From bb14ef396deb2b1bccc1e8d80da4bd47e3a04427 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 1 Sep 2025 13:50:19 +0000 Subject: [PATCH 001/193] chore: sync repo --- .editorconfig | 15 - .gitattributes | 10 - .github/workflows/ci.yml | 52 + .github/workflows/coverage.yml | 29 - .github/workflows/create-releases.yml | 30 + .github/workflows/release-doctor.yml | 21 + .github/workflows/test.yml | 31 - .github/workflows/wiki.yml | 24 - .gitignore | 51 +- .php-cs-fixer.dist.php | 17 + .phpactor.json | 6 + .release-please-manifest.json | 3 + .stats.yml | 4 + DEVELOPMENT.md | 25 - LICENSE | 221 +- README.md | 1277 +-------- SECURITY.md | 27 + bin/check-release-environment | 29 + composer.json | 89 +- composer.lock | 2395 ----------------- phpstan.dist.neon | 14 + phpunit.xml.dist | 31 +- release-please-config.json | 66 + sample/README.md | 15 - sample/file_management/index.php | 319 --- sample/metadata/index.php | 62 - sample/sample.php | 31 - sample/sample_image.jpeg | Bin 62767 -> 0 bytes sample/upload_api/index.php | 87 - sample/upload_api/sample_image.jpeg | Bin 62767 -> 0 bytes .../chained_transformations.php | 54 - ...age_enhancement_and_color_manipulation.php | 105 - sample/url_generation/index.php | 11 - ...size_crop_other_common_transformations.php | 521 ---- sample/url_generation/signed_url.php | 27 - sample/utility/index.php | 26 - scripts/bootstrap | 8 + scripts/clean | 8 + scripts/format | 8 + scripts/lint | 8 + scripts/mock | 41 + scripts/test | 55 + src/Accounts/Origins/OriginCreateParams.php | 87 + src/Accounts/Origins/OriginRequest.php | 48 + .../Origins/OriginRequest/AkeneoPim.php | 231 ++ .../Origins/OriginRequest/AzureBlob.php | 178 ++ .../OriginRequest/CloudinaryBackup.php | 202 ++ src/Accounts/Origins/OriginRequest/Gcs.php | 178 ++ src/Accounts/Origins/OriginRequest/S3.php | 198 ++ .../Origins/OriginRequest/S3Compatible.php | 245 ++ .../Origins/OriginRequest/WebFolder.php | 159 ++ .../Origins/OriginRequest/WebProxy.php | 118 + src/Accounts/Origins/OriginResponse.php | 48 + .../Origins/OriginResponse/AkeneoPim.php | 162 ++ .../Origins/OriginResponse/AzureBlob.php | 193 ++ .../OriginResponse/CloudinaryBackup.php | 185 ++ src/Accounts/Origins/OriginResponse/Gcs.php | 193 ++ src/Accounts/Origins/OriginResponse/S3.php | 185 ++ .../Origins/OriginResponse/S3Compatible.php | 233 ++ .../Origins/OriginResponse/WebFolder.php | 190 ++ .../Origins/OriginResponse/WebProxy.php | 138 + src/Accounts/Origins/OriginUpdateParams.php | 87 + .../URLEndpoints/URLEndpointCreateParams.php | 149 + .../URLEndpointCreateParams/URLRewriter.php | 38 + .../URLRewriter/Akamai.php | 36 + .../URLRewriter/Cloudinary.php | 60 + .../URLRewriter/Imgix.php | 36 + .../URLEndpoints/URLEndpointRequest.php | 144 + .../URLEndpointRequest/URLRewriter.php | 38 + .../URLEndpointRequest/URLRewriter/Akamai.php | 36 + .../URLRewriter/Cloudinary.php | 60 + .../URLEndpointRequest/URLRewriter/Imgix.php | 36 + .../URLEndpoints/URLEndpointResponse.php | 170 ++ .../URLEndpointResponse/URLRewriter.php | 38 + .../URLRewriter/Akamai.php | 36 + .../URLRewriter/Cloudinary.php | 74 + .../URLEndpointResponse/URLRewriter/Imgix.php | 36 + .../URLEndpoints/URLEndpointUpdateParams.php | 149 + .../URLEndpointUpdateParams/URLRewriter.php | 38 + .../URLRewriter/Akamai.php | 36 + .../URLRewriter/Cloudinary.php | 60 + .../URLRewriter/Imgix.php | 36 + src/Accounts/Usage/UsageGetParams.php | 96 + src/Accounts/Usage/UsageGetResponse.php | 140 + src/Assets/AssetListParams.php | 242 ++ src/Assets/AssetListParams/FileType.php | 26 + src/Assets/AssetListParams/Sort.php | 44 + src/Assets/AssetListParams/Type.php | 29 + src/Assets/AssetListResponseItem.php | 33 + src/BaseOverlay.php | 64 + src/Beta/V2/Files/FileUploadParams.php | 571 ++++ .../V2/Files/FileUploadParams/Extension.php | 35 + .../Extension/AIAutoDescription.php | 39 + .../Extension/AutoTaggingExtension.php | 119 + .../Extension/AutoTaggingExtension/Name.php | 20 + .../FileUploadParams/Extension/RemoveBg.php | 55 + .../Extension/RemoveBg/Options.php | 117 + .../Files/FileUploadParams/ResponseField.php | 27 + .../Files/FileUploadParams/Transformation.php | 99 + .../FileUploadParams/Transformation/Post.php | 37 + .../Transformation/Post/Abs.php | 101 + .../Transformation/Post/Abs/Protocol.php | 20 + .../Transformation/Post/GifToVideo.php | 62 + .../Transformation/Post/Thumbnail.php | 62 + .../Transformation/Post/Transformation.php | 76 + src/Beta/V2/Files/FileUploadResponse.php | 556 ++++ .../V2/Files/FileUploadResponse/AITag.php | 95 + .../FileUploadResponse/ExtensionStatus.php | 126 + .../ExtensionStatus/AIAutoDescription.php | 19 + .../ExtensionStatus/AwsAutoTagging.php | 19 + .../ExtensionStatus/GoogleAutoTagging.php | 19 + .../ExtensionStatus/RemoveBg.php | 19 + .../Files/FileUploadResponse/VersionInfo.php | 74 + .../Invalidation/InvalidationCreateParams.php | 74 + .../Invalidation/InvalidationGetResponse.php | 61 + .../InvalidationGetResponse/Status.php | 20 + .../Invalidation/InvalidationNewResponse.php | 54 + src/Client.php | 123 + src/Core.php | 9 + src/Core/Attributes/Api.php | 42 + src/Core/BaseClient.php | 222 ++ src/Core/Concerns/SdkEnum.php | 33 + src/Core/Concerns/SdkModel.php | 269 ++ src/Core/Concerns/SdkPage.php | 118 + src/Core/Concerns/SdkParams.php | 37 + src/Core/Concerns/SdkUnion.php | 40 + src/Core/Contracts/BaseModel.php | 18 + src/Core/Contracts/BasePage.php | 52 + src/Core/Contracts/BaseStream.php | 36 + src/Core/Conversion.php | 165 ++ src/Core/Conversion/CoerceState.php | 19 + src/Core/Conversion/Concerns/ArrayOf.php | 66 + src/Core/Conversion/Contracts/Converter.php | 24 + .../Conversion/Contracts/ConverterSource.php | 13 + src/Core/Conversion/DumpState.php | 15 + src/Core/Conversion/EnumOf.php | 46 + src/Core/Conversion/ListOf.php | 21 + src/Core/Conversion/MapOf.php | 16 + src/Core/Conversion/ModelOf.php | 128 + src/Core/Conversion/PropertyInfo.php | 76 + src/Core/Conversion/UnionOf.php | 96 + .../Exceptions/APIConnectionException.php | 9 + src/Core/Exceptions/APIException.php | 23 + src/Core/Exceptions/APIStatusException.php | 55 + src/Core/Exceptions/APITimeoutException.php | 19 + .../Exceptions/AuthenticationException.php | 9 + src/Core/Exceptions/BadRequestException.php | 9 + src/Core/Exceptions/ConflictException.php | 9 + src/Core/Exceptions/ImageKitException.php | 14 + .../Exceptions/InternalServerException.php | 9 + src/Core/Exceptions/NotFoundException.php | 9 + .../Exceptions/PermissionDeniedException.php | 9 + src/Core/Exceptions/RateLimitException.php | 9 + .../UnprocessableEntityException.php | 9 + src/Core/Implementation/Omit.php | 13 + .../Accounts/OriginsContract.php | 72 + .../Accounts/URLEndpointsContract.php | 77 + .../Accounts/UsageContract.php | 23 + .../ServiceContracts/AccountsContract.php | 7 + src/Core/ServiceContracts/AssetsContract.php | 61 + .../Beta/V2/FilesContract.php | 98 + src/Core/ServiceContracts/Beta/V2Contract.php | 7 + src/Core/ServiceContracts/BetaContract.php | 7 + .../Cache/InvalidationContract.php | 30 + src/Core/ServiceContracts/CacheContract.php | 7 + .../CustomMetadataFieldsContract.php | 63 + .../ServiceContracts/Files/BulkContract.php | 60 + .../Files/MetadataContract.php | 29 + .../Files/VersionsContract.php | 55 + src/Core/ServiceContracts/FilesContract.php | 206 ++ .../ServiceContracts/Folders/JobContract.php | 19 + src/Core/ServiceContracts/FoldersContract.php | 91 + .../ServiceContracts/WebhooksContract.php | 7 + src/Core/Services/Accounts/OriginsService.php | 149 + .../Services/Accounts/URLEndpointsService.php | 163 ++ src/Core/Services/Accounts/UsageService.php | 47 + src/Core/Services/AccountsService.php | 39 + src/Core/Services/AssetsService.php | 95 + src/Core/Services/Beta/V2/FilesService.php | 160 ++ src/Core/Services/Beta/V2Service.php | 25 + src/Core/Services/BetaService.php | 25 + .../Services/Cache/InvalidationService.php | 64 + src/Core/Services/CacheService.php | 25 + .../Services/CustomMetadataFieldsService.php | 132 + src/Core/Services/Files/BulkService.php | 139 + src/Core/Services/Files/MetadataService.php | 65 + src/Core/Services/Files/VersionsService.php | 129 + src/Core/Services/FilesService.php | 401 +++ src/Core/Services/Folders/JobService.php | 36 + src/Core/Services/FoldersService.php | 203 ++ src/Core/Services/WebhooksService.php | 16 + src/Core/Util.php | 445 +++ .../CustomMetadataField.php | 135 + .../CustomMetadataField/Schema.php | 234 ++ .../Schema/DefaultValue.php | 28 + .../Schema/DefaultValue/Mixed.php | 23 + .../CustomMetadataField/Schema/MaxValue.php | 26 + .../CustomMetadataField/Schema/MinValue.php | 26 + .../Schema/SelectOption.php | 23 + .../CustomMetadataField/Schema/Type.php | 30 + .../CustomMetadataFieldCreateParams.php | 113 + .../Schema.php | 232 ++ .../Schema/DefaultValue.php | 28 + .../Schema/DefaultValue/Mixed.php | 23 + .../Schema/MaxValue.php | 26 + .../Schema/MinValue.php | 26 + .../Schema/SelectOption.php | 23 + .../Schema/Type.php | 30 + .../CustomMetadataFieldDeleteResponse.php | 32 + .../CustomMetadataFieldListParams.php | 60 + .../CustomMetadataFieldUpdateParams.php | 83 + .../Schema.php | 193 ++ .../Schema/DefaultValue.php | 28 + .../Schema/DefaultValue/Mixed.php | 23 + .../Schema/MaxValue.php | 26 + .../Schema/MinValue.php | 26 + .../Schema/SelectOption.php | 23 + src/Files/Bulk/BulkAddTagsParams.php | 105 + src/Files/Bulk/BulkAddTagsResponse.php | 63 + src/Files/Bulk/BulkDeleteParams.php | 84 + src/Files/Bulk/BulkDeleteResponse.php | 63 + src/Files/Bulk/BulkRemoveAITagsParams.php | 105 + src/Files/Bulk/BulkRemoveAITagsResponse.php | 63 + src/Files/Bulk/BulkRemoveTagsParams.php | 105 + src/Files/Bulk/BulkRemoveTagsResponse.php | 63 + src/Files/File.php | 503 ++++ src/Files/File/AITag.php | 95 + src/Files/File/Type.php | 20 + src/Files/File/VersionInfo.php | 74 + src/Files/FileCopyParams.php | 118 + src/Files/FileCopyResponse.php | 32 + src/Files/FileMoveParams.php | 98 + src/Files/FileMoveResponse.php | 32 + src/Files/FileRenameParams.php | 144 + src/Files/FileRenameResponse.php | 54 + src/Files/FileUpdateParams.php | 60 + src/Files/FileUpdateParams/Update.php | 25 + .../Update/ChangePublicationStatus.php | 55 + .../ChangePublicationStatus/Publish.php | 93 + .../Update/UpdateFileDetails.php | 211 ++ .../Update/UpdateFileDetails/Extension.php | 35 + .../Extension/AIAutoDescription.php | 39 + .../Extension/AutoTaggingExtension.php | 119 + .../Extension/AutoTaggingExtension/Name.php | 20 + .../UpdateFileDetails/Extension/RemoveBg.php | 55 + .../Extension/RemoveBg/Options.php | 117 + .../Update/UpdateFileDetails/RemoveAITags.php | 31 + src/Files/FileUpdateResponse.php | 53 + .../FileUpdateResponse/ExtensionStatus.php | 118 + .../ExtensionStatus/AIAutoDescription.php | 19 + .../ExtensionStatus/AwsAutoTagging.php | 19 + .../ExtensionStatus/GoogleAutoTagging.php | 19 + .../ExtensionStatus/RemoveBg.php | 19 + src/Files/FileUploadParams.php | 655 +++++ src/Files/FileUploadParams/Extension.php | 35 + .../Extension/AIAutoDescription.php | 39 + .../Extension/AutoTaggingExtension.php | 119 + .../Extension/AutoTaggingExtension/Name.php | 20 + .../FileUploadParams/Extension/RemoveBg.php | 55 + .../Extension/RemoveBg/Options.php | 117 + src/Files/FileUploadParams/ResponseField.php | 27 + src/Files/FileUploadParams/Transformation.php | 99 + .../FileUploadParams/Transformation/Post.php | 37 + .../Transformation/Post/Abs.php | 101 + .../Transformation/Post/Abs/Protocol.php | 20 + .../Transformation/Post/GifToVideo.php | 62 + .../Transformation/Post/Thumbnail.php | 62 + .../Transformation/Post/Transformation.php | 76 + src/Files/FileUploadResponse.php | 555 ++++ src/Files/FileUploadResponse/AITag.php | 95 + .../FileUploadResponse/ExtensionStatus.php | 126 + .../ExtensionStatus/AIAutoDescription.php | 19 + .../ExtensionStatus/AwsAutoTagging.php | 19 + .../ExtensionStatus/GoogleAutoTagging.php | 19 + .../ExtensionStatus/RemoveBg.php | 19 + src/Files/FileUploadResponse/VersionInfo.php | 74 + src/Files/Folder.php | 164 ++ src/Files/Folder/Type.php | 18 + src/Files/Metadata.php | 314 +++ src/Files/Metadata/Exif.php | 163 ++ src/Files/Metadata/Exif/Exif.php | 406 +++ src/Files/Metadata/Exif/Gps.php | 56 + src/Files/Metadata/Exif/Image.php | 193 ++ src/Files/Metadata/Exif/Interoperability.php | 66 + src/Files/Metadata/Exif/Thumbnail.php | 123 + .../Metadata/MetadataGetFromURLParams.php | 74 + src/Files/Versions/VersionDeleteParams.php | 70 + src/Files/Versions/VersionDeleteResponse.php | 32 + src/Files/Versions/VersionGetParams.php | 68 + src/Files/Versions/VersionRestoreParams.php | 68 + src/Folders/FolderCopyParams.php | 116 + src/Folders/FolderCopyResponse.php | 70 + src/Folders/FolderCreateParams.php | 104 + src/Folders/FolderDeleteParams.php | 74 + src/Folders/FolderDeleteResponse.php | 32 + src/Folders/FolderMoveParams.php | 96 + src/Folders/FolderMoveResponse.php | 70 + src/Folders/FolderNewResponse.php | 32 + src/Folders/FolderRenameParams.php | 132 + src/Folders/FolderRenameResponse.php | 70 + src/Folders/Job/JobGetResponse.php | 130 + src/Folders/Job/JobGetResponse/Status.php | 20 + src/Folders/Job/JobGetResponse/Type.php | 22 + src/ImageKit/Configuration/Configuration.php | 30 - src/ImageKit/Constants/Endpoints.php | 263 -- src/ImageKit/Constants/ErrorMessages.php | 153 -- .../Constants/SupportedTransforms.php | 51 - src/ImageKit/ImageKit.php | 1205 --------- src/ImageKit/Manage/Cache.php | 89 - src/ImageKit/Manage/CustomMetadataFields.php | 242 -- src/ImageKit/Manage/File.php | 592 ---- src/ImageKit/Manage/Folder.php | 157 -- src/ImageKit/Phash/Phash.php | 52 - src/ImageKit/Resource/GuzzleHttpWrapper.php | 313 --- src/ImageKit/Resource/HttpRequest.php | 41 - src/ImageKit/Signature/Signature.php | 53 - src/ImageKit/Upload/Upload.php | 87 - src/ImageKit/Url/Url.php | 420 --- src/ImageKit/Utils/Authorization.php | 26 - src/ImageKit/Utils/Response.php | 71 - src/ImageKit/Utils/Transformation.php | 72 - src/ImageOverlay.php | 136 + src/ImageOverlay/Encoding.php | 25 + src/Overlay.php | 39 + src/OverlayPosition.php | 116 + src/OverlayPosition/Focus.php | 35 + src/OverlayPosition/X.php | 29 + src/OverlayPosition/Y.php | 29 + src/OverlayTiming.php | 117 + src/OverlayTiming/Duration.php | 29 + src/OverlayTiming/End.php | 30 + src/OverlayTiming/Start.php | 29 + src/RequestOptions.php | 219 ++ src/SolidColorOverlay.php | 106 + src/SolidColorOverlayTransformation.php | 165 ++ .../Gradient.php | 27 + .../Height.php | 27 + .../Radius.php | 27 + src/SolidColorOverlayTransformation/Width.php | 27 + src/SrcOptions.php | 243 ++ src/StreamingResolution.php | 30 + src/SubtitleOverlay.php | 134 + src/SubtitleOverlay/Encoding.php | 25 + src/SubtitleOverlayTransformation.php | 218 ++ .../Typography.php | 24 + src/TextOverlay.php | 134 + src/TextOverlay/Encoding.php | 25 + src/TextOverlayTransformation.php | 332 +++ src/TextOverlayTransformation/Flip.php | 24 + src/TextOverlayTransformation/FontSize.php | 26 + .../InnerAlignment.php | 22 + src/TextOverlayTransformation/LineHeight.php | 27 + src/TextOverlayTransformation/Padding.php | 28 + src/TextOverlayTransformation/Radius.php | 27 + src/TextOverlayTransformation/Rotation.php | 27 + src/TextOverlayTransformation/Width.php | 27 + src/Transformation.php | 1334 +++++++++ src/Transformation/AIDropShadow.php | 30 + src/Transformation/AIRemoveBackground.php | 20 + .../AIRemoveBackgroundExternal.php | 21 + src/Transformation/AIRetouch.php | 19 + src/Transformation/AIUpscale.php | 19 + src/Transformation/AIVariation.php | 20 + src/Transformation/AspectRatio.php | 28 + src/Transformation/AudioCodec.php | 22 + src/Transformation/ContrastStretch.php | 19 + src/Transformation/Crop.php | 26 + src/Transformation/CropMode.php | 22 + src/Transformation/Duration.php | 28 + src/Transformation/EndOffset.php | 28 + src/Transformation/Flip.php | 26 + src/Transformation/Format.php | 41 + src/Transformation/Gradient.php | 27 + src/Transformation/Grayscale.php | 18 + src/Transformation/Height.php | 28 + src/Transformation/Page.php | 29 + src/Transformation/Radius.php | 27 + src/Transformation/Rotation.php | 29 + src/Transformation/Shadow.php | 29 + src/Transformation/Sharpen.php | 28 + src/Transformation/StartOffset.php | 28 + src/Transformation/Trim.php | 28 + src/Transformation/UnsharpMask.php | 28 + src/Transformation/VideoCodec.php | 24 + src/Transformation/Width.php | 28 + src/Transformation/X.php | 26 + src/Transformation/XCenter.php | 26 + src/Transformation/Y.php | 26 + src/Transformation/YCenter.php | 26 + src/TransformationPosition.php | 22 + src/VideoOverlay.php | 136 + src/VideoOverlay/Encoding.php | 25 + src/Webhooks/UnsafeUnwrapWebhookEvent.php | 34 + src/Webhooks/UnwrapWebhookEvent.php | 34 + .../UploadPostTransformErrorEvent.php | 133 + .../UploadPostTransformErrorEvent/Data.php | 151 ++ .../Data/Transformation.php | 63 + .../Data/Transformation/Error.php | 68 + .../UploadPostTransformErrorEvent/Request.php | 85 + .../Request/Transformation.php | 123 + .../Request/Transformation/Protocol.php | 20 + .../Request/Transformation/Type.php | 24 + .../UploadPostTransformSuccessEvent.php | 133 + .../UploadPostTransformSuccessEvent/Data.php | 104 + .../Request.php | 85 + .../Request/Transformation.php | 123 + .../Request/Transformation/Protocol.php | 20 + .../Request/Transformation/Type.php | 24 + src/Webhooks/UploadPreTransformErrorEvent.php | 133 + .../UploadPreTransformErrorEvent/Data.php | 104 + .../Data/Transformation.php | 63 + .../Data/Transformation/Error.php | 68 + .../UploadPreTransformErrorEvent/Request.php | 88 + .../UploadPreTransformSuccessEvent.php | 139 + .../UploadPreTransformSuccessEvent/Data.php | 556 ++++ .../Data/AITag.php | 95 + .../Data/ExtensionStatus.php | 126 + .../ExtensionStatus/AIAutoDescription.php | 19 + .../Data/ExtensionStatus/AwsAutoTagging.php | 19 + .../ExtensionStatus/GoogleAutoTagging.php | 19 + .../Data/ExtensionStatus/RemoveBg.php | 19 + .../Data/VersionInfo.php | 74 + .../Request.php | 88 + .../VideoTransformationAcceptedEvent.php | 139 + .../VideoTransformationAcceptedEvent/Data.php | 90 + .../Data/Asset.php | 70 + .../Data/Transformation.php | 105 + .../Data/Transformation/Options.php | 209 ++ .../Transformation/Options/AudioCodec.php | 20 + .../Data/Transformation/Options/Format.php | 26 + .../Transformation/Options/StreamProtocol.php | 20 + .../Transformation/Options/VideoCodec.php | 22 + .../Data/Transformation/Type.php | 25 + .../Request.php | 112 + .../VideoTransformationErrorEvent.php | 139 + .../VideoTransformationErrorEvent/Data.php | 84 + .../Data/Asset.php | 70 + .../Data/Transformation.php | 125 + .../Data/Transformation/Error.php | 83 + .../Data/Transformation/Error/Reason.php | 25 + .../Data/Transformation/Options.php | 209 ++ .../Transformation/Options/AudioCodec.php | 20 + .../Data/Transformation/Options/Format.php | 26 + .../Transformation/Options/StreamProtocol.php | 20 + .../Transformation/Options/VideoCodec.php | 22 + .../Data/Transformation/Type.php | 25 + .../VideoTransformationErrorEvent/Request.php | 112 + .../VideoTransformationReadyEvent.php | 161 ++ .../VideoTransformationReadyEvent/Data.php | 84 + .../Data/Asset.php | 70 + .../Data/Transformation.php | 125 + .../Data/Transformation/Options.php | 209 ++ .../Transformation/Options/AudioCodec.php | 20 + .../Data/Transformation/Options/Format.php | 26 + .../Transformation/Options/StreamProtocol.php | 20 + .../Transformation/Options/VideoCodec.php | 22 + .../Data/Transformation/Output.php | 94 + .../Transformation/Output/VideoMetadata.php | 134 + .../Data/Transformation/Type.php | 25 + .../VideoTransformationReadyEvent/Request.php | 112 + .../VideoTransformationReadyEvent/Timings.php | 78 + tests/Core/TestModel.php | 180 ++ tests/ImageKit/ImageKitTest.php | 337 --- tests/ImageKit/Manage/CacheTest.php | 192 -- tests/ImageKit/Manage/CustomMetadataTest.php | 627 ----- tests/ImageKit/Manage/FileTest.php | 2035 -------------- tests/ImageKit/Manage/FolderTest.php | 565 ---- tests/ImageKit/Phash/PhashTest.php | 55 - .../Resource/GuzzleHttpWrapperTest.php | 41 - tests/ImageKit/Upload/UploadTest.php | 856 ------ tests/ImageKit/Url/UrlTest.php | 1283 --------- tests/Services/Accounts/OriginsTest.php | 153 ++ tests/Services/Accounts/URLEndpointsTest.php | 126 + tests/Services/Accounts/UsageTest.php | 62 + tests/Services/AssetsTest.php | 44 + tests/Services/Beta/V2/FilesTest.php | 62 + tests/Services/Cache/InvalidationTest.php | 72 + tests/Services/CustomMetadataFieldsTest.php | 108 + tests/Services/Files/BulkTest.php | 150 ++ tests/Services/Files/MetadataTest.php | 68 + tests/Services/Files/VersionsTest.php | 116 + tests/Services/FilesTest.php | 182 ++ tests/Services/Folders/JobTest.php | 44 + tests/Services/FoldersTest.php | 176 ++ tests/Services/WebhooksTest.php | 30 + tests/UnsupportedMockTests.php | 8 + 486 files changed, 35764 insertions(+), 14977 deletions(-) delete mode 100644 .editorconfig create mode 100644 .github/workflows/ci.yml delete mode 100644 .github/workflows/coverage.yml create mode 100644 .github/workflows/create-releases.yml create mode 100644 .github/workflows/release-doctor.yml delete mode 100644 .github/workflows/test.yml delete mode 100644 .github/workflows/wiki.yml create mode 100644 .php-cs-fixer.dist.php create mode 100644 .phpactor.json create mode 100644 .release-please-manifest.json create mode 100644 .stats.yml delete mode 100644 DEVELOPMENT.md create mode 100644 SECURITY.md create mode 100644 bin/check-release-environment delete mode 100644 composer.lock create mode 100644 phpstan.dist.neon create mode 100644 release-please-config.json delete mode 100644 sample/README.md delete mode 100644 sample/file_management/index.php delete mode 100644 sample/metadata/index.php delete mode 100644 sample/sample.php delete mode 100644 sample/sample_image.jpeg delete mode 100644 sample/upload_api/index.php delete mode 100644 sample/upload_api/sample_image.jpeg delete mode 100644 sample/url_generation/chained_transformations.php delete mode 100644 sample/url_generation/image_enhancement_and_color_manipulation.php delete mode 100644 sample/url_generation/index.php delete mode 100644 sample/url_generation/resize_crop_other_common_transformations.php delete mode 100644 sample/url_generation/signed_url.php delete mode 100644 sample/utility/index.php create mode 100755 scripts/bootstrap create mode 100755 scripts/clean create mode 100755 scripts/format create mode 100755 scripts/lint create mode 100755 scripts/mock create mode 100755 scripts/test create mode 100644 src/Accounts/Origins/OriginCreateParams.php create mode 100644 src/Accounts/Origins/OriginRequest.php create mode 100644 src/Accounts/Origins/OriginRequest/AkeneoPim.php create mode 100644 src/Accounts/Origins/OriginRequest/AzureBlob.php create mode 100644 src/Accounts/Origins/OriginRequest/CloudinaryBackup.php create mode 100644 src/Accounts/Origins/OriginRequest/Gcs.php create mode 100644 src/Accounts/Origins/OriginRequest/S3.php create mode 100644 src/Accounts/Origins/OriginRequest/S3Compatible.php create mode 100644 src/Accounts/Origins/OriginRequest/WebFolder.php create mode 100644 src/Accounts/Origins/OriginRequest/WebProxy.php create mode 100644 src/Accounts/Origins/OriginResponse.php create mode 100644 src/Accounts/Origins/OriginResponse/AkeneoPim.php create mode 100644 src/Accounts/Origins/OriginResponse/AzureBlob.php create mode 100644 src/Accounts/Origins/OriginResponse/CloudinaryBackup.php create mode 100644 src/Accounts/Origins/OriginResponse/Gcs.php create mode 100644 src/Accounts/Origins/OriginResponse/S3.php create mode 100644 src/Accounts/Origins/OriginResponse/S3Compatible.php create mode 100644 src/Accounts/Origins/OriginResponse/WebFolder.php create mode 100644 src/Accounts/Origins/OriginResponse/WebProxy.php create mode 100644 src/Accounts/Origins/OriginUpdateParams.php create mode 100644 src/Accounts/URLEndpoints/URLEndpointCreateParams.php create mode 100644 src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php create mode 100644 src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php create mode 100644 src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php create mode 100644 src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php create mode 100644 src/Accounts/URLEndpoints/URLEndpointRequest.php create mode 100644 src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php create mode 100644 src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php create mode 100644 src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php create mode 100644 src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php create mode 100644 src/Accounts/URLEndpoints/URLEndpointResponse.php create mode 100644 src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php create mode 100644 src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php create mode 100644 src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php create mode 100644 src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php create mode 100644 src/Accounts/URLEndpoints/URLEndpointUpdateParams.php create mode 100644 src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php create mode 100644 src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php create mode 100644 src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php create mode 100644 src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php create mode 100644 src/Accounts/Usage/UsageGetParams.php create mode 100644 src/Accounts/Usage/UsageGetResponse.php create mode 100644 src/Assets/AssetListParams.php create mode 100644 src/Assets/AssetListParams/FileType.php create mode 100644 src/Assets/AssetListParams/Sort.php create mode 100644 src/Assets/AssetListParams/Type.php create mode 100644 src/Assets/AssetListResponseItem.php create mode 100644 src/BaseOverlay.php create mode 100644 src/Beta/V2/Files/FileUploadParams.php create mode 100644 src/Beta/V2/Files/FileUploadParams/Extension.php create mode 100644 src/Beta/V2/Files/FileUploadParams/Extension/AIAutoDescription.php create mode 100644 src/Beta/V2/Files/FileUploadParams/Extension/AutoTaggingExtension.php create mode 100644 src/Beta/V2/Files/FileUploadParams/Extension/AutoTaggingExtension/Name.php create mode 100644 src/Beta/V2/Files/FileUploadParams/Extension/RemoveBg.php create mode 100644 src/Beta/V2/Files/FileUploadParams/Extension/RemoveBg/Options.php create mode 100644 src/Beta/V2/Files/FileUploadParams/ResponseField.php create mode 100644 src/Beta/V2/Files/FileUploadParams/Transformation.php create mode 100644 src/Beta/V2/Files/FileUploadParams/Transformation/Post.php create mode 100644 src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php create mode 100644 src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php create mode 100644 src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php create mode 100644 src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php create mode 100644 src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php create mode 100644 src/Beta/V2/Files/FileUploadResponse.php create mode 100644 src/Beta/V2/Files/FileUploadResponse/AITag.php create mode 100644 src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php create mode 100644 src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php create mode 100644 src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php create mode 100644 src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php create mode 100644 src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php create mode 100644 src/Beta/V2/Files/FileUploadResponse/VersionInfo.php create mode 100644 src/Cache/Invalidation/InvalidationCreateParams.php create mode 100644 src/Cache/Invalidation/InvalidationGetResponse.php create mode 100644 src/Cache/Invalidation/InvalidationGetResponse/Status.php create mode 100644 src/Cache/Invalidation/InvalidationNewResponse.php create mode 100644 src/Client.php create mode 100644 src/Core.php create mode 100644 src/Core/Attributes/Api.php create mode 100644 src/Core/BaseClient.php create mode 100644 src/Core/Concerns/SdkEnum.php create mode 100644 src/Core/Concerns/SdkModel.php create mode 100644 src/Core/Concerns/SdkPage.php create mode 100644 src/Core/Concerns/SdkParams.php create mode 100644 src/Core/Concerns/SdkUnion.php create mode 100644 src/Core/Contracts/BaseModel.php create mode 100644 src/Core/Contracts/BasePage.php create mode 100644 src/Core/Contracts/BaseStream.php create mode 100644 src/Core/Conversion.php create mode 100644 src/Core/Conversion/CoerceState.php create mode 100644 src/Core/Conversion/Concerns/ArrayOf.php create mode 100644 src/Core/Conversion/Contracts/Converter.php create mode 100644 src/Core/Conversion/Contracts/ConverterSource.php create mode 100644 src/Core/Conversion/DumpState.php create mode 100644 src/Core/Conversion/EnumOf.php create mode 100644 src/Core/Conversion/ListOf.php create mode 100644 src/Core/Conversion/MapOf.php create mode 100644 src/Core/Conversion/ModelOf.php create mode 100644 src/Core/Conversion/PropertyInfo.php create mode 100644 src/Core/Conversion/UnionOf.php create mode 100644 src/Core/Exceptions/APIConnectionException.php create mode 100644 src/Core/Exceptions/APIException.php create mode 100644 src/Core/Exceptions/APIStatusException.php create mode 100644 src/Core/Exceptions/APITimeoutException.php create mode 100644 src/Core/Exceptions/AuthenticationException.php create mode 100644 src/Core/Exceptions/BadRequestException.php create mode 100644 src/Core/Exceptions/ConflictException.php create mode 100644 src/Core/Exceptions/ImageKitException.php create mode 100644 src/Core/Exceptions/InternalServerException.php create mode 100644 src/Core/Exceptions/NotFoundException.php create mode 100644 src/Core/Exceptions/PermissionDeniedException.php create mode 100644 src/Core/Exceptions/RateLimitException.php create mode 100644 src/Core/Exceptions/UnprocessableEntityException.php create mode 100644 src/Core/Implementation/Omit.php create mode 100644 src/Core/ServiceContracts/Accounts/OriginsContract.php create mode 100644 src/Core/ServiceContracts/Accounts/URLEndpointsContract.php create mode 100644 src/Core/ServiceContracts/Accounts/UsageContract.php create mode 100644 src/Core/ServiceContracts/AccountsContract.php create mode 100644 src/Core/ServiceContracts/AssetsContract.php create mode 100644 src/Core/ServiceContracts/Beta/V2/FilesContract.php create mode 100644 src/Core/ServiceContracts/Beta/V2Contract.php create mode 100644 src/Core/ServiceContracts/BetaContract.php create mode 100644 src/Core/ServiceContracts/Cache/InvalidationContract.php create mode 100644 src/Core/ServiceContracts/CacheContract.php create mode 100644 src/Core/ServiceContracts/CustomMetadataFieldsContract.php create mode 100644 src/Core/ServiceContracts/Files/BulkContract.php create mode 100644 src/Core/ServiceContracts/Files/MetadataContract.php create mode 100644 src/Core/ServiceContracts/Files/VersionsContract.php create mode 100644 src/Core/ServiceContracts/FilesContract.php create mode 100644 src/Core/ServiceContracts/Folders/JobContract.php create mode 100644 src/Core/ServiceContracts/FoldersContract.php create mode 100644 src/Core/ServiceContracts/WebhooksContract.php create mode 100644 src/Core/Services/Accounts/OriginsService.php create mode 100644 src/Core/Services/Accounts/URLEndpointsService.php create mode 100644 src/Core/Services/Accounts/UsageService.php create mode 100644 src/Core/Services/AccountsService.php create mode 100644 src/Core/Services/AssetsService.php create mode 100644 src/Core/Services/Beta/V2/FilesService.php create mode 100644 src/Core/Services/Beta/V2Service.php create mode 100644 src/Core/Services/BetaService.php create mode 100644 src/Core/Services/Cache/InvalidationService.php create mode 100644 src/Core/Services/CacheService.php create mode 100644 src/Core/Services/CustomMetadataFieldsService.php create mode 100644 src/Core/Services/Files/BulkService.php create mode 100644 src/Core/Services/Files/MetadataService.php create mode 100644 src/Core/Services/Files/VersionsService.php create mode 100644 src/Core/Services/FilesService.php create mode 100644 src/Core/Services/Folders/JobService.php create mode 100644 src/Core/Services/FoldersService.php create mode 100644 src/Core/Services/WebhooksService.php create mode 100644 src/Core/Util.php create mode 100644 src/CustomMetadataFields/CustomMetadataField.php create mode 100644 src/CustomMetadataFields/CustomMetadataField/Schema.php create mode 100644 src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php create mode 100644 src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed.php create mode 100644 src/CustomMetadataFields/CustomMetadataField/Schema/MaxValue.php create mode 100644 src/CustomMetadataFields/CustomMetadataField/Schema/MinValue.php create mode 100644 src/CustomMetadataFields/CustomMetadataField/Schema/SelectOption.php create mode 100644 src/CustomMetadataFields/CustomMetadataField/Schema/Type.php create mode 100644 src/CustomMetadataFields/CustomMetadataFieldCreateParams.php create mode 100644 src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php create mode 100644 src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php create mode 100644 src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed.php create mode 100644 src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MaxValue.php create mode 100644 src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MinValue.php create mode 100644 src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/SelectOption.php create mode 100644 src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/Type.php create mode 100644 src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php create mode 100644 src/CustomMetadataFields/CustomMetadataFieldListParams.php create mode 100644 src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php create mode 100644 src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php create mode 100644 src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php create mode 100644 src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed.php create mode 100644 src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MaxValue.php create mode 100644 src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MinValue.php create mode 100644 src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/SelectOption.php create mode 100644 src/Files/Bulk/BulkAddTagsParams.php create mode 100644 src/Files/Bulk/BulkAddTagsResponse.php create mode 100644 src/Files/Bulk/BulkDeleteParams.php create mode 100644 src/Files/Bulk/BulkDeleteResponse.php create mode 100644 src/Files/Bulk/BulkRemoveAITagsParams.php create mode 100644 src/Files/Bulk/BulkRemoveAITagsResponse.php create mode 100644 src/Files/Bulk/BulkRemoveTagsParams.php create mode 100644 src/Files/Bulk/BulkRemoveTagsResponse.php create mode 100644 src/Files/File.php create mode 100644 src/Files/File/AITag.php create mode 100644 src/Files/File/Type.php create mode 100644 src/Files/File/VersionInfo.php create mode 100644 src/Files/FileCopyParams.php create mode 100644 src/Files/FileCopyResponse.php create mode 100644 src/Files/FileMoveParams.php create mode 100644 src/Files/FileMoveResponse.php create mode 100644 src/Files/FileRenameParams.php create mode 100644 src/Files/FileRenameResponse.php create mode 100644 src/Files/FileUpdateParams.php create mode 100644 src/Files/FileUpdateParams/Update.php create mode 100644 src/Files/FileUpdateParams/Update/ChangePublicationStatus.php create mode 100644 src/Files/FileUpdateParams/Update/ChangePublicationStatus/Publish.php create mode 100644 src/Files/FileUpdateParams/Update/UpdateFileDetails.php create mode 100644 src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension.php create mode 100644 src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/AIAutoDescription.php create mode 100644 src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/AutoTaggingExtension.php create mode 100644 src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/AutoTaggingExtension/Name.php create mode 100644 src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/RemoveBg.php create mode 100644 src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/RemoveBg/Options.php create mode 100644 src/Files/FileUpdateParams/Update/UpdateFileDetails/RemoveAITags.php create mode 100644 src/Files/FileUpdateResponse.php create mode 100644 src/Files/FileUpdateResponse/ExtensionStatus.php create mode 100644 src/Files/FileUpdateResponse/ExtensionStatus/AIAutoDescription.php create mode 100644 src/Files/FileUpdateResponse/ExtensionStatus/AwsAutoTagging.php create mode 100644 src/Files/FileUpdateResponse/ExtensionStatus/GoogleAutoTagging.php create mode 100644 src/Files/FileUpdateResponse/ExtensionStatus/RemoveBg.php create mode 100644 src/Files/FileUploadParams.php create mode 100644 src/Files/FileUploadParams/Extension.php create mode 100644 src/Files/FileUploadParams/Extension/AIAutoDescription.php create mode 100644 src/Files/FileUploadParams/Extension/AutoTaggingExtension.php create mode 100644 src/Files/FileUploadParams/Extension/AutoTaggingExtension/Name.php create mode 100644 src/Files/FileUploadParams/Extension/RemoveBg.php create mode 100644 src/Files/FileUploadParams/Extension/RemoveBg/Options.php create mode 100644 src/Files/FileUploadParams/ResponseField.php create mode 100644 src/Files/FileUploadParams/Transformation.php create mode 100644 src/Files/FileUploadParams/Transformation/Post.php create mode 100644 src/Files/FileUploadParams/Transformation/Post/Abs.php create mode 100644 src/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php create mode 100644 src/Files/FileUploadParams/Transformation/Post/GifToVideo.php create mode 100644 src/Files/FileUploadParams/Transformation/Post/Thumbnail.php create mode 100644 src/Files/FileUploadParams/Transformation/Post/Transformation.php create mode 100644 src/Files/FileUploadResponse.php create mode 100644 src/Files/FileUploadResponse/AITag.php create mode 100644 src/Files/FileUploadResponse/ExtensionStatus.php create mode 100644 src/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php create mode 100644 src/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php create mode 100644 src/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php create mode 100644 src/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php create mode 100644 src/Files/FileUploadResponse/VersionInfo.php create mode 100644 src/Files/Folder.php create mode 100644 src/Files/Folder/Type.php create mode 100644 src/Files/Metadata.php create mode 100644 src/Files/Metadata/Exif.php create mode 100644 src/Files/Metadata/Exif/Exif.php create mode 100644 src/Files/Metadata/Exif/Gps.php create mode 100644 src/Files/Metadata/Exif/Image.php create mode 100644 src/Files/Metadata/Exif/Interoperability.php create mode 100644 src/Files/Metadata/Exif/Thumbnail.php create mode 100644 src/Files/Metadata/MetadataGetFromURLParams.php create mode 100644 src/Files/Versions/VersionDeleteParams.php create mode 100644 src/Files/Versions/VersionDeleteResponse.php create mode 100644 src/Files/Versions/VersionGetParams.php create mode 100644 src/Files/Versions/VersionRestoreParams.php create mode 100644 src/Folders/FolderCopyParams.php create mode 100644 src/Folders/FolderCopyResponse.php create mode 100644 src/Folders/FolderCreateParams.php create mode 100644 src/Folders/FolderDeleteParams.php create mode 100644 src/Folders/FolderDeleteResponse.php create mode 100644 src/Folders/FolderMoveParams.php create mode 100644 src/Folders/FolderMoveResponse.php create mode 100644 src/Folders/FolderNewResponse.php create mode 100644 src/Folders/FolderRenameParams.php create mode 100644 src/Folders/FolderRenameResponse.php create mode 100644 src/Folders/Job/JobGetResponse.php create mode 100644 src/Folders/Job/JobGetResponse/Status.php create mode 100644 src/Folders/Job/JobGetResponse/Type.php delete mode 100644 src/ImageKit/Configuration/Configuration.php delete mode 100644 src/ImageKit/Constants/Endpoints.php delete mode 100644 src/ImageKit/Constants/ErrorMessages.php delete mode 100644 src/ImageKit/Constants/SupportedTransforms.php delete mode 100644 src/ImageKit/ImageKit.php delete mode 100644 src/ImageKit/Manage/Cache.php delete mode 100644 src/ImageKit/Manage/CustomMetadataFields.php delete mode 100644 src/ImageKit/Manage/File.php delete mode 100644 src/ImageKit/Manage/Folder.php delete mode 100644 src/ImageKit/Phash/Phash.php delete mode 100644 src/ImageKit/Resource/GuzzleHttpWrapper.php delete mode 100644 src/ImageKit/Resource/HttpRequest.php delete mode 100644 src/ImageKit/Signature/Signature.php delete mode 100644 src/ImageKit/Upload/Upload.php delete mode 100644 src/ImageKit/Url/Url.php delete mode 100644 src/ImageKit/Utils/Authorization.php delete mode 100644 src/ImageKit/Utils/Response.php delete mode 100644 src/ImageKit/Utils/Transformation.php create mode 100644 src/ImageOverlay.php create mode 100644 src/ImageOverlay/Encoding.php create mode 100644 src/Overlay.php create mode 100644 src/OverlayPosition.php create mode 100644 src/OverlayPosition/Focus.php create mode 100644 src/OverlayPosition/X.php create mode 100644 src/OverlayPosition/Y.php create mode 100644 src/OverlayTiming.php create mode 100644 src/OverlayTiming/Duration.php create mode 100644 src/OverlayTiming/End.php create mode 100644 src/OverlayTiming/Start.php create mode 100644 src/RequestOptions.php create mode 100644 src/SolidColorOverlay.php create mode 100644 src/SolidColorOverlayTransformation.php create mode 100644 src/SolidColorOverlayTransformation/Gradient.php create mode 100644 src/SolidColorOverlayTransformation/Height.php create mode 100644 src/SolidColorOverlayTransformation/Radius.php create mode 100644 src/SolidColorOverlayTransformation/Width.php create mode 100644 src/SrcOptions.php create mode 100644 src/StreamingResolution.php create mode 100644 src/SubtitleOverlay.php create mode 100644 src/SubtitleOverlay/Encoding.php create mode 100644 src/SubtitleOverlayTransformation.php create mode 100644 src/SubtitleOverlayTransformation/Typography.php create mode 100644 src/TextOverlay.php create mode 100644 src/TextOverlay/Encoding.php create mode 100644 src/TextOverlayTransformation.php create mode 100644 src/TextOverlayTransformation/Flip.php create mode 100644 src/TextOverlayTransformation/FontSize.php create mode 100644 src/TextOverlayTransformation/InnerAlignment.php create mode 100644 src/TextOverlayTransformation/LineHeight.php create mode 100644 src/TextOverlayTransformation/Padding.php create mode 100644 src/TextOverlayTransformation/Radius.php create mode 100644 src/TextOverlayTransformation/Rotation.php create mode 100644 src/TextOverlayTransformation/Width.php create mode 100644 src/Transformation.php create mode 100644 src/Transformation/AIDropShadow.php create mode 100644 src/Transformation/AIRemoveBackground.php create mode 100644 src/Transformation/AIRemoveBackgroundExternal.php create mode 100644 src/Transformation/AIRetouch.php create mode 100644 src/Transformation/AIUpscale.php create mode 100644 src/Transformation/AIVariation.php create mode 100644 src/Transformation/AspectRatio.php create mode 100644 src/Transformation/AudioCodec.php create mode 100644 src/Transformation/ContrastStretch.php create mode 100644 src/Transformation/Crop.php create mode 100644 src/Transformation/CropMode.php create mode 100644 src/Transformation/Duration.php create mode 100644 src/Transformation/EndOffset.php create mode 100644 src/Transformation/Flip.php create mode 100644 src/Transformation/Format.php create mode 100644 src/Transformation/Gradient.php create mode 100644 src/Transformation/Grayscale.php create mode 100644 src/Transformation/Height.php create mode 100644 src/Transformation/Page.php create mode 100644 src/Transformation/Radius.php create mode 100644 src/Transformation/Rotation.php create mode 100644 src/Transformation/Shadow.php create mode 100644 src/Transformation/Sharpen.php create mode 100644 src/Transformation/StartOffset.php create mode 100644 src/Transformation/Trim.php create mode 100644 src/Transformation/UnsharpMask.php create mode 100644 src/Transformation/VideoCodec.php create mode 100644 src/Transformation/Width.php create mode 100644 src/Transformation/X.php create mode 100644 src/Transformation/XCenter.php create mode 100644 src/Transformation/Y.php create mode 100644 src/Transformation/YCenter.php create mode 100644 src/TransformationPosition.php create mode 100644 src/VideoOverlay.php create mode 100644 src/VideoOverlay/Encoding.php create mode 100644 src/Webhooks/UnsafeUnwrapWebhookEvent.php create mode 100644 src/Webhooks/UnwrapWebhookEvent.php create mode 100644 src/Webhooks/UploadPostTransformErrorEvent.php create mode 100644 src/Webhooks/UploadPostTransformErrorEvent/Data.php create mode 100644 src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php create mode 100644 src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php create mode 100644 src/Webhooks/UploadPostTransformErrorEvent/Request.php create mode 100644 src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php create mode 100644 src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Protocol.php create mode 100644 src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Type.php create mode 100644 src/Webhooks/UploadPostTransformSuccessEvent.php create mode 100644 src/Webhooks/UploadPostTransformSuccessEvent/Data.php create mode 100644 src/Webhooks/UploadPostTransformSuccessEvent/Request.php create mode 100644 src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php create mode 100644 src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Protocol.php create mode 100644 src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Type.php create mode 100644 src/Webhooks/UploadPreTransformErrorEvent.php create mode 100644 src/Webhooks/UploadPreTransformErrorEvent/Data.php create mode 100644 src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php create mode 100644 src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php create mode 100644 src/Webhooks/UploadPreTransformErrorEvent/Request.php create mode 100644 src/Webhooks/UploadPreTransformSuccessEvent.php create mode 100644 src/Webhooks/UploadPreTransformSuccessEvent/Data.php create mode 100644 src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php create mode 100644 src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php create mode 100644 src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AIAutoDescription.php create mode 100644 src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AwsAutoTagging.php create mode 100644 src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/GoogleAutoTagging.php create mode 100644 src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/RemoveBg.php create mode 100644 src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php create mode 100644 src/Webhooks/UploadPreTransformSuccessEvent/Request.php create mode 100644 src/Webhooks/VideoTransformationAcceptedEvent.php create mode 100644 src/Webhooks/VideoTransformationAcceptedEvent/Data.php create mode 100644 src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php create mode 100644 src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php create mode 100644 src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php create mode 100644 src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/AudioCodec.php create mode 100644 src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/Format.php create mode 100644 src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/StreamProtocol.php create mode 100644 src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/VideoCodec.php create mode 100644 src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Type.php create mode 100644 src/Webhooks/VideoTransformationAcceptedEvent/Request.php create mode 100644 src/Webhooks/VideoTransformationErrorEvent.php create mode 100644 src/Webhooks/VideoTransformationErrorEvent/Data.php create mode 100644 src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php create mode 100644 src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php create mode 100644 src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php create mode 100644 src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error/Reason.php create mode 100644 src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php create mode 100644 src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/AudioCodec.php create mode 100644 src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/Format.php create mode 100644 src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/StreamProtocol.php create mode 100644 src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/VideoCodec.php create mode 100644 src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Type.php create mode 100644 src/Webhooks/VideoTransformationErrorEvent/Request.php create mode 100644 src/Webhooks/VideoTransformationReadyEvent.php create mode 100644 src/Webhooks/VideoTransformationReadyEvent/Data.php create mode 100644 src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php create mode 100644 src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php create mode 100644 src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php create mode 100644 src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/AudioCodec.php create mode 100644 src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/Format.php create mode 100644 src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/StreamProtocol.php create mode 100644 src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/VideoCodec.php create mode 100644 src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php create mode 100644 src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php create mode 100644 src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Type.php create mode 100644 src/Webhooks/VideoTransformationReadyEvent/Request.php create mode 100644 src/Webhooks/VideoTransformationReadyEvent/Timings.php create mode 100644 tests/Core/TestModel.php delete mode 100644 tests/ImageKit/ImageKitTest.php delete mode 100644 tests/ImageKit/Manage/CacheTest.php delete mode 100644 tests/ImageKit/Manage/CustomMetadataTest.php delete mode 100644 tests/ImageKit/Manage/FileTest.php delete mode 100644 tests/ImageKit/Manage/FolderTest.php delete mode 100644 tests/ImageKit/Phash/PhashTest.php delete mode 100644 tests/ImageKit/Resource/GuzzleHttpWrapperTest.php delete mode 100644 tests/ImageKit/Upload/UploadTest.php delete mode 100644 tests/ImageKit/Url/UrlTest.php create mode 100644 tests/Services/Accounts/OriginsTest.php create mode 100644 tests/Services/Accounts/URLEndpointsTest.php create mode 100644 tests/Services/Accounts/UsageTest.php create mode 100644 tests/Services/AssetsTest.php create mode 100644 tests/Services/Beta/V2/FilesTest.php create mode 100644 tests/Services/Cache/InvalidationTest.php create mode 100644 tests/Services/CustomMetadataFieldsTest.php create mode 100644 tests/Services/Files/BulkTest.php create mode 100644 tests/Services/Files/MetadataTest.php create mode 100644 tests/Services/Files/VersionsTest.php create mode 100644 tests/Services/FilesTest.php create mode 100644 tests/Services/Folders/JobTest.php create mode 100644 tests/Services/FoldersTest.php create mode 100644 tests/Services/WebhooksTest.php create mode 100644 tests/UnsupportedMockTests.php diff --git a/.editorconfig b/.editorconfig deleted file mode 100644 index e27be283..00000000 --- a/.editorconfig +++ /dev/null @@ -1,15 +0,0 @@ -# This file is for unifying the coding style for different editors and IDEs -# editorconfig.org - -root = true - -[*] -charset = utf-8 -end_of_line = lf -insert_final_newline = true -trim_trailing_whitespace = true -indent_style = space -indent_size = 4 - -[*.md] -trim_trailing_whitespace = false diff --git a/.gitattributes b/.gitattributes index 4c4dbe73..e69de29b 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,10 +0,0 @@ -# Path-based git attributes -# https://www.kernel.org/pub/software/scm/git/docs/gitattributes.html - -# Ignore all test and documentation with "export-ignore". -/.gitattributes export-ignore -/.gitignore export-ignore -/.travis.yml export-ignore -/phpunit.xml.dist export-ignore -/scrutinizer.yml export-ignore -/tests export-ignore diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..aed6777f --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,52 @@ +name: CI +on: + push: + branches-ignore: + - 'generated' + - 'codegen/**' + - 'integrated/**' + - 'stl-preview-head/**' + - 'stl-preview-base/**' + pull_request: + branches-ignore: + - 'stl-preview-head/**' + - 'stl-preview-base/**' + +jobs: + lint: + timeout-minutes: 10 + name: lint + runs-on: ${{ github.repository == 'stainless-sdks/imagekit-php' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + + steps: + - uses: actions/checkout@v4 + + - name: Set up PHP + uses: 'shivammathur/setup-php@v2' + with: + php-version: '8.3' + + - name: Run Bootstrap + run: ./scripts/bootstrap + + - name: Run lints + run: ./scripts/lint + test: + timeout-minutes: 10 + name: test + runs-on: ${{ github.repository == 'stainless-sdks/imagekit-php' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} + if: github.event_name == 'push' || github.event.pull_request.head.repo.fork + steps: + - uses: actions/checkout@v4 + + - name: Set up PHP + uses: 'shivammathur/setup-php@v2' + with: + php-version: '8.3' + + - name: Run bootstrap + run: ./scripts/bootstrap + + - name: Run tests + run: ./scripts/test diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml deleted file mode 100644 index 8cba38a5..00000000 --- a/.github/workflows/coverage.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: PHP Coverage CI - -on: [ push, pull_request ] - -jobs: - build: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v1 - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '8.0' - - - name: Validate composer.json and composer.lock - run: composer validate - - - name: Install dependencies - run: composer install --prefer-dist --no-progress --no-suggest - - # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" - # Docs: https://getcomposer.org/doc/articles/scripts.md - - - name: Run test suite - run: ./vendor/bin/phpunit --coverage-clover coverage.xml - - - name: Upload to codecov - run: bash <(curl -s https://codecov.io/bash) diff --git a/.github/workflows/create-releases.yml b/.github/workflows/create-releases.yml new file mode 100644 index 00000000..8e723adf --- /dev/null +++ b/.github/workflows/create-releases.yml @@ -0,0 +1,30 @@ +name: Create releases +on: + schedule: + - cron: '0 5 * * *' # every day at 5am UTC + push: + branches: + - main + +jobs: + release: + name: release + if: github.ref == 'refs/heads/main' && github.repository == 'stainless-sdks/imagekit-php' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: stainless-api/trigger-release-please@v1 + id: release + with: + repo: ${{ github.event.repository.full_name }} + stainless-api-key: ${{ secrets.STAINLESS_API_KEY }} + + - name: Publish to Packagist + if: ${{ steps.release.outputs.releases_created }} + run: |- + curl --fail-with-body -X POST -H 'Content-Type: application/json' "https://packagist.org/api/update-package?username=${PACKAGIST_USERNAME}&apiToken=${PACKAGIST_SAFE_KEY}" -d '{"repository":"https://www.github.com/stainless-sdks/imagekit-php"}' + env: + PACKAGIST_USERNAME: ${{ secrets.IMAGE_KIT_PACKAGIST_USERNAME || secrets.PACKAGIST_USERNAME }} + PACKAGIST_SAFE_KEY: ${{ secrets.IMAGE_KIT_PACKAGIST_SAFE_KEY || secrets.PACKAGIST_SAFE_KEY }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml new file mode 100644 index 00000000..c789d348 --- /dev/null +++ b/.github/workflows/release-doctor.yml @@ -0,0 +1,21 @@ +name: Release Doctor +on: + pull_request: + branches: + - main + workflow_dispatch: + +jobs: + release_doctor: + name: release doctor + runs-on: ubuntu-latest + if: github.repository == 'stainless-sdks/imagekit-php' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + + steps: + - uses: actions/checkout@v4 + + - name: Check release environment + run: | + bash ./bin/check-release-environment + env: + STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml deleted file mode 100644 index eded823b..00000000 --- a/.github/workflows/test.yml +++ /dev/null @@ -1,31 +0,0 @@ -name: PHP Test CI - -on: [ push, pull_request ] - -jobs: - build: - runs-on: ${{ matrix.operating-system }} - strategy: - matrix: - operating-system: [ 'ubuntu-latest', 'windows-latest', 'macos-latest' ] - php-versions: [ '5.6', '7.0', '7.1', '7.2', '7.3', '7.4', '8.0' ] - phpunit-versions: [ 'latest' ] - steps: - - uses: actions/checkout@v1 - - - name: Setup PHP - uses: shivammathur/setup-php@v2 - with: - php-version: '${{ matrix.php-versions }}' - - - name: Validate composer.json and composer.lock - run: composer validate - - - name: Install dependencies - run: composer install --prefer-dist --no-progress --no-suggest - - # Add a test script to composer.json, for instance: "test": "vendor/bin/phpunit" - # Docs: https://getcomposer.org/doc/articles/scripts.md - - - name: Run test suite - run: ./vendor/bin/phpunit diff --git a/.github/workflows/wiki.yml b/.github/workflows/wiki.yml deleted file mode 100644 index 85568a30..00000000 --- a/.github/workflows/wiki.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Automatic update project documentation - -on: - push: - branches: - - master - tags: - - '*' - -jobs: - update_wiki: - runs-on: ubuntu-latest - steps: - - name: Checkouting project code... - uses: actions/checkout@v2 - - name: Updating wiki... - uses: impresscms-dev/phpdocs-wiki-update-action@v1.0.0 - with: - wiki_github_update_token: ${{ secrets.WIKI_GITHUB_UPDATE_TOKEN }} - wiki_github_update_user: ${{ secrets.WIKI_GITHUB_UPDATE_USER }} - engine: clean/phpdoc-md - class_root_namespace: ImageKit - include: | - ImageKit\** diff --git a/.gitignore b/.gitignore index 5f842560..6739884e 100644 --- a/.gitignore +++ b/.gitignore @@ -1,42 +1,11 @@ -# IntelliJ - PhpStorm and PyCharm -.idea -*.iml -*.ipr -*.iws - -# Netbeans -nbproject -.nbproject -.nbproject/* -nbproject/* -nbproject/private/ -build/ -nbbuild/ -dist/ -nbdist/ -nbactions.xml -nb-configuration.xml - -# Mac OSX -.DS_Store -# Thumbnails -._* -# Files that might appear on external disk -.Spotlight-V100 -.Trashes - -# SublimeText project files -/*.sublime-project -*.sublime-workspace - -build -docs -vendor -composer.phar +composer.lock +docs/ +.idea/ +.php-cs-fixer.cache +.php-cs-fixer.php +.phpunit.cache phpunit.xml -.vscode -.phpunit* -sample/vendor -sample/composer.lock - -*.phar +playground/ +*.swo +*.swp +vendor/ diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 00000000..a2b062b9 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,17 @@ +setParallelConfig(ParallelConfigFactory::detect()) + ->setFinder(Finder::create()->in([__DIR__.'/src', __DIR__.'/tests'])) + ->setRules([ + '@PhpCsFixer' => true, + 'phpdoc_align' => false, + 'new_with_parentheses' => ['named_class' => false], + 'ordered_types' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], + 'phpdoc_types_order' => ['null_adjustment' => 'always_last', 'sort_algorithm' => 'none'], + ]) +; diff --git a/.phpactor.json b/.phpactor.json new file mode 100644 index 00000000..97fdd060 --- /dev/null +++ b/.phpactor.json @@ -0,0 +1,6 @@ +{ + "indexer.exclude_patterns": ["vendor"], + "language_server_completion.trim_leading_dollar": true, + "language_server_php_cs_fixer.enabled": false, + "language_server_phpstan.enabled": true +} diff --git a/.release-please-manifest.json b/.release-please-manifest.json new file mode 100644 index 00000000..1332969b --- /dev/null +++ b/.release-please-manifest.json @@ -0,0 +1,3 @@ +{ + ".": "0.0.1" +} \ No newline at end of file diff --git a/.stats.yml b/.stats.yml new file mode 100644 index 00000000..ad85869b --- /dev/null +++ b/.stats.yml @@ -0,0 +1,4 @@ +configured_endpoints: 42 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-3d7da4b8ef2ed30aa32c4fb3e98e498e67402e91aaa5fd4c628fc080bfe82ea1.yml +openapi_spec_hash: aaa50fcbccec6f2cf1165f34bc6ac886 +config_hash: cf9d50fe62973f4e91ef65c147aabcc1 diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md deleted file mode 100644 index 2f857ed7..00000000 --- a/DEVELOPMENT.md +++ /dev/null @@ -1,25 +0,0 @@ -## Installing dependencies - -Install the project dependencies by running the following command in terminal - -``` -composer install -``` - -## Running the tests - -``` -vendor/bin/phpunit -``` - -## Sample Code Instruction - -To run sample code go to the sample directory and run - -``` -php sample.php -``` - -## Support - -For any feedback or to report any issues or general implementation support, please reach out to [support@imagekit.io](mailto:support@imagekit.io) \ No newline at end of file diff --git a/LICENSE b/LICENSE index 8b976bea..e7a4d160 100644 --- a/LICENSE +++ b/LICENSE @@ -1,20 +1,201 @@ -MIT License - -Copyright (c) 2020 Imagekit - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright 2025 Image Kit + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/README.md b/README.md index 69c9d458..4a52aaa4 100644 --- a/README.md +++ b/README.md @@ -1,1238 +1,187 @@ -# PHP SDK for ImageKit +# Image Kit PHP API library -[![Packagist](https://img.shields.io/packagist/v/imagekit/imagekit.svg)](https://packagist.org/packages/imagekit/imagekit) [![Packagist](https://img.shields.io/packagist/dt/imagekit/imagekit.svg)](https://packagist.org/packages/imagekit/imagekit) [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT) [![codecov](https://codecov.io/gh/imagekit-developer/imagekit-php/branch/master/graph/badge.svg)](https://codecov.io/gh/imagekit-developer/imagekit-php) [![Twitter Follow](https://img.shields.io/twitter/follow/imagekitio?label=Follow&style=social)](https://twitter.com/ImagekitIo) -[![PHP Test CI](https://github.com/imagekit-developer/imagekit-php/actions/workflows/test.yml/badge.svg)](https://github.com/imagekit-developer/imagekit-php/actions/workflows/test.yml) [![PHP Coverage CI](https://github.com/imagekit-developer/imagekit-php/actions/workflows/coverage.yml/badge.svg)](https://github.com/imagekit-developer/imagekit-php/actions/workflows/coverage.yml) [![Wiki Documentation](https://img.shields.io/badge/wiki-documentation-forestgreen)](https://github.com/imagekit-developer/imagekit-php/wiki) +> [!NOTE] +> The Image Kit PHP API Library is currently in **beta** and we're excited for you to experiment with it! +> +> This library has not yet been exhaustively tested in production environments and may be missing some features you'd expect in a stable release. As we continue development, there may be breaking changes that require updates to your code. +> +> **We'd love your feedback!** Please share any suggestions, bug reports, feature requests, or general thoughts by [filing an issue](https://www.github.com/stainless-sdks/imagekit-php/issues/new). -PHP SDK for [ImageKit](https://imagekit.io/) implements the new APIs and interface for different file operations. +The Image Kit PHP library provides convenient access to the Image Kit REST API from any PHP 8.1.0+ application. -ImageKit is complete media storage, optimization, and transformation solution that comes with an [image and video CDN](https://imagekit.io/). It can be integrated with your existing infrastructure - storage like AWS S3, web servers, your CDN, and custom domain names, allowing you to deliver optimized images in minutes with minimal code changes. +It is generated with [Stainless](https://www.stainless.com/). -- [Key Features](#key-features) -- [Requirements](#requirements) -- [Version Support](#version-support) -- [Breaking changes](#breaking-changes) -- [Installation](#installation) -- [Usage](#usage) -- [Getting Started](#getting-started) -- [Quick Examples](#quick-examples) - * [Create an ImageKit Instance](#create-an-imagekit-instance) - * [URL Generation](#url-generation) - * [File Upload](#file-upload) -- [Demo Application](#demo-application) -- [URL Generation](#url-generation-1) -- [Signed URL & Image Transformations](#applying-chained-transformations-common-image-manipulations--signed-url) -- [Server-side File Upload](#server-side-file-upload) -- [File Management](#file-management) -- [Custom Metadata Fields API](#custom-metadata-fields-api) -- [Utility Function](#utility-functions) -- [Opening Issues](#opening-issues) -- [Support](#support) -- [Resources](#resources) -- [License](#license) +## Documentation -## Key Features -- [URL Generation](#url-generation) -- [Transformations](#1-chained-transformations-as-a-query-parameter) -- [Secure URLS](#6-signed-url) -- [File Upload](#server-side-file-upload) -- [File Management](#file-management) - -## Requirements -* PHP 5.6+ -* [JSON PHP Extension](https://www.php.net/manual/en/book.json.php) -* [cURL PHP Extension](https://www.php.net/manual/en/book.curl.php) - -## Version Support -| SDK Version | PHP 5.4 | PHP 5.5 | PHP 5.6 | PHP 7.x | PHP 8.x | -|-------------|---------|---------|---------|---------|---------| -| 4.x | ❌ | ❌ | ✔️ | ✔️ |✔️ | -| 3.x | ❌ | ❌ | ✔️ | ✔️ |✔️ | -| 2.x | ❌ | ❌ | ✔️ | ✔️ |✔️ | -| 1.x | ❌ | ✔️ | ✔️ | ✔️ |✔️ | - -## Breaking changes - -### Upgrading from 3.x to 4.x version - -1. Overlay syntax update - -* In version 4.0.0, we've removed the old overlay syntax parameters for transformations, such as `oi`, `ot`, `obg`, and [more](https://docs.imagekit.io/features/image-transformations/overlay). These parameters are deprecated and will start returning errors when used in URLs. Please migrate to the new layers syntax that supports overlay nesting, provides better positional control, and allows more transformations at the layer level. You can start with [examples](https://docs.imagekit.io/features/image-transformations/overlay-using-layers#examples) to learn quickly. -* You can migrate to the new layers syntax using the `raw` transformation parameter. +The REST API documentation can be found on [imagekit.io](https://imagekit.io/docs). ## Installation -You can install the bindings via [Composer](http://getcomposer.org/). Run the following command: - -```bash -composer require imagekit/imagekit -``` -To use the bindings, use Composer's [autoload](https://getcomposer.org/doc/01-basic-usage.md#autoloading): -```php -require_once('vendor/autoload.php'); -``` - -## Usage - -You can use this PHP SDK for three different methods - URL generation, file upload, and file management. The usage of the SDK has been explained below. - -* `URL Generation` -* `File Upload` -* `File Management` - -## Getting Started -1. **Sign up for ImageKit** – Before you begin, you need to sign up for an [ImageKit account](https://imagekit.io/registration/) -2. Get your [API Keys](https://docs.imagekit.io/api-reference/api-introduction/api-keys) from [developer options](https://imagekit.io/dashboard/developer) inside the dashboard. -3. **Minimum requirements** – To use PHP SDK, your system must meet the minimum requirements, including having **PHP >= 5.6**. We highly recommend having it compiled with the cURL extension and cURL 7.16.2+ compiled with a TLS backend (e.g., NSS or OpenSSL). -4. **Install the SDK** – Using Composer is the recommended way to install the ImageKit SDK for PHP. The SDK is available via [Packagist](http://packagist.org/) under the [`imagekit/imagekit`](https://packagist.org/packages/imagekit/imagekit) package. If Composer is installed globally on your system, you can run the following in the base directory of your project to add the SDK as a dependency: - ``` - composer require imagekit/imagekit - ``` - Please see the [Installation](#installation) section for more detailed information about installing. -5. **Using the SDK** – The best way to become familiar with how to use the SDK is to follow the examples provided in the [quick start guide](https://docs.imagekit.io/getting-started/quickstart-guides/php). - -## Quick Examples - -#### Create an ImageKit Instance -```php -// Require the Composer autoloader. -require 'vendor/autoload.php'; -use ImageKit\ImageKit; - -$imageKit = new ImageKit( - "your_public_key", - "your_private_key", - "your_url_endpoint" -); -``` - -#### URL Generation -```php -// For URL Generation, works for both images and videos -$imageURL = $imageKit->url( - [ - 'path' => '/default-image.jpg', - ] -); -echo $imageURL; -``` - -#### File Upload -```php -// For File Upload -$uploadFile = $imageKit->uploadFile([ - 'file' => 'file-url', # required, "binary","base64" or "file url" - 'fileName' => 'new-file' # required - 'checks' => '"file.size" < "1mb"' // optional `checks` parameters can be used to run server-side checks before files are uploaded to the Media Library. -]); -``` - -#### Response Structure -Following is the response for [server-side file upload API](https://docs.imagekit.io/api-reference/upload-file-api/server-side-file-upload#response-code-and-structure-json) +To use this package, install via Composer by adding the following to your application's `composer.json`: ```json { - "error": null, - "result": { - "fileId": "6286329dfef1b033aee60211", - "name": "your_file_name_S-PgGysnR.jpg", - "size": 94466, - "versionInfo": { - "id": "6286329dfef1b033aee60211", - "name": "Version 1" - }, - "filePath": "/your_file_name_S-PgGysnR.jpg", - "url": "https://ik.imagekit.io/demo/your_file_name_S-PgGysnR.jpg", - "fileType": "image", - "height": 640, - "width": 960, - "thumbnailUrl": "https://ik.imagekit.io/demo/tr:n-ik_ml_thumbnail/your_file_name_S-PgGysnR.jpg", - "tags": [], - "AITags": null, - "customMetadata": { }, - "extensionStatus": {} - }, - "responseMetadata":{ - "headers":{ - "access-control-allow-origin": "*", - "x-ik-requestid": "e98f2464-2a86-4934-a5ab-9a226df012c9", - "content-type": "application/json; charset=utf-8", - "content-length": "434", - "etag": 'W/"1b2-reNzjRCFNt45rEyD7yFY/dk+Ghg"', - "date": "Thu, 16 Jun 2022 14:22:01 GMT", - "x-request-id": "e98f2464-2a86-4934-a5ab-9a226df012c9" - }, - "raw":{ - "fileId": "6286329dfef1b033aee60211", - "name": "your_file_name_S-PgGysnR.jpg", - "size": 94466, - "versionInfo": { - "id": "6286329dfef1b033aee60211", - "name": "Version 1" - }, - "filePath": "/your_file_name_S-PgGysnR.jpg", - "url": "https://ik.imagekit.io/demo/your_file_name_S-PgGysnR.jpg", - "fileType": "image", - "height": 640, - "width": 960, - "thumbnailUrl": "https://ik.imagekit.io/demo/tr:n-ik_ml_thumbnail/your_file_name_S-PgGysnR.jpg", - "tags": [], - "AITags": null, - "customMetadata": { }, - "extensionStatus": {} - }, - "statusCode":200 + "repositories": [ + { + "type": "vcs", + "url": "git@github.com:stainless-sdks/imagekit-php.git" } + ], + "require": { + "imagekit/imagekit": "dev-main" + } } ``` -## Demo application - -* Step-by-step PHP quick start guide - https://docs.imagekit.io/getting-started/quickstart-guides/php -* You can also run the demo application in this repository's [sample](/sample) folder. - ```sh - cd sample - php sample.php - ``` - -## URL generation - -### Using relative file path and URL endpoint - -This method allows you to create an URL to access a file using the relative file path and the ImageKit URL endpoint (`urlEndpoint`). The file can be an image, video, or any other static file supported by ImageKit. - -#### Example - -```php -$imageURL = $imageKit->url( - [ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'height' => '300', - 'width' => '400' - ] - ] - ] -); -``` - -#### Response - -``` -https://ik.imagekit.io/your_imagekit_id/tr:h-300,w-400/default-image.jpg -``` - -### Using full image URL -This method allows you to add transformation parameters to an absolute URL. For example, if you have configured a custom CNAME and have absolute asset URLs in your database or CMS, you will often need this. - -#### Example -```php -$imageURL = $imageKit->url([ - 'src' => 'https://ik.imagekit.io/your_imagekit_id/endpoint/default-image.jpg', - 'transformation' => [ - [ - 'height' => '300', - 'width' => '400' - ] - ] -]); -``` - -#### Response -``` -https://ik.imagekit.io/your_imagekit_id/endpoint/tr:h-300,w-400/default-image.jpg -``` - -The `$imageKit->url()` method accepts the following parameters. - -| Option | Description | -| :-------------------- | :--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| urlEndpoint | Optional. The base URL to be appended before the path of the image. If not specified, the URL Endpoint specified at the time of SDK initialization is used. For example, https://ik.imagekit.io/your_imagekit_id/endpoint/ | -| path | Conditional. This is the path at which the image exists. For example, `/path/to/image.jpg`. Either the `path` or `src` parameter needs to be specified for URL generation. | -| src | Conditional. This is the complete URL of an image already mapped to ImageKit. For example, `https://ik.imagekit.io/your_imagekit_id/endpoint/path/to/image.jpg`. Either the `path` or `src` parameter needs to be specified for URL generation. | -| transformation | Optional. An array of objects specifying the transformation to be applied in the URL. The transformation name and the value should be specified as a key-value pair in the object. Different steps of a [chained transformation](https://docs.imagekit.io/features/image-transformations/chained-transformations) can be specified as different objects of the array. The complete [List of supported transformations](#list-of-supported-transformations) in the SDK and some examples of using them are given later. If you use a transformation name that is not specified in the SDK, it gets applied as it is in the URL. | -| transformationPosition | Optional. The default value is `path` which places the transformation string as a path parameter in the URL. It can also be specified as `query`, which adds the transformation string as the query parameter `tr` in the URL. The transformation string is always added as a query parameter if you use the `src` parameter to create the URL. | -| queryParameters | Optional. These are the other query parameters that you want to add to the final URL. These can be any query parameters and are not necessarily related to ImageKit. Especially useful if you want to add some versioning parameters to your URLs. | -| signed | Optional. Boolean. The default value is `false`. If set to `true`, the SDK generates a signed image URL adding the image signature to the image URL. | -| expireSeconds | Optional. Integer. It is used along with the `signed` parameter. It specifies the time in seconds from now when the signed URL will expire. If specified, the URL contains the expiry timestamp in the URL, and the image signature is modified accordingly. - -### Applying chained transformations, common image manipulations & signed URL - -This section covers the basics: - -* [Chained Transformations as a query parameter](#1-chained-transformations-as-a-query-parameter) -* [Image enhancement & color manipulation](#2-image-enhancement-and-color-manipulation) -* [Resizing images and videos](#3-resizing-images-and-videos) -* [Quality manipulation](#4-quality-manipulation) -* [Adding overlays](#5-adding-overlays) -* [Signed URL](#6-signed-url) - -The PHP SDK gives a name to each transformation parameter e.g. `height` for `h` and `width` for `w` parameter. It makes your code more readable. See the [Full list of supported transformations](#list-of-supported-transformations). - -👉 If the property does not match any of the available options, it is added as it is. For example: -```php -[ - 'effectGray' => 'e-grayscale' -] -// and -[ - 'e-grayscale' => '' -] -// works the same -``` -👉 Note that you can also use the `h` and `w` parameters instead of `height` and `width`. - -For more examples, check the [Demo Application](https://github.com/imagekit-developer/imagekit-php/tree/master/sample). - - -### 1. Chained transformations as a query parameter - -#### Example -```php -$imageURL = $imageKit->url([ - 'path' => '/default-image.jpg', - 'urlEndpoint' => 'https://ik.imagekit.io/your_imagekit_id/endpoint/', - 'transformation' => [ - [ - 'height' => '300', - 'width' => '400' - ], - [ - 'rotation' => 90 - ], - ], - 'transformationPosition' => 'query' -]); -``` -#### Response -``` -https://ik.imagekit.io/your_imagekit_id/endpoint/default-image.jpg?tr=h-300,w-400:rt-90 -``` - -### 2. Image enhancement and color manipulation - -Some transformations like [contrast stretch](https://docs.imagekit.io/features/image-transformations/image-enhancement-and-color-manipulation#contrast-stretch-e-contrast) , [sharpen](https://docs.imagekit.io/features/image-transformations/image-enhancement-and-color-manipulation#sharpen-e-sharpen) and [unsharp mask](https://docs.imagekit.io/features/image-transformations/image-enhancement-and-color-manipulation#unsharp-mask-e-usm) can be added to the URL with or without any other value. To use such transforms without specifying a value, specify the value as "-" in the transformation object. Otherwise, specify the value that you want to be added to this transformation. - -#### Example -```php -$imageURL = $imageKit->url([ - 'src' => 'https://ik.imagekit.io/your_imagekit_id/endpoint/default-image.jpg', - 'transformation' => - [ - [ - 'format' => 'jpg', - 'progressive' => true, - 'effectSharpen' => '-', - 'effectContrast' => '1' - ] - ] -]); -``` -#### Response -``` -https://ik.imagekit.io/your_imagekit_id/endpoint/tr:f-jpg,pr-true,e-sharpen,e-contrast-1/default-image.jpg -``` - -### 3. Resizing images and videos -Let's resize the image to `width` 400 and `height` 300. -Check detailed instructions on [resize, crop, and other Common transformations](https://docs.imagekit.io/features/image-transformations/resize-crop-and-other-transformations) - -#### Example -```php -$imageURL = $imageKit->url(array( - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'height' => '300', - 'width' => '400', - ] - ] -)); -``` -#### Response -``` -https://ik.imagekit.io/your_imagekit_id/tr:w-400,h-300/default-image.jpg -``` - -### 4. Quality manipulation -You can use the [quality parameter](https://docs.imagekit.io/features/image-transformations/resize-crop-and-other-transformations#quality-q) to change quality like this. - -#### Example -```php -$imageURL = $imageKit->url(array( - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'quality' => '40', - ] - ] -)); -``` - -#### Response -``` -https://ik.imagekit.io/your_imagekit_id/tr:q-40/default-image.jpg -``` - -### 5. Adding overlays - -ImageKit.io enables you to apply overlays to [images](https://docs.imagekit.io/features/image-transformations/overlay-using-layers) and [videos](https://docs.imagekit.io/features/video-transformation/overlay) using the raw parameter with the concept of [layers](https://docs.imagekit.io/features/image-transformations/overlay-using-layers#layers). The raw parameter facilitates incorporating transformations directly in the URL. A layer is a distinct type of transformation that allows you to define an asset to serve as an overlay, along with its positioning and additional transformations. - -#### Text as overlays - -You can add any text string over a base video or image using a text layer (l-text). +## Usage -For example: +This library uses named parameters to specify optional arguments. +Parameters with a default value must be set by name. ```php -$imageURL = $imageKit->url(array( - 'path' => '/default-image.jpg', - 'urlEndpoint' => 'https://ik.imagekit.io/your_imagekit_id' - - 'transformation' => [ - [ - 'height' => '300', - 'width' => '400', - 'raw': "l-text,i-Imagekit,fs-50,l-end" - ] - ] -)); -``` -#### Sample Result URL -``` -https://ik.imagekit.io/your_imagekit_id/tr:h-300,w-400,l-text,i-Imagekit,fs-50,l-end/default-image.jpg -``` +files->upload(file: 'file', fileName: "file-name.jpg"); -```php -$imageURL = $imageKit->url(array( - 'path' => '/default-image.jpg', - 'urlEndpoint' => 'https://ik.imagekit.io/your_imagekit_id' - - 'transformation' => [ - [ - 'height' => '300', - 'width' => '400', - 'raw': "l-image,i-default-image.jpg,w-100,b-10_CDDC39,l-end" - ] - ] -)); -``` -#### Sample Result URL +var_dump($response->videoCodec); ``` -https://ik.imagekit.io/your_imagekit_id/tr:h-300,w-400,l-image,i-default-image.jpg,w-100,b-10_CDDC39,l-end/default-image.jpg -``` - -#### Solid color blocks as overlays - -You can add solid color blocks over a base video or image using an image layer (l-image). -For example: +### Value Objects -```php -$imageURL = $imageKit->url(array( - 'path' => '/img/sample-video.mp4', - 'urlEndpoint' => 'https://ik.imagekit.io/your_imagekit_id' - - 'transformation' => [ - [ - 'height' => '300', - 'width' => '400', - 'raw': "l-image,i-ik_canvas,bg-FF0000,w-300,h-100,l-end" - ] - ] -)); -``` -#### Sample Result URL -``` -https://ik.imagekit.io/your_imagekit_id/tr:h-300,w-400,l-image,i-ik_canvas,bg-FF0000,w-300,h-100,l-end/img/sample-video.mp4 -``` +It is recommended to use the static `with` constructor `Dog::with(name: "Joey")` +and named parameters to initialize value objects. -### 6. Arithmetic expressions in transformations +However, builders are also provided `(new Dog)->withName("Joey")`. -ImageKit allows use of [arithmetic expressions](https://docs.imagekit.io/features/arithmetic-expressions-in-transformations) in certain dimension and position-related parameters, making media transformations more flexible and dynamic. +### Handling errors -For example: +When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `ImageKit\Core\Exceptions\APIException` will be thrown: ```php -$imageURL = $imageKit->url(array( - 'path' => '/default-image.jpg', - 'urlEndpoint' => 'https://ik.imagekit.io/your_imagekit_id' - 'transformation' => [ - [ - "height": "ih_div_2", - "width": "iw_div_4", - "border": "cw_mul_0.05_yellow" - ] - ] -)); -``` - -#### Sample Result URL -``` -https://ik.imagekit.io/your_imagekit_id/default-image.jpg?tr=w-iw_div_4,h-ih_div_2,b-cw_mul_0.05_yellow -`` - -### 7. Signed URL - -For example, the signed URL expires in 300 seconds with the default URL endpoint and other query parameters. -For a detailed explanation of the signed URL, refer to this [documentation](https://docs.imagekit.io/features/security/signed-urls). - -#### Example -```php -$imageURL = $imageKit->url([ - "path" => "/default-image.jpg", - "queryParameters" => - [ - "v" => "123" - ], - "transformation" => [ - [ - "height" => "300", - "width" => "400" - ] - ], - "signed" => true, - "expireSeconds" => 300, -]); -``` -#### Response -``` -https://ik.imagekit.io/your_imagekit_id/tr:h-300,w-400/default-image.jpg?v=123&ik-t=1654183277&ik-s=f98618f264a9ccb3c017e7b7441e86d1bc9a7ebb -``` - -You can manage [security settings](https://docs.imagekit.io/features/security#restricting-unsigned-urls) from the dashboard to prevent unsigned URLs usage. In that case, if the URL doesn't have a signature `ik-s` parameter or the signature is invalid, ImageKit will return a forbidden error instead of an actual image. - -### List of supported transformations - -The complete list of transformations supported and their usage in ImageKit can be found in the docs for [images](https://docs.imagekit.io/features/image-transformations) and [videos](https://docs.imagekit.io/features/video-transformation). The SDK gives a name to each transformation parameter, making the code simpler, making the code simpler, and readable. - -If a transformation is supported in ImageKit, but a name for it cannot be found in the table below, then use the transformation code from ImageKit docs as the name when using the `url` function. - -If you want to generate transformations in your application and add them to the URL as it is, use the `raw` parameter. - -| Supported Transformation Name | Translates to parameter | -|-------------------------------|-------------------------| -| height | h | -| width | w | -| aspectRatio | ar | -| quality | q | -| crop | c | -| cropMode | cm | -| x | x | -| y | y | -| focus | fo | -| format | f | -| radius | r | -| background | bg | -| border | b | -| rotation | rt | -| blur | bl | -| named | n | -| progressive | pr | -| lossless | lo | -| trim | t | -| metadata | md | -| colorProfile | cp | -| defaultImage | di | -| dpr | dpr | -| effectSharpen | e-sharpen | -| effectUSM | e-usm | -| effectContrast | e-contrast | -| effectGray | e-grayscale | -| effectShadow | e-shadow | -| effectGradient | e-gradient | -| original | orig | -| raw | `replaced by the parameter value` | - +uploadFile()` method to upload files to the [ImageKit Media Library](https://imagekit.io/dashboard/media-library). - -- [Server-side file upload API](https://docs.imagekit.io/api-reference/upload-file-api/server-side-file-upload). -- [Supported file types and extensions](https://docs.imagekit.io/api-reference/upload-file-api#allowed-file-types-for-uploading). - -#### Basic Usage -```php -$uploadFile = $imageKit->uploadFile([ - 'file' => 'your_file', // required, "binary","base64" or "file url" - 'fileName' => 'your_file_name.jpg', // required - 'checks' => '"file.size" < "1mb"', // optional `checks` parameters can be used to run server-side checks before files are uploaded to the Media Library. -]); -``` -#### Response -```json -{ - "error": null, - "result": { - "fileId": "6286329dfef1b033aee60211", - "name": "your_file_name_S-PgGysnR.jpg", - "size": 94466, - "versionInfo": { - "id": "6286329dfef1b033aee60211", - "name": "Version 1" - }, - "filePath": "/your_file_name_S-PgGysnR.jpg", - "url": "https://ik.imagekit.io/demo/your_file_name_S-PgGysnR.jpg", - "fileType": "image", - "height": 640, - "width": 960, - "thumbnailUrl": "https://ik.imagekit.io/demo/tr:n-ik_ml_thumbnail/your_file_name_S-PgGysnR.jpg", - "tags": [], - "AITags": null, - "customMetadata": { }, - "extensionStatus": {} - }, - "responseMetadata":{ - "headers":{ - "access-control-allow-origin": "*", - "x-ik-requestid": "e98f2464-2a86-4934-a5ab-9a226df012c9", - "content-type": "application/json; charset=utf-8", - "content-length": "434", - "etag": 'W/"1b2-reNzjRCFNt45rEyD7yFY/dk+Ghg"', - "date": "Thu, 16 Jun 2022 14:22:01 GMT", - "x-request-id": "e98f2464-2a86-4934-a5ab-9a226df012c9" - }, - "raw":{ - "fileId": "6286329dfef1b033aee60211", - "name": "your_file_name_S-PgGysnR.jpg", - "size": 94466, - "versionInfo": { - "id": "6286329dfef1b033aee60211", - "name": "Version 1" - }, - "filePath": "/your_file_name_S-PgGysnR.jpg", - "url": "https://ik.imagekit.io/demo/your_file_name_S-PgGysnR.jpg", - "fileType": "image", - "height": 640, - "width": 960, - "thumbnailUrl": "https://ik.imagekit.io/demo/tr:n-ik_ml_thumbnail/your_file_name_S-PgGysnR.jpg", - "tags": [], - "AITags": null, - "customMetadata": { }, - "extensionStatus": {} - }, - "statusCode":200 - } +try { + $response = $client->files->upload(file: 'file', fileName: "file-name.jpg"); +} catch (APIConnectionException $e) { + echo "The server could not be reached", PHP_EOL; + var_dump($e->getPrevious()); +} catch (RateLimitError $_) { + echo "A 429 status code was received; we should back off a bit.", PHP_EOL; +} catch (APIStatusError $e) { + echo "Another non-200-range status code was received", PHP_EOL; + echo $e->getMessage(); } ``` -#### Optional Parameters -Please refer to [server-side file upload API request structure](https://docs.imagekit.io/api-reference/upload-file-api/server-side-file-upload#request-structure-multipart-form-data) for a detailed explanation of mandatory and optional parameters. -```php -// Attempt File Uplaod -$uploadFile = $imageKit->uploadFile([ - 'file' => 'your_file', // required, "binary","base64" or "file url" - 'fileName' => 'your_file_name.jpg', // required - // Optional Parameters - "useUniqueFileName" => true, // true|false - "tags" => implode(",",["abd", "def"]), // max: 500 chars - "folder" => "/sample-folder", - "isPrivateFile" => false, // true|false - "customCoordinates" => implode(",", ["10", "10", "100", "100"]), // max: 500 chars - "responseFields" => implode(",", ["tags", "customMetadata"]), - "extensions" => [ - [ - "name" => "remove-bg", - "options" => [ // refer https://docs.imagekit.io/extensions/overview - "add_shadow" => true - ] - ] - ], - "webhookUrl" => "https://example.com/webhook", - "overwriteFile" => true, // in case of false useUniqueFileName should be true - "overwriteAITags" => true, // set to false in order to preserve overwriteAITags - "overwriteTags" => true, - "overwriteCustomMetadata" => true, - 'transformation' => [ - 'pre' => 'l-text,i-Imagekit,fs-50,l-end', - 'post' => [ - [ - 'type' => 'transformation', - 'value' => 'h-100' - ] - ] - ], - 'checks' => '"file.size" < "1mb"', // optional `checks` parameters can be used to run server-side checks before files are uploaded to the Media Library. - 'isPublished' => true, - // "customMetadata" => [ - // "SKU" => "VS882HJ2JD", - // "price" => 599.99, - // ] -]); -``` +Error codes are as follows: -## File Management +| Cause | Error Type | +| ---------------- | ------------------------------ | +| HTTP 400 | `BadRequestException` | +| HTTP 401 | `AuthenticationException` | +| HTTP 403 | `PermissionDeniedException` | +| HTTP 404 | `NotFoundException` | +| HTTP 409 | `ConflictException` | +| HTTP 422 | `UnprocessableEntityException` | +| HTTP 429 | `RateLimitException` | +| HTTP >= 500 | `InternalServerException` | +| Other HTTP error | `APIStatusException` | +| Timeout | `APITimeoutException` | +| Network error | `APIConnectionException` | -The SDK provides a simple interface for all the following [Media APIs](https://docs.imagekit.io/api-reference/media-api) to manage your files. +### Retries -### 1. List and Search Files +Certain errors will be automatically retried 2 times by default, with a short exponential backoff. -This API can list all the uploaded files and folders in your [ImageKit.io](https://docs.imagekit.io/api-reference/media-api) media library. +Connection errors (for example, due to a network connectivity problem), 408 Request Timeout, 409 Conflict, 429 Rate Limit, >=500 Internal errors, and timeouts will all be retried by default. -Refer to the [list and search file API](https://docs.imagekit.io/api-reference/media-api/list-and-search-files) for a better understanding of the **request & response structure**. +You can use the `maxRetries` option to configure or disable this: -#### Example ```php -$listFiles = $imageKit->listFiles(); -``` -#### Applying Filters -Filter out the files with an object specifying the parameters. +listFiles([ - "type" => "file", // file, file-version or folder - "sort" => "ASC_CREATED", - "path" => "/", // folder path - "fileType" => "all", // all, image, non-image - "limit" => 10, // min:1, max:1000 - "skip" => 0, // min:0 -]); -``` - -#### Advance Search -In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and providing this generated string as the value of the `searchQuery`. - -```php -$listFiles = $imageKit->listFiles([ - "searchQuery" => '(size < "1mb" AND width > 500) OR (tags IN ["summer-sale","banner"])', -]); -``` -Detailed documentation can be found here for [advance search queries](https://docs.imagekit.io/api-reference/media-api/list-and-search-files#advanced-search-queries). +use ImageKit\Client; +use ImageKit\RequestOptions; -### 2. Get File Details +// Configure the default for all requests: +$client = new Client(maxRetries: 0); -This API will get all the details and attributes of the current version of the asset. - -Refer to the [get file details API](https://docs.imagekit.io/api-reference/media-api/get-file-details) for a better understanding of the **request & response structure**. - -#### Example -```php -$getFileDetails = $imageKit->getFileDetails('file_id'); -``` +// Or, configure per-request: -### 3. Get File Version Details - -This API can get you all the details and attributes for the provided version of the file. - -Refer to the [get file version details API](https://docs.imagekit.io/api-reference/media-api/get-file-version-details) for a better understanding of the **request & response structure**. - -#### Example -```php -$getFileVersionDetails = $imageKit->getFileVersionDetails('file_id','version_id'); -``` - -### 4. Get File Versions - -This API will get you all the versions of an asset. - -Refer to the [get file versions API](https://docs.imagekit.io/api-reference/media-api/get-file-versions) for a better understanding of the **request & response structure**. - -#### Example -```php -$getFileVersions = $imageKit->getFileVersions('file_id'); -``` - -### 5. Update File Details - -Update file details such as `tags`, `customCoordinates` attributes, remove existing `AITags`, and apply [extensions](https://docs.imagekit.io/extensions/overview) using update file details API. This operation can only be performed only on the current version of an asset. - -Refer to the [update file details API](https://docs.imagekit.io/api-reference/media-api/update-file-details) for better understanding about the **request & response structure**. - -#### Example -```php -// Update parameters -$updateData = [ - "removeAITags" => "all", // "all" or ["tag1","tag2"] - "webhookUrl" => "https://example.com/webhook", - "extensions" => [ - [ - "name" => "remove-bg", - "options" => [ // refer https://docs.imagekit.io/extensions/overview - "add_shadow" => true - ] - ], - [ - "name" => "google-auto-tagging", - ] - ], - "tags" => ["tag1", "tag2"], - "customCoordinates" => "10,10,100,100", - // "customMetadata" => [ - // "SKU" => "VS882HJ2JD", - // "price" => 599.99, - // ] -]; - -// Attempt Update -$updateFileDetails = $imageKit->updateFileDetails( - 'file_id', - $updateData -); -``` - -**Update publish status** - -If `publish` is included in the update options, no other parameters are allowed. If any are present, an error will be returned: `Your request cannot contain any other parameters when publish is present`. - -#### Example -```php -// Update parameters -$updateData = [ - "publish" => [ - "isPublished" => true, - "includeFileVersions" => true - ] -]; - -// Attempt Update -$updateFileDetails = $imageKit->updateFileDetails( - 'file_id', - $updateData +$result = $client->files->upload( + file: 'file', + fileName: "file-name.jpg", + requestOptions: RequestOptions::with(maxRetries: 5), ); ``` -### 6. Add Tags (Bulk) API +## Advanced concepts -Add tags to multiple files in a single request. The method accepts an array of `fileIds` of the files and an array of `tags` that have to be added to those files. - -Refer to the [add tags (Bulk) API](https://docs.imagekit.io/api-reference/media-api/add-tags-bulk) for a better understanding of the **request & response structure**. - -#### Example -```php -$fileIds = ['file_id1','file_id2']; -$tags = ['image_tag_1', 'image_tag_2']; - -$bulkAddTags = $imageKit->bulkAddTags($fileIds, $tags); -``` +### Making custom or undocumented requests -### 7. Remove Tags (Bulk) API +#### Undocumented properties -Remove tags from multiple files in a single request. The method accepts an array of `fileIds` of the files and an array of `tags` that have to be removed from those files. +You can send undocumented parameters to any endpoint, and read undocumented response properties, like so: -Refer to the [remove tags (Bulk) API](https://docs.imagekit.io/api-reference/media-api/remove-tags-bulk) for a better understanding of the **request & response structure**. +Note: the `extra*` parameters of the same name overrides the documented parameters. -#### Example ```php -$fileIds = ['file_id1','file_id2']; -$tags = ['image_tag_1', 'image_tag_2']; - -$bulkRemoveTags = $imageKit->bulkRemoveTags($fileIds, $tags); -``` - -### 8. Remove AI Tags (Bulk) API - -Remove AI tags from multiple files in a single request. The method accepts an array of `fileIds` of the files and an array of `AITags` that have to be removed from those files. - -Refer to the [remove AI Tags (Bulk) API](https://docs.imagekit.io/api-reference/media-api/remove-aitags-bulk) for a better understanding of the **request & response structure**. - -#### Example -```php -$fileIds = ['file_id1','file_id2']; -$AITags = ['image_AITag_1', 'image_AITag_2']; - -$bulkRemoveTags = $imageKit->bulkRemoveTags($fileIds, $AITags); -``` + If a file or specific transformation has been requested in the past, then the response is cached. Deleting a file does not purge the cache. However, you can purge the cache using [Purge Cache API](#21-purge-cache-api). - -Refer to the [delete file API](https://docs.imagekit.io/api-reference/media-api/delete-file) for better understanding about the **request & response structure**. - -#### Basic Usage -```php -$fileId = 'file_id'; -$deleteFile = $imageKit->deleteFile($fileId); -``` - -### 10. Delete File Version API - -Using the delete file version API, you can programmatically delete the uploaded file version in the media library. - -> You can delete only the non-current version of a file. - -Refer to the [delete file version API](https://docs.imagekit.io/api-reference/media-api/delete-file-version) for a better understanding of the **request & response structure**. - -#### Example -```php -$fileId = 'file_id'; -$versionId = 'version_id'; -$deleteFileVersion = $imageKit->deleteFileVersion($fileId, $versionId); -``` - -### 11. Delete Files (Bulk) API - -Deletes multiple files and their versions from the media library. - -Refer to the [delete files (Bulk) API](https://docs.imagekit.io/api-reference/media-api/delete-files-bulk) for a better understanding of the **request & response structure**. - -#### Example -```php -$fileIds = ["5e1c13d0c55ec3437c451406", ...]; -$deleteFiles = $imageKit->bulkDeleteFiles($fileIds); -``` - - -### 12. Copy File API - -This will copy a file from one folder to another. - -> If any file at the destination has the same name as the source file, then the source file and its versions (if `includeFileVersions` is set to true) will be appended to the destination file version history. - -Refer to the [copy file API](https://docs.imagekit.io/api-reference/media-api/copy-file) for a better understanding of the **request & response structure**. - -#### Basic Usage -```php -$sourceFilePath = '/sample-folder1/sample-file.jpg'; -$destinationPath = '/sample-folder2/'; -$includeFileVersions = false; - -$copyFile = $imageKit->copy([ - 'sourceFilePath' => $sourceFilePath, - 'destinationPath' => $destinationPath, - 'includeFileVersions' => $includeFileVersions -]); -``` - -### 13. Move File API - -This will move a file and all its versions from one folder to another. - -> If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file. - -Refer to the [move file API](https://docs.imagekit.io/api-reference/media-api/move-file) for a better understanding of the **request & response structure**. - -#### Example -```php -$sourceFilePath = '/sample-file.jpg'; -$destinationPath = '/sample-folder/'; - -$moveFile = $imageKit->move([ - 'sourceFilePath' => $sourceFilePath, - 'destinationPath' => $destinationPath -]); -``` - -### 14. Rename File API - -Using Rename File API, you can programmatically rename an already existing file in the media library. This operation would rename all versions of the file. - -> The old URLs will stop working. However, the file/file version URLs cached on CDN will continue to work unless a purge is requested. - -Refer to the [rename file API](https://docs.imagekit.io/api-reference/media-api/rename-file) for a better understanding of the **request & response structure**. - -#### Example -```php -// Purge Cache would default to false - -$filePath = '/sample-folder/sample-file.jpg'; -$newFileName = 'sample-file2.jpg'; -$renameFile = $imageKit->rename([ - 'filePath' => $filePath, - 'newFileName' => $newFileName, -]); -``` -When `purgeCache` is set to `true`, response will return `purgeRequestId`. This `purgeRequestId` can be used to get the purge request status. -```php -$filePath = '/sample-folder/sample-file.jpg'; -$newFileName = 'sample-file2.jpg'; -$renameFile = $imageKit->rename([ - 'filePath' => $filePath, - 'newFileName' => $newFileName, -],true); -``` - -### 15. Restore File Version API - -This will restore the provided file version to a different version of the file. The newly restored version of the file will be returned in the response. - -Refer to the [restore file version API](https://docs.imagekit.io/api-reference/media-api/restore-file-version) for a better understanding of the **request & response structure**. - -#### Example -```php -$fileId = 'fileId'; -$versionId = 'versionId'; -$restoreFileVersion = $imageKit->restoreFileVersion([ - 'fileId' => $fileId, - 'versionId' => $versionId, -]); -``` - -### 16. Create Folder API - -This will create a new folder. You can specify the folder name and location of the parent folder where this new folder should be created. - -Refer to the [create folder API](https://docs.imagekit.io/api-reference/media-api/create-folder) for a better understanding of the **request & response structure**. - -#### Example -```php -$folderName = 'new-folder'; -$parentFolderPath = '/'; -$createFolder = $imageKit->createFolder([ - 'folderName' => $folderName, - 'parentFolderPath' => $parentFolderPath, -]); -``` - -### 17. Delete Folder API - -This will delete the specified folder and all nested files, their versions & folders. This action cannot be undone. - -Refer to the [delete folder API](https://docs.imagekit.io/api-reference/media-api/delete-folder) for a better understanding of the **request & response structure**. - -#### Example -```php -$folderPath = '/new-folder'; -$deleteFolder = $imageKit->deleteFolder($folderPath); -``` - -### 18. Copy Folder API - -This will copy one folder into another. - -Refer to the [copy folder API](https://docs.imagekit.io/api-reference/media-api/copy-folder) for a better understanding of the **request & response structure**. - -#### Example -```php -$sourceFolderPath = '/source-folder/'; -$destinationPath = '/destination-folder/'; -$includeFileVersions = false; -$copyFolder = $imageKit->copyFolder([ - 'sourceFolderPath' => $sourceFolderPath, - 'destinationPath' => $destinationPath, - 'includeFileVersions' => $includeFileVersions -]); -``` - -### 19. Move Folder API - -This will move one folder into another. The selected folder, its nested folders, files, and their versions are moved in this operation. - -> If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history. - -Refer to the [move folder API](https://docs.imagekit.io/api-reference/media-api/move-folder) for a better understanding of the **request & response structure**. - -#### Example -```php -$sourceFolderPath = '/sample-folder/'; -$destinationPath = '/destination-folder/'; -$moveFolder = $imageKit->moveFolder([ - 'sourceFolderPath' => $sourceFolderPath, - 'destinationPath' => $destinationPath -]); -``` - -### 20. Bulk Job Status API - -This endpoint allows you to get the status of a bulk operation e.g. [Copy Folder API](#18-copy-folder-api) or [Move Folder API](#19-move-folder-api). - -Refer to the [bulk job status API](https://docs.imagekit.io/api-reference/media-api/copy-move-folder-status) for a better understanding of the **request & response structure**. - -#### Example -```php -$jobId = 'jobId'; -$bulkJobStatus = $imageKit->getBulkJobStatus($jobId); -``` - -### 21. Purge Cache API - -This will purge CDN and ImageKit.io's internal cache. In response, `requestId` is returned, which can be used to fetch the status of the submitted purge request with [Purge Cache Status API](#22-purge-cache-status-api). - -Refer to the [Purge Cache API](https://docs.imagekit.io/api-reference/media-api/purge-cache) for a better understanding of the **request & response structure**. - -#### Example -```php -$image_url = 'https://ik.imagekit.io/demo/sample-folder/sample-file.jpg'; -$purgeCache = $imageKit->purgeCache($image_url); -``` - -You can purge the cache for multiple files. Check [purge cache multiple files](https://docs.imagekit.io/api-reference/media-api/purge-cache#purge-cache-for-multiple-files). - -### 22. Purge Cache Status API - -Get the purge cache request status using the `requestId` returned when a purge cache request gets submitted with [Purge Cache API](#21-purge-cache-api) - -Refer to the [Purge Cache Status API](https://docs.imagekit.io/api-reference/media-api/purge-cache-status) for a better understanding of the **request & response structure**. - -#### Example -```php -$cacheRequestId = '598821f949c0a938d57563bd'; -$purgeCacheStatus = $imageKit->purgeCacheStatus($cacheRequestId); -``` - -### 23. Get File Metadata API (From File ID) - -Get the image EXIF, pHash, and other metadata for uploaded files in the ImageKit.io media library using this API. - -Refer to the [get image metadata for uploaded media files API](https://docs.imagekit.io/api-reference/metadata-api/get-image-metadata-for-uploaded-media-files) for a better understanding of the **request & response structure**. - -#### Example -```php -$fileId = '598821f949c0a938d57563bd'; -$getFileMetadata = $imageKit->getFileMetaData($fileId); -``` - -### 24. Get File Metadata API (From Remote URL) - -Get image EXIF, pHash, and other metadata from ImageKit.io powered remote URL using this API. - -Refer to the [get image metadata from remote URL API](https://docs.imagekit.io/api-reference/metadata-api/get-image-metadata-from-remote-url) for a better understanding of the **request & response structure**. - -#### Example -```php -$image_url = 'https://ik.imagekit.io/demo/sample-folder/sample-file.jpg'; -$getFileMetadataFromRemoteURL = $imageKit->getFileMetadataFromRemoteURL($image_url); -``` -## Custom Metadata Fields API - -Imagekit.io allows you to define a `schema` for your metadata keys, and the value filled against that key will have to adhere to those rules. You can [create](#1-create-fields), [read](#2-get-fields) and [update](#3-update-fields) custom metadata rules and update your file with custom metadata value in [file update API](#5-update-file-details) or [file upload API](#server-side-file-upload). - -For a detailed explanation, refer to the [custom metadata fields documentation](https://docs.imagekit.io/api-reference/custom-metadata-fields-api). - - -### 1. Create Fields - -Create a custom metadata field with this API. - -Refer to the [create custom metadata fields API](https://docs.imagekit.io/api-reference/custom-metadata-fields-api/create-custom-metadata-field) for a better understanding of the **request & response structure**. - -#### Example -```php -$body = [ - "name" => "price", // required - "label" => "Unit Price", // required - "schema" => [ // required - "type" => 'Number', // required - "minValue" => 1000, - "maxValue" => 5000, - ], -]; - -$createCustomMetadataField = $imageKit->createCustomMetadataField($body); -``` - -Check for the [allowed values in the schema](https://docs.imagekit.io/api-reference/custom-metadata-fields-api/create-custom-metadata-field#allowed-values-in-the-schema-object). - -### 2. Get Fields - -Get a list of all the custom metadata fields. - -Refer to the [get custom metadata fields API](https://docs.imagekit.io/api-reference/custom-metadata-fields-api/get-custom-metadata-field) for a better understanding of the **request & response structure**. - -#### Example -```php -$includeDeleted = false; -$getCustomMetadataField = $imageKit->getCustomMetadataField($includeDeleted); -``` - -### 3. Update Fields - -Update an existing custom metadata field's `label` or `schema`. - -Refer to the [update custom metadata fields API](https://docs.imagekit.io/api-reference/custom-metadata-fields-api/update-custom-metadata-field) for a better understanding of the **request & response structure**. - -#### Example -```php -$customMetadataFieldId = '598821f949c0a938d57563dd'; -$body = [ - "label" => "Net Price", - "schema" => [ - "type"=>'Number' - ], -]; +$response = $client->files->upload( + file: 'file', + fileName: "file-name.jpg", + requestOptions: RequestOptions::with( + extraQueryParams: ["my_query_parameter" => "value"], + extraBodyParams: ["my_body_parameter" => "value"], + extraHeaders: ["my-header" => "value"], + ), +); -$updateCustomMetadataField = $imageKit->updateCustomMetadataField($customMetadataFieldId, $body); +var_dump($response["my_undocumented_property"]); ``` -Check for the [allowed values in the schema](https://docs.imagekit.io/api-reference/custom-metadata-fields-api/create-custom-metadata-field#allowed-values-in-the-schema-object). +#### Undocumented request params +If you want to explicitly send an extra param, you can do so with the `extra_query`, `extra_body`, and `extra_headers` under the `request_options:` parameter when making a request, as seen in the examples above. -### 4. Delete Fields +#### Undocumented endpoints -Delete a custom metadata field. +To make requests to undocumented endpoints while retaining the benefit of auth, retries, and so on, you can make requests using `client.request`, like so: -Refer to the [delete custom metadata fields API](https://docs.imagekit.io/api-reference/custom-metadata-fields-api/delete-custom-metadata-field) for a better understanding of the **request & response structure**. - -#### Example ```php -$customMetadataFieldId = '598821f949c0a938d57563dd'; +deleteCustomMetadataField($customMetadataFieldId); +$response = $client->request( + method: "post", + path: '/undocumented/endpoint', + query: ['dog' => 'woof'], + headers: ['useful-header' => 'interesting-value'], + body: ['hello' => 'world'] +); ``` +## Versioning -## Utility functions - -We have included the following commonly used utility functions in this SDK. - -### Authentication parameter generation +This package follows [SemVer](https://semver.org/spec/v2.0.0.html) conventions. As the library is in initial development and has a major version of `0`, APIs may change at any time. -If you want to implement client-side file upload, you will need a `token`, `expiry` timestamp, and a valid `signature` for that upload. The SDK provides a simple method you can use in your code to generate these authentication parameters. +This package considers improvements to the (non-runtime) PHPDoc type definitions to be non-breaking changes. -_Note: The Private API Key should never be exposed in any client-side code. You must always generate these authentication parameters on the server-side_ - -```php -$imageKit->getAuthenticationParameters($token = "", $expire = 0); -``` - -Returns - -```json -{ - "token": "5d1c4a22-54f2-40bb-9e8c-99daaeeb7307", - "expire": 1654207193, - "signature": "a03a88b814570a3d92919c16a1b8bd4491f053c3" -} -``` - -Both the `token` and `expire` parameters are optional. If not specified, the SDK internally generates a random token and a valid expiry timestamp. The value of the `token` and `expire` used to create the signature is always returned in the response, whether they are provided in input or not. - -### Distance calculation between two pHash values - -Perceptual hashing allows you to construct a hash value that uniquely identifies an input image based on the contents of an image. [ImageKit.io metadata API](https://docs.imagekit.io/api-reference/metadata-api) returns the pHash value of an image in the response. You can use this value to find a duplicate (or similar) image by calculating the distance between the pHash value of the two images. - -This SDK exposes `pHashDistance` function to calculate the distance between two pHash values. It accepts two pHash hexadecimal strings and returns a numeric value indicative of the level of difference between the two images. - -```php - $imageKit->pHashDistance($firstHash ,$secondHash); -``` - -#### Distance calculation examples - -```php -$imageKit->pHashDistance('f06830ca9f1e3e90', 'f06830ca9f1e3e90'); -// output: 0 (same image) - -$imageKit->pHashDistance('2d5ad3936d2e015b', '2d6ed293db36a4fb'); -// output: 17 (similar images) - -$imageKit->pHashDistance('a4a65595ac94518b', '7838873e791f8400'); -// output: 37 (dissimilar images) -``` - -## Opening Issues -If you encounter a bug with `imagekit-php` we would like to hear about it. Search the existing issues and try to make sure your problem doesn't already exist before opening a new issue. It's helpful if you include the version of `imagekit-php`, PHP version, and OS you're using. Please include a stack trace and a simple workflow to reproduce the case when appropriate, too. - - -## Support - -For any feedback or to report any issues or general implementation support, please reach out to [support@imagekit.io](mailto:support@imagekit.io) - -## Resources +## Requirements -- [Main website](https://imagekit.io) - Main Website. -- [Documentation](https://docs.imagekit.io) - For both getting started and in-depth SDK usage information. -- [PHP quick start guide](https://docs.imagekit.io/getting-started/quickstart-guides/php) +PHP 8.1.0 or higher. -## License +## Contributing -Released under the MIT license. \ No newline at end of file +See [the contributing documentation](https://github.com/stainless-sdks/imagekit-php/tree/main/CONTRIBUTING.md). diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 00000000..8e64327a --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,27 @@ +# Security Policy + +## Reporting Security Issues + +This SDK is generated by [Stainless Software Inc](http://stainless.com). Stainless takes security seriously, and encourages you to report any security vulnerability promptly so that appropriate action can be taken. + +To report a security issue, please contact the Stainless team at security@stainless.com. + +## Responsible Disclosure + +We appreciate the efforts of security researchers and individuals who help us maintain the security of +SDKs we generate. If you believe you have found a security vulnerability, please adhere to responsible +disclosure practices by allowing us a reasonable amount of time to investigate and address the issue +before making any information public. + +## Reporting Non-SDK Related Security Issues + +If you encounter security issues that are not directly related to SDKs but pertain to the services +or products provided by Image Kit, please follow the respective company's security reporting guidelines. + +### Image Kit Terms and Policies + +Please contact developer@imagekit.io for any questions or concerns regarding the security of our services. + +--- + +Thank you for helping us keep the SDKs and systems they interact with secure. diff --git a/bin/check-release-environment b/bin/check-release-environment new file mode 100644 index 00000000..0d9c55da --- /dev/null +++ b/bin/check-release-environment @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +errors=() + +if [ -z "${STAINLESS_API_KEY}" ]; then + errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organization secrets on GitHub.") +fi + +if [ -z "${PACKAGIST_USERNAME}" ]; then + errors+=("The PACKAGIST_USERNAME secret has not been set. Please set it in either this repository's secrets or your organization secrets") +fi + +if [ -z "${PACKAGIST_SAFE_KEY}" ]; then + errors+=("The PACKAGIST_SAFE_KEY secret has not been set. Please set it in either this repository's secrets or your organization secrets") +fi + +lenErrors=${#errors[@]} + +if [[ lenErrors -gt 0 ]]; then + echo -e "Found the following errors in the release environment:\n" + + for error in "${errors[@]}"; do + echo -e "- $error\n" + done + + exit 1 +fi + +echo "The environment is ready to push releases!" diff --git a/composer.json b/composer.json index 32efa114..7f793c41 100644 --- a/composer.json +++ b/composer.json @@ -1,46 +1,51 @@ { - "authors": [ - { - "name": "Imagekit", - "homepage": "https://github.com/imagekit-developer/imagekit-php/graphs/contributors" - } - ], - "autoload": { - "psr-4": { - "ImageKit\\": "src/ImageKit/" - } + "$schema": "https://getcomposer.org/schema.json", + "autoload": { + "files": ["src/Core.php", "src/Client.php"], + "psr-4": { + "ImageKit\\": "src/" + } + }, + "autoload-dev": { + "psr-4": { + "Tests\\": "tests/" + } + }, + "config": { + "allow-plugins": { + "pestphp/pest-plugin": true, + "php-http/discovery": false, + "phpstan/extension-installer": true }, - "autoload-dev": { - "psr-4": { - "ImageKit\\Tests\\": "tests/" - } + "platform": { + "php": "8.3" }, - "description": "PHP library for Imagekit", - "homepage": "https://github.com/imagekit-developer/imagekit-php", - "keywords": [ - "library", - "imagekit", - "image management" - ], - "license": "MIT", - "name": "imagekit/imagekit", - "require": { - "php": ">=5.6.0", - "ext-curl": "*", - "guzzlehttp/guzzle": "~6.0 || ~7.0", - "ext-json": "*", - "beberlei/assert": "^2.9.9" - }, - "config": { - "platform": { - "php": "5.6" - } - }, - "require-dev": { - "phpunit/phpunit": "^5.7.27" - }, - "support": { - "email": "support@imagekit.io" - }, - "type": "library" + "preferred-install": "dist", + "sort-packages": true + }, + "description": "Image Kit PHP SDK", + "name": "imagekit/imagekit", + "require": { + "php": "^8.1", + "php-http/discovery": "^1", + "psr/http-client": "^1", + "psr/http-client-implementation": "^1", + "psr/http-factory-implementation": "^1", + "psr/http-message": "^1|^2" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3", + "nyholm/psr7": "^1", + "pestphp/pest": "^3", + "phpstan/extension-installer": "^1", + "phpstan/phpstan": "^2", + "phpstan/phpstan-phpunit": "^2", + "phpunit/phpunit": "^11", + "symfony/http-client": "^7" + }, + "scripts": { + "build:docs": "curl --etag-save ./vendor/ag.etags --etag-compare ./vendor/ag.etags --create-dirs --remote-name --output-dir ./vendor/bin --no-progress-meter -- https://github.com/ApiGen/ApiGen/releases/latest/download/apigen.phar && php ./vendor/bin/apigen.phar --output docs -- src", + "lint": "./scripts/lint", + "test": "./scripts/test" + } } diff --git a/composer.lock b/composer.lock deleted file mode 100644 index 7594938f..00000000 --- a/composer.lock +++ /dev/null @@ -1,2395 +0,0 @@ -{ - "_readme": [ - "This file locks the dependencies of your project to a known state", - "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", - "This file is @generated automatically" - ], - "content-hash": "39a1be44588c84272c5860de8d14993c", - "packages": [ - { - "name": "beberlei/assert", - "version": "v2.9.9", - "source": { - "type": "git", - "url": "https://github.com/beberlei/assert.git", - "reference": "124317de301b7c91d5fce34c98bba2c6925bec95" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/beberlei/assert/zipball/124317de301b7c91d5fce34c98bba2c6925bec95", - "reference": "124317de301b7c91d5fce34c98bba2c6925bec95", - "shasum": "" - }, - "require": { - "ext-mbstring": "*", - "php": ">=5.3" - }, - "require-dev": { - "friendsofphp/php-cs-fixer": "^2.1.1", - "phpunit/phpunit": "^4.8.35|^5.7" - }, - "type": "library", - "autoload": { - "files": [ - "lib/Assert/functions.php" - ], - "psr-4": { - "Assert\\": "lib/Assert" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-2-Clause" - ], - "authors": [ - { - "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de", - "role": "Lead Developer" - }, - { - "name": "Richard Quadling", - "email": "rquadling@gmail.com", - "role": "Collaborator" - } - ], - "description": "Thin assertion library for input validation in business models.", - "keywords": [ - "assert", - "assertion", - "validation" - ], - "support": { - "issues": "https://github.com/beberlei/assert/issues", - "source": "https://github.com/beberlei/assert/tree/v2.9.9" - }, - "time": "2019-05-28T15:27:37+00:00" - }, - { - "name": "guzzlehttp/guzzle", - "version": "6.5.8", - "source": { - "type": "git", - "url": "https://github.com/guzzle/guzzle.git", - "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a52f0440530b54fa079ce76e8c5d196a42cad981", - "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981", - "shasum": "" - }, - "require": { - "ext-json": "*", - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.9", - "php": ">=5.5", - "symfony/polyfill-intl-idn": "^1.17" - }, - "require-dev": { - "ext-curl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", - "psr/log": "^1.1" - }, - "suggest": { - "psr/log": "Required for using the Log middleware" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "6.5-dev" - } - }, - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Jeremy Lindblom", - "email": "jeremeamia@gmail.com", - "homepage": "https://github.com/jeremeamia" - }, - { - "name": "George Mponos", - "email": "gmponos@gmail.com", - "homepage": "https://github.com/gmponos" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://github.com/sagikazarmark" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - } - ], - "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", - "keywords": [ - "client", - "curl", - "framework", - "http", - "http client", - "rest", - "web service" - ], - "support": { - "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/6.5.8" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", - "type": "tidelift" - } - ], - "time": "2022-06-20T22:16:07+00:00" - }, - { - "name": "guzzlehttp/promises", - "version": "1.5.3", - "source": { - "type": "git", - "url": "https://github.com/guzzle/promises.git", - "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/67ab6e18aaa14d753cc148911d273f6e6cb6721e", - "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\Promise\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - } - ], - "description": "Guzzle promises library", - "keywords": [ - "promise" - ], - "support": { - "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.3" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", - "type": "tidelift" - } - ], - "time": "2023-05-21T12:31:43+00:00" - }, - { - "name": "guzzlehttp/psr7", - "version": "1.9.1", - "source": { - "type": "git", - "url": "https://github.com/guzzle/psr7.git", - "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b", - "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b", - "shasum": "" - }, - "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" - }, - "provide": { - "psr/http-message-implementation": "1.0" - }, - "require-dev": { - "ext-zlib": "*", - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" - }, - "suggest": { - "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" - }, - "type": "library", - "autoload": { - "files": [ - "src/functions_include.php" - ], - "psr-4": { - "GuzzleHttp\\Psr7\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Graham Campbell", - "email": "hello@gjcampbell.co.uk", - "homepage": "https://github.com/GrahamCampbell" - }, - { - "name": "Michael Dowling", - "email": "mtdowling@gmail.com", - "homepage": "https://github.com/mtdowling" - }, - { - "name": "George Mponos", - "email": "gmponos@gmail.com", - "homepage": "https://github.com/gmponos" - }, - { - "name": "Tobias Nyholm", - "email": "tobias.nyholm@gmail.com", - "homepage": "https://github.com/Nyholm" - }, - { - "name": "Márk Sági-Kazár", - "email": "mark.sagikazar@gmail.com", - "homepage": "https://github.com/sagikazarmark" - }, - { - "name": "Tobias Schultze", - "email": "webmaster@tubo-world.de", - "homepage": "https://github.com/Tobion" - } - ], - "description": "PSR-7 message implementation that also provides common utility methods", - "keywords": [ - "http", - "message", - "psr-7", - "request", - "response", - "stream", - "uri", - "url" - ], - "support": { - "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.9.1" - }, - "funding": [ - { - "url": "https://github.com/GrahamCampbell", - "type": "github" - }, - { - "url": "https://github.com/Nyholm", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", - "type": "tidelift" - } - ], - "time": "2023-04-17T16:00:37+00:00" - }, - { - "name": "paragonie/random_compat", - "version": "v2.0.21", - "source": { - "type": "git", - "url": "https://github.com/paragonie/random_compat.git", - "reference": "96c132c7f2f7bc3230723b66e89f8f150b29d5ae" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/paragonie/random_compat/zipball/96c132c7f2f7bc3230723b66e89f8f150b29d5ae", - "reference": "96c132c7f2f7bc3230723b66e89f8f150b29d5ae", - "shasum": "" - }, - "require": { - "php": ">=5.2.0" - }, - "require-dev": { - "phpunit/phpunit": "*" - }, - "suggest": { - "ext-libsodium": "Provides a modern crypto API that can be used to generate random bytes." - }, - "type": "library", - "autoload": { - "files": [ - "lib/random.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Paragon Initiative Enterprises", - "email": "security@paragonie.com", - "homepage": "https://paragonie.com" - } - ], - "description": "PHP 5.x polyfill for random_bytes() and random_int() from PHP 7", - "keywords": [ - "csprng", - "polyfill", - "pseudorandom", - "random" - ], - "support": { - "email": "info@paragonie.com", - "issues": "https://github.com/paragonie/random_compat/issues", - "source": "https://github.com/paragonie/random_compat" - }, - "time": "2022-02-16T17:07:03+00:00" - }, - { - "name": "psr/http-message", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/php-fig/http-message.git", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/f6561bf28d520154e4b0ec72be95418abe6d9363", - "reference": "f6561bf28d520154e4b0ec72be95418abe6d9363", - "shasum": "" - }, - "require": { - "php": ">=5.3.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Psr\\Http\\Message\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" - } - ], - "description": "Common interface for HTTP messages", - "homepage": "https://github.com/php-fig/http-message", - "keywords": [ - "http", - "http-message", - "psr", - "psr-7", - "request", - "response" - ], - "support": { - "source": "https://github.com/php-fig/http-message/tree/master" - }, - "time": "2016-08-06T14:39:51+00:00" - }, - { - "name": "ralouphie/getallheaders", - "version": "3.0.3", - "source": { - "type": "git", - "url": "https://github.com/ralouphie/getallheaders.git", - "reference": "120b605dfeb996808c31b6477290a714d356e822" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", - "reference": "120b605dfeb996808c31b6477290a714d356e822", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "php-coveralls/php-coveralls": "^2.1", - "phpunit/phpunit": "^5 || ^6.5" - }, - "type": "library", - "autoload": { - "files": [ - "src/getallheaders.php" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Ralph Khattar", - "email": "ralph.khattar@gmail.com" - } - ], - "description": "A polyfill for getallheaders.", - "support": { - "issues": "https://github.com/ralouphie/getallheaders/issues", - "source": "https://github.com/ralouphie/getallheaders/tree/develop" - }, - "time": "2019-03-08T08:55:37+00:00" - }, - { - "name": "symfony/polyfill-intl-idn", - "version": "v1.19.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "4ad5115c0f5d5172a9fe8147675ec6de266d8826" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/4ad5115c0f5d5172a9fe8147675ec6de266d8826", - "reference": "4ad5115c0f5d5172a9fe8147675ec6de266d8826", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "symfony/polyfill-intl-normalizer": "^1.10", - "symfony/polyfill-php70": "^1.10", - "symfony/polyfill-php72": "^1.10" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.19-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Idn\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Laurent Bassin", - "email": "laurent@bassin.info" - }, - { - "name": "Trevor Rowbotham", - "email": "trevor.rowbotham@pm.me" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "idn", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.19.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-21T09:57:48+00:00" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.19.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8db0ae7936b42feb370840cf24de1a144fb0ef27" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8db0ae7936b42feb370840cf24de1a144fb0ef27", - "reference": "8db0ae7936b42feb370840cf24de1a144fb0ef27", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.19-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.19.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-23T09:01:57+00:00" - }, - { - "name": "symfony/polyfill-php70", - "version": "v1.19.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php70.git", - "reference": "3fe414077251a81a1b15b1c709faf5c2fbae3d4e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php70/zipball/3fe414077251a81a1b15b1c709faf5c2fbae3d4e", - "reference": "3fe414077251a81a1b15b1c709faf5c2fbae3d4e", - "shasum": "" - }, - "require": { - "paragonie/random_compat": "~1.0|~2.0|~9.99", - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.19-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php70\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.0+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php70/tree/v1.19.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-23T09:01:57+00:00" - }, - { - "name": "symfony/polyfill-php72", - "version": "v1.19.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-php72.git", - "reference": "beecef6b463b06954638f02378f52496cb84bacc" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php72/zipball/beecef6b463b06954638f02378f52496cb84bacc", - "reference": "beecef6b463b06954638f02378f52496cb84bacc", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.19-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Php72\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill backporting some PHP 7.2+ features to lower PHP versions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-php72/tree/v1.19.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-23T09:01:57+00:00" - } - ], - "packages-dev": [ - { - "name": "doctrine/instantiator", - "version": "1.0.5", - "source": { - "type": "git", - "url": "https://github.com/doctrine/instantiator.git", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/doctrine/instantiator/zipball/8e884e78f9f0eb1329e445619e04456e64d8051d", - "reference": "8e884e78f9f0eb1329e445619e04456e64d8051d", - "shasum": "" - }, - "require": { - "php": ">=5.3,<8.0-DEV" - }, - "require-dev": { - "athletic/athletic": "~0.1.8", - "ext-pdo": "*", - "ext-phar": "*", - "phpunit/phpunit": "~4.0", - "squizlabs/php_codesniffer": "~2.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "Doctrine\\Instantiator\\": "src/Doctrine/Instantiator/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Marco Pivetta", - "email": "ocramius@gmail.com", - "homepage": "http://ocramius.github.com/" - } - ], - "description": "A small, lightweight utility to instantiate objects in PHP without invoking their constructors", - "homepage": "https://github.com/doctrine/instantiator", - "keywords": [ - "constructor", - "instantiate" - ], - "support": { - "issues": "https://github.com/doctrine/instantiator/issues", - "source": "https://github.com/doctrine/instantiator/tree/1.0.5" - }, - "funding": [ - { - "url": "https://www.doctrine-project.org/sponsorship.html", - "type": "custom" - }, - { - "url": "https://www.patreon.com/phpdoctrine", - "type": "patreon" - }, - { - "url": "https://tidelift.com/funding/github/packagist/doctrine%2Finstantiator", - "type": "tidelift" - } - ], - "time": "2015-06-14T21:17:01+00:00" - }, - { - "name": "myclabs/deep-copy", - "version": "1.7.0", - "source": { - "type": "git", - "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "reference": "3b8a3a99ba1f6a3952ac2747d989303cbd6b7a3e", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "doctrine/collections": "^1.0", - "doctrine/common": "^2.6", - "phpunit/phpunit": "^4.1" - }, - "type": "library", - "autoload": { - "files": [ - "src/DeepCopy/deep_copy.php" - ], - "psr-4": { - "DeepCopy\\": "src/DeepCopy/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "description": "Create deep copies (clones) of your objects", - "keywords": [ - "clone", - "copy", - "duplicate", - "object", - "object graph" - ], - "support": { - "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.x" - }, - "time": "2017-10-19T19:58:43+00:00" - }, - { - "name": "phpdocumentor/reflection-common", - "version": "1.0.1", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionCommon.git", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "reference": "21bdeb5f65d7ebf9f43b1b25d404f87deab5bfb6", - "shasum": "" - }, - "require": { - "php": ">=5.5" - }, - "require-dev": { - "phpunit/phpunit": "^4.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Jaap van Otterdijk", - "email": "opensource@ijaap.nl" - } - ], - "description": "Common reflection classes used by phpdocumentor to reflect the code structure", - "homepage": "http://www.phpdoc.org", - "keywords": [ - "FQSEN", - "phpDocumentor", - "phpdoc", - "reflection", - "static analysis" - ], - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", - "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/master" - }, - "time": "2017-09-11T18:02:19+00:00" - }, - { - "name": "phpdocumentor/reflection-docblock", - "version": "3.3.2", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", - "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/bf329f6c1aadea3299f08ee804682b7c45b326a2", - "reference": "bf329f6c1aadea3299f08ee804682b7c45b326a2", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0", - "phpdocumentor/reflection-common": "^1.0.0", - "phpdocumentor/type-resolver": "^0.4.0", - "webmozart/assert": "^1.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^4.4" - }, - "type": "library", - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", - "support": { - "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", - "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/release/3.x" - }, - "time": "2017-11-10T14:09:06+00:00" - }, - { - "name": "phpdocumentor/type-resolver", - "version": "0.4.0", - "source": { - "type": "git", - "url": "https://github.com/phpDocumentor/TypeResolver.git", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/9c977708995954784726e25d0cd1dddf4e65b0f7", - "reference": "9c977708995954784726e25d0cd1dddf4e65b0f7", - "shasum": "" - }, - "require": { - "php": "^5.5 || ^7.0", - "phpdocumentor/reflection-common": "^1.0" - }, - "require-dev": { - "mockery/mockery": "^0.9.4", - "phpunit/phpunit": "^5.2||^4.8.24" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "psr-4": { - "phpDocumentor\\Reflection\\": [ - "src/" - ] - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Mike van Riel", - "email": "me@mikevanriel.com" - } - ], - "support": { - "issues": "https://github.com/phpDocumentor/TypeResolver/issues", - "source": "https://github.com/phpDocumentor/TypeResolver/tree/master" - }, - "time": "2017-07-14T14:27:02+00:00" - }, - { - "name": "phpspec/prophecy", - "version": "v1.10.3", - "source": { - "type": "git", - "url": "https://github.com/phpspec/prophecy.git", - "reference": "451c3cd1418cf640de218914901e51b064abb093" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/phpspec/prophecy/zipball/451c3cd1418cf640de218914901e51b064abb093", - "reference": "451c3cd1418cf640de218914901e51b064abb093", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.3|^7.0", - "phpdocumentor/reflection-docblock": "^2.0|^3.0.2|^4.0|^5.0", - "sebastian/comparator": "^1.2.3|^2.0|^3.0|^4.0", - "sebastian/recursion-context": "^1.0|^2.0|^3.0|^4.0" - }, - "require-dev": { - "phpspec/phpspec": "^2.5 || ^3.2", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.5 || ^7.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.10.x-dev" - } - }, - "autoload": { - "psr-4": { - "Prophecy\\": "src/Prophecy" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Konstantin Kudryashov", - "email": "ever.zet@gmail.com", - "homepage": "http://everzet.com" - }, - { - "name": "Marcello Duarte", - "email": "marcello.duarte@gmail.com" - } - ], - "description": "Highly opinionated mocking framework for PHP 5.3+", - "homepage": "https://github.com/phpspec/prophecy", - "keywords": [ - "Double", - "Dummy", - "fake", - "mock", - "spy", - "stub" - ], - "support": { - "issues": "https://github.com/phpspec/prophecy/issues", - "source": "https://github.com/phpspec/prophecy/tree/v1.10.3" - }, - "time": "2020-03-05T15:02:03+00:00" - }, - { - "name": "phpunit/php-code-coverage", - "version": "4.0.8", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "reference": "ef7b2f56815df854e66ceaee8ebe9393ae36a40d", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-xmlwriter": "*", - "php": "^5.6 || ^7.0", - "phpunit/php-file-iterator": "^1.3", - "phpunit/php-text-template": "^1.2", - "phpunit/php-token-stream": "^1.4.2 || ^2.0", - "sebastian/code-unit-reverse-lookup": "^1.0", - "sebastian/environment": "^1.3.2 || ^2.0", - "sebastian/version": "^1.0 || ^2.0" - }, - "require-dev": { - "ext-xdebug": "^2.1.4", - "phpunit/phpunit": "^5.7" - }, - "suggest": { - "ext-xdebug": "^2.5.1" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "4.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", - "homepage": "https://github.com/sebastianbergmann/php-code-coverage", - "keywords": [ - "coverage", - "testing", - "xunit" - ], - "support": { - "irc": "irc://irc.freenode.net/phpunit", - "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/4.0" - }, - "time": "2017-04-02T07:44:40+00:00" - }, - { - "name": "phpunit/php-file-iterator", - "version": "1.4.5", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/730b01bc3e867237eaac355e06a36b85dd93a8b4", - "reference": "730b01bc3e867237eaac355e06a36b85dd93a8b4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "FilterIterator implementation that filters files based on a list of suffixes.", - "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", - "keywords": [ - "filesystem", - "iterator" - ], - "support": { - "irc": "irc://irc.freenode.net/phpunit", - "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/1.4.5" - }, - "time": "2017-11-27T13:52:08+00:00" - }, - { - "name": "phpunit/php-text-template", - "version": "1.2.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-text-template.git", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "type": "library", - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Simple template engine.", - "homepage": "https://github.com/sebastianbergmann/php-text-template/", - "keywords": [ - "template" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-text-template/issues", - "source": "https://github.com/sebastianbergmann/php-text-template/tree/1.2.1" - }, - "time": "2015-06-21T13:50:34+00:00" - }, - { - "name": "phpunit/php-timer", - "version": "1.0.9", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "reference": "3dcf38ca72b158baf0bc245e9184d3fdffa9c46f", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Utility class for timing", - "homepage": "https://github.com/sebastianbergmann/php-timer/", - "keywords": [ - "timer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/master" - }, - "time": "2017-02-26T11:10:40+00:00" - }, - { - "name": "phpunit/php-token-stream", - "version": "1.4.12", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/php-token-stream.git", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/1ce90ba27c42e4e44e6d8458241466380b51fa16", - "reference": "1ce90ba27c42e4e44e6d8458241466380b51fa16", - "shasum": "" - }, - "require": { - "ext-tokenizer": "*", - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Wrapper around PHP's tokenizer extension.", - "homepage": "https://github.com/sebastianbergmann/php-token-stream/", - "keywords": [ - "tokenizer" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/php-token-stream/issues", - "source": "https://github.com/sebastianbergmann/php-token-stream/tree/1.4" - }, - "abandoned": true, - "time": "2017-12-04T08:55:13+00:00" - }, - { - "name": "phpunit/phpunit", - "version": "5.7.27", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", - "reference": "b7803aeca3ccb99ad0a506fa80b64cd6a56bbc0c", - "shasum": "" - }, - "require": { - "ext-dom": "*", - "ext-json": "*", - "ext-libxml": "*", - "ext-mbstring": "*", - "ext-xml": "*", - "myclabs/deep-copy": "~1.3", - "php": "^5.6 || ^7.0", - "phpspec/prophecy": "^1.6.2", - "phpunit/php-code-coverage": "^4.0.4", - "phpunit/php-file-iterator": "~1.4", - "phpunit/php-text-template": "~1.2", - "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "^3.2", - "sebastian/comparator": "^1.2.4", - "sebastian/diff": "^1.4.3", - "sebastian/environment": "^1.3.4 || ^2.0", - "sebastian/exporter": "~2.0", - "sebastian/global-state": "^1.1", - "sebastian/object-enumerator": "~2.0", - "sebastian/resource-operations": "~1.0", - "sebastian/version": "^1.0.6|^2.0.1", - "symfony/yaml": "~2.1|~3.0|~4.0" - }, - "conflict": { - "phpdocumentor/reflection-docblock": "3.0.2" - }, - "require-dev": { - "ext-pdo": "*" - }, - "suggest": { - "ext-xdebug": "*", - "phpunit/php-invoker": "~1.1" - }, - "bin": [ - "phpunit" - ], - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "5.7.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "The PHP Unit Testing framework.", - "homepage": "https://phpunit.de/", - "keywords": [ - "phpunit", - "testing", - "xunit" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/5.7.27" - }, - "time": "2018-02-01T05:50:59+00:00" - }, - { - "name": "phpunit/phpunit-mock-objects", - "version": "3.4.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/a23b761686d50a560cc56233b9ecf49597cc9118", - "reference": "a23b761686d50a560cc56233b9ecf49597cc9118", - "shasum": "" - }, - "require": { - "doctrine/instantiator": "^1.0.2", - "php": "^5.6 || ^7.0", - "phpunit/php-text-template": "^1.2", - "sebastian/exporter": "^1.2 || ^2.0" - }, - "conflict": { - "phpunit/phpunit": "<5.4.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.4" - }, - "suggest": { - "ext-soap": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "3.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sb@sebastian-bergmann.de", - "role": "lead" - } - ], - "description": "Mock Object library for PHPUnit", - "homepage": "https://github.com/sebastianbergmann/phpunit-mock-objects/", - "keywords": [ - "mock", - "xunit" - ], - "support": { - "irc": "irc://irc.freenode.net/phpunit", - "issues": "https://github.com/sebastianbergmann/phpunit-mock-objects/issues", - "source": "https://github.com/sebastianbergmann/phpunit-mock-objects/tree/3.4" - }, - "abandoned": true, - "time": "2017-06-30T09:13:00+00:00" - }, - { - "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.2", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "require-dev": { - "phpunit/phpunit": "^8.5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Looks up which function or method a line of code belongs to", - "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", - "support": { - "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2" - }, - "funding": [ - { - "url": "https://github.com/sebastianbergmann", - "type": "github" - } - ], - "time": "2020-11-30T08:15:22+00:00" - }, - { - "name": "sebastian/comparator", - "version": "1.2.4", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "reference": "2b7424b55f5047b47ac6e5ccb20b2aea4011d9be", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/diff": "~1.2", - "sebastian/exporter": "~1.2 || ~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.2.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides the functionality to compare PHP values for equality", - "homepage": "http://www.github.com/sebastianbergmann/comparator", - "keywords": [ - "comparator", - "compare", - "equality" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/1.2" - }, - "time": "2017-01-29T09:50:25+00:00" - }, - { - "name": "sebastian/diff", - "version": "1.4.3", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "reference": "7f066a26a962dbe58ddea9f72a4e82874a3975a4", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.4-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Kore Nordmann", - "email": "mail@kore-nordmann.de" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Diff implementation", - "homepage": "https://github.com/sebastianbergmann/diff", - "keywords": [ - "diff" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/1.4" - }, - "time": "2017-05-22T07:24:03+00:00" - }, - { - "name": "sebastian/environment", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "reference": "5795ffe5dc5b02460c3e34222fee8cbe245d8fac", - "shasum": "" - }, - "require": { - "php": "^5.6 || ^7.0" - }, - "require-dev": { - "phpunit/phpunit": "^5.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides functionality to handle HHVM/PHP environments", - "homepage": "http://www.github.com/sebastianbergmann/environment", - "keywords": [ - "Xdebug", - "environment", - "hhvm" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/master" - }, - "time": "2016-11-26T07:53:53+00:00" - }, - { - "name": "sebastian/exporter", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "reference": "ce474bdd1a34744d7ac5d6aad3a46d48d9bac4c4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3", - "sebastian/recursion-context": "~2.0" - }, - "require-dev": { - "ext-mbstring": "*", - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Volker Dusch", - "email": "github@wallbash.com" - }, - { - "name": "Bernhard Schussek", - "email": "bschussek@2bepublished.at" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides the functionality to export PHP variables for visualization", - "homepage": "http://www.github.com/sebastianbergmann/exporter", - "keywords": [ - "export", - "exporter" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/master" - }, - "time": "2016-11-19T08:54:04+00:00" - }, - { - "name": "sebastian/global-state", - "version": "1.1.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/bc37d50fea7d017d3d340f230811c9f1d7280af4", - "reference": "bc37d50fea7d017d3d340f230811c9f1d7280af4", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.2" - }, - "suggest": { - "ext-uopz": "*" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Snapshotting of global state", - "homepage": "http://www.github.com/sebastianbergmann/global-state", - "keywords": [ - "global state" - ], - "support": { - "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/1.1.1" - }, - "time": "2015-10-12T03:26:01+00:00" - }, - { - "name": "sebastian/object-enumerator", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/1311872ac850040a79c3c058bea3e22d0f09cbb7", - "reference": "1311872ac850040a79c3c058bea3e22d0f09cbb7", - "shasum": "" - }, - "require": { - "php": ">=5.6", - "sebastian/recursion-context": "~2.0" - }, - "require-dev": { - "phpunit/phpunit": "~5" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Traverses array structures and object graphs to enumerate all referenced objects", - "homepage": "https://github.com/sebastianbergmann/object-enumerator/", - "support": { - "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/master" - }, - "time": "2017-02-18T15:18:39+00:00" - }, - { - "name": "sebastian/recursion-context", - "version": "2.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "reference": "2c3ba150cbec723aa057506e73a8d33bdb286c9a", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "require-dev": { - "phpunit/phpunit": "~4.4" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Jeff Welch", - "email": "whatthejeff@gmail.com" - }, - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - }, - { - "name": "Adam Harvey", - "email": "aharvey@php.net" - } - ], - "description": "Provides functionality to recursively process PHP variables", - "homepage": "http://www.github.com/sebastianbergmann/recursion-context", - "support": { - "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/master" - }, - "time": "2016-11-19T07:33:16+00:00" - }, - { - "name": "sebastian/resource-operations", - "version": "1.0.0", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", - "shasum": "" - }, - "require": { - "php": ">=5.6.0" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de" - } - ], - "description": "Provides a list of PHP built-in functions that operate on resources", - "homepage": "https://www.github.com/sebastianbergmann/resource-operations", - "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/master" - }, - "time": "2015-07-28T20:34:47+00:00" - }, - { - "name": "sebastian/version", - "version": "2.0.1", - "source": { - "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/99732be0ddb3361e16ad77b68ba41efc8e979019", - "reference": "99732be0ddb3361e16ad77b68ba41efc8e979019", - "shasum": "" - }, - "require": { - "php": ">=5.6" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-master": "2.0.x-dev" - } - }, - "autoload": { - "classmap": [ - "src/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "BSD-3-Clause" - ], - "authors": [ - { - "name": "Sebastian Bergmann", - "email": "sebastian@phpunit.de", - "role": "lead" - } - ], - "description": "Library that helps with managing the version number of Git-hosted PHP projects", - "homepage": "https://github.com/sebastianbergmann/version", - "support": { - "issues": "https://github.com/sebastianbergmann/version/issues", - "source": "https://github.com/sebastianbergmann/version/tree/master" - }, - "time": "2016-10-03T07:35:21+00:00" - }, - { - "name": "symfony/polyfill-ctype", - "version": "v1.19.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "aed596913b70fae57be53d86faa2e9ef85a2297b" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/aed596913b70fae57be53d86faa2e9ef85a2297b", - "reference": "aed596913b70fae57be53d86faa2e9ef85a2297b", - "shasum": "" - }, - "require": { - "php": ">=5.3.3" - }, - "suggest": { - "ext-ctype": "For best performance" - }, - "type": "library", - "extra": { - "branch-alias": { - "dev-main": "1.19-dev" - }, - "thanks": { - "name": "symfony/polyfill", - "url": "https://github.com/symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Ctype\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Gert de Pagter", - "email": "BackEndTea@gmail.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for ctype functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "ctype", - "polyfill", - "portable" - ], - "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.19.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-23T09:01:57+00:00" - }, - { - "name": "symfony/yaml", - "version": "v3.4.47", - "source": { - "type": "git", - "url": "https://github.com/symfony/yaml.git", - "reference": "88289caa3c166321883f67fe5130188ebbb47094" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/yaml/zipball/88289caa3c166321883f67fe5130188ebbb47094", - "reference": "88289caa3c166321883f67fe5130188ebbb47094", - "shasum": "" - }, - "require": { - "php": "^5.5.9|>=7.0.8", - "symfony/polyfill-ctype": "~1.8" - }, - "conflict": { - "symfony/console": "<3.4" - }, - "require-dev": { - "symfony/console": "~3.4|~4.0" - }, - "suggest": { - "symfony/console": "For validating YAML files using the lint command" - }, - "type": "library", - "autoload": { - "psr-4": { - "Symfony\\Component\\Yaml\\": "" - }, - "exclude-from-classmap": [ - "/Tests/" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Fabien Potencier", - "email": "fabien@symfony.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony Yaml Component", - "homepage": "https://symfony.com", - "support": { - "source": "https://github.com/symfony/yaml/tree/v3.4.47" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2020-10-24T10:57:07+00:00" - }, - { - "name": "webmozart/assert", - "version": "1.9.1", - "source": { - "type": "git", - "url": "https://github.com/webmozarts/assert.git", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/webmozarts/assert/zipball/bafc69caeb4d49c39fd0779086c03a3738cbb389", - "reference": "bafc69caeb4d49c39fd0779086c03a3738cbb389", - "shasum": "" - }, - "require": { - "php": "^5.3.3 || ^7.0 || ^8.0", - "symfony/polyfill-ctype": "^1.8" - }, - "conflict": { - "phpstan/phpstan": "<0.12.20", - "vimeo/psalm": "<3.9.1" - }, - "require-dev": { - "phpunit/phpunit": "^4.8.36 || ^7.5.13" - }, - "type": "library", - "autoload": { - "psr-4": { - "Webmozart\\Assert\\": "src/" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Bernhard Schussek", - "email": "bschussek@gmail.com" - } - ], - "description": "Assertions to validate method input/output with nice error messages.", - "keywords": [ - "assert", - "check", - "validate" - ], - "support": { - "issues": "https://github.com/webmozarts/assert/issues", - "source": "https://github.com/webmozarts/assert/tree/1.9.1" - }, - "time": "2020-07-08T17:02:28+00:00" - } - ], - "aliases": [], - "minimum-stability": "stable", - "stability-flags": [], - "prefer-stable": false, - "prefer-lowest": false, - "platform": { - "php": ">=5.6.0", - "ext-curl": "*", - "ext-json": "*" - }, - "platform-dev": [], - "platform-overrides": { - "php": "5.6" - }, - "plugin-api-version": "2.2.0" -} diff --git a/phpstan.dist.neon b/phpstan.dist.neon new file mode 100644 index 00000000..1cdf47d8 --- /dev/null +++ b/phpstan.dist.neon @@ -0,0 +1,14 @@ +parameters: + level: max + phpVersion: + min: 80100 + max: 80499 + paths: + - src + - tests + ignoreErrors: + - identifier: parameter.defaultValue + - identifier: trait.unused + - identifier: property.onlyWritten + + reportUnmatchedIgnoredErrors: false diff --git a/phpunit.xml.dist b/phpunit.xml.dist index 00dd3c89..41860103 100644 --- a/phpunit.xml.dist +++ b/phpunit.xml.dist @@ -1,17 +1,18 @@ - + - - - src - - - - - tests - - + cacheDirectory=".phpunit.cache" + colors="true" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd" +> + + + ./src + + + + + ./tests + + diff --git a/release-please-config.json b/release-please-config.json new file mode 100644 index 00000000..1891660d --- /dev/null +++ b/release-please-config.json @@ -0,0 +1,66 @@ +{ + "packages": { + ".": {} + }, + "$schema": "https://raw.githubusercontent.com/stainless-api/release-please/main/schemas/config.json", + "include-v-in-tag": true, + "include-component-in-tag": false, + "versioning": "prerelease", + "prerelease": true, + "bump-minor-pre-major": true, + "bump-patch-for-minor-pre-major": false, + "pull-request-header": "Automated Release PR", + "pull-request-title-pattern": "release: ${version}", + "changelog-sections": [ + { + "type": "feat", + "section": "Features" + }, + { + "type": "fix", + "section": "Bug Fixes" + }, + { + "type": "perf", + "section": "Performance Improvements" + }, + { + "type": "revert", + "section": "Reverts" + }, + { + "type": "chore", + "section": "Chores" + }, + { + "type": "docs", + "section": "Documentation" + }, + { + "type": "style", + "section": "Styles" + }, + { + "type": "refactor", + "section": "Refactors" + }, + { + "type": "test", + "section": "Tests", + "hidden": true + }, + { + "type": "build", + "section": "Build System" + }, + { + "type": "ci", + "section": "Continuous Integration", + "hidden": true + } + ], + "release-type": "php", + "extra-files": [ + "README.md" + ] +} \ No newline at end of file diff --git a/sample/README.md b/sample/README.md deleted file mode 100644 index 2b83ab87..00000000 --- a/sample/README.md +++ /dev/null @@ -1,15 +0,0 @@ -# Running the sample application - -### Step 1 -Open `sample.php` and fill the account details: -```php -$public_key = 'your_public_key'; -$your_private_key = 'your_private_key'; -$url_end_point = 'https://ik.imagekit.io/demo'; -``` - -### Step 2: -Run the `sample.php` file. -```bash -php sample.php -``` \ No newline at end of file diff --git a/sample/file_management/index.php b/sample/file_management/index.php deleted file mode 100644 index 2d8e3ada..00000000 --- a/sample/file_management/index.php +++ /dev/null @@ -1,319 +0,0 @@ -listFiles(); - -echo "\n\n"; -echo "1. List All Files: \n"; -echo "\033[01;32m".print_r($listFiles,true)."\033[0m"; -echo "\n"; - -$file_id = $listFiles->result[0]->fileId; -$version_id = $listFiles->result[0]->versionInfo->id; -$filePath = $listFiles->result[0]->filePath; -$sourceFilePath = $listFiles->result[0]->filePath; - -// List Filtered Files - -$listFilteredFiles = $imageKit->listFiles([ - "type" => "file", - "sort" => "ASC_CREATED", - "path" => "/sample-folder", - "fileType" => "all", - "limit" => 10, - "skip" => 0, - "tags" => ["tag3","tag4"], -]); - -echo "\n\n"; -echo "2. List Filtered Files: \n"; -echo "\033[01;32m".print_r($listFilteredFiles,true)."\033[0m"; -echo "\n"; - -// Advance Search Filtered Files - -$advanceSearchFilteredFiles = $imageKit->listFiles([ - "searchQuery" => '(size < "50kb" AND width > 500) OR (tags IN ["summer-sale","banner"])', -]); - -echo "\n\n"; -echo "3. Advance Search Filtered Files: \n"; -echo "\033[01;32m".print_r($advanceSearchFilteredFiles,true)."\033[0m"; -echo "\n"; - -// Get File Details -$getFileDetails = $imageKit->getFileDetails($file_id); - -echo "\n\n"; -echo "4. Get File Details: \n"; -echo "\033[01;32m".print_r($getFileDetails,true)."\033[0m"; -echo "\n"; - -// Get File Version Details -$getFileVersionDetails = $imageKit->getFileVersionDetails($file_id,$version_id); - -echo "\n\n"; -echo "5. Get File Version Details: \n"; -echo "\033[01;32m".print_r($getFileVersionDetails,true)."\033[0m"; -echo "\n"; - -// Get File Versions -$getFileVersions = $imageKit->getFileVersions($file_id); - - -echo "\n\n"; -echo "6. Get File Versions: \n"; -echo "\033[01;32m".print_r($getFileVersions,true)."\033[0m"; -echo "\n"; - -// Update File Details -$updateData = [ - "removeAITags" => "all", // "all" or ["tag1","tag2"] - "webhookUrl" => "https://example.com/webhook", - "tags" => ["tag3", "tag4"], -]; - -$updateFileDetails = $imageKit->updateFileDetails( - $file_id, - $updateData -); - -echo "\n\n"; -echo "7. Update File Details: \n"; -echo "\033[01;32m".print_r($updateFileDetails,true)."\033[0m"; -echo "\n"; - -// Add Tags (Bulk) -$fileIds = [$file_id]; -$tags = ['image_tag_1', 'image_tag_2']; - -$bulkAddTags = $imageKit->bulkAddTags($fileIds, $tags); - -echo "\n\n"; -echo "8. Add Tags (Bulk): \n"; -echo "\033[01;32m".print_r($bulkAddTags,true)."\033[0m"; -echo "\n"; - -// Remove Tags (Bulk) -$fileIds = [$file_id]; -$tags = ['image_tag_1', 'image_tag_2']; - -$bulkRemoveTags = $imageKit->bulkRemoveTags($fileIds, $tags); - -echo "\n\n"; -echo "9. Remove Tags (Bulk): \n"; -echo "\033[01;32m".print_r($bulkRemoveTags,true)."\033[0m"; -echo "\n"; - -// Remove AI Tags (Bulk) -$fileIds = [$file_id]; -$AITags = ['image_AITag_1', 'image_AITag_2']; - -$bulkRemoveAITags = $imageKit->bulkRemoveAITags($fileIds, $AITags); - -echo "\n\n"; -echo "10. Remove AI Tags (Bulk): \n"; -echo "\033[01;32m".print_r($bulkRemoveAITags,true)."\033[0m"; -echo "\n"; - -// Copy File - -$destinationPath = '/sample-folder2/'; -$copyFile = $imageKit->copy([ - 'sourceFilePath' => $sourceFilePath, - 'destinationPath' => $destinationPath, - 'includeFileVersions' => false -]); - -echo "\n\n"; -echo "11. Copy File: \n"; -echo "\033[01;32m".print_r($copyFile,true)."\033[0m"; -echo "\n"; - -// Move File - -$destinationPath = '/'; -$moveFile = $imageKit->move([ - 'sourceFilePath' => '/sample-folder2/default-image.jpg', - 'destinationPath' => $destinationPath -]); - -echo "\n\n"; -echo "12. Move File: \n"; -echo "\033[01;32m".print_r($moveFile,true)."\033[0m"; -echo "\n"; - -// Rename File with purge cache false - -$newFileName = 'sample-file2.jpg'; -$renameFile = $imageKit->rename([ - 'filePath' => $filePath, - 'newFileName' => $newFileName, - 'purgeCache' => false -]); - -echo "\n\n"; -echo "13. Rename File with Pruge Cache False: \n"; -echo "\033[01;32m".print_r($renameFile,true)."\033[0m"; -echo "\n"; - -// Rename File with Purge Cache true - -$newFileName = 'sample-file3.jpg'; -$renameFile = $imageKit->renameFile([ - 'filePath' => $filePath, - 'newFileName' => $newFileName, -], true); - -echo "\n\n"; -echo "14. Rename File with Pruge Cache True: \n"; -echo "\033[01;32m".print_r($renameFile,true)."\033[0m"; -echo "\n"; - -// Restore File Version - -$restoreFileVersion = $imageKit->restoreFileVersion([ - 'fileId' => $file_id, - 'versionId' => $version_id, -]); - -echo "\n\n"; -echo "15. Restore File Version: \n"; -echo "\033[01;32m".print_r($restoreFileVersion,true)."\033[0m"; -echo "\n"; - -// Create Folder - -$folderName = 'new-folder'; -$parentFolderPath = '/'; -$createFolder = $imageKit->createFolder([ - 'folderName' => $folderName, - 'parentFolderPath' => $parentFolderPath, -]); - -echo "\n\n"; -echo "16. Create Folder: \n"; -echo "\033[01;32m".print_r($createFolder,true)."\033[0m"; -echo "\n"; - -// Copy Folder - -$sourceFolderPath = $folderName; -$destinationPath = '/sample-folder'; -$includeFileVersions = false; -$copyFolder = $imageKit->copyFolder([ - 'sourceFolderPath' => $sourceFolderPath, - 'destinationPath' => $destinationPath, - 'includeFileVersions' => $includeFileVersions -]); - -echo "\n\n"; -echo "17. Copy Folder: \n"; -echo "\033[01;32m".print_r($copyFolder,true)."\033[0m"; -echo "\n"; - -// Move Folder - -$sourceFolderPath = $folderName; -$destinationPath = '/sample-folder'; -$moveFolder = $imageKit->moveFolder([ - 'sourceFolderPath' => $sourceFolderPath, - 'destinationPath' => $destinationPath -]); - -$job_id = $moveFolder->result->jobId; - -echo "\n\n"; -echo "18. Move Folder: \n"; -echo "\033[01;32m".print_r($moveFolder,true)."\033[0m"; -echo "\n"; - - -// Delete Folder -$folderPath = '/sample-folder/new-folder'; -$deleteFolder = $imageKit->deleteFolder($folderPath); - -echo "\n\n"; -echo "19. Delete Folder: \n"; -echo "\033[01;32m".print_r($deleteFolder,true)."\033[0m"; -echo "\n"; - -// Bulk Job Status - -$bulkJobStatus = $imageKit->getBulkJobStatus($job_id); - -echo "\n\n"; -echo "20. Bulk Job Status: \n"; -echo "\033[01;32m".print_r($bulkJobStatus,true)."\033[0m"; -echo "\n"; - -// Purge Cache - -$image_url = $url_end_point.'/sample-folder/default-image.jpg'; -$purgeCache = $imageKit->purgeCache($image_url); -$cacheRequestId = $purgeCache->result->requestId; -echo "\n\n"; -echo "21. Purge Cache: \n"; -echo "\033[01;32m".print_r($purgeCache,true)."\033[0m"; -echo "\n"; - -// Purge Cache Status - -$getPurgeCacheStatus = $imageKit->getPurgeCacheStatus($cacheRequestId); - -echo "\n\n"; -echo "22. Purge Cache Status: \n"; -echo "\033[01;32m".print_r($getPurgeCacheStatus,true)."\033[0m"; -echo "\n"; - -// Get File Metadata (From File ID) - -$getFileMetadata = $imageKit->getFileMetaData($file_id); - -echo "\n\n"; -echo "23. Get File Metadata (From File ID): \n"; -echo "\033[01;32m".print_r($getFileMetadata,true)."\033[0m"; -echo "\n"; - -// Get File Metadata (From Remote URL) - -$getFileMetadata = $imageKit->getFileMetadataFromRemoteURL($image_url); - -echo "\n\n"; -echo "24. Get File Metadata (From Remote URL): \n"; -echo "\033[01;32m".print_r($getFileMetadata,true)."\033[0m"; -echo "\n"; - -// Delete File Version - -$deleteFileVersion = $imageKit->deleteFileVersion($file_id, $version_id); - -echo "\n\n"; -echo "25. Delete File Version: \n"; -echo "\033[01;32m".print_r($deleteFileVersion,true)."\033[0m"; -echo "\n"; - -// Delete File - -$deleteFile = $imageKit->deleteFile($file_id); - -echo "\n\n"; -echo "26. Delete File: \n"; -echo "\033[01;32m".print_r($deleteFile,true)."\033[0m"; -echo "\n"; - -// Delete Files (Bulk) - -$fileIds = [$file_id]; -$deleteFiles = $imageKit->bulkDeleteFiles($fileIds); - -echo "\n\n"; -echo "27. Delete Files (Bulk): \n"; -echo "\033[01;32m".print_r($deleteFiles,true)."\033[0m"; -echo "\n"; diff --git a/sample/metadata/index.php b/sample/metadata/index.php deleted file mode 100644 index 4c2fbed3..00000000 --- a/sample/metadata/index.php +++ /dev/null @@ -1,62 +0,0 @@ - "net_price", // required - "label" => "Net Price", // required - "schema" => [ // required - "type" => 'Number', // required - "minValue" => 1000, - "maxValue" => 5000, - ], -]; - -$createCustomMetadataField = $imageKit->createCustomMetadataField($body); - -echo "\n\n"; -echo "1. Create Fields: \n"; -echo "\033[01;32m".print_r($createCustomMetadataField,true)."\033[0m"; -echo "\n"; - -// Get Fields - -$includeDeleted = false; -$getCustomMetadataFields = $imageKit->getCustomMetadataFields($includeDeleted); -$customMetadataFieldId = $getCustomMetadataFields->result[0]->id; - -echo "\n\n"; -echo "2. Get Fields: \n"; -echo "\033[01;32m".print_r($getCustomMetadataFields,true)."\033[0m"; -echo "\n"; - -// Update Field - -$body = [ - "label" => "Net Price2", - "schema" => [ - "type"=>'Number' - ], -]; - -$updateCustomMetadataField = $imageKit->updateCustomMetadataField($customMetadataFieldId, $body); - -echo "\n\n"; -echo "3. Update Field: \n"; -echo "\033[01;32m".print_r($updateCustomMetadataField,true)."\033[0m"; -echo "\n"; - -// Delete Field - -$deleteCustomMetadataField = $imageKit->deleteCustomMetadataField($customMetadataFieldId); - -echo "\n\n"; -echo "4. Delete Field: \n"; -echo "\033[01;32m".print_r($deleteCustomMetadataField,true)."\033[0m"; -echo "\n"; - diff --git a/sample/sample.php b/sample/sample.php deleted file mode 100644 index ac3cc383..00000000 --- a/sample/sample.php +++ /dev/null @@ -1,31 +0,0 @@ -Q<0H13BF#rq{G&D36%)bE!2IdPa5*+M5 zpduo|BcY>WV4$O-qhsO_e#OMX$3{oTCBwxhA|fFn!Td`8jhy%!Au$Q@f0ID``xN#I zED9VP3NaQs7V-aYeD(s+;ULN(e?mc!10c~MpwJ;c`vHUi03_6Zs|EZYpr9cjVZH!h z;r?0iAOQav|IhT_69N(n8s>8qfCL2rfJB2r`}gKlX4!o_rLk^a$q){BTN;Cco1@lP zAch=X1|OH}m7Kz+lLpI)AM$$&CbD)nM!--OIh<4&LxhX1N*46YlXfLl1hqgEFmqab zIssv!>{!}p!xuAeoz*y}BM+go`AhmP2G)@powK!&`G}*`SM~1?$;5S64)loG0`oj% zt$Z9P+1BH_hPWXU-6aICX&jn!-T*JHQ%g7#rU<1%Xy1HnTEb+7rbyX{-vD4`uQ>zp z-5+my-E2_A^7GN!@ocOYs+Rz7SP7lZN=kvW3VEf+&o*R-<(y@|Qo&yF3*Bc3^gqM* zr&w6i?$w>DI(oL^i;xCVO45Zzm85O0=`_-$mGF`&`bp^i}7fE~94Nb3Qv-Vn_4d*F0_t@yUe#Ywd{Ad(gtPYqlgt;Z8khU61xRVzJ9h2mB zLBy--&G&Y+A@!DC&A8x2{I)VQX#Un{&q)alccx|2X_9Xcim7Z_FNPO1uQ@$tV+xWn zh(A@wgOJ$wv%Zyz&&nEP*M(_(_JXm(Ezr!-+A(s!+SQLKot7C_c@S#Vfw!f(-_<^D zfS&508^|HAhpNzb)LQtpDMcz>5n67EFtClygIo}2hQ*JtS@=yoH3uiy=!>Ju{lNYR zkf*?{9k6$r+R|D7)VQF3>z!OU|iB454ngBH` zvbQmNin=koN|njC`)P$6I+124^t#k)MeV|JN0XIulU2vZ6GFjg)@*XOFV+U>;p*q) zzgn1XLl!-&>--#EiXz*t`*c@ogOEv8F^mjZ0GpptNzHRC%Z~5ED7ttSg`i6GRhR88w}bvE2PKsEODdX zMu&A#H)V)Kf$poJ7_}tk6j;%Z5sK7-QF#SnYz1|US)OF+LZv_*fnR%SX19p4nT<>~t!l7TPSq9#a4aXA*1lm>OT~C-cdzAWcbcw&vFsMmwuwB76>`7*=GiCfLL^j&h zdMSB~f7KELz9r_86{-QnsY}Xj6Xw|y;QkOW6PF|Xkfk;99w zs1=;fS=v_T9jO12P%PN=25GyMk>i?4V~op}X~q(?HA+r^ zoNhbpzdhA9%3@6x^iXJ!SImeLO$2V{(@P5s{{1{ZGOz1+#qi?^aW-Q(Db; zt+&!D7wIt38g(i2YX_^523d*<5h2ieN|cU8zb{;5##V?h4fGbW%N-ibS-0qw5E3)4 zTlKb5Ami@LS~!R*-XE&-!Wq$J!#LTtCK~n+PQ?^?2k=)$7e)&t9@jZ0p>ip)8?kzu z*p|z3UpJ|?$@8tc4XTZCr^byy&7PItLRfaWqg`x`24u?TRH@Dld3kZ@Ih4cW!_XTu zq68H{GefBAj1~4$s#0RbDDI`&sebf9JI6NjzStAYss;UiwG1U3Y^|qhSPJ_RT0L@?;c@T!?At1BdDw9#OD)uhyp4+A zyn24qFy4USzTR%2K~>t}+uI}MyY_pdL$&22YbFo*SRy`${`6J}SoPYPo5_Ic}mitRWCynoU z6#`@2X5OU;yDlb1F=zg$v37&{t6g#)ZKDL%(g?ky#r4jqvqGt7$##!+cX9a4;3l~l zL+p*WIwv4=n29`HJ7d5tU#@dDgg>t_+f8Da7W<74?gKT*5(anccTEP96~;7|DPB_x z@hf<5jdOjP-YG43LKl>NvT#lVyj>#_v?EaPOZHUwDL%Szq;vWsc2VbG)X$l{w#d0E zeE)oL0Q)=RrF-d7Dwhp{lg);1GAlwrx9Qawj4yKRrf5h6KO1=iXwz2STWdUT*6z^maX_1SNs0)%mhw{>Cp^Vq@}l1xV>J z?XJiPc4}T3hstf-t&wv@OCw!6hD4X9HhzJzyZ8>`J3%!)BIV?SKB4S1jI_CRw?|O>kE@5M# zT%WyxA|-IIwUQ15-uwL3BMzf6^F(aB;7rKgoJ{?p^7cC5QlY=f;Q~C3Co8% zr+nS1F7NQs2K;Sp93uB}*t)Yij_&E50$5k9FE`Ha)D?~G9f!56IyXy6Vybu@CYy$u z(;m!KK6w$RMTAS9(~iE3f()9swgh39tqjH91%oq{`s0wV^2{dGX>lKZp1TjJK3?7B zY`^HFGAkvi@!v8O<1<+Q34kqCpit$p<^PTSFESi!o2IFMq%}PgN4g^e)w^e(oky-r`iN z=`A@#@7IJ#o57f8n>B%;0gAG%0-wBuA&O(!pNsNY41Nyt@@6nK43Qm^Vue4YAO`5( zEuv4?kY2Uyg!Q4m%1DPEHR{rVU~u7BbU@%zFlpZW+wA$SHzhfoLw;4lNbwd?xF(JTSTq)Z1sLV z)|E^TPCFijkGt{mYI5KCr@5vpeAS=4^ZMiB&}0XW^|Bd~S?$Y`d1O4ql`)_aGupPJ z(O`2MjDQHtb8^1B6?m@|iXVL3Gm-F0GLo918VDohhCgx-!ZqC^Nl+Z|{ON}hx-#aM zbko501N$w6JRp#Vjx()B7Q&DXIN>NmpX)C8@=C_+P9r+L8 z6{3;rJDs)^sm$gGJy?CoEN5-4dnN0Hp164q3{RlSD>rTn|1i<7?#Q^CQV=73>ZDv|D(*zb7i<8%6OU)7G+S3Hah zLEb78^S7nVR%wKhvestD2jcr#cJf z!D`sn&KUDe-uVt{a2qCY(_h9I#;O8_$29E)aQN-GQ{s!`_Fdd67Mz-#;*T9+7=cCg z>>M`>FI;Rl4KEx`4WocZL3m$*BZOJDq7v7I^aW2h_Jzv)#7jl-(xw4XvjmLFYSna| z=ZWpC0`s4%ZagxXyK15($K~|AkqY&v>kY}F8Yy+gwfJEQ@dAZz2unO;QJfs+5Ai@O zOjqN2fI)RoXAI7!(O1!s;M;Pq#u+>|G%ryL4z^p@P#XNr7D@WFHqtX{Wh?H`Qut~f z(K_kp2vLG52ovjkw#GA0LSvk!Xh|iffSi}p=`VS|Hyn^**!9Ncoz{QQb^Wxnl8w%5 z_?575BQ8ewRP#m!V+FxQpUpuqmK2rIRpbe4b(sK3d4Zbc!F8&ZI!d>w5$D9&6vq-Q zJEI0Yu_=NM5*#~LJ7eIPfRjJmAd$*ilYcX>D{MPO;mz31OM}ra0xjOto&HRli@ja_ zZ8gs><9rE0n#O($PmwO=$jue9F0y@Bq3NaeSR_R@{?{Q7)W`O;Cth^ZRd+0@lNAm+c z^cVa2!DwM4$*}bFJGAed$E3vJmG_&KK=%B5x;lDE9Lq9kmN?cqu?Z;1m!_-M9 zgW(ir4@(d1vT*?J*0$ktJi!=A>v!`S?C7sO#;~~|aL~jdH1{{u8oXGpu}@uiK7G4z z!b7I$STKfHyf?LZgLkD)np_MY>2QLc3Wmn7aOwAkD?YK8xW3%bb^Arl)|VwO3?Dlo zaHRJn<`#-Wh_QNR zjIaJ0JLl|>3Jts?pr*U%q`y0ZoD|ZX?|Gh3;r-Ivxg@D7D`koEqozX8~if(D)Zc}^;FKE zy4B|u383zrzvG?nHGt;T{gHzNh4e`bss9sj5&{Ju)OThG78Doi6tCNMdySl{IWM_| z8L#f|e(KlSEIqg)_%R#$A;cO~4=;a@Lf;bF^9mn{;|eST`|k;UXT7EKsxt5v$rX8Z ze|SQ(_Y0kVKje*syQ|*!;Lh`{sd6WJQzJweezW?|+sjOp%Lsu-zD?h2~_p=9DC~$fVC~U_) za<_*>g?aKraQ;^B07`!F&YleH2M*&>=j3D)_C0k1e{1StTcDu2qWt5yuDFd3Z46x^ zEBSBE-E0}nKGy7yD4$6sjsrx|X^xLT@A5}U{%`L;D#xZ7)paQYkVfU@Ug`}%bpGS+l@5sPu$2Ns%zrZ-RKY7kLc z3A8dNC*Ypl>F`>Ys5HQbr`RmiNMmd%o+VEhR!%%O z*E&5HT=fGQ8%l9pJ^>?a>+ZLL6_qqgmJ^eb%EE<0cs}vF>P_DqHEsL#D~qEB2x)>O zu1}(?E}lc`Vw%;j=?qw7NyGp@eSh{H_j1(Ok)NVQPkg`f({+>^{Gd3V*#_U47NL!i zvdW2QgC(Kz*JIX_-Z~2GXb>4c40N*ab<37WR-1KHx-v4`Kn7<={&%B38WXT-rD3%} zOUe4BL7s!fKZiX66Hqa3FRT4^IpG3u=@0*oC0VsrPOi_-qsdR4GHrYUTA&vXl6q@U zNd$5+cNt_XZIJw1&Aml5%-cC!X-bG2 zLN=s_;FU<_usb{_F8;}67@jIBv@0Ta{g$}OfaAfQQk4G`;lnQ_vg z-ROL%Rj(|$m7FL+z+Y9GTs{Hac8Sh}llO#pG>6|!e~>Lkb;z6qa_IS^uhk7>o;ZnK zXrM(*t1D`f?MM(P&1fh78b*@TvC=ta{a2;9U0)Pe!xE(A0nR9Tm%gJ?-qrt2C)ZIo zc;=mk6S?W+=q^9J`f<`NLF~?uBp{3fFZ}?8&r$Q_k*E4*=J}%=#TQNiCXy#=qi~|T zF*K_C*_BNy%4Lt>k5-;Z)9^I@fiLppc&9HDD+NxHd2&-Jb)T#`=_62k!0}?ASC$|u zw<&prSEh*TDaDQ+OAdQmF}%)%YuP)>JlO!pSBX(Sqo}j}1~w9hl%Q)t=C5-C+euyW zU|s=2@JbD=bF7ieTMh7(XVIOzbRE3@{=K$VmHlKvCQQ#bZWd5l7C5BRo=o#5oF6Q9I%|(Lxc1#rmWC-E4i`}a#Fi=McpdVTW%rZ zN4Zx28#h~4mZ!H$Iy$s_@#w@*-e7I}=e?1!PHq5zWELf6m{Ydc-N^hW-w(4V^buB>o|7fEvj`G zvyLAes8=vOz}7#FyqQh>G2hEnIBHpGOSIFFk_FvbpwXYcYQ?emQT)X?AmfGW%x2v&mIX%Xu|O(VadA=Q(Qi6ZGC<<*l zjNa^N4BU=%=~t382iYy1es!>W!kSE3cLt}IQ%+nA3r9j@>L)p-HbsIdC~Dc;z~}*s z$?|n<7a|$HEhj}I3UZ-Q?R&+<8bB*5?p6ThMNMVWc@O@#3gT0)wRdyzlk@j8E5UgM z0MWn`YJXRn^_9USeY{l)FXfBxl0tTtVw= zsN2cOZgdCo*Fmd$^Rzr-@x!*?ujAHjHLkmnxcO~NG>E%X%OE%5YMx{ica1y_OO0ab z>;JH0B(%$-l}OLZGd-e2t#3s?t#2OD;L}EI3b2d~?b^7g^_tuPp$2Sbn0MBu6bPd! zL`d8e>(*iBfOfCMolLZ!fSF`ZLEKlJk&zfsB6y#e@D)ypCEZFc^QM*~i` zM|`dp?HBl1jp*bu_D{f#Y5YBIG|EpmMxeoTQPoD`O{8|pGf!!6WVdgKu774~vMv%1 zywYkZJ_)jaM8tAh78SoAex(LpNOk0U7o$~(<^ znq!D1`F$W7t=+&%XEEME4ispvOY3Xim-C*?;3MRm{ze(mGr`}E(< zq%y5<6}aaKsJKRI$%I%rX5%jm(3>8&;#choBmSbpr-JqvL&B&WeD6+45}+CFPzlp5 zx0ytP8)oMQO&xd=F_Zii1aSVE>yP4*wAw!NB8G~wdOMO_?NqznoaiqPHLAvXEWPu* zsqI#CiE?+bEgtX_I@VSiv!BR~O4uqL6q}5HHFrW_tAk{gG4^eh|3jrzEL`EuXS|})2uIjldG(Uf}~vP(dsUT+8SE)wysa0 zJ9TiquS|27zdd1( z(cp_i;9bGrSEB2upPun*WS;eKGFoDiwczYAuwp{PfO%k3jA?95i4 zE=ISbpQ(uaUKD|xk_fIAxj8O{(JhTal(qk&f~JBCxv0lBzUJ9g~W;t z;drllc)be0oO!{J}r-TszT z03zBFkqo#IV|}@l1t+<6MZ@*f)zJ<_8x8*%ShF}-VY#Di$l+$(Q29`Idk(?foXqt7 zSPxk#9W~Y~8qRQ>!{4*BSE6W?At3mQr;c^%9w2whvl6SK*O))A_eIT!Jf59kNO2a3 zwU?3^`>YbQA)tW>i?klda;y{g1dgzHj7^jHneESLb2yE^y)NE9Tu$uv8e>Z(j$)psa9Tlk7 zb#z>8qdPEOH*WQPsVBkAd>3P{X{v25cF|;{G1!#nAehw9_n4zUWgLddN^fNtfH*Hy z+dka0Gnvz>CcD>^Bs$Nkw1A(HYUk=R>M56f`MGIdvyv2^uvS-LtRd4f*HY$+)KuYe zUewfGLg`?On(b>ce@Yui?e_=Nc}V#{=%WkeDq%Ua6qlCPvLVby5{O!L&*;ssFJPt_ zJZiR1SI*3P&f}hbqch+m{0WektPeVw>@5_6`bRO?-|X+*p5g|PH}*))J4bC^3URVc zwf#*;)AZ9{pOWEXf=Nnt6Daifsckz~s;2$o{AgJCwV3*ZczrzUG@sIA-jQ4-n5M4U z9N9$m@1Saud??v!qD!6s;E7pzh4y+krmNAME>`&}W1G3TTMRtNR_5M{&@@>V=2p-< z@+Urcj@Dq@&(-yf{&_)Ca?lrB&yi(7jJpIY(wp(glinAm!xMZ(9is(5KgUeMPe9ct zAi=Vp*+0eQDo6M|+?|@~(rgww<~@!YiA3!;w7CJD~qa*W0PL^I0L))stc%#5-MYn%Qd zAJB{Yk|s+n3GrRe5MIZEtU)-6ZmZ}67n{3<`blPdC2{I&afP?j{FJTMlOe^9WS)=k z^^q`QwOgHu>hSV946#OIhFfcN4+uxsdzp2R&b#8~;&)>azcWG?5ip(d_^T}I`&0Tk zQYdJ4!FWxKxw!9b$smSj!3Ew@Wrg!y;~y=WK!UFFF4r#Mv>xdC5b%sO57)afL{F-b z5$<&i^l7Y$v=)uEQy$7BzK!Es{0b_Zlidmpsf;#|bSqLYCeN7y8fcE(l^tT9lE^1Q z^XB>5s-BgFG8IyAJD;9YcX}&ci2gasWYBKYH#bySGt?|T`Flcr?b`DR$R{~U;cs&a zD5H@1z_s;iD66)%wb40l(o|Rdi54Co!<({eaG346~N5A@toaSb-w!ugkixg~f9_p)4*`8c0VcUu0lV#`5B85F>{f z#(<_$ZOs9(=H7GpgH7c5p!IEty7rVlj|GjkdX<<}l}o`q>W;F9tG*Ri{kv|Q^0w34 zax!YkWT8y^z-l5}L%MaxzwB9tR6`nB+Z*2hO`TX8ilw|1dITF_$?7rQ2wM|*$y zPPZ-^EB?~htVhz*I`SooThKU|5NSO@t!%82`!;M^l0TUy!1Psn!A7u>eX)WB*Wuh6 ze>A#ZI65ZB-(QjN#OxrhiB1m8)2wK2lu_OF7B`_e&=J*?rECd<1!0(A?NRh0zLnb2 z1ZFr%E03$^##QP%%SK2)sepAK-6D>T-5Rw^pF6IWKInJ5ZbV~2msU0qX=FQ{r#o}S z+5~!N3X~TE)Lo&`i?z!;g9F;iOK7}76)OqB(q-`miBCaJ5u6O{;c2>%@p~!>CA|Qi zt7Nh&H|^!=fXU&2PKk^>?u^)__I85nh1i6a(70i9<$DQ{7PLha{-mao;gzu1mBH%9 zNQ*s#>)Q7f+%%!pcyHWgtn+s7cq#mOZCmRpFo*{C$c+ShML(3fYL{I(*6!N6ZJhpe z6oRd`D|N4?QKh~+_e&Sp4!=Z*6Cn^kJ)ICq19A4+JNv%H+eb&P6w|i=&GGIUNs$Ft zG31f-A!C+W@)1b!8tF|8H$kwWlMT#{pRFSUNX&2j+U3lVb^6j(oMgR(xBh6~*Hv_{ zs--a~aCSjbIt9I;Q(M&yr$~{Qg;S}t(HK_03+7%aPWhLn!hoz7#566a_tbqZKR|VY zk%qySw(74Q%d%@jUHwYoy=VBo_Ff-8A-0SXk8B2s{2KSmpz5MsQiS_?uYnZ)y9{M@ zLo}k^xeR1(Zupc}L$=3iXai7PvZJdTq>};U)CAv*c06zE-f&C zP#a*E6R|bTQ=eW@jmS}V{ILcKkgE^7^_M6v)CT6v zR$n?`QkXewJ(NRL3IqC$?d3`{$d%G)LBjHWlkScZ+LoAQWb~2R5k9AOWJ2Iy#o_*S z1N=%Br;C{~YmVQc!Y6^6DR=ah6XY`_0qrmh?F&+B+I{IBI-RH)>FNC0iP(1Yr${dI|Dd+afk?LgUYJ5w7 zS1)i-KWh{+uY9;&8f(RBIShDt{Rxb|3_lJZ6O>g}fC7%Sv~E&W28)T;D<)LS5{R|7 z6cJswjHgWZ)F-)SdHmgl+V>G2DELh<5GA`)%e8*9M#@fmm#UG1XqeCs-Z<^6)*pg}#(RTbx^+_q?h1<~Dw;^+Gwm8F$fbi(cM9x-#FC zvPoOPUnFodjYe+bl`JJmrXb{WT!Jxz-}Oa@HYC`!uV^YF>}^ zAyazW%6ODasr}kkUF8R0vr_?IJ)tI$s7tEWC~=-XTUoD>sG_w&kON7W?~!W{pmQ2a z%x4Y$4P*?vZ%k5RQ^aR9;9E9Z7iZT2Od7bu2k!{UTDq1K+4rH|M_RP%_Sh20wM{oB zHl3BKG(K947jc(fGbD)$XcdN{Fgm@e`6;3;{H>36CLV)tP0377U=3&W>FqkGR!$hO z8q~e=x6@_lqQeir@>8{ecx-)Cebd!6NQ+2=x8%90ch<8*fN5MIZcI#8wv;ucpoLYb zZF-{L-)~AuAyZ1BZYJonm}?x@M5)V|G7E#fc`ef)&k8og;skQhqo_F6m&@;S=CuXhqP4u5U*j4is?8N zN#U7&0c|xj!!vqXtsHVFYja&&xY6&$d`X#TRjO%T)=4{L&UISIh2euWbc<+5`$+Dj zk|W}itR*uD)H3{?aG6&*_EpxICG)Jg)~qNmR%@OSIS^Db)7#L=K`+U?_TVKOvuzf5b8judcw53RX%^Pp4d1};;I{?c}a?!VAx;pY2{zb!<{F!`I ziHxFy(9zBMuKH8)uTMTdspmz9!km%YkUf`cWXU&4jS&NhAx)M|*0~6A`z5vOic>PH z&d71DL9Yo%281WF&x|~QI9+U$s@|M$PzSiU;;_ms4INfL9+r)6;Ui4m)Qs5upiL3` zn-Hma#^X+T18`zY8!#P-ox-7oVtl!|dBtd{Q(iv-HgcZ;>ra5!CqTbf?qfMic3$FD>GlMwt5AkfeuNy%6- zzC*DnW0JEOL&J!O{tv7EPkbN@A)8uV7%9u7IRhMsJqBfN%^5y6c)ey%e~iB3HhV1$ zBr{3HR59pwF5Y)e3P$IqhzV7h>{k=Q?-b9Twaw*$BEV8aaJ`Y+?y^Y8A;rXU>j`{t_6-n9%}8hC=ERG z&rIBShX_S^Fi712*BR0FShZHJzm02BBGtxdwX)GmYQ^HC&4>YSyknVxy*>l-D^?Vv zE0!avKuG~&4SmqDNhEQyi@yn*h3WZlE(H@+WQb|ndm2A4oj~lo$up9loT0-O1xAxc zlug|bHht<1D+~Sdl*CLz6l)A0Q`%d6vhc5ivtw=C+vzcunG;~NZpdJXoSa<}V(Q2$ zUJQjxlt1}fWUY(Y(LffAi4H@93X44sk5q17x_}1`*U*YN-SW6nh)d8@@VJm@zXL$g?B@9TO`}Zg?8odC5@F@{ZV1VAYq_5Rtu@*MgA!KP<-Hvf{4_-?vnLH9V z+R+bM%L6f4p$NoLqK?ZuSut%i&u9b4Vxp1TL&==SCpZR6<&It&=VA(&n6;%PmQRlR z4_Z57GXoODda^UeN9c(W4ClGICLE^y``>8%#Y`8EJFS&PB{+EGWCnkWEzpRO%qCYf za%p9S`6Thwcj5-;zpm1h0K-hc|Mp++#1yCc^q+%M|9=h+^{*r3|Fkm@kmzV+7_3mF z-^rmdS=f|~|JT1E|MTztbcVW{{+oVb8G7cYV=aRjudzGBzOkc^r-o4GeNTh4S%XaT zv4ND3&ZVnr*=kAZk6rx(;vX7#TLmV{I9tVR1Cp%xW9(Sg7~@A zOuU$s)7KX&X;E*&aOpa_l|3=b{CkYw$2YA)lR5%+n<~V$KnnSqBgJSdIVi>KO&(i6&XgBLqKz55?jn<%T$g}p@B>Hx zt2c3&6{5wg(*|7bUN|o&N66$b30er%UopRn2?Gt-gfJB6TfaTft?>LO376O8=3F2OY%VMmHb z-Q(7}?3aHWUZL<^Q@cPJ6BoBPL(KHd*HPN~X!hs~nmJQ+>NYYakeCi{jGi>}BS9o4 zZL9LWrLO4toR+U;B38Wei(j_1p9E%N5lw+U`3&>Id?}jGo|$P6+`D+$tPqK`i!yc| zgS1(Lo49O>nLiQv4@MFRVkrs4!H*1&GV*5|#ke-6Hpap_x={h!o7~DQT8-f54l1pc zSNL|)r!uCo%HKCPanrkG@hei&b>c2c`5%~X`ea>cxVCkwR`BTLTXPfdiWooO>9C|E zj)OpX`WgQ8+|zr#)L$YQ>iWmX<@FR8*%S@J;o`zAy-j9U+#K;YB6Nt@Xha1nkK4o& zFdP|F6vd@V>W8q|Sfg;le~cWT)#gX=Pz3Pg9tVA39B0^SQ|H_6UabI=EbjTyu67;J zaeOgWzDW@(vab1`&u|EpO+~@M>e2ra)7B zglpH$xJUNZ#-jy=xWs6XdkOf$&k}mn510{$(z*FCD3UD1DF`N~X7_fZUt~$yhsA4k zsCx-ekxR>JNzqA}#njATX$*;1@4zc9ub3G`QZ~@)Fr`(A{Z=MFU4gli2@2850?pJ3 zqGODOySUK-qr;qX!((J;q~&TA3dOHqVyU-FqFg9N*ZTfddoUmLk@Vrc$P$^QmYc*q zu|vXeiGp?wPZ-rUISWt5=gqH-g)nybXbXz1iUC}RLgN=xeQza zzP){YCIi3Y>tkpX1|x8yF(m#j@?qlhG4*SE#DJbOv`vB0$k(@INshIusci2J3fHWn<`nLD-Q+^j9tgyNHTO zd~J`I>dX$-zdpY!HRs=T-#D(t|F`Gui!kITfXQ8#l-ECQ3Rl>wtDQnpWOT*ldI+0! zV(diTZ5}OWwYur|vZRl@mN}W>k6Z|InC=#PvYQrH8HbLL}RhGZ9 z`h8SSrZgEU>p8x{wS_U{9xz4x-Z2d{z_Y}w0@Im#D6tLo&Nc_SC+r4}bRuO6+(tHQO z9~2MdJvj;Ii10BoHQ5E!>aYfE*YdGoy!~uq^1qxDxqRgtNUoEbz^shxY@=0!3pC*y z`bG^*ljDE?VY(iT_P{3-Gby$uduGLOcYe5XvG4G^5OjXiJnkpWVJS4Ax%?3L1b*>G zC~UZ0K0G3vE?g-UyoENinp0P3RQ(_tcMned%eb#hD)J|{AM;fHzX1nQ}yf{)8PCdm ztZ1}3IhVLNe`9n@vI4YC=OAPxRL|}bg&iC%mui=0Ree+WYpW6Kq&FC+ZG}Fyz`@^f zwQ+HSlX%KxD>~G=05uH7*(~Dpkj7=#sklPt^$KYJaisaM7j*gw7_aAJv3fr1=P8~0 z04fPVp3d!-q))X?vp7GaTAn9++CY{ro-YudMu+mok{@}00@Rb6v~A)cA5~l*+-~_M zv~_GBWU@~mkYhmHo8Fm&wEpY{QTW*_ei;-?0WhP1HZ)xJ@>OO2BJGsSu@mm#6hqjT zp@wk{HDP88XMlBkU+K*q3DCc~#{1*U_B2rFIEIu8y}VI+WF}DYtbgt)9=EL&-|8n~ zBOhuITlQt>c2Nmt`TEh$$Ib=iS6(%5pDS5kH~BISZ?TqE8aDu9BJFG5y>MQ_gQnLj zf{DQ7xG!WDL*P>uiRA0h!&5m@ehN0T+Fw0N4rlSxD$LW^T}?;*$~lis>A{=*ZN`CR!$^b0X|J>ol-;hm9pCd+qLu%y zroKVFfUjp1?g#SYBu*<;e4;6pEjEC2I>Oae#Zq5iGKFOKjl zKs&r$F8kV8Yu`XA^@T~M-4R~-9|=iAMX%t)y{fsQ}{Ij3EnJm#P%<2~w6Kehv zqEcOo{SK0te_+{z@z>Z2NThUM$Ty_|G*TtkUI|AHjIFDIl}|@MuRGrYqJPHV zrk+Mt5hWdbud5^>H{b6|*jP7k~pB^;}BC>%l-HrOO2WfNU2;^(KJl?vj=SS^V zm$EAz0UJ5|OZ<7-^9UDY&&#@Oj)26`@;1+9F#3B>N%5qfuHWOA)L=JT?{G)9lc)(t z78Fh{pNtTySNdT6MxH?EX9sXgI+0*qyXlrpis0>^zA@8yjip_wLE9_#&N>zn#G zIub=37?GDhfU4naGj&WAXDweE0}bG|qew~rr2olxaxB<+vo=q=$2SEdwR0U{n>1=C zmpOi`ium!fSp5)L+jk#P=Zq#617-GWq#i8H%mWHPqA9MK2c8c9XlOQRq00u)YDRZA zTf56WOf+!{AkZ#ET{c=e8_9m6|7v8rUm#;AwtG3$1Iw3-;=jbZ8OB{d!1ar0XOWMZ zfBX~Bb(ZkQ!iECAkN@B81}P0X?>-fsfbb<)S$b|83U)ONy9ce z$V;{0r`M;BO!rDNU59S!n?Q-1uhAnm(sjGJ0-(HHSz@}ekWf|Wh`3GLkY@+*{omyzcBt7kdeov1T4BCa` zRcg=$Dn-LDe$C}ro}3ueXU&_3TQ9y8n&J^^sE zwAq}d<()W9+B!JS{z6t09EAm7nA|JgH=3`QRbU5ONrq_p*-G4}7{uD>gCiObWee@7v7Mf6xU z2AAk0Tq*VVmHj^em_TR03se@6x+#@)G|>jf2Vrx;3PSG(n0&?oqf&rog2So9DBXB9 zUM6===G{LfHgkE788{FL{{ZVAzVe2tCh5qg{Y@R*dHN^Saql}z>`2kSg{i%gbRSC}qK%XK06ry7 z+o3y^P28$Izclx`rP&5y>J%wZuDYpef}>?I=2L+rs2JN)qhX>ygvycmAW#F>2n(T7 zG{OK-t!yKM=BL>?5ef-X=PguskbP7&^Ms+62yXuXhhnk=bGJ-f{n1$$crFyIwQf16 z21dxPtD*(5;q31J0NEBlQio|Q??|&Lk9pfCR;>K>-aJm^IR!TF9j8vIh0s4=R0lGF z*qp^SojqJ~j+>IFlqWZrX>xUkg|kuLvYazJbBxNJ(2?d|ffqSLP7{EY0|M@CM=zmG zJKQG)l#9f>q9X%M-e9w4%FWhFBPiy%@y;JCEsXFv?$9E}g>r$w9oA{S7O_F~V%`UT zr2hbP`G95+!UnhkvaHP(!17YneHK)I?LYNLwN{Y8VW4~NDi%ShKuv{_qey0Ur98UDl?<-={{U8;*}uK&iR*xP z5)PgUj}6COSa*!RF9ag0uFg7ZL4W5#NA1Qp&>XqI>$ z2R?WJqjhCuGyGGTs)6Mu$TTd9BE_SgF@~GzoHb`=YjK0%zBcGpK|XS19Nh_OWg0HZ8p8fpib?*tbHX@oHwub3d$`p z%dQ4WA!bGuI(j>Fa{fvgYKtSq!U%Fvf##h3V8S431($v9y64cUxeS0aABjew7N*(t za&ac|oX2xkC?GgySAtxm!$P@nQqTuArwf`M(p#to;azz``Zs1AisX4B5gdJ;vje;m ztUj)y5a};&Lpu@W`7G3cWBDQoxJEF}Mv7Q`Zca5xIgoO`5I0RC_mt{QvvQDsHms5v zNtbs-+MY^m@`KCzrnn|Ensb}=wQcMDkS@MwN~;>WDTL>=!MZQ^-)5>}qdX*n@O5|| zR(ws+r2EwO`gB1M54t~9my(p%H$t+e4V!YkY!NVl(Xyr9ZHn<|g7FwfBZPBCmGev} zOvyP~a}>zEvM=!EnSl)eYI-giy|nwGgV9(dmm2+BE?B$9frTsf)` z0`q=j3WAT;WH~)z$&O_=jK5r6Zw~`%H{yjgJQIsvJ=NP;H-P2ckAKVlt&pt3VeJnK zVN>8O{d)c=rgj@?<$+Vp;O68-k<;JpA=*1pEM(0( zd%Lgv(RZ&s*Jc`ZUC(B2R*m_ro1!&}XZ6C`rh}{?@R?6$wLC_OKNswX*-n^cb;kV{ zeL0xz`6pzk(BNX|HT;yf4N&B}K>MntKXlwHoB;?q3T*Q_!2kyhW>Kk~)QmX>c8W}> zHSq-v00E>fs%eYDhc(RVR#EYsSw@{9{ud+x0DE3`S@>T8{wyB4;tJc1)At=gSzqsq>S-ShK4JXiAcRL3C!I#z!3;Hon-Vh+`&33vakx(?gXH`zUGZGeNvohqhL=c8!wUFVbPy94Hw3&0- zBd5h*4cC;ec+?aly$v~J?y0l1RPQRsh^R)P*%(ycJE`cOu$)7Wy}{Yv$%_)UJ|?`{k+p_G5!sYBD@ghpEW<+ zA>$4Q%2URMENh(J(Md4xtfdNv@Z}LcX^wiSeyPy{fV?(LkEfTr@>aO-aezN z8a4GzO=!?yaBo7NZPu#B%Q@!*hc#D!v@D^p#2o5PcWORSwJ+|2 z8g6we2j-_zujSQWQ*yGVKAoY`oaV!Id!4gFXltdr^+kaik$-e@3QpKcjgj;}rV;Q# z<*|^*oXvNY!DbLi&_<(l z(=aNr(Yz-1uFY{v>uK&eM@>^rt5FUb^4WK+e|1)8p-!sO2;_xND^zTu1tRP^g)Dar zgy+(uO^(10W;z8bcpR922vSgm-Vt@-;4P+d zldHEtNemk(W~wtlK5nU}c`iPu9T9Foquu>eMu~t8Hxo3ZBC0XnA9JV?;orn&9_zx=qf{!&N*ArKyRY)?3-V+>Iv|32zH*&2l=dv zuJ^LBt)U+7gZd)y2tHJ1(6Y2H>}qvZM5*M7vFfaMO%hQqxoMwO8i;^-CW@TS=sCKh z-VZCbPHc(jn&YoEZBS`CuLipy`rt}|gKG^FQ$QP_!K#?DaT{>9V@1#_DcMVO#IO@F zs_~ns8kEs*5)P`|p~eU9ydc8Uho%-J1qDFDH&9R`{#y#CXij#Sos~HCSJQP_#j+Vn z-y15Kqbn{7&$1N4zAqs7o3d&5pQoa7))Q)w47*AoM+3&;F-+*Aa)SphFI5AA*jZ?^IIQhx&CILZ@XE@w zV`Xr&10boxT^3=ws~VdsZ93eQDZq3eHBvzY81-lXs8x{+N3vACGGufpjaq*qo?6`fny1#%<>;H*dpq;?bD`zx zi%62ZED|O?R&Lbr&=F^6fC7|B)m$$V8h#4&o6Tk|Bp?(jGFPN-~Z z_(w+WP;&=@B04Kv9S#{kmLMYAK~Br%CO}aT@$+62ecD!F%-x=)p2?U_b@Cgv3RFNO zp+vrCmWUnD!dEOe#5q-}&ofv^MztrL`#X6|bH-N?GY+`r`0y0ww{nA4vN$6`eBBW) z)xyJ)X(~mBMJC)mQ?qPkF^ura2Urr00RWxNxMso|%|azvYObM2M12!gwS@fI0sAI) zh@DHlVKuyfT6l_{3O${?uj+$aq(glb^}6sEB=$w}>vPGRV-9vs84h>OgCO z%lRzeTXfO*iW9Jv>aKV%qPmnqEGSoRXJ>gc)ACl=9e5=d9h4!2U|#XOj;kiipjY69 zWteK5-@Mc#V4YD;4Mp6PkBad5R@h3_Wl%T?+Yf@xtMc2T9i4_>R_;f$ljj+ex}nMy zl;8&1ldEl=5UT!l5w4o zz_gtWmuRGRb(0zvQG_A_1puAMTZR;?t0-CB&fQa|cPD;$8PmIunuluKC6;p0eIwyC zYZeMJ%rB}7!wt=3GZ`w%0=}!FZ$urqHbpkbIi|_8sv~|M?6g~>d_lYw;B#CCv9}0W zMyNlSS+rhfJJkl?H2koIZSl4Q^-`r}*rUq^f38#C5wS(&%KM>fI2C1^f^-NjLxVTw zx(yfmmwWIi6QZ|7Tkuf`7aOdl0t~fv)B55RVJhWY;){wcJdyDjMaPnEVY&p^DBVoq z$zN4$2ElqQFrwk*-FLwFGC}I3m8vRK$`Lm}a#>ZOTK#$Z2DA&UETm|fP#Y8h@}b}l zBT3mmGpry0zH6eM8AVD13uByIpf^&7#XgV`WJ{A+&%BHC6?JvtD9W+8R|-(z@iZQ* zQLBi-U8(b6sCb?whEt!q*MLkaG@-anV^u8F{GWij9=v3T9z+Q^RF-JQ-XE#aKc&oCnxP zh=QkeZB^D(SmR=vTX<09?7r|tp|V08)TjdZOsvR^E?_G!HWpWE@Y!9(P8Kk{>*+P- zqiv2Fg&Y_D!(WNM2zo2q8;Egwv@w5(16z*;s;zDgr9S zUm3uOSws~aT^B|4aC$4XZnaYZUYgNbRDvX}iqd_ot1IfV%qTx-ozxqSs#_sgqHyrp zYsGE|;2y$!rArOgk-?`8{fyzFy0;Df$rxO#DdCkGaBIbUE~nVYDq614PucWV`$)j! zs=u<=fO|Xt0G5CM!~iG|0RRF50s#a90|5a60RR910RRypF+ovb5OIN#p|Qcy@F3yw zF#p;B2mt{A0Y4$H_=0*X(jdJ`m7hqBA&lk+rpuP7CVyQCSLr|E2p}Lz^mv#F%+zBU zTg~A4m8ZkeCJBOb3o?aRO`_bm#V#?jXVSCi1!^>AkopNdH_{ooSqwgveu6C5WygSu zDpqG0R8K&Gm>!-{m0i>xfJ2E=rAn15QG{Dbc2W^mT_1)avrMn}(ioKHGUdgX9=~JI zlJPpm-jymOuSHy`Nwlb+@@^hvD$Kc;(Ps%zLky>+30|O>4-w3%Q)!z02hmsSOykhX zhoDN8=~CjN)6qC(^DL=hseR%)Yzi*mOgCQybN>K3OM+fdY>ZiR!LRr+U%3=mikLov zRAUr98O&ut>%_T_%o)bvy}=R~{{X_u1JK40^jD=y^nxU?RTM3FCqOV04@!)$LLc+9 z><${~YyK`=Sd=jCUSl@&rp5%z%wB_o93W+SX;8Ek=v=vereB~2 zXJ1HD=`gn+K=d!O5}0!zLcJS7>8K@Mg<`x+JW7V@I5RH4X`Y`xhP@Rl(!b*UE?Q!0 z?Jr<|FVwUhxkC3}^7<|%)GT?0K*ZZqh+T+8Syzlpw#@$k;u?dAuccyZH}o&jWy|#Z zi9n*ND;Oe0NHXHXTNiv0YYWNfdo;_>BtC=w5P!m~M3;okMb%-GrV##BkARCzIz?xt z^{@HAO#!=14$#%Ka_#cV{{WURr2?jKPOKP}n6O1#X_*>Gy$3k|0Fw+x(%{9+H!Ig{ zXEA1VcM6LyFL`lAFVRH{4=)j#juh;z{4lr%g`XGW(^ARgm0pGDGYF$mW5ir~k#Os^ zfrPXQCSHLb_gDe>rQ&Hru8+<@aYZkiVA#)E*DItHD`U~a>%mXV;1Sb}t@?#$_ z;$GLa$J-0<_4bSc;+~u zrS6n6H6Dru6bDeSQt+3DGUbxEA}Nf>wli82e_yF{DPnO|`XYK{ziF17T%qE_cI(o; zOd<<%a6{H0W{~0k0ACT%Tl|3hOPeJCcsTA05B&Be*mcxgOZ9UIdX^)j&(pXB&|}i# z#g_;eda&H2T^v|WMBM6#&0=4yC~wlV<TAQbawe8HjC7_Fk)ct4bn^d;gwpshoeFk=N%4VN2+Ud~0A1QZK1rCk~v`qCD zsl8FcG}oz;qZDGMf@0Nl%`A-CQO=gXWYn!~7ue6x%A+`y15TZCzeLd!)l(?v6}%pjN_$1luBzc%z|=Q4~>#uw1!Fv-D?>wbVkQw3uT z>4@bs#fT`qdTj5t5;Ex?ANYV4gdXMkStW;{s-rBtH2}ls&}fA)1Z<8J?c!awF*7ps zZ*vboqpw>?#t|~f=={EpWn=CikxC${15tTnW?Wps*;)SH>J47a&OcDb7KUEQS&&G_QQRp#3WG4S!-VdL{Rv@m;V5gq?K*;J7Uk- z#Zg_wn?qsmD!mBDl3bL>1U2Y7P}CHZL7Y<3uE&u$|lL1 z(5yxtDVRygDvRC|Q9FXdWbl=JA8 zc`!0JEtQGc2`zq6Vj?_TLJi`g)3I!HH`Cm|12N?LqS~f;cQW&+{_ey-x*~(~ zEVaVJV=(QwmBH<=f@OX7Qwstcg1*6i9)MfGP%8Yzuq)aj)Tg@j71!o5NL#HhM=ZP` zlxpHwN+eT)J^GX?=TN$e;t*05gn+K)sv$jqqxjc%T!=F zc0`W4F$=JZC758QQXxWsFds!0dR}R#BmV$iej+uwa~h5riWtTPLJEqU$u|_-O zN>_q=I#85|^CzHysZ?(mkQ&n(r*i=ON6z>38}pNpWz2gnzSBDpW++L&WOu;-01wmv zn!I~)9pWQb1O_vJ^9GJgox~P^28hVm%mgJ=Q_eo>9Mn)l=31`hv2ofVS_EEABzjO; zxNcj_&6LdXSNzXAIjLf7a}akRd#)op6)=?!y$qs2mLjS#=p_d`BbDhm`Vni}eE{xC z3G*XS;r^03z-`X@_%Q@QyUCW*K>!f0IQj_|Subz76#`b>M*}5SYbAOmkv-8*B9um`nG!Ts4993@YizBV;c%GDT;Q3g>QrM0=01{h?E+YM zlrv>-1I$E&P!%)8cuJ3}-*K&=$r?8pfubxg$Dv6ZCL?p5EvuypVXmXH8$Ocqg9X)=+xFiP?)N+gB(<-!1A;zD z=r+7DVYH1xJ5L5jytGcpm5N5MfnJVZP=Q*jg`mrRJ^ zF?9~ArxPtwRv&W)0J}p2+)2b-78mzG9GQuYXv#1wg0ajcqcb~1tNd9`I2sG)IHCRb zQQgN%((*1|&>2f|v6}NJX=cmj8do`*q}>xFc8+Dz^)7;E2JR#e5iyU733i&O3b{Fz zO2eo&)8cgzv2BoUQ8-H_FSMs5wpq9*RY5n$qG4m|FBQw?ZdV@?xSY($T?f!Yw5Cqh z;P*O@;dYc}uMq>#18l&kil};)H_S_hY{cQ2mW|7Sp~TS7m2FHSgFL+sSZRjLygVkS;$2Q6uY?CO)lk*PQoL>;EA5T!Btt*< zaoEAY_L+u44QdUruBU{!7QP4mW8zkJ3+uKLt4^j-rA*AiuC-ZoM0DOr#h_-lD=P^p ze3Kxk%$x|1C9rUO%QfO79e3_%lg#2{0Qtwoj5bAdxNLj#g&bEx1L_={;AV{?#O zKyRYeVo{A}`jk&={{XW0@SzzBbCRJWF)RwWFqk?g&;J0~S3R7rGOKIM*=k&x ztA5z@Z`x6BiEvQUHCU+x@ekZH$bf_%ASxn)@hkvE?l=P08pNyaw!MGI@$63FC z=2dInFp+~Ng3;w>2(tDVF)7Qbm2&v9taAYDcM{dWXpi4kVGCPTj+B}+H1g)9@Oz){ zski2z%)Xf%{{TPCz{ynpB}?&$6Cy*fr$6t^NnCJyz&eJl?gKB4;!vN7a^fvqQOK6| z{IIX@4-0X|_n2@#Vfg77bQEn_{e(QBf}DCC3lqM{p1jl#z?Jz;z-`Q+c%DS&D`Ex6 za8=fzjHF@JLYtDtCR`}p%f!uhRj<{`0-T;az-4a^%e55^P-pV}M6=6(eSRuZ!HyjZ z9>Mv59$=XU$^+hEvZw>Sd!0%HGu~gkW`=QlLl(s1DT;feLWz)>&p zB^THjdX5}pDaOP7g z#vSV){DQi@T)Ru*sou}LD6^}5AbFasuy-67r)&=@$HSu;_@y30H1*>NLUT}d6|{g5xWq+UCJwnJB|s2`U~zRpqciRpTaG-E?6k-JW^vk z8X>J#ClSoVT$MQl9~TTbL{xF8*E;j65A2uBJj=^fN6cKIowM-x)Ec|I(KAxT!iVZI z@kqDKR+5K#`4uk1jEw?7eG8=Dq$ z-;E6Ji{i;ibVUo5_kN}&4e_bwnfEdzn1X1m!0&j0DY7T?2&Ah)XU|XoRrIGXQzWXF zO=*JL4=9a!*oX^^!UVft3oyE}iMLh* zioaxPg|lv4O$TYmPm|2T4m{vxLf(JXhypDSzsexy_SmO@luJQ6sh(x z7+=pHFov$Tm8&|SK4n}39x-9g*1lyiHiaJYr9)OrS7QLFE7Nw-<%z1ImFJkFwi;K7 zkM~|?F^ZUZfr#u?G$Q{1gHS^JnU#1+m3DCDtNtZHV+L||{{H|GT>@L%e~Dqh1B5a4 zEI6#MD+30~KBGyAVS|_{bP+NMypDgEYdFLT{L4fG%Te(d$wob{Z9YCz_=j2FEc%Ey zC|JL|{7@?063U4H`+G6 z3&3{{7Mu2FS3qy#nm^pd>vPBK`F7Q5Ve-eT@^yps%u$!Yz5XDy z(Z%2>pC-2lb1XsQp$~C*2)L@?YpIOj+)<_uD(HVWrg0ENMD?s5SW!pt5RJT`1TalP zr_Jl$7*s|+Ww$GCQv(E`*yaww&Y_1j7|@!k(ijXI9JD00f@aX{mL}*2e_eTW_h-Uk@RP&Q(ZrMgYwGH zqz{4>h*&-XG3l2#58MqUf^zV<4pL~oUTpsWUG+6~XMtrM(CWnSd!>;x7ds0vgq?9e zoL`Mwm8ny7v}^7p7V9P-!WSR9~IG` z<1=$N$Zm03SGo#!5-6j9MXbqKi?em^{-rrC<^DQ^8i*VHP4dH;W2l^QC@-6QF$Mns zD~|sF5j?f#P}YziX{3qfVMC(atK1S$9?^swmmtWFp~NX=2v?F00NDcE>sCasZSu3qs>>R*WMnHn)3 zzL;X$S7@7BTYSVFEMWcvaNP(Snf7%BQEN#plT3JF;60I*9Pa>}8NAoC6}fZ^t6I=TJdEC>Zxj$+X{5uGyJTHC}@+hPg4&%CO<(jCGf z-}#vmf1F9Ss*rs5GKIsg=NA(F)@cUaNAyP_;5GSpn6a)6j3UQqO@kL1P-}`hhM~3i zk9U{tfw^@JX=7lByM&KXli2e!5asXBp{_R0il{yd)W58hWpoPEerY%pzc5lb$HgK;@4%s(_^3afywE;u1s@10*Y ztA!zTpi3Hq9*ev!15jkqD;(}(S<*9S(2H3@zJ)1cjw)!5Dm-m?f>yB|j~$RUI5Xlp zMF>kAVjZ+8z<6ST3$B`ih(mqwUzowIC9Y16pbh^3po@u4UjG2`Fi!H7s9-aojGDYvx>*F><!=)e!oWl~n0Sdy^zL;IGqUbjY ztdCoPcMGxkd&lnZ-*9C&T+Eww118SaBX1i`3u^ zq-RiSIar$XK^Z=<*H2Rd{kJdpVi`T_5wwGDNEpW=&$_)sE5{Hcr2&GwnzLjC&0a#w zjVl}Pk}ET1jngizq8Ip`7FxQU#f6cLV~jMZ%*o>_^8WzXr^(xMIE(HbI}Xvwi1#ic z%*`86)lMh6nWV)l`;6~5aQec-#G%wu!=0~L`I*f5IDP*B z)W^-4sG3=So0)-p4>F@|?exs9O1QQRML}nn&!-NM9<;}3D~H5X<*GyINaT zA^EomRhmDz$YmJDSaWRK{7fO98;aIg_2TgS#U>;DJDF{|F*~0u#m#Ae#<`U!%?nFv zmuzUdFy=mrD|%(9+gOd>XY7kvjGm@)S)VX0aKRp43{jbN*Z%xU@Kn~AT;KjqnLVJF zzZVY9zU3)H70lBvXmZqYKsI|@{X>wBp^n!=9wqYe!iH}4=47@V+1|ezi|DMN1{1 zQCnRT0jdUuDE|QGl*UV4G*qw(FjoA|6r92B1Vaub?u}eqSwgi>>JfbiZLXA;!pzy z`5w`7l|iNV7>mhZ=vOqw+-L2O;?kwq%R#ihJj*rSv-phO6BcthS7uU@z|_EY1Bp~q z7}@tPceP1I?={p&!Q^Z64@oY~SO>JMR1F<_-ePE=IWrGAj#)zjRsR5UV3)J~nMp)b zqEw-3svqVe@PRZ~!ka>oZJOR-G)mql`^0b|y1(POb@;r@ZUjo6V|@sP&Qesb3jx*6 z@TrPoRM5&D@p0M?$(l#RI$F5*;u%GyzcX@>(uSLh+jj5X3C5oN2y_W{^7hMJmoSS; z$Z|P@lW%)3@Bs;}N_@;Pyt8#J-5&QV0Q9pjxUNRraSetAWt9sZhBzQxhOLD*>O2yq z(c%hY(tcAh_hOf|nY>jWI+;i9jKQGS^)n_ayq}tiw-%OYg)6Ee%k-`DHDwGN9Acz$RO+yCX#nZB_bZi~`UB^^9AC z76koF?xS-}a9aNWckc@Jg=6(_a2#0K1zqJO&z{aR@wrYLg1S>d3_^~jfQ4C>8SXlp z1UXK;pxg(UZfu~!flo-%@=eMZc=H9VR)~r8nXiNGxGEu2EJTqPi$;bNw0ICY@g64n zWYA|3CdM2!wO+&=mD$9)q2f@)s*auch^JStX;r8+xu$lZtCWPR;#j`hn?tP5&NRXH z5nQGgFa_MLEs0>NkiMaA!k<%O!1_iIu(P)V`D3xMc*w;12+NEUF?G01;>me9matcI zTLQZiehP z>RGn88?ADSfo9UXuBHgF-zS1K`-1Ydc8 z#1G6}{{VQMjyF?xsaIAQ3{2KFs9)k24Fyq8^$IIii&gwh>g9RgK9(mhZeaBhxV*}j zMk1NrLn^C=w@QHRR3*!X8Zxy$p26w~Nu!@`2skO0Ru^+4T9k7ed5j3H{^5lRA&Imw z3^Yw}wYfdIg;%2G^Zx*Z9Tmt*%#9@&%bt-fYmX@B z!klI^hSfthqe@vuuzTOsDdXs9^DV|J-W&v+4m?Z{zVkYv?wr>??|3XMrci(Y&c`?J zDGmULi|3ICQ2m*P)YquLsYI}G6()V)MN19JK!;`#9uSoH80&O#JY3MRN?@?cd!;RN zsF25BMm@Ec+z&I)LLrgCd-|DyUy0Xi?l7o4)SxXe*HdG+-!lg3s+m0+>EDT{Ua#Yi z)W}TWk6pj%6OaxJ*E?-%*Z`ZXJ6)4 zPi;Qyp2}5JxAQM}I~H&meePc03+S(n^EA4Qm$}(B%q<$+q@=ZF#x}7_ZBUKW1&$pa zSg9?X`UD}4c$n?giu}qILn@~mY_B_sUCFa?Kh*PqL#Q#C85f$P@{qh5J~1?v9(kW7 z{Y+Gt0Dw?$ttA-CuRZ0?o zZCYX(Cuj2=sPf0&2I?LJIw#-HnEukKxmA&KGmv5Lj*yYq4Fvk&6S@wX^Ou_L}L0GHH#)PWn70sBP?Va~$%*vK) znWiR0y-S0{yliLl88gc&Nocx@lfB2e(dOYW+*QDM<>m=Ra7zP{am4J07xTYP1TCNa zjHj`b$SbUXY0#sGBOH3{;hsaF|nE66K|c;sYSr)p?d%e7yev zNl2_E&|ItU#JqQ3QP+_esP8XxiIvtb3R}T291z*T_j2Bcnw#T&ye29G$HczRgA<07 zr%c~+^B3kdvkVFf`--M-GObfaVtEz=mE{~meM?q0p${uJsc_BIC%eQ-O|nG2hZy$H zc(2+336`f!K_-C}d$u7QTN-1zRm8b*bzeFCRIOM_Hbxn1c zxLk&+=2s+Qw%Qy_QFWMgna@DfgkK&e*vu@`2^x6d++K@EFS zmWnD3`z{v{KIP;-a-D~X90j5Iw=ndSK{#)S+QAm4nw7c(ea8e{!H8zDY~2W^s{!>8 zlJcEg62XiU9*r;a9nrO3(ui>VdQ27pn7I?Pl2JwwCQQ(1hRaIc2;~0JFJ&94brZJ~{z^xz29bsVzfF2pRkIY<{rU^k$4yU(`CEoVRL9^l) z`yaRjEIE|puvdJ_Az3U-+kC*Sxl8U<)!=YKM}vD zPQ3B$3fb1bGR5j$p|RyWyZwjUX}Oo7FsGal$+IiWy+!!z-Z_QMvqZ*GqEz8zq4Hcx zoHF*nTIvQ5h>Wq&rZc`F{{WG0z@u`p1cfC*5Pf?}jzy_`V!fa|>Q#Z%N&0%CUGQwA8Z%>%*;U+ffVxk@d z@qs#?W+2&!raEG?MZ_Bc&X&My4{7X>UTRPm2eCHYvc&hDEuO%0Jc6cDR`*%eP6kW* z9>@BbR>?^QaQ(_9a4J_|6Atkx@m)%YHb5wtW<=D3gYH%HgsFl#LWmC#VO+3}Iko0E z0J62rSExZTF=ZUY!A-~U9ec=uqn4tvwNxYp3lv4c`IWW5b4o|FOnYZC`DOr=)KHcV zC+;qhN5GhXW0`8zu`h3X65HpS;`fy2L+Vvcg@bdjs?^h>SM@KU4L&9AR~GXIz~e6{xk28oleGDAU(af@t9nP+a(aJNeGQp=}8P@@wFI-0Ht zP2&t|YP0(>TTKMgRB8yFIh9t#br#}LZN1E5+(Uhi5YINf&qRy438(UjT>c@$1n~4a zLLWskuQ26s*AXokCQT58s4Rqy@h*d>8kjIFa?A!P1|nZ*G(Vv5uLB$B2!bMtL~RIBz?HG@ zA{i~i6cy2z^_Rz~UhCwC{{W-}9Iluq>7Tj^mZ=<_N`PO9g)O;C6sUgUM^2?!d(>2Y zk}oWiuA+GKP*A^mS_kCnY^ZIO4(!^&!BDePG;Q8a)T_olE}1_S|>0p zv55(qSCtNQPFxjc2nF~owcMTkX0nhC@CZk^J?-3oPUNXe2nzoIXhCRmD`+x@#|uJk z1(_~lA<{g(uuBZg?qY0d;he`K6CsuWokvcfhfXRMR$}=OuOjI~mS%C|@WtSXL&$>Y zC2DzN%M45(5Vm5KQu`uN3|hi0tB3~F3`)byR34Iqb(mbHED&ZfU=srTo9RX*^L3yqy-74&vTA<0&K^To@Z1*Kv zk1FPK9X3?GkCCVX8BfTDHFkM`Fq*_pj7KGrTbNWZ{5?KNbmEF~X)kC@^kJb26lP8{ z7WW)4M82kEQ=({?+d4|+uKg~FL}o-7)KT;;p&x-Fjal~*av-}*mhPb48jh%C82*5( z3m6n8#2{ta38}Uq4dB{y34}J{Cn(FTnBIAdm;jZ{k1~j5GJ|ErT(f7?diUcDL{j&R z7bD1KAAky|04^nV7z6~BM7;%9n_bkco#5{7ZpAgYTX87G-QC>+1P>O9TajYLp=fZo z0Hs9=#R8=*4#isFIlS)~-}&+rGVWyVeXn(0^IBqps#`KvYu~J}{mqvVzpXFY&#+(b z5L)#`&GuXB$qR?T*+P2`9J9FnpLsooVHJ`cddl_Vs&#fhL(4LpQpaZBY<1E8Kr*iAh0uNnFrhYl#j~2`v!sZj!lwU%!cdUEw}^M>f{7 zjG1ti5N5F%S0io~Tm_lf93>Cd2X=a4(`kE$f4@^=2p<;qkqYgGQsxh#@OvB3og$yI-T8eeqOZWv!> znWPV7hwWgnpYkQi->rG(N`&8x61h?c`mj1u6LI`~q3@ME{b$dVuwzRBe62iy>gvSe zh4-(;h@-QATN+C(r)~cwLYemQF9!>GIN54z6yNDN0BNO`jzz$)(xiGxtWd6`O#*2C zE`A^i`dD33Nz35+hs{EG-9uWM>|CAW@Z!Pwr#fauEV?Q3Dr3?fNDlLr=yf4IGypeG zn|i;W@=mJuw>QZdS3jT&UrC*4pYx$<~8=Hpa$6D_O=Bz%Z(SNZf0|&t+(lu+)*#1wfpVWgzL}

>By?{7cHlq;C(2EP5S z9EJ8J91?1&${G5(X<@uJ|A%>gZsxSgo)~dUotV?vX##bkx1DJ#iB*TgU9 z+?&5h9||HcMIhIS!5edV^CdJbRVb#g{ptA1fc0$<3J>RB#d_vzZ+Qk7%km38!btq$ zQ2c+N|FMPsUwnkfz|Jpr`Tt2miHs@e`yBplAPncN@Q+@gd8I5T?U_RceMB?x;{cKCutk8^UQ?2iPBDTh=K}k zjpOs#pUul-aCfH06`yB?oldS6{M8Qfwb>lm*jgj`JgLm+ZUYYTl&w0lG|C^gUF8WOHH&Rv0p}c zk~ZvCCeebR{fKRQST=*`DvCL7UD}V|LbO13?jr&BzE0T{!%3_93C-M0z@VL z+ddrehF!Bm&4Q_8ART$_SD0OK-z2Qc3q!GXV0OIPod^7m9O_Uj$g^c^A*ZANq-8n+ z@xHJ|7<(#vm0**>e7*<$vkk1=@o)rRKZH|m$Jvvv_aHISB4d_c%TnX&^Ffb_V6?JJ zW*#+~^a1eQjGVGCLw?^dAiJM+eWjf$_{7)omz%}~l&HGlo7dT@UFe3D(8|n}^-K~o zP4@~`@aF~oZ@+v^2cQ<4R-b)K6Q{IXkY8BD!X3}^w7%hX_AmK;@y9a8s*>l3!bqmA6^)nSFaPr!ayUzxZfSC)$ycGH2EsUc<45h2zq*-N(PT@A z8f~pchlNk$|B0cf1fhzMvS$dgX1BN`PD>Tgra$t+@Pcpfey|BN725Zx0kLv6h_R&B zNwdRn|IY2U+SGp$ci{zO*8iFo8dbLY4TOEPpjT3wvCO_Q9&g6AELx8X*L1nkMA@W^ z+k78?%+fvg1)O~>IPPewME8$?K8e2df&TWG{xNjwc4K1tyq#W7LHIF;MXFO;KsAv! z)*pBhQk{Lf{4gD4p-y-S6eU zT>kc@R*FE)PTXn^LNvOV_BSWrxkwyu?jAO{K{GOOw%(>7998f=!GDBv;{B@HvmgXE zwMkNl>z4l-(H$4X_WhP-=P;I4==N3*7&V8NLv_cRZ3knAGv{YJW9oNXKyu^7@e&m} z#6od{vgKxQT_iF6B@g$F9F(yYyKe{+cJqIW1<{{Y_oz(sf3_63VPnBCE5opoEtO~_ zaT=R(ffhu#KVb4_Np{q%nrgGA=VKdn`K-(2Q;SbQOkm_2bXOD8=zp?d0qeZXfpckW zAHbj1N2sH%mb@_8r{!C_tojQ&Z&)WwdnPg21<8$;ARO zFRe&SFoG?T@n_!dHco+;B;feJN$>&_{trv||B`^{g(SRqAqkh6+D7&+|2Gi+$Er&d zh!Ks!u*v_3T7CH2>{YbdKUoK-tgC6>)6)1n>k&4bN#?xk-7$#J<%W+_8=lBR+$O98 z$~(j=mmRfv(MJ)CCD9&Cpoy^oQ$!=tf=FpP24e+e&G8CvhC^}22p`2G!7~2=zz6s0 zSt77tnQ}YvIV!L0E>jXLm`!3g-uHuj(alXIzz@s8(-fa?)?+@ydXSX$J(==(nX>5{ zB3^1HiUWC%d=)V4saZ}D2AH(;bQ&_+3~<7m;vnQpvMe|}zG&Yhn!|TvI2_BmJt2yI z?~pV(zR58n&D%?~ulOi}s|Br?S;;1`KzBTg;0{?Zb}+wCiv>JofFOcp`z(xxB^u*RjSn z?&3pTtCK8x`~NqB3VBv zjo7TY zvHKKL$B~D_ILT;&*YE$modr>zT=P*){nY^x-n!b^Ox*^PE>YK_cANNut}JAFC0o|>^N8ZU zaG!=#8!#B{%uCL{&=^{%o+7DFH;|%oTd?4xQ;KY_9kFl z$uDqtAd~RuAsIhAC+lS()QV)a+@eOdz3m#FIqBHc*?4dBedd^jR`O|AI6QGPHEA#M zD&}{;#x7Vo&(&#o*cr@0fMBi8xhqha);k-!RJ^;P?{Yvrjydi8?MO74HL@u+9qLTS zYr@Nbkl5{XDR%#NLBP(L;xasV#Cl%zSoJG*a7En{BFVKy}wZ$ z_0E>h7>P=YZJqyW0G>t|-@V{P9YXT&@H7_+Tu%GF@@+ZUhnW5-8`~YFg8>8M&Y3$; zmgz^>dKx@$==kO5-@S4izi_Ct9lwDw$V==YHjd-VBKaT09epZ+qro%GHZKz|B$9sB zu{D+M@!PgKa{^4l9{q7dnlszZvvpS2GLu8cWy+aaY;BX}iP{(CXR)K*jop~Y4rAtx zz(5X{wTm5|)Rg*vzq&RTIqiD!%rt|bt;(KNZef_xPDPrZF;aKZXxq!<82t=- z6ei7>f&X$LfYIkYCgBanw3zL3|P41zi9Se+MxucU*vVLEL+}qq0ZqAqkwKN z)Qg$a+30eYxqoJM(EWXBtQ2DM!p`=0QIoZ5WKfT~Nb378HR+ZV;uU{yGve=Nd!4E)!ZRsFSA2aAvSl|^$OEO_+)=igh#K49 z>q0gAF`QsMGcTYDeXe3>ug|)?7j5mglBQmokq*7m$!7`+K3%lHZcUk#AXscA5|leF z{_!2m{E>r~-hOP9=MkqX#Dz2~YWQjHhBv;LH_-vN1UlGDFHID|Dv2je$i~?7L(s~U z8qe^K?sj)Nc7Vw_XX_DyuuQif$=8Z^`scW<=Hf)e=;t|TdTYH+a%TDIzLCG!_Vu6| zGfO{HhMElSIEU2+{-)q2fAh=*lIEb&aC6=Mpplk!-Iw3c#9?qOdzv~*D~tAmJ_1WY zn!~hAe82+pvk+j?sJ(3N6r;v$l6sc6|Nm*it?f$PO%&+-JOv@~*W6@B9KU6FDQ9aCNTwhTI8>ifsTMO@;j%UIA%>!hJw zMOUagq+-1M0^#qDPew^d|9weJqe#L`|NRQP)()L1lYCu)ym*9q@72Bx$FF z!I^p_6F5m-B8J45an7h=EvMqzFY-z}D!+bN@&lS#FEiNXVlgYPfP23b-p*?r+Cy#f zx3Sej>r8Z|*pYPqe6jxgz6AUS&=vlukNPkbg}hxrN_#te61DXl=cJ+;K9bm`J3SIR z$C0&HPrFW)pKoqFCWAicT9@8xRdC{CfhPM89k{}N=Q*7(H>KW zegu7oUsLE9pu{oWk^>7h0AI+*tfLl9)>i&r5aWUlx%W*3o4GxY9jOeX$6*IJ0>G;F z66*4v5PAS0{<3I| zYjtKw|74~|0=}KDAo?nbUy^R??0!||9BEJ+g4bcD9G@C{Rmue8qH_oF(hw7rK~jA` ziXT?U%d@|L>aZ=`No@GW8GhhQpnrdaqcEK6mon82jDIz$XDU|m!jB-EF#jj5n|iXYz21g;NV&(LlxavbW{}pytSEjil1p}Q(TUpNhBELpgV>^>|z=ee#FRM zdWcG| zpT>lg7E^~IDS+Jt)a?tRHA%Zw5`I>aT7eZ->BGnNo3LbvzPzw(qr&6k1#( zMyMO@H=ZgH_;=();4)TrFI^}-B;$a(U+T#?*w1!eOIstM$RJF%U>2zw*pD15u3ry} zJk+DY@d=If%@Oxsi1bTE3Ed_;0#dHJihYf~WNlCM47OF#ire<1Fy&Lm@U2q4f%D5^ zkRDhYo>DMe(kRG)rb&uNngdh@14{JFx>`jNV=nD3^Zi%y_Ky?O3G{aflJXdws=Ys` zHUu}BY%_$`$T&<|n$2Y5hfm(+kj{0WhayBbX7YV^KyEEGHn{q$IKNe#-8RU{14kmgn;Y9**MUKF2$p(XmfAU>)&LiL=L%6?7+Q073g*NO&rEcC$>=|v!KEqBz{p7%2qrpwV>H>ovw%gniMDF z@6pR$e#0iNBXePjrw>THwcQN`pq6+|Y-1zQ*tOYYB_$e5ER`%p;z>E$IxtSh9RLBD z3{Ejy5}HPF9!vCh-SDt{aqIT^p36*X1gn*;!#Qh4?8kTp8xAU9E%{$KXi6Oh(iD=u z%rehaWMc)LV`^;pBq0pH5rW(r`{^Z7?_di5W(t9DJklJrF653h-0z((?T)UtDwE9HvXvyXbv^D`eyeuG}@rxJjX8>ZV$5Tew=?0}mM{;dzQ1h*wN2W3w&CDe+!g0^v?=7>b}a=2Nd7+-*a7|^Ab)GIGsP}?*cWBt$$Jm{l_KRN%DZ;GlM0+V4BZEk4B=!2*dqv$a{yju@_ab zc2qlH^)60~HrbHyGFD?tV65>q0wmecWdBLiW|eP7fBRqf*jxAgA7aI}`B2`Ay>`$T zrfF;7yHxVSNI$T;V2{f0_|Xm@DO0;RbXTU6VDXj4S6#>;kx=p|+o{Yl|N4|y{6cuF zGc;&L{!%t2eTf=})cPTr{Fka+BwDA%sWm5&Ku#%r_ z7uDyeF#g8CL+Jb?o#aEGjriz6m14qa_)fAR>D|30ZZyV(N1{c6g)0fWVX|J&g23a1 zu_42alrtB;y=$oCh7i3id~5TidxLku=Lju}=clkqV++sY66LIJiH;~7*=XHnQS6%| z0HrQD0`&$R0a~|?2uD8Qn{?B6M7-2$3_pgr3BjOW3@=_8zo9uam?I2WaBML-qBN z-LTD*M1jb!HEO7d#SAIFwS8-;!sW@tLvDPOk5)N?9HnCMKd@$CUC8q*+^k-!g)A8#=##N z<7oRZMl0+Qs?gk)*0j&Xl)^IT^D&={`UGK(riNANjkM{(-;jYCOj+8hC`xJU^0JM5 zl6B%YP?O?RT;AMFZKSWs!9lpq6-fy(UdQW&UP-+xlyTT*zD$)I0x-LM^4nS?wD1E;6C%YK zq^EPt9HN{k5x9*kTpVzUmfZmB;*pob@Q@BlJ5`r zw}|@m#T->^@f1NS$tN+|RU{M&Q-=tZhNf4&N4(PMzP9zH_PwZZW(GV1mEM|%u_|w= zJx(~l;Hxjjg((s5#p+;i%clum->?kM_>AW6G}AOZq`#TZvsCu1&H;;zq=TiClR(&A z>5sVmtz0IW^ZSYY_hj1%Pg`HEGX-P455}9Lw~z?6d=yTOz%{EqXI2%abjmW~2j9-Q zAU_j?Jc_Mi@8qafY^Rj4760ZJlZ4-`KNSG3V7ef%&bC&Z9r!9Bw%I*lO6hmU2ZWFy zWR`s~*apTjkwyO<7P>(B_Kjz3!x?<95349|B;Q7~NKrAL zIOwe&fcg~4YY7P((f-mbtrx~@Q=-Vk+Uir)y-HlCM#5~vW93*p>EVojlOubOGA$9g z?_XaJAlFmC8N}oeTx)w>9QH|-rb7b5)Ow4LLYv@sM?Af9=XqHh``?|@F^&tPZMAcn z`VwR<_BiTr9mg63#r9Blb;w=a-Tb{5m9Ma>I0-%$S+vF(=e=5@;5Jry>Wn8~s+hVw^6d#@XUZAVu&JRa z)4loHu_e?{0xROsFS0H8%sKr>Je+^QfmeG;o2~K~3&1AW`Dyr3onDN;T@uOjv_I3NCGCzI&GUJeg)Tz=_S~X7Nl^Y#c-lu@0~PFm zd{b;YPasjz>|@Deg9pgfH0_-LvS|2dgixCLR6S+hIcZC_$+;HlCTrE`t6?QH zJ*pxxBpSsr1(7JvlY^aBYf6bsfgxtFqDHcRbX9B}4qktn+AgLMf=ByhQ6lav4*%kE zlIbH^d?G z(Uyb3y@!}UP_kiQL(wwoh<25KN6IkV{pm^A?( zK3QtpG4j%vxVFU6yGU}DNYL&u2%rq;V`?8Fz}ijKbj5QUe_gpTt5dZfQ~~GA>|+-Jt>Q0 z1d8#Z)klQE-Jmg%dcIM?g#0mh zMWNeV{67HI6pTd_%Q{SNifXmN5{;Oms`JT1ph!_dLCme1^8uo<2SmYMPakSr-+}6{ zi%1Ghl^}5}VB--{4^uUyAs0t>Sv9}XJrQ)Vl)CN8q5Qob&3=efB2+C=he7g603&7< zo4occj@<67|GX+nqHk)-!Bncy^jxik1U$Pt)bY!%q@PrSe()1Q$W>K|$hU?9gQI8o z;}&7#sVSR|z@dVE_*jF(2dhF=nqyWYi&1uAg>%!9yT;&VDgkH*Rs9f% z+_T3de4%(QY$Qx$D9p`l3e;cf_-dQ#6W8@6MACo}u5w?z9^M z>B)x8#)m)8zx8U1>J}ZlpAj4V?lp#i{(XGBf(#ACvkse%YFhQ30`LN0hv=JWoSDXj zyDDXdqBc@RIp%S5gB1PJ_2a)3c)J<7zz_Xa{!M=NB?#X6If}l8uCQi0Je|#Bvew9> zF+@_BwpuWFHKI|rKQbh>hXj!KG3fL6ZC-ufcQx9U8dpqcwS#=m6~3W7!eU+9#*s7? zXe{049d2opxhPQd`!E_mi6fu|F|UaXvkX8=YFckayfdfEpo|;b3LaUZUr|u6mJh`m zn8kk#Pebs&s-jk3DH_y*8xSzXiSmD}r3M;of4z)TDTV0!C2O0ZU6wko*lM)+e!9Q~ zr-@2C=}Ft|u9@N#`Q!2Q6-0~M$=xI!6)`W2(44b*4de9>7Y>MBLW}i6DD8b9>ea)$Rqk6dvsLH^F5<;*SUQ^{V>RHTOUSS zVM{Ry{P-8kHlQV!nJk^{Gmd-?E+#l-{w~iTo;t}5Z(GTkq|W^)K|IcDzaoQC)K;%K z&Xl-Zm7DEL6oZFupF8|AoARWDHSvweOi|3sw?(j93ChxZctOZ0mDm6vs z3Jh(&1Rg}UrPaNA_8a=ZxRHl8rJ%I+<-I*?gMnP+vtUK=_0P*}^8|@0GZra4lLWiR z-NI$Gjmf#9QD1?X*_NcZc6+sMIL^Bsq~hvjdfE|!59L?&5u;l>f6KqvVR!K|xTS-# z(s%lvmp#N>{+t$0@Ld+5$Q=d0-%xkuM+IiF=*_`1(h&{`sy_At}bk}kWL5Z)8_ zok5ri^_-Yfz>Kx^oDA70RDbD*v3raS8m<0p8-UyyqM~@ep=TQLqw*KyDk#=<4Z$KQ zY^S|JIpDbYcf8#Ncgi8zYY6(?ZMpp(%i79`SK;XM@44aIRk zo-^kibX&E2cYk!}n?z<- ziR-tuc%*VQe7(!l=CxUsvT?P z3U9g&%qB|}l)-kd#@#g#XmoYh$22f}YvNMScORGus8&6~;KE24XXE4$vVtJDiB_gw zs!#rIb2aavrYIf^UViv>fs{h`*DV#g&R=LQGF9f)XGTNY=Lf&jQ=vS zJ{# zsR+>3vv73meL7>l1Wu=cqG>dgj?zN_8s!FLVtGl)^$FXl8UW|DuJJ~`xAVCKwXgs* z@a48J>Yk!6x-BpQ=6$cso)Y*9$A5rIWfk8fH_XNx`{)iz7Ls0rB#n^mwG-176ml~y z^Cb$1OZQNQRw$a|#W5_2!9=rM{n-Ib;>SeAgTE#dW1Ha4Yg}&96OEOD*M1F!)1o~A zHlcEpvc0bk2t2PsY0wVEV8Uk=Um3I#>`YwpT^uYHbraXakA0a9fX~Q9ZVnB9Ujl*%J zry?Hq%_i!ZA%woi$LRl*tO z-p-ZOyKR2g*EY6#c|)P+S*X_fE$10RihTuQ#A?&OYNx2ifb%Tab0eBfCUbF4f6oC1 zgmQzj`+0y$Qmd`L29c2-9)hf0THoejFQjE8yvGAr<{wV+Fc)jl>~G-t`^px!)I2^) zzfz(i^?jyQxkG@6-um)c0Xyp&wr`(oBPsp`r#Jc{r`ju2D54GsyiA)W$S9#4Q}j&* zybVbd|GQ0s;=u*hlbqMj{bL`?#T(Q3L&;y(4(&H+MOff;mi%MmmJhseI|QTkCnyN4 z!giVD&rA9#=@`f)h2*j>hEt+-Q1gX{G`gbFp})BkrTdsnNidyEaKRqctXRUU-Gel| zlP<5qsqdOn2>tuiGoD7oJWGH&ml}&-8|eIW9O{Hw^)xGM&@7~~dV^?7v(uD*KTJ=v z^DmA-Iz5WY86ZllVLPkDy6AM1!14N~!R33DCC@v3_5{5-8#q5o8B^_p9fV1l?=1qO z_JQK9xA58bwao{P-Sm)xjCHh{t)|vq$K9g+{chC zF=i7luKm2^K02C*hOkk0J8b9vF&281iMv6+EX-V~-Vdf!s|GGqdwyMajpT1c-!PUK zj9ye0Z0B~ijeh_%!1lYA2!$pl9`!+K8?oRdWq|Y)_d830b=>et=gv#NsVq;a5fiw9 zRr8jpRqSH^)55FL*8c!2a3$jk$$>qrLz^RU=ut(g|(fFG7%S>o^|Jx5A$fYPtd|x+wTr`2(Mkd8iYQ0wkR0xbb?pxw` z_3=MnIP1KA^E)%71ILr?s$qzc+E+owsf>Iytgz~s`ctP}t3e1tqFK(qvG({SoAE%sz|cM9`Z}((qX+Orl@F*U>z)F<08=j z#3yFNiJi#+*Wx}!TtmgO{Kfb}8PTSH-0j>YtG^u0epZ%`B)?|U4{rVskW!o~;Z>0F zc_}6=kXCNP>4Ty4-ID`)cudKDED#R(G752!_&9ZpZ7gXDp8@?W!$g^GGCzyioLu$G zB334==kiCxoHe;ZGTLnq=k^q>?*awQ2O=ivzvIWR644R&^_LO&dU6T8^@;Z6gf}?2 zkBbX_wyVIZ%|tM<*~0sG5SI%zzA+$@b;z$m$0NBFmV|FFQR@QIyn~GFg3J|2H<8%y z*D=U`joqU7N7kn+dWmPM2u`E?p~E((ns)=UYown!6q>$zTS^_Ca&F-}eeyu<{ zvx(YE%Uj!NM2W43L@-wo(3&MT^h-@S)NQR$EL#x`G1D2L^r1iX-0~TR_(!9OMOa@K zJa7PK@0oU$tUfh<3nY3hvFGsn`O*#RpVlZrWO503>}WX z1lVg>=VH#G{y5x}O#*kY96K08a}7#J=p*XWsNAYF7t!ENDi+{b@ZeF}1KIhK|C0lFCC2NaU`ypaTn6(P|0}$f)8gg3MwGWwG_HE`r$CwEZtT;0 zN`qBHrkjBarXQo-?$W7~bzh1AA1B_$X4=x1XRhL?Sk{z`C2hvp{uw5*LxU@J6gd>p zxPN}YMD?h)+orDhnjT#7rt9C41P{u~=8=JS&r~v1|H;%Tnz)mLOA>tD>f575Hd3uT zlwh0-evDQ8_Onlt*lw)&Hos;A2@pG~cL*QS1#*GeFLjc;$MlFvk}VY|DPbrc$d#zE zf7rV|!d}vHVGOkz-+n3c^-EC%jdQX0X9$u1{uv`_@X7q++pED#dI_C#v$|NKp7gWH z0=I#ArB8wyilU(4=2o2e_*B)=HAE{`6X|=xI|?>~5uwD(gOLx7Uw-VZyPTq=Y_a^) z&P(ztkCIGC9FD3jNwZoLbSQ>_`su#P+?ooGN!Jg zc3q1iuJG8pN;TrRvF~VTZ$6pL4y+;}#AruH)GscL2>YBvb@taa_W(j97sx3FS}=E0 zO!0dUZl#@(f}-yma*F=@DImM?G5v}l&LLSxWC`=Us1IFo9U_W~MMI1- z6GZ38<@P(Dr~$2^LYT^KUmK`XP!QXy!+|j%iU(pdK_fa4(YH8>d{G|IF&UW4I`7Ld zXEeE}(W9e!yAg7h;7W3MxoHJ*BltQeMIm9=jScBcxw?dhlhdi# zvzot_e@>}TAB0?Hs@Bsa(IP#$-hEO6$(0+dZzlLhDU2QSdYOKh1JthBwk zX7iaT!1v57q5b!z4xZAXLSS55j5WM16z0T=sB@F+ilsqk56AP zYS#jN{f`wB%)GLd)eswi3-E6K>Nl4#vRWxy<*hoQr|?xfP)HXz^~y`BRaGhubt}@L zhv}ct5&9pN%tk3Xj=wMdyfd_9b{i_Tz?zFc>^p0wDk(O1M@%0wP_YEX`eb`XPl z*9g2OHt8~csUj(XT%S>SBj z=l)y|1Rx*oOVw97C)XmK!Lw1w=1$g+aMu&T5mr;_pdV`~U)A6VFNm5I49*1cYlxaU zPC_QHA>=%EHDe_#4gG%{XSpc6B=sg~4%vUy6dt%D6+gT0nd_53l%*a~?)uj(UD&|= zd5qkjFJLsd=XBrJwc1!9DxJEmN-8J$Kg0*>kHxekQIFdG?Cna~MNC?C(TAuJ9K#(@o3`~`2 zWLS~qEHL<4h?hHg0!=*;@E}Ah+>(t|)+Mk_1zTvAFhrf^7`uu0OhLh}bldx3)D0l} zyeIWe$$MM#KR{3{8P5rg_&IxZnC#yEcdxs>)W)S}uTl;%7Jfkr`e2Czshs zu@X1I7l=o0;={I{!h48**n{{po}VWQyz_N<^?lFGYwlrlY}G$<{*GKHW=$=ylIz~M z408R%nf8D3b_uRT>>r zH#{%EH)n73v2gUzFX;Q<2`?ODhVef+RNoJ@j(5yO+?v`U^i{Lx z`wl0ap4Tv{C6x1cDpX^K9n^c@4CSn!cbO_=R*y*p44Usk1{umtM@mf`P9mnHQ{_BR&e6OHLbXtmg zgoxJ+3N^K*Gy4_2lWymNWgS^`OX_C1u*Bj_BN9PwvfS4Z=*o}y^?S>kk z$K>u%q1%pBw$h>o=~@V>lxn)4=Rwhrv0;1`-!wN~uC z>+iLHt=4Kdb(Y~h&IS0o(cDW|OC-_$O2HsHoPfR^aa?6uKZj(6{LHkuS+|k-Spz)ftL7 zuUr;|qjr8YiR4LYWYHlV%(@2&Th~0OERQriItI{H9Bajomh_2v1d$X}8cT;0e3^Ov z%l4rW9L0PC;M4s>$uO-5$XB{ePHHrXw{%s^a9`7yoGrqhM>pFH0Y_5;G|+M# zW+v_u&%Uu-VCE7r+>e$~#&YKkSO4qf(s-3+_UAhH<+jeL*7oui&6339ow*+gFh0~L zuC-q}ro^5}xFHsE`Iw|D-xzE)v<%T*?t20y@SKF~`QGydFp{_gVP}E%J)!>A;&DI4{ZY_$Vp&%c=S&Xs3jnrGGN`s%NA6 zh`EaOE^akTBZAZ>VU!1L{~d|Qp-^mBqg_qxeQ*t`uLg54$C^GKo7?Ny~7b=e-CIPWXHJD#z&qd*@b&+)DlY}B+j*r=Y=d70pmR3Y<(GzKUvM?Tr#$EUR3zMLrS z+MRIrbrik_pHH^>Wbohi8>J>fRSuK`PPs=}ay|%hP}qqBLP=TxcH6JWAdI-fAe#Pd zdH*@je$#<&pM1t}tOfH3%>h=Szw zqIw6kCzxnR`*aVX2_L|)E_x{O3wW4fx6B`%R+am4OfS~8zoULf$2p}*QoKv7Ni}!_ z5Yxa+OJpPaK!L-l2%Mm&9^6&=BNHuOqThxc74-L6NOSnN`ANj9KS(JsWzLF>T^~S* zqXy%P#%xLAJQqIMr=E9DvCxXwrxvU~0%E9Dri+@S$RQ4nW2XX(gZ-0 z-*ct3Y@fMVr06GESj|+GW%$NNW~W00M5?#v66cA+kn|OwNdIS|n}v(ka2v8{VQHW< zoBO6O1kmeV=caY`AAppD9`Wp3lqHGScsg9q*y=73^Awd0iZksEQL<~#@{A~OCXgEC zjq~zwPAZK))B7MoM#dNsWj`|1#gBN;dZ10jMEL=p%%2f5=ewRlpX2C9;P+Z~zDzfh zM)E%ZUd-zj2H)of0KO$hZq`Mh+(kV(#+X`*#)^qMS9`54~RSnsTtmR=8mepm>lGSV5t$En{%O*FeDC9UCsiA(qkCRKxIpN+0q_ye{+C6Th za?TnMRqKoNuWy46M@<7c%Tce+cMBf1-sV~R)^@!48dtSn@i5x$y{CvDxwcLFCRu~c zeWWSexo^d_I2v2|;7EoWC!>7cD59X4#>lqepT)amZtqWhQT9X^grLCD;C%QlQ_2x8 zFb&yKLdKHKGJ#okDnnaf6fq%LntsE${X&D`ZlFDE{TpFMCm~4Z0ay979aDTK6H<0l z2wEJAT>@)p$9+v}{)DaX7w+^y!NXQ5WD10=G-VefR*vHBKq#noO zwvY~uWw~t&Rp6wN=+cLk z)A}zfiK233|3Dg%q#FeLGdTF!XLidkhVCb)%Y&2}RqxU#cw$U%msT~cB6q>+F(55# z#VLX=nSVko6A4X$ zzE01X#G#osDsdqnK6SwYX8Ue|F{`IAAIBI^`Huu>eFkW`?nG*)$lQdyJyVPnnI z@HGo#yx zH^p!0o+n_cp^yhJ6FkWq{Hb;7f}}WUg|&uUqL0exV|cxqg7>*pxQEJSywtrm0mpQv zpT7`{VKD)K+Z5ndgUPxWpH-75w9kL87$ap}xQWmVN5jJg1r5QN)sk}VF;xE8iOEi~ z2{sZmvs6syG)3EYjo9ekSlD~2j;}tZkBp}()KrfxKWh1hqyQ5){ALS|`7)J9l-5~|gCPCO0JDYb}_pA@5FZ9|d7w=vaMbbL#4W>gxIk6cTrkK9$g678s*dkj|#J(G&;+>{5k2!ocw1cl2@%Mqg1j>MJOp; zEaIK-xi(NLdAMZ)PygOelQeY7(YDp^3TzLk;@2vkP-!dT0StG0QmL)@yO{uiQ z)$nfPZ_Dp0G_B37bOw)j;@p9ZDy1XwabF;i<{)q6!)!-bcVApE64)im)CTH&76W3< zs$(h0lYj$^d^Dh%F1?+dJ2i{2NKcJqNDSUfv}knrF|H2|`0!vnw#swQ8Orejo(#T( zYCdrt_86_;J@}Jqt}28SH%h*jY~?VIRT3i4&;q@fB%4;TYMRyC=bS-DPrGWn*gW0y zf`GISVuks}Jlhp?fRakLl>*>O*+9@?1H=b6y{Ypde$jsMev`)5+MR`;ID*?r4#K48 zLrxpK18QE#By&O|A)#@0iB_!~H@O*}x9yNe2-;>#b2zDJlez%Im0H?|1o>zF?9wd}OW^xq>fN9GXzoh5r_7@l;Ru1H3H=Y&L5-h%A<~2jJic*afF)`}Z_9r; zIXJn<5|7{WhQP%~v&Kk-f+9I=fG0?=hZ&1NH;T|uvF`Q!<(w@RSc;C*eZ7O0kLM8$ z@HmfIG=ZB<0%HZwCnhfxIo>29iYTL{lkd(7U=@-eeV?pydaTMd6@&o*MHRSf2hb3R zfRzBkDtnkvO06n{5*;fGe%e+Kb>%58pd1pvyKUupAxB!G3_W8nPP)(g;Y}iYX@&3#hITvZJll|q|kVB;qs8I$*920~JQ9;w(bo^pi zDauo{_I70G9vgtrS5)frm!u;HOSk8DCzKF772dqT!qTtAMMLi>`M?+j6*pHNluDPg zd9{HzElMJcaHF_>@Ln>l%XX)o?|3K*4&d{>O@98cl%xetE`+t$-VIm{q9e%}^!)kC zhS9p)?AG=LzIB5}bBZkr0znE@#ktm=P(=x8XP1eM#x~$DGj)9!MId$uD&0T}6xI`1AUwxft-o5l;j}Jl4KJ1v=US7F~lpcF$SxgjFPH@sj$plf{yyf57@}o~@e^^h* zI5h^H8KoM$VLjC<`t8Qo2wn37e{(8T6HnIh0?p?Dr}>4I%`ju`R)?~3mtl`ldCLUN)7;<8LBRIvCL!9NBQ zt+H%KPce<|9&vU_(5e9|fAOZ`i3W4U63Y|Ct(igg-uTU`8YzLyOK4xE_aDqF0sA0K=k0t&80C>WyWsAO4V==51f^ygJy?Eec(R|AS-0} zfcn5Ovv5d!03W<}Gq!;&);$S(iR3YZfy#vWxVr^30m@-4XzT7qsW|b z#sC;KsyrK%^VTgXWOM^fDc-ViLINQq@gKii^Nb|~bTQ7aY~1fU9;|mH2vG)wMRJfy z1c=({^|OWJDX60;L4JWM&b@Pwbp{1gt!th+4~!y_A}uxAHLo*XamlbCMOR1N@i8hq z)`2T6j==5XpNgodKvKHrM~OFf^@Zyr)Kff#j>yj#nb;GukrQB^NqCsDkwR2bdR~8= zX-$jninPNag$Uc5@sA?H=TL}K} zow`Z&j^VV2BBEc1CChDPFOO|~+$WnVvy)G_$0uNxCo^;I;us69?GN)I#K`#^nRSz5 zZn(a^{bz-_w>ijIdBs&2GtX`hWTSNUbfeZ#rGgPaLseK9s{T@rfuwDV+%CrQk0l)_e3pyv9W|D+XWY^~8nhnt;3G800b3uji zMMucf>m5-$;fu;`NL?1X9GhtbQYmQ;)+wR@V}QsMs8O^g*3j4?o$3V+my!h!h3^Kb z1xpa>leZ1w5H8g}`;JF)oVO3WvR6RV1lM|9Oq7<16L?W}C!R7@P#QsWlob46Egcw~ zL*n)L!^uLH$RK!CTAn5ulqUx%UHl(;J_p*OtmEq@7%Fy&zR)M5CK3ok^0@RT$kF9- zi%D40_P)Qv8|RUVDsI<}`@^VGu&{F1k679*BLi)NkL`lk#Z@K&;W$UxjwZ;CVN#k& zP}r0cLAv#O2vXHyxkW^duoMn*1F7*5UNx+bG(u>wA3?p>7%W{wqKJrw_u~jPR>Flx z!`Fny7$7eMCFkbhuzhHY?8!7bCYh5tU;tmA8K{FiAnbi5GC@hMc$GMg37{$mZcTvvKXRYzpD-Z7B9Ou>{{ zq9 zO~L}JRb)6f=PVIXfC)-~9!jAx$}I39Br367>;OHyMh2Q6&jZBVom`w{a5-loWbrXw zAwr8gnHxqkSp`}VI!76U%za@urrXvWLpguUCv^p0d>?qi>j>jUYQ2Uc4d`aQv0w8q zocc$b`5bE?inmBScyK7EWnm>4DS+Nlxk>)gBT?GgU7L`YpgKwM$&;ckNRq_~$64T!n zL*>V)YqIKgoh&DZC0fNG`Z@pr=*38ZQ{mn{#Kj^gPC8_Maj$ANinD;gZBPYrUD!JY zgmT$Vo#bf~QD61(jF_M}ZE59QzCF2je?=n2UG!iDnM=F8HpyN<#{ow`JUYsRsqT*4 zet7qs=s;B45B1I7gaPHPXVk)2fwYFin>R9$h5{%u)sVQLVV0k$c7!grGnLY;0(t?>~py8qgtpKq~Q?oei1QL=f z*r1{&7Ym3K0;Et#>C#-Wj0HzQ9fEbMg~=rwUc^rh4bTKCBbW}Ghq3JL%)Tc;l4Udo`A7hpipSmO`I z1!|*05D`tV?IdbCN(g8G2>^IR1Ym;HAVf9^vLFMrF|i^ndW8TtWmH#XnD*gB01F{5 zo71}M5>N&}+*Cky?)QaSQXMY`m%`7CR3stGT1OD@)x)jq`8mUh-R}uRf_HkvC7{|I zG1flHs0Viv5Pipc4gB&LRn6tYlB$@_QBDv#BzwXn5dq>q`>F0dX3#G9uF-b~R^M#s_TG=6X^^|#T6%-*nj5a9DE z!=kkkElSiT)s<{G4|T?Zj)JLE;5%@D&{JnT?LvJR*GATC(h2KWV31PyulQo1LR$3`GRd5cLZEWvVb#$cp{<;|ZxO!$2%QL6;-}S6gRatk59Q0C%}L(asxCT%*x- z*FRWXl-r9cp58N4PY8k?uaN8B@-f3}A8Cx)z9^c4odjcgNRfG-c15{z%rPOfsiaaAj-qAEq^m&@d_jyZ3OL39 zY3-qT2oCc2B(bF|0j)0lM9FX#j@xmZA<^-BafL`#w0uwR0APcJ4HI6@a5BWy3Amh( zA2VEIIw@L{L;-K!_l;1T3aARC=4z975uT`)RpFtYR*-SRA_ZfST(m=-^kQITVA>dn zjo9|mlLCsMpn}zLBN<7B_VxuvqNad4x1$dA^V60j5 zh+q&WQmb~=6HTWG;}panh^fPOba0c#7YU;!kW-}7DZX$}BLlS>v36Zhw|60Is6lK_ zRB*f*xG~a5*M9KdC_yY_{o_UegnHj6tY}pilf7aDCWnsj*ifa${L=-|AM+#eGWjgX zgftkD6qw05H06{WLUM@1@q&886-1B-93>%a^b)8!U;i6er*F znsASf@yfz*-C&_3O`dV9A>Ddv{gVd}q7X=@RAQT&Cfq84(#2h`DXDaD1yxF24u~C3 z#v0eO3edd>CbzuWLJAEG2M|Y%;=M_scGX=R75!ld=p4yhbOG)TC}E*N4qXG4{8bDP zpwd8EQPFH32yI+}i3NZN*gE7N`r#HRpefh!f@h`O1F~oXe>vmzvwPNCxESC2S!9nU zy2BnvtLjs4Ni~o_|7u`uc2Si?lv;7ZkikI1_auJ&sjTr;%UG}#TPwnLq(R+2*m5I{{23t}c9A!)FP z%C!TnKn5z{bjZ{ium~kmi!SwriZO+Xl-iK(y5qb7umu{AQ1HKH$2Kq#WxJ4CuN&_T zm>L8Ob!01h#KY{vTjBhZH9%N5urSmU3Cj)rW{#M9VKu0%(>!LR5jfKC0954OQBEuz z3Q2~xUf($Qb}iuxU%|(@<0J4T5ks`{^5d1)uTMAYSpg9Zoe4qpQ|l(FTSJ}q@sS8AD^B`fuJAs2Y*c!bk`>LpsK4Gl?)()+(wfnrMpJTxz;#1u0WosRL>^Nw0#y zK|z4cH>@(Rp=lJ|5eAl$>~!K6R$l<=5vc)Tdz-@R3Q7PF2q1(QgKIJB_zi6k0@Jt` z;_o+J(G(ZExR=SSEP_Zcj+~tub6FQBhSHBtH999A@QKwbc5MCS6(XmGf94M>b!}0< z9Az-ddaeF2O)wNTsgHn&zc*J5mz0J5*0B0y+vCk8v0b-4WZ)oFHm~=O1`}h+LHfbw*aMK@^UgHA z44^kFLa!Ugp<1f15&Z|=9DoiW2Cf5gbJiZm13haTZnu|z81@DiSV?5GQvxJqSL1k5 zfDY_q5Z33;I!I3W9AH+dJY)qo_;~c;aB!>;$tvORY(J0I6k|y?;n^Xb(g1!R z-didU7fslHM+KlD-6PNQk^l-Dvd#UUj1%w?%I|-?F4P9JrYGQVxQ2zOb}JUl;Mbx$ z8)QoG{I#E(gy_?o6fFKfSOz1tdwBc85f~PA^56u}TJTR88BAeFRR>-<^NvU?%7IvF zLcMX7;97YKenq~621#H%ZxiJ}qMMVw7>Qx+HVF|JM(Os_hA@k(0D1)HndV@>x+ow4 z-UQKLRmg{14A312Q8pBI5$s6llN8b{wG#-e~iIo7*K!(AnMXo=O5G@@^_$E9A zaDlD|V1v=}2hd7jUPI3G1mgrd;u5&8Z_9^EVr}Phqw%b2N>D!9FZ{U`8yG~_3-7FP zXweGt=r-5i>lRQTK?7bxbz#KZml2n$VL5{KP3=0vJlJjW?Wnnr*UvyWJIqjJF~I|vZke>VyUh_4fVgnmiuE%uN+`YZL9yTUI%KJog7 z3*Q6z#ZV#1+3Ofsb-r*F5r*%R6~GLMtz2Qk9S$`A0JuX4QZ-h7IK%*r-9zY|V;cqp zJok)VwTKWw<#4;T0QZBOk_AzAgfwXH3?_wD?x*vQ8YoAE-G6%TMk(8(V2_1(>jhEI zQg_Sa7(f(3AL3%7!$>mt+rOMjYB;%ST4@d84&g5(8t2iPcN~VQ1wHM-?C1=YKm}EL z*ElsqsME5G?6170H-E+|PN*L|3{?6xedxvINWUV>n(%+a9$8g1Yfd&u1V)Z4Tz6zZ zu85YeS5VuG=_h4Tk~f!Fx&(Bt5h}nGtLVo#u0uc(djRtrtCmnYs3q;?+nN_=D)o_a zZ%A%<{bE7_LaSV1o%uLSEvXVNjRXDS7CaR@U2?xzENcLW_(w>&X3abVy@57ITI&IW z@m)?7JcKBymLTJ4g*h1#YW6xkmSjz`BnBji!B(t_AmZ&@Wyqo25v3g#xZAi?1yqf; zpMKnRNv0K82ZN3dJ1{TFA3^fjjf~$zgzWLMLzjU|f=v8(w(j#y}{+0WgFW zwP}{qsm9vZJx+DotOAis%`Wvycg_^G#;OcQeFyW9qNLJ_d~-E0Bgh3|O$pZDj3%X4 zY)uQah&?*%4@Qrwsby-r+iY!^hw2C@K)jUbPB_*!?K}ZJH8no>hQ3yv2Waw5>S6ce zNJWG<<8Hj*>%;1P@qi9dwvVio8jsglCIa5NLB^v{m;U&`U>*1?+w*YtnM{E9%lB}t zjN(AZ4SZrnKx*RT$U#OB?GM;=;gKXNAe7-lb@z%um4*`9y%^4^18{EDzBh(iE}6IO z+m=x0O5#+!@8br7kI>}}A(yZFSelmLv?mTCq6*i_c%%BsDxsL1ww_eD@yO@Y3&WuG zGgh#c=m0-U_letZH8I<%x_=mv@X~r2#ZH`64m%@6FgfRrZz16F z_i~z+8dsM#=qD&fZ_ncu%Nj#E;}{Vj)pnjf_llEpE!|f}3;^(k8x^_dy8i%NZk`t| zi0b;dXaQCRh1;*rIB2jPL=0ZI5!6dw=)2&nUm*HxwuGi|NivNPvT+ zK7oGBC(RIfhb~D)OkP}pc>`E{Q1E2Av9T2q;RY9A9&5tU^DEK{o0_lljKwHkxc)K$(pR0x@xA=yvqcHFT;Fr@d&`0@9UlrkYm z>x_{l4OUam_xO0$B`q5ZDBU&3%e*v@9U9qtH@#YSCL@}pZk5om={V~3#twjR3Zexa zK^gbq##kt!5xj2jb42+uzb9z#sHiB6(piZ>1ld5;g2CGBYrLmO4-WV=Uk4A3*RR{IYEHTf;v2sIC6+W z_XTg-pMP0ZK!ALo?g8hlEXIR>tZ7Up^?7hz5QtIkzPF1>Y!DUFp{<}~ct~tUKG;MZc&7y8SVQg(sHTL&}EtvP?93!X)oOO${czi_y9F*4e z;|-jRJxt-}iixk&toXeV3(BLi>&G}v;xDctP1p&@ZO&?ZJY_%+r}L7@VYdnGw}(r|boqRyL0Lvc8{$f{^i4gs85z0-*?3Lxn~ZKPL?^0QCQ8iIgGLu#Q3 z(C>S+)*%2jNC+l;;KY}~>Emn&^P zaUzA)x1D2!Rsqf4C}VH5bQ!+oB6$w5aZxlPotQ!r+K4&{wSD0r>CjGb%!I43Ct=&; ztSY12)H*Mhm**G~&BnvG;Qp`xq#AFc%k^KpqzzO&ZO6RSn7kj}K>eRsic%)T-_9^Q zS$!CZU0r+!`sXP$4+!^#p)opXC*?4H(m^7v;J<4GKsQf9VlfZ{WJJEIxP#`O6zKjBtZEg!9T`xKYvTzu z)?SogEeLq5_1hw>v3vd?{bDpZF*pSP0?NNQBB2n`@IB#%P|!aKdics%jjlE0E!;{P zCOWzcRGrM8ASm*bbbF_oaW&;SqD51EY(!hx!lj~Q_>Rj_9tfBAx_rL>-Ql-R4==f)MGT`EFyqc1$0 z>BUB?V5zgVamP7OYY2jN&9cZvG`hF|AdmrD!N7ELHQM8{gQApy6_T6t&loaD97PbZ zSCmdPBk_e&0=A{16M_&D<9{!vkOUI4o$M8GQIn!|?}erJOMok=1L z?tJ4lMdi={1UspZlU18WD0f>Qlg3DjtblcbMh3|^_Wp9ng$*7rHS)b>v_qwO{{Z(8 z3RtfO5{8X?z-$9UfrMev&alT}z1R|O5vZ%!D_^3%QhCU#(AuC=;|`vsAn&6cK0Zgr zN(d$c`8_!b#7d>y*L5r73U#$!L6-P8f*Bf~LF4ZX;>1bzJNYnl@#UgmAp?{b7sghU zXd`~!Z1vK-%99V49J0vG;k?VT*h*88U^6l75O&k6)6ah%H)BXkd!Bp!Ys>hJh zAQ3!wF`WTyQB!t17W2aMj-Xi8v0&GpI;Og@(kcv~0j&&Pj`geS8iY4$c)K4_*?H>> z7!?lG>gw#P^)4UFY3dfmH}knQi}FcM+XOan@>Q*Hh#C_^tJoI z$5j#iGdaYUt3Ql$YVbQUL?Mt-01wXayDkSv^mgQoBnZQ@7~grdjmfY8PNg@)k~dhz z{&27@QJtN>vD=7CN9H~ zuZ#P^OF$>8m{>^lq`GHJo5l$wG1)YU=XWDfWoGikK-7^C75FubSioS5XJRKE;>j$u z5&^BM>mZGtq92}D=MGazx0B8I|0$j)|saYaI%B z!md;hQD2|dHz=KMq0r>^KO&fg!hCjsFTwoGvK+UR1W&{J#-b=jk=_pnNCjaBy#c{? zbQGP8a=FA6pag#7fr;fqq3QkQ$OhkM`gUgs!W=X`{Na!Qj8>+^-N~dI3axeeMc?oRpF$2cm06+6}&Vy>%a#uAV%VwULm!~>nkR+sZ!en3)Ho1e}Jg8>ndH_u;q zvWPi|{{TSf?>IIfobl%p4JjgU9bem&;jlo&s?lmLxWFobp?Bf@{;|WR%J&C2q?fk32ZWQC8@JEB0d`z*OSyZ{@jaPz4J{ zA0qz%*Dn;PP1{u#uG^3~h_mtw2OU@dQ ztx5XHRMl?H84x0#IJj*Jysl`SlzrS1nuxFQjshA_?*T1%I^*|{5C)Lq;K;W`4zaBO z?WO^Mij{Y*c3w;&YAA`fDfCc2Fa?T2g|MUSkI0x%K~Xem+2CNM~#ie`Dk~W&*L@INDMjL^IUY` zI73b)Qdt49IQzm9@-N0TvA{2Q==3zW(3xQJ;-G;6eUne#LXcYR9}7rFa+tlP2&5t7 znSY-dBPeO=EFV!adIVwK_FNjcqB>R=;u$O?Dm0>FJzBu<+IhY`Wz?ur?j%R{e0*Uw zN(5JKea`&ncR*8A@gEN+5n!ig@qTjC{KJ6Dg>?Mum)@K@njtoiDl_S`yon@Rvo_%s z^}TxU80p*!J@0g?#h*LJm=4^I;ymyx+n3EIx@nZ##_n7s=qy$QM(=Cac=Mt#eSq<~ zhcbjfFPj!um|n5Ldm=}{wVs@D71(wc-WpUpOV+-yO9CkEj>@1OToP6)1(F~)#~02s z@|&Cu{=#CM`{puVel{&TWh)sBQFTB7gw9obS&( z=Hcwa(9x~;nvr#fOxuJYZf_e-sF-A^E8hFb>pU<<7g%n>ZmaxZ0(BvT`xjcspb!;Z zhrkv3#~Tq#5Z~`FfRxmV2))Jm;`q9NWFSHSa(g`E#$-|nr}+$ST7{%u-xC9xst=Ms ztd0OgkT`@$##)t*cEB z*@VcXLsNbAjYv%rsD*FeSZY;9?p1mGOmK+w1=w`B4vE@2?Y@-PquS*0(q1RQ(UE+n zu@&aJf4rH-iPCt+X-JwjgU=i?|(OY1QAx zv4XrGycty`f$tn6tFMgSD!azBU0o?v_#tzB4OP=Nm!~xlpiw{(AG{)AtE03O@|Yxt znYQOzsQ?^3V-}EkR`7e{k2p$@8Z?FyfIJ-@NBY8O zqoRDx4ZN&|FkX&LwY<>LmIlJa^to5eZU6YR?s zL2NOymrn$ADfya&F*s2UA4|C2;BE>Mb;tct~HWfwIzJJUu+c&Kb-#Fqe;XvnamBy1H1tm^H z%e*~+5k0)P>w1C<4Qm2IOgaTNUi8d>kO3fF9sS|e73yd_88$WMUb2$NIKr__d|*xt zDT5mI?-zX95<+u^0J|-_e(}iDd?T^IfGLggVDB*pi+jKI%hB=y8_@HFEb3MluyWvm z*g^U@!hGoyV9bSM0o^{WRKC{U=!zCzy(-ix|s5IzJ z%fEPS0yj^9{1wI}4J*dn7D6{0xz3^4)&(dVWdX}O*8Z`T)CwpL3h(ph48cWIO$%TKs> zj9s&h2k`6ngHVc~q#5DE#M1Ii({y$_#R8LBImUpX>67>?j^n>EU(2@-D z1%88^Tsjms4DIip3^A(eK=?30li|)VI;X??-f7quuv>+>SBHR;_PKbt4Y=Do4ln}) z(6#}a19gC=DINoIIm!b*65ny+qeCi32cheja?Qv+0C5W>ATb1v@!xV3q_PyOu61Og*R%wId!AxLNt z4MjgZVFE)9rFoqhbVU%n`267q4$vq!pPY2rHk%i`vecR`BDA-dzD(hB8p8EFR)_zpOw#hLb~rC=}uB#zO%V2^YMF4EA5amY-Vwuu~wK z*e(Jt9g>Hk#uN#rX~!YMcwz?*QD2Aa2y?Zr7!HqD4K(W;grJi88U&p#Q3{yJmD+?kxibklV=kzLGKNZon;HF)We5H zu=X5k`Nb50pmskw-$-Du(X%x;@LKjfKh7Xjxe9!lBwK@&JUV_b*{k8kX(<)i@t332 zjs4=O9}{R}6`C7+#0smbTsD(o$7~C^WW)$lba^vK^oacBP`Wt74;%R~h@JJ7O6Lq- z12-C8PdU$rhc^K(t}sXdaeyoUpE)w4VO#+Mv=?f=F(RUd%HDY3>o$;qwtpCI1ZRwk zgvou!tN^hP8kK$Yh8(lvTuT z4)DE!#>_+kIWUwWc+1caiGcwTq8FKpXhx_j@q@1=nyw65DZ4eC$xbadiW`-V9kTaK zay30T<=;06aOp$QhlGEeE4>d+6M+2Wei7U2FOWB2bBAbIfu@1Wss<>IGa6`d;30Wa zj3HJY4)Rb6X`N-A^>M|*`O5>zFf%(l%49PfuA>Y4!bp#m59!D3+1vCwak#0lrTaC3 zWxEjjnH6Z7-Q`o9zBFiChG0X(glrsV3i`&|V8n1Ez#hKw+C+jmKtpYKI>QAJ+{H`2 zyx|deE57lz+L*vzu?Tw2X5#9;i%o=u>Bn-s@t|=AcHaExhi9)9Gjkj(GCh$NF_QEx=Tk(QG zjl>js#`$qut}<=QG@HUbu`sc4+Ab~%OeBkdcTM8#oJd?O7Z}A{{ti8!vSCtUdt<$_ z1vAD3ujq03%AuploadFile([ - 'file' => $encodedImageData, - 'fileName' => 'sample-base64-upload', - 'folder' => 'sample-folder', - 'tags' => implode(['abd', 'def']), - 'useUniqueFileName' => false, - 'customCoordinates' => implode(',', ['10', '10', '100', '100']), - 'transformation' => [ - 'pre' => 'l-text,i-Imagekit,fs-50,l-end', - 'post' => [ - [ - 'type' => 'transformation', - 'value' => 'h-100' - ] - ] - ], -]); - -echo "\n\n"; -echo "1. Upload Image (Base64) - Response: \n"; -echo "\033[01;32m".print_r($uploadFile, true)."\033[0m"; -echo "\n"; - -// Upload Image - Binary - -$uploadFile = $imageKit->uploadFile([ - 'file' => fopen(__DIR__ . '/sample_image.jpeg', 'r'), - 'fileName' => 'sample-binary-upload', - 'folder' => 'sample-folder', - 'tags' => implode(['abd', 'def']), - 'useUniqueFileName' => true, - 'customCoordinates' => implode(',', ['10', '10', '100', '100']), - 'transformation' => [ - 'pre' => 'l-text,i-Imagekit,fs-50,l-end', - 'post' => [ - [ - 'type' => 'transformation', - 'value' => 'h-100' - ] - ] - ], -]); - -echo "\n\n"; -echo "2. Upload Image (Binary) - Response: \n"; -echo "\033[01;32m".print_r($uploadFile, true)."\033[0m"; -echo "\n"; - - -// Upload Image - URL - -$uploadFile = $imageKit->uploadFile([ - 'file' => $sample_file_url, - 'fileName' => 'sample-url-upload', - 'folder' => 'sample-folder', - 'tags' => implode(['abd', 'def']), - 'useUniqueFileName' => true, - 'customCoordinates' => implode(',', ['10', '10', '100', '100']), - 'transformation' => [ - 'pre' => 'l-text,i-Imagekit,fs-50,l-end', - 'post' => [ - [ - 'type' => 'transformation', - 'value' => 'h-100' - ] - ] - ], -]); - -echo "\n\n"; -echo "3. Upload Image (URL) - Response: \n"; -echo "\033[01;32m".print_r($uploadFile, true)."\033[0m"; -echo "\n"; diff --git a/sample/upload_api/sample_image.jpeg b/sample/upload_api/sample_image.jpeg deleted file mode 100644 index 44283cdf1be12c157324e4ea3fab3c89f05224f5..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 62767 zcmb5V^LJ%Wus(dEiH(Ulv29E|vF+qUC$=*a8x!Zmw#|uc+s4GkcRu&M_YZiVA9}B~ zYwcdWd)4ZyuBV>Q<0H13BF#rq{G&D36%)bE!2IdPa5*+M5 zpduo|BcY>WV4$O-qhsO_e#OMX$3{oTCBwxhA|fFn!Td`8jhy%!Au$Q@f0ID``xN#I zED9VP3NaQs7V-aYeD(s+;ULN(e?mc!10c~MpwJ;c`vHUi03_6Zs|EZYpr9cjVZH!h z;r?0iAOQav|IhT_69N(n8s>8qfCL2rfJB2r`}gKlX4!o_rLk^a$q){BTN;Cco1@lP zAch=X1|OH}m7Kz+lLpI)AM$$&CbD)nM!--OIh<4&LxhX1N*46YlXfLl1hqgEFmqab zIssv!>{!}p!xuAeoz*y}BM+go`AhmP2G)@powK!&`G}*`SM~1?$;5S64)loG0`oj% zt$Z9P+1BH_hPWXU-6aICX&jn!-T*JHQ%g7#rU<1%Xy1HnTEb+7rbyX{-vD4`uQ>zp z-5+my-E2_A^7GN!@ocOYs+Rz7SP7lZN=kvW3VEf+&o*R-<(y@|Qo&yF3*Bc3^gqM* zr&w6i?$w>DI(oL^i;xCVO45Zzm85O0=`_-$mGF`&`bp^i}7fE~94Nb3Qv-Vn_4d*F0_t@yUe#Ywd{Ad(gtPYqlgt;Z8khU61xRVzJ9h2mB zLBy--&G&Y+A@!DC&A8x2{I)VQX#Un{&q)alccx|2X_9Xcim7Z_FNPO1uQ@$tV+xWn zh(A@wgOJ$wv%Zyz&&nEP*M(_(_JXm(Ezr!-+A(s!+SQLKot7C_c@S#Vfw!f(-_<^D zfS&508^|HAhpNzb)LQtpDMcz>5n67EFtClygIo}2hQ*JtS@=yoH3uiy=!>Ju{lNYR zkf*?{9k6$r+R|D7)VQF3>z!OU|iB454ngBH` zvbQmNin=koN|njC`)P$6I+124^t#k)MeV|JN0XIulU2vZ6GFjg)@*XOFV+U>;p*q) zzgn1XLl!-&>--#EiXz*t`*c@ogOEv8F^mjZ0GpptNzHRC%Z~5ED7ttSg`i6GRhR88w}bvE2PKsEODdX zMu&A#H)V)Kf$poJ7_}tk6j;%Z5sK7-QF#SnYz1|US)OF+LZv_*fnR%SX19p4nT<>~t!l7TPSq9#a4aXA*1lm>OT~C-cdzAWcbcw&vFsMmwuwB76>`7*=GiCfLL^j&h zdMSB~f7KELz9r_86{-QnsY}Xj6Xw|y;QkOW6PF|Xkfk;99w zs1=;fS=v_T9jO12P%PN=25GyMk>i?4V~op}X~q(?HA+r^ zoNhbpzdhA9%3@6x^iXJ!SImeLO$2V{(@P5s{{1{ZGOz1+#qi?^aW-Q(Db; zt+&!D7wIt38g(i2YX_^523d*<5h2ieN|cU8zb{;5##V?h4fGbW%N-ibS-0qw5E3)4 zTlKb5Ami@LS~!R*-XE&-!Wq$J!#LTtCK~n+PQ?^?2k=)$7e)&t9@jZ0p>ip)8?kzu z*p|z3UpJ|?$@8tc4XTZCr^byy&7PItLRfaWqg`x`24u?TRH@Dld3kZ@Ih4cW!_XTu zq68H{GefBAj1~4$s#0RbDDI`&sebf9JI6NjzStAYss;UiwG1U3Y^|qhSPJ_RT0L@?;c@T!?At1BdDw9#OD)uhyp4+A zyn24qFy4USzTR%2K~>t}+uI}MyY_pdL$&22YbFo*SRy`${`6J}SoPYPo5_Ic}mitRWCynoU z6#`@2X5OU;yDlb1F=zg$v37&{t6g#)ZKDL%(g?ky#r4jqvqGt7$##!+cX9a4;3l~l zL+p*WIwv4=n29`HJ7d5tU#@dDgg>t_+f8Da7W<74?gKT*5(anccTEP96~;7|DPB_x z@hf<5jdOjP-YG43LKl>NvT#lVyj>#_v?EaPOZHUwDL%Szq;vWsc2VbG)X$l{w#d0E zeE)oL0Q)=RrF-d7Dwhp{lg);1GAlwrx9Qawj4yKRrf5h6KO1=iXwz2STWdUT*6z^maX_1SNs0)%mhw{>Cp^Vq@}l1xV>J z?XJiPc4}T3hstf-t&wv@OCw!6hD4X9HhzJzyZ8>`J3%!)BIV?SKB4S1jI_CRw?|O>kE@5M# zT%WyxA|-IIwUQ15-uwL3BMzf6^F(aB;7rKgoJ{?p^7cC5QlY=f;Q~C3Co8% zr+nS1F7NQs2K;Sp93uB}*t)Yij_&E50$5k9FE`Ha)D?~G9f!56IyXy6Vybu@CYy$u z(;m!KK6w$RMTAS9(~iE3f()9swgh39tqjH91%oq{`s0wV^2{dGX>lKZp1TjJK3?7B zY`^HFGAkvi@!v8O<1<+Q34kqCpit$p<^PTSFESi!o2IFMq%}PgN4g^e)w^e(oky-r`iN z=`A@#@7IJ#o57f8n>B%;0gAG%0-wBuA&O(!pNsNY41Nyt@@6nK43Qm^Vue4YAO`5( zEuv4?kY2Uyg!Q4m%1DPEHR{rVU~u7BbU@%zFlpZW+wA$SHzhfoLw;4lNbwd?xF(JTSTq)Z1sLV z)|E^TPCFijkGt{mYI5KCr@5vpeAS=4^ZMiB&}0XW^|Bd~S?$Y`d1O4ql`)_aGupPJ z(O`2MjDQHtb8^1B6?m@|iXVL3Gm-F0GLo918VDohhCgx-!ZqC^Nl+Z|{ON}hx-#aM zbko501N$w6JRp#Vjx()B7Q&DXIN>NmpX)C8@=C_+P9r+L8 z6{3;rJDs)^sm$gGJy?CoEN5-4dnN0Hp164q3{RlSD>rTn|1i<7?#Q^CQV=73>ZDv|D(*zb7i<8%6OU)7G+S3Hah zLEb78^S7nVR%wKhvestD2jcr#cJf z!D`sn&KUDe-uVt{a2qCY(_h9I#;O8_$29E)aQN-GQ{s!`_Fdd67Mz-#;*T9+7=cCg z>>M`>FI;Rl4KEx`4WocZL3m$*BZOJDq7v7I^aW2h_Jzv)#7jl-(xw4XvjmLFYSna| z=ZWpC0`s4%ZagxXyK15($K~|AkqY&v>kY}F8Yy+gwfJEQ@dAZz2unO;QJfs+5Ai@O zOjqN2fI)RoXAI7!(O1!s;M;Pq#u+>|G%ryL4z^p@P#XNr7D@WFHqtX{Wh?H`Qut~f z(K_kp2vLG52ovjkw#GA0LSvk!Xh|iffSi}p=`VS|Hyn^**!9Ncoz{QQb^Wxnl8w%5 z_?575BQ8ewRP#m!V+FxQpUpuqmK2rIRpbe4b(sK3d4Zbc!F8&ZI!d>w5$D9&6vq-Q zJEI0Yu_=NM5*#~LJ7eIPfRjJmAd$*ilYcX>D{MPO;mz31OM}ra0xjOto&HRli@ja_ zZ8gs><9rE0n#O($PmwO=$jue9F0y@Bq3NaeSR_R@{?{Q7)W`O;Cth^ZRd+0@lNAm+c z^cVa2!DwM4$*}bFJGAed$E3vJmG_&KK=%B5x;lDE9Lq9kmN?cqu?Z;1m!_-M9 zgW(ir4@(d1vT*?J*0$ktJi!=A>v!`S?C7sO#;~~|aL~jdH1{{u8oXGpu}@uiK7G4z z!b7I$STKfHyf?LZgLkD)np_MY>2QLc3Wmn7aOwAkD?YK8xW3%bb^Arl)|VwO3?Dlo zaHRJn<`#-Wh_QNR zjIaJ0JLl|>3Jts?pr*U%q`y0ZoD|ZX?|Gh3;r-Ivxg@D7D`koEqozX8~if(D)Zc}^;FKE zy4B|u383zrzvG?nHGt;T{gHzNh4e`bss9sj5&{Ju)OThG78Doi6tCNMdySl{IWM_| z8L#f|e(KlSEIqg)_%R#$A;cO~4=;a@Lf;bF^9mn{;|eST`|k;UXT7EKsxt5v$rX8Z ze|SQ(_Y0kVKje*syQ|*!;Lh`{sd6WJQzJweezW?|+sjOp%Lsu-zD?h2~_p=9DC~$fVC~U_) za<_*>g?aKraQ;^B07`!F&YleH2M*&>=j3D)_C0k1e{1StTcDu2qWt5yuDFd3Z46x^ zEBSBE-E0}nKGy7yD4$6sjsrx|X^xLT@A5}U{%`L;D#xZ7)paQYkVfU@Ug`}%bpGS+l@5sPu$2Ns%zrZ-RKY7kLc z3A8dNC*Ypl>F`>Ys5HQbr`RmiNMmd%o+VEhR!%%O z*E&5HT=fGQ8%l9pJ^>?a>+ZLL6_qqgmJ^eb%EE<0cs}vF>P_DqHEsL#D~qEB2x)>O zu1}(?E}lc`Vw%;j=?qw7NyGp@eSh{H_j1(Ok)NVQPkg`f({+>^{Gd3V*#_U47NL!i zvdW2QgC(Kz*JIX_-Z~2GXb>4c40N*ab<37WR-1KHx-v4`Kn7<={&%B38WXT-rD3%} zOUe4BL7s!fKZiX66Hqa3FRT4^IpG3u=@0*oC0VsrPOi_-qsdR4GHrYUTA&vXl6q@U zNd$5+cNt_XZIJw1&Aml5%-cC!X-bG2 zLN=s_;FU<_usb{_F8;}67@jIBv@0Ta{g$}OfaAfQQk4G`;lnQ_vg z-ROL%Rj(|$m7FL+z+Y9GTs{Hac8Sh}llO#pG>6|!e~>Lkb;z6qa_IS^uhk7>o;ZnK zXrM(*t1D`f?MM(P&1fh78b*@TvC=ta{a2;9U0)Pe!xE(A0nR9Tm%gJ?-qrt2C)ZIo zc;=mk6S?W+=q^9J`f<`NLF~?uBp{3fFZ}?8&r$Q_k*E4*=J}%=#TQNiCXy#=qi~|T zF*K_C*_BNy%4Lt>k5-;Z)9^I@fiLppc&9HDD+NxHd2&-Jb)T#`=_62k!0}?ASC$|u zw<&prSEh*TDaDQ+OAdQmF}%)%YuP)>JlO!pSBX(Sqo}j}1~w9hl%Q)t=C5-C+euyW zU|s=2@JbD=bF7ieTMh7(XVIOzbRE3@{=K$VmHlKvCQQ#bZWd5l7C5BRo=o#5oF6Q9I%|(Lxc1#rmWC-E4i`}a#Fi=McpdVTW%rZ zN4Zx28#h~4mZ!H$Iy$s_@#w@*-e7I}=e?1!PHq5zWELf6m{Ydc-N^hW-w(4V^buB>o|7fEvj`G zvyLAes8=vOz}7#FyqQh>G2hEnIBHpGOSIFFk_FvbpwXYcYQ?emQT)X?AmfGW%x2v&mIX%Xu|O(VadA=Q(Qi6ZGC<<*l zjNa^N4BU=%=~t382iYy1es!>W!kSE3cLt}IQ%+nA3r9j@>L)p-HbsIdC~Dc;z~}*s z$?|n<7a|$HEhj}I3UZ-Q?R&+<8bB*5?p6ThMNMVWc@O@#3gT0)wRdyzlk@j8E5UgM z0MWn`YJXRn^_9USeY{l)FXfBxl0tTtVw= zsN2cOZgdCo*Fmd$^Rzr-@x!*?ujAHjHLkmnxcO~NG>E%X%OE%5YMx{ica1y_OO0ab z>;JH0B(%$-l}OLZGd-e2t#3s?t#2OD;L}EI3b2d~?b^7g^_tuPp$2Sbn0MBu6bPd! zL`d8e>(*iBfOfCMolLZ!fSF`ZLEKlJk&zfsB6y#e@D)ypCEZFc^QM*~i` zM|`dp?HBl1jp*bu_D{f#Y5YBIG|EpmMxeoTQPoD`O{8|pGf!!6WVdgKu774~vMv%1 zywYkZJ_)jaM8tAh78SoAex(LpNOk0U7o$~(<^ znq!D1`F$W7t=+&%XEEME4ispvOY3Xim-C*?;3MRm{ze(mGr`}E(< zq%y5<6}aaKsJKRI$%I%rX5%jm(3>8&;#choBmSbpr-JqvL&B&WeD6+45}+CFPzlp5 zx0ytP8)oMQO&xd=F_Zii1aSVE>yP4*wAw!NB8G~wdOMO_?NqznoaiqPHLAvXEWPu* zsqI#CiE?+bEgtX_I@VSiv!BR~O4uqL6q}5HHFrW_tAk{gG4^eh|3jrzEL`EuXS|})2uIjldG(Uf}~vP(dsUT+8SE)wysa0 zJ9TiquS|27zdd1( z(cp_i;9bGrSEB2upPun*WS;eKGFoDiwczYAuwp{PfO%k3jA?95i4 zE=ISbpQ(uaUKD|xk_fIAxj8O{(JhTal(qk&f~JBCxv0lBzUJ9g~W;t z;drllc)be0oO!{J}r-TszT z03zBFkqo#IV|}@l1t+<6MZ@*f)zJ<_8x8*%ShF}-VY#Di$l+$(Q29`Idk(?foXqt7 zSPxk#9W~Y~8qRQ>!{4*BSE6W?At3mQr;c^%9w2whvl6SK*O))A_eIT!Jf59kNO2a3 zwU?3^`>YbQA)tW>i?klda;y{g1dgzHj7^jHneESLb2yE^y)NE9Tu$uv8e>Z(j$)psa9Tlk7 zb#z>8qdPEOH*WQPsVBkAd>3P{X{v25cF|;{G1!#nAehw9_n4zUWgLddN^fNtfH*Hy z+dka0Gnvz>CcD>^Bs$Nkw1A(HYUk=R>M56f`MGIdvyv2^uvS-LtRd4f*HY$+)KuYe zUewfGLg`?On(b>ce@Yui?e_=Nc}V#{=%WkeDq%Ua6qlCPvLVby5{O!L&*;ssFJPt_ zJZiR1SI*3P&f}hbqch+m{0WektPeVw>@5_6`bRO?-|X+*p5g|PH}*))J4bC^3URVc zwf#*;)AZ9{pOWEXf=Nnt6Daifsckz~s;2$o{AgJCwV3*ZczrzUG@sIA-jQ4-n5M4U z9N9$m@1Saud??v!qD!6s;E7pzh4y+krmNAME>`&}W1G3TTMRtNR_5M{&@@>V=2p-< z@+Urcj@Dq@&(-yf{&_)Ca?lrB&yi(7jJpIY(wp(glinAm!xMZ(9is(5KgUeMPe9ct zAi=Vp*+0eQDo6M|+?|@~(rgww<~@!YiA3!;w7CJD~qa*W0PL^I0L))stc%#5-MYn%Qd zAJB{Yk|s+n3GrRe5MIZEtU)-6ZmZ}67n{3<`blPdC2{I&afP?j{FJTMlOe^9WS)=k z^^q`QwOgHu>hSV946#OIhFfcN4+uxsdzp2R&b#8~;&)>azcWG?5ip(d_^T}I`&0Tk zQYdJ4!FWxKxw!9b$smSj!3Ew@Wrg!y;~y=WK!UFFF4r#Mv>xdC5b%sO57)afL{F-b z5$<&i^l7Y$v=)uEQy$7BzK!Es{0b_Zlidmpsf;#|bSqLYCeN7y8fcE(l^tT9lE^1Q z^XB>5s-BgFG8IyAJD;9YcX}&ci2gasWYBKYH#bySGt?|T`Flcr?b`DR$R{~U;cs&a zD5H@1z_s;iD66)%wb40l(o|Rdi54Co!<({eaG346~N5A@toaSb-w!ugkixg~f9_p)4*`8c0VcUu0lV#`5B85F>{f z#(<_$ZOs9(=H7GpgH7c5p!IEty7rVlj|GjkdX<<}l}o`q>W;F9tG*Ri{kv|Q^0w34 zax!YkWT8y^z-l5}L%MaxzwB9tR6`nB+Z*2hO`TX8ilw|1dITF_$?7rQ2wM|*$y zPPZ-^EB?~htVhz*I`SooThKU|5NSO@t!%82`!;M^l0TUy!1Psn!A7u>eX)WB*Wuh6 ze>A#ZI65ZB-(QjN#OxrhiB1m8)2wK2lu_OF7B`_e&=J*?rECd<1!0(A?NRh0zLnb2 z1ZFr%E03$^##QP%%SK2)sepAK-6D>T-5Rw^pF6IWKInJ5ZbV~2msU0qX=FQ{r#o}S z+5~!N3X~TE)Lo&`i?z!;g9F;iOK7}76)OqB(q-`miBCaJ5u6O{;c2>%@p~!>CA|Qi zt7Nh&H|^!=fXU&2PKk^>?u^)__I85nh1i6a(70i9<$DQ{7PLha{-mao;gzu1mBH%9 zNQ*s#>)Q7f+%%!pcyHWgtn+s7cq#mOZCmRpFo*{C$c+ShML(3fYL{I(*6!N6ZJhpe z6oRd`D|N4?QKh~+_e&Sp4!=Z*6Cn^kJ)ICq19A4+JNv%H+eb&P6w|i=&GGIUNs$Ft zG31f-A!C+W@)1b!8tF|8H$kwWlMT#{pRFSUNX&2j+U3lVb^6j(oMgR(xBh6~*Hv_{ zs--a~aCSjbIt9I;Q(M&yr$~{Qg;S}t(HK_03+7%aPWhLn!hoz7#566a_tbqZKR|VY zk%qySw(74Q%d%@jUHwYoy=VBo_Ff-8A-0SXk8B2s{2KSmpz5MsQiS_?uYnZ)y9{M@ zLo}k^xeR1(Zupc}L$=3iXai7PvZJdTq>};U)CAv*c06zE-f&C zP#a*E6R|bTQ=eW@jmS}V{ILcKkgE^7^_M6v)CT6v zR$n?`QkXewJ(NRL3IqC$?d3`{$d%G)LBjHWlkScZ+LoAQWb~2R5k9AOWJ2Iy#o_*S z1N=%Br;C{~YmVQc!Y6^6DR=ah6XY`_0qrmh?F&+B+I{IBI-RH)>FNC0iP(1Yr${dI|Dd+afk?LgUYJ5w7 zS1)i-KWh{+uY9;&8f(RBIShDt{Rxb|3_lJZ6O>g}fC7%Sv~E&W28)T;D<)LS5{R|7 z6cJswjHgWZ)F-)SdHmgl+V>G2DELh<5GA`)%e8*9M#@fmm#UG1XqeCs-Z<^6)*pg}#(RTbx^+_q?h1<~Dw;^+Gwm8F$fbi(cM9x-#FC zvPoOPUnFodjYe+bl`JJmrXb{WT!Jxz-}Oa@HYC`!uV^YF>}^ zAyazW%6ODasr}kkUF8R0vr_?IJ)tI$s7tEWC~=-XTUoD>sG_w&kON7W?~!W{pmQ2a z%x4Y$4P*?vZ%k5RQ^aR9;9E9Z7iZT2Od7bu2k!{UTDq1K+4rH|M_RP%_Sh20wM{oB zHl3BKG(K947jc(fGbD)$XcdN{Fgm@e`6;3;{H>36CLV)tP0377U=3&W>FqkGR!$hO z8q~e=x6@_lqQeir@>8{ecx-)Cebd!6NQ+2=x8%90ch<8*fN5MIZcI#8wv;ucpoLYb zZF-{L-)~AuAyZ1BZYJonm}?x@M5)V|G7E#fc`ef)&k8og;skQhqo_F6m&@;S=CuXhqP4u5U*j4is?8N zN#U7&0c|xj!!vqXtsHVFYja&&xY6&$d`X#TRjO%T)=4{L&UISIh2euWbc<+5`$+Dj zk|W}itR*uD)H3{?aG6&*_EpxICG)Jg)~qNmR%@OSIS^Db)7#L=K`+U?_TVKOvuzf5b8judcw53RX%^Pp4d1};;I{?c}a?!VAx;pY2{zb!<{F!`I ziHxFy(9zBMuKH8)uTMTdspmz9!km%YkUf`cWXU&4jS&NhAx)M|*0~6A`z5vOic>PH z&d71DL9Yo%281WF&x|~QI9+U$s@|M$PzSiU;;_ms4INfL9+r)6;Ui4m)Qs5upiL3` zn-Hma#^X+T18`zY8!#P-ox-7oVtl!|dBtd{Q(iv-HgcZ;>ra5!CqTbf?qfMic3$FD>GlMwt5AkfeuNy%6- zzC*DnW0JEOL&J!O{tv7EPkbN@A)8uV7%9u7IRhMsJqBfN%^5y6c)ey%e~iB3HhV1$ zBr{3HR59pwF5Y)e3P$IqhzV7h>{k=Q?-b9Twaw*$BEV8aaJ`Y+?y^Y8A;rXU>j`{t_6-n9%}8hC=ERG z&rIBShX_S^Fi712*BR0FShZHJzm02BBGtxdwX)GmYQ^HC&4>YSyknVxy*>l-D^?Vv zE0!avKuG~&4SmqDNhEQyi@yn*h3WZlE(H@+WQb|ndm2A4oj~lo$up9loT0-O1xAxc zlug|bHht<1D+~Sdl*CLz6l)A0Q`%d6vhc5ivtw=C+vzcunG;~NZpdJXoSa<}V(Q2$ zUJQjxlt1}fWUY(Y(LffAi4H@93X44sk5q17x_}1`*U*YN-SW6nh)d8@@VJm@zXL$g?B@9TO`}Zg?8odC5@F@{ZV1VAYq_5Rtu@*MgA!KP<-Hvf{4_-?vnLH9V z+R+bM%L6f4p$NoLqK?ZuSut%i&u9b4Vxp1TL&==SCpZR6<&It&=VA(&n6;%PmQRlR z4_Z57GXoODda^UeN9c(W4ClGICLE^y``>8%#Y`8EJFS&PB{+EGWCnkWEzpRO%qCYf za%p9S`6Thwcj5-;zpm1h0K-hc|Mp++#1yCc^q+%M|9=h+^{*r3|Fkm@kmzV+7_3mF z-^rmdS=f|~|JT1E|MTztbcVW{{+oVb8G7cYV=aRjudzGBzOkc^r-o4GeNTh4S%XaT zv4ND3&ZVnr*=kAZk6rx(;vX7#TLmV{I9tVR1Cp%xW9(Sg7~@A zOuU$s)7KX&X;E*&aOpa_l|3=b{CkYw$2YA)lR5%+n<~V$KnnSqBgJSdIVi>KO&(i6&XgBLqKz55?jn<%T$g}p@B>Hx zt2c3&6{5wg(*|7bUN|o&N66$b30er%UopRn2?Gt-gfJB6TfaTft?>LO376O8=3F2OY%VMmHb z-Q(7}?3aHWUZL<^Q@cPJ6BoBPL(KHd*HPN~X!hs~nmJQ+>NYYakeCi{jGi>}BS9o4 zZL9LWrLO4toR+U;B38Wei(j_1p9E%N5lw+U`3&>Id?}jGo|$P6+`D+$tPqK`i!yc| zgS1(Lo49O>nLiQv4@MFRVkrs4!H*1&GV*5|#ke-6Hpap_x={h!o7~DQT8-f54l1pc zSNL|)r!uCo%HKCPanrkG@hei&b>c2c`5%~X`ea>cxVCkwR`BTLTXPfdiWooO>9C|E zj)OpX`WgQ8+|zr#)L$YQ>iWmX<@FR8*%S@J;o`zAy-j9U+#K;YB6Nt@Xha1nkK4o& zFdP|F6vd@V>W8q|Sfg;le~cWT)#gX=Pz3Pg9tVA39B0^SQ|H_6UabI=EbjTyu67;J zaeOgWzDW@(vab1`&u|EpO+~@M>e2ra)7B zglpH$xJUNZ#-jy=xWs6XdkOf$&k}mn510{$(z*FCD3UD1DF`N~X7_fZUt~$yhsA4k zsCx-ekxR>JNzqA}#njATX$*;1@4zc9ub3G`QZ~@)Fr`(A{Z=MFU4gli2@2850?pJ3 zqGODOySUK-qr;qX!((J;q~&TA3dOHqVyU-FqFg9N*ZTfddoUmLk@Vrc$P$^QmYc*q zu|vXeiGp?wPZ-rUISWt5=gqH-g)nybXbXz1iUC}RLgN=xeQza zzP){YCIi3Y>tkpX1|x8yF(m#j@?qlhG4*SE#DJbOv`vB0$k(@INshIusci2J3fHWn<`nLD-Q+^j9tgyNHTO zd~J`I>dX$-zdpY!HRs=T-#D(t|F`Gui!kITfXQ8#l-ECQ3Rl>wtDQnpWOT*ldI+0! zV(diTZ5}OWwYur|vZRl@mN}W>k6Z|InC=#PvYQrH8HbLL}RhGZ9 z`h8SSrZgEU>p8x{wS_U{9xz4x-Z2d{z_Y}w0@Im#D6tLo&Nc_SC+r4}bRuO6+(tHQO z9~2MdJvj;Ii10BoHQ5E!>aYfE*YdGoy!~uq^1qxDxqRgtNUoEbz^shxY@=0!3pC*y z`bG^*ljDE?VY(iT_P{3-Gby$uduGLOcYe5XvG4G^5OjXiJnkpWVJS4Ax%?3L1b*>G zC~UZ0K0G3vE?g-UyoENinp0P3RQ(_tcMned%eb#hD)J|{AM;fHzX1nQ}yf{)8PCdm ztZ1}3IhVLNe`9n@vI4YC=OAPxRL|}bg&iC%mui=0Ree+WYpW6Kq&FC+ZG}Fyz`@^f zwQ+HSlX%KxD>~G=05uH7*(~Dpkj7=#sklPt^$KYJaisaM7j*gw7_aAJv3fr1=P8~0 z04fPVp3d!-q))X?vp7GaTAn9++CY{ro-YudMu+mok{@}00@Rb6v~A)cA5~l*+-~_M zv~_GBWU@~mkYhmHo8Fm&wEpY{QTW*_ei;-?0WhP1HZ)xJ@>OO2BJGsSu@mm#6hqjT zp@wk{HDP88XMlBkU+K*q3DCc~#{1*U_B2rFIEIu8y}VI+WF}DYtbgt)9=EL&-|8n~ zBOhuITlQt>c2Nmt`TEh$$Ib=iS6(%5pDS5kH~BISZ?TqE8aDu9BJFG5y>MQ_gQnLj zf{DQ7xG!WDL*P>uiRA0h!&5m@ehN0T+Fw0N4rlSxD$LW^T}?;*$~lis>A{=*ZN`CR!$^b0X|J>ol-;hm9pCd+qLu%y zroKVFfUjp1?g#SYBu*<;e4;6pEjEC2I>Oae#Zq5iGKFOKjl zKs&r$F8kV8Yu`XA^@T~M-4R~-9|=iAMX%t)y{fsQ}{Ij3EnJm#P%<2~w6Kehv zqEcOo{SK0te_+{z@z>Z2NThUM$Ty_|G*TtkUI|AHjIFDIl}|@MuRGrYqJPHV zrk+Mt5hWdbud5^>H{b6|*jP7k~pB^;}BC>%l-HrOO2WfNU2;^(KJl?vj=SS^V zm$EAz0UJ5|OZ<7-^9UDY&&#@Oj)26`@;1+9F#3B>N%5qfuHWOA)L=JT?{G)9lc)(t z78Fh{pNtTySNdT6MxH?EX9sXgI+0*qyXlrpis0>^zA@8yjip_wLE9_#&N>zn#G zIub=37?GDhfU4naGj&WAXDweE0}bG|qew~rr2olxaxB<+vo=q=$2SEdwR0U{n>1=C zmpOi`ium!fSp5)L+jk#P=Zq#617-GWq#i8H%mWHPqA9MK2c8c9XlOQRq00u)YDRZA zTf56WOf+!{AkZ#ET{c=e8_9m6|7v8rUm#;AwtG3$1Iw3-;=jbZ8OB{d!1ar0XOWMZ zfBX~Bb(ZkQ!iECAkN@B81}P0X?>-fsfbb<)S$b|83U)ONy9ce z$V;{0r`M;BO!rDNU59S!n?Q-1uhAnm(sjGJ0-(HHSz@}ekWf|Wh`3GLkY@+*{omyzcBt7kdeov1T4BCa` zRcg=$Dn-LDe$C}ro}3ueXU&_3TQ9y8n&J^^sE zwAq}d<()W9+B!JS{z6t09EAm7nA|JgH=3`QRbU5ONrq_p*-G4}7{uD>gCiObWee@7v7Mf6xU z2AAk0Tq*VVmHj^em_TR03se@6x+#@)G|>jf2Vrx;3PSG(n0&?oqf&rog2So9DBXB9 zUM6===G{LfHgkE788{FL{{ZVAzVe2tCh5qg{Y@R*dHN^Saql}z>`2kSg{i%gbRSC}qK%XK06ry7 z+o3y^P28$Izclx`rP&5y>J%wZuDYpef}>?I=2L+rs2JN)qhX>ygvycmAW#F>2n(T7 zG{OK-t!yKM=BL>?5ef-X=PguskbP7&^Ms+62yXuXhhnk=bGJ-f{n1$$crFyIwQf16 z21dxPtD*(5;q31J0NEBlQio|Q??|&Lk9pfCR;>K>-aJm^IR!TF9j8vIh0s4=R0lGF z*qp^SojqJ~j+>IFlqWZrX>xUkg|kuLvYazJbBxNJ(2?d|ffqSLP7{EY0|M@CM=zmG zJKQG)l#9f>q9X%M-e9w4%FWhFBPiy%@y;JCEsXFv?$9E}g>r$w9oA{S7O_F~V%`UT zr2hbP`G95+!UnhkvaHP(!17YneHK)I?LYNLwN{Y8VW4~NDi%ShKuv{_qey0Ur98UDl?<-={{U8;*}uK&iR*xP z5)PgUj}6COSa*!RF9ag0uFg7ZL4W5#NA1Qp&>XqI>$ z2R?WJqjhCuGyGGTs)6Mu$TTd9BE_SgF@~GzoHb`=YjK0%zBcGpK|XS19Nh_OWg0HZ8p8fpib?*tbHX@oHwub3d$`p z%dQ4WA!bGuI(j>Fa{fvgYKtSq!U%Fvf##h3V8S431($v9y64cUxeS0aABjew7N*(t za&ac|oX2xkC?GgySAtxm!$P@nQqTuArwf`M(p#to;azz``Zs1AisX4B5gdJ;vje;m ztUj)y5a};&Lpu@W`7G3cWBDQoxJEF}Mv7Q`Zca5xIgoO`5I0RC_mt{QvvQDsHms5v zNtbs-+MY^m@`KCzrnn|Ensb}=wQcMDkS@MwN~;>WDTL>=!MZQ^-)5>}qdX*n@O5|| zR(ws+r2EwO`gB1M54t~9my(p%H$t+e4V!YkY!NVl(Xyr9ZHn<|g7FwfBZPBCmGev} zOvyP~a}>zEvM=!EnSl)eYI-giy|nwGgV9(dmm2+BE?B$9frTsf)` z0`q=j3WAT;WH~)z$&O_=jK5r6Zw~`%H{yjgJQIsvJ=NP;H-P2ckAKVlt&pt3VeJnK zVN>8O{d)c=rgj@?<$+Vp;O68-k<;JpA=*1pEM(0( zd%Lgv(RZ&s*Jc`ZUC(B2R*m_ro1!&}XZ6C`rh}{?@R?6$wLC_OKNswX*-n^cb;kV{ zeL0xz`6pzk(BNX|HT;yf4N&B}K>MntKXlwHoB;?q3T*Q_!2kyhW>Kk~)QmX>c8W}> zHSq-v00E>fs%eYDhc(RVR#EYsSw@{9{ud+x0DE3`S@>T8{wyB4;tJc1)At=gSzqsq>S-ShK4JXiAcRL3C!I#z!3;Hon-Vh+`&33vakx(?gXH`zUGZGeNvohqhL=c8!wUFVbPy94Hw3&0- zBd5h*4cC;ec+?aly$v~J?y0l1RPQRsh^R)P*%(ycJE`cOu$)7Wy}{Yv$%_)UJ|?`{k+p_G5!sYBD@ghpEW<+ zA>$4Q%2URMENh(J(Md4xtfdNv@Z}LcX^wiSeyPy{fV?(LkEfTr@>aO-aezN z8a4GzO=!?yaBo7NZPu#B%Q@!*hc#D!v@D^p#2o5PcWORSwJ+|2 z8g6we2j-_zujSQWQ*yGVKAoY`oaV!Id!4gFXltdr^+kaik$-e@3QpKcjgj;}rV;Q# z<*|^*oXvNY!DbLi&_<(l z(=aNr(Yz-1uFY{v>uK&eM@>^rt5FUb^4WK+e|1)8p-!sO2;_xND^zTu1tRP^g)Dar zgy+(uO^(10W;z8bcpR922vSgm-Vt@-;4P+d zldHEtNemk(W~wtlK5nU}c`iPu9T9Foquu>eMu~t8Hxo3ZBC0XnA9JV?;orn&9_zx=qf{!&N*ArKyRY)?3-V+>Iv|32zH*&2l=dv zuJ^LBt)U+7gZd)y2tHJ1(6Y2H>}qvZM5*M7vFfaMO%hQqxoMwO8i;^-CW@TS=sCKh z-VZCbPHc(jn&YoEZBS`CuLipy`rt}|gKG^FQ$QP_!K#?DaT{>9V@1#_DcMVO#IO@F zs_~ns8kEs*5)P`|p~eU9ydc8Uho%-J1qDFDH&9R`{#y#CXij#Sos~HCSJQP_#j+Vn z-y15Kqbn{7&$1N4zAqs7o3d&5pQoa7))Q)w47*AoM+3&;F-+*Aa)SphFI5AA*jZ?^IIQhx&CILZ@XE@w zV`Xr&10boxT^3=ws~VdsZ93eQDZq3eHBvzY81-lXs8x{+N3vACGGufpjaq*qo?6`fny1#%<>;H*dpq;?bD`zx zi%62ZED|O?R&Lbr&=F^6fC7|B)m$$V8h#4&o6Tk|Bp?(jGFPN-~Z z_(w+WP;&=@B04Kv9S#{kmLMYAK~Br%CO}aT@$+62ecD!F%-x=)p2?U_b@Cgv3RFNO zp+vrCmWUnD!dEOe#5q-}&ofv^MztrL`#X6|bH-N?GY+`r`0y0ww{nA4vN$6`eBBW) z)xyJ)X(~mBMJC)mQ?qPkF^ura2Urr00RWxNxMso|%|azvYObM2M12!gwS@fI0sAI) zh@DHlVKuyfT6l_{3O${?uj+$aq(glb^}6sEB=$w}>vPGRV-9vs84h>OgCO z%lRzeTXfO*iW9Jv>aKV%qPmnqEGSoRXJ>gc)ACl=9e5=d9h4!2U|#XOj;kiipjY69 zWteK5-@Mc#V4YD;4Mp6PkBad5R@h3_Wl%T?+Yf@xtMc2T9i4_>R_;f$ljj+ex}nMy zl;8&1ldEl=5UT!l5w4o zz_gtWmuRGRb(0zvQG_A_1puAMTZR;?t0-CB&fQa|cPD;$8PmIunuluKC6;p0eIwyC zYZeMJ%rB}7!wt=3GZ`w%0=}!FZ$urqHbpkbIi|_8sv~|M?6g~>d_lYw;B#CCv9}0W zMyNlSS+rhfJJkl?H2koIZSl4Q^-`r}*rUq^f38#C5wS(&%KM>fI2C1^f^-NjLxVTw zx(yfmmwWIi6QZ|7Tkuf`7aOdl0t~fv)B55RVJhWY;){wcJdyDjMaPnEVY&p^DBVoq z$zN4$2ElqQFrwk*-FLwFGC}I3m8vRK$`Lm}a#>ZOTK#$Z2DA&UETm|fP#Y8h@}b}l zBT3mmGpry0zH6eM8AVD13uByIpf^&7#XgV`WJ{A+&%BHC6?JvtD9W+8R|-(z@iZQ* zQLBi-U8(b6sCb?whEt!q*MLkaG@-anV^u8F{GWij9=v3T9z+Q^RF-JQ-XE#aKc&oCnxP zh=QkeZB^D(SmR=vTX<09?7r|tp|V08)TjdZOsvR^E?_G!HWpWE@Y!9(P8Kk{>*+P- zqiv2Fg&Y_D!(WNM2zo2q8;Egwv@w5(16z*;s;zDgr9S zUm3uOSws~aT^B|4aC$4XZnaYZUYgNbRDvX}iqd_ot1IfV%qTx-ozxqSs#_sgqHyrp zYsGE|;2y$!rArOgk-?`8{fyzFy0;Df$rxO#DdCkGaBIbUE~nVYDq614PucWV`$)j! zs=u<=fO|Xt0G5CM!~iG|0RRF50s#a90|5a60RR910RRypF+ovb5OIN#p|Qcy@F3yw zF#p;B2mt{A0Y4$H_=0*X(jdJ`m7hqBA&lk+rpuP7CVyQCSLr|E2p}Lz^mv#F%+zBU zTg~A4m8ZkeCJBOb3o?aRO`_bm#V#?jXVSCi1!^>AkopNdH_{ooSqwgveu6C5WygSu zDpqG0R8K&Gm>!-{m0i>xfJ2E=rAn15QG{Dbc2W^mT_1)avrMn}(ioKHGUdgX9=~JI zlJPpm-jymOuSHy`Nwlb+@@^hvD$Kc;(Ps%zLky>+30|O>4-w3%Q)!z02hmsSOykhX zhoDN8=~CjN)6qC(^DL=hseR%)Yzi*mOgCQybN>K3OM+fdY>ZiR!LRr+U%3=mikLov zRAUr98O&ut>%_T_%o)bvy}=R~{{X_u1JK40^jD=y^nxU?RTM3FCqOV04@!)$LLc+9 z><${~YyK`=Sd=jCUSl@&rp5%z%wB_o93W+SX;8Ek=v=vereB~2 zXJ1HD=`gn+K=d!O5}0!zLcJS7>8K@Mg<`x+JW7V@I5RH4X`Y`xhP@Rl(!b*UE?Q!0 z?Jr<|FVwUhxkC3}^7<|%)GT?0K*ZZqh+T+8Syzlpw#@$k;u?dAuccyZH}o&jWy|#Z zi9n*ND;Oe0NHXHXTNiv0YYWNfdo;_>BtC=w5P!m~M3;okMb%-GrV##BkARCzIz?xt z^{@HAO#!=14$#%Ka_#cV{{WURr2?jKPOKP}n6O1#X_*>Gy$3k|0Fw+x(%{9+H!Ig{ zXEA1VcM6LyFL`lAFVRH{4=)j#juh;z{4lr%g`XGW(^ARgm0pGDGYF$mW5ir~k#Os^ zfrPXQCSHLb_gDe>rQ&Hru8+<@aYZkiVA#)E*DItHD`U~a>%mXV;1Sb}t@?#$_ z;$GLa$J-0<_4bSc;+~u zrS6n6H6Dru6bDeSQt+3DGUbxEA}Nf>wli82e_yF{DPnO|`XYK{ziF17T%qE_cI(o; zOd<<%a6{H0W{~0k0ACT%Tl|3hOPeJCcsTA05B&Be*mcxgOZ9UIdX^)j&(pXB&|}i# z#g_;eda&H2T^v|WMBM6#&0=4yC~wlV<TAQbawe8HjC7_Fk)ct4bn^d;gwpshoeFk=N%4VN2+Ud~0A1QZK1rCk~v`qCD zsl8FcG}oz;qZDGMf@0Nl%`A-CQO=gXWYn!~7ue6x%A+`y15TZCzeLd!)l(?v6}%pjN_$1luBzc%z|=Q4~>#uw1!Fv-D?>wbVkQw3uT z>4@bs#fT`qdTj5t5;Ex?ANYV4gdXMkStW;{s-rBtH2}ls&}fA)1Z<8J?c!awF*7ps zZ*vboqpw>?#t|~f=={EpWn=CikxC${15tTnW?Wps*;)SH>J47a&OcDb7KUEQS&&G_QQRp#3WG4S!-VdL{Rv@m;V5gq?K*;J7Uk- z#Zg_wn?qsmD!mBDl3bL>1U2Y7P}CHZL7Y<3uE&u$|lL1 z(5yxtDVRygDvRC|Q9FXdWbl=JA8 zc`!0JEtQGc2`zq6Vj?_TLJi`g)3I!HH`Cm|12N?LqS~f;cQW&+{_ey-x*~(~ zEVaVJV=(QwmBH<=f@OX7Qwstcg1*6i9)MfGP%8Yzuq)aj)Tg@j71!o5NL#HhM=ZP` zlxpHwN+eT)J^GX?=TN$e;t*05gn+K)sv$jqqxjc%T!=F zc0`W4F$=JZC758QQXxWsFds!0dR}R#BmV$iej+uwa~h5riWtTPLJEqU$u|_-O zN>_q=I#85|^CzHysZ?(mkQ&n(r*i=ON6z>38}pNpWz2gnzSBDpW++L&WOu;-01wmv zn!I~)9pWQb1O_vJ^9GJgox~P^28hVm%mgJ=Q_eo>9Mn)l=31`hv2ofVS_EEABzjO; zxNcj_&6LdXSNzXAIjLf7a}akRd#)op6)=?!y$qs2mLjS#=p_d`BbDhm`Vni}eE{xC z3G*XS;r^03z-`X@_%Q@QyUCW*K>!f0IQj_|Subz76#`b>M*}5SYbAOmkv-8*B9um`nG!Ts4993@YizBV;c%GDT;Q3g>QrM0=01{h?E+YM zlrv>-1I$E&P!%)8cuJ3}-*K&=$r?8pfubxg$Dv6ZCL?p5EvuypVXmXH8$Ocqg9X)=+xFiP?)N+gB(<-!1A;zD z=r+7DVYH1xJ5L5jytGcpm5N5MfnJVZP=Q*jg`mrRJ^ zF?9~ArxPtwRv&W)0J}p2+)2b-78mzG9GQuYXv#1wg0ajcqcb~1tNd9`I2sG)IHCRb zQQgN%((*1|&>2f|v6}NJX=cmj8do`*q}>xFc8+Dz^)7;E2JR#e5iyU733i&O3b{Fz zO2eo&)8cgzv2BoUQ8-H_FSMs5wpq9*RY5n$qG4m|FBQw?ZdV@?xSY($T?f!Yw5Cqh z;P*O@;dYc}uMq>#18l&kil};)H_S_hY{cQ2mW|7Sp~TS7m2FHSgFL+sSZRjLygVkS;$2Q6uY?CO)lk*PQoL>;EA5T!Btt*< zaoEAY_L+u44QdUruBU{!7QP4mW8zkJ3+uKLt4^j-rA*AiuC-ZoM0DOr#h_-lD=P^p ze3Kxk%$x|1C9rUO%QfO79e3_%lg#2{0Qtwoj5bAdxNLj#g&bEx1L_={;AV{?#O zKyRYeVo{A}`jk&={{XW0@SzzBbCRJWF)RwWFqk?g&;J0~S3R7rGOKIM*=k&x ztA5z@Z`x6BiEvQUHCU+x@ekZH$bf_%ASxn)@hkvE?l=P08pNyaw!MGI@$63FC z=2dInFp+~Ng3;w>2(tDVF)7Qbm2&v9taAYDcM{dWXpi4kVGCPTj+B}+H1g)9@Oz){ zski2z%)Xf%{{TPCz{ynpB}?&$6Cy*fr$6t^NnCJyz&eJl?gKB4;!vN7a^fvqQOK6| z{IIX@4-0X|_n2@#Vfg77bQEn_{e(QBf}DCC3lqM{p1jl#z?Jz;z-`Q+c%DS&D`Ex6 za8=fzjHF@JLYtDtCR`}p%f!uhRj<{`0-T;az-4a^%e55^P-pV}M6=6(eSRuZ!HyjZ z9>Mv59$=XU$^+hEvZw>Sd!0%HGu~gkW`=QlLl(s1DT;feLWz)>&p zB^THjdX5}pDaOP7g z#vSV){DQi@T)Ru*sou}LD6^}5AbFasuy-67r)&=@$HSu;_@y30H1*>NLUT}d6|{g5xWq+UCJwnJB|s2`U~zRpqciRpTaG-E?6k-JW^vk z8X>J#ClSoVT$MQl9~TTbL{xF8*E;j65A2uBJj=^fN6cKIowM-x)Ec|I(KAxT!iVZI z@kqDKR+5K#`4uk1jEw?7eG8=Dq$ z-;E6Ji{i;ibVUo5_kN}&4e_bwnfEdzn1X1m!0&j0DY7T?2&Ah)XU|XoRrIGXQzWXF zO=*JL4=9a!*oX^^!UVft3oyE}iMLh* zioaxPg|lv4O$TYmPm|2T4m{vxLf(JXhypDSzsexy_SmO@luJQ6sh(x z7+=pHFov$Tm8&|SK4n}39x-9g*1lyiHiaJYr9)OrS7QLFE7Nw-<%z1ImFJkFwi;K7 zkM~|?F^ZUZfr#u?G$Q{1gHS^JnU#1+m3DCDtNtZHV+L||{{H|GT>@L%e~Dqh1B5a4 zEI6#MD+30~KBGyAVS|_{bP+NMypDgEYdFLT{L4fG%Te(d$wob{Z9YCz_=j2FEc%Ey zC|JL|{7@?063U4H`+G6 z3&3{{7Mu2FS3qy#nm^pd>vPBK`F7Q5Ve-eT@^yps%u$!Yz5XDy z(Z%2>pC-2lb1XsQp$~C*2)L@?YpIOj+)<_uD(HVWrg0ENMD?s5SW!pt5RJT`1TalP zr_Jl$7*s|+Ww$GCQv(E`*yaww&Y_1j7|@!k(ijXI9JD00f@aX{mL}*2e_eTW_h-Uk@RP&Q(ZrMgYwGH zqz{4>h*&-XG3l2#58MqUf^zV<4pL~oUTpsWUG+6~XMtrM(CWnSd!>;x7ds0vgq?9e zoL`Mwm8ny7v}^7p7V9P-!WSR9~IG` z<1=$N$Zm03SGo#!5-6j9MXbqKi?em^{-rrC<^DQ^8i*VHP4dH;W2l^QC@-6QF$Mns zD~|sF5j?f#P}YziX{3qfVMC(atK1S$9?^swmmtWFp~NX=2v?F00NDcE>sCasZSu3qs>>R*WMnHn)3 zzL;X$S7@7BTYSVFEMWcvaNP(Snf7%BQEN#plT3JF;60I*9Pa>}8NAoC6}fZ^t6I=TJdEC>Zxj$+X{5uGyJTHC}@+hPg4&%CO<(jCGf z-}#vmf1F9Ss*rs5GKIsg=NA(F)@cUaNAyP_;5GSpn6a)6j3UQqO@kL1P-}`hhM~3i zk9U{tfw^@JX=7lByM&KXli2e!5asXBp{_R0il{yd)W58hWpoPEerY%pzc5lb$HgK;@4%s(_^3afywE;u1s@10*Y ztA!zTpi3Hq9*ev!15jkqD;(}(S<*9S(2H3@zJ)1cjw)!5Dm-m?f>yB|j~$RUI5Xlp zMF>kAVjZ+8z<6ST3$B`ih(mqwUzowIC9Y16pbh^3po@u4UjG2`Fi!H7s9-aojGDYvx>*F><!=)e!oWl~n0Sdy^zL;IGqUbjY ztdCoPcMGxkd&lnZ-*9C&T+Eww118SaBX1i`3u^ zq-RiSIar$XK^Z=<*H2Rd{kJdpVi`T_5wwGDNEpW=&$_)sE5{Hcr2&GwnzLjC&0a#w zjVl}Pk}ET1jngizq8Ip`7FxQU#f6cLV~jMZ%*o>_^8WzXr^(xMIE(HbI}Xvwi1#ic z%*`86)lMh6nWV)l`;6~5aQec-#G%wu!=0~L`I*f5IDP*B z)W^-4sG3=So0)-p4>F@|?exs9O1QQRML}nn&!-NM9<;}3D~H5X<*GyINaT zA^EomRhmDz$YmJDSaWRK{7fO98;aIg_2TgS#U>;DJDF{|F*~0u#m#Ae#<`U!%?nFv zmuzUdFy=mrD|%(9+gOd>XY7kvjGm@)S)VX0aKRp43{jbN*Z%xU@Kn~AT;KjqnLVJF zzZVY9zU3)H70lBvXmZqYKsI|@{X>wBp^n!=9wqYe!iH}4=47@V+1|ezi|DMN1{1 zQCnRT0jdUuDE|QGl*UV4G*qw(FjoA|6r92B1Vaub?u}eqSwgi>>JfbiZLXA;!pzy z`5w`7l|iNV7>mhZ=vOqw+-L2O;?kwq%R#ihJj*rSv-phO6BcthS7uU@z|_EY1Bp~q z7}@tPceP1I?={p&!Q^Z64@oY~SO>JMR1F<_-ePE=IWrGAj#)zjRsR5UV3)J~nMp)b zqEw-3svqVe@PRZ~!ka>oZJOR-G)mql`^0b|y1(POb@;r@ZUjo6V|@sP&Qesb3jx*6 z@TrPoRM5&D@p0M?$(l#RI$F5*;u%GyzcX@>(uSLh+jj5X3C5oN2y_W{^7hMJmoSS; z$Z|P@lW%)3@Bs;}N_@;Pyt8#J-5&QV0Q9pjxUNRraSetAWt9sZhBzQxhOLD*>O2yq z(c%hY(tcAh_hOf|nY>jWI+;i9jKQGS^)n_ayq}tiw-%OYg)6Ee%k-`DHDwGN9Acz$RO+yCX#nZB_bZi~`UB^^9AC z76koF?xS-}a9aNWckc@Jg=6(_a2#0K1zqJO&z{aR@wrYLg1S>d3_^~jfQ4C>8SXlp z1UXK;pxg(UZfu~!flo-%@=eMZc=H9VR)~r8nXiNGxGEu2EJTqPi$;bNw0ICY@g64n zWYA|3CdM2!wO+&=mD$9)q2f@)s*auch^JStX;r8+xu$lZtCWPR;#j`hn?tP5&NRXH z5nQGgFa_MLEs0>NkiMaA!k<%O!1_iIu(P)V`D3xMc*w;12+NEUF?G01;>me9matcI zTLQZiehP z>RGn88?ADSfo9UXuBHgF-zS1K`-1Ydc8 z#1G6}{{VQMjyF?xsaIAQ3{2KFs9)k24Fyq8^$IIii&gwh>g9RgK9(mhZeaBhxV*}j zMk1NrLn^C=w@QHRR3*!X8Zxy$p26w~Nu!@`2skO0Ru^+4T9k7ed5j3H{^5lRA&Imw z3^Yw}wYfdIg;%2G^Zx*Z9Tmt*%#9@&%bt-fYmX@B z!klI^hSfthqe@vuuzTOsDdXs9^DV|J-W&v+4m?Z{zVkYv?wr>??|3XMrci(Y&c`?J zDGmULi|3ICQ2m*P)YquLsYI}G6()V)MN19JK!;`#9uSoH80&O#JY3MRN?@?cd!;RN zsF25BMm@Ec+z&I)LLrgCd-|DyUy0Xi?l7o4)SxXe*HdG+-!lg3s+m0+>EDT{Ua#Yi z)W}TWk6pj%6OaxJ*E?-%*Z`ZXJ6)4 zPi;Qyp2}5JxAQM}I~H&meePc03+S(n^EA4Qm$}(B%q<$+q@=ZF#x}7_ZBUKW1&$pa zSg9?X`UD}4c$n?giu}qILn@~mY_B_sUCFa?Kh*PqL#Q#C85f$P@{qh5J~1?v9(kW7 z{Y+Gt0Dw?$ttA-CuRZ0?o zZCYX(Cuj2=sPf0&2I?LJIw#-HnEukKxmA&KGmv5Lj*yYq4Fvk&6S@wX^Ou_L}L0GHH#)PWn70sBP?Va~$%*vK) znWiR0y-S0{yliLl88gc&Nocx@lfB2e(dOYW+*QDM<>m=Ra7zP{am4J07xTYP1TCNa zjHj`b$SbUXY0#sGBOH3{;hsaF|nE66K|c;sYSr)p?d%e7yev zNl2_E&|ItU#JqQ3QP+_esP8XxiIvtb3R}T291z*T_j2Bcnw#T&ye29G$HczRgA<07 zr%c~+^B3kdvkVFf`--M-GObfaVtEz=mE{~meM?q0p${uJsc_BIC%eQ-O|nG2hZy$H zc(2+336`f!K_-C}d$u7QTN-1zRm8b*bzeFCRIOM_Hbxn1c zxLk&+=2s+Qw%Qy_QFWMgna@DfgkK&e*vu@`2^x6d++K@EFS zmWnD3`z{v{KIP;-a-D~X90j5Iw=ndSK{#)S+QAm4nw7c(ea8e{!H8zDY~2W^s{!>8 zlJcEg62XiU9*r;a9nrO3(ui>VdQ27pn7I?Pl2JwwCQQ(1hRaIc2;~0JFJ&94brZJ~{z^xz29bsVzfF2pRkIY<{rU^k$4yU(`CEoVRL9^l) z`yaRjEIE|puvdJ_Az3U-+kC*Sxl8U<)!=YKM}vD zPQ3B$3fb1bGR5j$p|RyWyZwjUX}Oo7FsGal$+IiWy+!!z-Z_QMvqZ*GqEz8zq4Hcx zoHF*nTIvQ5h>Wq&rZc`F{{WG0z@u`p1cfC*5Pf?}jzy_`V!fa|>Q#Z%N&0%CUGQwA8Z%>%*;U+ffVxk@d z@qs#?W+2&!raEG?MZ_Bc&X&My4{7X>UTRPm2eCHYvc&hDEuO%0Jc6cDR`*%eP6kW* z9>@BbR>?^QaQ(_9a4J_|6Atkx@m)%YHb5wtW<=D3gYH%HgsFl#LWmC#VO+3}Iko0E z0J62rSExZTF=ZUY!A-~U9ec=uqn4tvwNxYp3lv4c`IWW5b4o|FOnYZC`DOr=)KHcV zC+;qhN5GhXW0`8zu`h3X65HpS;`fy2L+Vvcg@bdjs?^h>SM@KU4L&9AR~GXIz~e6{xk28oleGDAU(af@t9nP+a(aJNeGQp=}8P@@wFI-0Ht zP2&t|YP0(>TTKMgRB8yFIh9t#br#}LZN1E5+(Uhi5YINf&qRy438(UjT>c@$1n~4a zLLWskuQ26s*AXokCQT58s4Rqy@h*d>8kjIFa?A!P1|nZ*G(Vv5uLB$B2!bMtL~RIBz?HG@ zA{i~i6cy2z^_Rz~UhCwC{{W-}9Iluq>7Tj^mZ=<_N`PO9g)O;C6sUgUM^2?!d(>2Y zk}oWiuA+GKP*A^mS_kCnY^ZIO4(!^&!BDePG;Q8a)T_olE}1_S|>0p zv55(qSCtNQPFxjc2nF~owcMTkX0nhC@CZk^J?-3oPUNXe2nzoIXhCRmD`+x@#|uJk z1(_~lA<{g(uuBZg?qY0d;he`K6CsuWokvcfhfXRMR$}=OuOjI~mS%C|@WtSXL&$>Y zC2DzN%M45(5Vm5KQu`uN3|hi0tB3~F3`)byR34Iqb(mbHED&ZfU=srTo9RX*^L3yqy-74&vTA<0&K^To@Z1*Kv zk1FPK9X3?GkCCVX8BfTDHFkM`Fq*_pj7KGrTbNWZ{5?KNbmEF~X)kC@^kJb26lP8{ z7WW)4M82kEQ=({?+d4|+uKg~FL}o-7)KT;;p&x-Fjal~*av-}*mhPb48jh%C82*5( z3m6n8#2{ta38}Uq4dB{y34}J{Cn(FTnBIAdm;jZ{k1~j5GJ|ErT(f7?diUcDL{j&R z7bD1KAAky|04^nV7z6~BM7;%9n_bkco#5{7ZpAgYTX87G-QC>+1P>O9TajYLp=fZo z0Hs9=#R8=*4#isFIlS)~-}&+rGVWyVeXn(0^IBqps#`KvYu~J}{mqvVzpXFY&#+(b z5L)#`&GuXB$qR?T*+P2`9J9FnpLsooVHJ`cddl_Vs&#fhL(4LpQpaZBY<1E8Kr*iAh0uNnFrhYl#j~2`v!sZj!lwU%!cdUEw}^M>f{7 zjG1ti5N5F%S0io~Tm_lf93>Cd2X=a4(`kE$f4@^=2p<;qkqYgGQsxh#@OvB3og$yI-T8eeqOZWv!> znWPV7hwWgnpYkQi->rG(N`&8x61h?c`mj1u6LI`~q3@ME{b$dVuwzRBe62iy>gvSe zh4-(;h@-QATN+C(r)~cwLYemQF9!>GIN54z6yNDN0BNO`jzz$)(xiGxtWd6`O#*2C zE`A^i`dD33Nz35+hs{EG-9uWM>|CAW@Z!Pwr#fauEV?Q3Dr3?fNDlLr=yf4IGypeG zn|i;W@=mJuw>QZdS3jT&UrC*4pYx$<~8=Hpa$6D_O=Bz%Z(SNZf0|&t+(lu+)*#1wfpVWgzL}

>By?{7cHlq;C(2EP5S z9EJ8J91?1&${G5(X<@uJ|A%>gZsxSgo)~dUotV?vX##bkx1DJ#iB*TgU9 z+?&5h9||HcMIhIS!5edV^CdJbRVb#g{ptA1fc0$<3J>RB#d_vzZ+Qk7%km38!btq$ zQ2c+N|FMPsUwnkfz|Jpr`Tt2miHs@e`yBplAPncN@Q+@gd8I5T?U_RceMB?x;{cKCutk8^UQ?2iPBDTh=K}k zjpOs#pUul-aCfH06`yB?oldS6{M8Qfwb>lm*jgj`JgLm+ZUYYTl&w0lG|C^gUF8WOHH&Rv0p}c zk~ZvCCeebR{fKRQST=*`DvCL7UD}V|LbO13?jr&BzE0T{!%3_93C-M0z@VL z+ddrehF!Bm&4Q_8ART$_SD0OK-z2Qc3q!GXV0OIPod^7m9O_Uj$g^c^A*ZANq-8n+ z@xHJ|7<(#vm0**>e7*<$vkk1=@o)rRKZH|m$Jvvv_aHISB4d_c%TnX&^Ffb_V6?JJ zW*#+~^a1eQjGVGCLw?^dAiJM+eWjf$_{7)omz%}~l&HGlo7dT@UFe3D(8|n}^-K~o zP4@~`@aF~oZ@+v^2cQ<4R-b)K6Q{IXkY8BD!X3}^w7%hX_AmK;@y9a8s*>l3!bqmA6^)nSFaPr!ayUzxZfSC)$ycGH2EsUc<45h2zq*-N(PT@A z8f~pchlNk$|B0cf1fhzMvS$dgX1BN`PD>Tgra$t+@Pcpfey|BN725Zx0kLv6h_R&B zNwdRn|IY2U+SGp$ci{zO*8iFo8dbLY4TOEPpjT3wvCO_Q9&g6AELx8X*L1nkMA@W^ z+k78?%+fvg1)O~>IPPewME8$?K8e2df&TWG{xNjwc4K1tyq#W7LHIF;MXFO;KsAv! z)*pBhQk{Lf{4gD4p-y-S6eU zT>kc@R*FE)PTXn^LNvOV_BSWrxkwyu?jAO{K{GOOw%(>7998f=!GDBv;{B@HvmgXE zwMkNl>z4l-(H$4X_WhP-=P;I4==N3*7&V8NLv_cRZ3knAGv{YJW9oNXKyu^7@e&m} z#6od{vgKxQT_iF6B@g$F9F(yYyKe{+cJqIW1<{{Y_oz(sf3_63VPnBCE5opoEtO~_ zaT=R(ffhu#KVb4_Np{q%nrgGA=VKdn`K-(2Q;SbQOkm_2bXOD8=zp?d0qeZXfpckW zAHbj1N2sH%mb@_8r{!C_tojQ&Z&)WwdnPg21<8$;ARO zFRe&SFoG?T@n_!dHco+;B;feJN$>&_{trv||B`^{g(SRqAqkh6+D7&+|2Gi+$Er&d zh!Ks!u*v_3T7CH2>{YbdKUoK-tgC6>)6)1n>k&4bN#?xk-7$#J<%W+_8=lBR+$O98 z$~(j=mmRfv(MJ)CCD9&Cpoy^oQ$!=tf=FpP24e+e&G8CvhC^}22p`2G!7~2=zz6s0 zSt77tnQ}YvIV!L0E>jXLm`!3g-uHuj(alXIzz@s8(-fa?)?+@ydXSX$J(==(nX>5{ zB3^1HiUWC%d=)V4saZ}D2AH(;bQ&_+3~<7m;vnQpvMe|}zG&Yhn!|TvI2_BmJt2yI z?~pV(zR58n&D%?~ulOi}s|Br?S;;1`KzBTg;0{?Zb}+wCiv>JofFOcp`z(xxB^u*RjSn z?&3pTtCK8x`~NqB3VBv zjo7TY zvHKKL$B~D_ILT;&*YE$modr>zT=P*){nY^x-n!b^Ox*^PE>YK_cANNut}JAFC0o|>^N8ZU zaG!=#8!#B{%uCL{&=^{%o+7DFH;|%oTd?4xQ;KY_9kFl z$uDqtAd~RuAsIhAC+lS()QV)a+@eOdz3m#FIqBHc*?4dBedd^jR`O|AI6QGPHEA#M zD&}{;#x7Vo&(&#o*cr@0fMBi8xhqha);k-!RJ^;P?{Yvrjydi8?MO74HL@u+9qLTS zYr@Nbkl5{XDR%#NLBP(L;xasV#Cl%zSoJG*a7En{BFVKy}wZ$ z_0E>h7>P=YZJqyW0G>t|-@V{P9YXT&@H7_+Tu%GF@@+ZUhnW5-8`~YFg8>8M&Y3$; zmgz^>dKx@$==kO5-@S4izi_Ct9lwDw$V==YHjd-VBKaT09epZ+qro%GHZKz|B$9sB zu{D+M@!PgKa{^4l9{q7dnlszZvvpS2GLu8cWy+aaY;BX}iP{(CXR)K*jop~Y4rAtx zz(5X{wTm5|)Rg*vzq&RTIqiD!%rt|bt;(KNZef_xPDPrZF;aKZXxq!<82t=- z6ei7>f&X$LfYIkYCgBanw3zL3|P41zi9Se+MxucU*vVLEL+}qq0ZqAqkwKN z)Qg$a+30eYxqoJM(EWXBtQ2DM!p`=0QIoZ5WKfT~Nb378HR+ZV;uU{yGve=Nd!4E)!ZRsFSA2aAvSl|^$OEO_+)=igh#K49 z>q0gAF`QsMGcTYDeXe3>ug|)?7j5mglBQmokq*7m$!7`+K3%lHZcUk#AXscA5|leF z{_!2m{E>r~-hOP9=MkqX#Dz2~YWQjHhBv;LH_-vN1UlGDFHID|Dv2je$i~?7L(s~U z8qe^K?sj)Nc7Vw_XX_DyuuQif$=8Z^`scW<=Hf)e=;t|TdTYH+a%TDIzLCG!_Vu6| zGfO{HhMElSIEU2+{-)q2fAh=*lIEb&aC6=Mpplk!-Iw3c#9?qOdzv~*D~tAmJ_1WY zn!~hAe82+pvk+j?sJ(3N6r;v$l6sc6|Nm*it?f$PO%&+-JOv@~*W6@B9KU6FDQ9aCNTwhTI8>ifsTMO@;j%UIA%>!hJw zMOUagq+-1M0^#qDPew^d|9weJqe#L`|NRQP)()L1lYCu)ym*9q@72Bx$FF z!I^p_6F5m-B8J45an7h=EvMqzFY-z}D!+bN@&lS#FEiNXVlgYPfP23b-p*?r+Cy#f zx3Sej>r8Z|*pYPqe6jxgz6AUS&=vlukNPkbg}hxrN_#te61DXl=cJ+;K9bm`J3SIR z$C0&HPrFW)pKoqFCWAicT9@8xRdC{CfhPM89k{}N=Q*7(H>KW zegu7oUsLE9pu{oWk^>7h0AI+*tfLl9)>i&r5aWUlx%W*3o4GxY9jOeX$6*IJ0>G;F z66*4v5PAS0{<3I| zYjtKw|74~|0=}KDAo?nbUy^R??0!||9BEJ+g4bcD9G@C{Rmue8qH_oF(hw7rK~jA` ziXT?U%d@|L>aZ=`No@GW8GhhQpnrdaqcEK6mon82jDIz$XDU|m!jB-EF#jj5n|iXYz21g;NV&(LlxavbW{}pytSEjil1p}Q(TUpNhBELpgV>^>|z=ee#FRM zdWcG| zpT>lg7E^~IDS+Jt)a?tRHA%Zw5`I>aT7eZ->BGnNo3LbvzPzw(qr&6k1#( zMyMO@H=ZgH_;=();4)TrFI^}-B;$a(U+T#?*w1!eOIstM$RJF%U>2zw*pD15u3ry} zJk+DY@d=If%@Oxsi1bTE3Ed_;0#dHJihYf~WNlCM47OF#ire<1Fy&Lm@U2q4f%D5^ zkRDhYo>DMe(kRG)rb&uNngdh@14{JFx>`jNV=nD3^Zi%y_Ky?O3G{aflJXdws=Ys` zHUu}BY%_$`$T&<|n$2Y5hfm(+kj{0WhayBbX7YV^KyEEGHn{q$IKNe#-8RU{14kmgn;Y9**MUKF2$p(XmfAU>)&LiL=L%6?7+Q073g*NO&rEcC$>=|v!KEqBz{p7%2qrpwV>H>ovw%gniMDF z@6pR$e#0iNBXePjrw>THwcQN`pq6+|Y-1zQ*tOYYB_$e5ER`%p;z>E$IxtSh9RLBD z3{Ejy5}HPF9!vCh-SDt{aqIT^p36*X1gn*;!#Qh4?8kTp8xAU9E%{$KXi6Oh(iD=u z%rehaWMc)LV`^;pBq0pH5rW(r`{^Z7?_di5W(t9DJklJrF653h-0z((?T)UtDwE9HvXvyXbv^D`eyeuG}@rxJjX8>ZV$5Tew=?0}mM{;dzQ1h*wN2W3w&CDe+!g0^v?=7>b}a=2Nd7+-*a7|^Ab)GIGsP}?*cWBt$$Jm{l_KRN%DZ;GlM0+V4BZEk4B=!2*dqv$a{yju@_ab zc2qlH^)60~HrbHyGFD?tV65>q0wmecWdBLiW|eP7fBRqf*jxAgA7aI}`B2`Ay>`$T zrfF;7yHxVSNI$T;V2{f0_|Xm@DO0;RbXTU6VDXj4S6#>;kx=p|+o{Yl|N4|y{6cuF zGc;&L{!%t2eTf=})cPTr{Fka+BwDA%sWm5&Ku#%r_ z7uDyeF#g8CL+Jb?o#aEGjriz6m14qa_)fAR>D|30ZZyV(N1{c6g)0fWVX|J&g23a1 zu_42alrtB;y=$oCh7i3id~5TidxLku=Lju}=clkqV++sY66LIJiH;~7*=XHnQS6%| z0HrQD0`&$R0a~|?2uD8Qn{?B6M7-2$3_pgr3BjOW3@=_8zo9uam?I2WaBML-qBN z-LTD*M1jb!HEO7d#SAIFwS8-;!sW@tLvDPOk5)N?9HnCMKd@$CUC8q*+^k-!g)A8#=##N z<7oRZMl0+Qs?gk)*0j&Xl)^IT^D&={`UGK(riNANjkM{(-;jYCOj+8hC`xJU^0JM5 zl6B%YP?O?RT;AMFZKSWs!9lpq6-fy(UdQW&UP-+xlyTT*zD$)I0x-LM^4nS?wD1E;6C%YK zq^EPt9HN{k5x9*kTpVzUmfZmB;*pob@Q@BlJ5`r zw}|@m#T->^@f1NS$tN+|RU{M&Q-=tZhNf4&N4(PMzP9zH_PwZZW(GV1mEM|%u_|w= zJx(~l;Hxjjg((s5#p+;i%clum->?kM_>AW6G}AOZq`#TZvsCu1&H;;zq=TiClR(&A z>5sVmtz0IW^ZSYY_hj1%Pg`HEGX-P455}9Lw~z?6d=yTOz%{EqXI2%abjmW~2j9-Q zAU_j?Jc_Mi@8qafY^Rj4760ZJlZ4-`KNSG3V7ef%&bC&Z9r!9Bw%I*lO6hmU2ZWFy zWR`s~*apTjkwyO<7P>(B_Kjz3!x?<95349|B;Q7~NKrAL zIOwe&fcg~4YY7P((f-mbtrx~@Q=-Vk+Uir)y-HlCM#5~vW93*p>EVojlOubOGA$9g z?_XaJAlFmC8N}oeTx)w>9QH|-rb7b5)Ow4LLYv@sM?Af9=XqHh``?|@F^&tPZMAcn z`VwR<_BiTr9mg63#r9Blb;w=a-Tb{5m9Ma>I0-%$S+vF(=e=5@;5Jry>Wn8~s+hVw^6d#@XUZAVu&JRa z)4loHu_e?{0xROsFS0H8%sKr>Je+^QfmeG;o2~K~3&1AW`Dyr3onDN;T@uOjv_I3NCGCzI&GUJeg)Tz=_S~X7Nl^Y#c-lu@0~PFm zd{b;YPasjz>|@Deg9pgfH0_-LvS|2dgixCLR6S+hIcZC_$+;HlCTrE`t6?QH zJ*pxxBpSsr1(7JvlY^aBYf6bsfgxtFqDHcRbX9B}4qktn+AgLMf=ByhQ6lav4*%kE zlIbH^d?G z(Uyb3y@!}UP_kiQL(wwoh<25KN6IkV{pm^A?( zK3QtpG4j%vxVFU6yGU}DNYL&u2%rq;V`?8Fz}ijKbj5QUe_gpTt5dZfQ~~GA>|+-Jt>Q0 z1d8#Z)klQE-Jmg%dcIM?g#0mh zMWNeV{67HI6pTd_%Q{SNifXmN5{;Oms`JT1ph!_dLCme1^8uo<2SmYMPakSr-+}6{ zi%1Ghl^}5}VB--{4^uUyAs0t>Sv9}XJrQ)Vl)CN8q5Qob&3=efB2+C=he7g603&7< zo4occj@<67|GX+nqHk)-!Bncy^jxik1U$Pt)bY!%q@PrSe()1Q$W>K|$hU?9gQI8o z;}&7#sVSR|z@dVE_*jF(2dhF=nqyWYi&1uAg>%!9yT;&VDgkH*Rs9f% z+_T3de4%(QY$Qx$D9p`l3e;cf_-dQ#6W8@6MACo}u5w?z9^M z>B)x8#)m)8zx8U1>J}ZlpAj4V?lp#i{(XGBf(#ACvkse%YFhQ30`LN0hv=JWoSDXj zyDDXdqBc@RIp%S5gB1PJ_2a)3c)J<7zz_Xa{!M=NB?#X6If}l8uCQi0Je|#Bvew9> zF+@_BwpuWFHKI|rKQbh>hXj!KG3fL6ZC-ufcQx9U8dpqcwS#=m6~3W7!eU+9#*s7? zXe{049d2opxhPQd`!E_mi6fu|F|UaXvkX8=YFckayfdfEpo|;b3LaUZUr|u6mJh`m zn8kk#Pebs&s-jk3DH_y*8xSzXiSmD}r3M;of4z)TDTV0!C2O0ZU6wko*lM)+e!9Q~ zr-@2C=}Ft|u9@N#`Q!2Q6-0~M$=xI!6)`W2(44b*4de9>7Y>MBLW}i6DD8b9>ea)$Rqk6dvsLH^F5<;*SUQ^{V>RHTOUSS zVM{Ry{P-8kHlQV!nJk^{Gmd-?E+#l-{w~iTo;t}5Z(GTkq|W^)K|IcDzaoQC)K;%K z&Xl-Zm7DEL6oZFupF8|AoARWDHSvweOi|3sw?(j93ChxZctOZ0mDm6vs z3Jh(&1Rg}UrPaNA_8a=ZxRHl8rJ%I+<-I*?gMnP+vtUK=_0P*}^8|@0GZra4lLWiR z-NI$Gjmf#9QD1?X*_NcZc6+sMIL^Bsq~hvjdfE|!59L?&5u;l>f6KqvVR!K|xTS-# z(s%lvmp#N>{+t$0@Ld+5$Q=d0-%xkuM+IiF=*_`1(h&{`sy_At}bk}kWL5Z)8_ zok5ri^_-Yfz>Kx^oDA70RDbD*v3raS8m<0p8-UyyqM~@ep=TQLqw*KyDk#=<4Z$KQ zY^S|JIpDbYcf8#Ncgi8zYY6(?ZMpp(%i79`SK;XM@44aIRk zo-^kibX&E2cYk!}n?z<- ziR-tuc%*VQe7(!l=CxUsvT?P z3U9g&%qB|}l)-kd#@#g#XmoYh$22f}YvNMScORGus8&6~;KE24XXE4$vVtJDiB_gw zs!#rIb2aavrYIf^UViv>fs{h`*DV#g&R=LQGF9f)XGTNY=Lf&jQ=vS zJ{# zsR+>3vv73meL7>l1Wu=cqG>dgj?zN_8s!FLVtGl)^$FXl8UW|DuJJ~`xAVCKwXgs* z@a48J>Yk!6x-BpQ=6$cso)Y*9$A5rIWfk8fH_XNx`{)iz7Ls0rB#n^mwG-176ml~y z^Cb$1OZQNQRw$a|#W5_2!9=rM{n-Ib;>SeAgTE#dW1Ha4Yg}&96OEOD*M1F!)1o~A zHlcEpvc0bk2t2PsY0wVEV8Uk=Um3I#>`YwpT^uYHbraXakA0a9fX~Q9ZVnB9Ujl*%J zry?Hq%_i!ZA%woi$LRl*tO z-p-ZOyKR2g*EY6#c|)P+S*X_fE$10RihTuQ#A?&OYNx2ifb%Tab0eBfCUbF4f6oC1 zgmQzj`+0y$Qmd`L29c2-9)hf0THoejFQjE8yvGAr<{wV+Fc)jl>~G-t`^px!)I2^) zzfz(i^?jyQxkG@6-um)c0Xyp&wr`(oBPsp`r#Jc{r`ju2D54GsyiA)W$S9#4Q}j&* zybVbd|GQ0s;=u*hlbqMj{bL`?#T(Q3L&;y(4(&H+MOff;mi%MmmJhseI|QTkCnyN4 z!giVD&rA9#=@`f)h2*j>hEt+-Q1gX{G`gbFp})BkrTdsnNidyEaKRqctXRUU-Gel| zlP<5qsqdOn2>tuiGoD7oJWGH&ml}&-8|eIW9O{Hw^)xGM&@7~~dV^?7v(uD*KTJ=v z^DmA-Iz5WY86ZllVLPkDy6AM1!14N~!R33DCC@v3_5{5-8#q5o8B^_p9fV1l?=1qO z_JQK9xA58bwao{P-Sm)xjCHh{t)|vq$K9g+{chC zF=i7luKm2^K02C*hOkk0J8b9vF&281iMv6+EX-V~-Vdf!s|GGqdwyMajpT1c-!PUK zj9ye0Z0B~ijeh_%!1lYA2!$pl9`!+K8?oRdWq|Y)_d830b=>et=gv#NsVq;a5fiw9 zRr8jpRqSH^)55FL*8c!2a3$jk$$>qrLz^RU=ut(g|(fFG7%S>o^|Jx5A$fYPtd|x+wTr`2(Mkd8iYQ0wkR0xbb?pxw` z_3=MnIP1KA^E)%71ILr?s$qzc+E+owsf>Iytgz~s`ctP}t3e1tqFK(qvG({SoAE%sz|cM9`Z}((qX+Orl@F*U>z)F<08=j z#3yFNiJi#+*Wx}!TtmgO{Kfb}8PTSH-0j>YtG^u0epZ%`B)?|U4{rVskW!o~;Z>0F zc_}6=kXCNP>4Ty4-ID`)cudKDED#R(G752!_&9ZpZ7gXDp8@?W!$g^GGCzyioLu$G zB334==kiCxoHe;ZGTLnq=k^q>?*awQ2O=ivzvIWR644R&^_LO&dU6T8^@;Z6gf}?2 zkBbX_wyVIZ%|tM<*~0sG5SI%zzA+$@b;z$m$0NBFmV|FFQR@QIyn~GFg3J|2H<8%y z*D=U`joqU7N7kn+dWmPM2u`E?p~E((ns)=UYown!6q>$zTS^_Ca&F-}eeyu<{ zvx(YE%Uj!NM2W43L@-wo(3&MT^h-@S)NQR$EL#x`G1D2L^r1iX-0~TR_(!9OMOa@K zJa7PK@0oU$tUfh<3nY3hvFGsn`O*#RpVlZrWO503>}WX z1lVg>=VH#G{y5x}O#*kY96K08a}7#J=p*XWsNAYF7t!ENDi+{b@ZeF}1KIhK|C0lFCC2NaU`ypaTn6(P|0}$f)8gg3MwGWwG_HE`r$CwEZtT;0 zN`qBHrkjBarXQo-?$W7~bzh1AA1B_$X4=x1XRhL?Sk{z`C2hvp{uw5*LxU@J6gd>p zxPN}YMD?h)+orDhnjT#7rt9C41P{u~=8=JS&r~v1|H;%Tnz)mLOA>tD>f575Hd3uT zlwh0-evDQ8_Onlt*lw)&Hos;A2@pG~cL*QS1#*GeFLjc;$MlFvk}VY|DPbrc$d#zE zf7rV|!d}vHVGOkz-+n3c^-EC%jdQX0X9$u1{uv`_@X7q++pED#dI_C#v$|NKp7gWH z0=I#ArB8wyilU(4=2o2e_*B)=HAE{`6X|=xI|?>~5uwD(gOLx7Uw-VZyPTq=Y_a^) z&P(ztkCIGC9FD3jNwZoLbSQ>_`su#P+?ooGN!Jg zc3q1iuJG8pN;TrRvF~VTZ$6pL4y+;}#AruH)GscL2>YBvb@taa_W(j97sx3FS}=E0 zO!0dUZl#@(f}-yma*F=@DImM?G5v}l&LLSxWC`=Us1IFo9U_W~MMI1- z6GZ38<@P(Dr~$2^LYT^KUmK`XP!QXy!+|j%iU(pdK_fa4(YH8>d{G|IF&UW4I`7Ld zXEeE}(W9e!yAg7h;7W3MxoHJ*BltQeMIm9=jScBcxw?dhlhdi# zvzot_e@>}TAB0?Hs@Bsa(IP#$-hEO6$(0+dZzlLhDU2QSdYOKh1JthBwk zX7iaT!1v57q5b!z4xZAXLSS55j5WM16z0T=sB@F+ilsqk56AP zYS#jN{f`wB%)GLd)eswi3-E6K>Nl4#vRWxy<*hoQr|?xfP)HXz^~y`BRaGhubt}@L zhv}ct5&9pN%tk3Xj=wMdyfd_9b{i_Tz?zFc>^p0wDk(O1M@%0wP_YEX`eb`XPl z*9g2OHt8~csUj(XT%S>SBj z=l)y|1Rx*oOVw97C)XmK!Lw1w=1$g+aMu&T5mr;_pdV`~U)A6VFNm5I49*1cYlxaU zPC_QHA>=%EHDe_#4gG%{XSpc6B=sg~4%vUy6dt%D6+gT0nd_53l%*a~?)uj(UD&|= zd5qkjFJLsd=XBrJwc1!9DxJEmN-8J$Kg0*>kHxekQIFdG?Cna~MNC?C(TAuJ9K#(@o3`~`2 zWLS~qEHL<4h?hHg0!=*;@E}Ah+>(t|)+Mk_1zTvAFhrf^7`uu0OhLh}bldx3)D0l} zyeIWe$$MM#KR{3{8P5rg_&IxZnC#yEcdxs>)W)S}uTl;%7Jfkr`e2Czshs zu@X1I7l=o0;={I{!h48**n{{po}VWQyz_N<^?lFGYwlrlY}G$<{*GKHW=$=ylIz~M z408R%nf8D3b_uRT>>r zH#{%EH)n73v2gUzFX;Q<2`?ODhVef+RNoJ@j(5yO+?v`U^i{Lx z`wl0ap4Tv{C6x1cDpX^K9n^c@4CSn!cbO_=R*y*p44Usk1{umtM@mf`P9mnHQ{_BR&e6OHLbXtmg zgoxJ+3N^K*Gy4_2lWymNWgS^`OX_C1u*Bj_BN9PwvfS4Z=*o}y^?S>kk z$K>u%q1%pBw$h>o=~@V>lxn)4=Rwhrv0;1`-!wN~uC z>+iLHt=4Kdb(Y~h&IS0o(cDW|OC-_$O2HsHoPfR^aa?6uKZj(6{LHkuS+|k-Spz)ftL7 zuUr;|qjr8YiR4LYWYHlV%(@2&Th~0OERQriItI{H9Bajomh_2v1d$X}8cT;0e3^Ov z%l4rW9L0PC;M4s>$uO-5$XB{ePHHrXw{%s^a9`7yoGrqhM>pFH0Y_5;G|+M# zW+v_u&%Uu-VCE7r+>e$~#&YKkSO4qf(s-3+_UAhH<+jeL*7oui&6339ow*+gFh0~L zuC-q}ro^5}xFHsE`Iw|D-xzE)v<%T*?t20y@SKF~`QGydFp{_gVP}E%J)!>A;&DI4{ZY_$Vp&%c=S&Xs3jnrGGN`s%NA6 zh`EaOE^akTBZAZ>VU!1L{~d|Qp-^mBqg_qxeQ*t`uLg54$C^GKo7?Ny~7b=e-CIPWXHJD#z&qd*@b&+)DlY}B+j*r=Y=d70pmR3Y<(GzKUvM?Tr#$EUR3zMLrS z+MRIrbrik_pHH^>Wbohi8>J>fRSuK`PPs=}ay|%hP}qqBLP=TxcH6JWAdI-fAe#Pd zdH*@je$#<&pM1t}tOfH3%>h=Szw zqIw6kCzxnR`*aVX2_L|)E_x{O3wW4fx6B`%R+am4OfS~8zoULf$2p}*QoKv7Ni}!_ z5Yxa+OJpPaK!L-l2%Mm&9^6&=BNHuOqThxc74-L6NOSnN`ANj9KS(JsWzLF>T^~S* zqXy%P#%xLAJQqIMr=E9DvCxXwrxvU~0%E9Dri+@S$RQ4nW2XX(gZ-0 z-*ct3Y@fMVr06GESj|+GW%$NNW~W00M5?#v66cA+kn|OwNdIS|n}v(ka2v8{VQHW< zoBO6O1kmeV=caY`AAppD9`Wp3lqHGScsg9q*y=73^Awd0iZksEQL<~#@{A~OCXgEC zjq~zwPAZK))B7MoM#dNsWj`|1#gBN;dZ10jMEL=p%%2f5=ewRlpX2C9;P+Z~zDzfh zM)E%ZUd-zj2H)of0KO$hZq`Mh+(kV(#+X`*#)^qMS9`54~RSnsTtmR=8mepm>lGSV5t$En{%O*FeDC9UCsiA(qkCRKxIpN+0q_ye{+C6Th za?TnMRqKoNuWy46M@<7c%Tce+cMBf1-sV~R)^@!48dtSn@i5x$y{CvDxwcLFCRu~c zeWWSexo^d_I2v2|;7EoWC!>7cD59X4#>lqepT)amZtqWhQT9X^grLCD;C%QlQ_2x8 zFb&yKLdKHKGJ#okDnnaf6fq%LntsE${X&D`ZlFDE{TpFMCm~4Z0ay979aDTK6H<0l z2wEJAT>@)p$9+v}{)DaX7w+^y!NXQ5WD10=G-VefR*vHBKq#noO zwvY~uWw~t&Rp6wN=+cLk z)A}zfiK233|3Dg%q#FeLGdTF!XLidkhVCb)%Y&2}RqxU#cw$U%msT~cB6q>+F(55# z#VLX=nSVko6A4X$ zzE01X#G#osDsdqnK6SwYX8Ue|F{`IAAIBI^`Huu>eFkW`?nG*)$lQdyJyVPnnI z@HGo#yx zH^p!0o+n_cp^yhJ6FkWq{Hb;7f}}WUg|&uUqL0exV|cxqg7>*pxQEJSywtrm0mpQv zpT7`{VKD)K+Z5ndgUPxWpH-75w9kL87$ap}xQWmVN5jJg1r5QN)sk}VF;xE8iOEi~ z2{sZmvs6syG)3EYjo9ekSlD~2j;}tZkBp}()KrfxKWh1hqyQ5){ALS|`7)J9l-5~|gCPCO0JDYb}_pA@5FZ9|d7w=vaMbbL#4W>gxIk6cTrkK9$g678s*dkj|#J(G&;+>{5k2!ocw1cl2@%Mqg1j>MJOp; zEaIK-xi(NLdAMZ)PygOelQeY7(YDp^3TzLk;@2vkP-!dT0StG0QmL)@yO{uiQ z)$nfPZ_Dp0G_B37bOw)j;@p9ZDy1XwabF;i<{)q6!)!-bcVApE64)im)CTH&76W3< zs$(h0lYj$^d^Dh%F1?+dJ2i{2NKcJqNDSUfv}knrF|H2|`0!vnw#swQ8Orejo(#T( zYCdrt_86_;J@}Jqt}28SH%h*jY~?VIRT3i4&;q@fB%4;TYMRyC=bS-DPrGWn*gW0y zf`GISVuks}Jlhp?fRakLl>*>O*+9@?1H=b6y{Ypde$jsMev`)5+MR`;ID*?r4#K48 zLrxpK18QE#By&O|A)#@0iB_!~H@O*}x9yNe2-;>#b2zDJlez%Im0H?|1o>zF?9wd}OW^xq>fN9GXzoh5r_7@l;Ru1H3H=Y&L5-h%A<~2jJic*afF)`}Z_9r; zIXJn<5|7{WhQP%~v&Kk-f+9I=fG0?=hZ&1NH;T|uvF`Q!<(w@RSc;C*eZ7O0kLM8$ z@HmfIG=ZB<0%HZwCnhfxIo>29iYTL{lkd(7U=@-eeV?pydaTMd6@&o*MHRSf2hb3R zfRzBkDtnkvO06n{5*;fGe%e+Kb>%58pd1pvyKUupAxB!G3_W8nPP)(g;Y}iYX@&3#hITvZJll|q|kVB;qs8I$*920~JQ9;w(bo^pi zDauo{_I70G9vgtrS5)frm!u;HOSk8DCzKF772dqT!qTtAMMLi>`M?+j6*pHNluDPg zd9{HzElMJcaHF_>@Ln>l%XX)o?|3K*4&d{>O@98cl%xetE`+t$-VIm{q9e%}^!)kC zhS9p)?AG=LzIB5}bBZkr0znE@#ktm=P(=x8XP1eM#x~$DGj)9!MId$uD&0T}6xI`1AUwxft-o5l;j}Jl4KJ1v=US7F~lpcF$SxgjFPH@sj$plf{yyf57@}o~@e^^h* zI5h^H8KoM$VLjC<`t8Qo2wn37e{(8T6HnIh0?p?Dr}>4I%`ju`R)?~3mtl`ldCLUN)7;<8LBRIvCL!9NBQ zt+H%KPce<|9&vU_(5e9|fAOZ`i3W4U63Y|Ct(igg-uTU`8YzLyOK4xE_aDqF0sA0K=k0t&80C>WyWsAO4V==51f^ygJy?Eec(R|AS-0} zfcn5Ovv5d!03W<}Gq!;&);$S(iR3YZfy#vWxVr^30m@-4XzT7qsW|b z#sC;KsyrK%^VTgXWOM^fDc-ViLINQq@gKii^Nb|~bTQ7aY~1fU9;|mH2vG)wMRJfy z1c=({^|OWJDX60;L4JWM&b@Pwbp{1gt!th+4~!y_A}uxAHLo*XamlbCMOR1N@i8hq z)`2T6j==5XpNgodKvKHrM~OFf^@Zyr)Kff#j>yj#nb;GukrQB^NqCsDkwR2bdR~8= zX-$jninPNag$Uc5@sA?H=TL}K} zow`Z&j^VV2BBEc1CChDPFOO|~+$WnVvy)G_$0uNxCo^;I;us69?GN)I#K`#^nRSz5 zZn(a^{bz-_w>ijIdBs&2GtX`hWTSNUbfeZ#rGgPaLseK9s{T@rfuwDV+%CrQk0l)_e3pyv9W|D+XWY^~8nhnt;3G800b3uji zMMucf>m5-$;fu;`NL?1X9GhtbQYmQ;)+wR@V}QsMs8O^g*3j4?o$3V+my!h!h3^Kb z1xpa>leZ1w5H8g}`;JF)oVO3WvR6RV1lM|9Oq7<16L?W}C!R7@P#QsWlob46Egcw~ zL*n)L!^uLH$RK!CTAn5ulqUx%UHl(;J_p*OtmEq@7%Fy&zR)M5CK3ok^0@RT$kF9- zi%D40_P)Qv8|RUVDsI<}`@^VGu&{F1k679*BLi)NkL`lk#Z@K&;W$UxjwZ;CVN#k& zP}r0cLAv#O2vXHyxkW^duoMn*1F7*5UNx+bG(u>wA3?p>7%W{wqKJrw_u~jPR>Flx z!`Fny7$7eMCFkbhuzhHY?8!7bCYh5tU;tmA8K{FiAnbi5GC@hMc$GMg37{$mZcTvvKXRYzpD-Z7B9Ou>{{ zq9 zO~L}JRb)6f=PVIXfC)-~9!jAx$}I39Br367>;OHyMh2Q6&jZBVom`w{a5-loWbrXw zAwr8gnHxqkSp`}VI!76U%za@urrXvWLpguUCv^p0d>?qi>j>jUYQ2Uc4d`aQv0w8q zocc$b`5bE?inmBScyK7EWnm>4DS+Nlxk>)gBT?GgU7L`YpgKwM$&;ckNRq_~$64T!n zL*>V)YqIKgoh&DZC0fNG`Z@pr=*38ZQ{mn{#Kj^gPC8_Maj$ANinD;gZBPYrUD!JY zgmT$Vo#bf~QD61(jF_M}ZE59QzCF2je?=n2UG!iDnM=F8HpyN<#{ow`JUYsRsqT*4 zet7qs=s;B45B1I7gaPHPXVk)2fwYFin>R9$h5{%u)sVQLVV0k$c7!grGnLY;0(t?>~py8qgtpKq~Q?oei1QL=f z*r1{&7Ym3K0;Et#>C#-Wj0HzQ9fEbMg~=rwUc^rh4bTKCBbW}Ghq3JL%)Tc;l4Udo`A7hpipSmO`I z1!|*05D`tV?IdbCN(g8G2>^IR1Ym;HAVf9^vLFMrF|i^ndW8TtWmH#XnD*gB01F{5 zo71}M5>N&}+*Cky?)QaSQXMY`m%`7CR3stGT1OD@)x)jq`8mUh-R}uRf_HkvC7{|I zG1flHs0Viv5Pipc4gB&LRn6tYlB$@_QBDv#BzwXn5dq>q`>F0dX3#G9uF-b~R^M#s_TG=6X^^|#T6%-*nj5a9DE z!=kkkElSiT)s<{G4|T?Zj)JLE;5%@D&{JnT?LvJR*GATC(h2KWV31PyulQo1LR$3`GRd5cLZEWvVb#$cp{<;|ZxO!$2%QL6;-}S6gRatk59Q0C%}L(asxCT%*x- z*FRWXl-r9cp58N4PY8k?uaN8B@-f3}A8Cx)z9^c4odjcgNRfG-c15{z%rPOfsiaaAj-qAEq^m&@d_jyZ3OL39 zY3-qT2oCc2B(bF|0j)0lM9FX#j@xmZA<^-BafL`#w0uwR0APcJ4HI6@a5BWy3Amh( zA2VEIIw@L{L;-K!_l;1T3aARC=4z975uT`)RpFtYR*-SRA_ZfST(m=-^kQITVA>dn zjo9|mlLCsMpn}zLBN<7B_VxuvqNad4x1$dA^V60j5 zh+q&WQmb~=6HTWG;}panh^fPOba0c#7YU;!kW-}7DZX$}BLlS>v36Zhw|60Is6lK_ zRB*f*xG~a5*M9KdC_yY_{o_UegnHj6tY}pilf7aDCWnsj*ifa${L=-|AM+#eGWjgX zgftkD6qw05H06{WLUM@1@q&886-1B-93>%a^b)8!U;i6er*F znsASf@yfz*-C&_3O`dV9A>Ddv{gVd}q7X=@RAQT&Cfq84(#2h`DXDaD1yxF24u~C3 z#v0eO3edd>CbzuWLJAEG2M|Y%;=M_scGX=R75!ld=p4yhbOG)TC}E*N4qXG4{8bDP zpwd8EQPFH32yI+}i3NZN*gE7N`r#HRpefh!f@h`O1F~oXe>vmzvwPNCxESC2S!9nU zy2BnvtLjs4Ni~o_|7u`uc2Si?lv;7ZkikI1_auJ&sjTr;%UG}#TPwnLq(R+2*m5I{{23t}c9A!)FP z%C!TnKn5z{bjZ{ium~kmi!SwriZO+Xl-iK(y5qb7umu{AQ1HKH$2Kq#WxJ4CuN&_T zm>L8Ob!01h#KY{vTjBhZH9%N5urSmU3Cj)rW{#M9VKu0%(>!LR5jfKC0954OQBEuz z3Q2~xUf($Qb}iuxU%|(@<0J4T5ks`{^5d1)uTMAYSpg9Zoe4qpQ|l(FTSJ}q@sS8AD^B`fuJAs2Y*c!bk`>LpsK4Gl?)()+(wfnrMpJTxz;#1u0WosRL>^Nw0#y zK|z4cH>@(Rp=lJ|5eAl$>~!K6R$l<=5vc)Tdz-@R3Q7PF2q1(QgKIJB_zi6k0@Jt` z;_o+J(G(ZExR=SSEP_Zcj+~tub6FQBhSHBtH999A@QKwbc5MCS6(XmGf94M>b!}0< z9Az-ddaeF2O)wNTsgHn&zc*J5mz0J5*0B0y+vCk8v0b-4WZ)oFHm~=O1`}h+LHfbw*aMK@^UgHA z44^kFLa!Ugp<1f15&Z|=9DoiW2Cf5gbJiZm13haTZnu|z81@DiSV?5GQvxJqSL1k5 zfDY_q5Z33;I!I3W9AH+dJY)qo_;~c;aB!>;$tvORY(J0I6k|y?;n^Xb(g1!R z-didU7fslHM+KlD-6PNQk^l-Dvd#UUj1%w?%I|-?F4P9JrYGQVxQ2zOb}JUl;Mbx$ z8)QoG{I#E(gy_?o6fFKfSOz1tdwBc85f~PA^56u}TJTR88BAeFRR>-<^NvU?%7IvF zLcMX7;97YKenq~621#H%ZxiJ}qMMVw7>Qx+HVF|JM(Os_hA@k(0D1)HndV@>x+ow4 z-UQKLRmg{14A312Q8pBI5$s6llN8b{wG#-e~iIo7*K!(AnMXo=O5G@@^_$E9A zaDlD|V1v=}2hd7jUPI3G1mgrd;u5&8Z_9^EVr}Phqw%b2N>D!9FZ{U`8yG~_3-7FP zXweGt=r-5i>lRQTK?7bxbz#KZml2n$VL5{KP3=0vJlJjW?Wnnr*UvyWJIqjJF~I|vZke>VyUh_4fVgnmiuE%uN+`YZL9yTUI%KJog7 z3*Q6z#ZV#1+3Ofsb-r*F5r*%R6~GLMtz2Qk9S$`A0JuX4QZ-h7IK%*r-9zY|V;cqp zJok)VwTKWw<#4;T0QZBOk_AzAgfwXH3?_wD?x*vQ8YoAE-G6%TMk(8(V2_1(>jhEI zQg_Sa7(f(3AL3%7!$>mt+rOMjYB;%ST4@d84&g5(8t2iPcN~VQ1wHM-?C1=YKm}EL z*ElsqsME5G?6170H-E+|PN*L|3{?6xedxvINWUV>n(%+a9$8g1Yfd&u1V)Z4Tz6zZ zu85YeS5VuG=_h4Tk~f!Fx&(Bt5h}nGtLVo#u0uc(djRtrtCmnYs3q;?+nN_=D)o_a zZ%A%<{bE7_LaSV1o%uLSEvXVNjRXDS7CaR@U2?xzENcLW_(w>&X3abVy@57ITI&IW z@m)?7JcKBymLTJ4g*h1#YW6xkmSjz`BnBji!B(t_AmZ&@Wyqo25v3g#xZAi?1yqf; zpMKnRNv0K82ZN3dJ1{TFA3^fjjf~$zgzWLMLzjU|f=v8(w(j#y}{+0WgFW zwP}{qsm9vZJx+DotOAis%`Wvycg_^G#;OcQeFyW9qNLJ_d~-E0Bgh3|O$pZDj3%X4 zY)uQah&?*%4@Qrwsby-r+iY!^hw2C@K)jUbPB_*!?K}ZJH8no>hQ3yv2Waw5>S6ce zNJWG<<8Hj*>%;1P@qi9dwvVio8jsglCIa5NLB^v{m;U&`U>*1?+w*YtnM{E9%lB}t zjN(AZ4SZrnKx*RT$U#OB?GM;=;gKXNAe7-lb@z%um4*`9y%^4^18{EDzBh(iE}6IO z+m=x0O5#+!@8br7kI>}}A(yZFSelmLv?mTCq6*i_c%%BsDxsL1ww_eD@yO@Y3&WuG zGgh#c=m0-U_letZH8I<%x_=mv@X~r2#ZH`64m%@6FgfRrZz16F z_i~z+8dsM#=qD&fZ_ncu%Nj#E;}{Vj)pnjf_llEpE!|f}3;^(k8x^_dy8i%NZk`t| zi0b;dXaQCRh1;*rIB2jPL=0ZI5!6dw=)2&nUm*HxwuGi|NivNPvT+ zK7oGBC(RIfhb~D)OkP}pc>`E{Q1E2Av9T2q;RY9A9&5tU^DEK{o0_lljKwHkxc)K$(pR0x@xA=yvqcHFT;Fr@d&`0@9UlrkYm z>x_{l4OUam_xO0$B`q5ZDBU&3%e*v@9U9qtH@#YSCL@}pZk5om={V~3#twjR3Zexa zK^gbq##kt!5xj2jb42+uzb9z#sHiB6(piZ>1ld5;g2CGBYrLmO4-WV=Uk4A3*RR{IYEHTf;v2sIC6+W z_XTg-pMP0ZK!ALo?g8hlEXIR>tZ7Up^?7hz5QtIkzPF1>Y!DUFp{<}~ct~tUKG;MZc&7y8SVQg(sHTL&}EtvP?93!X)oOO${czi_y9F*4e z;|-jRJxt-}iixk&toXeV3(BLi>&G}v;xDctP1p&@ZO&?ZJY_%+r}L7@VYdnGw}(r|boqRyL0Lvc8{$f{^i4gs85z0-*?3Lxn~ZKPL?^0QCQ8iIgGLu#Q3 z(C>S+)*%2jNC+l;;KY}~>Emn&^P zaUzA)x1D2!Rsqf4C}VH5bQ!+oB6$w5aZxlPotQ!r+K4&{wSD0r>CjGb%!I43Ct=&; ztSY12)H*Mhm**G~&BnvG;Qp`xq#AFc%k^KpqzzO&ZO6RSn7kj}K>eRsic%)T-_9^Q zS$!CZU0r+!`sXP$4+!^#p)opXC*?4H(m^7v;J<4GKsQf9VlfZ{WJJEIxP#`O6zKjBtZEg!9T`xKYvTzu z)?SogEeLq5_1hw>v3vd?{bDpZF*pSP0?NNQBB2n`@IB#%P|!aKdics%jjlE0E!;{P zCOWzcRGrM8ASm*bbbF_oaW&;SqD51EY(!hx!lj~Q_>Rj_9tfBAx_rL>-Ql-R4==f)MGT`EFyqc1$0 z>BUB?V5zgVamP7OYY2jN&9cZvG`hF|AdmrD!N7ELHQM8{gQApy6_T6t&loaD97PbZ zSCmdPBk_e&0=A{16M_&D<9{!vkOUI4o$M8GQIn!|?}erJOMok=1L z?tJ4lMdi={1UspZlU18WD0f>Qlg3DjtblcbMh3|^_Wp9ng$*7rHS)b>v_qwO{{Z(8 z3RtfO5{8X?z-$9UfrMev&alT}z1R|O5vZ%!D_^3%QhCU#(AuC=;|`vsAn&6cK0Zgr zN(d$c`8_!b#7d>y*L5r73U#$!L6-P8f*Bf~LF4ZX;>1bzJNYnl@#UgmAp?{b7sghU zXd`~!Z1vK-%99V49J0vG;k?VT*h*88U^6l75O&k6)6ah%H)BXkd!Bp!Ys>hJh zAQ3!wF`WTyQB!t17W2aMj-Xi8v0&GpI;Og@(kcv~0j&&Pj`geS8iY4$c)K4_*?H>> z7!?lG>gw#P^)4UFY3dfmH}knQi}FcM+XOan@>Q*Hh#C_^tJoI z$5j#iGdaYUt3Ql$YVbQUL?Mt-01wXayDkSv^mgQoBnZQ@7~grdjmfY8PNg@)k~dhz z{&27@QJtN>vD=7CN9H~ zuZ#P^OF$>8m{>^lq`GHJo5l$wG1)YU=XWDfWoGikK-7^C75FubSioS5XJRKE;>j$u z5&^BM>mZGtq92}D=MGazx0B8I|0$j)|saYaI%B z!md;hQD2|dHz=KMq0r>^KO&fg!hCjsFTwoGvK+UR1W&{J#-b=jk=_pnNCjaBy#c{? zbQGP8a=FA6pag#7fr;fqq3QkQ$OhkM`gUgs!W=X`{Na!Qj8>+^-N~dI3axeeMc?oRpF$2cm06+6}&Vy>%a#uAV%VwULm!~>nkR+sZ!en3)Ho1e}Jg8>ndH_u;q zvWPi|{{TSf?>IIfobl%p4JjgU9bem&;jlo&s?lmLxWFobp?Bf@{;|WR%J&C2q?fk32ZWQC8@JEB0d`z*OSyZ{@jaPz4J{ zA0qz%*Dn;PP1{u#uG^3~h_mtw2OU@dQ ztx5XHRMl?H84x0#IJj*Jysl`SlzrS1nuxFQjshA_?*T1%I^*|{5C)Lq;K;W`4zaBO z?WO^Mij{Y*c3w;&YAA`fDfCc2Fa?T2g|MUSkI0x%K~Xem+2CNM~#ie`Dk~W&*L@INDMjL^IUY` zI73b)Qdt49IQzm9@-N0TvA{2Q==3zW(3xQJ;-G;6eUne#LXcYR9}7rFa+tlP2&5t7 znSY-dBPeO=EFV!adIVwK_FNjcqB>R=;u$O?Dm0>FJzBu<+IhY`Wz?ur?j%R{e0*Uw zN(5JKea`&ncR*8A@gEN+5n!ig@qTjC{KJ6Dg>?Mum)@K@njtoiDl_S`yon@Rvo_%s z^}TxU80p*!J@0g?#h*LJm=4^I;ymyx+n3EIx@nZ##_n7s=qy$QM(=Cac=Mt#eSq<~ zhcbjfFPj!um|n5Ldm=}{wVs@D71(wc-WpUpOV+-yO9CkEj>@1OToP6)1(F~)#~02s z@|&Cu{=#CM`{puVel{&TWh)sBQFTB7gw9obS&( z=Hcwa(9x~;nvr#fOxuJYZf_e-sF-A^E8hFb>pU<<7g%n>ZmaxZ0(BvT`xjcspb!;Z zhrkv3#~Tq#5Z~`FfRxmV2))Jm;`q9NWFSHSa(g`E#$-|nr}+$ST7{%u-xC9xst=Ms ztd0OgkT`@$##)t*cEB z*@VcXLsNbAjYv%rsD*FeSZY;9?p1mGOmK+w1=w`B4vE@2?Y@-PquS*0(q1RQ(UE+n zu@&aJf4rH-iPCt+X-JwjgU=i?|(OY1QAx zv4XrGycty`f$tn6tFMgSD!azBU0o?v_#tzB4OP=Nm!~xlpiw{(AG{)AtE03O@|Yxt znYQOzsQ?^3V-}EkR`7e{k2p$@8Z?FyfIJ-@NBY8O zqoRDx4ZN&|FkX&LwY<>LmIlJa^to5eZU6YR?s zL2NOymrn$ADfya&F*s2UA4|C2;BE>Mb;tct~HWfwIzJJUu+c&Kb-#Fqe;XvnamBy1H1tm^H z%e*~+5k0)P>w1C<4Qm2IOgaTNUi8d>kO3fF9sS|e73yd_88$WMUb2$NIKr__d|*xt zDT5mI?-zX95<+u^0J|-_e(}iDd?T^IfGLggVDB*pi+jKI%hB=y8_@HFEb3MluyWvm z*g^U@!hGoyV9bSM0o^{WRKC{U=!zCzy(-ix|s5IzJ z%fEPS0yj^9{1wI}4J*dn7D6{0xz3^4)&(dVWdX}O*8Z`T)CwpL3h(ph48cWIO$%TKs> zj9s&h2k`6ngHVc~q#5DE#M1Ii({y$_#R8LBImUpX>67>?j^n>EU(2@-D z1%88^Tsjms4DIip3^A(eK=?30li|)VI;X??-f7quuv>+>SBHR;_PKbt4Y=Do4ln}) z(6#}a19gC=DINoIIm!b*65ny+qeCi32cheja?Qv+0C5W>ATb1v@!xV3q_PyOu61Og*R%wId!AxLNt z4MjgZVFE)9rFoqhbVU%n`267q4$vq!pPY2rHk%i`vecR`BDA-dzD(hB8p8EFR)_zpOw#hLb~rC=}uB#zO%V2^YMF4EA5amY-Vwuu~wK z*e(Jt9g>Hk#uN#rX~!YMcwz?*QD2Aa2y?Zr7!HqD4K(W;grJi88U&p#Q3{yJmD+?kxibklV=kzLGKNZon;HF)We5H zu=X5k`Nb50pmskw-$-Du(X%x;@LKjfKh7Xjxe9!lBwK@&JUV_b*{k8kX(<)i@t332 zjs4=O9}{R}6`C7+#0smbTsD(o$7~C^WW)$lba^vK^oacBP`Wt74;%R~h@JJ7O6Lq- z12-C8PdU$rhc^K(t}sXdaeyoUpE)w4VO#+Mv=?f=F(RUd%HDY3>o$;qwtpCI1ZRwk zgvou!tN^hP8kK$Yh8(lvTuT z4)DE!#>_+kIWUwWc+1caiGcwTq8FKpXhx_j@q@1=nyw65DZ4eC$xbadiW`-V9kTaK zay30T<=;06aOp$QhlGEeE4>d+6M+2Wei7U2FOWB2bBAbIfu@1Wss<>IGa6`d;30Wa zj3HJY4)Rb6X`N-A^>M|*`O5>zFf%(l%49PfuA>Y4!bp#m59!D3+1vCwak#0lrTaC3 zWxEjjnH6Z7-Q`o9zBFiChG0X(glrsV3i`&|V8n1Ez#hKw+C+jmKtpYKI>QAJ+{H`2 zyx|deE57lz+L*vzu?Tw2X5#9;i%o=u>Bn-s@t|=AcHaExhi9)9Gjkj(GCh$NF_QEx=Tk(QG zjl>js#`$qut}<=QG@HUbu`sc4+Ab~%OeBkdcTM8#oJd?O7Z}A{{ti8!vSCtUdt<$_ z1vAD3ujq03%Aurl( - [ - 'path' => '/default-image.jpg', - - // It means first resize the image to 400x300 and then rotate 90 degrees - 'transformation' => [ - [ - 'width' => '400', - 'height' => '300', - ], - [ - 'rotation' => '90' - ] - ], - ] -); - -echo "\n\n"; -echo "1. Resized then rotated Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Rotate then Resize - -$imageURL = $imageKit->url( - [ - 'path' => '/default-image.jpg', - - // It means first rotate the image to 90 degress and then resize it to 400x300 - 'transformation' => [ - [ - 'rotation' => '90' - ], - [ - 'width' => '400', - 'height' => '300', - ], - ], - ] -); - -echo "\n\n"; -echo "2. Retotated then resized Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - diff --git a/sample/url_generation/image_enhancement_and_color_manipulation.php b/sample/url_generation/image_enhancement_and_color_manipulation.php deleted file mode 100644 index dc83b116..00000000 --- a/sample/url_generation/image_enhancement_and_color_manipulation.php +++ /dev/null @@ -1,105 +0,0 @@ -url( - [ - 'src' => 'https://ik.imagekit.io/demo/sample_image.jpg', - 'transformation' => [ - [ - 'height' => '300', - 'effectContrast' => '', - ] - ], - ] -); - -echo "\n\n"; -echo "1. Contrast stretch Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Sharpen (e-sharpen) -// https://docs.imagekit.io/features/image-transformations/image-enhancement-and-color-manipulation#sharpen-e-sharpen - -$imageURL = $imageKit->url( - [ - 'src' => 'https://ik.imagekit.io/demo/sample_image.jpg', - 'transformation' => [ - [ - 'height' => '300', - 'effectSharpen' => '10', - ] - ], - ] -); - -echo "\n\n"; -echo "2. Sharpen Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Unsharp mask (e-usm) -// https://docs.imagekit.io/features/image-transformations/image-enhancement-and-color-manipulation#unsharp-mask-e-usm - -$imageURL = $imageKit->url( - [ - 'src' => 'https://ik.imagekit.io/demo/sample_image.jpg', - 'transformation' => [ - [ - 'height' => '300', - 'effectUSM' => '2-2-0.8-0.024', // radius=2, sigma=2, amount=0.8, threshold=0.024 - ] - ], - ] -); - -echo "\n\n"; -echo "3. Unsharp mask Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Shadow (e-shadow) -// https://docs.imagekit.io/features/image-transformations/image-enhancement-and-color-manipulation#shadow-e-shadow - -$imageURL = $imageKit->url( - [ - 'src' => 'https://ik.imagekit.io/demo/sample_image.jpg', - 'transformation' => [ - [ - 'height' => '300', - 'effectShadow' => 'bl-15_st-40_x-10_y-N5' - ] - ], - ] -); - -echo "\n\n"; -echo "4. Shadow image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Gradient (e-gradient) -// https://docs.imagekit.io/features/image-transformations/image-enhancement-and-color-manipulation#gradient-e-gradient - -$imageURL = $imageKit->url( - [ - 'src' => 'https://ik.imagekit.io/demo/sample_image.jpg', - 'transformation' => [ - [ - 'height' => '300', - 'effectGradient' => 'from-red_to-white', - ] - ], - ] -); - -echo "\n\n"; -echo "5. Gradient image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; \ No newline at end of file diff --git a/sample/url_generation/index.php b/sample/url_generation/index.php deleted file mode 100644 index bf586543..00000000 --- a/sample/url_generation/index.php +++ /dev/null @@ -1,11 +0,0 @@ -url( - [ - 'path' => '/default-image.jpg', - ] -); - -echo "\n\n"; -echo "1. URL for Image with relative path: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// URL for Image with relative path and custom URL Endpoint - -$imageURL = $imageKit->url( - [ - 'urlEndpoint' => $url_end_point . '/sample-folder', - 'path' => '/default-image.jpg', - ] -); - - -echo "\n\n"; -echo "2. URL for Image with relative path and Custom URL Endpoint: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// URL for Image with absolute url - -$imageURL = $imageKit->url( - [ - 'src' => 'https://ik.imagekit.io/test/default-image.jpg' - ] -); - -echo "\n\n"; -echo "3. URL for Image with Absolute URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Resizing Images - -$imageURL = $imageKit->url( - [ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'height' => '300', - 'width' => '400', - ], - ], - ] -); - -echo "\n\n"; -echo "4. Resized Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Pad resize crop strategy (cm-pad_resize) -// https://docs.imagekit.io/features/image-transformations/resize-crop-and-other-transformations#pad-resize-crop-strategy-cm-pad_resize - -$imageURL = $imageKit->url( - [ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'height' => '300', - 'width' => '400', - 'cropMode' => 'pad_resize', - 'background' => 'F3F3F3' - ], - ], - ] -); - -echo "\n\n"; -echo "5. Pad Resize Crop Strategy Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Pad resize crop strategy with Focus (fo) -// https://docs.imagekit.io/features/image-transformations/resize-crop-and-other-transformations#pad-resize-crop-strategy-cm-pad_resize -// More on 'fo' - https://docs.imagekit.io/features/image-transformations/resize-crop-and-other-transformations#focus-fo - -$imageURL = $imageKit->url( - [ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'height' => '300', - 'width' => '400', - 'cropMode' => 'pad_resize', - 'background' => 'D3D3D3', - 'focus' => 'left', - ], - ], - ] -); - -echo "\n\n"; -echo "6. Pad Resize Crop Strategy with Focus-Left Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Forced crop strategy (c-force) -// https://docs.imagekit.io/features/image-transformations/resize-crop-and-other-transformations#forced-crop-strategy-c-force - -$imageURL = $imageKit->url( - [ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'height' => '300', - 'width' => '400', - 'crop' => 'force', - 'background' => 'F3F3F3', - ], - ], - ] -); - -echo "\n\n"; -echo "7. Forced Crop Strategy Strategy Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Max-size cropping strategy (c-at_max) -// https://docs.imagekit.io/features/image-transformations/resize-crop-and-other-transformations#max-size-cropping-strategy-c-at_max - -$imageURL = $imageKit->url( - [ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'height' => '300', - 'width' => '400', - 'crop' => 'at_max', - ], - ], - ] -); - -echo "\n\n"; -echo "8. Max-size cropping strategy Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Min-size cropping strategy (c-at_least) -// https://docs.imagekit.io/features/image-transformations/resize-crop-and-other-transformations#min-size-cropping-strategy-c-at_least - -$imageURL = $imageKit->url( - [ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'height' => '300', - 'width' => '400', - 'crop' => 'at_least', - ], - ], - ] -); - -echo "\n\n"; -echo "9. Min-size cropping strategy Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Maintain ratio crop strategy c-maintain_ratio (center-top) -// https://docs.imagekit.io/features/image-transformations/resize-crop-and-other-transformations#maintain-ratio-crop-strategy-c-maintain_ratio - -$imageURL = $imageKit->url( - [ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'height' => '300', - 'width' => '400', - 'crop' => 'maintain_ratio', - ], - ], - ] -); - -echo "\n\n"; -echo "10. Maintain ratio cropping strategy (center-top) Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Maintain ratio crop strategy with fo-custom -// https://docs.imagekit.io/features/image-transformations/resize-crop-and-other-transformations#maintain-ratio-crop-strategy-c-maintain_ratio - -$imageURL = $imageKit->url( - [ - 'src' => 'https://ik.imagekit.io/demo/img/bike-image.jpeg', - 'transformation' => [ - [ - 'height' => '300', - 'width' => '400', - 'focus' => 'custom', - ], - ], - ] -); - -echo "\n\n"; -echo "11. Maintain ratio cropping strategy with fo-custom Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Extract crop strategy cm-extract (default center extract) -// https://docs.imagekit.io/features/image-transformations/resize-crop-and-other-transformations#extract-crop-strategy-cm-extract - -$imageURL = $imageKit->url( - [ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'width' => '200', - 'height' => '200', - 'cropMode' => 'extract', - ], - ], - ] -); - -echo "\n\n"; -echo "12. Extract crop strategy (default center extract) Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Extract crop strategy cm-extract (relative focus) -// https://docs.imagekit.io/features/image-transformations/resize-crop-and-other-transformations#extract-crop-strategy-cm-extract - -$imageURL = $imageKit->url( - [ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'width' => '200', - 'height' => '200', - 'cropMode' => 'extract', - 'focus' => 'bottom_right', - ], - ], - ] -); - -echo "\n\n"; -echo "13. Extract crop strategy (relative focus) Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Extract crop strategy cm-extract (focus with x,y coordinates) -// https://docs.imagekit.io/features/image-transformations/resize-crop-and-other-transformations#examples-focus-using-cropped-image-coordinates - -$imageURL = $imageKit->url( - [ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'width' => '200', - 'height' => '200', - 'cropMode' => 'extract', - 'x' => '100', - 'y' => '300', - ], - ], - ] -); - -echo "\n\n"; -echo "14. Extract crop strategy (Focus with X,Y Coordinates) Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Extract crop strategy cm-extract (focus using xc,yc center coordinates) -// https://docs.imagekit.io/features/image-transformations/resize-crop-and-other-transformations#examples-focus-using-cropped-image-coordinates - -$imageURL = $imageKit->url( - [ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'width' => '200', - 'height' => '200', - 'cropMode' => 'extract', - 'xc' => '100', - 'yc' => '300', - ], - ], - ] -); - -echo "\n\n"; -echo "15. Extract crop strategy (Focus using center Coordinates XC, YC) Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Extract crop strategy cm-extract (focus with custom coordinates) -// https://docs.imagekit.io/features/image-transformations/resize-crop-and-other-transformations#example-focus-using-custom-coordinates - -$imageURL = $imageKit->url( - [ - 'src' => 'https://ik.imagekit.io/demo/img/bike-image.jpeg', - 'transformation' => [ - [ - 'width' => '200', - 'height' => '200', - 'cropMode' => 'extract', - 'focus' => 'custom' - ], - ], - ] -); - -echo "\n\n"; -echo "16. Extract crop strategy (Focus using custom coordinates) Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Pad extract crop strategy (cm-pad_extract) -// https://docs.imagekit.io/features/image-transformations/resize-crop-and-other-transformations#pad-extract-crop-strategy-cm-pad_extract - -$imageURL = $imageKit->url( - [ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'width' => '200', - 'height' => '200', - 'cropMode' => 'pad_extract', - 'background' => 'F3F3F3', - ], - ], - ] -); - -echo "\n\n"; -echo "17. Pad extract crop strategy Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Quality manipulation - -$imageURL = $imageKit->url( - [ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'quality' => '40', - ], - ], - ] -); - -echo "\n\n"; -echo "18. Quality Manipulated Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Blur Image - -$imageURL = $imageKit->url( - [ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'blur' => '40', // 1-100 - ], - ], - ] -); - -echo "\n\n"; -echo "19. Blur Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Grayscale Image (e-grayscale) - -$imageURL = $imageKit->url( - [ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'effectGray' => '', - ], - ], - ] -); - -echo "\n\n"; -echo "20. Grayscale Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Trim edges - -$imageURL = $imageKit->url( - [ - 'src' => 'https://ik.imagekit.io/demo/img/trim_example_BkgQVu7oX.png', - 'transformation' => [ - [ - 'trim' => 'true', // true|Number - ], - ], - ] -); - -echo "\n\n"; -echo "21. Trim edges Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - - -// Bordered Image -// https://docs.imagekit.io/features/image-transformations/resize-crop-and-other-transformations#border-b - -$imageURL = $imageKit->url( - [ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'border' => '10_FF0000', // width_hexcolor - ], - ], - ] -); - -echo "\n\n"; -echo "22. Bordered Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Rotate Image - -$imageURL = $imageKit->url( - [ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'rotate' => '180', // degrees - ], - ], - ] -); - -echo "\n\n"; -echo "23. Rotated Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Radius - -$imageURL = $imageKit->url( - [ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - // 'radius' => '100', - 'radius' => 'max', - ], - ], - ] -); - -echo "\n\n"; -echo "24. Radius Applied Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Background color - -$imageURL = $imageKit->url( - [ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'width' => '1200', - 'height' => '1200', - 'cropMode' => 'pad_extract', - 'background' => '272B38', - ], - ], - ] -); - -echo "\n\n"; -echo "25. Background color Applied Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; - -// Download Image - -$imageURL = $imageKit->url( - [ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'width' => '1200', - 'height' => '1200', - 'cropMode' => 'pad_extract', - 'background' => '272B38', - ], - ], - 'queryParameters' => [ - 'ik-attachment' => 'true' - ] - ] -); - -echo "\n\n"; -echo "26. Download Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; diff --git a/sample/url_generation/signed_url.php b/sample/url_generation/signed_url.php deleted file mode 100644 index 896ebf45..00000000 --- a/sample/url_generation/signed_url.php +++ /dev/null @@ -1,27 +0,0 @@ -url([ - "path" => "/default-image.jpg", - "queryParameters" => - [ - "v" => "123" - ], - "transformation" => [ - [ - "height" => "300", - "width" => "400" - ] - ], - "signed" => true, - "expireSeconds" => 300, // 300 seconds -]); - -echo "\n\n"; -echo "Singed Image URL: \n"; -echo "\033[01;32m$imageURL\033[0m"; -echo "\n"; diff --git a/sample/utility/index.php b/sample/utility/index.php deleted file mode 100644 index bbd8cea6..00000000 --- a/sample/utility/index.php +++ /dev/null @@ -1,26 +0,0 @@ -getAuthenticationParameters($token = "", $expire = 0); - -echo "\n\n"; -echo "1. Authentication parameter generation: \n"; -echo "\033[01;32m".print_r($authenticationParameters,true)."\033[0m"; -echo "\n"; - -// Distance calculation between two pHash values -$firstHash='f06830ca9f1e3e90'; -$secondHash='f06830ca9f1e3e90'; -$pHashDistance = $imageKit->pHashDistance($firstHash ,$secondHash); - -echo "\n\n"; -echo "2. Distance calculation between two pHash values: \n"; -echo "\033[01;32m".print_r($pHashDistance,true)."\033[0m"; -echo "\n"; - diff --git a/scripts/bootstrap b/scripts/bootstrap new file mode 100755 index 00000000..0010226e --- /dev/null +++ b/scripts/bootstrap @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e + +cd -- "$(dirname -- "$0")/.." + +echo "==> Running composer install" +exec -- composer install --no-interaction diff --git a/scripts/clean b/scripts/clean new file mode 100755 index 00000000..5d9a765b --- /dev/null +++ b/scripts/clean @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e + +cd -- "$(dirname -- "$0")/.." + +echo "==> Cleaning up..." +exec -- rm -fr -- ./vendor/ ./.php-cs-fixer.cache diff --git a/scripts/format b/scripts/format new file mode 100755 index 00000000..8e633516 --- /dev/null +++ b/scripts/format @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e + +cd -- "$(dirname -- "$0")/.." + +echo "==> Running php-cs-fixer" +exec -- ./vendor/bin/php-cs-fixer fix diff --git a/scripts/lint b/scripts/lint new file mode 100755 index 00000000..6d629c28 --- /dev/null +++ b/scripts/lint @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +set -e + +cd -- "$(dirname -- "$0")/.." + +echo "==> Running PHPStan" +exec -- ./vendor/bin/phpstan analyse --memory-limit=1G diff --git a/scripts/mock b/scripts/mock new file mode 100755 index 00000000..0b28f6ea --- /dev/null +++ b/scripts/mock @@ -0,0 +1,41 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +if [[ -n "$1" && "$1" != '--'* ]]; then + URL="$1" + shift +else + URL="$(grep 'openapi_spec_url' .stats.yml | cut -d' ' -f2)" +fi + +# Check if the URL is empty +if [ -z "$URL" ]; then + echo "Error: No OpenAPI spec path/url provided or found in .stats.yml" + exit 1 +fi + +echo "==> Starting mock server with URL ${URL}" + +# Run prism mock on the given spec +if [ "$1" == "--daemon" ]; then + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & + + # Wait for server to come online + echo -n "Waiting for server" + while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do + echo -n "." + sleep 0.1 + done + + if grep -q "✖ fatal" ".prism.log"; then + cat .prism.log + exit 1 + fi + + echo +else + npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" +fi diff --git a/scripts/test b/scripts/test new file mode 100755 index 00000000..a8dc7cd3 --- /dev/null +++ b/scripts/test @@ -0,0 +1,55 @@ +#!/usr/bin/env bash + +set -e + +cd "$(dirname "$0")/.." + +RED='\033[0;31m' +GREEN='\033[0;32m' +YELLOW='\033[0;33m' +NC='\033[0m' # No Color + +function prism_is_running() { + curl --silent "http://localhost:4010" > /dev/null 2>&1 +} + +kill_server_on_port() { + pids=$(lsof -t -i tcp:"$1" || echo "") + if [ "$pids" != "" ]; then + kill "$pids" + echo "Stopped $pids." + fi +} + +function is_overriding_api_base_url() { + [ -n "$TEST_API_BASE_URL" ] +} + +if ! is_overriding_api_base_url && ! prism_is_running; then + # When we exit this script, make sure to kill the background mock server process + trap 'kill_server_on_port 4010' EXIT + + # Start the dev server + ./scripts/mock --daemon +fi + +if is_overriding_api_base_url; then + echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" + echo +elif ! prism_is_running; then + echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" + echo -e "running against your OpenAPI spec." + echo + echo -e "To run the server, pass in the path or url of your OpenAPI" + echo -e "spec to the prism command:" + echo + echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" + echo + + exit 1 +else + echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" + echo +fi + +exec -- ./vendor/bin/pest --colors=always diff --git a/src/Accounts/Origins/OriginCreateParams.php b/src/Accounts/Origins/OriginCreateParams.php new file mode 100644 index 00000000..1ba42b68 --- /dev/null +++ b/src/Accounts/Origins/OriginCreateParams.php @@ -0,0 +1,87 @@ +create + * + * @phpstan-type origin_create_params = array{ + * origin: S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim, + * } + */ +final class OriginCreateParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * Schema for origin request resources. + */ + #[Api(union: OriginRequest::class)] + public S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim $origin; + + /** + * `new OriginCreateParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OriginCreateParams::with(origin: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OriginCreateParams)->withOrigin(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim $origin, + ): self { + $obj = new self; + + $obj->origin = $origin; + + return $obj; + } + + /** + * Schema for origin request resources. + */ + public function withOrigin( + S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim $origin, + ): self { + $obj = clone $this; + $obj->origin = $origin; + + return $obj; + } +} diff --git a/src/Accounts/Origins/OriginRequest.php b/src/Accounts/Origins/OriginRequest.php new file mode 100644 index 00000000..93fcf986 --- /dev/null +++ b/src/Accounts/Origins/OriginRequest.php @@ -0,0 +1,48 @@ +|array + */ + public static function variants(): array + { + return [ + 'S3' => S3::class, + 'S3_COMPATIBLE' => S3Compatible::class, + 'CLOUDINARY_BACKUP' => CloudinaryBackup::class, + 'WEB_FOLDER' => WebFolder::class, + 'WEB_PROXY' => WebProxy::class, + 'GCS' => Gcs::class, + 'AZURE_BLOB' => AzureBlob::class, + 'AKENEO_PIM' => AkeneoPim::class, + ]; + } +} diff --git a/src/Accounts/Origins/OriginRequest/AkeneoPim.php b/src/Accounts/Origins/OriginRequest/AkeneoPim.php new file mode 100644 index 00000000..9e48f720 --- /dev/null +++ b/src/Accounts/Origins/OriginRequest/AkeneoPim.php @@ -0,0 +1,231 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'AKENEO_PIM'; + + /** + * Akeneo instance base URL. + */ + #[Api('baseUrl')] + public string $baseURL; + + /** + * Akeneo API client ID. + */ + #[Api('clientId')] + public string $clientID; + + /** + * Akeneo API client secret. + */ + #[Api] + public string $clientSecret; + + /** + * Display name of the origin. + */ + #[Api] + public string $name; + + /** + * Akeneo API password. + */ + #[Api] + public string $password; + + /** + * Akeneo API username. + */ + #[Api] + public string $username; + + /** + * URL used in the Canonical header (if enabled). + */ + #[Api('baseUrlForCanonicalHeader', optional: true)] + public ?string $baseURLForCanonicalHeader; + + /** + * Whether to send a Canonical header. + */ + #[Api(optional: true)] + public ?bool $includeCanonicalHeader; + + /** + * `new AkeneoPim()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AkeneoPim::with( + * baseURL: ..., + * clientID: ..., + * clientSecret: ..., + * name: ..., + * password: ..., + * username: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AkeneoPim) + * ->withBaseURL(...) + * ->withClientID(...) + * ->withClientSecret(...) + * ->withName(...) + * ->withPassword(...) + * ->withUsername(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $baseURL, + string $clientID, + string $clientSecret, + string $name, + string $password, + string $username, + ?string $baseURLForCanonicalHeader = null, + ?bool $includeCanonicalHeader = null, + ): self { + $obj = new self; + + $obj->baseURL = $baseURL; + $obj->clientID = $clientID; + $obj->clientSecret = $clientSecret; + $obj->name = $name; + $obj->password = $password; + $obj->username = $username; + + null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; + + return $obj; + } + + /** + * Akeneo instance base URL. + */ + public function withBaseURL(string $baseURL): self + { + $obj = clone $this; + $obj->baseURL = $baseURL; + + return $obj; + } + + /** + * Akeneo API client ID. + */ + public function withClientID(string $clientID): self + { + $obj = clone $this; + $obj->clientID = $clientID; + + return $obj; + } + + /** + * Akeneo API client secret. + */ + public function withClientSecret(string $clientSecret): self + { + $obj = clone $this; + $obj->clientSecret = $clientSecret; + + return $obj; + } + + /** + * Display name of the origin. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * Akeneo API password. + */ + public function withPassword(string $password): self + { + $obj = clone $this; + $obj->password = $password; + + return $obj; + } + + /** + * Akeneo API username. + */ + public function withUsername(string $username): self + { + $obj = clone $this; + $obj->username = $username; + + return $obj; + } + + /** + * URL used in the Canonical header (if enabled). + */ + public function withBaseURLForCanonicalHeader( + string $baseURLForCanonicalHeader + ): self { + $obj = clone $this; + $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } + + /** + * Whether to send a Canonical header. + */ + public function withIncludeCanonicalHeader( + bool $includeCanonicalHeader + ): self { + $obj = clone $this; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + + return $obj; + } +} diff --git a/src/Accounts/Origins/OriginRequest/AzureBlob.php b/src/Accounts/Origins/OriginRequest/AzureBlob.php new file mode 100644 index 00000000..822f1d72 --- /dev/null +++ b/src/Accounts/Origins/OriginRequest/AzureBlob.php @@ -0,0 +1,178 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'AZURE_BLOB'; + + #[Api] + public string $accountName; + + #[Api] + public string $container; + + /** + * Display name of the origin. + */ + #[Api] + public string $name; + + #[Api] + public string $sasToken; + + /** + * URL used in the Canonical header (if enabled). + */ + #[Api('baseUrlForCanonicalHeader', optional: true)] + public ?string $baseURLForCanonicalHeader; + + /** + * Whether to send a Canonical header. + */ + #[Api(optional: true)] + public ?bool $includeCanonicalHeader; + + #[Api(optional: true)] + public ?string $prefix; + + /** + * `new AzureBlob()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AzureBlob::with(accountName: ..., container: ..., name: ..., sasToken: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AzureBlob) + * ->withAccountName(...) + * ->withContainer(...) + * ->withName(...) + * ->withSasToken(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $accountName, + string $container, + string $name, + string $sasToken, + ?string $baseURLForCanonicalHeader = null, + ?bool $includeCanonicalHeader = null, + ?string $prefix = null, + ): self { + $obj = new self; + + $obj->accountName = $accountName; + $obj->container = $container; + $obj->name = $name; + $obj->sasToken = $sasToken; + + null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; + null !== $prefix && $obj->prefix = $prefix; + + return $obj; + } + + public function withAccountName(string $accountName): self + { + $obj = clone $this; + $obj->accountName = $accountName; + + return $obj; + } + + public function withContainer(string $container): self + { + $obj = clone $this; + $obj->container = $container; + + return $obj; + } + + /** + * Display name of the origin. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + public function withSasToken(string $sasToken): self + { + $obj = clone $this; + $obj->sasToken = $sasToken; + + return $obj; + } + + /** + * URL used in the Canonical header (if enabled). + */ + public function withBaseURLForCanonicalHeader( + string $baseURLForCanonicalHeader + ): self { + $obj = clone $this; + $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } + + /** + * Whether to send a Canonical header. + */ + public function withIncludeCanonicalHeader( + bool $includeCanonicalHeader + ): self { + $obj = clone $this; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + + return $obj; + } + + public function withPrefix(string $prefix): self + { + $obj = clone $this; + $obj->prefix = $prefix; + + return $obj; + } +} diff --git a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php new file mode 100644 index 00000000..b7c0652e --- /dev/null +++ b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php @@ -0,0 +1,202 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'CLOUDINARY_BACKUP'; + + /** + * Access key for the bucket. + */ + #[Api] + public string $accessKey; + + /** + * S3 bucket name. + */ + #[Api] + public string $bucket; + + /** + * Display name of the origin. + */ + #[Api] + public string $name; + + /** + * Secret key for the bucket. + */ + #[Api] + public string $secretKey; + + /** + * URL used in the Canonical header (if enabled). + */ + #[Api('baseUrlForCanonicalHeader', optional: true)] + public ?string $baseURLForCanonicalHeader; + + /** + * Whether to send a Canonical header. + */ + #[Api(optional: true)] + public ?bool $includeCanonicalHeader; + + /** + * Path prefix inside the bucket. + */ + #[Api(optional: true)] + public ?string $prefix; + + /** + * `new CloudinaryBackup()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * CloudinaryBackup::with(accessKey: ..., bucket: ..., name: ..., secretKey: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new CloudinaryBackup) + * ->withAccessKey(...) + * ->withBucket(...) + * ->withName(...) + * ->withSecretKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $accessKey, + string $bucket, + string $name, + string $secretKey, + ?string $baseURLForCanonicalHeader = null, + ?bool $includeCanonicalHeader = null, + ?string $prefix = null, + ): self { + $obj = new self; + + $obj->accessKey = $accessKey; + $obj->bucket = $bucket; + $obj->name = $name; + $obj->secretKey = $secretKey; + + null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; + null !== $prefix && $obj->prefix = $prefix; + + return $obj; + } + + /** + * Access key for the bucket. + */ + public function withAccessKey(string $accessKey): self + { + $obj = clone $this; + $obj->accessKey = $accessKey; + + return $obj; + } + + /** + * S3 bucket name. + */ + public function withBucket(string $bucket): self + { + $obj = clone $this; + $obj->bucket = $bucket; + + return $obj; + } + + /** + * Display name of the origin. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * Secret key for the bucket. + */ + public function withSecretKey(string $secretKey): self + { + $obj = clone $this; + $obj->secretKey = $secretKey; + + return $obj; + } + + /** + * URL used in the Canonical header (if enabled). + */ + public function withBaseURLForCanonicalHeader( + string $baseURLForCanonicalHeader + ): self { + $obj = clone $this; + $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } + + /** + * Whether to send a Canonical header. + */ + public function withIncludeCanonicalHeader( + bool $includeCanonicalHeader + ): self { + $obj = clone $this; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + + return $obj; + } + + /** + * Path prefix inside the bucket. + */ + public function withPrefix(string $prefix): self + { + $obj = clone $this; + $obj->prefix = $prefix; + + return $obj; + } +} diff --git a/src/Accounts/Origins/OriginRequest/Gcs.php b/src/Accounts/Origins/OriginRequest/Gcs.php new file mode 100644 index 00000000..7ce89f65 --- /dev/null +++ b/src/Accounts/Origins/OriginRequest/Gcs.php @@ -0,0 +1,178 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'GCS'; + + #[Api] + public string $bucket; + + #[Api] + public string $clientEmail; + + /** + * Display name of the origin. + */ + #[Api] + public string $name; + + #[Api] + public string $privateKey; + + /** + * URL used in the Canonical header (if enabled). + */ + #[Api('baseUrlForCanonicalHeader', optional: true)] + public ?string $baseURLForCanonicalHeader; + + /** + * Whether to send a Canonical header. + */ + #[Api(optional: true)] + public ?bool $includeCanonicalHeader; + + #[Api(optional: true)] + public ?string $prefix; + + /** + * `new Gcs()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Gcs::with(bucket: ..., clientEmail: ..., name: ..., privateKey: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Gcs) + * ->withBucket(...) + * ->withClientEmail(...) + * ->withName(...) + * ->withPrivateKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $bucket, + string $clientEmail, + string $name, + string $privateKey, + ?string $baseURLForCanonicalHeader = null, + ?bool $includeCanonicalHeader = null, + ?string $prefix = null, + ): self { + $obj = new self; + + $obj->bucket = $bucket; + $obj->clientEmail = $clientEmail; + $obj->name = $name; + $obj->privateKey = $privateKey; + + null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; + null !== $prefix && $obj->prefix = $prefix; + + return $obj; + } + + public function withBucket(string $bucket): self + { + $obj = clone $this; + $obj->bucket = $bucket; + + return $obj; + } + + public function withClientEmail(string $clientEmail): self + { + $obj = clone $this; + $obj->clientEmail = $clientEmail; + + return $obj; + } + + /** + * Display name of the origin. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + public function withPrivateKey(string $privateKey): self + { + $obj = clone $this; + $obj->privateKey = $privateKey; + + return $obj; + } + + /** + * URL used in the Canonical header (if enabled). + */ + public function withBaseURLForCanonicalHeader( + string $baseURLForCanonicalHeader + ): self { + $obj = clone $this; + $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } + + /** + * Whether to send a Canonical header. + */ + public function withIncludeCanonicalHeader( + bool $includeCanonicalHeader + ): self { + $obj = clone $this; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + + return $obj; + } + + public function withPrefix(string $prefix): self + { + $obj = clone $this; + $obj->prefix = $prefix; + + return $obj; + } +} diff --git a/src/Accounts/Origins/OriginRequest/S3.php b/src/Accounts/Origins/OriginRequest/S3.php new file mode 100644 index 00000000..4f2b45ac --- /dev/null +++ b/src/Accounts/Origins/OriginRequest/S3.php @@ -0,0 +1,198 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'S3'; + + /** + * Access key for the bucket. + */ + #[Api] + public string $accessKey; + + /** + * S3 bucket name. + */ + #[Api] + public string $bucket; + + /** + * Display name of the origin. + */ + #[Api] + public string $name; + + /** + * Secret key for the bucket. + */ + #[Api] + public string $secretKey; + + /** + * URL used in the Canonical header (if enabled). + */ + #[Api('baseUrlForCanonicalHeader', optional: true)] + public ?string $baseURLForCanonicalHeader; + + /** + * Whether to send a Canonical header. + */ + #[Api(optional: true)] + public ?bool $includeCanonicalHeader; + + /** + * Path prefix inside the bucket. + */ + #[Api(optional: true)] + public ?string $prefix; + + /** + * `new S3()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * S3::with(accessKey: ..., bucket: ..., name: ..., secretKey: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new S3)->withAccessKey(...)->withBucket(...)->withName(...)->withSecretKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $accessKey, + string $bucket, + string $name, + string $secretKey, + ?string $baseURLForCanonicalHeader = null, + ?bool $includeCanonicalHeader = null, + ?string $prefix = null, + ): self { + $obj = new self; + + $obj->accessKey = $accessKey; + $obj->bucket = $bucket; + $obj->name = $name; + $obj->secretKey = $secretKey; + + null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; + null !== $prefix && $obj->prefix = $prefix; + + return $obj; + } + + /** + * Access key for the bucket. + */ + public function withAccessKey(string $accessKey): self + { + $obj = clone $this; + $obj->accessKey = $accessKey; + + return $obj; + } + + /** + * S3 bucket name. + */ + public function withBucket(string $bucket): self + { + $obj = clone $this; + $obj->bucket = $bucket; + + return $obj; + } + + /** + * Display name of the origin. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * Secret key for the bucket. + */ + public function withSecretKey(string $secretKey): self + { + $obj = clone $this; + $obj->secretKey = $secretKey; + + return $obj; + } + + /** + * URL used in the Canonical header (if enabled). + */ + public function withBaseURLForCanonicalHeader( + string $baseURLForCanonicalHeader + ): self { + $obj = clone $this; + $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } + + /** + * Whether to send a Canonical header. + */ + public function withIncludeCanonicalHeader( + bool $includeCanonicalHeader + ): self { + $obj = clone $this; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + + return $obj; + } + + /** + * Path prefix inside the bucket. + */ + public function withPrefix(string $prefix): self + { + $obj = clone $this; + $obj->prefix = $prefix; + + return $obj; + } +} diff --git a/src/Accounts/Origins/OriginRequest/S3Compatible.php b/src/Accounts/Origins/OriginRequest/S3Compatible.php new file mode 100644 index 00000000..d0b9966e --- /dev/null +++ b/src/Accounts/Origins/OriginRequest/S3Compatible.php @@ -0,0 +1,245 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'S3_COMPATIBLE'; + + /** + * Access key for the bucket. + */ + #[Api] + public string $accessKey; + + /** + * S3 bucket name. + */ + #[Api] + public string $bucket; + + /** + * Custom S3-compatible endpoint. + */ + #[Api] + public string $endpoint; + + /** + * Display name of the origin. + */ + #[Api] + public string $name; + + /** + * Secret key for the bucket. + */ + #[Api] + public string $secretKey; + + /** + * URL used in the Canonical header (if enabled). + */ + #[Api('baseUrlForCanonicalHeader', optional: true)] + public ?string $baseURLForCanonicalHeader; + + /** + * Whether to send a Canonical header. + */ + #[Api(optional: true)] + public ?bool $includeCanonicalHeader; + + /** + * Path prefix inside the bucket. + */ + #[Api(optional: true)] + public ?string $prefix; + + /** + * Use path-style S3 URLs? + */ + #[Api(optional: true)] + public ?bool $s3ForcePathStyle; + + /** + * `new S3Compatible()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * S3Compatible::with( + * accessKey: ..., bucket: ..., endpoint: ..., name: ..., secretKey: ... + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new S3Compatible) + * ->withAccessKey(...) + * ->withBucket(...) + * ->withEndpoint(...) + * ->withName(...) + * ->withSecretKey(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $accessKey, + string $bucket, + string $endpoint, + string $name, + string $secretKey, + ?string $baseURLForCanonicalHeader = null, + ?bool $includeCanonicalHeader = null, + ?string $prefix = null, + ?bool $s3ForcePathStyle = null, + ): self { + $obj = new self; + + $obj->accessKey = $accessKey; + $obj->bucket = $bucket; + $obj->endpoint = $endpoint; + $obj->name = $name; + $obj->secretKey = $secretKey; + + null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; + null !== $prefix && $obj->prefix = $prefix; + null !== $s3ForcePathStyle && $obj->s3ForcePathStyle = $s3ForcePathStyle; + + return $obj; + } + + /** + * Access key for the bucket. + */ + public function withAccessKey(string $accessKey): self + { + $obj = clone $this; + $obj->accessKey = $accessKey; + + return $obj; + } + + /** + * S3 bucket name. + */ + public function withBucket(string $bucket): self + { + $obj = clone $this; + $obj->bucket = $bucket; + + return $obj; + } + + /** + * Custom S3-compatible endpoint. + */ + public function withEndpoint(string $endpoint): self + { + $obj = clone $this; + $obj->endpoint = $endpoint; + + return $obj; + } + + /** + * Display name of the origin. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * Secret key for the bucket. + */ + public function withSecretKey(string $secretKey): self + { + $obj = clone $this; + $obj->secretKey = $secretKey; + + return $obj; + } + + /** + * URL used in the Canonical header (if enabled). + */ + public function withBaseURLForCanonicalHeader( + string $baseURLForCanonicalHeader + ): self { + $obj = clone $this; + $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } + + /** + * Whether to send a Canonical header. + */ + public function withIncludeCanonicalHeader( + bool $includeCanonicalHeader + ): self { + $obj = clone $this; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + + return $obj; + } + + /** + * Path prefix inside the bucket. + */ + public function withPrefix(string $prefix): self + { + $obj = clone $this; + $obj->prefix = $prefix; + + return $obj; + } + + /** + * Use path-style S3 URLs? + */ + public function withS3ForcePathStyle(bool $s3ForcePathStyle): self + { + $obj = clone $this; + $obj->s3ForcePathStyle = $s3ForcePathStyle; + + return $obj; + } +} diff --git a/src/Accounts/Origins/OriginRequest/WebFolder.php b/src/Accounts/Origins/OriginRequest/WebFolder.php new file mode 100644 index 00000000..4c634e60 --- /dev/null +++ b/src/Accounts/Origins/OriginRequest/WebFolder.php @@ -0,0 +1,159 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'WEB_FOLDER'; + + /** + * Root URL for the web folder origin. + */ + #[Api('baseUrl')] + public string $baseURL; + + /** + * Display name of the origin. + */ + #[Api] + public string $name; + + /** + * URL used in the Canonical header (if enabled). + */ + #[Api('baseUrlForCanonicalHeader', optional: true)] + public ?string $baseURLForCanonicalHeader; + + /** + * Forward the Host header to origin? + */ + #[Api(optional: true)] + public ?bool $forwardHostHeaderToOrigin; + + /** + * Whether to send a Canonical header. + */ + #[Api(optional: true)] + public ?bool $includeCanonicalHeader; + + /** + * `new WebFolder()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * WebFolder::with(baseURL: ..., name: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new WebFolder)->withBaseURL(...)->withName(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $baseURL, + string $name, + ?string $baseURLForCanonicalHeader = null, + ?bool $forwardHostHeaderToOrigin = null, + ?bool $includeCanonicalHeader = null, + ): self { + $obj = new self; + + $obj->baseURL = $baseURL; + $obj->name = $name; + + null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $forwardHostHeaderToOrigin && $obj->forwardHostHeaderToOrigin = $forwardHostHeaderToOrigin; + null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; + + return $obj; + } + + /** + * Root URL for the web folder origin. + */ + public function withBaseURL(string $baseURL): self + { + $obj = clone $this; + $obj->baseURL = $baseURL; + + return $obj; + } + + /** + * Display name of the origin. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * URL used in the Canonical header (if enabled). + */ + public function withBaseURLForCanonicalHeader( + string $baseURLForCanonicalHeader + ): self { + $obj = clone $this; + $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } + + /** + * Forward the Host header to origin? + */ + public function withForwardHostHeaderToOrigin( + bool $forwardHostHeaderToOrigin + ): self { + $obj = clone $this; + $obj->forwardHostHeaderToOrigin = $forwardHostHeaderToOrigin; + + return $obj; + } + + /** + * Whether to send a Canonical header. + */ + public function withIncludeCanonicalHeader( + bool $includeCanonicalHeader + ): self { + $obj = clone $this; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + + return $obj; + } +} diff --git a/src/Accounts/Origins/OriginRequest/WebProxy.php b/src/Accounts/Origins/OriginRequest/WebProxy.php new file mode 100644 index 00000000..2b6404b7 --- /dev/null +++ b/src/Accounts/Origins/OriginRequest/WebProxy.php @@ -0,0 +1,118 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'WEB_PROXY'; + + /** + * Display name of the origin. + */ + #[Api] + public string $name; + + /** + * URL used in the Canonical header (if enabled). + */ + #[Api('baseUrlForCanonicalHeader', optional: true)] + public ?string $baseURLForCanonicalHeader; + + /** + * Whether to send a Canonical header. + */ + #[Api(optional: true)] + public ?bool $includeCanonicalHeader; + + /** + * `new WebProxy()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * WebProxy::with(name: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new WebProxy)->withName(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $name, + ?string $baseURLForCanonicalHeader = null, + ?bool $includeCanonicalHeader = null, + ): self { + $obj = new self; + + $obj->name = $name; + + null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; + + return $obj; + } + + /** + * Display name of the origin. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * URL used in the Canonical header (if enabled). + */ + public function withBaseURLForCanonicalHeader( + string $baseURLForCanonicalHeader + ): self { + $obj = clone $this; + $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } + + /** + * Whether to send a Canonical header. + */ + public function withIncludeCanonicalHeader( + bool $includeCanonicalHeader + ): self { + $obj = clone $this; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + + return $obj; + } +} diff --git a/src/Accounts/Origins/OriginResponse.php b/src/Accounts/Origins/OriginResponse.php new file mode 100644 index 00000000..7c9f0050 --- /dev/null +++ b/src/Accounts/Origins/OriginResponse.php @@ -0,0 +1,48 @@ +|array + */ + public static function variants(): array + { + return [ + 'S3' => S3::class, + 'S3_COMPATIBLE' => S3Compatible::class, + 'CLOUDINARY_BACKUP' => CloudinaryBackup::class, + 'WEB_FOLDER' => WebFolder::class, + 'WEB_PROXY' => WebProxy::class, + 'GCS' => Gcs::class, + 'AZURE_BLOB' => AzureBlob::class, + 'AKENEO_PIM' => AkeneoPim::class, + ]; + } +} diff --git a/src/Accounts/Origins/OriginResponse/AkeneoPim.php b/src/Accounts/Origins/OriginResponse/AkeneoPim.php new file mode 100644 index 00000000..2459a81d --- /dev/null +++ b/src/Accounts/Origins/OriginResponse/AkeneoPim.php @@ -0,0 +1,162 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'AKENEO_PIM'; + + /** + * Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + */ + #[Api] + public string $id; + + /** + * Akeneo instance base URL. + */ + #[Api('baseUrl')] + public string $baseURL; + + /** + * Whether to send a Canonical header. + */ + #[Api] + public bool $includeCanonicalHeader; + + /** + * Display name of the origin. + */ + #[Api] + public string $name; + + /** + * URL used in the Canonical header (if enabled). + */ + #[Api('baseUrlForCanonicalHeader', optional: true)] + public ?string $baseURLForCanonicalHeader; + + /** + * `new AkeneoPim()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AkeneoPim::with(id: ..., baseURL: ..., includeCanonicalHeader: ..., name: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AkeneoPim) + * ->withID(...) + * ->withBaseURL(...) + * ->withIncludeCanonicalHeader(...) + * ->withName(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $id, + string $baseURL, + string $name, + bool $includeCanonicalHeader = false, + ?string $baseURLForCanonicalHeader = null, + ): self { + $obj = new self; + + $obj->id = $id; + $obj->baseURL = $baseURL; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj->name = $name; + + null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } + + /** + * Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * Akeneo instance base URL. + */ + public function withBaseURL(string $baseURL): self + { + $obj = clone $this; + $obj->baseURL = $baseURL; + + return $obj; + } + + /** + * Whether to send a Canonical header. + */ + public function withIncludeCanonicalHeader( + bool $includeCanonicalHeader + ): self { + $obj = clone $this; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + + return $obj; + } + + /** + * Display name of the origin. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * URL used in the Canonical header (if enabled). + */ + public function withBaseURLForCanonicalHeader( + string $baseURLForCanonicalHeader + ): self { + $obj = clone $this; + $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } +} diff --git a/src/Accounts/Origins/OriginResponse/AzureBlob.php b/src/Accounts/Origins/OriginResponse/AzureBlob.php new file mode 100644 index 00000000..63c2a2db --- /dev/null +++ b/src/Accounts/Origins/OriginResponse/AzureBlob.php @@ -0,0 +1,193 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'AZURE_BLOB'; + + /** + * Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + */ + #[Api] + public string $id; + + #[Api] + public string $accountName; + + #[Api] + public string $container; + + /** + * Whether to send a Canonical header. + */ + #[Api] + public bool $includeCanonicalHeader; + + /** + * Display name of the origin. + */ + #[Api] + public string $name; + + #[Api] + public string $prefix; + + /** + * URL used in the Canonical header (if enabled). + */ + #[Api('baseUrlForCanonicalHeader', optional: true)] + public ?string $baseURLForCanonicalHeader; + + /** + * `new AzureBlob()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AzureBlob::with( + * id: ..., + * accountName: ..., + * container: ..., + * includeCanonicalHeader: ..., + * name: ..., + * prefix: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AzureBlob) + * ->withID(...) + * ->withAccountName(...) + * ->withContainer(...) + * ->withIncludeCanonicalHeader(...) + * ->withName(...) + * ->withPrefix(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $id, + string $accountName, + string $container, + string $name, + string $prefix, + bool $includeCanonicalHeader = false, + ?string $baseURLForCanonicalHeader = null, + ): self { + $obj = new self; + + $obj->id = $id; + $obj->accountName = $accountName; + $obj->container = $container; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj->name = $name; + $obj->prefix = $prefix; + + null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } + + /** + * Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + public function withAccountName(string $accountName): self + { + $obj = clone $this; + $obj->accountName = $accountName; + + return $obj; + } + + public function withContainer(string $container): self + { + $obj = clone $this; + $obj->container = $container; + + return $obj; + } + + /** + * Whether to send a Canonical header. + */ + public function withIncludeCanonicalHeader( + bool $includeCanonicalHeader + ): self { + $obj = clone $this; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + + return $obj; + } + + /** + * Display name of the origin. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + public function withPrefix(string $prefix): self + { + $obj = clone $this; + $obj->prefix = $prefix; + + return $obj; + } + + /** + * URL used in the Canonical header (if enabled). + */ + public function withBaseURLForCanonicalHeader( + string $baseURLForCanonicalHeader + ): self { + $obj = clone $this; + $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } +} diff --git a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php new file mode 100644 index 00000000..e721eb2a --- /dev/null +++ b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php @@ -0,0 +1,185 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'CLOUDINARY_BACKUP'; + + /** + * Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + */ + #[Api] + public string $id; + + /** + * S3 bucket name. + */ + #[Api] + public string $bucket; + + /** + * Whether to send a Canonical header. + */ + #[Api] + public bool $includeCanonicalHeader; + + /** + * Display name of the origin. + */ + #[Api] + public string $name; + + /** + * Path prefix inside the bucket. + */ + #[Api] + public string $prefix; + + /** + * URL used in the Canonical header (if enabled). + */ + #[Api('baseUrlForCanonicalHeader', optional: true)] + public ?string $baseURLForCanonicalHeader; + + /** + * `new CloudinaryBackup()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * CloudinaryBackup::with( + * id: ..., bucket: ..., includeCanonicalHeader: ..., name: ..., prefix: ... + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new CloudinaryBackup) + * ->withID(...) + * ->withBucket(...) + * ->withIncludeCanonicalHeader(...) + * ->withName(...) + * ->withPrefix(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $id, + string $bucket, + string $name, + string $prefix, + bool $includeCanonicalHeader = false, + ?string $baseURLForCanonicalHeader = null, + ): self { + $obj = new self; + + $obj->id = $id; + $obj->bucket = $bucket; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj->name = $name; + $obj->prefix = $prefix; + + null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } + + /** + * Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * S3 bucket name. + */ + public function withBucket(string $bucket): self + { + $obj = clone $this; + $obj->bucket = $bucket; + + return $obj; + } + + /** + * Whether to send a Canonical header. + */ + public function withIncludeCanonicalHeader( + bool $includeCanonicalHeader + ): self { + $obj = clone $this; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + + return $obj; + } + + /** + * Display name of the origin. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * Path prefix inside the bucket. + */ + public function withPrefix(string $prefix): self + { + $obj = clone $this; + $obj->prefix = $prefix; + + return $obj; + } + + /** + * URL used in the Canonical header (if enabled). + */ + public function withBaseURLForCanonicalHeader( + string $baseURLForCanonicalHeader + ): self { + $obj = clone $this; + $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } +} diff --git a/src/Accounts/Origins/OriginResponse/Gcs.php b/src/Accounts/Origins/OriginResponse/Gcs.php new file mode 100644 index 00000000..bd7bc41e --- /dev/null +++ b/src/Accounts/Origins/OriginResponse/Gcs.php @@ -0,0 +1,193 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'GCS'; + + /** + * Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + */ + #[Api] + public string $id; + + #[Api] + public string $bucket; + + #[Api] + public string $clientEmail; + + /** + * Whether to send a Canonical header. + */ + #[Api] + public bool $includeCanonicalHeader; + + /** + * Display name of the origin. + */ + #[Api] + public string $name; + + #[Api] + public string $prefix; + + /** + * URL used in the Canonical header (if enabled). + */ + #[Api('baseUrlForCanonicalHeader', optional: true)] + public ?string $baseURLForCanonicalHeader; + + /** + * `new Gcs()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Gcs::with( + * id: ..., + * bucket: ..., + * clientEmail: ..., + * includeCanonicalHeader: ..., + * name: ..., + * prefix: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Gcs) + * ->withID(...) + * ->withBucket(...) + * ->withClientEmail(...) + * ->withIncludeCanonicalHeader(...) + * ->withName(...) + * ->withPrefix(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $id, + string $bucket, + string $clientEmail, + string $name, + string $prefix, + bool $includeCanonicalHeader = false, + ?string $baseURLForCanonicalHeader = null, + ): self { + $obj = new self; + + $obj->id = $id; + $obj->bucket = $bucket; + $obj->clientEmail = $clientEmail; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj->name = $name; + $obj->prefix = $prefix; + + null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } + + /** + * Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + public function withBucket(string $bucket): self + { + $obj = clone $this; + $obj->bucket = $bucket; + + return $obj; + } + + public function withClientEmail(string $clientEmail): self + { + $obj = clone $this; + $obj->clientEmail = $clientEmail; + + return $obj; + } + + /** + * Whether to send a Canonical header. + */ + public function withIncludeCanonicalHeader( + bool $includeCanonicalHeader + ): self { + $obj = clone $this; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + + return $obj; + } + + /** + * Display name of the origin. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + public function withPrefix(string $prefix): self + { + $obj = clone $this; + $obj->prefix = $prefix; + + return $obj; + } + + /** + * URL used in the Canonical header (if enabled). + */ + public function withBaseURLForCanonicalHeader( + string $baseURLForCanonicalHeader + ): self { + $obj = clone $this; + $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } +} diff --git a/src/Accounts/Origins/OriginResponse/S3.php b/src/Accounts/Origins/OriginResponse/S3.php new file mode 100644 index 00000000..48050fed --- /dev/null +++ b/src/Accounts/Origins/OriginResponse/S3.php @@ -0,0 +1,185 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'S3'; + + /** + * Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + */ + #[Api] + public string $id; + + /** + * S3 bucket name. + */ + #[Api] + public string $bucket; + + /** + * Whether to send a Canonical header. + */ + #[Api] + public bool $includeCanonicalHeader; + + /** + * Display name of the origin. + */ + #[Api] + public string $name; + + /** + * Path prefix inside the bucket. + */ + #[Api] + public string $prefix; + + /** + * URL used in the Canonical header (if enabled). + */ + #[Api('baseUrlForCanonicalHeader', optional: true)] + public ?string $baseURLForCanonicalHeader; + + /** + * `new S3()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * S3::with( + * id: ..., bucket: ..., includeCanonicalHeader: ..., name: ..., prefix: ... + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new S3) + * ->withID(...) + * ->withBucket(...) + * ->withIncludeCanonicalHeader(...) + * ->withName(...) + * ->withPrefix(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $id, + string $bucket, + string $name, + string $prefix, + bool $includeCanonicalHeader = false, + ?string $baseURLForCanonicalHeader = null, + ): self { + $obj = new self; + + $obj->id = $id; + $obj->bucket = $bucket; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj->name = $name; + $obj->prefix = $prefix; + + null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } + + /** + * Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * S3 bucket name. + */ + public function withBucket(string $bucket): self + { + $obj = clone $this; + $obj->bucket = $bucket; + + return $obj; + } + + /** + * Whether to send a Canonical header. + */ + public function withIncludeCanonicalHeader( + bool $includeCanonicalHeader + ): self { + $obj = clone $this; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + + return $obj; + } + + /** + * Display name of the origin. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * Path prefix inside the bucket. + */ + public function withPrefix(string $prefix): self + { + $obj = clone $this; + $obj->prefix = $prefix; + + return $obj; + } + + /** + * URL used in the Canonical header (if enabled). + */ + public function withBaseURLForCanonicalHeader( + string $baseURLForCanonicalHeader + ): self { + $obj = clone $this; + $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } +} diff --git a/src/Accounts/Origins/OriginResponse/S3Compatible.php b/src/Accounts/Origins/OriginResponse/S3Compatible.php new file mode 100644 index 00000000..74d8e0d6 --- /dev/null +++ b/src/Accounts/Origins/OriginResponse/S3Compatible.php @@ -0,0 +1,233 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'S3_COMPATIBLE'; + + /** + * Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + */ + #[Api] + public string $id; + + /** + * S3 bucket name. + */ + #[Api] + public string $bucket; + + /** + * Custom S3-compatible endpoint. + */ + #[Api] + public string $endpoint; + + /** + * Whether to send a Canonical header. + */ + #[Api] + public bool $includeCanonicalHeader; + + /** + * Display name of the origin. + */ + #[Api] + public string $name; + + /** + * Path prefix inside the bucket. + */ + #[Api] + public string $prefix; + + /** + * Use path-style S3 URLs? + */ + #[Api] + public bool $s3ForcePathStyle; + + /** + * URL used in the Canonical header (if enabled). + */ + #[Api('baseUrlForCanonicalHeader', optional: true)] + public ?string $baseURLForCanonicalHeader; + + /** + * `new S3Compatible()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * S3Compatible::with( + * id: ..., + * bucket: ..., + * endpoint: ..., + * includeCanonicalHeader: ..., + * name: ..., + * prefix: ..., + * s3ForcePathStyle: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new S3Compatible) + * ->withID(...) + * ->withBucket(...) + * ->withEndpoint(...) + * ->withIncludeCanonicalHeader(...) + * ->withName(...) + * ->withPrefix(...) + * ->withS3ForcePathStyle(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $id, + string $bucket, + string $endpoint, + string $name, + string $prefix, + bool $includeCanonicalHeader = false, + bool $s3ForcePathStyle = false, + ?string $baseURLForCanonicalHeader = null, + ): self { + $obj = new self; + + $obj->id = $id; + $obj->bucket = $bucket; + $obj->endpoint = $endpoint; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj->name = $name; + $obj->prefix = $prefix; + $obj->s3ForcePathStyle = $s3ForcePathStyle; + + null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } + + /** + * Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * S3 bucket name. + */ + public function withBucket(string $bucket): self + { + $obj = clone $this; + $obj->bucket = $bucket; + + return $obj; + } + + /** + * Custom S3-compatible endpoint. + */ + public function withEndpoint(string $endpoint): self + { + $obj = clone $this; + $obj->endpoint = $endpoint; + + return $obj; + } + + /** + * Whether to send a Canonical header. + */ + public function withIncludeCanonicalHeader( + bool $includeCanonicalHeader + ): self { + $obj = clone $this; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + + return $obj; + } + + /** + * Display name of the origin. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * Path prefix inside the bucket. + */ + public function withPrefix(string $prefix): self + { + $obj = clone $this; + $obj->prefix = $prefix; + + return $obj; + } + + /** + * Use path-style S3 URLs? + */ + public function withS3ForcePathStyle(bool $s3ForcePathStyle): self + { + $obj = clone $this; + $obj->s3ForcePathStyle = $s3ForcePathStyle; + + return $obj; + } + + /** + * URL used in the Canonical header (if enabled). + */ + public function withBaseURLForCanonicalHeader( + string $baseURLForCanonicalHeader + ): self { + $obj = clone $this; + $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } +} diff --git a/src/Accounts/Origins/OriginResponse/WebFolder.php b/src/Accounts/Origins/OriginResponse/WebFolder.php new file mode 100644 index 00000000..97d22763 --- /dev/null +++ b/src/Accounts/Origins/OriginResponse/WebFolder.php @@ -0,0 +1,190 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'WEB_FOLDER'; + + /** + * Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + */ + #[Api] + public string $id; + + /** + * Root URL for the web folder origin. + */ + #[Api('baseUrl')] + public string $baseURL; + + /** + * Forward the Host header to origin? + */ + #[Api] + public bool $forwardHostHeaderToOrigin; + + /** + * Whether to send a Canonical header. + */ + #[Api] + public bool $includeCanonicalHeader; + + /** + * Display name of the origin. + */ + #[Api] + public string $name; + + /** + * URL used in the Canonical header (if enabled). + */ + #[Api('baseUrlForCanonicalHeader', optional: true)] + public ?string $baseURLForCanonicalHeader; + + /** + * `new WebFolder()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * WebFolder::with( + * id: ..., + * baseURL: ..., + * forwardHostHeaderToOrigin: ..., + * includeCanonicalHeader: ..., + * name: ..., + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new WebFolder) + * ->withID(...) + * ->withBaseURL(...) + * ->withForwardHostHeaderToOrigin(...) + * ->withIncludeCanonicalHeader(...) + * ->withName(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $id, + string $baseURL, + string $name, + bool $forwardHostHeaderToOrigin = false, + bool $includeCanonicalHeader = false, + ?string $baseURLForCanonicalHeader = null, + ): self { + $obj = new self; + + $obj->id = $id; + $obj->baseURL = $baseURL; + $obj->forwardHostHeaderToOrigin = $forwardHostHeaderToOrigin; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj->name = $name; + + null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } + + /** + * Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * Root URL for the web folder origin. + */ + public function withBaseURL(string $baseURL): self + { + $obj = clone $this; + $obj->baseURL = $baseURL; + + return $obj; + } + + /** + * Forward the Host header to origin? + */ + public function withForwardHostHeaderToOrigin( + bool $forwardHostHeaderToOrigin + ): self { + $obj = clone $this; + $obj->forwardHostHeaderToOrigin = $forwardHostHeaderToOrigin; + + return $obj; + } + + /** + * Whether to send a Canonical header. + */ + public function withIncludeCanonicalHeader( + bool $includeCanonicalHeader + ): self { + $obj = clone $this; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + + return $obj; + } + + /** + * Display name of the origin. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * URL used in the Canonical header (if enabled). + */ + public function withBaseURLForCanonicalHeader( + string $baseURLForCanonicalHeader + ): self { + $obj = clone $this; + $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } +} diff --git a/src/Accounts/Origins/OriginResponse/WebProxy.php b/src/Accounts/Origins/OriginResponse/WebProxy.php new file mode 100644 index 00000000..3a302c3b --- /dev/null +++ b/src/Accounts/Origins/OriginResponse/WebProxy.php @@ -0,0 +1,138 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'WEB_PROXY'; + + /** + * Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + */ + #[Api] + public string $id; + + /** + * Whether to send a Canonical header. + */ + #[Api] + public bool $includeCanonicalHeader; + + /** + * Display name of the origin. + */ + #[Api] + public string $name; + + /** + * URL used in the Canonical header (if enabled). + */ + #[Api('baseUrlForCanonicalHeader', optional: true)] + public ?string $baseURLForCanonicalHeader; + + /** + * `new WebProxy()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * WebProxy::with(id: ..., includeCanonicalHeader: ..., name: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new WebProxy)->withID(...)->withIncludeCanonicalHeader(...)->withName(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $id, + string $name, + bool $includeCanonicalHeader = false, + ?string $baseURLForCanonicalHeader = null, + ): self { + $obj = new self; + + $obj->id = $id; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj->name = $name; + + null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } + + /** + * Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * Whether to send a Canonical header. + */ + public function withIncludeCanonicalHeader( + bool $includeCanonicalHeader + ): self { + $obj = clone $this; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + + return $obj; + } + + /** + * Display name of the origin. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * URL used in the Canonical header (if enabled). + */ + public function withBaseURLForCanonicalHeader( + string $baseURLForCanonicalHeader + ): self { + $obj = clone $this; + $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } +} diff --git a/src/Accounts/Origins/OriginUpdateParams.php b/src/Accounts/Origins/OriginUpdateParams.php new file mode 100644 index 00000000..bbcec186 --- /dev/null +++ b/src/Accounts/Origins/OriginUpdateParams.php @@ -0,0 +1,87 @@ +update + * + * @phpstan-type origin_update_params = array{ + * origin: S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim, + * } + */ +final class OriginUpdateParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * Schema for origin request resources. + */ + #[Api(union: OriginRequest::class)] + public S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim $origin; + + /** + * `new OriginUpdateParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * OriginUpdateParams::with(origin: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new OriginUpdateParams)->withOrigin(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim $origin, + ): self { + $obj = new self; + + $obj->origin = $origin; + + return $obj; + } + + /** + * Schema for origin request resources. + */ + public function withOrigin( + S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim $origin, + ): self { + $obj = clone $this; + $obj->origin = $origin; + + return $obj; + } +} diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php new file mode 100644 index 00000000..9afd5302 --- /dev/null +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php @@ -0,0 +1,149 @@ +create + * + * @phpstan-type url_endpoint_create_params = array{ + * description: string, + * origins?: list, + * urlPrefix?: string, + * urlRewriter?: Cloudinary|Imgix|Akamai, + * } + */ +final class URLEndpointCreateParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * Description of the URL endpoint. + */ + #[Api] + public string $description; + + /** + * Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. + * + * @var list|null $origins + */ + #[Api(list: 'string', optional: true)] + public ?array $origins; + + /** + * Path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint). + */ + #[Api(optional: true)] + public ?string $urlPrefix; + + /** + * Configuration for third-party URL rewriting. + */ + #[Api(union: URLRewriter::class, optional: true)] + public Cloudinary|Imgix|Akamai|null $urlRewriter; + + /** + * `new URLEndpointCreateParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * URLEndpointCreateParams::with(description: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new URLEndpointCreateParams)->withDescription(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $origins + */ + public static function with( + string $description, + ?array $origins = null, + ?string $urlPrefix = null, + Cloudinary|Imgix|Akamai|null $urlRewriter = null, + ): self { + $obj = new self; + + $obj->description = $description; + + null !== $origins && $obj->origins = $origins; + null !== $urlPrefix && $obj->urlPrefix = $urlPrefix; + null !== $urlRewriter && $obj->urlRewriter = $urlRewriter; + + return $obj; + } + + /** + * Description of the URL endpoint. + */ + public function withDescription(string $description): self + { + $obj = clone $this; + $obj->description = $description; + + return $obj; + } + + /** + * Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. + * + * @param list $origins + */ + public function withOrigins(array $origins): self + { + $obj = clone $this; + $obj->origins = $origins; + + return $obj; + } + + /** + * Path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint). + */ + public function withURLPrefix(string $urlPrefix): self + { + $obj = clone $this; + $obj->urlPrefix = $urlPrefix; + + return $obj; + } + + /** + * Configuration for third-party URL rewriting. + */ + public function withURLRewriter(Cloudinary|Imgix|Akamai $urlRewriter): self + { + $obj = clone $this; + $obj->urlRewriter = $urlRewriter; + + return $obj; + } +} diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php new file mode 100644 index 00000000..22264f1e --- /dev/null +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php @@ -0,0 +1,38 @@ +|array + */ + public static function variants(): array + { + return [ + 'CLOUDINARY' => Cloudinary::class, + 'IMGIX' => Imgix::class, + 'AKAMAI' => Akamai::class, + ]; + } +} diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php new file mode 100644 index 00000000..ea43417a --- /dev/null +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php @@ -0,0 +1,36 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'AKAMAI'; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(): self + { + return new self; + } +} diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php new file mode 100644 index 00000000..48561fe6 --- /dev/null +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php @@ -0,0 +1,60 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'CLOUDINARY'; + + /** + * Whether to preserve `/` in the rewritten URL. + */ + #[Api(optional: true)] + public ?bool $preserveAssetDeliveryTypes; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(?bool $preserveAssetDeliveryTypes = null): self + { + $obj = new self; + + null !== $preserveAssetDeliveryTypes && $obj->preserveAssetDeliveryTypes = $preserveAssetDeliveryTypes; + + return $obj; + } + + /** + * Whether to preserve `/` in the rewritten URL. + */ + public function withPreserveAssetDeliveryTypes( + bool $preserveAssetDeliveryTypes + ): self { + $obj = clone $this; + $obj->preserveAssetDeliveryTypes = $preserveAssetDeliveryTypes; + + return $obj; + } +} diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php new file mode 100644 index 00000000..8ad00879 --- /dev/null +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php @@ -0,0 +1,36 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'IMGIX'; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(): self + { + return new self; + } +} diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest.php b/src/Accounts/URLEndpoints/URLEndpointRequest.php new file mode 100644 index 00000000..dd4177a6 --- /dev/null +++ b/src/Accounts/URLEndpoints/URLEndpointRequest.php @@ -0,0 +1,144 @@ +|null, + * urlPrefix?: string|null, + * urlRewriter?: null|Cloudinary|Imgix|Akamai, + * } + */ +final class URLEndpointRequest implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Description of the URL endpoint. + */ + #[Api] + public string $description; + + /** + * Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. + * + * @var list|null $origins + */ + #[Api(list: 'string', optional: true)] + public ?array $origins; + + /** + * Path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint). + */ + #[Api(optional: true)] + public ?string $urlPrefix; + + /** + * Configuration for third-party URL rewriting. + */ + #[Api(union: URLRewriter::class, optional: true)] + public Cloudinary|Imgix|Akamai|null $urlRewriter; + + /** + * `new URLEndpointRequest()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * URLEndpointRequest::with(description: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new URLEndpointRequest)->withDescription(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $origins + */ + public static function with( + string $description, + ?array $origins = null, + ?string $urlPrefix = null, + Cloudinary|Imgix|Akamai|null $urlRewriter = null, + ): self { + $obj = new self; + + $obj->description = $description; + + null !== $origins && $obj->origins = $origins; + null !== $urlPrefix && $obj->urlPrefix = $urlPrefix; + null !== $urlRewriter && $obj->urlRewriter = $urlRewriter; + + return $obj; + } + + /** + * Description of the URL endpoint. + */ + public function withDescription(string $description): self + { + $obj = clone $this; + $obj->description = $description; + + return $obj; + } + + /** + * Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. + * + * @param list $origins + */ + public function withOrigins(array $origins): self + { + $obj = clone $this; + $obj->origins = $origins; + + return $obj; + } + + /** + * Path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint). + */ + public function withURLPrefix(string $urlPrefix): self + { + $obj = clone $this; + $obj->urlPrefix = $urlPrefix; + + return $obj; + } + + /** + * Configuration for third-party URL rewriting. + */ + public function withURLRewriter(Cloudinary|Imgix|Akamai $urlRewriter): self + { + $obj = clone $this; + $obj->urlRewriter = $urlRewriter; + + return $obj; + } +} diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php new file mode 100644 index 00000000..61bbc068 --- /dev/null +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php @@ -0,0 +1,38 @@ +|array + */ + public static function variants(): array + { + return [ + 'CLOUDINARY' => Cloudinary::class, + 'IMGIX' => Imgix::class, + 'AKAMAI' => Akamai::class, + ]; + } +} diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php new file mode 100644 index 00000000..dbf4c8d9 --- /dev/null +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php @@ -0,0 +1,36 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'AKAMAI'; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(): self + { + return new self; + } +} diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php new file mode 100644 index 00000000..17f95e0f --- /dev/null +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php @@ -0,0 +1,60 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'CLOUDINARY'; + + /** + * Whether to preserve `/` in the rewritten URL. + */ + #[Api(optional: true)] + public ?bool $preserveAssetDeliveryTypes; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(?bool $preserveAssetDeliveryTypes = null): self + { + $obj = new self; + + null !== $preserveAssetDeliveryTypes && $obj->preserveAssetDeliveryTypes = $preserveAssetDeliveryTypes; + + return $obj; + } + + /** + * Whether to preserve `/` in the rewritten URL. + */ + public function withPreserveAssetDeliveryTypes( + bool $preserveAssetDeliveryTypes + ): self { + $obj = clone $this; + $obj->preserveAssetDeliveryTypes = $preserveAssetDeliveryTypes; + + return $obj; + } +} diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php new file mode 100644 index 00000000..cf77cd8f --- /dev/null +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php @@ -0,0 +1,36 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'IMGIX'; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(): self + { + return new self; + } +} diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse.php b/src/Accounts/URLEndpoints/URLEndpointResponse.php new file mode 100644 index 00000000..6dcecef8 --- /dev/null +++ b/src/Accounts/URLEndpoints/URLEndpointResponse.php @@ -0,0 +1,170 @@ +, + * urlPrefix: string, + * urlRewriter?: null|Cloudinary|Imgix|Akamai, + * } + */ +final class URLEndpointResponse implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. + */ + #[Api] + public string $id; + + /** + * Description of the URL endpoint. + */ + #[Api] + public string $description; + + /** + * Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. + * + * @var list $origins + */ + #[Api(list: 'string')] + public array $origins; + + /** + * Path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint). + */ + #[Api] + public string $urlPrefix; + + /** + * Configuration for third-party URL rewriting. + */ + #[Api(union: URLRewriter::class, optional: true)] + public Cloudinary|Imgix|Akamai|null $urlRewriter; + + /** + * `new URLEndpointResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * URLEndpointResponse::with( + * id: ..., description: ..., origins: ..., urlPrefix: ... + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new URLEndpointResponse) + * ->withID(...) + * ->withDescription(...) + * ->withOrigins(...) + * ->withURLPrefix(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $origins + */ + public static function with( + string $id, + string $description, + array $origins = [], + string $urlPrefix = '', + Cloudinary|Imgix|Akamai|null $urlRewriter = null, + ): self { + $obj = new self; + + $obj->id = $id; + $obj->description = $description; + $obj->origins = $origins; + $obj->urlPrefix = $urlPrefix; + + null !== $urlRewriter && $obj->urlRewriter = $urlRewriter; + + return $obj; + } + + /** + * Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * Description of the URL endpoint. + */ + public function withDescription(string $description): self + { + $obj = clone $this; + $obj->description = $description; + + return $obj; + } + + /** + * Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. + * + * @param list $origins + */ + public function withOrigins(array $origins): self + { + $obj = clone $this; + $obj->origins = $origins; + + return $obj; + } + + /** + * Path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint). + */ + public function withURLPrefix(string $urlPrefix): self + { + $obj = clone $this; + $obj->urlPrefix = $urlPrefix; + + return $obj; + } + + /** + * Configuration for third-party URL rewriting. + */ + public function withURLRewriter(Cloudinary|Imgix|Akamai $urlRewriter): self + { + $obj = clone $this; + $obj->urlRewriter = $urlRewriter; + + return $obj; + } +} diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php new file mode 100644 index 00000000..d91d8404 --- /dev/null +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php @@ -0,0 +1,38 @@ +|array + */ + public static function variants(): array + { + return [ + 'CLOUDINARY' => Cloudinary::class, + 'IMGIX' => Imgix::class, + 'AKAMAI' => Akamai::class, + ]; + } +} diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php new file mode 100644 index 00000000..0c4052c4 --- /dev/null +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php @@ -0,0 +1,36 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'AKAMAI'; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(): self + { + return new self; + } +} diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php new file mode 100644 index 00000000..137c04c0 --- /dev/null +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php @@ -0,0 +1,74 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'CLOUDINARY'; + + /** + * Whether to preserve `/` in the rewritten URL. + */ + #[Api] + public bool $preserveAssetDeliveryTypes; + + /** + * `new Cloudinary()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Cloudinary::with(preserveAssetDeliveryTypes: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Cloudinary)->withPreserveAssetDeliveryTypes(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(bool $preserveAssetDeliveryTypes = false): self + { + $obj = new self; + + $obj->preserveAssetDeliveryTypes = $preserveAssetDeliveryTypes; + + return $obj; + } + + /** + * Whether to preserve `/` in the rewritten URL. + */ + public function withPreserveAssetDeliveryTypes( + bool $preserveAssetDeliveryTypes + ): self { + $obj = clone $this; + $obj->preserveAssetDeliveryTypes = $preserveAssetDeliveryTypes; + + return $obj; + } +} diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php new file mode 100644 index 00000000..f873ae66 --- /dev/null +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php @@ -0,0 +1,36 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'IMGIX'; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(): self + { + return new self; + } +} diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php new file mode 100644 index 00000000..ff6de86b --- /dev/null +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php @@ -0,0 +1,149 @@ +update + * + * @phpstan-type url_endpoint_update_params = array{ + * description: string, + * origins?: list, + * urlPrefix?: string, + * urlRewriter?: Cloudinary|Imgix|Akamai, + * } + */ +final class URLEndpointUpdateParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * Description of the URL endpoint. + */ + #[Api] + public string $description; + + /** + * Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. + * + * @var list|null $origins + */ + #[Api(list: 'string', optional: true)] + public ?array $origins; + + /** + * Path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint). + */ + #[Api(optional: true)] + public ?string $urlPrefix; + + /** + * Configuration for third-party URL rewriting. + */ + #[Api(union: URLRewriter::class, optional: true)] + public Cloudinary|Imgix|Akamai|null $urlRewriter; + + /** + * `new URLEndpointUpdateParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * URLEndpointUpdateParams::with(description: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new URLEndpointUpdateParams)->withDescription(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $origins + */ + public static function with( + string $description, + ?array $origins = null, + ?string $urlPrefix = null, + Cloudinary|Imgix|Akamai|null $urlRewriter = null, + ): self { + $obj = new self; + + $obj->description = $description; + + null !== $origins && $obj->origins = $origins; + null !== $urlPrefix && $obj->urlPrefix = $urlPrefix; + null !== $urlRewriter && $obj->urlRewriter = $urlRewriter; + + return $obj; + } + + /** + * Description of the URL endpoint. + */ + public function withDescription(string $description): self + { + $obj = clone $this; + $obj->description = $description; + + return $obj; + } + + /** + * Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. + * + * @param list $origins + */ + public function withOrigins(array $origins): self + { + $obj = clone $this; + $obj->origins = $origins; + + return $obj; + } + + /** + * Path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint). + */ + public function withURLPrefix(string $urlPrefix): self + { + $obj = clone $this; + $obj->urlPrefix = $urlPrefix; + + return $obj; + } + + /** + * Configuration for third-party URL rewriting. + */ + public function withURLRewriter(Cloudinary|Imgix|Akamai $urlRewriter): self + { + $obj = clone $this; + $obj->urlRewriter = $urlRewriter; + + return $obj; + } +} diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php new file mode 100644 index 00000000..869e9ad8 --- /dev/null +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php @@ -0,0 +1,38 @@ +|array + */ + public static function variants(): array + { + return [ + 'CLOUDINARY' => Cloudinary::class, + 'IMGIX' => Imgix::class, + 'AKAMAI' => Akamai::class, + ]; + } +} diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php new file mode 100644 index 00000000..ade81c92 --- /dev/null +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php @@ -0,0 +1,36 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'AKAMAI'; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(): self + { + return new self; + } +} diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php new file mode 100644 index 00000000..74a44ba4 --- /dev/null +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php @@ -0,0 +1,60 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'CLOUDINARY'; + + /** + * Whether to preserve `/` in the rewritten URL. + */ + #[Api(optional: true)] + public ?bool $preserveAssetDeliveryTypes; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(?bool $preserveAssetDeliveryTypes = null): self + { + $obj = new self; + + null !== $preserveAssetDeliveryTypes && $obj->preserveAssetDeliveryTypes = $preserveAssetDeliveryTypes; + + return $obj; + } + + /** + * Whether to preserve `/` in the rewritten URL. + */ + public function withPreserveAssetDeliveryTypes( + bool $preserveAssetDeliveryTypes + ): self { + $obj = clone $this; + $obj->preserveAssetDeliveryTypes = $preserveAssetDeliveryTypes; + + return $obj; + } +} diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php new file mode 100644 index 00000000..13c3e71f --- /dev/null +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php @@ -0,0 +1,36 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'IMGIX'; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(): self + { + return new self; + } +} diff --git a/src/Accounts/Usage/UsageGetParams.php b/src/Accounts/Usage/UsageGetParams.php new file mode 100644 index 00000000..b2a3c202 --- /dev/null +++ b/src/Accounts/Usage/UsageGetParams.php @@ -0,0 +1,96 @@ +get + * + * @phpstan-type usage_get_params = array{ + * endDate: \DateTimeInterface, startDate: \DateTimeInterface + * } + */ +final class UsageGetParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * Specify a `endDate` in `YYYY-MM-DD` format. It should be after the `startDate`. The difference between `startDate` and `endDate` should be less than 90 days. + */ + #[Api] + public \DateTimeInterface $endDate; + + /** + * Specify a `startDate` in `YYYY-MM-DD` format. It should be before the `endDate`. The difference between `startDate` and `endDate` should be less than 90 days. + */ + #[Api] + public \DateTimeInterface $startDate; + + /** + * `new UsageGetParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * UsageGetParams::with(endDate: ..., startDate: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new UsageGetParams)->withEndDate(...)->withStartDate(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + \DateTimeInterface $endDate, + \DateTimeInterface $startDate + ): self { + $obj = new self; + + $obj->endDate = $endDate; + $obj->startDate = $startDate; + + return $obj; + } + + /** + * Specify a `endDate` in `YYYY-MM-DD` format. It should be after the `startDate`. The difference between `startDate` and `endDate` should be less than 90 days. + */ + public function withEndDate(\DateTimeInterface $endDate): self + { + $obj = clone $this; + $obj->endDate = $endDate; + + return $obj; + } + + /** + * Specify a `startDate` in `YYYY-MM-DD` format. It should be before the `endDate`. The difference between `startDate` and `endDate` should be less than 90 days. + */ + public function withStartDate(\DateTimeInterface $startDate): self + { + $obj = clone $this; + $obj->startDate = $startDate; + + return $obj; + } +} diff --git a/src/Accounts/Usage/UsageGetResponse.php b/src/Accounts/Usage/UsageGetResponse.php new file mode 100644 index 00000000..02fc093d --- /dev/null +++ b/src/Accounts/Usage/UsageGetResponse.php @@ -0,0 +1,140 @@ + */ + use SdkModel; + + /** + * Amount of bandwidth used in bytes. + */ + #[Api(optional: true)] + public ?int $bandwidthBytes; + + /** + * Number of extension units used. + */ + #[Api(optional: true)] + public ?int $extensionUnitsCount; + + /** + * Storage used by media library in bytes. + */ + #[Api(optional: true)] + public ?int $mediaLibraryStorageBytes; + + /** + * Storage used by the original cache in bytes. + */ + #[Api(optional: true)] + public ?int $originalCacheStorageBytes; + + /** + * Number of video processing units used. + */ + #[Api(optional: true)] + public ?int $videoProcessingUnitsCount; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + ?int $bandwidthBytes = null, + ?int $extensionUnitsCount = null, + ?int $mediaLibraryStorageBytes = null, + ?int $originalCacheStorageBytes = null, + ?int $videoProcessingUnitsCount = null, + ): self { + $obj = new self; + + null !== $bandwidthBytes && $obj->bandwidthBytes = $bandwidthBytes; + null !== $extensionUnitsCount && $obj->extensionUnitsCount = $extensionUnitsCount; + null !== $mediaLibraryStorageBytes && $obj->mediaLibraryStorageBytes = $mediaLibraryStorageBytes; + null !== $originalCacheStorageBytes && $obj->originalCacheStorageBytes = $originalCacheStorageBytes; + null !== $videoProcessingUnitsCount && $obj->videoProcessingUnitsCount = $videoProcessingUnitsCount; + + return $obj; + } + + /** + * Amount of bandwidth used in bytes. + */ + public function withBandwidthBytes(int $bandwidthBytes): self + { + $obj = clone $this; + $obj->bandwidthBytes = $bandwidthBytes; + + return $obj; + } + + /** + * Number of extension units used. + */ + public function withExtensionUnitsCount(int $extensionUnitsCount): self + { + $obj = clone $this; + $obj->extensionUnitsCount = $extensionUnitsCount; + + return $obj; + } + + /** + * Storage used by media library in bytes. + */ + public function withMediaLibraryStorageBytes( + int $mediaLibraryStorageBytes + ): self { + $obj = clone $this; + $obj->mediaLibraryStorageBytes = $mediaLibraryStorageBytes; + + return $obj; + } + + /** + * Storage used by the original cache in bytes. + */ + public function withOriginalCacheStorageBytes( + int $originalCacheStorageBytes + ): self { + $obj = clone $this; + $obj->originalCacheStorageBytes = $originalCacheStorageBytes; + + return $obj; + } + + /** + * Number of video processing units used. + */ + public function withVideoProcessingUnitsCount( + int $videoProcessingUnitsCount + ): self { + $obj = clone $this; + $obj->videoProcessingUnitsCount = $videoProcessingUnitsCount; + + return $obj; + } +} diff --git a/src/Assets/AssetListParams.php b/src/Assets/AssetListParams.php new file mode 100644 index 00000000..b24fabb4 --- /dev/null +++ b/src/Assets/AssetListParams.php @@ -0,0 +1,242 @@ +list + * + * @phpstan-type asset_list_params = array{ + * fileType?: FileType::*, + * limit?: int, + * path?: string, + * searchQuery?: string, + * skip?: int, + * sort?: Sort::*, + * type?: Type::*, + * } + */ +final class AssetListParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * Filter results by file type. + * + * - `all` — include all file types + * - `image` — include only image files + * - `non-image` — include only non-image files (e.g., JS, CSS, video) + * + * @var FileType::*|null $fileType + */ + #[Api(enum: FileType::class, optional: true)] + public ?string $fileType; + + /** + * The maximum number of results to return in response. + */ + #[Api(optional: true)] + public ?int $limit; + + /** + * Folder path if you want to limit the search within a specific folder. For example, `/sales-banner/` will only search in folder sales-banner. + * + * Note : If your use case involves searching within a folder as well as its subfolders, you can use `path` parameter in `searchQuery` with appropriate operator. + * Checkout [Supported parameters](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#supported-parameters) for more information. + */ + #[Api(optional: true)] + public ?string $path; + + /** + * Query string in a Lucene-like query language e.g. `createdAt > "7d"`. + * + * Note : When the searchQuery parameter is present, the following query parameters will have no effect on the result: + * + * 1. `tags` + * 2. `type` + * 3. `name` + * + * [Learn more](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#advanced-search-queries) from examples. + */ + #[Api(optional: true)] + public ?string $searchQuery; + + /** + * The number of results to skip before returning results. + */ + #[Api(optional: true)] + public ?int $skip; + + /** + * Sort the results by one of the supported fields in ascending or descending order. + * + * @var Sort::*|null $sort + */ + #[Api(enum: Sort::class, optional: true)] + public ?string $sort; + + /** + * Filter results by asset type. + * + * - `file` — returns only files + * - `file-version` — returns specific file versions + * - `folder` — returns only folders + * - `all` — returns both files and folders (excludes `file-version`) + * + * @var Type::*|null $type + */ + #[Api(enum: Type::class, optional: true)] + public ?string $type; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param FileType::* $fileType + * @param Sort::* $sort + * @param Type::* $type + */ + public static function with( + ?string $fileType = null, + ?int $limit = null, + ?string $path = null, + ?string $searchQuery = null, + ?int $skip = null, + ?string $sort = null, + ?string $type = null, + ): self { + $obj = new self; + + null !== $fileType && $obj->fileType = $fileType; + null !== $limit && $obj->limit = $limit; + null !== $path && $obj->path = $path; + null !== $searchQuery && $obj->searchQuery = $searchQuery; + null !== $skip && $obj->skip = $skip; + null !== $sort && $obj->sort = $sort; + null !== $type && $obj->type = $type; + + return $obj; + } + + /** + * Filter results by file type. + * + * - `all` — include all file types + * - `image` — include only image files + * - `non-image` — include only non-image files (e.g., JS, CSS, video) + * + * @param FileType::* $fileType + */ + public function withFileType(string $fileType): self + { + $obj = clone $this; + $obj->fileType = $fileType; + + return $obj; + } + + /** + * The maximum number of results to return in response. + */ + public function withLimit(int $limit): self + { + $obj = clone $this; + $obj->limit = $limit; + + return $obj; + } + + /** + * Folder path if you want to limit the search within a specific folder. For example, `/sales-banner/` will only search in folder sales-banner. + * + * Note : If your use case involves searching within a folder as well as its subfolders, you can use `path` parameter in `searchQuery` with appropriate operator. + * Checkout [Supported parameters](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#supported-parameters) for more information. + */ + public function withPath(string $path): self + { + $obj = clone $this; + $obj->path = $path; + + return $obj; + } + + /** + * Query string in a Lucene-like query language e.g. `createdAt > "7d"`. + * + * Note : When the searchQuery parameter is present, the following query parameters will have no effect on the result: + * + * 1. `tags` + * 2. `type` + * 3. `name` + * + * [Learn more](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#advanced-search-queries) from examples. + */ + public function withSearchQuery(string $searchQuery): self + { + $obj = clone $this; + $obj->searchQuery = $searchQuery; + + return $obj; + } + + /** + * The number of results to skip before returning results. + */ + public function withSkip(int $skip): self + { + $obj = clone $this; + $obj->skip = $skip; + + return $obj; + } + + /** + * Sort the results by one of the supported fields in ascending or descending order. + * + * @param Sort::* $sort + */ + public function withSort(string $sort): self + { + $obj = clone $this; + $obj->sort = $sort; + + return $obj; + } + + /** + * Filter results by asset type. + * + * - `file` — returns only files + * - `file-version` — returns specific file versions + * - `folder` — returns only folders + * - `all` — returns both files and folders (excludes `file-version`) + * + * @param Type::* $type + */ + public function withType(string $type): self + { + $obj = clone $this; + $obj->type = $type; + + return $obj; + } +} diff --git a/src/Assets/AssetListParams/FileType.php b/src/Assets/AssetListParams/FileType.php new file mode 100644 index 00000000..65c88ef3 --- /dev/null +++ b/src/Assets/AssetListParams/FileType.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return [File::class, 'folder' => Folder::class]; + } +} diff --git a/src/BaseOverlay.php b/src/BaseOverlay.php new file mode 100644 index 00000000..3dd79187 --- /dev/null +++ b/src/BaseOverlay.php @@ -0,0 +1,64 @@ + */ + use SdkModel; + + #[Api(optional: true)] + public ?OverlayPosition $position; + + #[Api(optional: true)] + public ?OverlayTiming $timing; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + ?OverlayPosition $position = null, + ?OverlayTiming $timing = null + ): self { + $obj = new self; + + null !== $position && $obj->position = $position; + null !== $timing && $obj->timing = $timing; + + return $obj; + } + + public function withPosition(OverlayPosition $position): self + { + $obj = clone $this; + $obj->position = $position; + + return $obj; + } + + public function withTiming(OverlayTiming $timing): self + { + $obj = clone $this; + $obj->timing = $timing; + + return $obj; + } +} diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php new file mode 100644 index 00000000..cd83a4c0 --- /dev/null +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -0,0 +1,571 @@ +upload + * + * @phpstan-type file_upload_params = array{ + * file: string, + * fileName: string, + * token?: string, + * checks?: string, + * customCoordinates?: string, + * customMetadata?: array, + * description?: string, + * extensions?: list, + * folder?: string, + * isPrivateFile?: bool, + * isPublished?: bool, + * overwriteAITags?: bool, + * overwriteCustomMetadata?: bool, + * overwriteFile?: bool, + * overwriteTags?: bool, + * responseFields?: list, + * tags?: list, + * transformation?: Transformation, + * useUniqueFileName?: bool, + * webhookURL?: string, + * } + */ +final class FileUploadParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * The API accepts any of the following: + * + * - **Binary data** – send the raw bytes as `multipart/form-data`. + * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. + * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. + * + * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + */ + #[Api] + public string $file; + + /** + * The name with which the file has to be uploaded. + */ + #[Api] + public string $fileName; + + /** + * This is the client-generated JSON Web Token (JWT). The ImageKit.io server uses it to authenticate and check that the upload request parameters have not been tampered with after the token has been generated. Learn how to create the token on the page below. This field is only required for authentication when uploading a file from the client side. + * + * **Note**: Sending a JWT that has been used in the past will result in a validation error. Even if your previous request resulted in an error, you should always send a new token. + * + * + * **⚠️Warning**: JWT must be generated on the server-side because it is generated using your account's private API key. This field is required for authentication when uploading a file from the client-side. + */ + #[Api(optional: true)] + public ?string $token; + + /** + * Server-side checks to run on the asset. + * Read more about [Upload API checks](/docs/api-reference/upload-file/upload-file-v2#upload-api-checks). + */ + #[Api(optional: true)] + public ?string $checks; + + /** + * Define an important area in the image. This is only relevant for image type files. + * + * - To be passed as a string with the x and y coordinates of the top-left corner, and width and height of the area of interest in the format `x,y,width,height`. For example - `10,10,100,100` + * - Can be used with fo-customtransformation. + * - If this field is not specified and the file is overwritten, then customCoordinates will be removed. + */ + #[Api(optional: true)] + public ?string $customCoordinates; + + /** + * JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. + * + * @var array|null $customMetadata + */ + #[Api(map: 'mixed', optional: true)] + public ?array $customMetadata; + + /** + * Optional text to describe the contents of the file. + */ + #[Api(optional: true)] + public ?string $description; + + /** + * Array of extensions to be applied to the image. Each extension can be configured with specific parameters based on the extension type. + * + * @var list|null $extensions + */ + #[Api(list: Extension::class, optional: true)] + public ?array $extensions; + + /** + * The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. Using multiple `/` creates a nested folder. + */ + #[Api(optional: true)] + public ?string $folder; + + /** + * Whether to mark the file as private or not. + * + * If `true`, the file is marked as private and is accessible only using named transformation or signed URL. + */ + #[Api(optional: true)] + public ?bool $isPrivateFile; + + /** + * Whether to upload file as published or not. + * + * If `false`, the file is marked as unpublished, which restricts access to the file only via the media library. Files in draft or unpublished state can only be publicly accessed after being published. + * + * The option to upload in draft state is only available in custom enterprise pricing plans. + */ + #[Api(optional: true)] + public ?bool $isPublished; + + /** + * If set to `true` and a file already exists at the exact location, its AITags will be removed. Set `overwriteAITags` to `false` to preserve AITags. + */ + #[Api(optional: true)] + public ?bool $overwriteAITags; + + /** + * If the request does not have `customMetadata`, and a file already exists at the exact location, existing customMetadata will be removed. + */ + #[Api(optional: true)] + public ?bool $overwriteCustomMetadata; + + /** + * If `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately. + */ + #[Api(optional: true)] + public ?bool $overwriteFile; + + /** + * If the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed. + */ + #[Api(optional: true)] + public ?bool $overwriteTags; + + /** + * Array of response field keys to include in the API response body. + * + * @var list|null $responseFields + */ + #[Api(list: ResponseField::class, optional: true)] + public ?array $responseFields; + + /** + * Set the tags while uploading the file. + * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. + * If this field is not specified and the file is overwritten, the existing tags will be removed. + * + * @var list|null $tags + */ + #[Api(list: 'string', optional: true)] + public ?array $tags; + + /** + * Configure pre-processing (`pre`) and post-processing (`post`) transformations. + * + * - `pre` — applied before the file is uploaded to the Media Library. + * Useful for reducing file size or applying basic optimizations upfront (e.g., resize, compress). + * + * - `post` — applied immediately after upload. + * Ideal for generating transformed versions (like video encodes or thumbnails) in advance, so they're ready for delivery without delay. + * + * You can mix and match any combination of post-processing types. + */ + #[Api(optional: true)] + public ?Transformation $transformation; + + /** + * Whether to use a unique filename for this file or not. + * + * If `true`, ImageKit.io will add a unique suffix to the filename parameter to get a unique filename. + * + * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. + */ + #[Api(optional: true)] + public ?bool $useUniqueFileName; + + /** + * The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + */ + #[Api('webhookUrl', optional: true)] + public ?string $webhookURL; + + /** + * `new FileUploadParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * FileUploadParams::with(file: ..., fileName: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new FileUploadParams)->withFile(...)->withFileName(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param array $customMetadata + * @param list $extensions + * @param list $responseFields + * @param list $tags + */ + public static function with( + string $file, + string $fileName, + ?string $token = null, + ?string $checks = null, + ?string $customCoordinates = null, + ?array $customMetadata = null, + ?string $description = null, + ?array $extensions = null, + ?string $folder = null, + ?bool $isPrivateFile = null, + ?bool $isPublished = null, + ?bool $overwriteAITags = null, + ?bool $overwriteCustomMetadata = null, + ?bool $overwriteFile = null, + ?bool $overwriteTags = null, + ?array $responseFields = null, + ?array $tags = null, + ?Transformation $transformation = null, + ?bool $useUniqueFileName = null, + ?string $webhookURL = null, + ): self { + $obj = new self; + + $obj->file = $file; + $obj->fileName = $fileName; + + null !== $token && $obj->token = $token; + null !== $checks && $obj->checks = $checks; + null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; + null !== $customMetadata && $obj->customMetadata = $customMetadata; + null !== $description && $obj->description = $description; + null !== $extensions && $obj->extensions = $extensions; + null !== $folder && $obj->folder = $folder; + null !== $isPrivateFile && $obj->isPrivateFile = $isPrivateFile; + null !== $isPublished && $obj->isPublished = $isPublished; + null !== $overwriteAITags && $obj->overwriteAITags = $overwriteAITags; + null !== $overwriteCustomMetadata && $obj->overwriteCustomMetadata = $overwriteCustomMetadata; + null !== $overwriteFile && $obj->overwriteFile = $overwriteFile; + null !== $overwriteTags && $obj->overwriteTags = $overwriteTags; + null !== $responseFields && $obj->responseFields = $responseFields; + null !== $tags && $obj->tags = $tags; + null !== $transformation && $obj->transformation = $transformation; + null !== $useUniqueFileName && $obj->useUniqueFileName = $useUniqueFileName; + null !== $webhookURL && $obj->webhookURL = $webhookURL; + + return $obj; + } + + /** + * The API accepts any of the following: + * + * - **Binary data** – send the raw bytes as `multipart/form-data`. + * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. + * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. + * + * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + */ + public function withFile(string $file): self + { + $obj = clone $this; + $obj->file = $file; + + return $obj; + } + + /** + * The name with which the file has to be uploaded. + */ + public function withFileName(string $fileName): self + { + $obj = clone $this; + $obj->fileName = $fileName; + + return $obj; + } + + /** + * This is the client-generated JSON Web Token (JWT). The ImageKit.io server uses it to authenticate and check that the upload request parameters have not been tampered with after the token has been generated. Learn how to create the token on the page below. This field is only required for authentication when uploading a file from the client side. + * + * **Note**: Sending a JWT that has been used in the past will result in a validation error. Even if your previous request resulted in an error, you should always send a new token. + * + * + * **⚠️Warning**: JWT must be generated on the server-side because it is generated using your account's private API key. This field is required for authentication when uploading a file from the client-side. + */ + public function withToken(string $token): self + { + $obj = clone $this; + $obj->token = $token; + + return $obj; + } + + /** + * Server-side checks to run on the asset. + * Read more about [Upload API checks](/docs/api-reference/upload-file/upload-file-v2#upload-api-checks). + */ + public function withChecks(string $checks): self + { + $obj = clone $this; + $obj->checks = $checks; + + return $obj; + } + + /** + * Define an important area in the image. This is only relevant for image type files. + * + * - To be passed as a string with the x and y coordinates of the top-left corner, and width and height of the area of interest in the format `x,y,width,height`. For example - `10,10,100,100` + * - Can be used with fo-customtransformation. + * - If this field is not specified and the file is overwritten, then customCoordinates will be removed. + */ + public function withCustomCoordinates(string $customCoordinates): self + { + $obj = clone $this; + $obj->customCoordinates = $customCoordinates; + + return $obj; + } + + /** + * JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. + * + * @param array $customMetadata + */ + public function withCustomMetadata(array $customMetadata): self + { + $obj = clone $this; + $obj->customMetadata = $customMetadata; + + return $obj; + } + + /** + * Optional text to describe the contents of the file. + */ + public function withDescription(string $description): self + { + $obj = clone $this; + $obj->description = $description; + + return $obj; + } + + /** + * Array of extensions to be applied to the image. Each extension can be configured with specific parameters based on the extension type. + * + * @param list $extensions + */ + public function withExtensions(array $extensions): self + { + $obj = clone $this; + $obj->extensions = $extensions; + + return $obj; + } + + /** + * The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. Using multiple `/` creates a nested folder. + */ + public function withFolder(string $folder): self + { + $obj = clone $this; + $obj->folder = $folder; + + return $obj; + } + + /** + * Whether to mark the file as private or not. + * + * If `true`, the file is marked as private and is accessible only using named transformation or signed URL. + */ + public function withIsPrivateFile(bool $isPrivateFile): self + { + $obj = clone $this; + $obj->isPrivateFile = $isPrivateFile; + + return $obj; + } + + /** + * Whether to upload file as published or not. + * + * If `false`, the file is marked as unpublished, which restricts access to the file only via the media library. Files in draft or unpublished state can only be publicly accessed after being published. + * + * The option to upload in draft state is only available in custom enterprise pricing plans. + */ + public function withIsPublished(bool $isPublished): self + { + $obj = clone $this; + $obj->isPublished = $isPublished; + + return $obj; + } + + /** + * If set to `true` and a file already exists at the exact location, its AITags will be removed. Set `overwriteAITags` to `false` to preserve AITags. + */ + public function withOverwriteAITags(bool $overwriteAITags): self + { + $obj = clone $this; + $obj->overwriteAITags = $overwriteAITags; + + return $obj; + } + + /** + * If the request does not have `customMetadata`, and a file already exists at the exact location, existing customMetadata will be removed. + */ + public function withOverwriteCustomMetadata( + bool $overwriteCustomMetadata + ): self { + $obj = clone $this; + $obj->overwriteCustomMetadata = $overwriteCustomMetadata; + + return $obj; + } + + /** + * If `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately. + */ + public function withOverwriteFile(bool $overwriteFile): self + { + $obj = clone $this; + $obj->overwriteFile = $overwriteFile; + + return $obj; + } + + /** + * If the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed. + */ + public function withOverwriteTags(bool $overwriteTags): self + { + $obj = clone $this; + $obj->overwriteTags = $overwriteTags; + + return $obj; + } + + /** + * Array of response field keys to include in the API response body. + * + * @param list $responseFields + */ + public function withResponseFields(array $responseFields): self + { + $obj = clone $this; + $obj->responseFields = $responseFields; + + return $obj; + } + + /** + * Set the tags while uploading the file. + * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. + * If this field is not specified and the file is overwritten, the existing tags will be removed. + * + * @param list $tags + */ + public function withTags(array $tags): self + { + $obj = clone $this; + $obj->tags = $tags; + + return $obj; + } + + /** + * Configure pre-processing (`pre`) and post-processing (`post`) transformations. + * + * - `pre` — applied before the file is uploaded to the Media Library. + * Useful for reducing file size or applying basic optimizations upfront (e.g., resize, compress). + * + * - `post` — applied immediately after upload. + * Ideal for generating transformed versions (like video encodes or thumbnails) in advance, so they're ready for delivery without delay. + * + * You can mix and match any combination of post-processing types. + */ + public function withTransformation(Transformation $transformation): self + { + $obj = clone $this; + $obj->transformation = $transformation; + + return $obj; + } + + /** + * Whether to use a unique filename for this file or not. + * + * If `true`, ImageKit.io will add a unique suffix to the filename parameter to get a unique filename. + * + * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. + */ + public function withUseUniqueFileName(bool $useUniqueFileName): self + { + $obj = clone $this; + $obj->useUniqueFileName = $useUniqueFileName; + + return $obj; + } + + /** + * The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + */ + public function withWebhookURL(string $webhookURL): self + { + $obj = clone $this; + $obj->webhookURL = $webhookURL; + + return $obj; + } +} diff --git a/src/Beta/V2/Files/FileUploadParams/Extension.php b/src/Beta/V2/Files/FileUploadParams/Extension.php new file mode 100644 index 00000000..fa3874f8 --- /dev/null +++ b/src/Beta/V2/Files/FileUploadParams/Extension.php @@ -0,0 +1,35 @@ +|array + */ + public static function variants(): array + { + return [ + AutoTaggingExtension::class, + 'remove-bg' => RemoveBg::class, + 'ai-auto-description' => AIAutoDescription::class, + ]; + } +} diff --git a/src/Beta/V2/Files/FileUploadParams/Extension/AIAutoDescription.php b/src/Beta/V2/Files/FileUploadParams/Extension/AIAutoDescription.php new file mode 100644 index 00000000..0f4d8b65 --- /dev/null +++ b/src/Beta/V2/Files/FileUploadParams/Extension/AIAutoDescription.php @@ -0,0 +1,39 @@ + */ + use SdkModel; + + /** + * Specifies the auto description extension. + */ + #[Api] + public string $name = 'ai-auto-description'; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(): self + { + return new self; + } +} diff --git a/src/Beta/V2/Files/FileUploadParams/Extension/AutoTaggingExtension.php b/src/Beta/V2/Files/FileUploadParams/Extension/AutoTaggingExtension.php new file mode 100644 index 00000000..2d9ba10c --- /dev/null +++ b/src/Beta/V2/Files/FileUploadParams/Extension/AutoTaggingExtension.php @@ -0,0 +1,119 @@ + */ + use SdkModel; + + /** + * Maximum number of tags to attach to the asset. + */ + #[Api] + public int $maxTags; + + /** + * Minimum confidence level for tags to be considered valid. + */ + #[Api] + public int $minConfidence; + + /** + * Specifies the auto-tagging extension used. + * + * @var Name::* $name + */ + #[Api(enum: Name::class)] + public string $name; + + /** + * `new AutoTaggingExtension()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AutoTaggingExtension::with(maxTags: ..., minConfidence: ..., name: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AutoTaggingExtension) + * ->withMaxTags(...) + * ->withMinConfidence(...) + * ->withName(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Name::* $name + */ + public static function with( + int $maxTags, + int $minConfidence, + string $name + ): self { + $obj = new self; + + $obj->maxTags = $maxTags; + $obj->minConfidence = $minConfidence; + $obj->name = $name; + + return $obj; + } + + /** + * Maximum number of tags to attach to the asset. + */ + public function withMaxTags(int $maxTags): self + { + $obj = clone $this; + $obj->maxTags = $maxTags; + + return $obj; + } + + /** + * Minimum confidence level for tags to be considered valid. + */ + public function withMinConfidence(int $minConfidence): self + { + $obj = clone $this; + $obj->minConfidence = $minConfidence; + + return $obj; + } + + /** + * Specifies the auto-tagging extension used. + * + * @param Name::* $name + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } +} diff --git a/src/Beta/V2/Files/FileUploadParams/Extension/AutoTaggingExtension/Name.php b/src/Beta/V2/Files/FileUploadParams/Extension/AutoTaggingExtension/Name.php new file mode 100644 index 00000000..7ad64d68 --- /dev/null +++ b/src/Beta/V2/Files/FileUploadParams/Extension/AutoTaggingExtension/Name.php @@ -0,0 +1,20 @@ + */ + use SdkModel; + + /** + * Specifies the background removal extension. + */ + #[Api] + public string $name = 'remove-bg'; + + #[Api(optional: true)] + public ?Options $options; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(?Options $options = null): self + { + $obj = new self; + + null !== $options && $obj->options = $options; + + return $obj; + } + + public function withOptions(Options $options): self + { + $obj = clone $this; + $obj->options = $options; + + return $obj; + } +} diff --git a/src/Beta/V2/Files/FileUploadParams/Extension/RemoveBg/Options.php b/src/Beta/V2/Files/FileUploadParams/Extension/RemoveBg/Options.php new file mode 100644 index 00000000..94bf0352 --- /dev/null +++ b/src/Beta/V2/Files/FileUploadParams/Extension/RemoveBg/Options.php @@ -0,0 +1,117 @@ + */ + use SdkModel; + + /** + * Whether to add an artificial shadow to the result. Default is false. Note: Adding shadows is currently only supported for car photos. + */ + #[Api('add_shadow', optional: true)] + public ?bool $addShadow; + + /** + * Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or color name (e.g., "green"). If this parameter is set, `bg_image_url` must be empty. + */ + #[Api('bg_color', optional: true)] + public ?string $bgColor; + + /** + * Sets a background image from a URL. If this parameter is set, `bg_color` must be empty. + */ + #[Api('bg_image_url', optional: true)] + public ?string $bgImageURL; + + /** + * Allows semi-transparent regions in the result. Default is true. Note: Semitransparency is currently only supported for car windows. + */ + #[Api(optional: true)] + public ?bool $semitransparency; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + ?bool $addShadow = null, + ?string $bgColor = null, + ?string $bgImageURL = null, + ?bool $semitransparency = null, + ): self { + $obj = new self; + + null !== $addShadow && $obj->addShadow = $addShadow; + null !== $bgColor && $obj->bgColor = $bgColor; + null !== $bgImageURL && $obj->bgImageURL = $bgImageURL; + null !== $semitransparency && $obj->semitransparency = $semitransparency; + + return $obj; + } + + /** + * Whether to add an artificial shadow to the result. Default is false. Note: Adding shadows is currently only supported for car photos. + */ + public function withAddShadow(bool $addShadow): self + { + $obj = clone $this; + $obj->addShadow = $addShadow; + + return $obj; + } + + /** + * Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or color name (e.g., "green"). If this parameter is set, `bg_image_url` must be empty. + */ + public function withBgColor(string $bgColor): self + { + $obj = clone $this; + $obj->bgColor = $bgColor; + + return $obj; + } + + /** + * Sets a background image from a URL. If this parameter is set, `bg_color` must be empty. + */ + public function withBgImageURL(string $bgImageURL): self + { + $obj = clone $this; + $obj->bgImageURL = $bgImageURL; + + return $obj; + } + + /** + * Allows semi-transparent regions in the result. Default is true. Note: Semitransparency is currently only supported for car windows. + */ + public function withSemitransparency(bool $semitransparency): self + { + $obj = clone $this; + $obj->semitransparency = $semitransparency; + + return $obj; + } +} diff --git a/src/Beta/V2/Files/FileUploadParams/ResponseField.php b/src/Beta/V2/Files/FileUploadParams/ResponseField.php new file mode 100644 index 00000000..19cd2bcd --- /dev/null +++ b/src/Beta/V2/Files/FileUploadParams/ResponseField.php @@ -0,0 +1,27 @@ +|null, pre?: string|null + * } + */ +final class Transformation implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * List of transformations to apply *after* the file is uploaded. + * Each item must match one of the following types: + * `transformation`, `gif-to-video`, `thumbnail`, `abs`. + * + * @var list|null $post + */ + #[Api(list: Post::class, optional: true)] + public ?array $post; + + /** + * Transformation string to apply before uploading the file to the Media Library. Useful for optimizing files at ingestion. + */ + #[Api(optional: true)] + public ?string $pre; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $post + */ + public static function with(?array $post = null, ?string $pre = null): self + { + $obj = new self; + + null !== $post && $obj->post = $post; + null !== $pre && $obj->pre = $pre; + + return $obj; + } + + /** + * List of transformations to apply *after* the file is uploaded. + * Each item must match one of the following types: + * `transformation`, `gif-to-video`, `thumbnail`, `abs`. + * + * @param list $post + */ + public function withPost(array $post): self + { + $obj = clone $this; + $obj->post = $post; + + return $obj; + } + + /** + * Transformation string to apply before uploading the file to the Media Library. Useful for optimizing files at ingestion. + */ + public function withPre(string $pre): self + { + $obj = clone $this; + $obj->pre = $pre; + + return $obj; + } +} diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php new file mode 100644 index 00000000..41763187 --- /dev/null +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php @@ -0,0 +1,37 @@ +|array + */ + public static function variants(): array + { + return [ + 'transformation' => Transformation::class, + 'gif-to-video' => GifToVideo::class, + 'thumbnail' => Thumbnail::class, + 'abs' => Abs::class, + ]; + } +} diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php new file mode 100644 index 00000000..5e1747c1 --- /dev/null +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php @@ -0,0 +1,101 @@ + */ + use SdkModel; + + /** + * Adaptive Bitrate Streaming (ABS) setup. + */ + #[Api] + public string $type = 'abs'; + + /** + * Streaming protocol to use (`hls` or `dash`). + * + * @var Protocol::* $protocol + */ + #[Api(enum: Protocol::class)] + public string $protocol; + + /** + * List of different representations you want to create separated by an underscore. + */ + #[Api] + public string $value; + + /** + * `new Abs()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Abs::with(protocol: ..., value: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Abs)->withProtocol(...)->withValue(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Protocol::* $protocol + */ + public static function with(string $protocol, string $value): self + { + $obj = new self; + + $obj->protocol = $protocol; + $obj->value = $value; + + return $obj; + } + + /** + * Streaming protocol to use (`hls` or `dash`). + * + * @param Protocol::* $protocol + */ + public function withProtocol(string $protocol): self + { + $obj = clone $this; + $obj->protocol = $protocol; + + return $obj; + } + + /** + * List of different representations you want to create separated by an underscore. + */ + public function withValue(string $value): self + { + $obj = clone $this; + $obj->value = $value; + + return $obj; + } +} diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php new file mode 100644 index 00000000..2220d490 --- /dev/null +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php @@ -0,0 +1,20 @@ + */ + use SdkModel; + + /** + * Converts an animated GIF into an MP4. + */ + #[Api] + public string $type = 'gif-to-video'; + + /** + * Optional transformation string to apply to the output video. + * **Example**: `q-80`. + */ + #[Api(optional: true)] + public ?string $value; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(?string $value = null): self + { + $obj = new self; + + null !== $value && $obj->value = $value; + + return $obj; + } + + /** + * Optional transformation string to apply to the output video. + * **Example**: `q-80`. + */ + public function withValue(string $value): self + { + $obj = clone $this; + $obj->value = $value; + + return $obj; + } +} diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php new file mode 100644 index 00000000..ca978f5f --- /dev/null +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php @@ -0,0 +1,62 @@ + */ + use SdkModel; + + /** + * Generates a thumbnail image. + */ + #[Api] + public string $type = 'thumbnail'; + + /** + * Optional transformation string. + * **Example**: `w-150,h-150`. + */ + #[Api(optional: true)] + public ?string $value; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(?string $value = null): self + { + $obj = new self; + + null !== $value && $obj->value = $value; + + return $obj; + } + + /** + * Optional transformation string. + * **Example**: `w-150,h-150`. + */ + public function withValue(string $value): self + { + $obj = clone $this; + $obj->value = $value; + + return $obj; + } +} diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php new file mode 100644 index 00000000..498c6597 --- /dev/null +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php @@ -0,0 +1,76 @@ + */ + use SdkModel; + + /** + * Transformation type. + */ + #[Api] + public string $type = 'transformation'; + + /** + * Transformation string (e.g. `w-200,h-200`). + * Same syntax as ImageKit URL-based transformations. + */ + #[Api] + public string $value; + + /** + * `new Transformation()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Transformation::with(value: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Transformation)->withValue(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $value): self + { + $obj = new self; + + $obj->value = $value; + + return $obj; + } + + /** + * Transformation string (e.g. `w-200,h-200`). + * Same syntax as ImageKit URL-based transformations. + */ + public function withValue(string $value): self + { + $obj = clone $this; + $obj->value = $value; + + return $obj; + } +} diff --git a/src/Beta/V2/Files/FileUploadResponse.php b/src/Beta/V2/Files/FileUploadResponse.php new file mode 100644 index 00000000..7ae8aedc --- /dev/null +++ b/src/Beta/V2/Files/FileUploadResponse.php @@ -0,0 +1,556 @@ +|null, + * audioCodec?: string|null, + * bitRate?: int|null, + * customCoordinates?: string|null, + * customMetadata?: array|null, + * description?: string|null, + * duration?: int|null, + * embeddedMetadata?: array|null, + * extensionStatus?: ExtensionStatus|null, + * fileID?: string|null, + * filePath?: string|null, + * fileType?: string|null, + * height?: float|null, + * isPrivateFile?: bool|null, + * isPublished?: bool|null, + * metadata?: Metadata|null, + * name?: string|null, + * size?: float|null, + * tags?: list|null, + * thumbnailURL?: string|null, + * url?: string|null, + * versionInfo?: VersionInfo|null, + * videoCodec?: string|null, + * width?: float|null, + * } + */ +final class FileUploadResponse implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * An array of tags assigned to the uploaded file by auto tagging. + * + * @var list|null $aiTags + */ + #[Api('AITags', list: AITag::class, nullable: true, optional: true)] + public ?array $aiTags; + + /** + * The audio codec used in the video (only for video). + */ + #[Api(optional: true)] + public ?string $audioCodec; + + /** + * The bit rate of the video in kbps (only for video). + */ + #[Api(optional: true)] + public ?int $bitRate; + + /** + * Value of custom coordinates associated with the image in the format `x,y,width,height`. If `customCoordinates` are not defined, then it is `null`. Send `customCoordinates` in `responseFields` in API request to get the value of this field. + */ + #[Api(nullable: true, optional: true)] + public ?string $customCoordinates; + + /** + * A key-value data associated with the asset. Use `responseField` in API request to get `customMetadata` in the upload API response. Before setting any custom metadata on an asset, you have to create the field using custom metadata fields API. Send `customMetadata` in `responseFields` in API request to get the value of this field. + * + * @var array|null $customMetadata + */ + #[Api(map: 'mixed', optional: true)] + public ?array $customMetadata; + + /** + * Optional text to describe the contents of the file. Can be set by the user or the ai-auto-description extension. + */ + #[Api(optional: true)] + public ?string $description; + + /** + * The duration of the video in seconds (only for video). + */ + #[Api(optional: true)] + public ?int $duration; + + /** + * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. Send `embeddedMetadata` in `responseFields` in API request to get embeddedMetadata in the upload API response. + * + * @var array|null $embeddedMetadata + */ + #[Api(map: 'mixed', optional: true)] + public ?array $embeddedMetadata; + + /** + * Extension names with their processing status at the time of completion of the request. It could have one of the following status values: + * + * `success`: The extension has been successfully applied. + * `failed`: The extension has failed and will not be retried. + * `pending`: The extension will finish processing in some time. On completion, the final status (success / failed) will be sent to the `webhookUrl` provided. + * + * If no extension was requested, then this parameter is not returned. + */ + #[Api(optional: true)] + public ?ExtensionStatus $extensionStatus; + + /** + * Unique fileId. Store this fileld in your database, as this will be used to perform update action on this file. + */ + #[Api('fileId', optional: true)] + public ?string $fileID; + + /** + * The relative path of the file in the media library e.g. `/marketing-assets/new-banner.jpg`. + */ + #[Api(optional: true)] + public ?string $filePath; + + /** + * Type of the uploaded file. Possible values are `image`, `non-image`. + */ + #[Api(optional: true)] + public ?string $fileType; + + /** + * Height of the image in pixels (Only for images). + */ + #[Api(optional: true)] + public ?float $height; + + /** + * Is the file marked as private. It can be either `true` or `false`. Send `isPrivateFile` in `responseFields` in API request to get the value of this field. + */ + #[Api(optional: true)] + public ?bool $isPrivateFile; + + /** + * Is the file published or in draft state. It can be either `true` or `false`. Send `isPublished` in `responseFields` in API request to get the value of this field. + */ + #[Api(optional: true)] + public ?bool $isPublished; + + /** + * Legacy metadata. Send `metadata` in `responseFields` in API request to get metadata in the upload API response. + */ + #[Api(optional: true)] + public ?Metadata $metadata; + + /** + * Name of the asset. + */ + #[Api(optional: true)] + public ?string $name; + + /** + * Size of the image file in Bytes. + */ + #[Api(optional: true)] + public ?float $size; + + /** + * The array of tags associated with the asset. If no tags are set, it will be `null`. Send `tags` in `responseFields` in API request to get the value of this field. + * + * @var list|null $tags + */ + #[Api(list: 'string', nullable: true, optional: true)] + public ?array $tags; + + /** + * In the case of an image, a small thumbnail URL. + */ + #[Api('thumbnailUrl', optional: true)] + public ?string $thumbnailURL; + + /** + * A publicly accessible URL of the file. + */ + #[Api(optional: true)] + public ?string $url; + + /** + * An object containing the file or file version's `id` (versionId) and `name`. + */ + #[Api(optional: true)] + public ?VersionInfo $versionInfo; + + /** + * The video codec used in the video (only for video). + */ + #[Api(optional: true)] + public ?string $videoCodec; + + /** + * Width of the image in pixels (Only for Images). + */ + #[Api(optional: true)] + public ?float $width; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list|null $aiTags + * @param array $customMetadata + * @param array $embeddedMetadata + * @param list|null $tags + */ + public static function with( + ?array $aiTags = null, + ?string $audioCodec = null, + ?int $bitRate = null, + ?string $customCoordinates = null, + ?array $customMetadata = null, + ?string $description = null, + ?int $duration = null, + ?array $embeddedMetadata = null, + ?ExtensionStatus $extensionStatus = null, + ?string $fileID = null, + ?string $filePath = null, + ?string $fileType = null, + ?float $height = null, + ?bool $isPrivateFile = null, + ?bool $isPublished = null, + ?Metadata $metadata = null, + ?string $name = null, + ?float $size = null, + ?array $tags = null, + ?string $thumbnailURL = null, + ?string $url = null, + ?VersionInfo $versionInfo = null, + ?string $videoCodec = null, + ?float $width = null, + ): self { + $obj = new self; + + null !== $aiTags && $obj->aiTags = $aiTags; + null !== $audioCodec && $obj->audioCodec = $audioCodec; + null !== $bitRate && $obj->bitRate = $bitRate; + null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; + null !== $customMetadata && $obj->customMetadata = $customMetadata; + null !== $description && $obj->description = $description; + null !== $duration && $obj->duration = $duration; + null !== $embeddedMetadata && $obj->embeddedMetadata = $embeddedMetadata; + null !== $extensionStatus && $obj->extensionStatus = $extensionStatus; + null !== $fileID && $obj->fileID = $fileID; + null !== $filePath && $obj->filePath = $filePath; + null !== $fileType && $obj->fileType = $fileType; + null !== $height && $obj->height = $height; + null !== $isPrivateFile && $obj->isPrivateFile = $isPrivateFile; + null !== $isPublished && $obj->isPublished = $isPublished; + null !== $metadata && $obj->metadata = $metadata; + null !== $name && $obj->name = $name; + null !== $size && $obj->size = $size; + null !== $tags && $obj->tags = $tags; + null !== $thumbnailURL && $obj->thumbnailURL = $thumbnailURL; + null !== $url && $obj->url = $url; + null !== $versionInfo && $obj->versionInfo = $versionInfo; + null !== $videoCodec && $obj->videoCodec = $videoCodec; + null !== $width && $obj->width = $width; + + return $obj; + } + + /** + * An array of tags assigned to the uploaded file by auto tagging. + * + * @param list|null $aiTags + */ + public function withAITags(?array $aiTags): self + { + $obj = clone $this; + $obj->aiTags = $aiTags; + + return $obj; + } + + /** + * The audio codec used in the video (only for video). + */ + public function withAudioCodec(string $audioCodec): self + { + $obj = clone $this; + $obj->audioCodec = $audioCodec; + + return $obj; + } + + /** + * The bit rate of the video in kbps (only for video). + */ + public function withBitRate(int $bitRate): self + { + $obj = clone $this; + $obj->bitRate = $bitRate; + + return $obj; + } + + /** + * Value of custom coordinates associated with the image in the format `x,y,width,height`. If `customCoordinates` are not defined, then it is `null`. Send `customCoordinates` in `responseFields` in API request to get the value of this field. + */ + public function withCustomCoordinates(?string $customCoordinates): self + { + $obj = clone $this; + $obj->customCoordinates = $customCoordinates; + + return $obj; + } + + /** + * A key-value data associated with the asset. Use `responseField` in API request to get `customMetadata` in the upload API response. Before setting any custom metadata on an asset, you have to create the field using custom metadata fields API. Send `customMetadata` in `responseFields` in API request to get the value of this field. + * + * @param array $customMetadata + */ + public function withCustomMetadata(array $customMetadata): self + { + $obj = clone $this; + $obj->customMetadata = $customMetadata; + + return $obj; + } + + /** + * Optional text to describe the contents of the file. Can be set by the user or the ai-auto-description extension. + */ + public function withDescription(string $description): self + { + $obj = clone $this; + $obj->description = $description; + + return $obj; + } + + /** + * The duration of the video in seconds (only for video). + */ + public function withDuration(int $duration): self + { + $obj = clone $this; + $obj->duration = $duration; + + return $obj; + } + + /** + * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. Send `embeddedMetadata` in `responseFields` in API request to get embeddedMetadata in the upload API response. + * + * @param array $embeddedMetadata + */ + public function withEmbeddedMetadata(array $embeddedMetadata): self + { + $obj = clone $this; + $obj->embeddedMetadata = $embeddedMetadata; + + return $obj; + } + + /** + * Extension names with their processing status at the time of completion of the request. It could have one of the following status values: + * + * `success`: The extension has been successfully applied. + * `failed`: The extension has failed and will not be retried. + * `pending`: The extension will finish processing in some time. On completion, the final status (success / failed) will be sent to the `webhookUrl` provided. + * + * If no extension was requested, then this parameter is not returned. + */ + public function withExtensionStatus(ExtensionStatus $extensionStatus): self + { + $obj = clone $this; + $obj->extensionStatus = $extensionStatus; + + return $obj; + } + + /** + * Unique fileId. Store this fileld in your database, as this will be used to perform update action on this file. + */ + public function withFileID(string $fileID): self + { + $obj = clone $this; + $obj->fileID = $fileID; + + return $obj; + } + + /** + * The relative path of the file in the media library e.g. `/marketing-assets/new-banner.jpg`. + */ + public function withFilePath(string $filePath): self + { + $obj = clone $this; + $obj->filePath = $filePath; + + return $obj; + } + + /** + * Type of the uploaded file. Possible values are `image`, `non-image`. + */ + public function withFileType(string $fileType): self + { + $obj = clone $this; + $obj->fileType = $fileType; + + return $obj; + } + + /** + * Height of the image in pixels (Only for images). + */ + public function withHeight(float $height): self + { + $obj = clone $this; + $obj->height = $height; + + return $obj; + } + + /** + * Is the file marked as private. It can be either `true` or `false`. Send `isPrivateFile` in `responseFields` in API request to get the value of this field. + */ + public function withIsPrivateFile(bool $isPrivateFile): self + { + $obj = clone $this; + $obj->isPrivateFile = $isPrivateFile; + + return $obj; + } + + /** + * Is the file published or in draft state. It can be either `true` or `false`. Send `isPublished` in `responseFields` in API request to get the value of this field. + */ + public function withIsPublished(bool $isPublished): self + { + $obj = clone $this; + $obj->isPublished = $isPublished; + + return $obj; + } + + /** + * Legacy metadata. Send `metadata` in `responseFields` in API request to get metadata in the upload API response. + */ + public function withMetadata(Metadata $metadata): self + { + $obj = clone $this; + $obj->metadata = $metadata; + + return $obj; + } + + /** + * Name of the asset. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * Size of the image file in Bytes. + */ + public function withSize(float $size): self + { + $obj = clone $this; + $obj->size = $size; + + return $obj; + } + + /** + * The array of tags associated with the asset. If no tags are set, it will be `null`. Send `tags` in `responseFields` in API request to get the value of this field. + * + * @param list|null $tags + */ + public function withTags(?array $tags): self + { + $obj = clone $this; + $obj->tags = $tags; + + return $obj; + } + + /** + * In the case of an image, a small thumbnail URL. + */ + public function withThumbnailURL(string $thumbnailURL): self + { + $obj = clone $this; + $obj->thumbnailURL = $thumbnailURL; + + return $obj; + } + + /** + * A publicly accessible URL of the file. + */ + public function withURL(string $url): self + { + $obj = clone $this; + $obj->url = $url; + + return $obj; + } + + /** + * An object containing the file or file version's `id` (versionId) and `name`. + */ + public function withVersionInfo(VersionInfo $versionInfo): self + { + $obj = clone $this; + $obj->versionInfo = $versionInfo; + + return $obj; + } + + /** + * The video codec used in the video (only for video). + */ + public function withVideoCodec(string $videoCodec): self + { + $obj = clone $this; + $obj->videoCodec = $videoCodec; + + return $obj; + } + + /** + * Width of the image in pixels (Only for Images). + */ + public function withWidth(float $width): self + { + $obj = clone $this; + $obj->width = $width; + + return $obj; + } +} diff --git a/src/Beta/V2/Files/FileUploadResponse/AITag.php b/src/Beta/V2/Files/FileUploadResponse/AITag.php new file mode 100644 index 00000000..0c2c4782 --- /dev/null +++ b/src/Beta/V2/Files/FileUploadResponse/AITag.php @@ -0,0 +1,95 @@ + */ + use SdkModel; + + /** + * Confidence score of the tag. + */ + #[Api(optional: true)] + public ?float $confidence; + + /** + * Name of the tag. + */ + #[Api(optional: true)] + public ?string $name; + + /** + * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + */ + #[Api(optional: true)] + public ?string $source; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + ?float $confidence = null, + ?string $name = null, + ?string $source = null + ): self { + $obj = new self; + + null !== $confidence && $obj->confidence = $confidence; + null !== $name && $obj->name = $name; + null !== $source && $obj->source = $source; + + return $obj; + } + + /** + * Confidence score of the tag. + */ + public function withConfidence(float $confidence): self + { + $obj = clone $this; + $obj->confidence = $confidence; + + return $obj; + } + + /** + * Name of the tag. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + */ + public function withSource(string $source): self + { + $obj = clone $this; + $obj->source = $source; + + return $obj; + } +} diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php new file mode 100644 index 00000000..84aa7475 --- /dev/null +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php @@ -0,0 +1,126 @@ + */ + use SdkModel; + + /** @var AIAutoDescription::*|null $aiAutoDescription */ + #[Api('ai-auto-description', enum: AIAutoDescription::class, optional: true)] + public ?string $aiAutoDescription; + + /** @var AwsAutoTagging::*|null $awsAutoTagging */ + #[Api('aws-auto-tagging', enum: AwsAutoTagging::class, optional: true)] + public ?string $awsAutoTagging; + + /** @var GoogleAutoTagging::*|null $googleAutoTagging */ + #[Api('google-auto-tagging', enum: GoogleAutoTagging::class, optional: true)] + public ?string $googleAutoTagging; + + /** @var RemoveBg::*|null $removeBg */ + #[Api('remove-bg', enum: RemoveBg::class, optional: true)] + public ?string $removeBg; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param AIAutoDescription::* $aiAutoDescription + * @param AwsAutoTagging::* $awsAutoTagging + * @param GoogleAutoTagging::* $googleAutoTagging + * @param RemoveBg::* $removeBg + */ + public static function with( + ?string $aiAutoDescription = null, + ?string $awsAutoTagging = null, + ?string $googleAutoTagging = null, + ?string $removeBg = null, + ): self { + $obj = new self; + + null !== $aiAutoDescription && $obj->aiAutoDescription = $aiAutoDescription; + null !== $awsAutoTagging && $obj->awsAutoTagging = $awsAutoTagging; + null !== $googleAutoTagging && $obj->googleAutoTagging = $googleAutoTagging; + null !== $removeBg && $obj->removeBg = $removeBg; + + return $obj; + } + + /** + * @param AIAutoDescription::* $aiAutoDescription + */ + public function withAIAutoDescription(string $aiAutoDescription): self + { + $obj = clone $this; + $obj->aiAutoDescription = $aiAutoDescription; + + return $obj; + } + + /** + * @param AwsAutoTagging::* $awsAutoTagging + */ + public function withAwsAutoTagging(string $awsAutoTagging): self + { + $obj = clone $this; + $obj->awsAutoTagging = $awsAutoTagging; + + return $obj; + } + + /** + * @param GoogleAutoTagging::* $googleAutoTagging + */ + public function withGoogleAutoTagging(string $googleAutoTagging): self + { + $obj = clone $this; + $obj->googleAutoTagging = $googleAutoTagging; + + return $obj; + } + + /** + * @param RemoveBg::* $removeBg + */ + public function withRemoveBg(string $removeBg): self + { + $obj = clone $this; + $obj->removeBg = $removeBg; + + return $obj; + } +} diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php new file mode 100644 index 00000000..c1579539 --- /dev/null +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php @@ -0,0 +1,19 @@ + */ + use SdkModel; + + /** + * Unique identifier of the file version. + */ + #[Api(optional: true)] + public ?string $id; + + /** + * Name of the file version. + */ + #[Api(optional: true)] + public ?string $name; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(?string $id = null, ?string $name = null): self + { + $obj = new self; + + null !== $id && $obj->id = $id; + null !== $name && $obj->name = $name; + + return $obj; + } + + /** + * Unique identifier of the file version. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * Name of the file version. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } +} diff --git a/src/Cache/Invalidation/InvalidationCreateParams.php b/src/Cache/Invalidation/InvalidationCreateParams.php new file mode 100644 index 00000000..ca1f5eeb --- /dev/null +++ b/src/Cache/Invalidation/InvalidationCreateParams.php @@ -0,0 +1,74 @@ +create + * + * @phpstan-type invalidation_create_params = array{url: string} + */ +final class InvalidationCreateParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * The full URL of the file to be purged. + */ + #[Api] + public string $url; + + /** + * `new InvalidationCreateParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * InvalidationCreateParams::with(url: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new InvalidationCreateParams)->withURL(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $url): self + { + $obj = new self; + + $obj->url = $url; + + return $obj; + } + + /** + * The full URL of the file to be purged. + */ + public function withURL(string $url): self + { + $obj = clone $this; + $obj->url = $url; + + return $obj; + } +} diff --git a/src/Cache/Invalidation/InvalidationGetResponse.php b/src/Cache/Invalidation/InvalidationGetResponse.php new file mode 100644 index 00000000..8a114e35 --- /dev/null +++ b/src/Cache/Invalidation/InvalidationGetResponse.php @@ -0,0 +1,61 @@ + */ + use SdkModel; + + /** + * Status of the purge request. + * + * @var Status::*|null $status + */ + #[Api(enum: Status::class, optional: true)] + public ?string $status; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Status::* $status + */ + public static function with(?string $status = null): self + { + $obj = new self; + + null !== $status && $obj->status = $status; + + return $obj; + } + + /** + * Status of the purge request. + * + * @param Status::* $status + */ + public function withStatus(string $status): self + { + $obj = clone $this; + $obj->status = $status; + + return $obj; + } +} diff --git a/src/Cache/Invalidation/InvalidationGetResponse/Status.php b/src/Cache/Invalidation/InvalidationGetResponse/Status.php new file mode 100644 index 00000000..d446c2de --- /dev/null +++ b/src/Cache/Invalidation/InvalidationGetResponse/Status.php @@ -0,0 +1,20 @@ + */ + use SdkModel; + + /** + * Unique identifier of the purge request. This can be used to check the status of the purge request. + */ + #[Api('requestId', optional: true)] + public ?string $requestID; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(?string $requestID = null): self + { + $obj = new self; + + null !== $requestID && $obj->requestID = $requestID; + + return $obj; + } + + /** + * Unique identifier of the purge request. This can be used to check the status of the purge request. + */ + public function withRequestID(string $requestID): self + { + $obj = clone $this; + $obj->requestID = $requestID; + + return $obj; + } +} diff --git a/src/Client.php b/src/Client.php new file mode 100644 index 00000000..a7dabcc9 --- /dev/null +++ b/src/Client.php @@ -0,0 +1,123 @@ +privateAPIKey = (string) ( + $privateAPIKey ?? getenv('IMAGEKIT_PRIVATE_API_KEY') + ); + $this->password = (string) ( + $password ?? getenv('OPTIONAL_IMAGEKIT_IGNORES_THIS') ?: 'do_not_set' + ); + + $this->baseUrlOverridden = !is_null($baseUrl); + + $base = $baseUrl ?? getenv( + 'IMAGE_KIT_BASE_URL' + ) ?: 'https://api.imagekit.io'; + + $options = RequestOptions::with( + uriFactory: Psr17FactoryDiscovery::findUriFactory(), + streamFactory: Psr17FactoryDiscovery::findStreamFactory(), + requestFactory: Psr17FactoryDiscovery::findRequestFactory(), + transporter: Psr18ClientDiscovery::find(), + ); + + parent::__construct( + headers: [ + 'Content-Type' => 'application/json', 'Accept' => 'application/json', + ], + baseUrl: $base, + options: $options, + ); + + $this->customMetadataFields = new CustomMetadataFieldsService($this); + $this->files = new FilesService($this); + $this->assets = new AssetsService($this); + $this->cache = new CacheService($this); + $this->folders = new FoldersService($this); + $this->accounts = new AccountsService($this); + $this->beta = new BetaService($this); + $this->webhooks = new WebhooksService($this); + } + + /** @return array */ + protected function authHeaders(): array + { + if (!$this->privateAPIKey && !$this->password) { + return []; + } + + $base64_credentials = base64_encode( + "{$this->privateAPIKey}:{$this->password}" + ); + + return ['Authorization' => "Basic {$base64_credentials}"]; + } +} diff --git a/src/Core.php b/src/Core.php new file mode 100644 index 00000000..46b56ff5 --- /dev/null +++ b/src/Core.php @@ -0,0 +1,9 @@ +|Converter|string|null + */ + public readonly Converter|string|null $type; + + /** + * @param class-string|Converter|string|null $type + * @param class-string|Converter|null $enum + * @param class-string|Converter|null $union + * @param class-string|Converter|string|null $list + * @param class-string|Converter|string|null $map + */ + public function __construct( + public readonly ?string $apiName = null, + Converter|string|null $type = null, + Converter|string|null $enum = null, + Converter|string|null $union = null, + Converter|string|null $list = null, + Converter|string|null $map = null, + public readonly bool $nullable = false, + public readonly bool $optional = false, + ) { + $this->type = $type ?? $enum ?? $union ?? ($list ? new ListOf($list) : ($map ? new MapOf($map) : null)); + } +} diff --git a/src/Core/BaseClient.php b/src/Core/BaseClient.php new file mode 100644 index 00000000..d0a5c00a --- /dev/null +++ b/src/Core/BaseClient.php @@ -0,0 +1,222 @@ +, + * headers: array>, + * body: mixed, + * } + */ +class BaseClient +{ + protected UriInterface $baseUrl; + + /** + * @internal + * + * @param array|null> $headers + */ + public function __construct( + protected array $headers, + string $baseUrl, + protected RequestOptions $options = new RequestOptions, + ) { + assert(null !== $this->options->uriFactory); + $this->baseUrl = $this->options->uriFactory->createUri($baseUrl); + } + + /** + * @param string|list $path + * @param array $query + * @param array $headers + * @param class-string> $page + * @param class-string> $stream + * @param RequestOptions|array|null $options + */ + public function request( + string $method, + string|array $path, + array $query = [], + array $headers = [], + mixed $body = null, + string|Converter|ConverterSource|null $convert = null, + ?string $page = null, + ?string $stream = null, + RequestOptions|array|null $options = [], + ): mixed { + // @phpstan-ignore-next-line + [$req, $opts] = $this->buildRequest(method: $method, path: $path, query: $query, headers: $headers, body: $body, opts: $options); + ['method' => $method, 'path' => $uri, 'headers' => $headers] = $req; + assert(null !== $opts->requestFactory); + + $request = $opts->requestFactory->createRequest($method, uri: $uri); + $request = Util::withSetHeaders($request, headers: $headers); + + // @phpstan-ignore-next-line + $rsp = $this->sendRequest($opts, req: $request, data: $body, redirectCount: 0, retryCount: 0); + + $decoded = Util::decodeContent($rsp); + + if (!is_null($stream)) { + return new $stream( + convert: $convert, + request: $request, + response: $rsp, + stream: $decoded + ); + } + + if (!is_null($page)) { + return new $page( + convert: $convert, + client: $this, + request: $req, + options: $opts, + data: $decoded, + ); + } + + if (!is_null($convert)) { + return Conversion::coerce($convert, value: $decoded); + } + + return $decoded; + } + + /** @return array */ + protected function authHeaders(): array + { + return []; + } + + /** + * @internal + * + * @param string|list $path + * @param array $query + * @param array|null> $headers + * @param array{ + * timeout?: float|null, + * maxRetries?: int|null, + * initialRetryDelay?: float|null, + * maxRetryDelay?: float|null, + * extraHeaders?: array|null>|null, + * extraQueryParams?: array|null, + * extraBodyParams?: mixed, + * transporter?: ClientInterface|null, + * uriFactory?: UriFactoryInterface|null, + * streamFactory?: StreamFactoryInterface|null, + * requestFactory?: RequestFactoryInterface|null, + * }|null $opts + * + * @return array{normalized_request, RequestOptions} + */ + protected function buildRequest( + string $method, + string|array $path, + array $query, + array $headers, + mixed $body, + RequestOptions|array|null $opts, + ): array { + $options = RequestOptions::parse($this->options, $opts); + + $parsedPath = Util::parsePath($path); + + /** @var array $mergedQuery */ + $mergedQuery = array_merge_recursive( + $query, + $options->extraQueryParams ?? [], + ); + $uri = Util::joinUri($this->baseUrl, path: $parsedPath, query: $mergedQuery)->__toString(); + + /** @var array|null> $mergedHeaders */ + $mergedHeaders = [...$this->headers, + ...$this->authHeaders(), + ...$headers, + ...($options->extraHeaders ?? []), ]; + + $req = ['method' => strtoupper($method), 'path' => $uri, 'query' => $mergedQuery, 'headers' => $mergedHeaders, 'body' => $body]; + + return [$req, $options]; + } + + /** + * @internal + */ + protected function followRedirect( + ResponseInterface $rsp, + RequestInterface $req + ): RequestInterface { + $location = $rsp->getHeaderLine('Location'); + if (!$location) { + throw new \RuntimeException('Redirection without Location header'); + } + + $uri = Util::joinUri($req->getUri(), path: $location); + + return $req->withUri($uri); + } + + /** + * @internal + * + * @param bool|int|float|string|resource|\Traversable|array|null $data + */ + protected function sendRequest( + RequestOptions $opts, + RequestInterface $req, + mixed $data, + int $retryCount, + int $redirectCount, + ): ResponseInterface { + assert(null !== $opts->streamFactory && null !== $opts->transporter); + + $req = Util::withSetBody($opts->streamFactory, req: $req, body: $data); + $rsp = $opts->transporter->sendRequest($req); + $code = $rsp->getStatusCode(); + + if ($code >= 300 && $code < 400) { + if ($redirectCount >= 20) { + throw new \RuntimeException('Maximum redirects exceeded'); + } + + $req = $this->followRedirect($rsp, req: $req); + + return $this->sendRequest($opts, req: $req, data: $data, retryCount: $retryCount, redirectCount: ++$redirectCount); + } + + if ($code >= 400 && $code < 500) { + throw APIStatusException::from(request: $req, response: $rsp); + } + + if ($code >= 500 && $retryCount < $opts->maxRetries) { + usleep((int) $opts->initialRetryDelay); + + return $this->sendRequest($opts, req: $req, data: $data, retryCount: ++$retryCount, redirectCount: $redirectCount); + } + + return $rsp; + } +} diff --git a/src/Core/Concerns/SdkEnum.php b/src/Core/Concerns/SdkEnum.php new file mode 100644 index 00000000..cf3651aa --- /dev/null +++ b/src/Core/Concerns/SdkEnum.php @@ -0,0 +1,33 @@ +getReflectionConstants() as $constant) { + if ($constant->isPublic()) { + array_push($acc, $constant->getValue()); + } + } + + return static::$converter = new EnumOf($acc); // @phpstan-ignore-line + } +} diff --git a/src/Core/Concerns/SdkModel.php b/src/Core/Concerns/SdkModel.php new file mode 100644 index 00000000..da86c0ad --- /dev/null +++ b/src/Core/Concerns/SdkModel.php @@ -0,0 +1,269 @@ + + */ +trait SdkModel +{ + private static ModelOf $converter; + + /** + * @var array keeps track of undocumented data + */ + private array $_data = []; + + /** + * @internal + * + * @return array + */ + public function __serialize(): array + { + $rows = [...Util::get_object_vars($this), ...$this->_data]; // @phpstan-ignore-line + + return array_map(static fn ($v) => self::serialize($v), array: $rows); + } + + /** + * @internal + * + * @param array $data + */ + public function __unserialize(array $data): void + { + foreach ($data as $key => $value) { + $this->offsetSet($key, value: $value); // @phpstan-ignore-line + } + } + + /** + * @internal + * + * @return array + */ + public function __debugInfo(): array + { + return $this->__serialize(); + } + + /** + * @internal + */ + public function __toString(): string + { + return Util::prettyEncodeJson($this->__debugInfo()); + } + + /** + * @internal + * + * Magic get is intended to occur when we have manually unset + * a native class property, indicating an omitted value, + * or a property overridden with an incongruent type + * + * @return value-of + * + * @throws \Exception + */ + public function __get(string $key): mixed + { + if (!array_key_exists($key, array: self::$converter->properties)) { + throw new \RuntimeException("Property '{$key}' does not exist in {$this}::class"); + } + + // The unset property was overridden by a value with an incongruent type. + // It's forbidden for an optional value to be `null` in the payload. + if (array_key_exists($key, array: $this->_data)) { + throw new \Exception( + "The {$key} property is overridden, use the array access ['{$key}'] syntax to the raw payload property.", + ); + } + + // An optional property which was unset to be omitted from serialized is being accessed. + // Return null to match user's expectations. + return null; // @phpstan-ignore-line + } + + /** + * @return Shape + */ + public function toArray(): array + { + return $this->__serialize(); // @phpstan-ignore-line + } + + /** + * @internal + * + * @param key-of $offset + */ + public function offsetExists(mixed $offset): bool + { + if (!is_string($offset)) { // @phpstan-ignore-line + throw new \InvalidArgumentException; + } + + if (array_key_exists($offset, array: $this->_data)) { + return true; + } + + if (array_key_exists($offset, array: self::$converter->properties)) { + if (isset($this->{$offset})) { + return true; + } + + $property = self::$converter->properties[$offset]->property ?? new \ReflectionProperty($this, property: $offset); + + return $property->isInitialized($this); + } + + return false; + } + + /** + * @internal + * + * @param key-of $offset + */ + public function &offsetGet(mixed $offset): mixed + { + if (!is_string($offset)) { // @phpstan-ignore-line + throw new \InvalidArgumentException; + } + + if (!$this->offsetExists($offset)) { // @phpstan-ignore-line + return null; // @phpstan-ignore-line + } + + if (array_key_exists($offset, array: $this->_data)) { + return $this->_data[$offset]; // @phpstan-ignore-line + } + + return $this->{$offset}; // @phpstan-ignore-line + } + + /** + * @internal + * + * @param key-of $offset + */ + public function offsetSet(mixed $offset, mixed $value): void + { + if (!is_string($offset)) { // @phpstan-ignore-line + throw new \InvalidArgumentException; + } + + $type = array_key_exists($offset, array: self::$converter->properties) + ? self::$converter->properties[$offset]->type + : 'mixed'; + + $coerced = Conversion::coerce($type, value: $value, state: new CoerceState(translateNames: false)); + + if (property_exists($this, property: $offset)) { // @phpstan-ignore-line + try { + $this->{$offset} = $coerced; // @phpstan-ignore-line + unset($this->_data[$offset]); + + return; + } catch (\TypeError) { // @phpstan-ignore-line + unset($this->{$offset}); + } + } + + $this->_data[$offset] = $coerced; + } + + /** + * @internal + * + * @param key-of $offset + */ + public function offsetUnset(mixed $offset): void + { + if (!is_string($offset)) { // @phpstan-ignore-line + throw new \InvalidArgumentException; + } + + if (property_exists($this, property: $offset)) { // @phpstan-ignore-line + unset($this->{$offset}); + } + + unset($this->_data[$offset]); + } + + /** + * @internal + * + * @return array + */ + public function jsonSerialize(): array + { + // @phpstan-ignore-next-line + return Conversion::dump(self::converter(), value: $this->__serialize()); + } + + /** + * @param array $data + */ + public static function fromArray(array $data): static + { + return self::converter()->from($data); // @phpstan-ignore-line + } + + /** + * @internal + */ + public static function converter(): Converter + { + if (isset(self::$converter)) { + return self::$converter; + } + + $class = new \ReflectionClass(static::class); + + return self::$converter = new ModelOf($class); + } + + /** + * @internal + */ + private function initialize(): void + { + static::converter(); + + foreach (self::$converter->properties as $name => $info) { + if ($info->optional) { + unset($this->{$name}); + } + } + } + + /** + * @internal + */ + private static function serialize(mixed $value): mixed + { + if ($value instanceof BaseModel) { + return $value->toArray(); + } + + if (is_array($value)) { + return array_map(static fn ($v) => self::serialize($v), array: $value); + } + + return $value; + } +} diff --git a/src/Core/Concerns/SdkPage.php b/src/Core/Concerns/SdkPage.php new file mode 100644 index 00000000..25f2e976 --- /dev/null +++ b/src/Core/Concerns/SdkPage.php @@ -0,0 +1,118 @@ + + */ + abstract public function getItems(): array; + + public function hasNextPage(): bool + { + $items = $this->getItems(); + if (empty($items)) { + return false; + } + + return null != $this->nextRequest(); + } + + /** + * Get the next page of results. + * Before calling this method, you must check if there is a next page + * using {@link hasNextPage()}. + * + * @return static of static + * + * @throws APIStatusException + */ + public function getNextPage(): static + { + $next = $this->nextRequest(); + if (!$next) { + throw new \RuntimeException( + 'No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.' + ); + } + + [$req, $opts] = $next; + + // @phpstan-ignore-next-line + return $this->client->request(...$req, convert: $this->convert, page: $this::class, options: $opts); + } + + /** + * Iterator yielding each page (instance of static). + * + * @return \Generator + */ + public function getIterator(): \Generator + { + $page = $this; + + yield $page; + while ($page->hasNextPage()) { + $page = $page->getNextPage(); + + yield $page; + } + } + + /** + * Iterator yielding each item across all pages. + * + * @return \Generator + */ + public function pagingEachItem(): \Generator + { + foreach ($this as $page) { + foreach ($page->getItems() as $item) { + yield $item; + } + } + } + + /** + * @internal + * + * @param array $data + * + * @return static + */ + abstract public static function fromArray(array $data): static; + + /** + * @internal + * + * @return array{normalized_request, RequestOptions} + */ + abstract protected function nextRequest(): ?array; +} diff --git a/src/Core/Concerns/SdkParams.php b/src/Core/Concerns/SdkParams.php new file mode 100644 index 00000000..2797d525 --- /dev/null +++ b/src/Core/Concerns/SdkParams.php @@ -0,0 +1,37 @@ +|self|null $params + * @param array|RequestOptions|null $options + * + * @return array{array, RequestOptions} + */ + public static function parseRequest(array|self|null $params, array|RequestOptions|null $options): array + { + $value = is_array($params) ? Util::array_filter_omit($params) : $params; + $converter = self::converter(); + $state = new DumpState; + $dumped = (array) Conversion::dump($converter, value: $value, state: $state); + $opts = RequestOptions::parse($options); // @phpstan-ignore-line + + if (!$state->canRetry) { + $opts->maxRetries = 0; + } + + return [$dumped, $opts]; // @phpstan-ignore-line + } +} diff --git a/src/Core/Concerns/SdkUnion.php b/src/Core/Concerns/SdkUnion.php new file mode 100644 index 00000000..87356601 --- /dev/null +++ b/src/Core/Concerns/SdkUnion.php @@ -0,0 +1,40 @@ +|list + */ + public static function variants(): array + { + return []; + } + + public static function converter(): Converter + { + if (isset(static::$converter)) { + return static::$converter; + } + + // @phpstan-ignore-next-line + return static::$converter = new UnionOf(discriminator: static::discriminator(), variants: static::variants()); + } +} diff --git a/src/Core/Contracts/BaseModel.php b/src/Core/Contracts/BaseModel.php new file mode 100644 index 00000000..68d47446 --- /dev/null +++ b/src/Core/Contracts/BaseModel.php @@ -0,0 +1,18 @@ + + */ +interface BaseModel extends \ArrayAccess, \JsonSerializable, \Stringable, ConverterSource +{ + /** @return array */ + public function toArray(): array; +} diff --git a/src/Core/Contracts/BasePage.php b/src/Core/Contracts/BasePage.php new file mode 100644 index 00000000..143f5b66 --- /dev/null +++ b/src/Core/Contracts/BasePage.php @@ -0,0 +1,52 @@ + + */ +interface BasePage extends \IteratorAggregate +{ + /** + * @internal + * + * @param normalized_request $request + */ + public function __construct( + Converter|ConverterSource|string $convert, + Client $client, + array $request, + RequestOptions $options, + mixed $data, + ); + + public function hasNextPage(): bool; + + /** + * @return list + */ + public function getItems(): array; + + /** + * @return static + */ + public function getNextPage(): static; + + /** + * @return \Generator + */ + public function pagingEachItem(): \Generator; +} diff --git a/src/Core/Contracts/BaseStream.php b/src/Core/Contracts/BaseStream.php new file mode 100644 index 00000000..77555bbe --- /dev/null +++ b/src/Core/Contracts/BaseStream.php @@ -0,0 +1,36 @@ + + */ +interface BaseStream extends \IteratorAggregate +{ + /** + * @param \Generator $stream + */ + public function __construct( + Converter|ConverterSource|string $convert, + RequestInterface $request, + ResponseInterface $response, + \Generator $stream, + ); + + /** + * Manually force the stream to close early. + * Iterating through will automatically close as well. + */ + public function close(): void; +} diff --git a/src/Core/Conversion.php b/src/Core/Conversion.php new file mode 100644 index 00000000..6f27a71a --- /dev/null +++ b/src/Core/Conversion.php @@ -0,0 +1,165 @@ + self::dump_unknown($v, state: $state), array: $value); + } + + if (is_object($value)) { + if (is_a($value, class: ConverterSource::class)) { + return $value::converter()->dump($value, state: $state); + } + + if (is_a($value, class: \DateTimeInterface::class)) { + return $value->format(format: \DateTimeInterface::RFC3339); + } + + if (is_a($value, class: \JsonSerializable::class)) { + return $value->jsonSerialize(); + } + + $acc = get_object_vars($value); + + return empty($acc) ? (object) $acc : self::dump_unknown($acc, state: $state); + } + + return $value; + } + + public static function coerce(Converter|ConverterSource|string $target, mixed $value, CoerceState $state = new CoerceState): mixed + { + if ($value instanceof $target) { + ++$state->yes; + + return $value; + } + + if (is_a($target, class: ConverterSource::class, allow_string: true)) { + $target = $target::converter(); + } + + if ($target instanceof Converter) { + return $target->coerce($value, state: $state); + } + + switch ($target) { + case 'mixed': + ++$state->yes; + + return $value; + + case 'null': + if (is_null($value)) { + ++$state->yes; + + return null; + } + + ++$state->maybe; + + return null; + + case 'bool': + if (is_bool($value)) { + ++$state->yes; + + return $value; + } + + ++$state->no; + + return $value; + + case 'int': + if (is_int($value)) { + ++$state->yes; + + return $value; + } + + if (is_float($value)) { + ++$state->maybe; + + return (int) $value; + } + + if (is_string($value) && ctype_digit($value)) { + ++$state->maybe; + + return (int) $value; + } + + ++$state->no; + + return $value; + + case 'float': + if (is_numeric($value)) { + ++$state->yes; + + return (float) $value; + } + + if (is_string($value) && is_numeric($value)) { + ++$state->maybe; + + return (float) $value; + } + + ++$state->no; + + return $value; + + case 'string': + if (is_string($value)) { + ++$state->yes; + + return $value; + } + + if (is_numeric($value)) { + ++$state->maybe; + + return (string) $value; + } + + if ($value instanceof \Generator) { + return implode('', iterator_to_array($value)); + } + + ++$state->no; + + return $value; + + default: + ++$state->no; + + return $value; + } + } + + public static function dump(Converter|ConverterSource|string $target, mixed $value, DumpState $state = new DumpState): mixed + { + if ($target instanceof Converter) { + return $target->dump($value, state: $state); + } + + if (is_a($target, class: ConverterSource::class, allow_string: true)) { + return $target::converter()->dump($value, state: $state); + } + + return self::dump_unknown($value, state: $state); + } +} diff --git a/src/Core/Conversion/CoerceState.php b/src/Core/Conversion/CoerceState.php new file mode 100644 index 00000000..b1de64d7 --- /dev/null +++ b/src/Core/Conversion/CoerceState.php @@ -0,0 +1,19 @@ +type = $type ?? $enum ?? $union; + assert(!is_null($this->type)); + } + + public function coerce(mixed $value, CoerceState $state): mixed + { + if (!is_array($value)) { + return $value; + } + + $acc = []; + foreach ($value as $k => $v) { + if ($this->nullable && null === $v) { + ++$state->yes; + $acc[$k] = null; + } else { + $acc[$k] = Conversion::coerce($this->type, value: $v, state: $state); + } + } + + return $acc; + } + + public function dump(mixed $value, DumpState $state): mixed + { + if (!is_array($value)) { + return Conversion::dump_unknown($value, state: $state); + } + + if (empty($value)) { + return $this->empty(); + } + + return array_map(fn ($v) => Conversion::dump($this->type, value: $v, state: $state), array: $value); + } + + private function empty(): array|object // @phpstan-ignore-line + { + return (object) []; + } +} diff --git a/src/Core/Conversion/Contracts/Converter.php b/src/Core/Conversion/Contracts/Converter.php new file mode 100644 index 00000000..dadf46de --- /dev/null +++ b/src/Core/Conversion/Contracts/Converter.php @@ -0,0 +1,24 @@ + $members + */ + public function __construct(private readonly array $members) + { + $type = 'NULL'; + foreach ($this->members as $member) { + $type = gettype($member); + } + $this->type = $type; + } + + public function coerce(mixed $value, CoerceState $state): mixed + { + if (in_array($value, haystack: $this->members, strict: true)) { + ++$state->yes; + } elseif ($this->type === gettype($value)) { + ++$state->maybe; + } else { + ++$state->no; + } + + return $value; + } + + public function dump(mixed $value, DumpState $state): mixed + { + return Conversion::dump_unknown($value, state: $state); + } +} diff --git a/src/Core/Conversion/ListOf.php b/src/Core/Conversion/ListOf.php new file mode 100644 index 00000000..9bbe8482 --- /dev/null +++ b/src/Core/Conversion/ListOf.php @@ -0,0 +1,21 @@ + + */ + public readonly array $properties; + + /** + * @param \ReflectionClass $class + */ + public function __construct(public readonly \ReflectionClass $class) + { + $properties = []; + + foreach ($this->class->getProperties() as $property) { + if (!empty($property->getAttributes(Api::class))) { + $name = $property->getName(); + $properties[$name] = new PropertyInfo($property); + } + } + $this->properties = $properties; + } + + public function coerce(mixed $value, CoerceState $state): mixed + { + if ($value instanceof $this->class->name) { + ++$state->yes; + + return $value; + } + + if (!is_array($value) || (!empty($value) && array_is_list($value))) { + ++$state->no; + + return $value; + } + + ++$state->yes; + + $val = [...$value]; + $acc = []; + + foreach ($this->properties as $name => $info) { + $srcName = $state->translateNames ? $info->apiName : $name; + if (!array_key_exists($srcName, array: $val)) { + if ($info->optional) { + ++$state->yes; + } elseif ($info->nullable) { + ++$state->maybe; + } else { + ++$state->no; + } + + continue; + } + + $item = $val[$srcName]; + unset($val[$srcName]); + + if (is_null($item) && ($info->nullable || $info->optional)) { + if ($info->nullable) { + ++$state->yes; + } elseif ($info->optional) { + ++$state->maybe; + } + $acc[$name] = null; + } else { + $coerced = Conversion::coerce($info->type, value: $item, state: $state); + $acc[$name] = $coerced; + } + } + + foreach ($val as $name => $item) { + $acc[$name] = $item; + } + + return $this->from($acc); // @phpstan-ignore-line + } + + /** + * @param array $data + */ + public function from(array $data): BaseModel + { + $instance = $this->class->newInstanceWithoutConstructor(); + $instance->__unserialize($data); // @phpstan-ignore-line + + return $instance; + } + + public function dump(mixed $value, DumpState $state): mixed + { + if ($value instanceof BaseModel) { + $value = $value->toArray(); + } + + if (is_array($value)) { + $acc = []; + + foreach ($value as $name => $item) { + if (array_key_exists($name, array: $this->properties)) { + $info = $this->properties[$name]; + $acc[$info->apiName] = Conversion::dump($info->type, value: $item, state: $state); + } else { + $acc[$name] = Conversion::dump_unknown($item, state: $state); + } + } + + return empty($acc) ? ((object) []) : $acc; + } + + return Conversion::dump_unknown($value, state: $state); + } +} diff --git a/src/Core/Conversion/PropertyInfo.php b/src/Core/Conversion/PropertyInfo.php new file mode 100644 index 00000000..0cfd7c72 --- /dev/null +++ b/src/Core/Conversion/PropertyInfo.php @@ -0,0 +1,76 @@ +getType()?->allowsNull() ?? false; + + $apiName = $property->getName(); + $type = $property->getType(); + $optional = false; + + foreach ($property->getAttributes(Api::class) as $attr) { + /** @var Api $attribute */ + $attribute = $attr->newInstance(); + + $apiName = $attribute->apiName ?? $apiName; + $optional = $attribute->optional; + $nullable |= $attribute->nullable; + $type = $attribute->type ?? $type; + } + + $this->apiName = $apiName; + $this->type = self::parse($type); + $this->nullable = (bool) $nullable; + $this->optional = $optional; + } + + /** + * @param array|Converter|ConverterSource|\ReflectionType|string|null $type + */ + private static function parse(array|Converter|ConverterSource|\ReflectionType|string|null $type): Converter|ConverterSource|string + { + if (is_string($type) || $type instanceof Converter) { + return $type; + } + + if (is_array($type)) { + return new UnionOf($type); // @phpstan-ignore-line + } + + if ($type instanceof \ReflectionUnionType) { + // @phpstan-ignore-next-line + return new UnionOf(array_map(static fn ($t) => self::parse($t), array: $type->getTypes())); + } + + if ($type instanceof \ReflectionNamedType) { + return $type->getName(); + } + + if ($type instanceof \ReflectionIntersectionType) { + throw new \ValueError; + } + + return 'mixed'; + } +} diff --git a/src/Core/Conversion/UnionOf.php b/src/Core/Conversion/UnionOf.php new file mode 100644 index 00000000..1502f9bb --- /dev/null +++ b/src/Core/Conversion/UnionOf.php @@ -0,0 +1,96 @@ +|list $variants + */ + public function __construct( + private readonly array $variants, + private readonly ?string $discriminator = null, + ) {} + + public function coerce(mixed $value, CoerceState $state): mixed + { + if (!is_null($target = $this->resolveVariant(value: $value))) { + return Conversion::coerce($target, value: $value, state: $state); + } + + $alternatives = []; + foreach ($this->variants as $_ => $variant) { + ++$state->branched; + $newState = new CoerceState; + + $coerced = Conversion::coerce($variant, value: $value, state: $newState); + if (($newState->no + $newState->maybe) === 0) { + $state->yes += $newState->yes; + + return $coerced; + } + if ($newState->maybe > 0) { + $alternatives[] = [[-$newState->yes, -$newState->maybe, $newState->no], $newState, $coerced]; + } + } + + usort( + $alternatives, + static fn (array $a, array $b): int => $a[0][0] <=> $b[0][0] ?: $a[0][1] <=> $b[0][1] ?: $a[0][2] <=> $b[0][2] + ); + + if (empty($alternatives)) { + ++$state->no; + + return $value; + } + + [[,$newState, $best]] = $alternatives; + $state->yes += $newState->yes; + $state->maybe += $newState->maybe; + $state->no += $newState->no; + + return $best; + } + + public function dump(mixed $value, DumpState $state): mixed + { + if (!is_null($target = $this->resolveVariant(value: $value))) { + return Conversion::dump($target, value: $value, state: $state); + } + + foreach ($this->variants as $variant) { + if ($value instanceof $variant) { + return Conversion::dump($variant, value: $value, state: $state); + } + } + + return Conversion::dump_unknown($value, state: $state); + } + + private function resolveVariant( + mixed $value, + ): Converter|ConverterSource|string|null { + if ($value instanceof BaseModel) { + return $value::class; + } + + if (!is_null($this->discriminator) && is_array($value) && array_key_exists($this->discriminator, array: $value)) { + $discriminator = $value[$this->discriminator]; + + return $this->variants[$discriminator] ?? null; + } + + return null; + } +} diff --git a/src/Core/Exceptions/APIConnectionException.php b/src/Core/Exceptions/APIConnectionException.php new file mode 100644 index 00000000..c897edb5 --- /dev/null +++ b/src/Core/Exceptions/APIConnectionException.php @@ -0,0 +1,9 @@ +response = $response; + $this->status = $response->getStatusCode(); + + $summary = Util::prettyEncodeJson(['status' => $this->status, 'body' => Util::decodeJson($response->getBody())]); + + if ('' != $message) { + $summary .= $message.PHP_EOL.$summary; + } + + parent::__construct(request: $request, message: $summary, previous: $previous); + } + + public static function from( + RequestInterface $request, + ResponseInterface $response, + string $message = '' + ): self { + $status = $response->getStatusCode(); + + $cls = match (true) { + 400 === $status => BadRequestException::class, + 401 === $status => AuthenticationException::class, + 403 === $status => PermissionDeniedException::class, + 404 === $status => NotFoundException::class, + 409 === $status => ConflictException::class, + 422 === $status => UnprocessableEntityException::class, + 429 === $status => RateLimitException::class, + $status >= 500 => InternalServerException::class, + default => APIStatusException::class + }; + + return new $cls(request: $request, response: $response, message: $message); + } +} diff --git a/src/Core/Exceptions/APITimeoutException.php b/src/Core/Exceptions/APITimeoutException.php new file mode 100644 index 00000000..e3397769 --- /dev/null +++ b/src/Core/Exceptions/APITimeoutException.php @@ -0,0 +1,19 @@ + + */ + public function list( + ?RequestOptions $requestOptions = null + ): array; + + /** + * @api + */ + public function delete( + string $id, + ?RequestOptions $requestOptions = null + ): mixed; + + /** + * @api + */ + public function get( + string $id, + ?RequestOptions $requestOptions = null + ): S31|S3Compatible1|CloudinaryBackup1|WebFolder1|WebProxy1|Gcs1|AzureBlob1|AkeneoPim1; +} diff --git a/src/Core/ServiceContracts/Accounts/URLEndpointsContract.php b/src/Core/ServiceContracts/Accounts/URLEndpointsContract.php new file mode 100644 index 00000000..765c3efd --- /dev/null +++ b/src/Core/ServiceContracts/Accounts/URLEndpointsContract.php @@ -0,0 +1,77 @@ + $origins Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. + * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) + * @param Cloudinary|Imgix|Akamai $urlRewriter configuration for third-party URL rewriting + */ + public function create( + $description, + $origins = omit, + $urlPrefix = omit, + $urlRewriter = omit, + ?RequestOptions $requestOptions = null, + ): URLEndpointResponse; + + /** + * @api + * + * @param string $description description of the URL endpoint + * @param list $origins Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. + * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) + * @param Cloudinary1|Imgix1|Akamai1 $urlRewriter configuration for third-party URL rewriting + */ + public function update( + string $id, + $description, + $origins = omit, + $urlPrefix = omit, + $urlRewriter = omit, + ?RequestOptions $requestOptions = null, + ): URLEndpointResponse; + + /** + * @api + * + * @return list + */ + public function list( + ?RequestOptions $requestOptions = null + ): array; + + /** + * @api + */ + public function delete( + string $id, + ?RequestOptions $requestOptions = null + ): mixed; + + /** + * @api + */ + public function get( + string $id, + ?RequestOptions $requestOptions = null + ): URLEndpointResponse; +} diff --git a/src/Core/ServiceContracts/Accounts/UsageContract.php b/src/Core/ServiceContracts/Accounts/UsageContract.php new file mode 100644 index 00000000..eeb5fac6 --- /dev/null +++ b/src/Core/ServiceContracts/Accounts/UsageContract.php @@ -0,0 +1,23 @@ + "7d"`. + * + * Note : When the searchQuery parameter is present, the following query parameters will have no effect on the result: + * + * 1. `tags` + * 2. `type` + * 3. `name` + * + * [Learn more](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#advanced-search-queries) from examples. + * @param int $skip the number of results to skip before returning results + * @param Sort::* $sort sort the results by one of the supported fields in ascending or descending order + * @param Type::* $type Filter results by asset type. + * + * - `file` — returns only files + * - `file-version` — returns specific file versions + * - `folder` — returns only folders + * - `all` — returns both files and folders (excludes `file-version`) + * + * @return list + */ + public function list( + $fileType = omit, + $limit = omit, + $path = omit, + $searchQuery = omit, + $skip = omit, + $sort = omit, + $type = omit, + ?RequestOptions $requestOptions = null, + ): array; +} diff --git a/src/Core/ServiceContracts/Beta/V2/FilesContract.php b/src/Core/ServiceContracts/Beta/V2/FilesContract.php new file mode 100644 index 00000000..cf4f4f19 --- /dev/null +++ b/src/Core/ServiceContracts/Beta/V2/FilesContract.php @@ -0,0 +1,98 @@ + $customMetadata JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. + * @param string $description optional text to describe the contents of the file + * @param list $extensions Array of extensions to be applied to the image. Each extension can be configured with specific parameters based on the extension type. + * @param string $folder The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. Using multiple `/` creates a nested folder. + * @param bool $isPrivateFile Whether to mark the file as private or not. + * + * If `true`, the file is marked as private and is accessible only using named transformation or signed URL. + * @param bool $isPublished Whether to upload file as published or not. + * + * If `false`, the file is marked as unpublished, which restricts access to the file only via the media library. Files in draft or unpublished state can only be publicly accessed after being published. + * + * The option to upload in draft state is only available in custom enterprise pricing plans. + * @param bool $overwriteAITags If set to `true` and a file already exists at the exact location, its AITags will be removed. Set `overwriteAITags` to `false` to preserve AITags. + * @param bool $overwriteCustomMetadata if the request does not have `customMetadata`, and a file already exists at the exact location, existing customMetadata will be removed + * @param bool $overwriteFile if `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately + * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed + * @param list $responseFields array of response field keys to include in the API response body + * @param list $tags Set the tags while uploading the file. + * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. + * If this field is not specified and the file is overwritten, the existing tags will be removed. + * @param Transformation $transformation Configure pre-processing (`pre`) and post-processing (`post`) transformations. + * + * - `pre` — applied before the file is uploaded to the Media Library. + * Useful for reducing file size or applying basic optimizations upfront (e.g., resize, compress). + * + * - `post` — applied immediately after upload. + * Ideal for generating transformed versions (like video encodes or thumbnails) in advance, so they're ready for delivery without delay. + * + * You can mix and match any combination of post-processing types. + * @param bool $useUniqueFileName Whether to use a unique filename for this file or not. + * + * If `true`, ImageKit.io will add a unique suffix to the filename parameter to get a unique filename. + * + * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. + * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + */ + public function upload( + $file, + $fileName, + $token = omit, + $checks = omit, + $customCoordinates = omit, + $customMetadata = omit, + $description = omit, + $extensions = omit, + $folder = omit, + $isPrivateFile = omit, + $isPublished = omit, + $overwriteAITags = omit, + $overwriteCustomMetadata = omit, + $overwriteFile = omit, + $overwriteTags = omit, + $responseFields = omit, + $tags = omit, + $transformation = omit, + $useUniqueFileName = omit, + $webhookURL = omit, + ?RequestOptions $requestOptions = null, + ): FileUploadResponse; +} diff --git a/src/Core/ServiceContracts/Beta/V2Contract.php b/src/Core/ServiceContracts/Beta/V2Contract.php new file mode 100644 index 00000000..a76de06f --- /dev/null +++ b/src/Core/ServiceContracts/Beta/V2Contract.php @@ -0,0 +1,7 @@ + + */ + public function list( + $includeDeleted = omit, + ?RequestOptions $requestOptions = null + ): array; + + /** + * @api + */ + public function delete( + string $id, + ?RequestOptions $requestOptions = null + ): CustomMetadataFieldDeleteResponse; +} diff --git a/src/Core/ServiceContracts/Files/BulkContract.php b/src/Core/ServiceContracts/Files/BulkContract.php new file mode 100644 index 00000000..b8c4fb2d --- /dev/null +++ b/src/Core/ServiceContracts/Files/BulkContract.php @@ -0,0 +1,60 @@ + $fileIDs an array of fileIds which you want to delete + */ + public function delete( + $fileIDs, + ?RequestOptions $requestOptions = null + ): BulkDeleteResponse; + + /** + * @api + * + * @param list $fileIDs an array of fileIds to which you want to add tags + * @param list $tags an array of tags that you want to add to the files + */ + public function addTags( + $fileIDs, + $tags, + ?RequestOptions $requestOptions = null + ): BulkAddTagsResponse; + + /** + * @api + * + * @param list $aiTags an array of AITags that you want to remove from the files + * @param list $fileIDs an array of fileIds from which you want to remove AITags + */ + public function removeAITags( + $aiTags, + $fileIDs, + ?RequestOptions $requestOptions = null + ): BulkRemoveAITagsResponse; + + /** + * @api + * + * @param list $fileIDs an array of fileIds from which you want to remove tags + * @param list $tags an array of tags that you want to remove from the files + */ + public function removeTags( + $fileIDs, + $tags, + ?RequestOptions $requestOptions = null + ): BulkRemoveTagsResponse; +} diff --git a/src/Core/ServiceContracts/Files/MetadataContract.php b/src/Core/ServiceContracts/Files/MetadataContract.php new file mode 100644 index 00000000..3c3d3a23 --- /dev/null +++ b/src/Core/ServiceContracts/Files/MetadataContract.php @@ -0,0 +1,29 @@ + + */ + public function list( + string $fileID, + ?RequestOptions $requestOptions = null + ): array; + + /** + * @api + * + * @param string $fileID + */ + public function delete( + string $versionID, + $fileID, + ?RequestOptions $requestOptions = null + ): VersionDeleteResponse; + + /** + * @api + * + * @param string $fileID + */ + public function get( + string $versionID, + $fileID, + ?RequestOptions $requestOptions = null + ): File; + + /** + * @api + * + * @param string $fileID + */ + public function restore( + string $versionID, + $fileID, + ?RequestOptions $requestOptions = null + ): File; +} diff --git a/src/Core/ServiceContracts/FilesContract.php b/src/Core/ServiceContracts/FilesContract.php new file mode 100644 index 00000000..c698af13 --- /dev/null +++ b/src/Core/ServiceContracts/FilesContract.php @@ -0,0 +1,206 @@ + $customMetadata JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. + * @param string $description optional text to describe the contents of the file + * @param int $expire The time until your signature is valid. It must be a [Unix time](https://en.wikipedia.org/wiki/Unix_time) in less than 1 hour into the future. It should be in seconds. This field is only required for authentication when uploading a file from the client side. + * @param list $extensions Array of extensions to be applied to the image. Each extension can be configured with specific parameters based on the extension type. + * @param string $folder The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. + * + * The folder name can contain: + * + * - Alphanumeric Characters: `a-z` , `A-Z` , `0-9` + * - Special Characters: `/` , `_` , `-` + * + * Using multiple `/` creates a nested folder. + * @param bool $isPrivateFile Whether to mark the file as private or not. + * + * If `true`, the file is marked as private and is accessible only using named transformation or signed URL. + * @param bool $isPublished Whether to upload file as published or not. + * + * If `false`, the file is marked as unpublished, which restricts access to the file only via the media library. Files in draft or unpublished state can only be publicly accessed after being published. + * + * The option to upload in draft state is only available in custom enterprise pricing plans. + * @param bool $overwriteAITags If set to `true` and a file already exists at the exact location, its AITags will be removed. Set `overwriteAITags` to `false` to preserve AITags. + * @param bool $overwriteCustomMetadata if the request does not have `customMetadata`, and a file already exists at the exact location, existing customMetadata will be removed + * @param bool $overwriteFile if `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately + * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed + * @param string $publicKey Your ImageKit.io public key. This field is only required for authentication when uploading a file from the client side. + * @param list $responseFields array of response field keys to include in the API response body + * @param string $signature HMAC-SHA1 digest of the token+expire using your ImageKit.io private API key as a key. Learn how to create a signature on the page below. This should be in lowercase. + * + * Signature must be calculated on the server-side. This field is only required for authentication when uploading a file from the client side. + * @param list $tags Set the tags while uploading the file. + * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. + * If this field is not specified and the file is overwritten, the existing tags will be removed. + * @param Transformation $transformation Configure pre-processing (`pre`) and post-processing (`post`) transformations. + * + * - `pre` — applied before the file is uploaded to the Media Library. + * Useful for reducing file size or applying basic optimizations upfront (e.g., resize, compress). + * + * - `post` — applied immediately after upload. + * Ideal for generating transformed versions (like video encodes or thumbnails) in advance, so they're ready for delivery without delay. + * + * You can mix and match any combination of post-processing types. + * @param bool $useUniqueFileName Whether to use a unique filename for this file or not. + * + * If `true`, ImageKit.io will add a unique suffix to the filename parameter to get a unique filename. + * + * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. + * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + */ + public function upload( + $file, + $fileName, + $token = omit, + $checks = omit, + $customCoordinates = omit, + $customMetadata = omit, + $description = omit, + $expire = omit, + $extensions = omit, + $folder = omit, + $isPrivateFile = omit, + $isPublished = omit, + $overwriteAITags = omit, + $overwriteCustomMetadata = omit, + $overwriteFile = omit, + $overwriteTags = omit, + $publicKey = omit, + $responseFields = omit, + $signature = omit, + $tags = omit, + $transformation = omit, + $useUniqueFileName = omit, + $webhookURL = omit, + ?RequestOptions $requestOptions = null, + ): FileUploadResponse; +} diff --git a/src/Core/ServiceContracts/Folders/JobContract.php b/src/Core/ServiceContracts/Folders/JobContract.php new file mode 100644 index 00000000..85a41014 --- /dev/null +++ b/src/Core/ServiceContracts/Folders/JobContract.php @@ -0,0 +1,19 @@ + $origin], + $requestOptions + ); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'post', + path: 'v1/accounts/origins', + body: (object) $parsed['origin'], + options: $options, + convert: OriginResponse::class, + ); + } + + /** + * @api + * + * **Note:** This API is currently in beta. + * Updates the origin identified by `id` and returns the updated origin object. + * + * @param S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim $origin schema for origin request resources + */ + public function update( + string $id, + $origin, + ?RequestOptions $requestOptions = null + ): S31|S3Compatible1|CloudinaryBackup1|WebFolder1|WebProxy1|Gcs1|AzureBlob1|AkeneoPim1 { + [$parsed, $options] = OriginUpdateParams::parseRequest( + ['origin' => $origin], + $requestOptions + ); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'put', + path: ['v1/accounts/origins/%1$s', $id], + body: (object) $parsed['origin'], + options: $options, + convert: OriginResponse::class, + ); + } + + /** + * @api + * + * **Note:** This API is currently in beta. + * Returns an array of all configured origins for the current account. + * + * @return list + */ + public function list(?RequestOptions $requestOptions = null): array + { + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'get', + path: 'v1/accounts/origins', + options: $requestOptions, + convert: new ListOf(OriginResponse::class), + ); + } + + /** + * @api + * + * **Note:** This API is currently in beta. + * Permanently removes the origin identified by `id`. If the origin is in use by any URL‑endpoints, the API will return an error. + */ + public function delete( + string $id, + ?RequestOptions $requestOptions = null + ): mixed { + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'delete', + path: ['v1/accounts/origins/%1$s', $id], + options: $requestOptions, + convert: null, + ); + } + + /** + * @api + * + * **Note:** This API is currently in beta. + * Retrieves the origin identified by `id`. + */ + public function get( + string $id, + ?RequestOptions $requestOptions = null + ): S31|S3Compatible1|CloudinaryBackup1|WebFolder1|WebProxy1|Gcs1|AzureBlob1|AkeneoPim1 { + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'get', + path: ['v1/accounts/origins/%1$s', $id], + options: $requestOptions, + convert: OriginResponse::class, + ); + } +} diff --git a/src/Core/Services/Accounts/URLEndpointsService.php b/src/Core/Services/Accounts/URLEndpointsService.php new file mode 100644 index 00000000..a571f965 --- /dev/null +++ b/src/Core/Services/Accounts/URLEndpointsService.php @@ -0,0 +1,163 @@ + $origins Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. + * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) + * @param Cloudinary|Imgix|Akamai $urlRewriter configuration for third-party URL rewriting + */ + public function create( + $description, + $origins = omit, + $urlPrefix = omit, + $urlRewriter = omit, + ?RequestOptions $requestOptions = null, + ): URLEndpointResponse { + [$parsed, $options] = URLEndpointCreateParams::parseRequest( + [ + 'description' => $description, + 'origins' => $origins, + 'urlPrefix' => $urlPrefix, + 'urlRewriter' => $urlRewriter, + ], + $requestOptions, + ); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'post', + path: 'v1/accounts/url-endpoints', + body: (object) $parsed, + options: $options, + convert: URLEndpointResponse::class, + ); + } + + /** + * @api + * + * **Note:** This API is currently in beta. + * Updates the URL‑endpoint identified by `id` and returns the updated object. + * + * @param string $description description of the URL endpoint + * @param list $origins Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. + * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) + * @param Cloudinary1|Imgix1|Akamai1 $urlRewriter configuration for third-party URL rewriting + */ + public function update( + string $id, + $description, + $origins = omit, + $urlPrefix = omit, + $urlRewriter = omit, + ?RequestOptions $requestOptions = null, + ): URLEndpointResponse { + [$parsed, $options] = URLEndpointUpdateParams::parseRequest( + [ + 'description' => $description, + 'origins' => $origins, + 'urlPrefix' => $urlPrefix, + 'urlRewriter' => $urlRewriter, + ], + $requestOptions, + ); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'put', + path: ['v1/accounts/url-endpoints/%1$s', $id], + body: (object) $parsed, + options: $options, + convert: URLEndpointResponse::class, + ); + } + + /** + * @api + * + * **Note:** This API is currently in beta. + * Returns an array of all URL‑endpoints configured including the default URL-endpoint generated by ImageKit during account creation. + * + * @return list + */ + public function list(?RequestOptions $requestOptions = null): array + { + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'get', + path: 'v1/accounts/url-endpoints', + options: $requestOptions, + convert: new ListOf(URLEndpointResponse::class), + ); + } + + /** + * @api + * + * **Note:** This API is currently in beta. + * Deletes the URL‑endpoint identified by `id`. You cannot delete the default URL‑endpoint created by ImageKit during account creation. + */ + public function delete( + string $id, + ?RequestOptions $requestOptions = null + ): mixed { + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'delete', + path: ['v1/accounts/url-endpoints/%1$s', $id], + options: $requestOptions, + convert: null, + ); + } + + /** + * @api + * + * **Note:** This API is currently in beta. + * Retrieves the URL‑endpoint identified by `id`. + */ + public function get( + string $id, + ?RequestOptions $requestOptions = null + ): URLEndpointResponse { + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'get', + path: ['v1/accounts/url-endpoints/%1$s', $id], + options: $requestOptions, + convert: URLEndpointResponse::class, + ); + } +} diff --git a/src/Core/Services/Accounts/UsageService.php b/src/Core/Services/Accounts/UsageService.php new file mode 100644 index 00000000..ffba52fa --- /dev/null +++ b/src/Core/Services/Accounts/UsageService.php @@ -0,0 +1,47 @@ + $endDate, 'startDate' => $startDate], + $requestOptions + ); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'get', + path: 'v1/accounts/usage', + query: $parsed, + options: $options, + convert: UsageGetResponse::class, + ); + } +} diff --git a/src/Core/Services/AccountsService.php b/src/Core/Services/AccountsService.php new file mode 100644 index 00000000..c65638a4 --- /dev/null +++ b/src/Core/Services/AccountsService.php @@ -0,0 +1,39 @@ +usage = new UsageService($this->client); + $this->origins = new OriginsService($this->client); + $this->urlEndpoints = new URLEndpointsService($this->client); + } +} diff --git a/src/Core/Services/AssetsService.php b/src/Core/Services/AssetsService.php new file mode 100644 index 00000000..cd4a536f --- /dev/null +++ b/src/Core/Services/AssetsService.php @@ -0,0 +1,95 @@ + "7d"`. + * + * Note : When the searchQuery parameter is present, the following query parameters will have no effect on the result: + * + * 1. `tags` + * 2. `type` + * 3. `name` + * + * [Learn more](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#advanced-search-queries) from examples. + * @param int $skip the number of results to skip before returning results + * @param Sort::* $sort sort the results by one of the supported fields in ascending or descending order + * @param Type::* $type Filter results by asset type. + * + * - `file` — returns only files + * - `file-version` — returns specific file versions + * - `folder` — returns only folders + * - `all` — returns both files and folders (excludes `file-version`) + * + * @return list + */ + public function list( + $fileType = omit, + $limit = omit, + $path = omit, + $searchQuery = omit, + $skip = omit, + $sort = omit, + $type = omit, + ?RequestOptions $requestOptions = null, + ): array { + [$parsed, $options] = AssetListParams::parseRequest( + [ + 'fileType' => $fileType, + 'limit' => $limit, + 'path' => $path, + 'searchQuery' => $searchQuery, + 'skip' => $skip, + 'sort' => $sort, + 'type' => $type, + ], + $requestOptions, + ); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'get', + path: 'v1/files', + query: $parsed, + options: $options, + convert: new ListOf(AssetListResponseItem::class), + ); + } +} diff --git a/src/Core/Services/Beta/V2/FilesService.php b/src/Core/Services/Beta/V2/FilesService.php new file mode 100644 index 00000000..9cb9ef2f --- /dev/null +++ b/src/Core/Services/Beta/V2/FilesService.php @@ -0,0 +1,160 @@ + $customMetadata JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. + * @param string $description optional text to describe the contents of the file + * @param list $extensions Array of extensions to be applied to the image. Each extension can be configured with specific parameters based on the extension type. + * @param string $folder The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. Using multiple `/` creates a nested folder. + * @param bool $isPrivateFile Whether to mark the file as private or not. + * + * If `true`, the file is marked as private and is accessible only using named transformation or signed URL. + * @param bool $isPublished Whether to upload file as published or not. + * + * If `false`, the file is marked as unpublished, which restricts access to the file only via the media library. Files in draft or unpublished state can only be publicly accessed after being published. + * + * The option to upload in draft state is only available in custom enterprise pricing plans. + * @param bool $overwriteAITags If set to `true` and a file already exists at the exact location, its AITags will be removed. Set `overwriteAITags` to `false` to preserve AITags. + * @param bool $overwriteCustomMetadata if the request does not have `customMetadata`, and a file already exists at the exact location, existing customMetadata will be removed + * @param bool $overwriteFile if `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately + * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed + * @param list $responseFields array of response field keys to include in the API response body + * @param list $tags Set the tags while uploading the file. + * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. + * If this field is not specified and the file is overwritten, the existing tags will be removed. + * @param Transformation $transformation Configure pre-processing (`pre`) and post-processing (`post`) transformations. + * + * - `pre` — applied before the file is uploaded to the Media Library. + * Useful for reducing file size or applying basic optimizations upfront (e.g., resize, compress). + * + * - `post` — applied immediately after upload. + * Ideal for generating transformed versions (like video encodes or thumbnails) in advance, so they're ready for delivery without delay. + * + * You can mix and match any combination of post-processing types. + * @param bool $useUniqueFileName Whether to use a unique filename for this file or not. + * + * If `true`, ImageKit.io will add a unique suffix to the filename parameter to get a unique filename. + * + * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. + * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + */ + public function upload( + $file, + $fileName, + $token = omit, + $checks = omit, + $customCoordinates = omit, + $customMetadata = omit, + $description = omit, + $extensions = omit, + $folder = omit, + $isPrivateFile = omit, + $isPublished = omit, + $overwriteAITags = omit, + $overwriteCustomMetadata = omit, + $overwriteFile = omit, + $overwriteTags = omit, + $responseFields = omit, + $tags = omit, + $transformation = omit, + $useUniqueFileName = omit, + $webhookURL = omit, + ?RequestOptions $requestOptions = null, + ): FileUploadResponse { + [$parsed, $options] = FileUploadParams::parseRequest( + [ + 'file' => $file, + 'fileName' => $fileName, + 'token' => $token, + 'checks' => $checks, + 'customCoordinates' => $customCoordinates, + 'customMetadata' => $customMetadata, + 'description' => $description, + 'extensions' => $extensions, + 'folder' => $folder, + 'isPrivateFile' => $isPrivateFile, + 'isPublished' => $isPublished, + 'overwriteAITags' => $overwriteAITags, + 'overwriteCustomMetadata' => $overwriteCustomMetadata, + 'overwriteFile' => $overwriteFile, + 'overwriteTags' => $overwriteTags, + 'responseFields' => $responseFields, + 'tags' => $tags, + 'transformation' => $transformation, + 'useUniqueFileName' => $useUniqueFileName, + 'webhookURL' => $webhookURL, + ], + $requestOptions, + ); + $path = $this + ->client + ->baseUrlOverridden ? 'api/v2/files/upload' : 'https://upload.imagekit.io/api/v2/files/upload'; + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'post', + path: $path, + headers: ['Content-Type' => 'multipart/form-data'], + body: (object) $parsed, + options: $options, + convert: FileUploadResponse::class, + ); + } +} diff --git a/src/Core/Services/Beta/V2Service.php b/src/Core/Services/Beta/V2Service.php new file mode 100644 index 00000000..425c2750 --- /dev/null +++ b/src/Core/Services/Beta/V2Service.php @@ -0,0 +1,25 @@ +files = new FilesService($this->client); + } +} diff --git a/src/Core/Services/BetaService.php b/src/Core/Services/BetaService.php new file mode 100644 index 00000000..82b57a59 --- /dev/null +++ b/src/Core/Services/BetaService.php @@ -0,0 +1,25 @@ +v2 = new V2Service($this->client); + } +} diff --git a/src/Core/Services/Cache/InvalidationService.php b/src/Core/Services/Cache/InvalidationService.php new file mode 100644 index 00000000..4d66728b --- /dev/null +++ b/src/Core/Services/Cache/InvalidationService.php @@ -0,0 +1,64 @@ + $url], + $requestOptions + ); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'post', + path: 'v1/files/purge', + body: (object) $parsed, + options: $options, + convert: InvalidationNewResponse::class, + ); + } + + /** + * @api + * + * This API returns the status of a purge cache request. + */ + public function get( + string $requestID, + ?RequestOptions $requestOptions = null + ): InvalidationGetResponse { + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'get', + path: ['v1/files/purge/%1$s', $requestID], + options: $requestOptions, + convert: InvalidationGetResponse::class, + ); + } +} diff --git a/src/Core/Services/CacheService.php b/src/Core/Services/CacheService.php new file mode 100644 index 00000000..1fd48de0 --- /dev/null +++ b/src/Core/Services/CacheService.php @@ -0,0 +1,25 @@ +invalidation = new InvalidationService($this->client); + } +} diff --git a/src/Core/Services/CustomMetadataFieldsService.php b/src/Core/Services/CustomMetadataFieldsService.php new file mode 100644 index 00000000..1c8a67bd --- /dev/null +++ b/src/Core/Services/CustomMetadataFieldsService.php @@ -0,0 +1,132 @@ + $label, 'name' => $name, 'schema' => $schema], + $requestOptions + ); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'post', + path: 'v1/customMetadataFields', + body: (object) $parsed, + options: $options, + convert: CustomMetadataField::class, + ); + } + + /** + * @api + * + * This API updates the label or schema of an existing custom metadata field. + * + * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. This parameter is required if `schema` is not provided. + * @param Schema1 $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. + */ + public function update( + string $id, + $label = omit, + $schema = omit, + ?RequestOptions $requestOptions = null, + ): CustomMetadataField { + [$parsed, $options] = CustomMetadataFieldUpdateParams::parseRequest( + ['label' => $label, 'schema' => $schema], + $requestOptions + ); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'patch', + path: ['v1/customMetadataFields/%1$s', $id], + body: (object) $parsed, + options: $options, + convert: CustomMetadataField::class, + ); + } + + /** + * @api + * + * This API returns the array of created custom metadata field objects. By default the API returns only non deleted field objects, but you can include deleted fields in the API response. + * + * @param bool $includeDeleted set it to `true` to include deleted field objects in the API response + * + * @return list + */ + public function list( + $includeDeleted = omit, + ?RequestOptions $requestOptions = null + ): array { + [$parsed, $options] = CustomMetadataFieldListParams::parseRequest( + ['includeDeleted' => $includeDeleted], + $requestOptions + ); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'get', + path: 'v1/customMetadataFields', + query: $parsed, + options: $options, + convert: new ListOf(CustomMetadataField::class), + ); + } + + /** + * @api + * + * This API deletes a custom metadata field. Even after deleting a custom metadata field, you cannot create any new custom metadata field with the same name. + */ + public function delete( + string $id, + ?RequestOptions $requestOptions = null + ): CustomMetadataFieldDeleteResponse { + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'delete', + path: ['v1/customMetadataFields/%1$s', $id], + options: $requestOptions, + convert: CustomMetadataFieldDeleteResponse::class, + ); + } +} diff --git a/src/Core/Services/Files/BulkService.php b/src/Core/Services/Files/BulkService.php new file mode 100644 index 00000000..23fc95dd --- /dev/null +++ b/src/Core/Services/Files/BulkService.php @@ -0,0 +1,139 @@ + $fileIDs an array of fileIds which you want to delete + */ + public function delete( + $fileIDs, + ?RequestOptions $requestOptions = null + ): BulkDeleteResponse { + [$parsed, $options] = BulkDeleteParams::parseRequest( + ['fileIDs' => $fileIDs], + $requestOptions + ); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'post', + path: 'v1/files/batch/deleteByFileIds', + body: (object) $parsed, + options: $options, + convert: BulkDeleteResponse::class, + ); + } + + /** + * @api + * + * This API adds tags to multiple files in bulk. A maximum of 50 files can be specified at a time. + * + * @param list $fileIDs an array of fileIds to which you want to add tags + * @param list $tags an array of tags that you want to add to the files + */ + public function addTags( + $fileIDs, + $tags, + ?RequestOptions $requestOptions = null + ): BulkAddTagsResponse { + [$parsed, $options] = BulkAddTagsParams::parseRequest( + ['fileIDs' => $fileIDs, 'tags' => $tags], + $requestOptions + ); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'post', + path: 'v1/files/addTags', + body: (object) $parsed, + options: $options, + convert: BulkAddTagsResponse::class, + ); + } + + /** + * @api + * + * This API removes AITags from multiple files in bulk. A maximum of 50 files can be specified at a time. + * + * @param list $aiTags an array of AITags that you want to remove from the files + * @param list $fileIDs an array of fileIds from which you want to remove AITags + */ + public function removeAITags( + $aiTags, + $fileIDs, + ?RequestOptions $requestOptions = null + ): BulkRemoveAITagsResponse { + [$parsed, $options] = BulkRemoveAITagsParams::parseRequest( + ['aiTags' => $aiTags, 'fileIDs' => $fileIDs], + $requestOptions + ); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'post', + path: 'v1/files/removeAITags', + body: (object) $parsed, + options: $options, + convert: BulkRemoveAITagsResponse::class, + ); + } + + /** + * @api + * + * This API removes tags from multiple files in bulk. A maximum of 50 files can be specified at a time. + * + * @param list $fileIDs an array of fileIds from which you want to remove tags + * @param list $tags an array of tags that you want to remove from the files + */ + public function removeTags( + $fileIDs, + $tags, + ?RequestOptions $requestOptions = null + ): BulkRemoveTagsResponse { + [$parsed, $options] = BulkRemoveTagsParams::parseRequest( + ['fileIDs' => $fileIDs, 'tags' => $tags], + $requestOptions + ); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'post', + path: 'v1/files/removeTags', + body: (object) $parsed, + options: $options, + convert: BulkRemoveTagsResponse::class, + ); + } +} diff --git a/src/Core/Services/Files/MetadataService.php b/src/Core/Services/Files/MetadataService.php new file mode 100644 index 00000000..4c47b2ec --- /dev/null +++ b/src/Core/Services/Files/MetadataService.php @@ -0,0 +1,65 @@ +client->request( + method: 'get', + path: ['v1/files/%1$s/metadata', $fileID], + options: $requestOptions, + convert: Metadata::class, + ); + } + + /** + * @api + * + * Get image EXIF, pHash, and other metadata from ImageKit.io powered remote URL using this API. + * + * @param string $url Should be a valid file URL. It should be accessible using your ImageKit.io account. + */ + public function getFromURL( + $url, + ?RequestOptions $requestOptions = null + ): Metadata { + [$parsed, $options] = MetadataGetFromURLParams::parseRequest( + ['url' => $url], + $requestOptions + ); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'get', + path: 'v1/files/metadata', + query: $parsed, + options: $options, + convert: Metadata::class, + ); + } +} diff --git a/src/Core/Services/Files/VersionsService.php b/src/Core/Services/Files/VersionsService.php new file mode 100644 index 00000000..0c62d1e2 --- /dev/null +++ b/src/Core/Services/Files/VersionsService.php @@ -0,0 +1,129 @@ + + */ + public function list( + string $fileID, + ?RequestOptions $requestOptions = null + ): array { + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'get', + path: ['v1/files/%1$s/versions', $fileID], + options: $requestOptions, + convert: new ListOf(File::class), + ); + } + + /** + * @api + * + * This API deletes a non-current file version permanently. The API returns an empty response. + * + * Note: If you want to delete all versions of a file, use the delete file API. + * + * @param string $fileID + */ + public function delete( + string $versionID, + $fileID, + ?RequestOptions $requestOptions = null + ): VersionDeleteResponse { + [$parsed, $options] = VersionDeleteParams::parseRequest( + ['fileID' => $fileID], + $requestOptions + ); + $fileID = $parsed['fileID']; + unset($parsed['fileID']); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'delete', + path: ['v1/files/%1$s/versions/%2$s', $fileID, $versionID], + options: $options, + convert: VersionDeleteResponse::class, + ); + } + + /** + * @api + * + * This API returns an object with details or attributes of a file version. + * + * @param string $fileID + */ + public function get( + string $versionID, + $fileID, + ?RequestOptions $requestOptions = null + ): File { + [$parsed, $options] = VersionGetParams::parseRequest( + ['fileID' => $fileID], + $requestOptions + ); + $fileID = $parsed['fileID']; + unset($parsed['fileID']); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'get', + path: ['v1/files/%1$s/versions/%2$s', $fileID, $versionID], + options: $options, + convert: File::class, + ); + } + + /** + * @api + * + * This API restores a file version as the current file version. + * + * @param string $fileID + */ + public function restore( + string $versionID, + $fileID, + ?RequestOptions $requestOptions = null + ): File { + [$parsed, $options] = VersionRestoreParams::parseRequest( + ['fileID' => $fileID], + $requestOptions + ); + $fileID = $parsed['fileID']; + unset($parsed['fileID']); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'put', + path: ['v1/files/%1$s/versions/%2$s/restore', $fileID, $versionID], + options: $options, + convert: File::class, + ); + } +} diff --git a/src/Core/Services/FilesService.php b/src/Core/Services/FilesService.php new file mode 100644 index 00000000..5eb5ecbf --- /dev/null +++ b/src/Core/Services/FilesService.php @@ -0,0 +1,401 @@ +bulk = new BulkService($this->client); + $this->versions = new VersionsService($this->client); + $this->metadata = new MetadataService($this->client); + } + + /** + * @api + * + * This API updates the details or attributes of the current version of the file. You can update `tags`, `customCoordinates`, `customMetadata`, publication status, remove existing `AITags` and apply extensions using this API. + * + * @param UpdateFileDetails|ChangePublicationStatus $update + */ + public function update( + string $fileID, + $update = omit, + ?RequestOptions $requestOptions = null + ): FileUpdateResponse { + [$parsed, $options] = FileUpdateParams::parseRequest( + ['update' => $update], + $requestOptions + ); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'patch', + path: ['v1/files/%1$s/details', $fileID], + body: (object) $parsed['update'], + options: $options, + convert: FileUpdateResponse::class, + ); + } + + /** + * @api + * + * This API deletes the file and all its file versions permanently. + * + * Note: If a file or specific transformation has been requested in the past, then the response is cached. Deleting a file does not purge the cache. You can purge the cache using purge cache API. + */ + public function delete( + string $fileID, + ?RequestOptions $requestOptions = null + ): mixed { + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'delete', + path: ['v1/files/%1$s', $fileID], + options: $requestOptions, + convert: null, + ); + } + + /** + * @api + * + * This will copy a file from one folder to another. + * + * Note: If any file at the destination has the same name as the source file, then the source file and its versions (if `includeFileVersions` is set to true) will be appended to the destination file version history. + * + * @param string $destinationPath full path to the folder you want to copy the above file into + * @param string $sourceFilePath the full path of the file you want to copy + * @param bool $includeFileVersions Option to copy all versions of a file. By default, only the current version of the file is copied. When set to true, all versions of the file will be copied. Default value - `false`. + */ + public function copy( + $destinationPath, + $sourceFilePath, + $includeFileVersions = omit, + ?RequestOptions $requestOptions = null, + ): FileCopyResponse { + [$parsed, $options] = FileCopyParams::parseRequest( + [ + 'destinationPath' => $destinationPath, + 'sourceFilePath' => $sourceFilePath, + 'includeFileVersions' => $includeFileVersions, + ], + $requestOptions, + ); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'post', + path: 'v1/files/copy', + body: (object) $parsed, + options: $options, + convert: FileCopyResponse::class, + ); + } + + /** + * @api + * + * This API returns an object with details or attributes about the current version of the file. + */ + public function get( + string $fileID, + ?RequestOptions $requestOptions = null + ): File { + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'get', + path: ['v1/files/%1$s/details', $fileID], + options: $requestOptions, + convert: File::class, + ); + } + + /** + * @api + * + * This will move a file and all its versions from one folder to another. + * + * Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file. + * + * @param string $destinationPath full path to the folder you want to move the above file into + * @param string $sourceFilePath the full path of the file you want to move + */ + public function move( + $destinationPath, + $sourceFilePath, + ?RequestOptions $requestOptions = null + ): FileMoveResponse { + [$parsed, $options] = FileMoveParams::parseRequest( + [ + 'destinationPath' => $destinationPath, + 'sourceFilePath' => $sourceFilePath, + ], + $requestOptions, + ); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'post', + path: 'v1/files/move', + body: (object) $parsed, + options: $options, + convert: FileMoveResponse::class, + ); + } + + /** + * @api + * + * You can rename an already existing file in the media library using rename file API. This operation would rename all file versions of the file. + * + * Note: The old URLs will stop working. The file/file version URLs cached on CDN will continue to work unless a purge is requested. + * + * @param string $filePath the full path of the file you want to rename + * @param string $newFileName The new name of the file. A filename can contain: + * + * Alphanumeric Characters: `a-z`, `A-Z`, `0-9` (including Unicode letters, marks, and numerals in other languages). + * Special Characters: `.`, `_`, and `-`. + * + * Any other character, including space, will be replaced by `_`. + * @param bool $purgeCache Option to purge cache for the old file and its versions' URLs. + * + * When set to true, it will internally issue a purge cache request on CDN to remove cached content of old file and its versions. This purge request is counted against your monthly purge quota. + * + * Note: If the old file were accessible at `https://ik.imagekit.io/demo/old-filename.jpg`, a purge cache request would be issued against `https://ik.imagekit.io/demo/old-filename.jpg*` (with a wildcard at the end). It will remove the file and its versions' URLs and any transformations made using query parameters on this file or its versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. + * + * Default value - `false` + */ + public function rename( + $filePath, + $newFileName, + $purgeCache = omit, + ?RequestOptions $requestOptions = null, + ): FileRenameResponse { + [$parsed, $options] = FileRenameParams::parseRequest( + [ + 'filePath' => $filePath, + 'newFileName' => $newFileName, + 'purgeCache' => $purgeCache, + ], + $requestOptions, + ); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'put', + path: 'v1/files/rename', + body: (object) $parsed, + options: $options, + convert: FileRenameResponse::class, + ); + } + + /** + * @api + * + * ImageKit.io allows you to upload files directly from both the server and client sides. For server-side uploads, private API key authentication is used. For client-side uploads, generate a one-time `token`, `signature`, and `expire` from your secure backend using private API. [Learn more](/docs/api-reference/upload-file/upload-file#how-to-implement-client-side-file-upload) about how to implement client-side file upload. + * + * The [V2 API](/docs/api-reference/upload-file/upload-file-v2) enhances security by verifying the entire payload using JWT. + * + * **File size limit** \ + * On the free plan, the maximum upload file sizes are 20MB for images, audio, and raw files and 100MB for videos. On the paid plan, these limits increase to 40MB for images, audio, and raw files and 2GB for videos. These limits can be further increased with higher-tier plans. + * + * **Version limit** \ + * A file can have a maximum of 100 versions. + * + * **Demo applications** + * + * - A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more. + * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. + * + * @param string $file The API accepts any of the following: + * + * - **Binary data** – send the raw bytes as `multipart/form-data`. + * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. + * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. + * + * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + * @param string $fileName The name with which the file has to be uploaded. + * The file name can contain: + * + * - Alphanumeric Characters: `a-z`, `A-Z`, `0-9`. + * - Special Characters: `.`, `-` + * + * Any other character including space will be replaced by `_` + * @param string $token A unique value that the ImageKit.io server will use to recognize and prevent subsequent retries for the same request. We suggest using V4 UUIDs, or another random string with enough entropy to avoid collisions. This field is only required for authentication when uploading a file from the client side. + * + * **Note**: Sending a value that has been used in the past will result in a validation error. Even if your previous request resulted in an error, you should always send a new value for this field. + * @param string $checks Server-side checks to run on the asset. + * Read more about [Upload API checks](/docs/api-reference/upload-file/upload-file#upload-api-checks). + * @param string $customCoordinates Define an important area in the image. This is only relevant for image type files. + * + * - To be passed as a string with the x and y coordinates of the top-left corner, and width and height of the area of interest in the format `x,y,width,height`. For example - `10,10,100,100` + * - Can be used with fo-customtransformation. + * - If this field is not specified and the file is overwritten, then customCoordinates will be removed. + * @param array $customMetadata JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. + * @param string $description optional text to describe the contents of the file + * @param int $expire The time until your signature is valid. It must be a [Unix time](https://en.wikipedia.org/wiki/Unix_time) in less than 1 hour into the future. It should be in seconds. This field is only required for authentication when uploading a file from the client side. + * @param list $extensions Array of extensions to be applied to the image. Each extension can be configured with specific parameters based on the extension type. + * @param string $folder The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. + * + * The folder name can contain: + * + * - Alphanumeric Characters: `a-z` , `A-Z` , `0-9` + * - Special Characters: `/` , `_` , `-` + * + * Using multiple `/` creates a nested folder. + * @param bool $isPrivateFile Whether to mark the file as private or not. + * + * If `true`, the file is marked as private and is accessible only using named transformation or signed URL. + * @param bool $isPublished Whether to upload file as published or not. + * + * If `false`, the file is marked as unpublished, which restricts access to the file only via the media library. Files in draft or unpublished state can only be publicly accessed after being published. + * + * The option to upload in draft state is only available in custom enterprise pricing plans. + * @param bool $overwriteAITags If set to `true` and a file already exists at the exact location, its AITags will be removed. Set `overwriteAITags` to `false` to preserve AITags. + * @param bool $overwriteCustomMetadata if the request does not have `customMetadata`, and a file already exists at the exact location, existing customMetadata will be removed + * @param bool $overwriteFile if `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately + * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed + * @param string $publicKey Your ImageKit.io public key. This field is only required for authentication when uploading a file from the client side. + * @param list $responseFields array of response field keys to include in the API response body + * @param string $signature HMAC-SHA1 digest of the token+expire using your ImageKit.io private API key as a key. Learn how to create a signature on the page below. This should be in lowercase. + * + * Signature must be calculated on the server-side. This field is only required for authentication when uploading a file from the client side. + * @param list $tags Set the tags while uploading the file. + * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. + * If this field is not specified and the file is overwritten, the existing tags will be removed. + * @param Transformation $transformation Configure pre-processing (`pre`) and post-processing (`post`) transformations. + * + * - `pre` — applied before the file is uploaded to the Media Library. + * Useful for reducing file size or applying basic optimizations upfront (e.g., resize, compress). + * + * - `post` — applied immediately after upload. + * Ideal for generating transformed versions (like video encodes or thumbnails) in advance, so they're ready for delivery without delay. + * + * You can mix and match any combination of post-processing types. + * @param bool $useUniqueFileName Whether to use a unique filename for this file or not. + * + * If `true`, ImageKit.io will add a unique suffix to the filename parameter to get a unique filename. + * + * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. + * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + */ + public function upload( + $file, + $fileName, + $token = omit, + $checks = omit, + $customCoordinates = omit, + $customMetadata = omit, + $description = omit, + $expire = omit, + $extensions = omit, + $folder = omit, + $isPrivateFile = omit, + $isPublished = omit, + $overwriteAITags = omit, + $overwriteCustomMetadata = omit, + $overwriteFile = omit, + $overwriteTags = omit, + $publicKey = omit, + $responseFields = omit, + $signature = omit, + $tags = omit, + $transformation = omit, + $useUniqueFileName = omit, + $webhookURL = omit, + ?RequestOptions $requestOptions = null, + ): FileUploadResponse { + [$parsed, $options] = FileUploadParams::parseRequest( + [ + 'file' => $file, + 'fileName' => $fileName, + 'token' => $token, + 'checks' => $checks, + 'customCoordinates' => $customCoordinates, + 'customMetadata' => $customMetadata, + 'description' => $description, + 'expire' => $expire, + 'extensions' => $extensions, + 'folder' => $folder, + 'isPrivateFile' => $isPrivateFile, + 'isPublished' => $isPublished, + 'overwriteAITags' => $overwriteAITags, + 'overwriteCustomMetadata' => $overwriteCustomMetadata, + 'overwriteFile' => $overwriteFile, + 'overwriteTags' => $overwriteTags, + 'publicKey' => $publicKey, + 'responseFields' => $responseFields, + 'signature' => $signature, + 'tags' => $tags, + 'transformation' => $transformation, + 'useUniqueFileName' => $useUniqueFileName, + 'webhookURL' => $webhookURL, + ], + $requestOptions, + ); + $path = $this + ->client + ->baseUrlOverridden ? 'api/v1/files/upload' : 'https://upload.imagekit.io/api/v1/files/upload'; + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'post', + path: $path, + headers: ['Content-Type' => 'multipart/form-data'], + body: (object) $parsed, + options: $options, + convert: FileUploadResponse::class, + ); + } +} diff --git a/src/Core/Services/Folders/JobService.php b/src/Core/Services/Folders/JobService.php new file mode 100644 index 00000000..bb21f3bf --- /dev/null +++ b/src/Core/Services/Folders/JobService.php @@ -0,0 +1,36 @@ +client->request( + method: 'get', + path: ['v1/bulkJobs/%1$s', $jobID], + options: $requestOptions, + convert: JobGetResponse::class, + ); + } +} diff --git a/src/Core/Services/FoldersService.php b/src/Core/Services/FoldersService.php new file mode 100644 index 00000000..31fd4ac5 --- /dev/null +++ b/src/Core/Services/FoldersService.php @@ -0,0 +1,203 @@ +job = new JobService($this->client); + } + + /** + * @api + * + * This will create a new folder. You can specify the folder name and location of the parent folder where this new folder should be created. + * + * @param string $folderName The folder will be created with this name. + * + * All characters except alphabets and numbers (inclusive of unicode letters, marks, and numerals in other languages) will be replaced by an underscore i.e. `_`. + * @param string $parentFolderPath The folder where the new folder should be created, for root use `/` else the path e.g. `containing/folder/`. + * + * Note: If any folder(s) is not present in the parentFolderPath parameter, it will be automatically created. For example, if you pass `/product/images/summer`, then `product`, `images`, and `summer` folders will be created if they don't already exist. + */ + public function create( + $folderName, + $parentFolderPath, + ?RequestOptions $requestOptions = null + ): FolderNewResponse { + [$parsed, $options] = FolderCreateParams::parseRequest( + ['folderName' => $folderName, 'parentFolderPath' => $parentFolderPath], + $requestOptions, + ); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'post', + path: 'v1/folder', + body: (object) $parsed, + options: $options, + convert: FolderNewResponse::class, + ); + } + + /** + * @api + * + * This will delete a folder and all its contents permanently. The API returns an empty response. + * + * @param string $folderPath Full path to the folder you want to delete. For example `/folder/to/delete/`. + */ + public function delete( + $folderPath, + ?RequestOptions $requestOptions = null + ): FolderDeleteResponse { + [$parsed, $options] = FolderDeleteParams::parseRequest( + ['folderPath' => $folderPath], + $requestOptions + ); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'delete', + path: 'v1/folder', + body: (object) $parsed, + options: $options, + convert: FolderDeleteResponse::class, + ); + } + + /** + * @api + * + * This will copy one folder into another. The selected folder, its nested folders, files, and their versions (in `includeVersions` is set to true) are copied in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history. + * + * @param string $destinationPath full path to the destination folder where you want to copy the source folder into + * @param string $sourceFolderPath the full path to the source folder you want to copy + * @param bool $includeVersions Option to copy all versions of files that are nested inside the selected folder. By default, only the current version of each file will be copied. When set to true, all versions of each file will be copied. Default value - `false`. + */ + public function copy( + $destinationPath, + $sourceFolderPath, + $includeVersions = omit, + ?RequestOptions $requestOptions = null, + ): FolderCopyResponse { + [$parsed, $options] = FolderCopyParams::parseRequest( + [ + 'destinationPath' => $destinationPath, + 'sourceFolderPath' => $sourceFolderPath, + 'includeVersions' => $includeVersions, + ], + $requestOptions, + ); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'post', + path: 'v1/bulkJobs/copyFolder', + body: (object) $parsed, + options: $options, + convert: FolderCopyResponse::class, + ); + } + + /** + * @api + * + * This will move one folder into another. The selected folder, its nested folders, files, and their versions are moved in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history. + * + * @param string $destinationPath full path to the destination folder where you want to move the source folder into + * @param string $sourceFolderPath the full path to the source folder you want to move + */ + public function move( + $destinationPath, + $sourceFolderPath, + ?RequestOptions $requestOptions = null + ): FolderMoveResponse { + [$parsed, $options] = FolderMoveParams::parseRequest( + [ + 'destinationPath' => $destinationPath, + 'sourceFolderPath' => $sourceFolderPath, + ], + $requestOptions, + ); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'post', + path: 'v1/bulkJobs/moveFolder', + body: (object) $parsed, + options: $options, + convert: FolderMoveResponse::class, + ); + } + + /** + * @api + * + * This API allows you to rename an existing folder. The folder and all its nested assets and sub-folders will remain unchanged, but their paths will be updated to reflect the new folder name. + * + * @param string $folderPath the full path to the folder you want to rename + * @param string $newFolderName The new name for the folder. + * + * All characters except alphabets and numbers (inclusive of unicode letters, marks, and numerals in other languages) and `-` will be replaced by an underscore i.e. `_`. + * @param bool $purgeCache Option to purge cache for the old nested files and their versions' URLs. + * + * When set to true, it will internally issue a purge cache request on CDN to remove the cached content of the old nested files and their versions. There will only be one purge request for all the nested files, which will be counted against your monthly purge quota. + * + * Note: A purge cache request will be issued against `https://ik.imagekit.io/old/folder/path*` (with a wildcard at the end). This will remove all nested files, their versions' URLs, and any transformations made using query parameters on these files or their versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. + * + * Default value - `false` + */ + public function rename( + $folderPath, + $newFolderName, + $purgeCache = omit, + ?RequestOptions $requestOptions = null, + ): FolderRenameResponse { + [$parsed, $options] = FolderRenameParams::parseRequest( + [ + 'folderPath' => $folderPath, + 'newFolderName' => $newFolderName, + 'purgeCache' => $purgeCache, + ], + $requestOptions, + ); + + // @phpstan-ignore-next-line; + return $this->client->request( + method: 'post', + path: 'v1/bulkJobs/renameFolder', + body: (object) $parsed, + options: $options, + convert: FolderRenameResponse::class, + ); + } +} diff --git a/src/Core/Services/WebhooksService.php b/src/Core/Services/WebhooksService.php new file mode 100644 index 00000000..bbcf1195 --- /dev/null +++ b/src/Core/Services/WebhooksService.php @@ -0,0 +1,16 @@ + + */ + public static function get_object_vars(object $object1): array + { + return get_object_vars($object1); + } + + /** + * @template T + * + * @param array $array + * @param array $map + * + * @return array + */ + public static function array_transform_keys(array $array, array $map): array + { + $acc = []; + foreach ($array as $key => $value) { + $acc[$map[$key] ?? $key] = $value; + } + + return $acc; + } + + /** + * @param array $arr + * + * @return array + */ + public static function array_filter_omit(array $arr): array + { + return array_filter($arr, fn ($v, $_) => OMIT !== $v, mode: ARRAY_FILTER_USE_BOTH); + } + + /** + * @param string|int|list|callable $key + */ + public static function dig( + mixed $array, + string|int|array|callable $key + ): mixed { + if (is_callable($key)) { + return $key($array); + } + + if (is_array($array)) { + if ((is_string($key) || is_int($key)) && array_key_exists($key, array: $array)) { + return $array[$key]; + } + + if (is_array($key) && !empty($key)) { + if (array_key_exists($fst = $key[0], array: $array)) { + return self::dig($array[$fst], key: array_slice($key, 1)); + } + } + } + + return null; + } + + /** + * @param string|list $path + */ + public static function parsePath(string|array $path): string + { + if (is_string($path)) { + return $path; + } + + if (empty($path)) { + return ''; + } + + [$template] = $path; + + return sprintf($template, ...array_map('rawurlencode', array: array_slice($path, 1))); + } + + /** + * @param array $query + */ + public static function joinUri( + UriInterface $base, + string $path, + array $query = [] + ): UriInterface { + $parsed = parse_url($path); + if ($scheme = $parsed['scheme'] ?? null) { + $base = $base->withScheme($scheme); + } + if ($host = $parsed['host'] ?? null) { + $base = $base->withHost($host); + } + if ($port = $parsed['port'] ?? null) { + $base = $base->withPort($port); + } + if (($user = $parsed['user'] ?? null) || ($pass = $parsed['pass'] ?? null)) { + $base = $base->withUserInfo($user ?? '', $pass ?? null); + } + if ($path = $parsed['path'] ?? null) { + $base = str_starts_with($path, '/') ? $base->withPath($path) : $base->withPath($base->getPath().'/'.$path); + } + + [$q1, $q2] = [[], []]; + parse_str($base->getQuery(), $q1); + parse_str($parsed['query'] ?? '', $q2); + + $merged_query = array_merge_recursive($q1, $q2, $query); + $qs = http_build_query($merged_query, encoding_type: PHP_QUERY_RFC3986); + + return $base->withQuery($qs); + } + + /** + * @param array|null> $headers + */ + public static function withSetHeaders( + RequestInterface $req, + array $headers + ): RequestInterface { + foreach ($headers as $name => $value) { + if (is_null($value)) { + $req = $req->withoutHeader($name); + } else { + $value = is_int($value) + ? (string) $value + : (is_array($value) + ? array_map(static fn ($v) => (string) $v, array: $value) + : $value); + $req = $req->withHeader($name, $value); + } + } + + return $req; + } + + /** + * @return \Iterator + */ + public static function streamIterator(StreamInterface $stream): \Iterator + { + if (!$stream->isReadable()) { + return; + } + + try { + while (!$stream->eof()) { + yield $stream->read(self::BUF_SIZE); + } + } finally { + $stream->close(); + } + } + + /** + * @param bool|int|float|string|resource|\Traversable|array|null $body + */ + public static function withSetBody( + StreamFactoryInterface $factory, + RequestInterface $req, + mixed $body + ): RequestInterface { + if ($body instanceof StreamInterface) { + return $req->withBody($body); + } + + $contentType = $req->getHeaderLine('Content-Type'); + if (preg_match(self::JSON_CONTENT_TYPE, $contentType)) { + if (is_array($body) || is_object($body)) { + $encoded = json_encode($body, flags: self::JSON_ENCODE_FLAGS); + $stream = $factory->createStream($encoded); + + return $req->withBody($stream); + } + } + + if (preg_match('/^multipart\/form-data/', $contentType)) { + [$boundary, $gen] = self::encodeMultipartStreaming($body); + $encoded = implode('', iterator_to_array($gen)); + $stream = $factory->createStream($encoded); + + return $req->withHeader('Content-Type', "{$contentType}; boundary={$boundary}")->withBody($stream); + } + + if (is_resource($body)) { + $stream = $factory->createStreamFromResource($body); + + return $req->withBody($stream); + } + + return $req; + } + + /** + * @param \Iterator $stream + * + * @return \Iterator + */ + public static function decodeLines(\Iterator $stream): \Iterator + { + $buf = ''; + foreach ($stream as $chunk) { + $buf .= $chunk; + while (($pos = strpos($buf, "\n")) !== false) { + yield substr($buf, 0, $pos); + $buf = substr($buf, $pos + 1); + } + } + if ('' !== $buf) { + yield $buf; + } + } + + /** + * @param \Iterator $lines + * + * @return \Generator< + * array{ + * event?: string|null, data?: string|null, id?: string|null, retry?: int|null + * }, + * > + */ + public static function decodeSSE(\Iterator $lines): \Generator + { + $blank = ['event' => null, 'data' => null, 'id' => null, 'retry' => null]; + $acc = []; + + foreach ($lines as $line) { + $line = rtrim($line); + if ('' === $line) { + if (empty($acc)) { + continue; + } + + yield [...$blank, ...$acc]; + $acc = []; + } + + if (str_starts_with($line, ':')) { + continue; + } + + $matches = []; + if (preg_match('/^([^:]+):\s?(.*)$/', $line, $matches)) { + [, $field, $value] = $matches; + + switch ($field) { + case 'event': + $acc['event'] = $value; + + break; + + case 'data': + if (isset($acc['data'])) { + $acc['data'] .= "\n".$value; + } else { + $acc['data'] = $value; + } + + break; + + case 'id': + $acc['id'] = $value; + + break; + + case 'retry': + $acc['retry'] = (int) $value; + + break; + } + } + } + + if (!empty($acc)) { + yield [...$blank, ...$acc]; + } + } + + public static function decodeJson(string $json): mixed + { + return json_decode($json, associative: true, flags: JSON_THROW_ON_ERROR); + } + + public static function decodeContent(ResponseInterface $rsp): mixed + { + if (204 == $rsp->getStatusCode()) { + return null; + } + + $content_type = $rsp->getHeaderLine('Content-Type'); + $body = $rsp->getBody(); + + if (preg_match(self::JSON_CONTENT_TYPE, subject: $content_type)) { + $json = $body->getContents(); + + return self::decodeJson($json); + } + + if (preg_match(self::JSONL_CONTENT_TYPE, subject: $content_type)) { + $it = self::streamIterator($body); + $lines = self::decodeLines($it); + + return (function () use ($lines) { + foreach ($lines as $line) { + yield static::decodeJson($line); + } + })(); + } + + if (str_contains($content_type, needle: 'text/event-stream')) { + $it = self::streamIterator($body); + $lines = self::decodeLines($it); + + return self::decodeSSE($lines); + } + + return self::streamIterator($body); + } + + public static function prettyEncodeJson(mixed $obj): string + { + return json_encode($obj, flags: JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) ?: ''; + } + + /** + * @param list $closing + * + * @return \Generator + */ + private static function writeMultipartContent( + mixed $val, + array &$closing, + ?string $contentType = null + ): \Generator { + $contentLine = "Content-Type: %s\r\n\r\n"; + + if (is_resource($val)) { + yield sprintf($contentLine, $contentType ?? 'application/octet-stream'); + while (!feof($val)) { + if ($read = fread($val, length: self::BUF_SIZE)) { + yield $read; + } + } + } elseif (is_string($val) || is_numeric($val) || is_bool($val)) { + yield sprintf($contentLine, $contentType ?? 'text/plain'); + + yield (string) $val; + } else { + yield sprintf($contentLine, $contentType ?? 'application/json'); + + yield json_encode($val, flags: self::JSON_ENCODE_FLAGS); + } + + yield "\r\n"; + } + + /** + * @param list $closing + * + * @return \Generator + */ + private static function writeMultipartChunk( + string $boundary, + ?string $key, + mixed $val, + array &$closing + ): \Generator { + yield "--{$boundary}\r\n"; + + yield 'Content-Disposition: form-data'; + + if (!is_null($key)) { + $name = rawurlencode($key); + + yield "; name=\"{$name}\""; + } + + yield "\r\n"; + foreach (self::writeMultipartContent($val, closing: $closing) as $chunk) { + yield $chunk; + } + } + + /** + * @param bool|int|float|string|resource|\Traversable|array|null $body + * + * @return array{string, \Generator} + */ + private static function encodeMultipartStreaming(mixed $body): array + { + $boundary = rtrim(strtr(base64_encode(random_bytes(60)), '+/', '-_'), '='); + $gen = (function () use ($boundary, $body) { + $closing = []; + + try { + if (is_array($body) || is_object($body)) { + foreach ((array) $body as $key => $val) { + foreach (static::writeMultipartChunk(boundary: $boundary, key: $key, val: $val, closing: $closing) as $chunk) { + yield $chunk; + } + } + } else { + foreach (static::writeMultipartChunk(boundary: $boundary, key: null, val: $body, closing: $closing) as $chunk) { + yield $chunk; + } + } + + yield "--{$boundary}--\r\n"; + } finally { + foreach ($closing as $c) { + $c(); + } + } + })(); + + return [$boundary, $gen]; + } +} diff --git a/src/CustomMetadataFields/CustomMetadataField.php b/src/CustomMetadataFields/CustomMetadataField.php new file mode 100644 index 00000000..ddc9c662 --- /dev/null +++ b/src/CustomMetadataFields/CustomMetadataField.php @@ -0,0 +1,135 @@ + */ + use SdkModel; + + /** + * Unique identifier for the custom metadata field. Use this to update the field. + */ + #[Api] + public string $id; + + /** + * Human readable name of the custom metadata field. This name is displayed as form field label to the users while setting field value on the asset in the media library UI. + */ + #[Api] + public string $label; + + /** + * API name of the custom metadata field. This becomes the key while setting `customMetadata` (key-value object) for an asset using upload or update API. + */ + #[Api] + public string $name; + + /** + * An object that describes the rules for the custom metadata field value. + */ + #[Api] + public Schema $schema; + + /** + * `new CustomMetadataField()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * CustomMetadataField::with(id: ..., label: ..., name: ..., schema: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new CustomMetadataField) + * ->withID(...) + * ->withLabel(...) + * ->withName(...) + * ->withSchema(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $id, + string $label, + string $name, + Schema $schema + ): self { + $obj = new self; + + $obj->id = $id; + $obj->label = $label; + $obj->name = $name; + $obj->schema = $schema; + + return $obj; + } + + /** + * Unique identifier for the custom metadata field. Use this to update the field. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * Human readable name of the custom metadata field. This name is displayed as form field label to the users while setting field value on the asset in the media library UI. + */ + public function withLabel(string $label): self + { + $obj = clone $this; + $obj->label = $label; + + return $obj; + } + + /** + * API name of the custom metadata field. This becomes the key while setting `customMetadata` (key-value object) for an asset using upload or update API. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * An object that describes the rules for the custom metadata field value. + */ + public function withSchema(Schema $schema): self + { + $obj = clone $this; + $obj->schema = $schema; + + return $obj; + } +} diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema.php b/src/CustomMetadataFields/CustomMetadataField/Schema.php new file mode 100644 index 00000000..c1f7bead --- /dev/null +++ b/src/CustomMetadataFields/CustomMetadataField/Schema.php @@ -0,0 +1,234 @@ +, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * selectOptions?: list|null, + * } + */ +final class Schema implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Type of the custom metadata field. + * + * @var Type::* $type + */ + #[Api(enum: Type::class)] + public string $type; + + /** + * The default value for this custom metadata field. Date type of default value depends on the field type. + * + * @var string|float|bool|list|null $defaultValue + */ + #[Api(union: DefaultValue::class, optional: true)] + public string|float|bool|array|null $defaultValue; + + /** + * Specifies if the this custom metadata field is required or not. + */ + #[Api(optional: true)] + public ?bool $isValueRequired; + + /** + * Maximum length of string. Only set if `type` is set to `Text` or `Textarea`. + */ + #[Api(optional: true)] + public ?float $maxLength; + + /** + * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + */ + #[Api(optional: true)] + public string|float|null $maxValue; + + /** + * Minimum length of string. Only set if `type` is set to `Text` or `Textarea`. + */ + #[Api(optional: true)] + public ?float $minLength; + + /** + * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + */ + #[Api(optional: true)] + public string|float|null $minValue; + + /** + * An array of allowed values when field type is `SingleSelect` or `MultiSelect`. + * + * @var list|null $selectOptions + */ + #[Api(list: SelectOption::class, optional: true)] + public ?array $selectOptions; + + /** + * `new Schema()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Schema::with(type: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Schema)->withType(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Type::* $type + * @param string|float|bool|list $defaultValue + * @param list $selectOptions + */ + public static function with( + string $type, + string|float|bool|array|null $defaultValue = null, + ?bool $isValueRequired = null, + ?float $maxLength = null, + string|float|null $maxValue = null, + ?float $minLength = null, + string|float|null $minValue = null, + ?array $selectOptions = null, + ): self { + $obj = new self; + + $obj->type = $type; + + null !== $defaultValue && $obj->defaultValue = $defaultValue; + null !== $isValueRequired && $obj->isValueRequired = $isValueRequired; + null !== $maxLength && $obj->maxLength = $maxLength; + null !== $maxValue && $obj->maxValue = $maxValue; + null !== $minLength && $obj->minLength = $minLength; + null !== $minValue && $obj->minValue = $minValue; + null !== $selectOptions && $obj->selectOptions = $selectOptions; + + return $obj; + } + + /** + * Type of the custom metadata field. + * + * @param Type::* $type + */ + public function withType(string $type): self + { + $obj = clone $this; + $obj->type = $type; + + return $obj; + } + + /** + * The default value for this custom metadata field. Date type of default value depends on the field type. + * + * @param string|float|bool|list $defaultValue + */ + public function withDefaultValue( + string|float|bool|array $defaultValue + ): self { + $obj = clone $this; + $obj->defaultValue = $defaultValue; + + return $obj; + } + + /** + * Specifies if the this custom metadata field is required or not. + */ + public function withIsValueRequired(bool $isValueRequired): self + { + $obj = clone $this; + $obj->isValueRequired = $isValueRequired; + + return $obj; + } + + /** + * Maximum length of string. Only set if `type` is set to `Text` or `Textarea`. + */ + public function withMaxLength(float $maxLength): self + { + $obj = clone $this; + $obj->maxLength = $maxLength; + + return $obj; + } + + /** + * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + */ + public function withMaxValue(string|float $maxValue): self + { + $obj = clone $this; + $obj->maxValue = $maxValue; + + return $obj; + } + + /** + * Minimum length of string. Only set if `type` is set to `Text` or `Textarea`. + */ + public function withMinLength(float $minLength): self + { + $obj = clone $this; + $obj->minLength = $minLength; + + return $obj; + } + + /** + * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + */ + public function withMinValue(string|float $minValue): self + { + $obj = clone $this; + $obj->minValue = $minValue; + + return $obj; + } + + /** + * An array of allowed values when field type is `SingleSelect` or `MultiSelect`. + * + * @param list $selectOptions + */ + public function withSelectOptions(array $selectOptions): self + { + $obj = clone $this; + $obj->selectOptions = $selectOptions; + + return $obj; + } +} diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php new file mode 100644 index 00000000..6be6b638 --- /dev/null +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php @@ -0,0 +1,28 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool', new ListOf(Mixed::class)]; + } +} diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed.php b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed.php new file mode 100644 index 00000000..eb17c055 --- /dev/null +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed.php @@ -0,0 +1,23 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool']; + } +} diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/MaxValue.php b/src/CustomMetadataFields/CustomMetadataField/Schema/MaxValue.php new file mode 100644 index 00000000..98596244 --- /dev/null +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/MaxValue.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float']; + } +} diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/MinValue.php b/src/CustomMetadataFields/CustomMetadataField/Schema/MinValue.php new file mode 100644 index 00000000..0f866656 --- /dev/null +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/MinValue.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float']; + } +} diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/SelectOption.php b/src/CustomMetadataFields/CustomMetadataField/Schema/SelectOption.php new file mode 100644 index 00000000..ab5d2a23 --- /dev/null +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/SelectOption.php @@ -0,0 +1,23 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool']; + } +} diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/Type.php b/src/CustomMetadataFields/CustomMetadataField/Schema/Type.php new file mode 100644 index 00000000..2e567bd1 --- /dev/null +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/Type.php @@ -0,0 +1,30 @@ +create + * + * @phpstan-type custom_metadata_field_create_params = array{ + * label: string, name: string, schema: Schema + * } + */ +final class CustomMetadataFieldCreateParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. + */ + #[Api] + public string $label; + + /** + * API name of the custom metadata field. This should be unique across all (including deleted) custom metadata fields. + */ + #[Api] + public string $name; + + #[Api] + public Schema $schema; + + /** + * `new CustomMetadataFieldCreateParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * CustomMetadataFieldCreateParams::with(label: ..., name: ..., schema: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new CustomMetadataFieldCreateParams) + * ->withLabel(...) + * ->withName(...) + * ->withSchema(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $label, + string $name, + Schema $schema + ): self { + $obj = new self; + + $obj->label = $label; + $obj->name = $name; + $obj->schema = $schema; + + return $obj; + } + + /** + * Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. + */ + public function withLabel(string $label): self + { + $obj = clone $this; + $obj->label = $label; + + return $obj; + } + + /** + * API name of the custom metadata field. This should be unique across all (including deleted) custom metadata fields. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + public function withSchema(Schema $schema): self + { + $obj = clone $this; + $obj->schema = $schema; + + return $obj; + } +} diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php new file mode 100644 index 00000000..397ec2bb --- /dev/null +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php @@ -0,0 +1,232 @@ +, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * selectOptions?: list|null, + * } + */ +final class Schema implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Type of the custom metadata field. + * + * @var Type::* $type + */ + #[Api(enum: Type::class)] + public string $type; + + /** + * The default value for this custom metadata field. This property is only required if `isValueRequired` property is set to `true`. The value should match the `type` of custom metadata field. + * + * @var string|float|bool|list|null $defaultValue + */ + #[Api(union: DefaultValue::class, optional: true)] + public string|float|bool|array|null $defaultValue; + + /** + * Sets this custom metadata field as required. Setting custom metadata fields on an asset will throw error if the value for all required fields are not present in upload or update asset API request body. + */ + #[Api(optional: true)] + public ?bool $isValueRequired; + + /** + * Maximum length of string. Only set this property if `type` is set to `Text` or `Textarea`. + */ + #[Api(optional: true)] + public ?float $maxLength; + + /** + * Maximum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. + */ + #[Api(optional: true)] + public string|float|null $maxValue; + + /** + * Minimum length of string. Only set this property if `type` is set to `Text` or `Textarea`. + */ + #[Api(optional: true)] + public ?float $minLength; + + /** + * Minimum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. + */ + #[Api(optional: true)] + public string|float|null $minValue; + + /** + * An array of allowed values. This property is only required if `type` property is set to `SingleSelect` or `MultiSelect`. + * + * @var list|null $selectOptions + */ + #[Api(list: SelectOption::class, optional: true)] + public ?array $selectOptions; + + /** + * `new Schema()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Schema::with(type: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Schema)->withType(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Type::* $type + * @param string|float|bool|list $defaultValue + * @param list $selectOptions + */ + public static function with( + string $type, + string|float|bool|array|null $defaultValue = null, + ?bool $isValueRequired = null, + ?float $maxLength = null, + string|float|null $maxValue = null, + ?float $minLength = null, + string|float|null $minValue = null, + ?array $selectOptions = null, + ): self { + $obj = new self; + + $obj->type = $type; + + null !== $defaultValue && $obj->defaultValue = $defaultValue; + null !== $isValueRequired && $obj->isValueRequired = $isValueRequired; + null !== $maxLength && $obj->maxLength = $maxLength; + null !== $maxValue && $obj->maxValue = $maxValue; + null !== $minLength && $obj->minLength = $minLength; + null !== $minValue && $obj->minValue = $minValue; + null !== $selectOptions && $obj->selectOptions = $selectOptions; + + return $obj; + } + + /** + * Type of the custom metadata field. + * + * @param Type::* $type + */ + public function withType(string $type): self + { + $obj = clone $this; + $obj->type = $type; + + return $obj; + } + + /** + * The default value for this custom metadata field. This property is only required if `isValueRequired` property is set to `true`. The value should match the `type` of custom metadata field. + * + * @param string|float|bool|list $defaultValue + */ + public function withDefaultValue( + string|float|bool|array $defaultValue + ): self { + $obj = clone $this; + $obj->defaultValue = $defaultValue; + + return $obj; + } + + /** + * Sets this custom metadata field as required. Setting custom metadata fields on an asset will throw error if the value for all required fields are not present in upload or update asset API request body. + */ + public function withIsValueRequired(bool $isValueRequired): self + { + $obj = clone $this; + $obj->isValueRequired = $isValueRequired; + + return $obj; + } + + /** + * Maximum length of string. Only set this property if `type` is set to `Text` or `Textarea`. + */ + public function withMaxLength(float $maxLength): self + { + $obj = clone $this; + $obj->maxLength = $maxLength; + + return $obj; + } + + /** + * Maximum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. + */ + public function withMaxValue(string|float $maxValue): self + { + $obj = clone $this; + $obj->maxValue = $maxValue; + + return $obj; + } + + /** + * Minimum length of string. Only set this property if `type` is set to `Text` or `Textarea`. + */ + public function withMinLength(float $minLength): self + { + $obj = clone $this; + $obj->minLength = $minLength; + + return $obj; + } + + /** + * Minimum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. + */ + public function withMinValue(string|float $minValue): self + { + $obj = clone $this; + $obj->minValue = $minValue; + + return $obj; + } + + /** + * An array of allowed values. This property is only required if `type` property is set to `SingleSelect` or `MultiSelect`. + * + * @param list $selectOptions + */ + public function withSelectOptions(array $selectOptions): self + { + $obj = clone $this; + $obj->selectOptions = $selectOptions; + + return $obj; + } +} diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php new file mode 100644 index 00000000..1743cefa --- /dev/null +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php @@ -0,0 +1,28 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool', new ListOf(Mixed::class)]; + } +} diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed.php new file mode 100644 index 00000000..be50455d --- /dev/null +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed.php @@ -0,0 +1,23 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool']; + } +} diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MaxValue.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MaxValue.php new file mode 100644 index 00000000..997c7234 --- /dev/null +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MaxValue.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float']; + } +} diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MinValue.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MinValue.php new file mode 100644 index 00000000..14041062 --- /dev/null +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MinValue.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float']; + } +} diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/SelectOption.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/SelectOption.php new file mode 100644 index 00000000..57718552 --- /dev/null +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/SelectOption.php @@ -0,0 +1,23 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool']; + } +} diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/Type.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/Type.php new file mode 100644 index 00000000..048a6f6e --- /dev/null +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/Type.php @@ -0,0 +1,30 @@ + */ + use SdkModel; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(): self + { + return new self; + } +} diff --git a/src/CustomMetadataFields/CustomMetadataFieldListParams.php b/src/CustomMetadataFields/CustomMetadataFieldListParams.php new file mode 100644 index 00000000..9e0ed855 --- /dev/null +++ b/src/CustomMetadataFields/CustomMetadataFieldListParams.php @@ -0,0 +1,60 @@ +list + * + * @phpstan-type custom_metadata_field_list_params = array{includeDeleted?: bool} + */ +final class CustomMetadataFieldListParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * Set it to `true` to include deleted field objects in the API response. + */ + #[Api(optional: true)] + public ?bool $includeDeleted; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(?bool $includeDeleted = null): self + { + $obj = new self; + + null !== $includeDeleted && $obj->includeDeleted = $includeDeleted; + + return $obj; + } + + /** + * Set it to `true` to include deleted field objects in the API response. + */ + public function withIncludeDeleted(bool $includeDeleted): self + { + $obj = clone $this; + $obj->includeDeleted = $includeDeleted; + + return $obj; + } +} diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php new file mode 100644 index 00000000..54fb7c37 --- /dev/null +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php @@ -0,0 +1,83 @@ +update + * + * @phpstan-type custom_metadata_field_update_params = array{ + * label?: string, schema?: Schema + * } + */ +final class CustomMetadataFieldUpdateParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. This parameter is required if `schema` is not provided. + */ + #[Api(optional: true)] + public ?string $label; + + /** + * An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. + */ + #[Api(optional: true)] + public ?Schema $schema; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + ?string $label = null, + ?Schema $schema = null + ): self { + $obj = new self; + + null !== $label && $obj->label = $label; + null !== $schema && $obj->schema = $schema; + + return $obj; + } + + /** + * Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. This parameter is required if `schema` is not provided. + */ + public function withLabel(string $label): self + { + $obj = clone $this; + $obj->label = $label; + + return $obj; + } + + /** + * An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. + */ + public function withSchema(Schema $schema): self + { + $obj = clone $this; + $obj->schema = $schema; + + return $obj; + } +} diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php new file mode 100644 index 00000000..0367e1f6 --- /dev/null +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php @@ -0,0 +1,193 @@ +, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * selectOptions?: list|null, + * } + */ +final class Schema implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * The default value for this custom metadata field. This property is only required if `isValueRequired` property is set to `true`. The value should match the `type` of custom metadata field. + * + * @var string|float|bool|list|null $defaultValue + */ + #[Api(union: DefaultValue::class, optional: true)] + public string|float|bool|array|null $defaultValue; + + /** + * Sets this custom metadata field as required. Setting custom metadata fields on an asset will throw error if the value for all required fields are not present in upload or update asset API request body. + */ + #[Api(optional: true)] + public ?bool $isValueRequired; + + /** + * Maximum length of string. Only set this property if `type` is set to `Text` or `Textarea`. + */ + #[Api(optional: true)] + public ?float $maxLength; + + /** + * Maximum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. + */ + #[Api(optional: true)] + public string|float|null $maxValue; + + /** + * Minimum length of string. Only set this property if `type` is set to `Text` or `Textarea`. + */ + #[Api(optional: true)] + public ?float $minLength; + + /** + * Minimum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. + */ + #[Api(optional: true)] + public string|float|null $minValue; + + /** + * An array of allowed values. This property is only required if `type` property is set to `SingleSelect` or `MultiSelect`. + * + * @var list|null $selectOptions + */ + #[Api(list: SelectOption::class, optional: true)] + public ?array $selectOptions; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param string|float|bool|list $defaultValue + * @param list $selectOptions + */ + public static function with( + string|float|bool|array|null $defaultValue = null, + ?bool $isValueRequired = null, + ?float $maxLength = null, + string|float|null $maxValue = null, + ?float $minLength = null, + string|float|null $minValue = null, + ?array $selectOptions = null, + ): self { + $obj = new self; + + null !== $defaultValue && $obj->defaultValue = $defaultValue; + null !== $isValueRequired && $obj->isValueRequired = $isValueRequired; + null !== $maxLength && $obj->maxLength = $maxLength; + null !== $maxValue && $obj->maxValue = $maxValue; + null !== $minLength && $obj->minLength = $minLength; + null !== $minValue && $obj->minValue = $minValue; + null !== $selectOptions && $obj->selectOptions = $selectOptions; + + return $obj; + } + + /** + * The default value for this custom metadata field. This property is only required if `isValueRequired` property is set to `true`. The value should match the `type` of custom metadata field. + * + * @param string|float|bool|list $defaultValue + */ + public function withDefaultValue( + string|float|bool|array $defaultValue + ): self { + $obj = clone $this; + $obj->defaultValue = $defaultValue; + + return $obj; + } + + /** + * Sets this custom metadata field as required. Setting custom metadata fields on an asset will throw error if the value for all required fields are not present in upload or update asset API request body. + */ + public function withIsValueRequired(bool $isValueRequired): self + { + $obj = clone $this; + $obj->isValueRequired = $isValueRequired; + + return $obj; + } + + /** + * Maximum length of string. Only set this property if `type` is set to `Text` or `Textarea`. + */ + public function withMaxLength(float $maxLength): self + { + $obj = clone $this; + $obj->maxLength = $maxLength; + + return $obj; + } + + /** + * Maximum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. + */ + public function withMaxValue(string|float $maxValue): self + { + $obj = clone $this; + $obj->maxValue = $maxValue; + + return $obj; + } + + /** + * Minimum length of string. Only set this property if `type` is set to `Text` or `Textarea`. + */ + public function withMinLength(float $minLength): self + { + $obj = clone $this; + $obj->minLength = $minLength; + + return $obj; + } + + /** + * Minimum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. + */ + public function withMinValue(string|float $minValue): self + { + $obj = clone $this; + $obj->minValue = $minValue; + + return $obj; + } + + /** + * An array of allowed values. This property is only required if `type` property is set to `SingleSelect` or `MultiSelect`. + * + * @param list $selectOptions + */ + public function withSelectOptions(array $selectOptions): self + { + $obj = clone $this; + $obj->selectOptions = $selectOptions; + + return $obj; + } +} diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php new file mode 100644 index 00000000..6d79746b --- /dev/null +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php @@ -0,0 +1,28 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool', new ListOf(Mixed::class)]; + } +} diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed.php new file mode 100644 index 00000000..c8257310 --- /dev/null +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed.php @@ -0,0 +1,23 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool']; + } +} diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MaxValue.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MaxValue.php new file mode 100644 index 00000000..7c7f7ff8 --- /dev/null +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MaxValue.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float']; + } +} diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MinValue.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MinValue.php new file mode 100644 index 00000000..fadf1963 --- /dev/null +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MinValue.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float']; + } +} diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/SelectOption.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/SelectOption.php new file mode 100644 index 00000000..292832b0 --- /dev/null +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/SelectOption.php @@ -0,0 +1,23 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool']; + } +} diff --git a/src/Files/Bulk/BulkAddTagsParams.php b/src/Files/Bulk/BulkAddTagsParams.php new file mode 100644 index 00000000..53ffd749 --- /dev/null +++ b/src/Files/Bulk/BulkAddTagsParams.php @@ -0,0 +1,105 @@ +addTags + * + * @phpstan-type bulk_add_tags_params = array{ + * fileIDs: list, tags: list + * } + */ +final class BulkAddTagsParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * An array of fileIds to which you want to add tags. + * + * @var list $fileIDs + */ + #[Api('fileIds', list: 'string')] + public array $fileIDs; + + /** + * An array of tags that you want to add to the files. + * + * @var list $tags + */ + #[Api(list: 'string')] + public array $tags; + + /** + * `new BulkAddTagsParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * BulkAddTagsParams::with(fileIDs: ..., tags: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new BulkAddTagsParams)->withFileIDs(...)->withTags(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $fileIDs + * @param list $tags + */ + public static function with(array $fileIDs, array $tags): self + { + $obj = new self; + + $obj->fileIDs = $fileIDs; + $obj->tags = $tags; + + return $obj; + } + + /** + * An array of fileIds to which you want to add tags. + * + * @param list $fileIDs + */ + public function withFileIDs(array $fileIDs): self + { + $obj = clone $this; + $obj->fileIDs = $fileIDs; + + return $obj; + } + + /** + * An array of tags that you want to add to the files. + * + * @param list $tags + */ + public function withTags(array $tags): self + { + $obj = clone $this; + $obj->tags = $tags; + + return $obj; + } +} diff --git a/src/Files/Bulk/BulkAddTagsResponse.php b/src/Files/Bulk/BulkAddTagsResponse.php new file mode 100644 index 00000000..45a93613 --- /dev/null +++ b/src/Files/Bulk/BulkAddTagsResponse.php @@ -0,0 +1,63 @@ +|null + * } + */ +final class BulkAddTagsResponse implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * An array of fileIds that in which tags were successfully added. + * + * @var list|null $successfullyUpdatedFileIDs + */ + #[Api('successfullyUpdatedFileIds', list: 'string', optional: true)] + public ?array $successfullyUpdatedFileIDs; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $successfullyUpdatedFileIDs + */ + public static function with(?array $successfullyUpdatedFileIDs = null): self + { + $obj = new self; + + null !== $successfullyUpdatedFileIDs && $obj->successfullyUpdatedFileIDs = $successfullyUpdatedFileIDs; + + return $obj; + } + + /** + * An array of fileIds that in which tags were successfully added. + * + * @param list $successfullyUpdatedFileIDs + */ + public function withSuccessfullyUpdatedFileIDs( + array $successfullyUpdatedFileIDs + ): self { + $obj = clone $this; + $obj->successfullyUpdatedFileIDs = $successfullyUpdatedFileIDs; + + return $obj; + } +} diff --git a/src/Files/Bulk/BulkDeleteParams.php b/src/Files/Bulk/BulkDeleteParams.php new file mode 100644 index 00000000..c7b6e882 --- /dev/null +++ b/src/Files/Bulk/BulkDeleteParams.php @@ -0,0 +1,84 @@ +delete + * + * @phpstan-type bulk_delete_params = array{fileIDs: list} + */ +final class BulkDeleteParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * An array of fileIds which you want to delete. + * + * @var list $fileIDs + */ + #[Api('fileIds', list: 'string')] + public array $fileIDs; + + /** + * `new BulkDeleteParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * BulkDeleteParams::with(fileIDs: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new BulkDeleteParams)->withFileIDs(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $fileIDs + */ + public static function with(array $fileIDs): self + { + $obj = new self; + + $obj->fileIDs = $fileIDs; + + return $obj; + } + + /** + * An array of fileIds which you want to delete. + * + * @param list $fileIDs + */ + public function withFileIDs(array $fileIDs): self + { + $obj = clone $this; + $obj->fileIDs = $fileIDs; + + return $obj; + } +} diff --git a/src/Files/Bulk/BulkDeleteResponse.php b/src/Files/Bulk/BulkDeleteResponse.php new file mode 100644 index 00000000..42f62916 --- /dev/null +++ b/src/Files/Bulk/BulkDeleteResponse.php @@ -0,0 +1,63 @@ +|null + * } + */ +final class BulkDeleteResponse implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * An array of fileIds that were successfully deleted. + * + * @var list|null $successfullyDeletedFileIDs + */ + #[Api('successfullyDeletedFileIds', list: 'string', optional: true)] + public ?array $successfullyDeletedFileIDs; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $successfullyDeletedFileIDs + */ + public static function with(?array $successfullyDeletedFileIDs = null): self + { + $obj = new self; + + null !== $successfullyDeletedFileIDs && $obj->successfullyDeletedFileIDs = $successfullyDeletedFileIDs; + + return $obj; + } + + /** + * An array of fileIds that were successfully deleted. + * + * @param list $successfullyDeletedFileIDs + */ + public function withSuccessfullyDeletedFileIDs( + array $successfullyDeletedFileIDs + ): self { + $obj = clone $this; + $obj->successfullyDeletedFileIDs = $successfullyDeletedFileIDs; + + return $obj; + } +} diff --git a/src/Files/Bulk/BulkRemoveAITagsParams.php b/src/Files/Bulk/BulkRemoveAITagsParams.php new file mode 100644 index 00000000..2fe76ca5 --- /dev/null +++ b/src/Files/Bulk/BulkRemoveAITagsParams.php @@ -0,0 +1,105 @@ +removeAITags + * + * @phpstan-type bulk_remove_ai_tags_params = array{ + * aiTags: list, fileIDs: list + * } + */ +final class BulkRemoveAITagsParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * An array of AITags that you want to remove from the files. + * + * @var list $aiTags + */ + #[Api('AITags', list: 'string')] + public array $aiTags; + + /** + * An array of fileIds from which you want to remove AITags. + * + * @var list $fileIDs + */ + #[Api('fileIds', list: 'string')] + public array $fileIDs; + + /** + * `new BulkRemoveAITagsParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * BulkRemoveAITagsParams::with(aiTags: ..., fileIDs: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new BulkRemoveAITagsParams)->withAITags(...)->withFileIDs(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $aiTags + * @param list $fileIDs + */ + public static function with(array $aiTags, array $fileIDs): self + { + $obj = new self; + + $obj->aiTags = $aiTags; + $obj->fileIDs = $fileIDs; + + return $obj; + } + + /** + * An array of AITags that you want to remove from the files. + * + * @param list $aiTags + */ + public function withAITags(array $aiTags): self + { + $obj = clone $this; + $obj->aiTags = $aiTags; + + return $obj; + } + + /** + * An array of fileIds from which you want to remove AITags. + * + * @param list $fileIDs + */ + public function withFileIDs(array $fileIDs): self + { + $obj = clone $this; + $obj->fileIDs = $fileIDs; + + return $obj; + } +} diff --git a/src/Files/Bulk/BulkRemoveAITagsResponse.php b/src/Files/Bulk/BulkRemoveAITagsResponse.php new file mode 100644 index 00000000..ec996967 --- /dev/null +++ b/src/Files/Bulk/BulkRemoveAITagsResponse.php @@ -0,0 +1,63 @@ +|null + * } + */ +final class BulkRemoveAITagsResponse implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * An array of fileIds that in which AITags were successfully removed. + * + * @var list|null $successfullyUpdatedFileIDs + */ + #[Api('successfullyUpdatedFileIds', list: 'string', optional: true)] + public ?array $successfullyUpdatedFileIDs; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $successfullyUpdatedFileIDs + */ + public static function with(?array $successfullyUpdatedFileIDs = null): self + { + $obj = new self; + + null !== $successfullyUpdatedFileIDs && $obj->successfullyUpdatedFileIDs = $successfullyUpdatedFileIDs; + + return $obj; + } + + /** + * An array of fileIds that in which AITags were successfully removed. + * + * @param list $successfullyUpdatedFileIDs + */ + public function withSuccessfullyUpdatedFileIDs( + array $successfullyUpdatedFileIDs + ): self { + $obj = clone $this; + $obj->successfullyUpdatedFileIDs = $successfullyUpdatedFileIDs; + + return $obj; + } +} diff --git a/src/Files/Bulk/BulkRemoveTagsParams.php b/src/Files/Bulk/BulkRemoveTagsParams.php new file mode 100644 index 00000000..678dc4ed --- /dev/null +++ b/src/Files/Bulk/BulkRemoveTagsParams.php @@ -0,0 +1,105 @@ +removeTags + * + * @phpstan-type bulk_remove_tags_params = array{ + * fileIDs: list, tags: list + * } + */ +final class BulkRemoveTagsParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * An array of fileIds from which you want to remove tags. + * + * @var list $fileIDs + */ + #[Api('fileIds', list: 'string')] + public array $fileIDs; + + /** + * An array of tags that you want to remove from the files. + * + * @var list $tags + */ + #[Api(list: 'string')] + public array $tags; + + /** + * `new BulkRemoveTagsParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * BulkRemoveTagsParams::with(fileIDs: ..., tags: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new BulkRemoveTagsParams)->withFileIDs(...)->withTags(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $fileIDs + * @param list $tags + */ + public static function with(array $fileIDs, array $tags): self + { + $obj = new self; + + $obj->fileIDs = $fileIDs; + $obj->tags = $tags; + + return $obj; + } + + /** + * An array of fileIds from which you want to remove tags. + * + * @param list $fileIDs + */ + public function withFileIDs(array $fileIDs): self + { + $obj = clone $this; + $obj->fileIDs = $fileIDs; + + return $obj; + } + + /** + * An array of tags that you want to remove from the files. + * + * @param list $tags + */ + public function withTags(array $tags): self + { + $obj = clone $this; + $obj->tags = $tags; + + return $obj; + } +} diff --git a/src/Files/Bulk/BulkRemoveTagsResponse.php b/src/Files/Bulk/BulkRemoveTagsResponse.php new file mode 100644 index 00000000..a2c5ff1a --- /dev/null +++ b/src/Files/Bulk/BulkRemoveTagsResponse.php @@ -0,0 +1,63 @@ +|null + * } + */ +final class BulkRemoveTagsResponse implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * An array of fileIds that in which tags were successfully removed. + * + * @var list|null $successfullyUpdatedFileIDs + */ + #[Api('successfullyUpdatedFileIds', list: 'string', optional: true)] + public ?array $successfullyUpdatedFileIDs; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $successfullyUpdatedFileIDs + */ + public static function with(?array $successfullyUpdatedFileIDs = null): self + { + $obj = new self; + + null !== $successfullyUpdatedFileIDs && $obj->successfullyUpdatedFileIDs = $successfullyUpdatedFileIDs; + + return $obj; + } + + /** + * An array of fileIds that in which tags were successfully removed. + * + * @param list $successfullyUpdatedFileIDs + */ + public function withSuccessfullyUpdatedFileIDs( + array $successfullyUpdatedFileIDs + ): self { + $obj = clone $this; + $obj->successfullyUpdatedFileIDs = $successfullyUpdatedFileIDs; + + return $obj; + } +} diff --git a/src/Files/File.php b/src/Files/File.php new file mode 100644 index 00000000..b2b612a5 --- /dev/null +++ b/src/Files/File.php @@ -0,0 +1,503 @@ +|null, + * createdAt?: \DateTimeInterface|null, + * customCoordinates?: string|null, + * customMetadata?: array|null, + * description?: string|null, + * fileID?: string|null, + * filePath?: string|null, + * fileType?: string|null, + * hasAlpha?: bool|null, + * height?: float|null, + * isPrivateFile?: bool|null, + * isPublished?: bool|null, + * mime?: string|null, + * name?: string|null, + * size?: float|null, + * tags?: list|null, + * thumbnail?: string|null, + * type?: Type::*|null, + * updatedAt?: \DateTimeInterface|null, + * url?: string|null, + * versionInfo?: VersionInfo|null, + * width?: float|null, + * } + */ +final class File implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * An array of tags assigned to the file by auto tagging. + * + * @var list|null $aiTags + */ + #[Api('AITags', list: AITag::class, nullable: true, optional: true)] + public ?array $aiTags; + + /** + * Date and time when the file was uploaded. The date and time is in ISO8601 format. + */ + #[Api(optional: true)] + public ?\DateTimeInterface $createdAt; + + /** + * An string with custom coordinates of the file. + */ + #[Api(nullable: true, optional: true)] + public ?string $customCoordinates; + + /** + * An object with custom metadata for the file. + * + * @var array|null $customMetadata + */ + #[Api(map: 'mixed', optional: true)] + public ?array $customMetadata; + + /** + * Optional text to describe the contents of the file. Can be set by the user or the ai-auto-description extension. + */ + #[Api(optional: true)] + public ?string $description; + + /** + * Unique identifier of the asset. + */ + #[Api('fileId', optional: true)] + public ?string $fileID; + + /** + * Path of the file. This is the path you would use in the URL to access the file. For example, if the file is at the root of the media library, the path will be `/file.jpg`. If the file is inside a folder named `images`, the path will be `/images/file.jpg`. + */ + #[Api(optional: true)] + public ?string $filePath; + + /** + * Type of the file. Possible values are `image`, `non-image`. + */ + #[Api(optional: true)] + public ?string $fileType; + + /** + * Specifies if the image has an alpha channel. + */ + #[Api(optional: true)] + public ?bool $hasAlpha; + + /** + * Height of the file. + */ + #[Api(optional: true)] + public ?float $height; + + /** + * Specifies if the file is private or not. + */ + #[Api(optional: true)] + public ?bool $isPrivateFile; + + /** + * Specifies if the file is published or not. + */ + #[Api(optional: true)] + public ?bool $isPublished; + + /** + * MIME type of the file. + */ + #[Api(optional: true)] + public ?string $mime; + + /** + * Name of the asset. + */ + #[Api(optional: true)] + public ?string $name; + + /** + * Size of the file in bytes. + */ + #[Api(optional: true)] + public ?float $size; + + /** + * An array of tags assigned to the file. Tags are used to search files in the media library. + * + * @var list|null $tags + */ + #[Api(list: 'string', nullable: true, optional: true)] + public ?array $tags; + + /** + * URL of the thumbnail image. This URL is used to access the thumbnail image of the file in the media library. + */ + #[Api(optional: true)] + public ?string $thumbnail; + + /** + * Type of the asset. + * + * @var Type::*|null $type + */ + #[Api(enum: Type::class, optional: true)] + public ?string $type; + + /** + * Date and time when the file was last updated. The date and time is in ISO8601 format. + */ + #[Api(optional: true)] + public ?\DateTimeInterface $updatedAt; + + /** + * URL of the file. + */ + #[Api(optional: true)] + public ?string $url; + + /** + * An object with details of the file version. + */ + #[Api(optional: true)] + public ?VersionInfo $versionInfo; + + /** + * Width of the file. + */ + #[Api(optional: true)] + public ?float $width; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list|null $aiTags + * @param array $customMetadata + * @param list|null $tags + * @param Type::* $type + */ + public static function with( + ?array $aiTags = null, + ?\DateTimeInterface $createdAt = null, + ?string $customCoordinates = null, + ?array $customMetadata = null, + ?string $description = null, + ?string $fileID = null, + ?string $filePath = null, + ?string $fileType = null, + ?bool $hasAlpha = null, + ?float $height = null, + ?bool $isPrivateFile = null, + ?bool $isPublished = null, + ?string $mime = null, + ?string $name = null, + ?float $size = null, + ?array $tags = null, + ?string $thumbnail = null, + ?string $type = null, + ?\DateTimeInterface $updatedAt = null, + ?string $url = null, + ?VersionInfo $versionInfo = null, + ?float $width = null, + ): self { + $obj = new self; + + null !== $aiTags && $obj->aiTags = $aiTags; + null !== $createdAt && $obj->createdAt = $createdAt; + null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; + null !== $customMetadata && $obj->customMetadata = $customMetadata; + null !== $description && $obj->description = $description; + null !== $fileID && $obj->fileID = $fileID; + null !== $filePath && $obj->filePath = $filePath; + null !== $fileType && $obj->fileType = $fileType; + null !== $hasAlpha && $obj->hasAlpha = $hasAlpha; + null !== $height && $obj->height = $height; + null !== $isPrivateFile && $obj->isPrivateFile = $isPrivateFile; + null !== $isPublished && $obj->isPublished = $isPublished; + null !== $mime && $obj->mime = $mime; + null !== $name && $obj->name = $name; + null !== $size && $obj->size = $size; + null !== $tags && $obj->tags = $tags; + null !== $thumbnail && $obj->thumbnail = $thumbnail; + null !== $type && $obj->type = $type; + null !== $updatedAt && $obj->updatedAt = $updatedAt; + null !== $url && $obj->url = $url; + null !== $versionInfo && $obj->versionInfo = $versionInfo; + null !== $width && $obj->width = $width; + + return $obj; + } + + /** + * An array of tags assigned to the file by auto tagging. + * + * @param list|null $aiTags + */ + public function withAITags(?array $aiTags): self + { + $obj = clone $this; + $obj->aiTags = $aiTags; + + return $obj; + } + + /** + * Date and time when the file was uploaded. The date and time is in ISO8601 format. + */ + public function withCreatedAt(\DateTimeInterface $createdAt): self + { + $obj = clone $this; + $obj->createdAt = $createdAt; + + return $obj; + } + + /** + * An string with custom coordinates of the file. + */ + public function withCustomCoordinates(?string $customCoordinates): self + { + $obj = clone $this; + $obj->customCoordinates = $customCoordinates; + + return $obj; + } + + /** + * An object with custom metadata for the file. + * + * @param array $customMetadata + */ + public function withCustomMetadata(array $customMetadata): self + { + $obj = clone $this; + $obj->customMetadata = $customMetadata; + + return $obj; + } + + /** + * Optional text to describe the contents of the file. Can be set by the user or the ai-auto-description extension. + */ + public function withDescription(string $description): self + { + $obj = clone $this; + $obj->description = $description; + + return $obj; + } + + /** + * Unique identifier of the asset. + */ + public function withFileID(string $fileID): self + { + $obj = clone $this; + $obj->fileID = $fileID; + + return $obj; + } + + /** + * Path of the file. This is the path you would use in the URL to access the file. For example, if the file is at the root of the media library, the path will be `/file.jpg`. If the file is inside a folder named `images`, the path will be `/images/file.jpg`. + */ + public function withFilePath(string $filePath): self + { + $obj = clone $this; + $obj->filePath = $filePath; + + return $obj; + } + + /** + * Type of the file. Possible values are `image`, `non-image`. + */ + public function withFileType(string $fileType): self + { + $obj = clone $this; + $obj->fileType = $fileType; + + return $obj; + } + + /** + * Specifies if the image has an alpha channel. + */ + public function withHasAlpha(bool $hasAlpha): self + { + $obj = clone $this; + $obj->hasAlpha = $hasAlpha; + + return $obj; + } + + /** + * Height of the file. + */ + public function withHeight(float $height): self + { + $obj = clone $this; + $obj->height = $height; + + return $obj; + } + + /** + * Specifies if the file is private or not. + */ + public function withIsPrivateFile(bool $isPrivateFile): self + { + $obj = clone $this; + $obj->isPrivateFile = $isPrivateFile; + + return $obj; + } + + /** + * Specifies if the file is published or not. + */ + public function withIsPublished(bool $isPublished): self + { + $obj = clone $this; + $obj->isPublished = $isPublished; + + return $obj; + } + + /** + * MIME type of the file. + */ + public function withMime(string $mime): self + { + $obj = clone $this; + $obj->mime = $mime; + + return $obj; + } + + /** + * Name of the asset. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * Size of the file in bytes. + */ + public function withSize(float $size): self + { + $obj = clone $this; + $obj->size = $size; + + return $obj; + } + + /** + * An array of tags assigned to the file. Tags are used to search files in the media library. + * + * @param list|null $tags + */ + public function withTags(?array $tags): self + { + $obj = clone $this; + $obj->tags = $tags; + + return $obj; + } + + /** + * URL of the thumbnail image. This URL is used to access the thumbnail image of the file in the media library. + */ + public function withThumbnail(string $thumbnail): self + { + $obj = clone $this; + $obj->thumbnail = $thumbnail; + + return $obj; + } + + /** + * Type of the asset. + * + * @param Type::* $type + */ + public function withType(string $type): self + { + $obj = clone $this; + $obj->type = $type; + + return $obj; + } + + /** + * Date and time when the file was last updated. The date and time is in ISO8601 format. + */ + public function withUpdatedAt(\DateTimeInterface $updatedAt): self + { + $obj = clone $this; + $obj->updatedAt = $updatedAt; + + return $obj; + } + + /** + * URL of the file. + */ + public function withURL(string $url): self + { + $obj = clone $this; + $obj->url = $url; + + return $obj; + } + + /** + * An object with details of the file version. + */ + public function withVersionInfo(VersionInfo $versionInfo): self + { + $obj = clone $this; + $obj->versionInfo = $versionInfo; + + return $obj; + } + + /** + * Width of the file. + */ + public function withWidth(float $width): self + { + $obj = clone $this; + $obj->width = $width; + + return $obj; + } +} diff --git a/src/Files/File/AITag.php b/src/Files/File/AITag.php new file mode 100644 index 00000000..1b692418 --- /dev/null +++ b/src/Files/File/AITag.php @@ -0,0 +1,95 @@ + */ + use SdkModel; + + /** + * Confidence score of the tag. + */ + #[Api(optional: true)] + public ?float $confidence; + + /** + * Name of the tag. + */ + #[Api(optional: true)] + public ?string $name; + + /** + * Source of the tag. Possible values are `google-auto-tagging` and `aws-auto-tagging`. + */ + #[Api(optional: true)] + public ?string $source; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + ?float $confidence = null, + ?string $name = null, + ?string $source = null + ): self { + $obj = new self; + + null !== $confidence && $obj->confidence = $confidence; + null !== $name && $obj->name = $name; + null !== $source && $obj->source = $source; + + return $obj; + } + + /** + * Confidence score of the tag. + */ + public function withConfidence(float $confidence): self + { + $obj = clone $this; + $obj->confidence = $confidence; + + return $obj; + } + + /** + * Name of the tag. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * Source of the tag. Possible values are `google-auto-tagging` and `aws-auto-tagging`. + */ + public function withSource(string $source): self + { + $obj = clone $this; + $obj->source = $source; + + return $obj; + } +} diff --git a/src/Files/File/Type.php b/src/Files/File/Type.php new file mode 100644 index 00000000..8d6f266a --- /dev/null +++ b/src/Files/File/Type.php @@ -0,0 +1,20 @@ + */ + use SdkModel; + + /** + * Unique identifier of the file version. + */ + #[Api(optional: true)] + public ?string $id; + + /** + * Name of the file version. + */ + #[Api(optional: true)] + public ?string $name; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(?string $id = null, ?string $name = null): self + { + $obj = new self; + + null !== $id && $obj->id = $id; + null !== $name && $obj->name = $name; + + return $obj; + } + + /** + * Unique identifier of the file version. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * Name of the file version. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } +} diff --git a/src/Files/FileCopyParams.php b/src/Files/FileCopyParams.php new file mode 100644 index 00000000..fce0e5d8 --- /dev/null +++ b/src/Files/FileCopyParams.php @@ -0,0 +1,118 @@ +copy + * + * @phpstan-type file_copy_params = array{ + * destinationPath: string, sourceFilePath: string, includeFileVersions?: bool + * } + */ +final class FileCopyParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * Full path to the folder you want to copy the above file into. + */ + #[Api] + public string $destinationPath; + + /** + * The full path of the file you want to copy. + */ + #[Api] + public string $sourceFilePath; + + /** + * Option to copy all versions of a file. By default, only the current version of the file is copied. When set to true, all versions of the file will be copied. Default value - `false`. + */ + #[Api(optional: true)] + public ?bool $includeFileVersions; + + /** + * `new FileCopyParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * FileCopyParams::with(destinationPath: ..., sourceFilePath: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new FileCopyParams)->withDestinationPath(...)->withSourceFilePath(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $destinationPath, + string $sourceFilePath, + ?bool $includeFileVersions = null, + ): self { + $obj = new self; + + $obj->destinationPath = $destinationPath; + $obj->sourceFilePath = $sourceFilePath; + + null !== $includeFileVersions && $obj->includeFileVersions = $includeFileVersions; + + return $obj; + } + + /** + * Full path to the folder you want to copy the above file into. + */ + public function withDestinationPath(string $destinationPath): self + { + $obj = clone $this; + $obj->destinationPath = $destinationPath; + + return $obj; + } + + /** + * The full path of the file you want to copy. + */ + public function withSourceFilePath(string $sourceFilePath): self + { + $obj = clone $this; + $obj->sourceFilePath = $sourceFilePath; + + return $obj; + } + + /** + * Option to copy all versions of a file. By default, only the current version of the file is copied. When set to true, all versions of the file will be copied. Default value - `false`. + */ + public function withIncludeFileVersions(bool $includeFileVersions): self + { + $obj = clone $this; + $obj->includeFileVersions = $includeFileVersions; + + return $obj; + } +} diff --git a/src/Files/FileCopyResponse.php b/src/Files/FileCopyResponse.php new file mode 100644 index 00000000..ae593ba5 --- /dev/null +++ b/src/Files/FileCopyResponse.php @@ -0,0 +1,32 @@ + */ + use SdkModel; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(): self + { + return new self; + } +} diff --git a/src/Files/FileMoveParams.php b/src/Files/FileMoveParams.php new file mode 100644 index 00000000..68c5a7a4 --- /dev/null +++ b/src/Files/FileMoveParams.php @@ -0,0 +1,98 @@ +move + * + * @phpstan-type file_move_params = array{ + * destinationPath: string, sourceFilePath: string + * } + */ +final class FileMoveParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * Full path to the folder you want to move the above file into. + */ + #[Api] + public string $destinationPath; + + /** + * The full path of the file you want to move. + */ + #[Api] + public string $sourceFilePath; + + /** + * `new FileMoveParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * FileMoveParams::with(destinationPath: ..., sourceFilePath: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new FileMoveParams)->withDestinationPath(...)->withSourceFilePath(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $destinationPath, + string $sourceFilePath + ): self { + $obj = new self; + + $obj->destinationPath = $destinationPath; + $obj->sourceFilePath = $sourceFilePath; + + return $obj; + } + + /** + * Full path to the folder you want to move the above file into. + */ + public function withDestinationPath(string $destinationPath): self + { + $obj = clone $this; + $obj->destinationPath = $destinationPath; + + return $obj; + } + + /** + * The full path of the file you want to move. + */ + public function withSourceFilePath(string $sourceFilePath): self + { + $obj = clone $this; + $obj->sourceFilePath = $sourceFilePath; + + return $obj; + } +} diff --git a/src/Files/FileMoveResponse.php b/src/Files/FileMoveResponse.php new file mode 100644 index 00000000..bcdaa4ce --- /dev/null +++ b/src/Files/FileMoveResponse.php @@ -0,0 +1,32 @@ + */ + use SdkModel; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(): self + { + return new self; + } +} diff --git a/src/Files/FileRenameParams.php b/src/Files/FileRenameParams.php new file mode 100644 index 00000000..b41454d5 --- /dev/null +++ b/src/Files/FileRenameParams.php @@ -0,0 +1,144 @@ +rename + * + * @phpstan-type file_rename_params = array{ + * filePath: string, newFileName: string, purgeCache?: bool + * } + */ +final class FileRenameParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * The full path of the file you want to rename. + */ + #[Api] + public string $filePath; + + /** + * The new name of the file. A filename can contain: + * + * Alphanumeric Characters: `a-z`, `A-Z`, `0-9` (including Unicode letters, marks, and numerals in other languages). + * Special Characters: `.`, `_`, and `-`. + * + * Any other character, including space, will be replaced by `_`. + */ + #[Api] + public string $newFileName; + + /** + * Option to purge cache for the old file and its versions' URLs. + * + * When set to true, it will internally issue a purge cache request on CDN to remove cached content of old file and its versions. This purge request is counted against your monthly purge quota. + * + * Note: If the old file were accessible at `https://ik.imagekit.io/demo/old-filename.jpg`, a purge cache request would be issued against `https://ik.imagekit.io/demo/old-filename.jpg*` (with a wildcard at the end). It will remove the file and its versions' URLs and any transformations made using query parameters on this file or its versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. + * + * + * + * Default value - `false` + */ + #[Api(optional: true)] + public ?bool $purgeCache; + + /** + * `new FileRenameParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * FileRenameParams::with(filePath: ..., newFileName: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new FileRenameParams)->withFilePath(...)->withNewFileName(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $filePath, + string $newFileName, + ?bool $purgeCache = null + ): self { + $obj = new self; + + $obj->filePath = $filePath; + $obj->newFileName = $newFileName; + + null !== $purgeCache && $obj->purgeCache = $purgeCache; + + return $obj; + } + + /** + * The full path of the file you want to rename. + */ + public function withFilePath(string $filePath): self + { + $obj = clone $this; + $obj->filePath = $filePath; + + return $obj; + } + + /** + * The new name of the file. A filename can contain: + * + * Alphanumeric Characters: `a-z`, `A-Z`, `0-9` (including Unicode letters, marks, and numerals in other languages). + * Special Characters: `.`, `_`, and `-`. + * + * Any other character, including space, will be replaced by `_`. + */ + public function withNewFileName(string $newFileName): self + { + $obj = clone $this; + $obj->newFileName = $newFileName; + + return $obj; + } + + /** + * Option to purge cache for the old file and its versions' URLs. + * + * When set to true, it will internally issue a purge cache request on CDN to remove cached content of old file and its versions. This purge request is counted against your monthly purge quota. + * + * Note: If the old file were accessible at `https://ik.imagekit.io/demo/old-filename.jpg`, a purge cache request would be issued against `https://ik.imagekit.io/demo/old-filename.jpg*` (with a wildcard at the end). It will remove the file and its versions' URLs and any transformations made using query parameters on this file or its versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. + * + * + * + * Default value - `false` + */ + public function withPurgeCache(bool $purgeCache): self + { + $obj = clone $this; + $obj->purgeCache = $purgeCache; + + return $obj; + } +} diff --git a/src/Files/FileRenameResponse.php b/src/Files/FileRenameResponse.php new file mode 100644 index 00000000..bea1adab --- /dev/null +++ b/src/Files/FileRenameResponse.php @@ -0,0 +1,54 @@ + */ + use SdkModel; + + /** + * Unique identifier of the purge request. This can be used to check the status of the purge request. + */ + #[Api('purgeRequestId', optional: true)] + public ?string $purgeRequestID; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(?string $purgeRequestID = null): self + { + $obj = new self; + + null !== $purgeRequestID && $obj->purgeRequestID = $purgeRequestID; + + return $obj; + } + + /** + * Unique identifier of the purge request. This can be used to check the status of the purge request. + */ + public function withPurgeRequestID(string $purgeRequestID): self + { + $obj = clone $this; + $obj->purgeRequestID = $purgeRequestID; + + return $obj; + } +} diff --git a/src/Files/FileUpdateParams.php b/src/Files/FileUpdateParams.php new file mode 100644 index 00000000..6289a5c2 --- /dev/null +++ b/src/Files/FileUpdateParams.php @@ -0,0 +1,60 @@ +update + * + * @phpstan-type file_update_params = array{ + * update?: UpdateFileDetails|ChangePublicationStatus + * } + */ +final class FileUpdateParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + #[Api(optional: true)] + public UpdateFileDetails|ChangePublicationStatus|null $update; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + UpdateFileDetails|ChangePublicationStatus|null $update = null + ): self { + $obj = new self; + + null !== $update && $obj->update = $update; + + return $obj; + } + + public function withUpdate( + UpdateFileDetails|ChangePublicationStatus $update + ): self { + $obj = clone $this; + $obj->update = $update; + + return $obj; + } +} diff --git a/src/Files/FileUpdateParams/Update.php b/src/Files/FileUpdateParams/Update.php new file mode 100644 index 00000000..452427d7 --- /dev/null +++ b/src/Files/FileUpdateParams/Update.php @@ -0,0 +1,25 @@ +|array + */ + public static function variants(): array + { + return [UpdateFileDetails::class, ChangePublicationStatus::class]; + } +} diff --git a/src/Files/FileUpdateParams/Update/ChangePublicationStatus.php b/src/Files/FileUpdateParams/Update/ChangePublicationStatus.php new file mode 100644 index 00000000..876df8c0 --- /dev/null +++ b/src/Files/FileUpdateParams/Update/ChangePublicationStatus.php @@ -0,0 +1,55 @@ + */ + use SdkModel; + + /** + * Configure the publication status of a file and its versions. + */ + #[Api(optional: true)] + public ?Publish $publish; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(?Publish $publish = null): self + { + $obj = new self; + + null !== $publish && $obj->publish = $publish; + + return $obj; + } + + /** + * Configure the publication status of a file and its versions. + */ + public function withPublish(Publish $publish): self + { + $obj = clone $this; + $obj->publish = $publish; + + return $obj; + } +} diff --git a/src/Files/FileUpdateParams/Update/ChangePublicationStatus/Publish.php b/src/Files/FileUpdateParams/Update/ChangePublicationStatus/Publish.php new file mode 100644 index 00000000..ffd75ef1 --- /dev/null +++ b/src/Files/FileUpdateParams/Update/ChangePublicationStatus/Publish.php @@ -0,0 +1,93 @@ + */ + use SdkModel; + + /** + * Set to `true` to publish the file. Set to `false` to unpublish the file. + */ + #[Api] + public bool $isPublished; + + /** + * Set to `true` to publish/unpublish all versions of the file. Set to `false` to publish/unpublish only the current version of the file. + */ + #[Api(optional: true)] + public ?bool $includeFileVersions; + + /** + * `new Publish()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Publish::with(isPublished: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Publish)->withIsPublished(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $isPublished, + ?bool $includeFileVersions = null + ): self { + $obj = new self; + + $obj->isPublished = $isPublished; + + null !== $includeFileVersions && $obj->includeFileVersions = $includeFileVersions; + + return $obj; + } + + /** + * Set to `true` to publish the file. Set to `false` to unpublish the file. + */ + public function withIsPublished(bool $isPublished): self + { + $obj = clone $this; + $obj->isPublished = $isPublished; + + return $obj; + } + + /** + * Set to `true` to publish/unpublish all versions of the file. Set to `false` to publish/unpublish only the current version of the file. + */ + public function withIncludeFileVersions(bool $includeFileVersions): self + { + $obj = clone $this; + $obj->includeFileVersions = $includeFileVersions; + + return $obj; + } +} diff --git a/src/Files/FileUpdateParams/Update/UpdateFileDetails.php b/src/Files/FileUpdateParams/Update/UpdateFileDetails.php new file mode 100644 index 00000000..47747047 --- /dev/null +++ b/src/Files/FileUpdateParams/Update/UpdateFileDetails.php @@ -0,0 +1,211 @@ +|null, + * description?: string|null, + * extensions?: list|null, + * removeAITags?: string|null|list, + * tags?: list|null, + * webhookURL?: string|null, + * } + */ +final class UpdateFileDetails implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Define an important area in the image in the format `x,y,width,height` e.g. `10,10,100,100`. Send `null` to unset this value. + */ + #[Api(nullable: true, optional: true)] + public ?string $customCoordinates; + + /** + * A key-value data to be associated with the asset. To unset a key, send `null` value for that key. Before setting any custom metadata on an asset you have to create the field using custom metadata fields API. + * + * @var array|null $customMetadata + */ + #[Api(map: 'mixed', optional: true)] + public ?array $customMetadata; + + /** + * Optional text to describe the contents of the file. + */ + #[Api(optional: true)] + public ?string $description; + + /** + * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. + * + * @var list|null $extensions + */ + #[Api(list: Extension::class, optional: true)] + public ?array $extensions; + + /** + * An array of AITags associated with the file that you want to remove, e.g. `["car", "vehicle", "motorsports"]`. + * + * If you want to remove all AITags associated with the file, send a string - "all". + * + * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. + * + * @var string|list|null $removeAITags + */ + #[Api(union: RemoveAITags::class, optional: true)] + public string|array|null $removeAITags; + + /** + * An array of tags associated with the file, such as `["tag1", "tag2"]`. Send `null` to unset all tags associated with the file. + * + * @var list|null $tags + */ + #[Api(list: 'string', nullable: true, optional: true)] + public ?array $tags; + + /** + * The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + */ + #[Api('webhookUrl', optional: true)] + public ?string $webhookURL; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param array $customMetadata + * @param list $extensions + * @param string|list $removeAITags + * @param list|null $tags + */ + public static function with( + ?string $customCoordinates = null, + ?array $customMetadata = null, + ?string $description = null, + ?array $extensions = null, + string|array|null $removeAITags = null, + ?array $tags = null, + ?string $webhookURL = null, + ): self { + $obj = new self; + + null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; + null !== $customMetadata && $obj->customMetadata = $customMetadata; + null !== $description && $obj->description = $description; + null !== $extensions && $obj->extensions = $extensions; + null !== $removeAITags && $obj->removeAITags = $removeAITags; + null !== $tags && $obj->tags = $tags; + null !== $webhookURL && $obj->webhookURL = $webhookURL; + + return $obj; + } + + /** + * Define an important area in the image in the format `x,y,width,height` e.g. `10,10,100,100`. Send `null` to unset this value. + */ + public function withCustomCoordinates(?string $customCoordinates): self + { + $obj = clone $this; + $obj->customCoordinates = $customCoordinates; + + return $obj; + } + + /** + * A key-value data to be associated with the asset. To unset a key, send `null` value for that key. Before setting any custom metadata on an asset you have to create the field using custom metadata fields API. + * + * @param array $customMetadata + */ + public function withCustomMetadata(array $customMetadata): self + { + $obj = clone $this; + $obj->customMetadata = $customMetadata; + + return $obj; + } + + /** + * Optional text to describe the contents of the file. + */ + public function withDescription(string $description): self + { + $obj = clone $this; + $obj->description = $description; + + return $obj; + } + + /** + * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. + * + * @param list $extensions + */ + public function withExtensions(array $extensions): self + { + $obj = clone $this; + $obj->extensions = $extensions; + + return $obj; + } + + /** + * An array of AITags associated with the file that you want to remove, e.g. `["car", "vehicle", "motorsports"]`. + * + * If you want to remove all AITags associated with the file, send a string - "all". + * + * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. + * + * @param string|list $removeAITags + */ + public function withRemoveAITags(string|array $removeAITags): self + { + $obj = clone $this; + $obj->removeAITags = $removeAITags; + + return $obj; + } + + /** + * An array of tags associated with the file, such as `["tag1", "tag2"]`. Send `null` to unset all tags associated with the file. + * + * @param list|null $tags + */ + public function withTags(?array $tags): self + { + $obj = clone $this; + $obj->tags = $tags; + + return $obj; + } + + /** + * The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + */ + public function withWebhookURL(string $webhookURL): self + { + $obj = clone $this; + $obj->webhookURL = $webhookURL; + + return $obj; + } +} diff --git a/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension.php b/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension.php new file mode 100644 index 00000000..106a7ee7 --- /dev/null +++ b/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension.php @@ -0,0 +1,35 @@ +|array + */ + public static function variants(): array + { + return [ + AutoTaggingExtension::class, + 'remove-bg' => RemoveBg::class, + 'ai-auto-description' => AIAutoDescription::class, + ]; + } +} diff --git a/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/AIAutoDescription.php b/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/AIAutoDescription.php new file mode 100644 index 00000000..61040877 --- /dev/null +++ b/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/AIAutoDescription.php @@ -0,0 +1,39 @@ + */ + use SdkModel; + + /** + * Specifies the auto description extension. + */ + #[Api] + public string $name = 'ai-auto-description'; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(): self + { + return new self; + } +} diff --git a/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/AutoTaggingExtension.php b/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/AutoTaggingExtension.php new file mode 100644 index 00000000..95159c43 --- /dev/null +++ b/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/AutoTaggingExtension.php @@ -0,0 +1,119 @@ + */ + use SdkModel; + + /** + * Maximum number of tags to attach to the asset. + */ + #[Api] + public int $maxTags; + + /** + * Minimum confidence level for tags to be considered valid. + */ + #[Api] + public int $minConfidence; + + /** + * Specifies the auto-tagging extension used. + * + * @var Name::* $name + */ + #[Api(enum: Name::class)] + public string $name; + + /** + * `new AutoTaggingExtension()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AutoTaggingExtension::with(maxTags: ..., minConfidence: ..., name: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AutoTaggingExtension) + * ->withMaxTags(...) + * ->withMinConfidence(...) + * ->withName(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Name::* $name + */ + public static function with( + int $maxTags, + int $minConfidence, + string $name + ): self { + $obj = new self; + + $obj->maxTags = $maxTags; + $obj->minConfidence = $minConfidence; + $obj->name = $name; + + return $obj; + } + + /** + * Maximum number of tags to attach to the asset. + */ + public function withMaxTags(int $maxTags): self + { + $obj = clone $this; + $obj->maxTags = $maxTags; + + return $obj; + } + + /** + * Minimum confidence level for tags to be considered valid. + */ + public function withMinConfidence(int $minConfidence): self + { + $obj = clone $this; + $obj->minConfidence = $minConfidence; + + return $obj; + } + + /** + * Specifies the auto-tagging extension used. + * + * @param Name::* $name + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } +} diff --git a/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/AutoTaggingExtension/Name.php b/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/AutoTaggingExtension/Name.php new file mode 100644 index 00000000..1b209a58 --- /dev/null +++ b/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/AutoTaggingExtension/Name.php @@ -0,0 +1,20 @@ + */ + use SdkModel; + + /** + * Specifies the background removal extension. + */ + #[Api] + public string $name = 'remove-bg'; + + #[Api(optional: true)] + public ?Options $options; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(?Options $options = null): self + { + $obj = new self; + + null !== $options && $obj->options = $options; + + return $obj; + } + + public function withOptions(Options $options): self + { + $obj = clone $this; + $obj->options = $options; + + return $obj; + } +} diff --git a/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/RemoveBg/Options.php b/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/RemoveBg/Options.php new file mode 100644 index 00000000..d6122438 --- /dev/null +++ b/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/RemoveBg/Options.php @@ -0,0 +1,117 @@ + */ + use SdkModel; + + /** + * Whether to add an artificial shadow to the result. Default is false. Note: Adding shadows is currently only supported for car photos. + */ + #[Api('add_shadow', optional: true)] + public ?bool $addShadow; + + /** + * Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or color name (e.g., "green"). If this parameter is set, `bg_image_url` must be empty. + */ + #[Api('bg_color', optional: true)] + public ?string $bgColor; + + /** + * Sets a background image from a URL. If this parameter is set, `bg_color` must be empty. + */ + #[Api('bg_image_url', optional: true)] + public ?string $bgImageURL; + + /** + * Allows semi-transparent regions in the result. Default is true. Note: Semitransparency is currently only supported for car windows. + */ + #[Api(optional: true)] + public ?bool $semitransparency; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + ?bool $addShadow = null, + ?string $bgColor = null, + ?string $bgImageURL = null, + ?bool $semitransparency = null, + ): self { + $obj = new self; + + null !== $addShadow && $obj->addShadow = $addShadow; + null !== $bgColor && $obj->bgColor = $bgColor; + null !== $bgImageURL && $obj->bgImageURL = $bgImageURL; + null !== $semitransparency && $obj->semitransparency = $semitransparency; + + return $obj; + } + + /** + * Whether to add an artificial shadow to the result. Default is false. Note: Adding shadows is currently only supported for car photos. + */ + public function withAddShadow(bool $addShadow): self + { + $obj = clone $this; + $obj->addShadow = $addShadow; + + return $obj; + } + + /** + * Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or color name (e.g., "green"). If this parameter is set, `bg_image_url` must be empty. + */ + public function withBgColor(string $bgColor): self + { + $obj = clone $this; + $obj->bgColor = $bgColor; + + return $obj; + } + + /** + * Sets a background image from a URL. If this parameter is set, `bg_color` must be empty. + */ + public function withBgImageURL(string $bgImageURL): self + { + $obj = clone $this; + $obj->bgImageURL = $bgImageURL; + + return $obj; + } + + /** + * Allows semi-transparent regions in the result. Default is true. Note: Semitransparency is currently only supported for car windows. + */ + public function withSemitransparency(bool $semitransparency): self + { + $obj = clone $this; + $obj->semitransparency = $semitransparency; + + return $obj; + } +} diff --git a/src/Files/FileUpdateParams/Update/UpdateFileDetails/RemoveAITags.php b/src/Files/FileUpdateParams/Update/UpdateFileDetails/RemoveAITags.php new file mode 100644 index 00000000..e30a5980 --- /dev/null +++ b/src/Files/FileUpdateParams/Update/UpdateFileDetails/RemoveAITags.php @@ -0,0 +1,31 @@ +|array + */ + public static function variants(): array + { + return [new ListOf('string'), STAINLESS_FIXME_::class]; + } +} diff --git a/src/Files/FileUpdateResponse.php b/src/Files/FileUpdateResponse.php new file mode 100644 index 00000000..0a6596f9 --- /dev/null +++ b/src/Files/FileUpdateResponse.php @@ -0,0 +1,53 @@ + */ + use SdkModel; + + #[Api(optional: true)] + public ?ExtensionStatus $extensionStatus; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(?ExtensionStatus $extensionStatus = null): self + { + $obj = new self; + + null !== $extensionStatus && $obj->extensionStatus = $extensionStatus; + + return $obj; + } + + public function withExtensionStatus(ExtensionStatus $extensionStatus): self + { + $obj = clone $this; + $obj->extensionStatus = $extensionStatus; + + return $obj; + } +} diff --git a/src/Files/FileUpdateResponse/ExtensionStatus.php b/src/Files/FileUpdateResponse/ExtensionStatus.php new file mode 100644 index 00000000..e9a8ebfb --- /dev/null +++ b/src/Files/FileUpdateResponse/ExtensionStatus.php @@ -0,0 +1,118 @@ + */ + use SdkModel; + + /** @var AIAutoDescription::*|null $aiAutoDescription */ + #[Api('ai-auto-description', enum: AIAutoDescription::class, optional: true)] + public ?string $aiAutoDescription; + + /** @var AwsAutoTagging::*|null $awsAutoTagging */ + #[Api('aws-auto-tagging', enum: AwsAutoTagging::class, optional: true)] + public ?string $awsAutoTagging; + + /** @var GoogleAutoTagging::*|null $googleAutoTagging */ + #[Api('google-auto-tagging', enum: GoogleAutoTagging::class, optional: true)] + public ?string $googleAutoTagging; + + /** @var RemoveBg::*|null $removeBg */ + #[Api('remove-bg', enum: RemoveBg::class, optional: true)] + public ?string $removeBg; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param AIAutoDescription::* $aiAutoDescription + * @param AwsAutoTagging::* $awsAutoTagging + * @param GoogleAutoTagging::* $googleAutoTagging + * @param RemoveBg::* $removeBg + */ + public static function with( + ?string $aiAutoDescription = null, + ?string $awsAutoTagging = null, + ?string $googleAutoTagging = null, + ?string $removeBg = null, + ): self { + $obj = new self; + + null !== $aiAutoDescription && $obj->aiAutoDescription = $aiAutoDescription; + null !== $awsAutoTagging && $obj->awsAutoTagging = $awsAutoTagging; + null !== $googleAutoTagging && $obj->googleAutoTagging = $googleAutoTagging; + null !== $removeBg && $obj->removeBg = $removeBg; + + return $obj; + } + + /** + * @param AIAutoDescription::* $aiAutoDescription + */ + public function withAIAutoDescription(string $aiAutoDescription): self + { + $obj = clone $this; + $obj->aiAutoDescription = $aiAutoDescription; + + return $obj; + } + + /** + * @param AwsAutoTagging::* $awsAutoTagging + */ + public function withAwsAutoTagging(string $awsAutoTagging): self + { + $obj = clone $this; + $obj->awsAutoTagging = $awsAutoTagging; + + return $obj; + } + + /** + * @param GoogleAutoTagging::* $googleAutoTagging + */ + public function withGoogleAutoTagging(string $googleAutoTagging): self + { + $obj = clone $this; + $obj->googleAutoTagging = $googleAutoTagging; + + return $obj; + } + + /** + * @param RemoveBg::* $removeBg + */ + public function withRemoveBg(string $removeBg): self + { + $obj = clone $this; + $obj->removeBg = $removeBg; + + return $obj; + } +} diff --git a/src/Files/FileUpdateResponse/ExtensionStatus/AIAutoDescription.php b/src/Files/FileUpdateResponse/ExtensionStatus/AIAutoDescription.php new file mode 100644 index 00000000..984373de --- /dev/null +++ b/src/Files/FileUpdateResponse/ExtensionStatus/AIAutoDescription.php @@ -0,0 +1,19 @@ +upload + * + * @phpstan-type file_upload_params = array{ + * file: string, + * fileName: string, + * token?: string, + * checks?: string, + * customCoordinates?: string, + * customMetadata?: array, + * description?: string, + * expire?: int, + * extensions?: list, + * folder?: string, + * isPrivateFile?: bool, + * isPublished?: bool, + * overwriteAITags?: bool, + * overwriteCustomMetadata?: bool, + * overwriteFile?: bool, + * overwriteTags?: bool, + * publicKey?: string, + * responseFields?: list, + * signature?: string, + * tags?: list, + * transformation?: Transformation, + * useUniqueFileName?: bool, + * webhookURL?: string, + * } + */ +final class FileUploadParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * The API accepts any of the following: + * + * - **Binary data** – send the raw bytes as `multipart/form-data`. + * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. + * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. + * + * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + */ + #[Api] + public string $file; + + /** + * The name with which the file has to be uploaded. + * The file name can contain: + * + * - Alphanumeric Characters: `a-z`, `A-Z`, `0-9`. + * - Special Characters: `.`, `-` + * + * Any other character including space will be replaced by `_` + */ + #[Api] + public string $fileName; + + /** + * A unique value that the ImageKit.io server will use to recognize and prevent subsequent retries for the same request. We suggest using V4 UUIDs, or another random string with enough entropy to avoid collisions. This field is only required for authentication when uploading a file from the client side. + * + * **Note**: Sending a value that has been used in the past will result in a validation error. Even if your previous request resulted in an error, you should always send a new value for this field. + */ + #[Api(optional: true)] + public ?string $token; + + /** + * Server-side checks to run on the asset. + * Read more about [Upload API checks](/docs/api-reference/upload-file/upload-file#upload-api-checks). + */ + #[Api(optional: true)] + public ?string $checks; + + /** + * Define an important area in the image. This is only relevant for image type files. + * + * - To be passed as a string with the x and y coordinates of the top-left corner, and width and height of the area of interest in the format `x,y,width,height`. For example - `10,10,100,100` + * - Can be used with fo-customtransformation. + * - If this field is not specified and the file is overwritten, then customCoordinates will be removed. + */ + #[Api(optional: true)] + public ?string $customCoordinates; + + /** + * JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. + * + * @var array|null $customMetadata + */ + #[Api(map: 'mixed', optional: true)] + public ?array $customMetadata; + + /** + * Optional text to describe the contents of the file. + */ + #[Api(optional: true)] + public ?string $description; + + /** + * The time until your signature is valid. It must be a [Unix time](https://en.wikipedia.org/wiki/Unix_time) in less than 1 hour into the future. It should be in seconds. This field is only required for authentication when uploading a file from the client side. + */ + #[Api(optional: true)] + public ?int $expire; + + /** + * Array of extensions to be applied to the image. Each extension can be configured with specific parameters based on the extension type. + * + * @var list|null $extensions + */ + #[Api(list: Extension::class, optional: true)] + public ?array $extensions; + + /** + * The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. + * + * The folder name can contain: + * + * - Alphanumeric Characters: `a-z` , `A-Z` , `0-9` + * - Special Characters: `/` , `_` , `-` + * + * Using multiple `/` creates a nested folder. + */ + #[Api(optional: true)] + public ?string $folder; + + /** + * Whether to mark the file as private or not. + * + * If `true`, the file is marked as private and is accessible only using named transformation or signed URL. + */ + #[Api(optional: true)] + public ?bool $isPrivateFile; + + /** + * Whether to upload file as published or not. + * + * If `false`, the file is marked as unpublished, which restricts access to the file only via the media library. Files in draft or unpublished state can only be publicly accessed after being published. + * + * The option to upload in draft state is only available in custom enterprise pricing plans. + */ + #[Api(optional: true)] + public ?bool $isPublished; + + /** + * If set to `true` and a file already exists at the exact location, its AITags will be removed. Set `overwriteAITags` to `false` to preserve AITags. + */ + #[Api(optional: true)] + public ?bool $overwriteAITags; + + /** + * If the request does not have `customMetadata`, and a file already exists at the exact location, existing customMetadata will be removed. + */ + #[Api(optional: true)] + public ?bool $overwriteCustomMetadata; + + /** + * If `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately. + */ + #[Api(optional: true)] + public ?bool $overwriteFile; + + /** + * If the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed. + */ + #[Api(optional: true)] + public ?bool $overwriteTags; + + /** + * Your ImageKit.io public key. This field is only required for authentication when uploading a file from the client side. + */ + #[Api(optional: true)] + public ?string $publicKey; + + /** + * Array of response field keys to include in the API response body. + * + * @var list|null $responseFields + */ + #[Api(list: ResponseField::class, optional: true)] + public ?array $responseFields; + + /** + * HMAC-SHA1 digest of the token+expire using your ImageKit.io private API key as a key. Learn how to create a signature on the page below. This should be in lowercase. + * + * Signature must be calculated on the server-side. This field is only required for authentication when uploading a file from the client side. + */ + #[Api(optional: true)] + public ?string $signature; + + /** + * Set the tags while uploading the file. + * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. + * If this field is not specified and the file is overwritten, the existing tags will be removed. + * + * @var list|null $tags + */ + #[Api(list: 'string', optional: true)] + public ?array $tags; + + /** + * Configure pre-processing (`pre`) and post-processing (`post`) transformations. + * + * - `pre` — applied before the file is uploaded to the Media Library. + * Useful for reducing file size or applying basic optimizations upfront (e.g., resize, compress). + * + * - `post` — applied immediately after upload. + * Ideal for generating transformed versions (like video encodes or thumbnails) in advance, so they're ready for delivery without delay. + * + * You can mix and match any combination of post-processing types. + */ + #[Api(optional: true)] + public ?Transformation $transformation; + + /** + * Whether to use a unique filename for this file or not. + * + * If `true`, ImageKit.io will add a unique suffix to the filename parameter to get a unique filename. + * + * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. + */ + #[Api(optional: true)] + public ?bool $useUniqueFileName; + + /** + * The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + */ + #[Api('webhookUrl', optional: true)] + public ?string $webhookURL; + + /** + * `new FileUploadParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * FileUploadParams::with(file: ..., fileName: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new FileUploadParams)->withFile(...)->withFileName(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param array $customMetadata + * @param list $extensions + * @param list $responseFields + * @param list $tags + */ + public static function with( + string $file, + string $fileName, + ?string $token = null, + ?string $checks = null, + ?string $customCoordinates = null, + ?array $customMetadata = null, + ?string $description = null, + ?int $expire = null, + ?array $extensions = null, + ?string $folder = null, + ?bool $isPrivateFile = null, + ?bool $isPublished = null, + ?bool $overwriteAITags = null, + ?bool $overwriteCustomMetadata = null, + ?bool $overwriteFile = null, + ?bool $overwriteTags = null, + ?string $publicKey = null, + ?array $responseFields = null, + ?string $signature = null, + ?array $tags = null, + ?Transformation $transformation = null, + ?bool $useUniqueFileName = null, + ?string $webhookURL = null, + ): self { + $obj = new self; + + $obj->file = $file; + $obj->fileName = $fileName; + + null !== $token && $obj->token = $token; + null !== $checks && $obj->checks = $checks; + null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; + null !== $customMetadata && $obj->customMetadata = $customMetadata; + null !== $description && $obj->description = $description; + null !== $expire && $obj->expire = $expire; + null !== $extensions && $obj->extensions = $extensions; + null !== $folder && $obj->folder = $folder; + null !== $isPrivateFile && $obj->isPrivateFile = $isPrivateFile; + null !== $isPublished && $obj->isPublished = $isPublished; + null !== $overwriteAITags && $obj->overwriteAITags = $overwriteAITags; + null !== $overwriteCustomMetadata && $obj->overwriteCustomMetadata = $overwriteCustomMetadata; + null !== $overwriteFile && $obj->overwriteFile = $overwriteFile; + null !== $overwriteTags && $obj->overwriteTags = $overwriteTags; + null !== $publicKey && $obj->publicKey = $publicKey; + null !== $responseFields && $obj->responseFields = $responseFields; + null !== $signature && $obj->signature = $signature; + null !== $tags && $obj->tags = $tags; + null !== $transformation && $obj->transformation = $transformation; + null !== $useUniqueFileName && $obj->useUniqueFileName = $useUniqueFileName; + null !== $webhookURL && $obj->webhookURL = $webhookURL; + + return $obj; + } + + /** + * The API accepts any of the following: + * + * - **Binary data** – send the raw bytes as `multipart/form-data`. + * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. + * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. + * + * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + */ + public function withFile(string $file): self + { + $obj = clone $this; + $obj->file = $file; + + return $obj; + } + + /** + * The name with which the file has to be uploaded. + * The file name can contain: + * + * - Alphanumeric Characters: `a-z`, `A-Z`, `0-9`. + * - Special Characters: `.`, `-` + * + * Any other character including space will be replaced by `_` + */ + public function withFileName(string $fileName): self + { + $obj = clone $this; + $obj->fileName = $fileName; + + return $obj; + } + + /** + * A unique value that the ImageKit.io server will use to recognize and prevent subsequent retries for the same request. We suggest using V4 UUIDs, or another random string with enough entropy to avoid collisions. This field is only required for authentication when uploading a file from the client side. + * + * **Note**: Sending a value that has been used in the past will result in a validation error. Even if your previous request resulted in an error, you should always send a new value for this field. + */ + public function withToken(string $token): self + { + $obj = clone $this; + $obj->token = $token; + + return $obj; + } + + /** + * Server-side checks to run on the asset. + * Read more about [Upload API checks](/docs/api-reference/upload-file/upload-file#upload-api-checks). + */ + public function withChecks(string $checks): self + { + $obj = clone $this; + $obj->checks = $checks; + + return $obj; + } + + /** + * Define an important area in the image. This is only relevant for image type files. + * + * - To be passed as a string with the x and y coordinates of the top-left corner, and width and height of the area of interest in the format `x,y,width,height`. For example - `10,10,100,100` + * - Can be used with fo-customtransformation. + * - If this field is not specified and the file is overwritten, then customCoordinates will be removed. + */ + public function withCustomCoordinates(string $customCoordinates): self + { + $obj = clone $this; + $obj->customCoordinates = $customCoordinates; + + return $obj; + } + + /** + * JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. + * + * @param array $customMetadata + */ + public function withCustomMetadata(array $customMetadata): self + { + $obj = clone $this; + $obj->customMetadata = $customMetadata; + + return $obj; + } + + /** + * Optional text to describe the contents of the file. + */ + public function withDescription(string $description): self + { + $obj = clone $this; + $obj->description = $description; + + return $obj; + } + + /** + * The time until your signature is valid. It must be a [Unix time](https://en.wikipedia.org/wiki/Unix_time) in less than 1 hour into the future. It should be in seconds. This field is only required for authentication when uploading a file from the client side. + */ + public function withExpire(int $expire): self + { + $obj = clone $this; + $obj->expire = $expire; + + return $obj; + } + + /** + * Array of extensions to be applied to the image. Each extension can be configured with specific parameters based on the extension type. + * + * @param list $extensions + */ + public function withExtensions(array $extensions): self + { + $obj = clone $this; + $obj->extensions = $extensions; + + return $obj; + } + + /** + * The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. + * + * The folder name can contain: + * + * - Alphanumeric Characters: `a-z` , `A-Z` , `0-9` + * - Special Characters: `/` , `_` , `-` + * + * Using multiple `/` creates a nested folder. + */ + public function withFolder(string $folder): self + { + $obj = clone $this; + $obj->folder = $folder; + + return $obj; + } + + /** + * Whether to mark the file as private or not. + * + * If `true`, the file is marked as private and is accessible only using named transformation or signed URL. + */ + public function withIsPrivateFile(bool $isPrivateFile): self + { + $obj = clone $this; + $obj->isPrivateFile = $isPrivateFile; + + return $obj; + } + + /** + * Whether to upload file as published or not. + * + * If `false`, the file is marked as unpublished, which restricts access to the file only via the media library. Files in draft or unpublished state can only be publicly accessed after being published. + * + * The option to upload in draft state is only available in custom enterprise pricing plans. + */ + public function withIsPublished(bool $isPublished): self + { + $obj = clone $this; + $obj->isPublished = $isPublished; + + return $obj; + } + + /** + * If set to `true` and a file already exists at the exact location, its AITags will be removed. Set `overwriteAITags` to `false` to preserve AITags. + */ + public function withOverwriteAITags(bool $overwriteAITags): self + { + $obj = clone $this; + $obj->overwriteAITags = $overwriteAITags; + + return $obj; + } + + /** + * If the request does not have `customMetadata`, and a file already exists at the exact location, existing customMetadata will be removed. + */ + public function withOverwriteCustomMetadata( + bool $overwriteCustomMetadata + ): self { + $obj = clone $this; + $obj->overwriteCustomMetadata = $overwriteCustomMetadata; + + return $obj; + } + + /** + * If `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately. + */ + public function withOverwriteFile(bool $overwriteFile): self + { + $obj = clone $this; + $obj->overwriteFile = $overwriteFile; + + return $obj; + } + + /** + * If the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed. + */ + public function withOverwriteTags(bool $overwriteTags): self + { + $obj = clone $this; + $obj->overwriteTags = $overwriteTags; + + return $obj; + } + + /** + * Your ImageKit.io public key. This field is only required for authentication when uploading a file from the client side. + */ + public function withPublicKey(string $publicKey): self + { + $obj = clone $this; + $obj->publicKey = $publicKey; + + return $obj; + } + + /** + * Array of response field keys to include in the API response body. + * + * @param list $responseFields + */ + public function withResponseFields(array $responseFields): self + { + $obj = clone $this; + $obj->responseFields = $responseFields; + + return $obj; + } + + /** + * HMAC-SHA1 digest of the token+expire using your ImageKit.io private API key as a key. Learn how to create a signature on the page below. This should be in lowercase. + * + * Signature must be calculated on the server-side. This field is only required for authentication when uploading a file from the client side. + */ + public function withSignature(string $signature): self + { + $obj = clone $this; + $obj->signature = $signature; + + return $obj; + } + + /** + * Set the tags while uploading the file. + * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. + * If this field is not specified and the file is overwritten, the existing tags will be removed. + * + * @param list $tags + */ + public function withTags(array $tags): self + { + $obj = clone $this; + $obj->tags = $tags; + + return $obj; + } + + /** + * Configure pre-processing (`pre`) and post-processing (`post`) transformations. + * + * - `pre` — applied before the file is uploaded to the Media Library. + * Useful for reducing file size or applying basic optimizations upfront (e.g., resize, compress). + * + * - `post` — applied immediately after upload. + * Ideal for generating transformed versions (like video encodes or thumbnails) in advance, so they're ready for delivery without delay. + * + * You can mix and match any combination of post-processing types. + */ + public function withTransformation(Transformation $transformation): self + { + $obj = clone $this; + $obj->transformation = $transformation; + + return $obj; + } + + /** + * Whether to use a unique filename for this file or not. + * + * If `true`, ImageKit.io will add a unique suffix to the filename parameter to get a unique filename. + * + * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. + */ + public function withUseUniqueFileName(bool $useUniqueFileName): self + { + $obj = clone $this; + $obj->useUniqueFileName = $useUniqueFileName; + + return $obj; + } + + /** + * The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + */ + public function withWebhookURL(string $webhookURL): self + { + $obj = clone $this; + $obj->webhookURL = $webhookURL; + + return $obj; + } +} diff --git a/src/Files/FileUploadParams/Extension.php b/src/Files/FileUploadParams/Extension.php new file mode 100644 index 00000000..ace12834 --- /dev/null +++ b/src/Files/FileUploadParams/Extension.php @@ -0,0 +1,35 @@ +|array + */ + public static function variants(): array + { + return [ + AutoTaggingExtension::class, + 'remove-bg' => RemoveBg::class, + 'ai-auto-description' => AIAutoDescription::class, + ]; + } +} diff --git a/src/Files/FileUploadParams/Extension/AIAutoDescription.php b/src/Files/FileUploadParams/Extension/AIAutoDescription.php new file mode 100644 index 00000000..4affc0d4 --- /dev/null +++ b/src/Files/FileUploadParams/Extension/AIAutoDescription.php @@ -0,0 +1,39 @@ + */ + use SdkModel; + + /** + * Specifies the auto description extension. + */ + #[Api] + public string $name = 'ai-auto-description'; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(): self + { + return new self; + } +} diff --git a/src/Files/FileUploadParams/Extension/AutoTaggingExtension.php b/src/Files/FileUploadParams/Extension/AutoTaggingExtension.php new file mode 100644 index 00000000..f1042d04 --- /dev/null +++ b/src/Files/FileUploadParams/Extension/AutoTaggingExtension.php @@ -0,0 +1,119 @@ + */ + use SdkModel; + + /** + * Maximum number of tags to attach to the asset. + */ + #[Api] + public int $maxTags; + + /** + * Minimum confidence level for tags to be considered valid. + */ + #[Api] + public int $minConfidence; + + /** + * Specifies the auto-tagging extension used. + * + * @var Name::* $name + */ + #[Api(enum: Name::class)] + public string $name; + + /** + * `new AutoTaggingExtension()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AutoTaggingExtension::with(maxTags: ..., minConfidence: ..., name: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AutoTaggingExtension) + * ->withMaxTags(...) + * ->withMinConfidence(...) + * ->withName(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Name::* $name + */ + public static function with( + int $maxTags, + int $minConfidence, + string $name + ): self { + $obj = new self; + + $obj->maxTags = $maxTags; + $obj->minConfidence = $minConfidence; + $obj->name = $name; + + return $obj; + } + + /** + * Maximum number of tags to attach to the asset. + */ + public function withMaxTags(int $maxTags): self + { + $obj = clone $this; + $obj->maxTags = $maxTags; + + return $obj; + } + + /** + * Minimum confidence level for tags to be considered valid. + */ + public function withMinConfidence(int $minConfidence): self + { + $obj = clone $this; + $obj->minConfidence = $minConfidence; + + return $obj; + } + + /** + * Specifies the auto-tagging extension used. + * + * @param Name::* $name + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } +} diff --git a/src/Files/FileUploadParams/Extension/AutoTaggingExtension/Name.php b/src/Files/FileUploadParams/Extension/AutoTaggingExtension/Name.php new file mode 100644 index 00000000..3e4be1ce --- /dev/null +++ b/src/Files/FileUploadParams/Extension/AutoTaggingExtension/Name.php @@ -0,0 +1,20 @@ + */ + use SdkModel; + + /** + * Specifies the background removal extension. + */ + #[Api] + public string $name = 'remove-bg'; + + #[Api(optional: true)] + public ?Options $options; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(?Options $options = null): self + { + $obj = new self; + + null !== $options && $obj->options = $options; + + return $obj; + } + + public function withOptions(Options $options): self + { + $obj = clone $this; + $obj->options = $options; + + return $obj; + } +} diff --git a/src/Files/FileUploadParams/Extension/RemoveBg/Options.php b/src/Files/FileUploadParams/Extension/RemoveBg/Options.php new file mode 100644 index 00000000..dd170491 --- /dev/null +++ b/src/Files/FileUploadParams/Extension/RemoveBg/Options.php @@ -0,0 +1,117 @@ + */ + use SdkModel; + + /** + * Whether to add an artificial shadow to the result. Default is false. Note: Adding shadows is currently only supported for car photos. + */ + #[Api('add_shadow', optional: true)] + public ?bool $addShadow; + + /** + * Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or color name (e.g., "green"). If this parameter is set, `bg_image_url` must be empty. + */ + #[Api('bg_color', optional: true)] + public ?string $bgColor; + + /** + * Sets a background image from a URL. If this parameter is set, `bg_color` must be empty. + */ + #[Api('bg_image_url', optional: true)] + public ?string $bgImageURL; + + /** + * Allows semi-transparent regions in the result. Default is true. Note: Semitransparency is currently only supported for car windows. + */ + #[Api(optional: true)] + public ?bool $semitransparency; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + ?bool $addShadow = null, + ?string $bgColor = null, + ?string $bgImageURL = null, + ?bool $semitransparency = null, + ): self { + $obj = new self; + + null !== $addShadow && $obj->addShadow = $addShadow; + null !== $bgColor && $obj->bgColor = $bgColor; + null !== $bgImageURL && $obj->bgImageURL = $bgImageURL; + null !== $semitransparency && $obj->semitransparency = $semitransparency; + + return $obj; + } + + /** + * Whether to add an artificial shadow to the result. Default is false. Note: Adding shadows is currently only supported for car photos. + */ + public function withAddShadow(bool $addShadow): self + { + $obj = clone $this; + $obj->addShadow = $addShadow; + + return $obj; + } + + /** + * Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or color name (e.g., "green"). If this parameter is set, `bg_image_url` must be empty. + */ + public function withBgColor(string $bgColor): self + { + $obj = clone $this; + $obj->bgColor = $bgColor; + + return $obj; + } + + /** + * Sets a background image from a URL. If this parameter is set, `bg_color` must be empty. + */ + public function withBgImageURL(string $bgImageURL): self + { + $obj = clone $this; + $obj->bgImageURL = $bgImageURL; + + return $obj; + } + + /** + * Allows semi-transparent regions in the result. Default is true. Note: Semitransparency is currently only supported for car windows. + */ + public function withSemitransparency(bool $semitransparency): self + { + $obj = clone $this; + $obj->semitransparency = $semitransparency; + + return $obj; + } +} diff --git a/src/Files/FileUploadParams/ResponseField.php b/src/Files/FileUploadParams/ResponseField.php new file mode 100644 index 00000000..dc6a9aa7 --- /dev/null +++ b/src/Files/FileUploadParams/ResponseField.php @@ -0,0 +1,27 @@ +|null, pre?: string|null + * } + */ +final class Transformation implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * List of transformations to apply *after* the file is uploaded. + * Each item must match one of the following types: + * `transformation`, `gif-to-video`, `thumbnail`, `abs`. + * + * @var list|null $post + */ + #[Api(list: Post::class, optional: true)] + public ?array $post; + + /** + * Transformation string to apply before uploading the file to the Media Library. Useful for optimizing files at ingestion. + */ + #[Api(optional: true)] + public ?string $pre; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $post + */ + public static function with(?array $post = null, ?string $pre = null): self + { + $obj = new self; + + null !== $post && $obj->post = $post; + null !== $pre && $obj->pre = $pre; + + return $obj; + } + + /** + * List of transformations to apply *after* the file is uploaded. + * Each item must match one of the following types: + * `transformation`, `gif-to-video`, `thumbnail`, `abs`. + * + * @param list $post + */ + public function withPost(array $post): self + { + $obj = clone $this; + $obj->post = $post; + + return $obj; + } + + /** + * Transformation string to apply before uploading the file to the Media Library. Useful for optimizing files at ingestion. + */ + public function withPre(string $pre): self + { + $obj = clone $this; + $obj->pre = $pre; + + return $obj; + } +} diff --git a/src/Files/FileUploadParams/Transformation/Post.php b/src/Files/FileUploadParams/Transformation/Post.php new file mode 100644 index 00000000..25adf16b --- /dev/null +++ b/src/Files/FileUploadParams/Transformation/Post.php @@ -0,0 +1,37 @@ +|array + */ + public static function variants(): array + { + return [ + 'transformation' => Transformation::class, + 'gif-to-video' => GifToVideo::class, + 'thumbnail' => Thumbnail::class, + 'abs' => Abs::class, + ]; + } +} diff --git a/src/Files/FileUploadParams/Transformation/Post/Abs.php b/src/Files/FileUploadParams/Transformation/Post/Abs.php new file mode 100644 index 00000000..0bdb263e --- /dev/null +++ b/src/Files/FileUploadParams/Transformation/Post/Abs.php @@ -0,0 +1,101 @@ + */ + use SdkModel; + + /** + * Adaptive Bitrate Streaming (ABS) setup. + */ + #[Api] + public string $type = 'abs'; + + /** + * Streaming protocol to use (`hls` or `dash`). + * + * @var Protocol::* $protocol + */ + #[Api(enum: Protocol::class)] + public string $protocol; + + /** + * List of different representations you want to create separated by an underscore. + */ + #[Api] + public string $value; + + /** + * `new Abs()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Abs::with(protocol: ..., value: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Abs)->withProtocol(...)->withValue(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Protocol::* $protocol + */ + public static function with(string $protocol, string $value): self + { + $obj = new self; + + $obj->protocol = $protocol; + $obj->value = $value; + + return $obj; + } + + /** + * Streaming protocol to use (`hls` or `dash`). + * + * @param Protocol::* $protocol + */ + public function withProtocol(string $protocol): self + { + $obj = clone $this; + $obj->protocol = $protocol; + + return $obj; + } + + /** + * List of different representations you want to create separated by an underscore. + */ + public function withValue(string $value): self + { + $obj = clone $this; + $obj->value = $value; + + return $obj; + } +} diff --git a/src/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php b/src/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php new file mode 100644 index 00000000..a31642c3 --- /dev/null +++ b/src/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php @@ -0,0 +1,20 @@ + */ + use SdkModel; + + /** + * Converts an animated GIF into an MP4. + */ + #[Api] + public string $type = 'gif-to-video'; + + /** + * Optional transformation string to apply to the output video. + * **Example**: `q-80`. + */ + #[Api(optional: true)] + public ?string $value; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(?string $value = null): self + { + $obj = new self; + + null !== $value && $obj->value = $value; + + return $obj; + } + + /** + * Optional transformation string to apply to the output video. + * **Example**: `q-80`. + */ + public function withValue(string $value): self + { + $obj = clone $this; + $obj->value = $value; + + return $obj; + } +} diff --git a/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php b/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php new file mode 100644 index 00000000..426e24d0 --- /dev/null +++ b/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php @@ -0,0 +1,62 @@ + */ + use SdkModel; + + /** + * Generates a thumbnail image. + */ + #[Api] + public string $type = 'thumbnail'; + + /** + * Optional transformation string. + * **Example**: `w-150,h-150`. + */ + #[Api(optional: true)] + public ?string $value; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(?string $value = null): self + { + $obj = new self; + + null !== $value && $obj->value = $value; + + return $obj; + } + + /** + * Optional transformation string. + * **Example**: `w-150,h-150`. + */ + public function withValue(string $value): self + { + $obj = clone $this; + $obj->value = $value; + + return $obj; + } +} diff --git a/src/Files/FileUploadParams/Transformation/Post/Transformation.php b/src/Files/FileUploadParams/Transformation/Post/Transformation.php new file mode 100644 index 00000000..3f514695 --- /dev/null +++ b/src/Files/FileUploadParams/Transformation/Post/Transformation.php @@ -0,0 +1,76 @@ + */ + use SdkModel; + + /** + * Transformation type. + */ + #[Api] + public string $type = 'transformation'; + + /** + * Transformation string (e.g. `w-200,h-200`). + * Same syntax as ImageKit URL-based transformations. + */ + #[Api] + public string $value; + + /** + * `new Transformation()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Transformation::with(value: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Transformation)->withValue(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $value): self + { + $obj = new self; + + $obj->value = $value; + + return $obj; + } + + /** + * Transformation string (e.g. `w-200,h-200`). + * Same syntax as ImageKit URL-based transformations. + */ + public function withValue(string $value): self + { + $obj = clone $this; + $obj->value = $value; + + return $obj; + } +} diff --git a/src/Files/FileUploadResponse.php b/src/Files/FileUploadResponse.php new file mode 100644 index 00000000..96f41701 --- /dev/null +++ b/src/Files/FileUploadResponse.php @@ -0,0 +1,555 @@ +|null, + * audioCodec?: string|null, + * bitRate?: int|null, + * customCoordinates?: string|null, + * customMetadata?: array|null, + * description?: string|null, + * duration?: int|null, + * embeddedMetadata?: array|null, + * extensionStatus?: ExtensionStatus|null, + * fileID?: string|null, + * filePath?: string|null, + * fileType?: string|null, + * height?: float|null, + * isPrivateFile?: bool|null, + * isPublished?: bool|null, + * metadata?: Metadata|null, + * name?: string|null, + * size?: float|null, + * tags?: list|null, + * thumbnailURL?: string|null, + * url?: string|null, + * versionInfo?: VersionInfo|null, + * videoCodec?: string|null, + * width?: float|null, + * } + */ +final class FileUploadResponse implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * An array of tags assigned to the uploaded file by auto tagging. + * + * @var list|null $aiTags + */ + #[Api('AITags', list: AITag::class, nullable: true, optional: true)] + public ?array $aiTags; + + /** + * The audio codec used in the video (only for video). + */ + #[Api(optional: true)] + public ?string $audioCodec; + + /** + * The bit rate of the video in kbps (only for video). + */ + #[Api(optional: true)] + public ?int $bitRate; + + /** + * Value of custom coordinates associated with the image in the format `x,y,width,height`. If `customCoordinates` are not defined, then it is `null`. Send `customCoordinates` in `responseFields` in API request to get the value of this field. + */ + #[Api(nullable: true, optional: true)] + public ?string $customCoordinates; + + /** + * A key-value data associated with the asset. Use `responseField` in API request to get `customMetadata` in the upload API response. Before setting any custom metadata on an asset, you have to create the field using custom metadata fields API. Send `customMetadata` in `responseFields` in API request to get the value of this field. + * + * @var array|null $customMetadata + */ + #[Api(map: 'mixed', optional: true)] + public ?array $customMetadata; + + /** + * Optional text to describe the contents of the file. Can be set by the user or the ai-auto-description extension. + */ + #[Api(optional: true)] + public ?string $description; + + /** + * The duration of the video in seconds (only for video). + */ + #[Api(optional: true)] + public ?int $duration; + + /** + * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. Send `embeddedMetadata` in `responseFields` in API request to get embeddedMetadata in the upload API response. + * + * @var array|null $embeddedMetadata + */ + #[Api(map: 'mixed', optional: true)] + public ?array $embeddedMetadata; + + /** + * Extension names with their processing status at the time of completion of the request. It could have one of the following status values: + * + * `success`: The extension has been successfully applied. + * `failed`: The extension has failed and will not be retried. + * `pending`: The extension will finish processing in some time. On completion, the final status (success / failed) will be sent to the `webhookUrl` provided. + * + * If no extension was requested, then this parameter is not returned. + */ + #[Api(optional: true)] + public ?ExtensionStatus $extensionStatus; + + /** + * Unique fileId. Store this fileld in your database, as this will be used to perform update action on this file. + */ + #[Api('fileId', optional: true)] + public ?string $fileID; + + /** + * The relative path of the file in the media library e.g. `/marketing-assets/new-banner.jpg`. + */ + #[Api(optional: true)] + public ?string $filePath; + + /** + * Type of the uploaded file. Possible values are `image`, `non-image`. + */ + #[Api(optional: true)] + public ?string $fileType; + + /** + * Height of the image in pixels (Only for images). + */ + #[Api(optional: true)] + public ?float $height; + + /** + * Is the file marked as private. It can be either `true` or `false`. Send `isPrivateFile` in `responseFields` in API request to get the value of this field. + */ + #[Api(optional: true)] + public ?bool $isPrivateFile; + + /** + * Is the file published or in draft state. It can be either `true` or `false`. Send `isPublished` in `responseFields` in API request to get the value of this field. + */ + #[Api(optional: true)] + public ?bool $isPublished; + + /** + * Legacy metadata. Send `metadata` in `responseFields` in API request to get metadata in the upload API response. + */ + #[Api(optional: true)] + public ?Metadata $metadata; + + /** + * Name of the asset. + */ + #[Api(optional: true)] + public ?string $name; + + /** + * Size of the image file in Bytes. + */ + #[Api(optional: true)] + public ?float $size; + + /** + * The array of tags associated with the asset. If no tags are set, it will be `null`. Send `tags` in `responseFields` in API request to get the value of this field. + * + * @var list|null $tags + */ + #[Api(list: 'string', nullable: true, optional: true)] + public ?array $tags; + + /** + * In the case of an image, a small thumbnail URL. + */ + #[Api('thumbnailUrl', optional: true)] + public ?string $thumbnailURL; + + /** + * A publicly accessible URL of the file. + */ + #[Api(optional: true)] + public ?string $url; + + /** + * An object containing the file or file version's `id` (versionId) and `name`. + */ + #[Api(optional: true)] + public ?VersionInfo $versionInfo; + + /** + * The video codec used in the video (only for video). + */ + #[Api(optional: true)] + public ?string $videoCodec; + + /** + * Width of the image in pixels (Only for Images). + */ + #[Api(optional: true)] + public ?float $width; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list|null $aiTags + * @param array $customMetadata + * @param array $embeddedMetadata + * @param list|null $tags + */ + public static function with( + ?array $aiTags = null, + ?string $audioCodec = null, + ?int $bitRate = null, + ?string $customCoordinates = null, + ?array $customMetadata = null, + ?string $description = null, + ?int $duration = null, + ?array $embeddedMetadata = null, + ?ExtensionStatus $extensionStatus = null, + ?string $fileID = null, + ?string $filePath = null, + ?string $fileType = null, + ?float $height = null, + ?bool $isPrivateFile = null, + ?bool $isPublished = null, + ?Metadata $metadata = null, + ?string $name = null, + ?float $size = null, + ?array $tags = null, + ?string $thumbnailURL = null, + ?string $url = null, + ?VersionInfo $versionInfo = null, + ?string $videoCodec = null, + ?float $width = null, + ): self { + $obj = new self; + + null !== $aiTags && $obj->aiTags = $aiTags; + null !== $audioCodec && $obj->audioCodec = $audioCodec; + null !== $bitRate && $obj->bitRate = $bitRate; + null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; + null !== $customMetadata && $obj->customMetadata = $customMetadata; + null !== $description && $obj->description = $description; + null !== $duration && $obj->duration = $duration; + null !== $embeddedMetadata && $obj->embeddedMetadata = $embeddedMetadata; + null !== $extensionStatus && $obj->extensionStatus = $extensionStatus; + null !== $fileID && $obj->fileID = $fileID; + null !== $filePath && $obj->filePath = $filePath; + null !== $fileType && $obj->fileType = $fileType; + null !== $height && $obj->height = $height; + null !== $isPrivateFile && $obj->isPrivateFile = $isPrivateFile; + null !== $isPublished && $obj->isPublished = $isPublished; + null !== $metadata && $obj->metadata = $metadata; + null !== $name && $obj->name = $name; + null !== $size && $obj->size = $size; + null !== $tags && $obj->tags = $tags; + null !== $thumbnailURL && $obj->thumbnailURL = $thumbnailURL; + null !== $url && $obj->url = $url; + null !== $versionInfo && $obj->versionInfo = $versionInfo; + null !== $videoCodec && $obj->videoCodec = $videoCodec; + null !== $width && $obj->width = $width; + + return $obj; + } + + /** + * An array of tags assigned to the uploaded file by auto tagging. + * + * @param list|null $aiTags + */ + public function withAITags(?array $aiTags): self + { + $obj = clone $this; + $obj->aiTags = $aiTags; + + return $obj; + } + + /** + * The audio codec used in the video (only for video). + */ + public function withAudioCodec(string $audioCodec): self + { + $obj = clone $this; + $obj->audioCodec = $audioCodec; + + return $obj; + } + + /** + * The bit rate of the video in kbps (only for video). + */ + public function withBitRate(int $bitRate): self + { + $obj = clone $this; + $obj->bitRate = $bitRate; + + return $obj; + } + + /** + * Value of custom coordinates associated with the image in the format `x,y,width,height`. If `customCoordinates` are not defined, then it is `null`. Send `customCoordinates` in `responseFields` in API request to get the value of this field. + */ + public function withCustomCoordinates(?string $customCoordinates): self + { + $obj = clone $this; + $obj->customCoordinates = $customCoordinates; + + return $obj; + } + + /** + * A key-value data associated with the asset. Use `responseField` in API request to get `customMetadata` in the upload API response. Before setting any custom metadata on an asset, you have to create the field using custom metadata fields API. Send `customMetadata` in `responseFields` in API request to get the value of this field. + * + * @param array $customMetadata + */ + public function withCustomMetadata(array $customMetadata): self + { + $obj = clone $this; + $obj->customMetadata = $customMetadata; + + return $obj; + } + + /** + * Optional text to describe the contents of the file. Can be set by the user or the ai-auto-description extension. + */ + public function withDescription(string $description): self + { + $obj = clone $this; + $obj->description = $description; + + return $obj; + } + + /** + * The duration of the video in seconds (only for video). + */ + public function withDuration(int $duration): self + { + $obj = clone $this; + $obj->duration = $duration; + + return $obj; + } + + /** + * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. Send `embeddedMetadata` in `responseFields` in API request to get embeddedMetadata in the upload API response. + * + * @param array $embeddedMetadata + */ + public function withEmbeddedMetadata(array $embeddedMetadata): self + { + $obj = clone $this; + $obj->embeddedMetadata = $embeddedMetadata; + + return $obj; + } + + /** + * Extension names with their processing status at the time of completion of the request. It could have one of the following status values: + * + * `success`: The extension has been successfully applied. + * `failed`: The extension has failed and will not be retried. + * `pending`: The extension will finish processing in some time. On completion, the final status (success / failed) will be sent to the `webhookUrl` provided. + * + * If no extension was requested, then this parameter is not returned. + */ + public function withExtensionStatus(ExtensionStatus $extensionStatus): self + { + $obj = clone $this; + $obj->extensionStatus = $extensionStatus; + + return $obj; + } + + /** + * Unique fileId. Store this fileld in your database, as this will be used to perform update action on this file. + */ + public function withFileID(string $fileID): self + { + $obj = clone $this; + $obj->fileID = $fileID; + + return $obj; + } + + /** + * The relative path of the file in the media library e.g. `/marketing-assets/new-banner.jpg`. + */ + public function withFilePath(string $filePath): self + { + $obj = clone $this; + $obj->filePath = $filePath; + + return $obj; + } + + /** + * Type of the uploaded file. Possible values are `image`, `non-image`. + */ + public function withFileType(string $fileType): self + { + $obj = clone $this; + $obj->fileType = $fileType; + + return $obj; + } + + /** + * Height of the image in pixels (Only for images). + */ + public function withHeight(float $height): self + { + $obj = clone $this; + $obj->height = $height; + + return $obj; + } + + /** + * Is the file marked as private. It can be either `true` or `false`. Send `isPrivateFile` in `responseFields` in API request to get the value of this field. + */ + public function withIsPrivateFile(bool $isPrivateFile): self + { + $obj = clone $this; + $obj->isPrivateFile = $isPrivateFile; + + return $obj; + } + + /** + * Is the file published or in draft state. It can be either `true` or `false`. Send `isPublished` in `responseFields` in API request to get the value of this field. + */ + public function withIsPublished(bool $isPublished): self + { + $obj = clone $this; + $obj->isPublished = $isPublished; + + return $obj; + } + + /** + * Legacy metadata. Send `metadata` in `responseFields` in API request to get metadata in the upload API response. + */ + public function withMetadata(Metadata $metadata): self + { + $obj = clone $this; + $obj->metadata = $metadata; + + return $obj; + } + + /** + * Name of the asset. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * Size of the image file in Bytes. + */ + public function withSize(float $size): self + { + $obj = clone $this; + $obj->size = $size; + + return $obj; + } + + /** + * The array of tags associated with the asset. If no tags are set, it will be `null`. Send `tags` in `responseFields` in API request to get the value of this field. + * + * @param list|null $tags + */ + public function withTags(?array $tags): self + { + $obj = clone $this; + $obj->tags = $tags; + + return $obj; + } + + /** + * In the case of an image, a small thumbnail URL. + */ + public function withThumbnailURL(string $thumbnailURL): self + { + $obj = clone $this; + $obj->thumbnailURL = $thumbnailURL; + + return $obj; + } + + /** + * A publicly accessible URL of the file. + */ + public function withURL(string $url): self + { + $obj = clone $this; + $obj->url = $url; + + return $obj; + } + + /** + * An object containing the file or file version's `id` (versionId) and `name`. + */ + public function withVersionInfo(VersionInfo $versionInfo): self + { + $obj = clone $this; + $obj->versionInfo = $versionInfo; + + return $obj; + } + + /** + * The video codec used in the video (only for video). + */ + public function withVideoCodec(string $videoCodec): self + { + $obj = clone $this; + $obj->videoCodec = $videoCodec; + + return $obj; + } + + /** + * Width of the image in pixels (Only for Images). + */ + public function withWidth(float $width): self + { + $obj = clone $this; + $obj->width = $width; + + return $obj; + } +} diff --git a/src/Files/FileUploadResponse/AITag.php b/src/Files/FileUploadResponse/AITag.php new file mode 100644 index 00000000..547bcb68 --- /dev/null +++ b/src/Files/FileUploadResponse/AITag.php @@ -0,0 +1,95 @@ + */ + use SdkModel; + + /** + * Confidence score of the tag. + */ + #[Api(optional: true)] + public ?float $confidence; + + /** + * Name of the tag. + */ + #[Api(optional: true)] + public ?string $name; + + /** + * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + */ + #[Api(optional: true)] + public ?string $source; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + ?float $confidence = null, + ?string $name = null, + ?string $source = null + ): self { + $obj = new self; + + null !== $confidence && $obj->confidence = $confidence; + null !== $name && $obj->name = $name; + null !== $source && $obj->source = $source; + + return $obj; + } + + /** + * Confidence score of the tag. + */ + public function withConfidence(float $confidence): self + { + $obj = clone $this; + $obj->confidence = $confidence; + + return $obj; + } + + /** + * Name of the tag. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + */ + public function withSource(string $source): self + { + $obj = clone $this; + $obj->source = $source; + + return $obj; + } +} diff --git a/src/Files/FileUploadResponse/ExtensionStatus.php b/src/Files/FileUploadResponse/ExtensionStatus.php new file mode 100644 index 00000000..1b0abced --- /dev/null +++ b/src/Files/FileUploadResponse/ExtensionStatus.php @@ -0,0 +1,126 @@ + */ + use SdkModel; + + /** @var AIAutoDescription::*|null $aiAutoDescription */ + #[Api('ai-auto-description', enum: AIAutoDescription::class, optional: true)] + public ?string $aiAutoDescription; + + /** @var AwsAutoTagging::*|null $awsAutoTagging */ + #[Api('aws-auto-tagging', enum: AwsAutoTagging::class, optional: true)] + public ?string $awsAutoTagging; + + /** @var GoogleAutoTagging::*|null $googleAutoTagging */ + #[Api('google-auto-tagging', enum: GoogleAutoTagging::class, optional: true)] + public ?string $googleAutoTagging; + + /** @var RemoveBg::*|null $removeBg */ + #[Api('remove-bg', enum: RemoveBg::class, optional: true)] + public ?string $removeBg; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param AIAutoDescription::* $aiAutoDescription + * @param AwsAutoTagging::* $awsAutoTagging + * @param GoogleAutoTagging::* $googleAutoTagging + * @param RemoveBg::* $removeBg + */ + public static function with( + ?string $aiAutoDescription = null, + ?string $awsAutoTagging = null, + ?string $googleAutoTagging = null, + ?string $removeBg = null, + ): self { + $obj = new self; + + null !== $aiAutoDescription && $obj->aiAutoDescription = $aiAutoDescription; + null !== $awsAutoTagging && $obj->awsAutoTagging = $awsAutoTagging; + null !== $googleAutoTagging && $obj->googleAutoTagging = $googleAutoTagging; + null !== $removeBg && $obj->removeBg = $removeBg; + + return $obj; + } + + /** + * @param AIAutoDescription::* $aiAutoDescription + */ + public function withAIAutoDescription(string $aiAutoDescription): self + { + $obj = clone $this; + $obj->aiAutoDescription = $aiAutoDescription; + + return $obj; + } + + /** + * @param AwsAutoTagging::* $awsAutoTagging + */ + public function withAwsAutoTagging(string $awsAutoTagging): self + { + $obj = clone $this; + $obj->awsAutoTagging = $awsAutoTagging; + + return $obj; + } + + /** + * @param GoogleAutoTagging::* $googleAutoTagging + */ + public function withGoogleAutoTagging(string $googleAutoTagging): self + { + $obj = clone $this; + $obj->googleAutoTagging = $googleAutoTagging; + + return $obj; + } + + /** + * @param RemoveBg::* $removeBg + */ + public function withRemoveBg(string $removeBg): self + { + $obj = clone $this; + $obj->removeBg = $removeBg; + + return $obj; + } +} diff --git a/src/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php b/src/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php new file mode 100644 index 00000000..ade7f05c --- /dev/null +++ b/src/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php @@ -0,0 +1,19 @@ + */ + use SdkModel; + + /** + * Unique identifier of the file version. + */ + #[Api(optional: true)] + public ?string $id; + + /** + * Name of the file version. + */ + #[Api(optional: true)] + public ?string $name; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(?string $id = null, ?string $name = null): self + { + $obj = new self; + + null !== $id && $obj->id = $id; + null !== $name && $obj->name = $name; + + return $obj; + } + + /** + * Unique identifier of the file version. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * Name of the file version. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } +} diff --git a/src/Files/Folder.php b/src/Files/Folder.php new file mode 100644 index 00000000..5778cbeb --- /dev/null +++ b/src/Files/Folder.php @@ -0,0 +1,164 @@ + */ + use SdkModel; + + /** + * Date and time when the folder was created. The date and time is in ISO8601 format. + */ + #[Api(optional: true)] + public ?\DateTimeInterface $createdAt; + + /** + * Unique identifier of the asset. + */ + #[Api('folderId', optional: true)] + public ?string $folderID; + + /** + * Path of the folder. This is the path you would use in the URL to access the folder. For example, if the folder is at the root of the media library, the path will be /folder. If the folder is inside another folder named images, the path will be /images/folder. + */ + #[Api(optional: true)] + public ?string $folderPath; + + /** + * Name of the asset. + */ + #[Api(optional: true)] + public ?string $name; + + /** + * Type of the asset. + * + * @var Type::*|null $type + */ + #[Api(enum: Type::class, optional: true)] + public ?string $type; + + /** + * Date and time when the folder was last updated. The date and time is in ISO8601 format. + */ + #[Api(optional: true)] + public ?\DateTimeInterface $updatedAt; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Type::* $type + */ + public static function with( + ?\DateTimeInterface $createdAt = null, + ?string $folderID = null, + ?string $folderPath = null, + ?string $name = null, + ?string $type = null, + ?\DateTimeInterface $updatedAt = null, + ): self { + $obj = new self; + + null !== $createdAt && $obj->createdAt = $createdAt; + null !== $folderID && $obj->folderID = $folderID; + null !== $folderPath && $obj->folderPath = $folderPath; + null !== $name && $obj->name = $name; + null !== $type && $obj->type = $type; + null !== $updatedAt && $obj->updatedAt = $updatedAt; + + return $obj; + } + + /** + * Date and time when the folder was created. The date and time is in ISO8601 format. + */ + public function withCreatedAt(\DateTimeInterface $createdAt): self + { + $obj = clone $this; + $obj->createdAt = $createdAt; + + return $obj; + } + + /** + * Unique identifier of the asset. + */ + public function withFolderID(string $folderID): self + { + $obj = clone $this; + $obj->folderID = $folderID; + + return $obj; + } + + /** + * Path of the folder. This is the path you would use in the URL to access the folder. For example, if the folder is at the root of the media library, the path will be /folder. If the folder is inside another folder named images, the path will be /images/folder. + */ + public function withFolderPath(string $folderPath): self + { + $obj = clone $this; + $obj->folderPath = $folderPath; + + return $obj; + } + + /** + * Name of the asset. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * Type of the asset. + * + * @param Type::* $type + */ + public function withType(string $type): self + { + $obj = clone $this; + $obj->type = $type; + + return $obj; + } + + /** + * Date and time when the folder was last updated. The date and time is in ISO8601 format. + */ + public function withUpdatedAt(\DateTimeInterface $updatedAt): self + { + $obj = clone $this; + $obj->updatedAt = $updatedAt; + + return $obj; + } +} diff --git a/src/Files/Folder/Type.php b/src/Files/Folder/Type.php new file mode 100644 index 00000000..42c52ca4 --- /dev/null +++ b/src/Files/Folder/Type.php @@ -0,0 +1,18 @@ + */ + use SdkModel; + + /** + * The audio codec used in the video (only for video). + */ + #[Api(optional: true)] + public ?string $audioCodec; + + /** + * The bit rate of the video in kbps (only for video). + */ + #[Api(optional: true)] + public ?int $bitRate; + + /** + * The density of the image in DPI. + */ + #[Api(optional: true)] + public ?int $density; + + /** + * The duration of the video in seconds (only for video). + */ + #[Api(optional: true)] + public ?int $duration; + + #[Api(optional: true)] + public ?Exif $exif; + + /** + * The format of the file (e.g., 'jpg', 'mp4'). + */ + #[Api(optional: true)] + public ?string $format; + + /** + * Indicates if the image has a color profile. + */ + #[Api(optional: true)] + public ?bool $hasColorProfile; + + /** + * Indicates if the image contains transparent areas. + */ + #[Api(optional: true)] + public ?bool $hasTransparency; + + /** + * The height of the image or video in pixels. + */ + #[Api(optional: true)] + public ?int $height; + + /** + * Perceptual hash of the image. + */ + #[Api(optional: true)] + public ?string $pHash; + + /** + * The quality indicator of the image. + */ + #[Api(optional: true)] + public ?int $quality; + + /** + * The file size in bytes. + */ + #[Api(optional: true)] + public ?int $size; + + /** + * The video codec used in the video (only for video). + */ + #[Api(optional: true)] + public ?string $videoCodec; + + /** + * The width of the image or video in pixels. + */ + #[Api(optional: true)] + public ?int $width; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + ?string $audioCodec = null, + ?int $bitRate = null, + ?int $density = null, + ?int $duration = null, + ?Exif $exif = null, + ?string $format = null, + ?bool $hasColorProfile = null, + ?bool $hasTransparency = null, + ?int $height = null, + ?string $pHash = null, + ?int $quality = null, + ?int $size = null, + ?string $videoCodec = null, + ?int $width = null, + ): self { + $obj = new self; + + null !== $audioCodec && $obj->audioCodec = $audioCodec; + null !== $bitRate && $obj->bitRate = $bitRate; + null !== $density && $obj->density = $density; + null !== $duration && $obj->duration = $duration; + null !== $exif && $obj->exif = $exif; + null !== $format && $obj->format = $format; + null !== $hasColorProfile && $obj->hasColorProfile = $hasColorProfile; + null !== $hasTransparency && $obj->hasTransparency = $hasTransparency; + null !== $height && $obj->height = $height; + null !== $pHash && $obj->pHash = $pHash; + null !== $quality && $obj->quality = $quality; + null !== $size && $obj->size = $size; + null !== $videoCodec && $obj->videoCodec = $videoCodec; + null !== $width && $obj->width = $width; + + return $obj; + } + + /** + * The audio codec used in the video (only for video). + */ + public function withAudioCodec(string $audioCodec): self + { + $obj = clone $this; + $obj->audioCodec = $audioCodec; + + return $obj; + } + + /** + * The bit rate of the video in kbps (only for video). + */ + public function withBitRate(int $bitRate): self + { + $obj = clone $this; + $obj->bitRate = $bitRate; + + return $obj; + } + + /** + * The density of the image in DPI. + */ + public function withDensity(int $density): self + { + $obj = clone $this; + $obj->density = $density; + + return $obj; + } + + /** + * The duration of the video in seconds (only for video). + */ + public function withDuration(int $duration): self + { + $obj = clone $this; + $obj->duration = $duration; + + return $obj; + } + + public function withExif(Exif $exif): self + { + $obj = clone $this; + $obj->exif = $exif; + + return $obj; + } + + /** + * The format of the file (e.g., 'jpg', 'mp4'). + */ + public function withFormat(string $format): self + { + $obj = clone $this; + $obj->format = $format; + + return $obj; + } + + /** + * Indicates if the image has a color profile. + */ + public function withHasColorProfile(bool $hasColorProfile): self + { + $obj = clone $this; + $obj->hasColorProfile = $hasColorProfile; + + return $obj; + } + + /** + * Indicates if the image contains transparent areas. + */ + public function withHasTransparency(bool $hasTransparency): self + { + $obj = clone $this; + $obj->hasTransparency = $hasTransparency; + + return $obj; + } + + /** + * The height of the image or video in pixels. + */ + public function withHeight(int $height): self + { + $obj = clone $this; + $obj->height = $height; + + return $obj; + } + + /** + * Perceptual hash of the image. + */ + public function withPHash(string $pHash): self + { + $obj = clone $this; + $obj->pHash = $pHash; + + return $obj; + } + + /** + * The quality indicator of the image. + */ + public function withQuality(int $quality): self + { + $obj = clone $this; + $obj->quality = $quality; + + return $obj; + } + + /** + * The file size in bytes. + */ + public function withSize(int $size): self + { + $obj = clone $this; + $obj->size = $size; + + return $obj; + } + + /** + * The video codec used in the video (only for video). + */ + public function withVideoCodec(string $videoCodec): self + { + $obj = clone $this; + $obj->videoCodec = $videoCodec; + + return $obj; + } + + /** + * The width of the image or video in pixels. + */ + public function withWidth(int $width): self + { + $obj = clone $this; + $obj->width = $width; + + return $obj; + } +} diff --git a/src/Files/Metadata/Exif.php b/src/Files/Metadata/Exif.php new file mode 100644 index 00000000..a1815e9d --- /dev/null +++ b/src/Files/Metadata/Exif.php @@ -0,0 +1,163 @@ +|null, + * thumbnail?: Thumbnail|null, + * } + */ +final class Exif implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Object containing Exif details. + */ + #[Api(optional: true)] + public ?Exif1 $exif; + + /** + * Object containing GPS information. + */ + #[Api(optional: true)] + public ?Gps $gps; + + /** + * Object containing EXIF image information. + */ + #[Api(optional: true)] + public ?Image $image; + + /** + * JSON object. + */ + #[Api(optional: true)] + public ?Interoperability $interoperability; + + /** @var array|null $makernote */ + #[Api(map: 'mixed', optional: true)] + public ?array $makernote; + + /** + * Object containing Thumbnail information. + */ + #[Api(optional: true)] + public ?Thumbnail $thumbnail; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param array $makernote + */ + public static function with( + ?Exif1 $exif = null, + ?Gps $gps = null, + ?Image $image = null, + ?Interoperability $interoperability = null, + ?array $makernote = null, + ?Thumbnail $thumbnail = null, + ): self { + $obj = new self; + + null !== $exif && $obj->exif = $exif; + null !== $gps && $obj->gps = $gps; + null !== $image && $obj->image = $image; + null !== $interoperability && $obj->interoperability = $interoperability; + null !== $makernote && $obj->makernote = $makernote; + null !== $thumbnail && $obj->thumbnail = $thumbnail; + + return $obj; + } + + /** + * Object containing Exif details. + */ + public function withExif(Exif1 $exif): self + { + $obj = clone $this; + $obj->exif = $exif; + + return $obj; + } + + /** + * Object containing GPS information. + */ + public function withGps(Gps $gps): self + { + $obj = clone $this; + $obj->gps = $gps; + + return $obj; + } + + /** + * Object containing EXIF image information. + */ + public function withImage(Image $image): self + { + $obj = clone $this; + $obj->image = $image; + + return $obj; + } + + /** + * JSON object. + */ + public function withInteroperability( + Interoperability $interoperability + ): self { + $obj = clone $this; + $obj->interoperability = $interoperability; + + return $obj; + } + + /** + * @param array $makernote + */ + public function withMakernote(array $makernote): self + { + $obj = clone $this; + $obj->makernote = $makernote; + + return $obj; + } + + /** + * Object containing Thumbnail information. + */ + public function withThumbnail(Thumbnail $thumbnail): self + { + $obj = clone $this; + $obj->thumbnail = $thumbnail; + + return $obj; + } +} diff --git a/src/Files/Metadata/Exif/Exif.php b/src/Files/Metadata/Exif/Exif.php new file mode 100644 index 00000000..1bd947ab --- /dev/null +++ b/src/Files/Metadata/Exif/Exif.php @@ -0,0 +1,406 @@ + */ + use SdkModel; + + #[Api('ApertureValue', optional: true)] + public ?float $apertureValue; + + #[Api('ColorSpace', optional: true)] + public ?int $colorSpace; + + #[Api('CreateDate', optional: true)] + public ?string $createDate; + + #[Api('CustomRendered', optional: true)] + public ?int $customRendered; + + #[Api('DateTimeOriginal', optional: true)] + public ?string $dateTimeOriginal; + + #[Api('ExifImageHeight', optional: true)] + public ?int $exifImageHeight; + + #[Api('ExifImageWidth', optional: true)] + public ?int $exifImageWidth; + + #[Api('ExifVersion', optional: true)] + public ?string $exifVersion; + + #[Api('ExposureCompensation', optional: true)] + public ?float $exposureCompensation; + + #[Api('ExposureMode', optional: true)] + public ?int $exposureMode; + + #[Api('ExposureProgram', optional: true)] + public ?int $exposureProgram; + + #[Api('ExposureTime', optional: true)] + public ?float $exposureTime; + + #[Api('Flash', optional: true)] + public ?int $flash; + + #[Api('FlashpixVersion', optional: true)] + public ?string $flashpixVersion; + + #[Api('FNumber', optional: true)] + public ?float $fNumber; + + #[Api('FocalLength', optional: true)] + public ?int $focalLength; + + #[Api('FocalPlaneResolutionUnit', optional: true)] + public ?int $focalPlaneResolutionUnit; + + #[Api('FocalPlaneXResolution', optional: true)] + public ?float $focalPlaneXResolution; + + #[Api('FocalPlaneYResolution', optional: true)] + public ?float $focalPlaneYResolution; + + #[Api('InteropOffset', optional: true)] + public ?int $interopOffset; + + #[Api('ISO', optional: true)] + public ?int $iso; + + #[Api('MeteringMode', optional: true)] + public ?int $meteringMode; + + #[Api('SceneCaptureType', optional: true)] + public ?int $sceneCaptureType; + + #[Api('ShutterSpeedValue', optional: true)] + public ?float $shutterSpeedValue; + + #[Api('SubSecTime', optional: true)] + public ?string $subSecTime; + + #[Api('WhiteBalance', optional: true)] + public ?int $whiteBalance; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + ?float $apertureValue = null, + ?int $colorSpace = null, + ?string $createDate = null, + ?int $customRendered = null, + ?string $dateTimeOriginal = null, + ?int $exifImageHeight = null, + ?int $exifImageWidth = null, + ?string $exifVersion = null, + ?float $exposureCompensation = null, + ?int $exposureMode = null, + ?int $exposureProgram = null, + ?float $exposureTime = null, + ?int $flash = null, + ?string $flashpixVersion = null, + ?float $fNumber = null, + ?int $focalLength = null, + ?int $focalPlaneResolutionUnit = null, + ?float $focalPlaneXResolution = null, + ?float $focalPlaneYResolution = null, + ?int $interopOffset = null, + ?int $iso = null, + ?int $meteringMode = null, + ?int $sceneCaptureType = null, + ?float $shutterSpeedValue = null, + ?string $subSecTime = null, + ?int $whiteBalance = null, + ): self { + $obj = new self; + + null !== $apertureValue && $obj->apertureValue = $apertureValue; + null !== $colorSpace && $obj->colorSpace = $colorSpace; + null !== $createDate && $obj->createDate = $createDate; + null !== $customRendered && $obj->customRendered = $customRendered; + null !== $dateTimeOriginal && $obj->dateTimeOriginal = $dateTimeOriginal; + null !== $exifImageHeight && $obj->exifImageHeight = $exifImageHeight; + null !== $exifImageWidth && $obj->exifImageWidth = $exifImageWidth; + null !== $exifVersion && $obj->exifVersion = $exifVersion; + null !== $exposureCompensation && $obj->exposureCompensation = $exposureCompensation; + null !== $exposureMode && $obj->exposureMode = $exposureMode; + null !== $exposureProgram && $obj->exposureProgram = $exposureProgram; + null !== $exposureTime && $obj->exposureTime = $exposureTime; + null !== $flash && $obj->flash = $flash; + null !== $flashpixVersion && $obj->flashpixVersion = $flashpixVersion; + null !== $fNumber && $obj->fNumber = $fNumber; + null !== $focalLength && $obj->focalLength = $focalLength; + null !== $focalPlaneResolutionUnit && $obj->focalPlaneResolutionUnit = $focalPlaneResolutionUnit; + null !== $focalPlaneXResolution && $obj->focalPlaneXResolution = $focalPlaneXResolution; + null !== $focalPlaneYResolution && $obj->focalPlaneYResolution = $focalPlaneYResolution; + null !== $interopOffset && $obj->interopOffset = $interopOffset; + null !== $iso && $obj->iso = $iso; + null !== $meteringMode && $obj->meteringMode = $meteringMode; + null !== $sceneCaptureType && $obj->sceneCaptureType = $sceneCaptureType; + null !== $shutterSpeedValue && $obj->shutterSpeedValue = $shutterSpeedValue; + null !== $subSecTime && $obj->subSecTime = $subSecTime; + null !== $whiteBalance && $obj->whiteBalance = $whiteBalance; + + return $obj; + } + + public function withApertureValue(float $apertureValue): self + { + $obj = clone $this; + $obj->apertureValue = $apertureValue; + + return $obj; + } + + public function withColorSpace(int $colorSpace): self + { + $obj = clone $this; + $obj->colorSpace = $colorSpace; + + return $obj; + } + + public function withCreateDate(string $createDate): self + { + $obj = clone $this; + $obj->createDate = $createDate; + + return $obj; + } + + public function withCustomRendered(int $customRendered): self + { + $obj = clone $this; + $obj->customRendered = $customRendered; + + return $obj; + } + + public function withDateTimeOriginal(string $dateTimeOriginal): self + { + $obj = clone $this; + $obj->dateTimeOriginal = $dateTimeOriginal; + + return $obj; + } + + public function withExifImageHeight(int $exifImageHeight): self + { + $obj = clone $this; + $obj->exifImageHeight = $exifImageHeight; + + return $obj; + } + + public function withExifImageWidth(int $exifImageWidth): self + { + $obj = clone $this; + $obj->exifImageWidth = $exifImageWidth; + + return $obj; + } + + public function withExifVersion(string $exifVersion): self + { + $obj = clone $this; + $obj->exifVersion = $exifVersion; + + return $obj; + } + + public function withExposureCompensation(float $exposureCompensation): self + { + $obj = clone $this; + $obj->exposureCompensation = $exposureCompensation; + + return $obj; + } + + public function withExposureMode(int $exposureMode): self + { + $obj = clone $this; + $obj->exposureMode = $exposureMode; + + return $obj; + } + + public function withExposureProgram(int $exposureProgram): self + { + $obj = clone $this; + $obj->exposureProgram = $exposureProgram; + + return $obj; + } + + public function withExposureTime(float $exposureTime): self + { + $obj = clone $this; + $obj->exposureTime = $exposureTime; + + return $obj; + } + + public function withFlash(int $flash): self + { + $obj = clone $this; + $obj->flash = $flash; + + return $obj; + } + + public function withFlashpixVersion(string $flashpixVersion): self + { + $obj = clone $this; + $obj->flashpixVersion = $flashpixVersion; + + return $obj; + } + + public function withFNumber(float $fNumber): self + { + $obj = clone $this; + $obj->fNumber = $fNumber; + + return $obj; + } + + public function withFocalLength(int $focalLength): self + { + $obj = clone $this; + $obj->focalLength = $focalLength; + + return $obj; + } + + public function withFocalPlaneResolutionUnit( + int $focalPlaneResolutionUnit + ): self { + $obj = clone $this; + $obj->focalPlaneResolutionUnit = $focalPlaneResolutionUnit; + + return $obj; + } + + public function withFocalPlaneXResolution( + float $focalPlaneXResolution + ): self { + $obj = clone $this; + $obj->focalPlaneXResolution = $focalPlaneXResolution; + + return $obj; + } + + public function withFocalPlaneYResolution( + float $focalPlaneYResolution + ): self { + $obj = clone $this; + $obj->focalPlaneYResolution = $focalPlaneYResolution; + + return $obj; + } + + public function withInteropOffset(int $interopOffset): self + { + $obj = clone $this; + $obj->interopOffset = $interopOffset; + + return $obj; + } + + public function withISO(int $iso): self + { + $obj = clone $this; + $obj->iso = $iso; + + return $obj; + } + + public function withMeteringMode(int $meteringMode): self + { + $obj = clone $this; + $obj->meteringMode = $meteringMode; + + return $obj; + } + + public function withSceneCaptureType(int $sceneCaptureType): self + { + $obj = clone $this; + $obj->sceneCaptureType = $sceneCaptureType; + + return $obj; + } + + public function withShutterSpeedValue(float $shutterSpeedValue): self + { + $obj = clone $this; + $obj->shutterSpeedValue = $shutterSpeedValue; + + return $obj; + } + + public function withSubSecTime(string $subSecTime): self + { + $obj = clone $this; + $obj->subSecTime = $subSecTime; + + return $obj; + } + + public function withWhiteBalance(int $whiteBalance): self + { + $obj = clone $this; + $obj->whiteBalance = $whiteBalance; + + return $obj; + } +} diff --git a/src/Files/Metadata/Exif/Gps.php b/src/Files/Metadata/Exif/Gps.php new file mode 100644 index 00000000..9f4d027f --- /dev/null +++ b/src/Files/Metadata/Exif/Gps.php @@ -0,0 +1,56 @@ +|null} + */ +final class Gps implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** @var list|null $gpsVersionID */ + #[Api('GPSVersionID', list: 'int', optional: true)] + public ?array $gpsVersionID; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $gpsVersionID + */ + public static function with(?array $gpsVersionID = null): self + { + $obj = new self; + + null !== $gpsVersionID && $obj->gpsVersionID = $gpsVersionID; + + return $obj; + } + + /** + * @param list $gpsVersionID + */ + public function withGpsVersionID(array $gpsVersionID): self + { + $obj = clone $this; + $obj->gpsVersionID = $gpsVersionID; + + return $obj; + } +} diff --git a/src/Files/Metadata/Exif/Image.php b/src/Files/Metadata/Exif/Image.php new file mode 100644 index 00000000..2d66f0d4 --- /dev/null +++ b/src/Files/Metadata/Exif/Image.php @@ -0,0 +1,193 @@ + */ + use SdkModel; + + #[Api('ExifOffset', optional: true)] + public ?int $exifOffset; + + #[Api('GPSInfo', optional: true)] + public ?int $gpsInfo; + + #[Api('Make', optional: true)] + public ?string $make; + + #[Api('Model', optional: true)] + public ?string $model; + + #[Api('ModifyDate', optional: true)] + public ?string $modifyDate; + + #[Api('Orientation', optional: true)] + public ?int $orientation; + + #[Api('ResolutionUnit', optional: true)] + public ?int $resolutionUnit; + + #[Api('Software', optional: true)] + public ?string $software; + + #[Api('XResolution', optional: true)] + public ?int $xResolution; + + #[Api('YCbCrPositioning', optional: true)] + public ?int $yCbCrPositioning; + + #[Api('YResolution', optional: true)] + public ?int $yResolution; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + ?int $exifOffset = null, + ?int $gpsInfo = null, + ?string $make = null, + ?string $model = null, + ?string $modifyDate = null, + ?int $orientation = null, + ?int $resolutionUnit = null, + ?string $software = null, + ?int $xResolution = null, + ?int $yCbCrPositioning = null, + ?int $yResolution = null, + ): self { + $obj = new self; + + null !== $exifOffset && $obj->exifOffset = $exifOffset; + null !== $gpsInfo && $obj->gpsInfo = $gpsInfo; + null !== $make && $obj->make = $make; + null !== $model && $obj->model = $model; + null !== $modifyDate && $obj->modifyDate = $modifyDate; + null !== $orientation && $obj->orientation = $orientation; + null !== $resolutionUnit && $obj->resolutionUnit = $resolutionUnit; + null !== $software && $obj->software = $software; + null !== $xResolution && $obj->xResolution = $xResolution; + null !== $yCbCrPositioning && $obj->yCbCrPositioning = $yCbCrPositioning; + null !== $yResolution && $obj->yResolution = $yResolution; + + return $obj; + } + + public function withExifOffset(int $exifOffset): self + { + $obj = clone $this; + $obj->exifOffset = $exifOffset; + + return $obj; + } + + public function withGpsInfo(int $gpsInfo): self + { + $obj = clone $this; + $obj->gpsInfo = $gpsInfo; + + return $obj; + } + + public function withMake(string $make): self + { + $obj = clone $this; + $obj->make = $make; + + return $obj; + } + + public function withModel(string $model): self + { + $obj = clone $this; + $obj->model = $model; + + return $obj; + } + + public function withModifyDate(string $modifyDate): self + { + $obj = clone $this; + $obj->modifyDate = $modifyDate; + + return $obj; + } + + public function withOrientation(int $orientation): self + { + $obj = clone $this; + $obj->orientation = $orientation; + + return $obj; + } + + public function withResolutionUnit(int $resolutionUnit): self + { + $obj = clone $this; + $obj->resolutionUnit = $resolutionUnit; + + return $obj; + } + + public function withSoftware(string $software): self + { + $obj = clone $this; + $obj->software = $software; + + return $obj; + } + + public function withXResolution(int $xResolution): self + { + $obj = clone $this; + $obj->xResolution = $xResolution; + + return $obj; + } + + public function withYCbCrPositioning(int $yCbCrPositioning): self + { + $obj = clone $this; + $obj->yCbCrPositioning = $yCbCrPositioning; + + return $obj; + } + + public function withYResolution(int $yResolution): self + { + $obj = clone $this; + $obj->yResolution = $yResolution; + + return $obj; + } +} diff --git a/src/Files/Metadata/Exif/Interoperability.php b/src/Files/Metadata/Exif/Interoperability.php new file mode 100644 index 00000000..80632026 --- /dev/null +++ b/src/Files/Metadata/Exif/Interoperability.php @@ -0,0 +1,66 @@ + */ + use SdkModel; + + #[Api('InteropIndex', optional: true)] + public ?string $interopIndex; + + #[Api('InteropVersion', optional: true)] + public ?string $interopVersion; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + ?string $interopIndex = null, + ?string $interopVersion = null + ): self { + $obj = new self; + + null !== $interopIndex && $obj->interopIndex = $interopIndex; + null !== $interopVersion && $obj->interopVersion = $interopVersion; + + return $obj; + } + + public function withInteropIndex(string $interopIndex): self + { + $obj = clone $this; + $obj->interopIndex = $interopIndex; + + return $obj; + } + + public function withInteropVersion(string $interopVersion): self + { + $obj = clone $this; + $obj->interopVersion = $interopVersion; + + return $obj; + } +} diff --git a/src/Files/Metadata/Exif/Thumbnail.php b/src/Files/Metadata/Exif/Thumbnail.php new file mode 100644 index 00000000..b1dd809c --- /dev/null +++ b/src/Files/Metadata/Exif/Thumbnail.php @@ -0,0 +1,123 @@ + */ + use SdkModel; + + #[Api('Compression', optional: true)] + public ?int $compression; + + #[Api('ResolutionUnit', optional: true)] + public ?int $resolutionUnit; + + #[Api('ThumbnailLength', optional: true)] + public ?int $thumbnailLength; + + #[Api('ThumbnailOffset', optional: true)] + public ?int $thumbnailOffset; + + #[Api('XResolution', optional: true)] + public ?int $xResolution; + + #[Api('YResolution', optional: true)] + public ?int $yResolution; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + ?int $compression = null, + ?int $resolutionUnit = null, + ?int $thumbnailLength = null, + ?int $thumbnailOffset = null, + ?int $xResolution = null, + ?int $yResolution = null, + ): self { + $obj = new self; + + null !== $compression && $obj->compression = $compression; + null !== $resolutionUnit && $obj->resolutionUnit = $resolutionUnit; + null !== $thumbnailLength && $obj->thumbnailLength = $thumbnailLength; + null !== $thumbnailOffset && $obj->thumbnailOffset = $thumbnailOffset; + null !== $xResolution && $obj->xResolution = $xResolution; + null !== $yResolution && $obj->yResolution = $yResolution; + + return $obj; + } + + public function withCompression(int $compression): self + { + $obj = clone $this; + $obj->compression = $compression; + + return $obj; + } + + public function withResolutionUnit(int $resolutionUnit): self + { + $obj = clone $this; + $obj->resolutionUnit = $resolutionUnit; + + return $obj; + } + + public function withThumbnailLength(int $thumbnailLength): self + { + $obj = clone $this; + $obj->thumbnailLength = $thumbnailLength; + + return $obj; + } + + public function withThumbnailOffset(int $thumbnailOffset): self + { + $obj = clone $this; + $obj->thumbnailOffset = $thumbnailOffset; + + return $obj; + } + + public function withXResolution(int $xResolution): self + { + $obj = clone $this; + $obj->xResolution = $xResolution; + + return $obj; + } + + public function withYResolution(int $yResolution): self + { + $obj = clone $this; + $obj->yResolution = $yResolution; + + return $obj; + } +} diff --git a/src/Files/Metadata/MetadataGetFromURLParams.php b/src/Files/Metadata/MetadataGetFromURLParams.php new file mode 100644 index 00000000..d56164d9 --- /dev/null +++ b/src/Files/Metadata/MetadataGetFromURLParams.php @@ -0,0 +1,74 @@ +getFromURL + * + * @phpstan-type metadata_get_from_url_params = array{url: string} + */ +final class MetadataGetFromURLParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * Should be a valid file URL. It should be accessible using your ImageKit.io account. + */ + #[Api] + public string $url; + + /** + * `new MetadataGetFromURLParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * MetadataGetFromURLParams::with(url: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new MetadataGetFromURLParams)->withURL(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $url): self + { + $obj = new self; + + $obj->url = $url; + + return $obj; + } + + /** + * Should be a valid file URL. It should be accessible using your ImageKit.io account. + */ + public function withURL(string $url): self + { + $obj = clone $this; + $obj->url = $url; + + return $obj; + } +} diff --git a/src/Files/Versions/VersionDeleteParams.php b/src/Files/Versions/VersionDeleteParams.php new file mode 100644 index 00000000..a5c99a18 --- /dev/null +++ b/src/Files/Versions/VersionDeleteParams.php @@ -0,0 +1,70 @@ +delete + * + * @phpstan-type version_delete_params = array{fileID: string} + */ +final class VersionDeleteParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + #[Api] + public string $fileID; + + /** + * `new VersionDeleteParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * VersionDeleteParams::with(fileID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new VersionDeleteParams)->withFileID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $fileID): self + { + $obj = new self; + + $obj->fileID = $fileID; + + return $obj; + } + + public function withFileID(string $fileID): self + { + $obj = clone $this; + $obj->fileID = $fileID; + + return $obj; + } +} diff --git a/src/Files/Versions/VersionDeleteResponse.php b/src/Files/Versions/VersionDeleteResponse.php new file mode 100644 index 00000000..39c07a2d --- /dev/null +++ b/src/Files/Versions/VersionDeleteResponse.php @@ -0,0 +1,32 @@ + */ + use SdkModel; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(): self + { + return new self; + } +} diff --git a/src/Files/Versions/VersionGetParams.php b/src/Files/Versions/VersionGetParams.php new file mode 100644 index 00000000..e6d9ac37 --- /dev/null +++ b/src/Files/Versions/VersionGetParams.php @@ -0,0 +1,68 @@ +get + * + * @phpstan-type version_get_params = array{fileID: string} + */ +final class VersionGetParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + #[Api] + public string $fileID; + + /** + * `new VersionGetParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * VersionGetParams::with(fileID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new VersionGetParams)->withFileID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $fileID): self + { + $obj = new self; + + $obj->fileID = $fileID; + + return $obj; + } + + public function withFileID(string $fileID): self + { + $obj = clone $this; + $obj->fileID = $fileID; + + return $obj; + } +} diff --git a/src/Files/Versions/VersionRestoreParams.php b/src/Files/Versions/VersionRestoreParams.php new file mode 100644 index 00000000..e1deb729 --- /dev/null +++ b/src/Files/Versions/VersionRestoreParams.php @@ -0,0 +1,68 @@ +restore + * + * @phpstan-type version_restore_params = array{fileID: string} + */ +final class VersionRestoreParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + #[Api] + public string $fileID; + + /** + * `new VersionRestoreParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * VersionRestoreParams::with(fileID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new VersionRestoreParams)->withFileID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $fileID): self + { + $obj = new self; + + $obj->fileID = $fileID; + + return $obj; + } + + public function withFileID(string $fileID): self + { + $obj = clone $this; + $obj->fileID = $fileID; + + return $obj; + } +} diff --git a/src/Folders/FolderCopyParams.php b/src/Folders/FolderCopyParams.php new file mode 100644 index 00000000..c70ebbac --- /dev/null +++ b/src/Folders/FolderCopyParams.php @@ -0,0 +1,116 @@ +copy + * + * @phpstan-type folder_copy_params = array{ + * destinationPath: string, sourceFolderPath: string, includeVersions?: bool + * } + */ +final class FolderCopyParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * Full path to the destination folder where you want to copy the source folder into. + */ + #[Api] + public string $destinationPath; + + /** + * The full path to the source folder you want to copy. + */ + #[Api] + public string $sourceFolderPath; + + /** + * Option to copy all versions of files that are nested inside the selected folder. By default, only the current version of each file will be copied. When set to true, all versions of each file will be copied. Default value - `false`. + */ + #[Api(optional: true)] + public ?bool $includeVersions; + + /** + * `new FolderCopyParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * FolderCopyParams::with(destinationPath: ..., sourceFolderPath: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new FolderCopyParams)->withDestinationPath(...)->withSourceFolderPath(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $destinationPath, + string $sourceFolderPath, + ?bool $includeVersions = null, + ): self { + $obj = new self; + + $obj->destinationPath = $destinationPath; + $obj->sourceFolderPath = $sourceFolderPath; + + null !== $includeVersions && $obj->includeVersions = $includeVersions; + + return $obj; + } + + /** + * Full path to the destination folder where you want to copy the source folder into. + */ + public function withDestinationPath(string $destinationPath): self + { + $obj = clone $this; + $obj->destinationPath = $destinationPath; + + return $obj; + } + + /** + * The full path to the source folder you want to copy. + */ + public function withSourceFolderPath(string $sourceFolderPath): self + { + $obj = clone $this; + $obj->sourceFolderPath = $sourceFolderPath; + + return $obj; + } + + /** + * Option to copy all versions of files that are nested inside the selected folder. By default, only the current version of each file will be copied. When set to true, all versions of each file will be copied. Default value - `false`. + */ + public function withIncludeVersions(bool $includeVersions): self + { + $obj = clone $this; + $obj->includeVersions = $includeVersions; + + return $obj; + } +} diff --git a/src/Folders/FolderCopyResponse.php b/src/Folders/FolderCopyResponse.php new file mode 100644 index 00000000..81c8daa4 --- /dev/null +++ b/src/Folders/FolderCopyResponse.php @@ -0,0 +1,70 @@ + */ + use SdkModel; + + /** + * Unique identifier of the bulk job. This can be used to check the status of the bulk job. + */ + #[Api('jobId')] + public string $jobID; + + /** + * `new FolderCopyResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * FolderCopyResponse::with(jobID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new FolderCopyResponse)->withJobID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $jobID): self + { + $obj = new self; + + $obj->jobID = $jobID; + + return $obj; + } + + /** + * Unique identifier of the bulk job. This can be used to check the status of the bulk job. + */ + public function withJobID(string $jobID): self + { + $obj = clone $this; + $obj->jobID = $jobID; + + return $obj; + } +} diff --git a/src/Folders/FolderCreateParams.php b/src/Folders/FolderCreateParams.php new file mode 100644 index 00000000..7698adae --- /dev/null +++ b/src/Folders/FolderCreateParams.php @@ -0,0 +1,104 @@ +create + * + * @phpstan-type folder_create_params = array{ + * folderName: string, parentFolderPath: string + * } + */ +final class FolderCreateParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * The folder will be created with this name. + * + * All characters except alphabets and numbers (inclusive of unicode letters, marks, and numerals in other languages) will be replaced by an underscore i.e. `_`. + */ + #[Api] + public string $folderName; + + /** + * The folder where the new folder should be created, for root use `/` else the path e.g. `containing/folder/`. + * + * Note: If any folder(s) is not present in the parentFolderPath parameter, it will be automatically created. For example, if you pass `/product/images/summer`, then `product`, `images`, and `summer` folders will be created if they don't already exist. + */ + #[Api] + public string $parentFolderPath; + + /** + * `new FolderCreateParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * FolderCreateParams::with(folderName: ..., parentFolderPath: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new FolderCreateParams)->withFolderName(...)->withParentFolderPath(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $folderName, + string $parentFolderPath + ): self { + $obj = new self; + + $obj->folderName = $folderName; + $obj->parentFolderPath = $parentFolderPath; + + return $obj; + } + + /** + * The folder will be created with this name. + * + * All characters except alphabets and numbers (inclusive of unicode letters, marks, and numerals in other languages) will be replaced by an underscore i.e. `_`. + */ + public function withFolderName(string $folderName): self + { + $obj = clone $this; + $obj->folderName = $folderName; + + return $obj; + } + + /** + * The folder where the new folder should be created, for root use `/` else the path e.g. `containing/folder/`. + * + * Note: If any folder(s) is not present in the parentFolderPath parameter, it will be automatically created. For example, if you pass `/product/images/summer`, then `product`, `images`, and `summer` folders will be created if they don't already exist. + */ + public function withParentFolderPath(string $parentFolderPath): self + { + $obj = clone $this; + $obj->parentFolderPath = $parentFolderPath; + + return $obj; + } +} diff --git a/src/Folders/FolderDeleteParams.php b/src/Folders/FolderDeleteParams.php new file mode 100644 index 00000000..0af429b0 --- /dev/null +++ b/src/Folders/FolderDeleteParams.php @@ -0,0 +1,74 @@ +delete + * + * @phpstan-type folder_delete_params = array{folderPath: string} + */ +final class FolderDeleteParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * Full path to the folder you want to delete. For example `/folder/to/delete/`. + */ + #[Api] + public string $folderPath; + + /** + * `new FolderDeleteParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * FolderDeleteParams::with(folderPath: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new FolderDeleteParams)->withFolderPath(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $folderPath): self + { + $obj = new self; + + $obj->folderPath = $folderPath; + + return $obj; + } + + /** + * Full path to the folder you want to delete. For example `/folder/to/delete/`. + */ + public function withFolderPath(string $folderPath): self + { + $obj = clone $this; + $obj->folderPath = $folderPath; + + return $obj; + } +} diff --git a/src/Folders/FolderDeleteResponse.php b/src/Folders/FolderDeleteResponse.php new file mode 100644 index 00000000..c7a62789 --- /dev/null +++ b/src/Folders/FolderDeleteResponse.php @@ -0,0 +1,32 @@ + */ + use SdkModel; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(): self + { + return new self; + } +} diff --git a/src/Folders/FolderMoveParams.php b/src/Folders/FolderMoveParams.php new file mode 100644 index 00000000..f04be7df --- /dev/null +++ b/src/Folders/FolderMoveParams.php @@ -0,0 +1,96 @@ +move + * + * @phpstan-type folder_move_params = array{ + * destinationPath: string, sourceFolderPath: string + * } + */ +final class FolderMoveParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * Full path to the destination folder where you want to move the source folder into. + */ + #[Api] + public string $destinationPath; + + /** + * The full path to the source folder you want to move. + */ + #[Api] + public string $sourceFolderPath; + + /** + * `new FolderMoveParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * FolderMoveParams::with(destinationPath: ..., sourceFolderPath: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new FolderMoveParams)->withDestinationPath(...)->withSourceFolderPath(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $destinationPath, + string $sourceFolderPath + ): self { + $obj = new self; + + $obj->destinationPath = $destinationPath; + $obj->sourceFolderPath = $sourceFolderPath; + + return $obj; + } + + /** + * Full path to the destination folder where you want to move the source folder into. + */ + public function withDestinationPath(string $destinationPath): self + { + $obj = clone $this; + $obj->destinationPath = $destinationPath; + + return $obj; + } + + /** + * The full path to the source folder you want to move. + */ + public function withSourceFolderPath(string $sourceFolderPath): self + { + $obj = clone $this; + $obj->sourceFolderPath = $sourceFolderPath; + + return $obj; + } +} diff --git a/src/Folders/FolderMoveResponse.php b/src/Folders/FolderMoveResponse.php new file mode 100644 index 00000000..5d767f7b --- /dev/null +++ b/src/Folders/FolderMoveResponse.php @@ -0,0 +1,70 @@ + */ + use SdkModel; + + /** + * Unique identifier of the bulk job. This can be used to check the status of the bulk job. + */ + #[Api('jobId')] + public string $jobID; + + /** + * `new FolderMoveResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * FolderMoveResponse::with(jobID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new FolderMoveResponse)->withJobID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $jobID): self + { + $obj = new self; + + $obj->jobID = $jobID; + + return $obj; + } + + /** + * Unique identifier of the bulk job. This can be used to check the status of the bulk job. + */ + public function withJobID(string $jobID): self + { + $obj = clone $this; + $obj->jobID = $jobID; + + return $obj; + } +} diff --git a/src/Folders/FolderNewResponse.php b/src/Folders/FolderNewResponse.php new file mode 100644 index 00000000..f8ce7b88 --- /dev/null +++ b/src/Folders/FolderNewResponse.php @@ -0,0 +1,32 @@ + */ + use SdkModel; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(): self + { + return new self; + } +} diff --git a/src/Folders/FolderRenameParams.php b/src/Folders/FolderRenameParams.php new file mode 100644 index 00000000..e7260993 --- /dev/null +++ b/src/Folders/FolderRenameParams.php @@ -0,0 +1,132 @@ +rename + * + * @phpstan-type folder_rename_params = array{ + * folderPath: string, newFolderName: string, purgeCache?: bool + * } + */ +final class FolderRenameParams implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + use SdkParams; + + /** + * The full path to the folder you want to rename. + */ + #[Api] + public string $folderPath; + + /** + * The new name for the folder. + * + * All characters except alphabets and numbers (inclusive of unicode letters, marks, and numerals in other languages) and `-` will be replaced by an underscore i.e. `_`. + */ + #[Api] + public string $newFolderName; + + /** + * Option to purge cache for the old nested files and their versions' URLs. + * + * When set to true, it will internally issue a purge cache request on CDN to remove the cached content of the old nested files and their versions. There will only be one purge request for all the nested files, which will be counted against your monthly purge quota. + * + * Note: A purge cache request will be issued against `https://ik.imagekit.io/old/folder/path*` (with a wildcard at the end). This will remove all nested files, their versions' URLs, and any transformations made using query parameters on these files or their versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. + * + * Default value - `false` + */ + #[Api(optional: true)] + public ?bool $purgeCache; + + /** + * `new FolderRenameParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * FolderRenameParams::with(folderPath: ..., newFolderName: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new FolderRenameParams)->withFolderPath(...)->withNewFolderName(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $folderPath, + string $newFolderName, + ?bool $purgeCache = null + ): self { + $obj = new self; + + $obj->folderPath = $folderPath; + $obj->newFolderName = $newFolderName; + + null !== $purgeCache && $obj->purgeCache = $purgeCache; + + return $obj; + } + + /** + * The full path to the folder you want to rename. + */ + public function withFolderPath(string $folderPath): self + { + $obj = clone $this; + $obj->folderPath = $folderPath; + + return $obj; + } + + /** + * The new name for the folder. + * + * All characters except alphabets and numbers (inclusive of unicode letters, marks, and numerals in other languages) and `-` will be replaced by an underscore i.e. `_`. + */ + public function withNewFolderName(string $newFolderName): self + { + $obj = clone $this; + $obj->newFolderName = $newFolderName; + + return $obj; + } + + /** + * Option to purge cache for the old nested files and their versions' URLs. + * + * When set to true, it will internally issue a purge cache request on CDN to remove the cached content of the old nested files and their versions. There will only be one purge request for all the nested files, which will be counted against your monthly purge quota. + * + * Note: A purge cache request will be issued against `https://ik.imagekit.io/old/folder/path*` (with a wildcard at the end). This will remove all nested files, their versions' URLs, and any transformations made using query parameters on these files or their versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. + * + * Default value - `false` + */ + public function withPurgeCache(bool $purgeCache): self + { + $obj = clone $this; + $obj->purgeCache = $purgeCache; + + return $obj; + } +} diff --git a/src/Folders/FolderRenameResponse.php b/src/Folders/FolderRenameResponse.php new file mode 100644 index 00000000..15f1cacb --- /dev/null +++ b/src/Folders/FolderRenameResponse.php @@ -0,0 +1,70 @@ + */ + use SdkModel; + + /** + * Unique identifier of the bulk job. This can be used to check the status of the bulk job. + */ + #[Api('jobId')] + public string $jobID; + + /** + * `new FolderRenameResponse()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * FolderRenameResponse::with(jobID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new FolderRenameResponse)->withJobID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $jobID): self + { + $obj = new self; + + $obj->jobID = $jobID; + + return $obj; + } + + /** + * Unique identifier of the bulk job. This can be used to check the status of the bulk job. + */ + public function withJobID(string $jobID): self + { + $obj = clone $this; + $obj->jobID = $jobID; + + return $obj; + } +} diff --git a/src/Folders/Job/JobGetResponse.php b/src/Folders/Job/JobGetResponse.php new file mode 100644 index 00000000..bf0953e6 --- /dev/null +++ b/src/Folders/Job/JobGetResponse.php @@ -0,0 +1,130 @@ + */ + use SdkModel; + + /** + * Unique identifier of the bulk job. + */ + #[Api('jobId', optional: true)] + public ?string $jobID; + + /** + * Unique identifier of the purge request. This will be present only if `purgeCache` is set to `true` in the rename folder API request. + */ + #[Api('purgeRequestId', optional: true)] + public ?string $purgeRequestID; + + /** + * Status of the bulk job. + * + * @var Status::*|null $status + */ + #[Api(enum: Status::class, optional: true)] + public ?string $status; + + /** + * Type of the bulk job. + * + * @var Type::*|null $type + */ + #[Api(enum: Type::class, optional: true)] + public ?string $type; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Status::* $status + * @param Type::* $type + */ + public static function with( + ?string $jobID = null, + ?string $purgeRequestID = null, + ?string $status = null, + ?string $type = null, + ): self { + $obj = new self; + + null !== $jobID && $obj->jobID = $jobID; + null !== $purgeRequestID && $obj->purgeRequestID = $purgeRequestID; + null !== $status && $obj->status = $status; + null !== $type && $obj->type = $type; + + return $obj; + } + + /** + * Unique identifier of the bulk job. + */ + public function withJobID(string $jobID): self + { + $obj = clone $this; + $obj->jobID = $jobID; + + return $obj; + } + + /** + * Unique identifier of the purge request. This will be present only if `purgeCache` is set to `true` in the rename folder API request. + */ + public function withPurgeRequestID(string $purgeRequestID): self + { + $obj = clone $this; + $obj->purgeRequestID = $purgeRequestID; + + return $obj; + } + + /** + * Status of the bulk job. + * + * @param Status::* $status + */ + public function withStatus(string $status): self + { + $obj = clone $this; + $obj->status = $status; + + return $obj; + } + + /** + * Type of the bulk job. + * + * @param Type::* $type + */ + public function withType(string $type): self + { + $obj = clone $this; + $obj->type = $type; + + return $obj; + } +} diff --git a/src/Folders/Job/JobGetResponse/Status.php b/src/Folders/Job/JobGetResponse/Status.php new file mode 100644 index 00000000..99b4b5f7 --- /dev/null +++ b/src/Folders/Job/JobGetResponse/Status.php @@ -0,0 +1,20 @@ + 'Invalid Request', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $INVALID_UPLOAD_OPTIONS = ['message' => 'Invalid Upload Options ImageKit initialization', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $INVALID_LIST_FILES_OPTIONS = ['message' => 'Invalid List Files Options ImageKit initialization', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $MANDATORY_INITIALIZATION_MISSING = ['message' => 'Missing publicKey or privateKey or urlEndpoint during ImageKit initialization', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $INVALID_TRANSFORMATION_POSITION = ['message' => 'Invalid transformationPosition parameter', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $INVALID_FILE_OPTIONS = ['message' => 'Invalid File Options ImageKit initialization', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $LIST_FILES_OPTIONS_NON_ARRAY = ['message' => 'List File Options accepts an array of parameters, non array value passed', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $CACHE_PURGE_URL_MISSING = ['message' => 'Missing URL parameter for this request', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $CACHE_PURGE_URL_INVALID = ['message' => 'Invalid URL provided for this request', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $CACHE_PURGE_STATUS_ID_MISSING = ['message' => 'Missing Request ID parameter for this request', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $fileId_MISSING = ['message' => 'Missing File ID parameter for this request', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $versionId_MISSING = ['message' => 'Missing Version ID parameter for this request', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $JOBID_MISSING = ['message' => 'Missing Job ID parameter for this request', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $UPDATE_DATA_MISSING = ['message' => 'Missing file update data for this request', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $BULK_TAGS_DATA_MISSING = ['message' => 'Missing bulk tag update data for this request', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $BULK_TAGS_FILEIDS_MISSING = ['message' => 'Missing FileIds for Bulk Tags API', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $BULK_TAGS_FILEIDS_NON_ARRAY = ['message' => 'Bulk Tags API accepts FileIds as an array, non array passed', 'help' => 'For support kindly contact us at support@imagekit.io .' ]; - public static $BULK_TAGS_FILEIDS_EMPTY_ARRAY = ['message' => 'Bulk Tags API accepts FileIds as an array of ids, empty array passed', 'help' => - 'For support kindly contact us at support@imagekit.io .']; - public static $BULK_TAGS_TAGS_MISSING = ['message' => 'Missing Tags for Bulk Tags API', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $BULK_TAGS_TAGS_NON_ARRAY = ['message' => 'Bulk Tags API accepts Tags as an array, non array passed', 'help' => 'For support kindly contact us at support@imagekit.io .' ]; - public static $BULK_TAGS_TAGS_EMPTY_ARRAY = ['message' => 'Bulk Tags API accepts Tags as an array of tags, empty array passed', 'help' => - 'For support kindly contact us at support@imagekit.io .']; - public static $UPDATE_DATA_TAGS_INVALID = ['message' => 'Invalid tags parameter for this request', 'help' => "tags should be passed as null or an array like ['tag1', 'tag2']"]; - public static $UPDATE_DATA_COORDS_INVALID = ['message' => 'Invalid customCoordinates parameter for this request', 'help' => "customCoordinates should be passed as null or a string like 'x,y,width,height'"]; - public static $LIST_FILES_INPUT_MISSING = ['message' => 'Missing options for list files', 'help' => 'if you do not want to pass any parameter for listing, pass an empty object']; - public static $UPLOAD_FILE_PARAMETER_MISSING = ['message' => 'Upload API accepts an array of parameters, null passed', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $UPLOAD_FILE_PARAMETER_NON_ARRAY = ['message' => 'Upload API accepts an array of parameters, non array value passed', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $UPLOAD_FILE_PARAMETER_EMPTY_ARRAY = ['message' => 'Upload API accepts an array of parameters, empty array passed', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $UPLOAD_FILE_PARAMETER_OPTIONS_NON_ARRAY = ['message' => 'Upload API parameter "options" accepts an array of parameters, non array value passed', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $UPLOAD_FILE_PARAMETER_OPTIONS_USEUNIQUEFILENAME_INVALID = ['message' => 'useUniqueFileName must be boolean', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $UPLOAD_FILE_PARAMETER_OPTIONS_ISPRIVATEFILE_INVALID = ['message' => 'isPrivateFile must be boolean', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $UPLOAD_FILE_PARAMETER_OPTIONS_OVERWRITEFILE_INVALID = ['message' => 'overwriteFile must be boolean', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $UPLOAD_FILE_PARAMETER_OPTIONS_OVERWRITEAITAGS_INVALID = ['message' => 'overwriteAITags must be boolean', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $UPLOAD_FILE_PARAMETER_OPTIONS_OVERWRITETAGS_INVALID = ['message' => 'overwriteTags must be boolean', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $UPLOAD_FILE_PARAMETER_OPTIONS_OVERWRITECUSTOMMETADATA_INVALID = ['message' => 'overwriteCustomMetadata must be boolean', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $UPLOAD_FILE_PARAMETER_OPTIONS_EXTENSIONS_INVALID = ['message' => 'extensions must be an array', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $UPLOAD_FILE_PARAMETER_OPTIONS_CUSTOMMETADATA_INVALID = ['message' => 'customMetadata must be an array', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $UPLOAD_FILE_PARAMETER_OPTIONS_INVALID_TRANSFORMATION = [ "message" => "Invalid transformation parameter. Please include at least pre, post, or both.", "help" => "For support kindly contact us at support@imagekit.io ."]; - public static $UPLOAD_FILE_PARAMETER_OPTIONS_INVALID_PRE_TRANSFORMATION = [ "message" => "Invalid pre transformation parameter.", "help" => "For support kindly contact us at support@imagekit.io ."]; - public static $UPLOAD_FILE_PARAMETER_OPTIONS_INVALID_POST_TRANSFORMATION = [ "message" => "Invalid post transformation parameter.", "help" => "For support kindly contact us at support@imagekit.io ."]; - public static $UPLOAD_FILE_PARAMETER_OPTIONS_INVALID_CHECKS = [ "message" => "The value provided for the checks parameter is invalid.", "help" => "For support kindly contact us at support@imagekit.io ."]; - public static $UPLOAD_FILE_PARAMETER_OPTIONS_INVALID_PUBLISH_STATUS = [ "message" => "isPublished must be boolean.", "help" => "For support kindly contact us at support@imagekit.io ."]; - public static $MISSING_UPLOAD_DATA = ['message' => 'Missing data for upload', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $MISSING_UPLOAD_FILE_PARAMETER = ['message' => 'Missing file parameter for upload', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $MISSING_UPLOAD_FILENAME_PARAMETER = ['message' => 'Missing fileName parameter for upload', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $INVALID_PHASH_VALUE = ['message' => 'Invalid pHash value', 'help' => 'Both pHash strings must be valid hexadecimal numbers']; - public static $MISSING_PHASH_VALUE = ['message' => 'Missing pHash value', 'help' => 'Both pHash strings must be valid hexadecimal numbers']; - public static $UNEQUAL_STRING_LENGTH = ['message' => 'Unequal pHash string length', 'help' => 'For distance calucation, the two pHash strings must have equal length']; - public static $fileIdS_MISSING = ['message' => 'Missing Parameter FileIds', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $fileIdS_NON_ARRAY = ['message' => 'File ids should be passed in an array', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $fileIdS_EMPTY_ARRAY = ['message' => 'File ids should be passed as an array of file ids, empty array passed', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $MISSING_URL_PARAMETER = ['message' => 'Your request is missing the url query paramater', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $INVALID_URL_PARAMETER = ['message' => 'Invalid URL provided for this request', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $URL_GENERATION_PARAMETER_MISSING = ['message' => 'URL Generation Method accepts an array, null passed', 'help' => - 'For support kindly contact us at support@imagekit.io .']; - public static $URL_GENERATION_PARAMETER_NON_ARRAY = ['message' => 'URL Generation API accepts an array of parameters, non array value passed.', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $URL_GENERATION_PARAMETER_EMPTY_ARRAY = ['message' => 'URL Generation API accepts an array of parameters, empty array passed.', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $URL_GENERATION_SRC_INVALID = ['message' => 'src is not a valid URL', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $URL_GENERATION_URL_INVALID = ['message' => 'Invalid urlEndpoint value', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $URL_GENERATION_TRANSFORMATION_PARAMETER_INVALID = ['message' => 'Transformation Parameter accepts an array, not array or null provided.', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $URL_GENERATION_IF_CONDITION_MISSING = ['message' => 'Missing Parameter "condition" in if statement.', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $URL_GENERATION_IF_CONDITION_NON_ARRAY = ['message' => 'Invalid Parameter. "condition" accepts an array of parameters, non array value passed.', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $URL_GENERATION_IF_CONDITION_EMPTY_ARRAY = ['message' => '"condition" accepts an array of parameters, empty array passed.', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $URL_GENERATION_IF_CONDITION_INVALID_PROPERTY = ['message' => 'Invalid property applied in the condition. Refer to SDK docs for allowed properties.', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $URL_GENERATION_IF_CONDITION_INVALID_OPERAND = ['message' => 'Invalid operator applied. Allowed operators are "==","!=",">",">=","<","<="', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $URL_GENERATION_IF_TRUE_MISSING = ['message' => 'Missing Parameter "true" in if statement.', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $URL_GENERATION_IF_TRUE_NON_ARRAY = ['message' => 'Invalid Parameter. "true" accepts an array of parameters, non array value passed.', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $URL_GENERATION_IF_TRUE_EMPTY_ARRAY = ['message' => '"true" accepts an array of parameters, empty array passed.', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $URL_GENERATION_TRANSFORMATION_QUERY_INVALID = ['message' => 'Invalid value provided for "transformationPosition". Supported values are "path" and "query"', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $COPY_FILE_PARAMETER_MISSING = ['message' => 'Copy File API accepts an array, null passed', 'help' => - 'For support kindly contact us at support@imagekit.io .']; - public static $COPY_FILE_PARAMETER_NON_ARRAY = ['message' => 'Copy File API accepts an array of parameters, non array value passed', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $COPY_FILE_PARAMETER_EMPTY_ARRAY = ['message' => 'Copy File API accepts an array of parameters, empty array passed', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $COPY_FILE_DATA_INVALID = ['message' => 'Missing parameter sourceFilePath and/or destinationPath for Copy File API', 'help' => - 'For support kindly contact us at support@imagekit.io .']; - public static $MOVE_FILE_PARAMETER_MISSING = ['message' => 'Move File API accepts an array, null passed', 'help' => - 'For support kindly contact us at support@imagekit.io .']; - public static $MOVE_FILE_PARAMETER_NON_ARRAY = ['message' => 'Move File API accepts an array of parameters, non array value passed', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $MOVE_FILE_PARAMETER_EMPTY_ARRAY = ['message' => 'Move File API accepts an array of parameters, empty array passed', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $MOVE_FILE_DATA_INVALID = ['message' => 'Missing parameter sourceFilePath and/or destinationPath for Move File API', 'help' => - 'For support kindly contact us at support@imagekit.io .']; - public static $RENAME_FILE_PARAMETER_MISSING = ['message' => 'Rename File API accepts an array, null passed', 'help' => - 'For support kindly contact us at support@imagekit.io .']; - public static $RENAME_FILE_PARAMETER_NON_ARRAY = ['message' => 'Rename File API accepts an array of parameters, non array value passed', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $RENAME_FILE_PARAMETER_EMPTY_ARRAY = ['message' => 'Rename File API accepts an array of parameters, empty array passed', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $RENAME_FILE_DATA_INVALID = ['message' => 'Missing parameter filePath and/or newFileName for Rename File API', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $RENAME_FILE_DATA_INVALID_PURGE_CACHE = ['message' => 'purgeCache parameter must be boolean', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $RESTORE_FILE_VERSION_PARAMETER_MISSING = ['message' => 'Restore File Version API accepts an array, null passed', 'help' => - 'For support kindly contact us at support@imagekit.io .']; - public static $RESTORE_FILE_VERSION_PARAMETER_NON_ARRAY = ['message' => 'Restore File Version API accepts an array of parameters, non array value passed', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $RESTORE_FILE_VERSION_PARAMETER_EMPTY_ARRAY = ['message' => 'Restore File Version API accepts an array of parameters, empty array passed', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $RESTORE_FILE_VERSION_DATA_INVALID = ['message' => 'Missing parameter fileId and/or versionId for Restore File Version API', 'help' => - 'For support kindly contact us at support@imagekit.io .']; - public static $CREATE_FOLDER_PARAMETER_MISSING = ['message' => 'Create Folder API accepts an array, null passed', 'help' => - 'For support kindly contact us at support@imagekit.io .']; - public static $CREATE_FOLDER_PARAMETER_NON_ARRAY = ['message' => 'Create Folder API accepts an array of parameters, non array value passed', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $CREATE_FOLDER_PARAMETER_EMPTY_ARRAY = ['message' => 'Create Folder API accepts an array of parameters, empty array passed', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $CREATE_FOLDER_DATA_INVALID = ['message' => 'Missing parameter folderName and/or parentFolderPath for Create Folder API', 'help' => - 'For support kindly contact us at support@imagekit.io .']; - public static $DELETE_FOLDER_PARAMETER_MISSING = ['message' => 'Missing folderPath for Delete Folder API', 'help' => - 'For support kindly contact us at support@imagekit.io .']; - public static $COPY_FOLDER_PARAMETER_MISSING = ['message' => 'Copy Folder API accepts an array, null passed', 'help' => - 'For support kindly contact us at support@imagekit.io .']; - public static $COPY_FOLDER_PARAMETER_NON_ARRAY = ['message' => 'Copy Folder API accepts an array of parameters, non array value passed', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $COPY_FOLDER_PARAMETER_EMPTY_ARRAY = ['message' => 'Copy Folder API accepts an array of parameters, empty array passed', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $COPY_FOLDER_DATA_INVALID = ['message' => 'Missing parameter sourceFolderPath and/or destinationPath for Copy Folder API', 'help' => - 'For support kindly contact us at support@imagekit.io .']; - public static $MOVE_FOLDER_PARAMETER_MISSING = ['message' => 'Move Folder API accepts an array, null passed', 'help' => - 'For support kindly contact us at support@imagekit.io .']; - public static $MOVE_FOLDER_PARAMETER_NON_ARRAY = ['message' => 'Move Folder API accepts an array of parameters, non array value passed', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $MOVE_FOLDER_PARAMETER_EMPTY_ARRAY = ['message' => 'Move Folder API accepts an array of parameters, empty array passed', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $MOVE_FOLDER_DATA_INVALID = ['message' => 'Missing parameter sourceFolderPath and/or destinationPath for Move Folder API', 'help' => - 'For support kindly contact us at support@imagekit.io .']; - public static $MISSING_CREATE_FOLDER_OPTIONS = ['message' => 'Missing data for creation of folder', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $MISSING_DELETE_FOLDER_OPTIONS = ['message' => 'Missing data for deletion of folder', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $MISSING_COPY_FOLDER_OPTIONS = ['message' => 'Missing data for copying folder', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $MISSING_MOVE_FOLDER_OPTIONS = ['message' => 'Missing data for moving folder', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $CREATE_CUSTOM_METADATA_PARAMETER_MISSING = ['message' => 'Create Custom Metadata API accepts an array, null passed', 'help' => - 'For support kindly contact us at support@imagekit.io .']; - public static $CREATE_CUSTOM_METADATA_PARAMETER_NON_ARRAY = ['message' => 'Create Custom Metadata API accepts an array of parameters, non array value passed', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $CREATE_CUSTOM_METADATA_PARAMETER_EMPTY_ARRAY = ['message' => 'Create Custom Metadata API accepts an array of parameters, empty array passed', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $CREATE_CUSTOM_METADATA_DATA_INVALID = ['message' => 'Missing parameter name and/or label and/or schema for this request', 'help' => - 'For support kindly contact us at support@imagekit.io .']; - public static $CREATE_CUSTOM_METADATA_DATA_INVALID_SCHEMA_OBJECT = ['message' => 'Invalid parameter schema', 'help' => - 'For support kindly contact us at support@imagekit.io .']; - public static $GET_CUSTOM_METADATA_INVALID_PARAMETER = ['message' => 'Invalid parameter includeDeleted', 'help' => - 'For support kindly contact us at support@imagekit.io .']; - public static $UPDATE_CUSTOM_METADATA_PARAMETER_MISSING = ['message' => 'Update Custom Metadata API accepts an id and requestBody, null passed', 'help' => - 'For support kindly contact us at support@imagekit.io .']; - public static $UPDATE_CUSTOM_METADATA_PARAMETER_NON_ARRAY = ['message' => 'Update Custom Metadata API accepts requestBody as an array of parameters, non array value passed', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $UPDATE_CUSTOM_METADATA_PARAMETER_EMPTY_ARRAY = ['message' => 'Update Custom Metadata API accepts an array of parameters, empty array passed', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $UPDATE_CUSTOM_METADATA_DATA_INVALID = ['message' => 'Missing parameter label and/or schema for this request', 'help' => - 'For support kindly contact us at support@imagekit.io .']; - public static $UPDATE_CUSTOM_METADATA_DATA_INVALID_SCHEMA_OBJECT = ['message' => 'Invalid parameter schema', 'help' => - 'For support kindly contact us at support@imagekit.io .']; - public static $UPDATE_CUSTOM_METADATA_ID_MISSING = ['message' => 'Missing Custom Metadata Field ID parameter for this request', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $UPDATE_CUSTOM_METADATA_BODY_MISSING = ['message' => 'Missing body parameter for this request', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $DELETE_CUSTOM_METADATA_ID_MISSING = ['message' => 'Missing Custom Metadata Field ID parameter for this request', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $PHASH_DISTANCE_FIRST_PHASH_MISSING = ['message' => 'Missing First pHash parameter for this request', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $PHASH_DISTANCE_SECOND_PHASH_MISSING = ['message' => 'Missing Second pHash parameter for this request', 'help' => 'For support kindly contact us at support@imagekit.io .']; - public static $URL_GENERATION_EXPIRESECONDS_PARAMETER_INVALID = ['message' => 'expireSeconds accepts an integer value, non integer value provided.', 'help' => 'For support kindly contact us at support@imagekit.io .']; -} diff --git a/src/ImageKit/Constants/SupportedTransforms.php b/src/ImageKit/Constants/SupportedTransforms.php deleted file mode 100644 index c31aa4de..00000000 --- a/src/ImageKit/Constants/SupportedTransforms.php +++ /dev/null @@ -1,51 +0,0 @@ - 'h', - 'width' => 'w', - 'aspectRatio' => 'ar', - 'quality' => 'q', - 'crop' => 'c', - 'cropMode' => 'cm', - 'x' => 'x', - 'y' => 'y', - 'focus' => 'fo', - 'format' => 'f', - 'radius' => 'r', - 'background' => 'bg', - 'border' => 'b', - 'rotation' => 'rt', - 'blur' => 'bl', - 'named' => 'n', - 'progressive' => 'pr', - 'lossless' => 'lo', - 'trim' => 't', - 'metadata' => 'md', - 'colorProfile' => 'cp', - 'defaultImage' => 'di', - 'dpr' => 'dpr', - 'effectSharpen' => 'e-sharpen', - 'effectUSM' => 'e-usm', - 'effectContrast' => 'e-contrast', - 'effectGray' => 'e-grayscale', - 'effectShadow' => 'e-shadow', - 'effectGradient' => 'e-gradient', - 'original' => 'orig', - 'rotate' => 'rt', - ]; - - /** - * @return array - */ - public static function get() - { - return self::$transforms; - } -} diff --git a/src/ImageKit/ImageKit.php b/src/ImageKit/ImageKit.php deleted file mode 100644 index 33089341..00000000 --- a/src/ImageKit/ImageKit.php +++ /dev/null @@ -1,1205 +0,0 @@ -configuration = new Configuration(); - if ($publicKey == null || empty($publicKey)) { - $msg = 'Missing publicKey during ImageKit initialization'; - throw new InvalidArgumentException($msg); - } - $this->configuration->publicKey = $publicKey; - - if ($privateKey == null || empty($privateKey)) { - $msg = 'Missing privateKey during ImageKit initialization'; - throw new InvalidArgumentException($msg); - } - $this->configuration->privateKey = $privateKey; - - if ($urlEndpoint == null || empty($urlEndpoint)) { - $msg = 'Missing urlEndpoint during ImageKit initialization'; - throw new InvalidArgumentException($msg); - } - - if (!filter_var($urlEndpoint, FILTER_VALIDATE_URL)) { - throw new InvalidArgumentException('urlEndpoint should be a valid URL'); - } - $this->configuration->urlEndpoint = $urlEndpoint; - - if ($transformationPosition !== 'path' && $transformationPosition !== 'query') { - $msg = 'Invalid transformationPosition during ImageKit initialization. Can be one of path or query'; - throw new InvalidArgumentException($msg); - } - $this->configuration->transformationPosition = $transformationPosition; - - $client = new Client(Authorization::addAuthorization($this->configuration,$handlerStack)); - $this->httpClient = new GuzzleHttpWrapper($client); - } - - /** - * You can add multiple origins in the same ImageKit.io account. - * URL endpoints allow you to configure which origins are accessible through your account and set their preference - * order as well. - * - * @link https://docs.imagekit.io/integration/url-endpoints Url Endpoint Documentation - * @link https://github.com/imagekit-developer/imagekit-php#url-generation Url Generation Documentation - * - * @param array $options - * @return string - */ - public function url($options=null) - { - if(!isset($options)){ - return json_encode(Response::respond(true, ((object)ErrorMessages::$URL_GENERATION_PARAMETER_MISSING))); - } - if(!is_array($options)){ - return json_encode(Response::respond(true, ((object)ErrorMessages::$URL_GENERATION_PARAMETER_NON_ARRAY))); - } - if(sizeof($options)==0){ - return json_encode(Response::respond(true, ((object)ErrorMessages::$URL_GENERATION_PARAMETER_EMPTY_ARRAY))); - } - if (isset($options['src']) && !filter_var($options['src'], FILTER_VALIDATE_URL)) { - return json_encode(Response::respond(true, ((object)ErrorMessages::$URL_GENERATION_SRC_INVALID))); - } - if (isset($options['urlEndpoint']) && !filter_var($options['urlEndpoint'], FILTER_VALIDATE_URL)) { - return json_encode(Response::respond(true, ((object)ErrorMessages::$URL_GENERATION_URL_INVALID))); - } - - if (isset($options['transformation']) && !is_array($options['transformation'])) { - return json_encode(Response::respond(true, ((object)ErrorMessages::$URL_GENERATION_TRANSFORMATION_PARAMETER_INVALID))); - } - - if (isset($options['signed']) && $options['signed'] === true){ - if(isset($options['expireSeconds']) && $options['expireSeconds'] !== '' && !is_numeric($options['expireSeconds'])){ - return json_encode(Response::respond(true, ((object)ErrorMessages::$URL_GENERATION_EXPIRESECONDS_PARAMETER_INVALID))); - } - } - - $urlInstance = new Url(); - return $urlInstance->buildURL(array_merge((array)$this->configuration, $options)); - } - - /** - * You can upload files to ImageKit.io media library from your server-side using private API key authentication. - * - * - * @link https://docs.imagekit.io/api-reference/upload-file-api/server-side-file-upload API Reference - * - * @param array $options - * @return object - * - */ - public function upload($options=null) - { - return $this->uploadFile($options); - } - - /** - * You can upload files to ImageKit.io media library from your server-side using private API key authentication. - * - * - * @link https://docs.imagekit.io/api-reference/upload-file-api/server-side-file-upload API Reference - * - * @param array $options - * @return Response - */ - public function uploadFile($options=null) - { - - if(!isset($options)){ - return Response::respond(true, ((object)ErrorMessages::$UPLOAD_FILE_PARAMETER_MISSING)); - } - if(!is_array($options)){ - return Response::respond(true, ((object)ErrorMessages::$UPLOAD_FILE_PARAMETER_NON_ARRAY)); - } - if(sizeof($options)==0){ - return Response::respond(true, ((object)ErrorMessages::$UPLOAD_FILE_PARAMETER_EMPTY_ARRAY)); - } - if (empty($options['file'])) { - return Response::respond(true, ((object)ErrorMessages::$MISSING_UPLOAD_FILE_PARAMETER)); - } - if (empty($options['fileName'])) { - return Response::respond(true, ((object)ErrorMessages::$MISSING_UPLOAD_FILENAME_PARAMETER)); - } - if(isset($options['useUniqueFileName']) && !is_bool($options['useUniqueFileName'])){ - return Response::respond(true, ((object)ErrorMessages::$UPLOAD_FILE_PARAMETER_OPTIONS_USEUNIQUEFILENAME_INVALID)); - } - if(isset($options['isPrivateFile']) && !is_bool($options['isPrivateFile'])){ - return Response::respond(true, ((object)ErrorMessages::$UPLOAD_FILE_PARAMETER_OPTIONS_ISPRIVATEFILE_INVALID)); - } - if(isset($options['overwriteFile']) && !is_bool($options['overwriteFile'])){ - return Response::respond(true, ((object)ErrorMessages::$UPLOAD_FILE_PARAMETER_OPTIONS_OVERWRITEFILE_INVALID)); - } - if(isset($options['overwriteAITags']) && !is_bool($options['overwriteAITags'])){ - return Response::respond(true, ((object)ErrorMessages::$UPLOAD_FILE_PARAMETER_OPTIONS_OVERWRITEAITAGS_INVALID)); - } - if(isset($options['overwriteTags']) && !is_bool($options['overwriteTags'])){ - return Response::respond(true, ((object)ErrorMessages::$UPLOAD_FILE_PARAMETER_OPTIONS_OVERWRITETAGS_INVALID)); - } - if(isset($options['overwriteCustomMetadata']) && !is_bool($options['overwriteCustomMetadata'])){ - return Response::respond(true, ((object)ErrorMessages::$UPLOAD_FILE_PARAMETER_OPTIONS_OVERWRITECUSTOMMETADATA_INVALID)); - } - if(isset($options['extensions']) && !is_array($options['extensions'])){ - return Response::respond(true, ((object)ErrorMessages::$UPLOAD_FILE_PARAMETER_OPTIONS_EXTENSIONS_INVALID)); - } - if(isset($options['customMetadata']) && !is_array($options['customMetadata'])){ - return Response::respond(true, ((object)ErrorMessages::$UPLOAD_FILE_PARAMETER_OPTIONS_CUSTOMMETADATA_INVALID)); - } - if (isset($options['transformation'])) { - if (!isset($options['transformation']['pre']) && !isset($options['transformation']['post'])) { - return Response::respond(true, ((object)ErrorMessages::$UPLOAD_FILE_PARAMETER_OPTIONS_INVALID_TRANSFORMATION)); - } - if (isset($options['transformation']['pre']) && empty($options['transformation']['pre'])) { - return Response::respond(true, ((object)ErrorMessages::$UPLOAD_FILE_PARAMETER_OPTIONS_INVALID_PRE_TRANSFORMATION)); - } - if (isset($options['transformation']['post'])) { - if (is_array($options['transformation']['post'])) { - foreach ($options['transformation']['post'] as $transformation) { - if ($transformation['type'] === "abs" && (!isset($transformation['protocol']) || !isset($transformation['value']))) { - return Response::respond(true, ((object)ErrorMessages::$UPLOAD_FILE_PARAMETER_OPTIONS_INVALID_POST_TRANSFORMATION)); - } else if ($transformation['type'] === "transformation" && empty($transformation['value'])) { - return Response::respond(true, ((object)ErrorMessages::$UPLOAD_FILE_PARAMETER_OPTIONS_INVALID_POST_TRANSFORMATION)); - } - } - } else { - return Response::respond(true, ((object)ErrorMessages::$UPLOAD_FILE_PARAMETER_OPTIONS_INVALID_POST_TRANSFORMATION)); - } - } - } - if(isset($options['checks']) && !is_string($options['checks'])){ - return Response::respond(true, ((object)ErrorMessages::$UPLOAD_FILE_PARAMETER_OPTIONS_INVALID_CHECKS)); - } - if(isset($options['isPublished']) && !is_bool($options['isPublished'])){ - return Response::respond(true, ((object)ErrorMessages::$UPLOAD_FILE_PARAMETER_OPTIONS_INVALID_PUBLISH_STATUS)); - } - $this->httpClient->setUri(Endpoints::getUploadFileEndpoint()); - return Upload::upload($options, $this->httpClient); - } - - /** - * You can upload files to ImageKit.io media library from your server-side using private API key authentication. - * - * - * @link https://docs.imagekit.io/api-reference/upload-file-api/server-side-file-upload API Reference - * - * @param array $options - * @return Response - * - * @deprecated since 2.0.0, use uploadFile; uploadFiles was misleading as it supports only singular - * - * file upload - */ - public function uploadFiles($options=null) - { - return $this->uploadFile($options); - } - - /** - * This API can list all the uploaded files in your ImageKit.io media library. - * For searching and filtering, you can use query parameters as described below. - * - * @link https://docs.imagekit.io/api-reference/media-api/list-and-search-files API Reference - * - * @param array $parameters - * @return Response - */ - public function listFiles($parameters = null) - { - if($parameters){ - if(!is_array($parameters)){ - return Response::respond(true, ((object)ErrorMessages::$LIST_FILES_OPTIONS_NON_ARRAY)); - } - } - - $this->httpClient->setUri(Endpoints::getListFilesEndpoint()); - return Manage\File::listFile($this->httpClient, $parameters); - } - - /** - * Get the file details such as tags, customCoordinates, and isPrivate properties using get file detail API. - * - * @link https://docs.imagekit.io/api-reference/media-api/get-file-details API Reference - * - * @param string $fileId - * - * @return Response - * - * @deprecated since 2.0.0, use getFileDetails - */ - public function getDetails($fileId=null) - { - return $this->getFileDetails($fileId); - } - - /** - * Get the file details such as tags, customCoordinates, and isPrivate properties using get file detail API. - * - * @link https://docs.imagekit.io/api-reference/media-api/get-file-details API Reference - * - * @param string $fileId - * @return Response - * - */ - public function getFileDetails($fileId=null) - { - if (empty($fileId)) { - return Response::respond(true, ((object)ErrorMessages::$fileId_MISSING)); - } - $this->httpClient->setUri(Endpoints::getDetailsEndpoint($fileId)); - return Manage\File::getDetails($fileId, $this->httpClient); - } - - /** - * Get the file version details such as tags, customCoordinates, and isPrivate properties using get file version details API. - * - * @link https://docs.imagekit.io/api-reference/media-api/get-file-version-details API Reference - * - * @param string $fileId - * @param string $versionId - * @return Response - * - */ - public function getFileVersionDetails($fileId=null, $versionId=null) - { - if (empty($fileId)) { - return Response::respond(true, ((object)ErrorMessages::$fileId_MISSING)); - } - - if (empty($versionId)) { - return Response::respond(true, ((object)ErrorMessages::$versionId_MISSING)); - } - - $this->httpClient->setUri(Endpoints::getVersionDetailsEndpoint($fileId, $versionId)); - return Manage\File::getVersionDetails($fileId, $versionId, $this->httpClient); - } - - /** - * Get all the versions of a file using get file versions API. - * - * @link https://docs.imagekit.io/api-reference/media-api/get-file-versions API Reference - * - * @param string $fileId - * @return Response - * - */ - public function getFileVersions($fileId=null) - { - if (empty($fileId)) { - return Response::respond(true, ((object)ErrorMessages::$fileId_MISSING)); - } - - $this->httpClient->setUri(Endpoints::getFileVersionsEndpoint($fileId)); - return Manage\File::getFileVersions($fileId, $this->httpClient); - } - - /** - * Get image exif, pHash and other metadata for uploaded files in ImageKit.io media library using this API. - * - * @link https://docs.imagekit.io/api-reference/metadata-api/get-image-metadata-for-uploaded-media-files - * - * @param string $fileId The unique fileId of the uploaded file. fileId is returned in list files API and upload API - * - * @return Response - * @deprecated since 2.0.0, use getFileMetaData - */ - public function getMetaData($fileId=null) - { - return $this->getFileMetaData($fileId); - } - - /** - * Get image exif, pHash and other metadata for uploaded files in ImageKit.io media library using this API. - * - * @link https://docs.imagekit.io/api-reference/metadata-api/get-image-metadata-for-uploaded-media-files - * - * @param string $fileId The unique fileId of the uploaded file. fileId is returned in list files API and upload API - * - * @return Response - */ - public function getFileMetaData($fileId=null) - { - if (empty($fileId)) { - return Response::respond(true, ((object)ErrorMessages::$fileId_MISSING)); - } - $this->httpClient->setUri(Endpoints::getListMetaDataFilesEndpoint($fileId)); - return Manage\CustomMetadataFields::get($fileId, $this->httpClient); - } - - /** - * Update file details such as tags and customCoordinates attribute using update file detail API. - * - * @link https://docs.imagekit.io/api-reference/media-api/update-file-details - * - * @param string $fileId The unique fileId of the uploaded file. fileId is returned in list files API and upload API - * @param array $updateData - * - * @return Response - * @deprecated since 2.0.0, use updateFileDetails - */ - public function updateDetails($fileId=null, $updateData=null) - { - return $this->updateFileDetails($fileId, $updateData); - } - - /** - * Update file details such as tags and customCoordinates attribute using update file detail API. - * - * @link https://docs.imagekit.io/api-reference/media-api/update-file-details - * - * @param string $fileId The unique fileId of the uploaded file. fileId is returned in list files API and upload API - * @param array $updateData - * @return Response - */ - public function updateFileDetails($fileId=null, $updateData=null) - { - if (empty($fileId)) { - return Response::respond(true, ((object)ErrorMessages::$fileId_MISSING)); - } - - if (!is_array($updateData) || sizeof($updateData)==0) { - return Response::respond(true, ((object)ErrorMessages::$UPDATE_DATA_MISSING)); - } - - $this->httpClient->setUri(Endpoints::getUpdateFileDetailsEndpoint($fileId)); - return Manage\File::updateDetails($fileId, $updateData, $this->httpClient); - } - - /** - * Add tags to multiple files in a single request. The method accepts an array of fileIDs of the files and an - * array of tags that have to be added to those files. - * - * @link https://docs.imagekit.io/api-reference/media-api/add-tags-bulk - * - * @param array $fileIds - * @param array $tags - * - * @return Response - */ - public function bulkAddTags($fileIds=null, $tags=null) - { - if(!isset($fileIds)){ - return Response::respond(true, ((object)ErrorMessages::$BULK_TAGS_FILEIDS_MISSING)); - } - if(!is_array($fileIds)){ - return Response::respond(true, ((object)ErrorMessages::$BULK_TAGS_FILEIDS_NON_ARRAY)); - } - if(sizeof($fileIds)==0){ - return Response::respond(true, ((object)ErrorMessages::$BULK_TAGS_FILEIDS_EMPTY_ARRAY)); - } - if(!isset($tags)){ - return Response::respond(true, ((object)ErrorMessages::$BULK_TAGS_TAGS_MISSING)); - } - if(!is_array($tags)){ - return Response::respond(true, ((object)ErrorMessages::$BULK_TAGS_TAGS_NON_ARRAY)); - } - if(sizeof($tags)==0){ - return Response::respond(true, ((object)ErrorMessages::$BULK_TAGS_TAGS_EMPTY_ARRAY)); - } - - $this->httpClient->setUri(Endpoints::getBulkAddTagsEndpoint()); - return Manage\File::bulkAddTags($fileIds, $tags, $this->httpClient); - } - - /** - * Remove tags to multiple files in a single request. The method accepts an array of fileIDs of the files and an - * array of tags that have to be removed to those files. - * - * @link https://docs.imagekit.io/api-reference/media-api/remove-tags-bulk - * - * @param array $fileIds - * @param array $tags - * - * @return Response - */ - public function bulkRemoveTags($fileIds=null, $tags=null) - { - if(!isset($fileIds)){ - return Response::respond(true, ((object)ErrorMessages::$BULK_TAGS_FILEIDS_MISSING)); - } - if(!is_array($fileIds)){ - return Response::respond(true, ((object)ErrorMessages::$BULK_TAGS_FILEIDS_NON_ARRAY)); - } - if(sizeof($fileIds)==0){ - return Response::respond(true, ((object)ErrorMessages::$BULK_TAGS_FILEIDS_EMPTY_ARRAY)); - } - if(!isset($tags)){ - return Response::respond(true, ((object)ErrorMessages::$BULK_TAGS_TAGS_MISSING)); - } - if(!is_array($tags)){ - return Response::respond(true, ((object)ErrorMessages::$BULK_TAGS_TAGS_NON_ARRAY)); - } - if(sizeof($tags)==0){ - return Response::respond(true, ((object)ErrorMessages::$BULK_TAGS_TAGS_EMPTY_ARRAY)); - } - - $this->httpClient->setUri(Endpoints::getBulkRemoveTagsEndpoint()); - return Manage\File::bulkRemoveTags($fileIds, $tags, $this->httpClient); - } - - /** - * Remove AI tags from multiple files in a single request. The method accepts an array of fileIDs of the files and an array of tags that have to be removed to those files. - * - * @link https://docs.imagekit.io/api-reference/media-api/remove-aitags-bulk - * - * @param array $fileIds - * @param array $AITags - * - * @return Response - */ - public function bulkRemoveAITags($fileIds=null, $AITags=null) - { - if(!isset($fileIds)){ - return Response::respond(true, ((object)ErrorMessages::$BULK_TAGS_FILEIDS_MISSING)); - } - if(!is_array($fileIds)){ - return Response::respond(true, ((object)ErrorMessages::$BULK_TAGS_FILEIDS_NON_ARRAY)); - } - if(sizeof($fileIds)==0){ - return Response::respond(true, ((object)ErrorMessages::$BULK_TAGS_FILEIDS_EMPTY_ARRAY)); - } - if(!isset($AITags)){ - return Response::respond(true, ((object)ErrorMessages::$BULK_TAGS_TAGS_MISSING)); - } - if(!is_array($AITags)){ - return Response::respond(true, ((object)ErrorMessages::$BULK_TAGS_TAGS_NON_ARRAY)); - } - if(sizeof($AITags)==0){ - return Response::respond(true, ((object)ErrorMessages::$BULK_TAGS_TAGS_EMPTY_ARRAY)); - } - $this->httpClient->setUri(Endpoints::getBulkRemoveAITagsEndpoint()); - return Manage\File::bulkRemoveAITags($fileIds, $AITags, $this->httpClient); - } - - /** - * You can programmatically delete uploaded files in media library using delete file API. - * - * @link https://docs.imagekit.io/api-reference/media-api/delete-file - * - * @param $fileId - * @return Response - * - */ - public function deleteFile($fileId=null) - { - if (!isset($fileId) || empty($fileId)) { - return Response::respond(true, ((object)ErrorMessages::$fileId_MISSING)); - } - - $this->httpClient->setUri(Endpoints::getDeleteFilesEndpoint($fileId)); - return Manage\File::delete($fileId, $this->httpClient); - } - - - /** - * You can programmatically delete uploaded file version in media library using delete file version API. - * - * @link https://docs.imagekit.io/api-reference/media-api/delete-file-version - * - * @param $fileId - * @param $versionId - * @return Response - * - */ - public function deleteFileVersion($fileId=null, $versionId=null) - { - if (!isset($fileId) || empty($fileId)) { - return Response::respond(true, ((object)ErrorMessages::$fileId_MISSING)); - } - - if (!isset($versionId) || empty($versionId)) { - return Response::respond(true, ((object)ErrorMessages::$versionId_MISSING)); - } - - $this->httpClient->setUri(Endpoints::getDeleteFileVersionEndpoint($fileId,$versionId)); - return Manage\File::deleteVersion($fileId, $versionId, $this->httpClient); - } - - /** - * This will purge CDN and ImageKit.io internal cache. - * - * @link https://docs.imagekit.io/api-reference/media-api/purge-cache - * - * @param $options - * @return Response - * - * @deprecated since 2.0.0, use purgeCache - */ - public function purgeFileCacheApi($options=null) - { - return $this->purgeCache($options); - } - - /** - * This will purge CDN and ImageKit.io internal cache. - * - * @link https://docs.imagekit.io/api-reference/media-api/purge-cache - * - * @param $options - * @return Response - * - * @deprecated since 2.0.0, use purgeCache - */ - public function purgeCacheApi($options=null) - { - return $this->purgeCache($options); - } - - /** - * This will purge CDN and ImageKit.io internal cache. - * - * @link https://docs.imagekit.io/api-reference/media-api/purge-cache - * - * @param $options - * @return Response - */ - public function purgeCache($options=null) - { - if (empty($options)) { - return Response::respond(true, ((object)ErrorMessages::$CACHE_PURGE_URL_MISSING)); - } - - if (!filter_var($options, FILTER_VALIDATE_URL)) { - return Response::respond(true, ((object)ErrorMessages::$CACHE_PURGE_URL_INVALID)); - } - - $this->httpClient->setUri(Endpoints::getPurgeCacheEndpoint()); - return Manage\Cache::purgeFileCache($options, $this->httpClient); - } - - /** - * Get the status of submitted purge request. - * - * @link https://docs.imagekit.io/api-reference/media-api/purge-cache-status - * - * @param $requestId - * @return Response - * - * @deprecated since 2.0.0, use getPurgeCacheStatus - */ - public function purgeCacheStatus($requestId=null) - { - return $this->getPurgeCacheStatus($requestId); - } - - /** - * Get the status of submitted purge request. - * - * @link https://docs.imagekit.io/api-reference/media-api/purge-cache-status - * - * @param $requestId - * @return Response - * - * @deprecated since 2.0.0, use getPurgeCacheStatus - */ - public function purgeFileCacheApiStatus($requestId=null) - { - return $this->getPurgeCacheStatus($requestId); - } - - /** - * Get the status of submitted purge request. - * - * @link https://docs.imagekit.io/api-reference/media-api/purge-cache-status - * - * @param $requestId - * @return Response - */ - public function getPurgeCacheStatus($requestId=null) - { - if (empty($requestId)) { - return Response::respond(true, ((object)ErrorMessages::$CACHE_PURGE_STATUS_ID_MISSING)); - } - - $this->httpClient->setUri(Endpoints::getPurgeCacheApiStatusEndpoint($requestId)); - return Manage\Cache::purgeFileCacheStatus($requestId, $this->httpClient); - } - - /** - * Delete multiple files. The method accepts an array of file IDs of the files that have to be deleted. - * - * @link https://docs.imagekit.io/api-reference/media-api/delete-files-bulk - * - * @param $options - * @return Response - * - * @deprecated since 2.0.0, use bulkDeleteFiles - */ - public function bulkFileDeleteByIds($fileIds=null) - { - return $this->bulkDeleteFiles($fileIds); - } - - /** - * Delete multiple files. The method accepts an array of file IDs of the files that have to be deleted. - * - * @link https://docs.imagekit.io/api-reference/media-api/delete-files-bulk - * - * @param $fileIds - * @return Response - * - */ - public function bulkDeleteFiles($fileIds=null) - { - if (!isset($fileIds)) { - return Response::respond(true, ((object)ErrorMessages::$fileIdS_MISSING)); - } - if (!is_array($fileIds)) { - return Response::respond(true, ((object)ErrorMessages::$fileIdS_NON_ARRAY)); - } - if (sizeof($fileIds)==0) { - return Response::respond(true, ((object)ErrorMessages::$fileIdS_EMPTY_ARRAY)); - } - - $this->httpClient->setUri(Endpoints::getDeleteByFileIdsEndpoint()); - return Manage\File::bulkDeleteByFileIds($fileIds, $this->httpClient); - } - - /** - * This will copy a file from one location to another. This method accepts an array of source file's path, destination path and boolean to include versions or not - * folder path. - * - * @link https://docs.imagekit.io/api-reference/media-api/copy-file - * - * @param $parameter['sourceFilePath','destinationPath','includeFileVersions'] - * @return Response - * - */ - public function copy($parameter=null) - { - if(!isset($parameter)){ - return Response::respond(true, ((object)ErrorMessages::$COPY_FILE_PARAMETER_MISSING)); - } - if(!is_array($parameter)){ - return Response::respond(true, ((object)ErrorMessages::$COPY_FILE_PARAMETER_NON_ARRAY)); - } - if(sizeof($parameter)==0){ - return Response::respond(true, ((object)ErrorMessages::$COPY_FILE_PARAMETER_EMPTY_ARRAY)); - } - if (empty($parameter['sourceFilePath']) || empty($parameter['destinationPath'])) { - return Response::respond(true, ((object)ErrorMessages::$COPY_FILE_DATA_INVALID)); - } - - $this->httpClient->setUri(Endpoints::getCopyFileEndpoint()); - return Manage\File::copy($parameter['sourceFilePath'], $parameter['destinationPath'], isset($parameter['includeFileVersions']) ? $parameter['includeFileVersions'] : false, $this->httpClient); - } - - - /** - * This will copy a file from one location to another. This method accepts an array of source file's path, destination path and boolean to include versions or not - * folder path. - * - * @link https://docs.imagekit.io/api-reference/media-api/copy-file - * - * @param $sourceFilePath - * @param $destinationPath - * @param $includeFileVersions - * @return Response - * - * @deprecated since 3.0.0, use copy - * - */ - public function copyFile($sourceFilePath=null, $destinationPath=null, $includeFileVersions=null) - { - - if (empty($sourceFilePath) || empty($destinationPath)) { - return Response::respond(true, ((object)ErrorMessages::$COPY_FILE_DATA_INVALID)); - } - - $this->httpClient->setUri(Endpoints::getCopyFileEndpoint()); - return Manage\File::copy($sourceFilePath, $destinationPath, $includeFileVersions, $this->httpClient); - } - - /** - * This will move a file from one location to another. This method accepts an array containing source file's path and destination path - * folder path. - * - * @link https://docs.imagekit.io/api-reference/media-api/move-file - * - * @param $parameter['sourceFilePath','destinationPath'] - * @return Response - * - */ - public function move($parameter=null) - { - if(!isset($parameter)){ - return Response::respond(true, ((object)ErrorMessages::$MOVE_FILE_PARAMETER_MISSING)); - } - if(!is_array($parameter)){ - return Response::respond(true, ((object)ErrorMessages::$MOVE_FILE_PARAMETER_NON_ARRAY)); - } - if(sizeof($parameter)==0){ - return Response::respond(true, ((object)ErrorMessages::$MOVE_FILE_PARAMETER_EMPTY_ARRAY)); - } - if (empty($parameter['sourceFilePath']) || empty($parameter['destinationPath'])) { - return Response::respond(true, ((object)ErrorMessages::$MOVE_FILE_DATA_INVALID)); - } - $this->httpClient->setUri(Endpoints::getMoveFileEndpoint()); - return Manage\File::move($parameter['sourceFilePath'], $parameter['destinationPath'], $this->httpClient); - } - - /** - * This will move a file from one location to another. This method accepts an array containing source file's path and destination path - * folder path. - * - * @link https://docs.imagekit.io/api-reference/media-api/move-file - * - * @param $sourceFilePath - * @param $destinationPath - * @param $includeVersions - * @return Response - * - * @deprecated since 3.0.0, use move - */ - public function moveFile($sourceFilePath=null, $destinationPath=null) - { - if (empty($sourceFilePath) || empty($destinationPath)) { - return Response::respond(true, ((object)ErrorMessages::$MOVE_FILE_DATA_INVALID)); - } - $this->httpClient->setUri(Endpoints::getMoveFileEndpoint()); - return Manage\File::move($sourceFilePath, $destinationPath, $this->httpClient); - } - - /** - * This will rename a file. This method accepts the source file's path, new file name and an optional parameter - * boolean to purge cache - * - * - * @link https://docs.imagekit.io/api-reference/media-api/rename-file - * - * @param $parameter[$filePath, $newFileNamem, $purgeCache] - * - * @return Response - */ - public function rename($parameter=null) - { - if(!isset($parameter)){ - return Response::respond(true, ((object)ErrorMessages::$RENAME_FILE_PARAMETER_MISSING)); - } - if(!is_array($parameter)){ - return Response::respond(true, ((object)ErrorMessages::$RENAME_FILE_PARAMETER_NON_ARRAY)); - } - if(sizeof($parameter)==0){ - return Response::respond(true, ((object)ErrorMessages::$RENAME_FILE_PARAMETER_EMPTY_ARRAY)); - } - if (empty($parameter['filePath']) || empty($parameter['newFileName'])) { - return Response::respond(true, ((object)ErrorMessages::$RENAME_FILE_DATA_INVALID)); - } - $purgeCache= false; - if(isset($parameter['purgeCache'])){ - if(!is_bool($parameter['purgeCache'])){ - return Response::respond(true, ((object)ErrorMessages::$RENAME_FILE_DATA_INVALID_PURGE_CACHE)); - } - else{ - $purgeCache = $parameter['purgeCache']; - } - } - - $this->httpClient->setUri(Endpoints::getRenameFileEndpoint()); - return Manage\File::rename($parameter['filePath'], $parameter['newFileName'], $purgeCache, $this->httpClient); - } - - /** - * This will rename a file. This method accepts the source file's path, new file name and an optional parameter - * boolean to purge cache - * - * - * @link https://docs.imagekit.io/api-reference/media-api/rename-file - * - * @param $filePath - * @param $newFileName - * @param $purgeCache - * @return Response - * - * @deprecated since 3.0.0, use rename - */ - public function renameFile($filePath, $newFileName, $purgeCache = false) - { - if (empty($filePath) || empty($newFileName)) { - return Response::respond(true, ((object)ErrorMessages::$RENAME_FILE_DATA_INVALID)); - } - - $this->httpClient->setUri(Endpoints::getRenameFileEndpoint()); - return Manage\File::rename($filePath, $newFileName, $purgeCache, $this->httpClient); - } - - /** - * This will Restore file version to a different version of a file. This method accepts the fileId and versionId - * - * - * @link https://docs.imagekit.io/api-reference/media-api/restore-file-version - * - * @param $parameter[$fileId, $versionId] - * @return Response - */ - public function restoreFileVersion($parameter=null) - { - if(!isset($parameter)){ - return Response::respond(true, ((object)ErrorMessages::$RESTORE_FILE_VERSION_PARAMETER_MISSING)); - } - if(!is_array($parameter)){ - return Response::respond(true, ((object)ErrorMessages::$RESTORE_FILE_VERSION_PARAMETER_NON_ARRAY)); - } - if(sizeof($parameter)==0){ - return Response::respond(true, ((object)ErrorMessages::$RESTORE_FILE_VERSION_PARAMETER_EMPTY_ARRAY)); - } - if (empty($parameter['fileId']) || empty($parameter['versionId'])) { - return Response::respond(true, ((object)ErrorMessages::$RESTORE_FILE_VERSION_DATA_INVALID)); - } - $this->httpClient->setUri(Endpoints::getRestoreFileVersionEndpoint($parameter['fileId'], $parameter['versionId'])); - return Manage\File::restoreVersion($this->httpClient); - } - - - /** - * This will create a new folder. This method accepts folder name and parent folder path in an array. - * - * @link https://docs.imagekit.io/api-reference/media-api/create-folder - * - * @param $parameter[$folderName, $parentFolderPath] - * - * @return Response - */ - public function createFolder($parameter=null) - { - if(!isset($parameter)){ - return Response::respond(true, ((object)ErrorMessages::$CREATE_FOLDER_PARAMETER_MISSING)); - } - if(!is_array($parameter)){ - return Response::respond(true, ((object)ErrorMessages::$CREATE_FOLDER_PARAMETER_NON_ARRAY)); - } - if(sizeof($parameter)==0){ - return Response::respond(true, ((object)ErrorMessages::$CREATE_FOLDER_PARAMETER_EMPTY_ARRAY)); - } - if (empty($parameter['folderName']) || empty($parameter['parentFolderPath'])) { - return Response::respond(true, ((object)ErrorMessages::$CREATE_FOLDER_DATA_INVALID)); - } - $this->httpClient->setUri(Endpoints::getCreateFolderEndpoint()); - return Manage\Folder::create($parameter['folderName'], $parameter['parentFolderPath'], $this->httpClient); - } - - /** - * This will delete the specified folder and all nested files & folders. - * This method accepts the full path of the folder that is to be deleted. - * - * @link https://docs.imagekit.io/api-reference/media-api/delete-folder - * - * @param $folderPath - * - * @return Response - */ - public function deleteFolder($folderPath=null) - { - if(!isset($folderPath) || empty($folderPath)){ - return Response::respond(true, ((object)ErrorMessages::$DELETE_FOLDER_PARAMETER_MISSING)); - } - $this->httpClient->setUri(Endpoints::getDeleteFolderEndpoint()); - return Manage\Folder::delete($folderPath, $this->httpClient); - } - - /** - * This will copy a folder from one location to another. This method accepts an array of source folder's path, destination path and boolean to include versions or not. - * - * @link https://docs.imagekit.io/api-reference/media-api/copy-folder - * - * @param $parameter[$sourceFolderPath, $destinationPath, includeFileVersions] - * - * @return Response - */ - public function copyFolder($parameter=null) - { - if(!isset($parameter)){ - return Response::respond(true, ((object)ErrorMessages::$COPY_FOLDER_PARAMETER_MISSING)); - } - if(!is_array($parameter)){ - return Response::respond(true, ((object)ErrorMessages::$COPY_FOLDER_PARAMETER_NON_ARRAY)); - } - if(sizeof($parameter)==0){ - return Response::respond(true, ((object)ErrorMessages::$COPY_FOLDER_PARAMETER_EMPTY_ARRAY)); - } - if (empty($parameter['sourceFolderPath']) || empty($parameter['destinationPath'])) { - return Response::respond(true, ((object)ErrorMessages::$COPY_FOLDER_DATA_INVALID)); - } - - $this->httpClient->setUri(Endpoints::getCopyFolderEndpoint()); - return Manage\Folder::copy($parameter['sourceFolderPath'], $parameter['destinationPath'], isset($parameter['includeFileVersions']) ? $parameter['includeFileVersions'] : false, $this->httpClient); - } - - /** - * This will move a folder from one location to another. This method accepts the source folder's path - * and destination folder path in an array. - * - * @link https://docs.imagekit.io/api-reference/media-api/move-folder - * - * @param $parameter[$sourceFolderPath, $destinationPath] - * - * @return Response - */ - public function moveFolder($parameter=null) - { - if(!isset($parameter)){ - return Response::respond(true, ((object)ErrorMessages::$MOVE_FOLDER_PARAMETER_MISSING)); - } - if(!is_array($parameter)){ - return Response::respond(true, ((object)ErrorMessages::$MOVE_FOLDER_PARAMETER_NON_ARRAY)); - } - if(sizeof($parameter)==0){ - return Response::respond(true, ((object)ErrorMessages::$MOVE_FOLDER_PARAMETER_EMPTY_ARRAY)); - } - if (empty($parameter['sourceFolderPath']) || empty($parameter['destinationPath'])) { - return Response::respond(true, ((object)ErrorMessages::$MOVE_FOLDER_DATA_INVALID)); - } - - $this->httpClient->setUri(Endpoints::getMoveFolderEndpoint()); - return Manage\Folder::move($parameter['sourceFolderPath'], $parameter['destinationPath'], $this->httpClient); - } - - /** - * @param string $token - * @param int $expire - * @return object { token: string, expire: int, signature: string} - */ - public function getAuthenticationParameters($token = '', $expire = 0) - { - return Signature::getAuthenticationParameters($token, $expire, $this->configuration); - } - - /** - * This endpoint allows you to get the status of a bulk operation e.g. copy or move folder API. - * - * @link https://docs.imagekit.io/api-reference/media-api/copy-move-folder-status - * - * @param $jobId - * @return Response - */ - public function getBulkJobStatus($jobId=null) - { - - if (empty($jobId)) { - return Response::respond(true, ((object)ErrorMessages::$JOBID_MISSING)); - } - $this->httpClient->setUri(Endpoints::getBulkJobStatusEndpoint($jobId)); - - try { - $res = $this->httpClient->get(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } - - /** - * Get image exif, pHash and other metadata for uploaded files in ImageKit.io powered remote URL using this API. - * - * @link https://docs.imagekit.io/api-reference/metadata-api/get-image-metadata-from-remote-url - * - * @param $url - * @return Response - */ - public function getFileMetadataFromRemoteURL($url=null) - { - if (empty($url)) { - return Response::respond(true, ((object)ErrorMessages::$MISSING_URL_PARAMETER)); - } - - if (!filter_var($url, FILTER_VALIDATE_URL)) { - return Response::respond(true, ((object)ErrorMessages::$INVALID_URL_PARAMETER)); - } - - $this->httpClient->setUri(Endpoints::getFileMetadataFromRemoteURLEndpoint()); - return Manage\CustomMetadataFields::getFileMetadataFromRemoteURL($url, $this->httpClient); - } - /** - * Using pHash to find similar or duplicate images - * The hamming distance between two pHash values determines how similar or different the images are. - * - * The pHash value returned by ImageKit.io metadata API is a hexadecimal string of 64bit pHash. The distance - * between two hash can be between 0 and 64. A lower distance means similar images. If the distance is 0, - * that means two images are identical. - * - * @param string $firstPHash - * @param string $secondPHash - * @return int - */ - public function pHashDistance($firstPHash=null, $secondPHash=null) - { - if(!isset($firstPHash) || empty($firstPHash)){ - return Response::respond(true, ((object)ErrorMessages::$PHASH_DISTANCE_FIRST_PHASH_MISSING)); - } - if(!isset($secondPHash) || empty($secondPHash)){ - return Response::respond(true, ((object)ErrorMessages::$PHASH_DISTANCE_SECOND_PHASH_MISSING)); - } - return Phash::pHashDistance($firstPHash, $secondPHash); - } - - - /** - * Create custom metadata field using this API. - * - * @link https://docs.imagekit.io/api-reference/custom-metadata-fields-api/create-custom-metadata-field - * - * @param $parameter[$name,$label,$schema] - * @return Response - */ - public function createCustomMetadataField($parameter=null) - { - if(!isset($parameter)){ - return Response::respond(true, ((object)ErrorMessages::$CREATE_CUSTOM_METADATA_PARAMETER_MISSING)); - } - if(!is_array($parameter)){ - return Response::respond(true, ((object)ErrorMessages::$CREATE_CUSTOM_METADATA_PARAMETER_NON_ARRAY)); - } - if(sizeof($parameter)==0){ - return Response::respond(true, ((object)ErrorMessages::$CREATE_CUSTOM_METADATA_PARAMETER_EMPTY_ARRAY)); - } - if (empty($parameter['name']) || empty($parameter['label']) || !isset($parameter['schema'])) { - return Response::respond(true, ((object)ErrorMessages::$CREATE_CUSTOM_METADATA_DATA_INVALID)); - } - if(!isset($parameter['schema']['type']) || empty($parameter['schema']['type'])){ - return Response::respond(true, ((object)ErrorMessages::$CREATE_CUSTOM_METADATA_DATA_INVALID_SCHEMA_OBJECT)); - } - - $this->httpClient->setUri(Endpoints::createCustomMetadataField()); - return Manage\CustomMetadataFields::createCustomMetadataField($parameter['name'], $parameter['label'], $parameter['schema'], $this->httpClient); - } - - /** - * Get custom metadata field using this API. - * - * @link https://docs.imagekit.io/api-reference/custom-metadata-fields-api/get-custom-metadata-field - * - * @param $includeDeleted - * @return Response - */ - public function getCustomMetadataFields($includeDeleted=false) - { - if(!is_bool($includeDeleted)){ - return Response::respond(true, ((object)ErrorMessages::$GET_CUSTOM_METADATA_INVALID_PARAMETER)); - } - $this->httpClient->setUri(Endpoints::getCustomMetadataField()); - return Manage\CustomMetadataFields::getCustomMetadataField($includeDeleted, $this->httpClient); - } - - /** - * Update custom metadata field using this API. - * - * @link https://docs.imagekit.io/api-reference/custom-metadata-fields-api/update-custom-metadata-field - * - * @param $id - * @param $parameter[$name,$label,$schema] - * @return Response - */ - public function updateCustomMetadataField($id=null,$parameter=null) - { - if(!isset($id) && !isset($parameter)){ - return Response::respond(true, ((object)ErrorMessages::$UPDATE_CUSTOM_METADATA_PARAMETER_MISSING)); - } - if(!isset($id) || empty($id)){ - return Response::respond(true, ((object)ErrorMessages::$UPDATE_CUSTOM_METADATA_ID_MISSING)); - } - if(!isset($parameter)){ - return Response::respond(true, ((object)ErrorMessages::$UPDATE_CUSTOM_METADATA_BODY_MISSING)); - } - if(!is_array($parameter)){ - return Response::respond(true, ((object)ErrorMessages::$UPDATE_CUSTOM_METADATA_PARAMETER_NON_ARRAY)); - } - if(sizeof($parameter)==0){ - return Response::respond(true, ((object)ErrorMessages::$UPDATE_CUSTOM_METADATA_PARAMETER_EMPTY_ARRAY)); - } - if (empty($parameter['label']) || !isset($parameter['schema'])) { - return Response::respond(true, ((object)ErrorMessages::$UPDATE_CUSTOM_METADATA_DATA_INVALID)); - } - if(!isset($parameter['schema']['type']) || empty($parameter['schema']['type'])){ - return Response::respond(true, ((object)ErrorMessages::$UPDATE_CUSTOM_METADATA_DATA_INVALID_SCHEMA_OBJECT)); - } - - $this->httpClient->setUri(Endpoints::updateCustomMetadataField($id)); - return Manage\CustomMetadataFields::updateCustomMetadataField($parameter['label'], $parameter['schema'], $this->httpClient); - } - - /** - * Delete custom metadata field using this API. - * - * @link https://docs.imagekit.io/api-reference/custom-metadata-fields-api/delete-custom-metadata-field - * - * @param $id - * @return Response - */ - public function deleteCustomMetadataField($id=null) - { - if(!isset($id) || empty($id)){ - return Response::respond(true, ((object)ErrorMessages::$DELETE_CUSTOM_METADATA_ID_MISSING)); - } - - $this->httpClient->setUri(Endpoints::deleteCustomMetadataField($id)); - return Manage\CustomMetadataFields::deleteCustomMetadataField($this->httpClient); - } - -} diff --git a/src/ImageKit/Manage/Cache.php b/src/ImageKit/Manage/Cache.php deleted file mode 100644 index 16c4f0db..00000000 --- a/src/ImageKit/Manage/Cache.php +++ /dev/null @@ -1,89 +0,0 @@ - $urlParam - ]; - - $resource->setDatas($urlParamArray); - try { - $res = $resource->post(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } - - /** - * purgeCacheStatus File API - * - * @param $requestId - * @param GuzzleHttpWrapper $resource - * @return Response - */ - public static function purgeFileCacheStatus($requestId, GuzzleHttpWrapper $resource) - { - try { - $res = $resource->get(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } - -} diff --git a/src/ImageKit/Manage/CustomMetadataFields.php b/src/ImageKit/Manage/CustomMetadataFields.php deleted file mode 100644 index 4770fd37..00000000 --- a/src/ImageKit/Manage/CustomMetadataFields.php +++ /dev/null @@ -1,242 +0,0 @@ -get(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } - - - /** - * Get file metadata from remote URL - * - * @param $url - * @param $resource - * @return Response - */ - public static function getFileMetadataFromRemoteURL($url, $resource) - { - if (empty($url)) { - return Response::respond(true, ((object)ErrorMessages::$MISSING_URL_PARAMETER)); - } - - $resource->setDatas([ - 'url' => $url - ]); - try { - $res = $resource->get(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } - - - /** - * Create custom metadata field - * - * @param $name - * @param $label - * @param $schema - * @param $resource - * @return Response - */ - public static function createCustomMetadataField($name, $label, $schema, $resource) - { - $resource->setDatas([ - 'name' => $name, - 'label' => $label, - 'schema' => $schema - ]); - try { - $res = $resource->post(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } - - /** - * Get custom metadata field - * - * @param $includeDeleted - * @param $resource - * @return Response - */ - public static function getCustomMetadataField($includeDeleted, $resource) - { - $resource->setDatas([ - 'includeDeleted' => $includeDeleted - ]); - - try { - $res = $resource->get(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, $content); - } - - return Response::respond(false, $content); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } - - /** - * Update custom metadata field - * - * @param $label - * @param $schema - * @param $resource - * @return Response - */ - public static function updateCustomMetadataField($label, $schema, $resource) - { - $resource->setDatas([ - 'label' => $label, - 'schema' => $schema - ]); - try { - $res = $resource->patch(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } - - /** - * Update custom metadata field - * - * @param $resource - * @return Response - */ - public static function deleteCustomMetadataField($resource) - { - try { - $res = $resource->delete(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } -} diff --git a/src/ImageKit/Manage/File.php b/src/ImageKit/Manage/File.php deleted file mode 100644 index 4995837d..00000000 --- a/src/ImageKit/Manage/File.php +++ /dev/null @@ -1,592 +0,0 @@ -setDatas($parameters); - } - try { - $res = $resource->get(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - - - } - - /** - * Get Details Of file - * - * @param string $fileId - * @param GuzzleHttpWrapper $resource - * - * @return Response - */ - public static function getDetails($fileId, GuzzleHttpWrapper $resource) - { - try { - $res = $resource->get(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } - - /** - * Get Version Details Of file - * - * @param string $fileId - * @param string $versionId - * @param GuzzleHttpWrapper $resource - * - * @return Response - */ - public static function getVersionDetails($fileId, $versionId, GuzzleHttpWrapper $resource) - { - try { - $res = $resource->get(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } - - /** - * Get All Versions Of file - * - * @param string $fileId - * @param GuzzleHttpWrapper $resource - * - * @return Response - */ - public static function getFileVersions($fileId, GuzzleHttpWrapper $resource) - { - try { - $res = $resource->get(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } - - - /** - * Delete File API - * - * @param $fileId - * @param GuzzleHttpWrapper $resource - * - * @return Response - */ - public static function delete($fileId, GuzzleHttpWrapper $resource) - { - - $resource->setDatas((array)$fileId); - try { - $res = $resource->delete(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } - - - /** - * Delete File Version API - * - * @param $fileId - * @param $versionId - * @param GuzzleHttpWrapper $resource - * - * @return Response - */ - public static function deleteVersion($fileId, $versionId, GuzzleHttpWrapper $resource) - { - $resource->setDatas([$fileId,$versionId]); - try { - $res = $resource->delete(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } - - /** - * Delete Bulk Files by File ID API - * - * @param $fileIds - * @param GuzzleHttpWrapper $resource - * - * @return Response - */ - public static function bulkDeleteByFileIds($fileIds, GuzzleHttpWrapper $resource) - { - $resource->setDatas(['fileIds' => $fileIds]); - - try { - $res = $resource->post(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } - - - /** - * Copy File API - * - * @param $sourceFilePath - * @param $destinationPath - * @param $includeVersions - * @param GuzzleHttpWrapper $resource - * - * @return Response - */ - public static function copy($sourceFilePath, $destinationPath, $includeFileVersions, GuzzleHttpWrapper $resource) - { - $resource->setDatas(['sourceFilePath' => $sourceFilePath, 'destinationPath' => $destinationPath, 'includeFileVersions' => $includeFileVersions]); - try { - $res = $resource->post(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } - - /** - * Move File API - * - * @param $sourceFilePath - * @param $destinationPath - * @param GuzzleHttpWrapper $resource - * - * @return Response - */ - public static function move($sourceFilePath, $destinationPath, GuzzleHttpWrapper $resource) - { - $resource->setDatas(['sourceFilePath' => $sourceFilePath, 'destinationPath' => $destinationPath]); - try { - $res = $resource->post(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } - - - /** - * Rename File API - * - * @param $filePath - * @param $newFileName - * @param $purgeCache - * @param GuzzleHttpWrapper $resource - * - * @return Response - */ - public static function rename($filePath, $newFileName, $purgeCache, GuzzleHttpWrapper $resource) - { - $resource->setDatas(['filePath' => $filePath, 'newFileName' => $newFileName, 'purgeCache' => $purgeCache]); - try { - $res = $resource->put(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } - - - /** - * Restore File Version API - * - * @param GuzzleHttpWrapper $resource - * - * @return Response - */ - public static function restoreVersion(GuzzleHttpWrapper $resource) - { - try { - $res = $resource->put(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } - - - /** - * Bulk Add Tags - * - * @param array $fileIds - * @param array $tags - * @param GuzzleHttpWrapper $resource - * - * @return Response - */ - public static function bulkAddTags($fileIds, $tags, GuzzleHttpWrapper $resource) - { - - $resource->setDatas(['fileIds' => $fileIds, 'tags' => $tags]); - try { - $res = $resource->post(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } - - /** - * Bulk Remove Tags - * - * @param array $fileIds - * @param array $tags - * @param GuzzleHttpWrapper $resource - * - * @return Response - */ - public static function bulkRemoveTags(array $fileIds, array $tags, GuzzleHttpWrapper $resource) - { - - - if (!is_array($fileIds) || empty($fileIds) || !is_array($tags) || empty($tags)) { - return Response::respond(true, ((object)ErrorMessages::$BULK_TAGS_DATA_MISSING)); - } - - $resource->setDatas(['fileIds' => $fileIds, 'tags' => $tags]); - try { - $res = $resource->post(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } - - - /** - * Bulk Remove AI Tags - * - * @param array $fileIds - * @param array $AITags - * @param GuzzleHttpWrapper $resource - * - * @return Response - */ - public static function bulkRemoveAITags(array $fileIds, array $AITags, GuzzleHttpWrapper $resource) - { - $resource->setDatas(['fileIds' => $fileIds, 'AITags' => $AITags]); - try { - $res = $resource->post(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } - - - /** - * Update File Details - * - * @param $fileId - * @param $updateData - * @param GuzzleHttpWrapper $resource - * - * @return Response - */ - public static function updateDetails($fileId, $updateData, GuzzleHttpWrapper $resource) - { - $obj = (object)$updateData; - - if (isset($obj->tags) && ($obj->tags !== null) && ($obj->tags !== 'undefined') && !is_array($obj->tags)) { - return Response::respond(true, ((object)ErrorMessages::$UPDATE_DATA_TAGS_INVALID)); - } - - if (isset($obj->customCoordinates) && ($obj->customCoordinates !== 'undefined') && is_array($obj->customCoordinates)) { - return Response::respond(true, ((object)ErrorMessages::$UPDATE_DATA_COORDS_INVALID)); - } - - $resource->setDatas($updateData); - try { - $res = $resource->patch(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } -} diff --git a/src/ImageKit/Manage/Folder.php b/src/ImageKit/Manage/Folder.php deleted file mode 100644 index da840a81..00000000 --- a/src/ImageKit/Manage/Folder.php +++ /dev/null @@ -1,157 +0,0 @@ -setDatas(['parentFolderPath' => $parentFolderPath, 'folderName' => $folderName]); - try { - $res = $httpClient->post(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } - - /** - * @param $folderPath - * @param GuzzleHttpWrapper $httpClient - * - * @return Response - */ - public static function delete($folderPath, GuzzleHttpWrapper $httpClient) - { - if (empty($folderPath)) { - return Response::respond(true, ((object)ErrorMessages::$MISSING_DELETE_FOLDER_OPTIONS)); - } - - $httpClient->setDatas(['folderPath' => $folderPath]); - try { - $res = $httpClient->delete(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } - - /** - * @param $sourceFolderPath - * @param $destinationPath - * @param $includeVersions - * @param GuzzleHttpWrapper $httpClient - * - * @return Response - */ - public static function copy($sourceFolderPath, $destinationPath, $includeFileVersions, GuzzleHttpWrapper $httpClient) - { - $httpClient->setDatas(['sourceFolderPath' => $sourceFolderPath, 'destinationPath' => $destinationPath, 'includeFileVersions' => $includeFileVersions]); - try { - $res = $httpClient->post(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } - - /** - * @param $sourceFolderPath - * @param $destinationPath - * @param GuzzleHttpWrapper $httpClient - * - * @return Response - */ - public static function move($sourceFolderPath, $destinationPath, GuzzleHttpWrapper $httpClient) - { - $httpClient->setDatas(['sourceFolderPath' => $sourceFolderPath, 'destinationPath' => $destinationPath]); - try { - $res = $httpClient->post(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - } -} diff --git a/src/ImageKit/Phash/Phash.php b/src/ImageKit/Phash/Phash.php deleted file mode 100644 index 64052895..00000000 --- a/src/ImageKit/Phash/Phash.php +++ /dev/null @@ -1,52 +0,0 @@ -client = $client; - $this->serviceId = self::gen_uuid(); - } - - - - /** - * @return string - */ - public static function gen_uuid() - { - return sprintf( - '%04x%04x-%04x-%04x-%04x-%04x%04x%04x', - // 32 bits for "time_low" - mt_rand(0, 0xffff), - mt_rand(0, 0xffff), - - // 16 bits for "time_mid" - mt_rand(0, 0xffff), - - // 16 bits for "time_hi_and_version", - // four most significant bits holds version number 4 - mt_rand(0, 0x0fff) | 0x4000, - - // 16 bits, 8 bits for "clk_seq_hi_res", - // 8 bits for "clk_seq_low", - // two most significant bits holds zero and one for variant DCE1.1 - mt_rand(0, 0x3fff) | 0x8000, - - // 48 bits for "node" - mt_rand(0, 0xffff), - mt_rand(0, 0xffff), - mt_rand(0, 0xffff) - ); - } - - /** - * @return array - */ - public function getDatas() - { - return $this->datas; - } - - /** - * @param array $datas - * @return void - */ - public function setDatas(array $datas) - { - $this->datas = array_filter($datas, function ($var) { - if ($var === '' || $var === null || is_array($var) && count($var) === 0) { - return false; - } - - return true; - }); - } - /** - * @param array $headers - * @return void - */ - public function setHeaders(array $headers) - { - $this->headers = $headers; - } - /** - * @return Response - */ - public function get() - { - try { - return $this->client->request('GET', $this->getUri(), $this->getOptions('query')); - } catch (RequestException $e) { - return $this->handleRequestException($e); - } catch (Exception $e) { - return $this->handleException($e); - } - } - - /** - * @return mixed - */ - protected function getUri() - { - return $this->uri; - } - - - /** - * @param $uri - */ - public function setUri($uri) - { - $this->uri = $uri; - } - - /** - * @param $dataType - * @return array - */ - protected function getOptions($dataType) - { - return [ - $dataType => $this->datas, - 'headers' => $this->headers, - ]; - } - - /** - * @param RequestException $e - * @return Response - */ - protected function handleRequestException(RequestException $e) - { - $status = $e->getCode(); - $headers = []; - $body = ''; - if ($e->hasResponse()) { - $body = (string)$e->getResponse()->getBody(); - $headers = $e->getResponse()->getHeaders(); - $statusCode = $e->getResponse()->getStatusCode(); - } - - return new Response($status, $headers, $body); - } - - /** - * @param Exception $e - * @return Response - */ - protected function handleException(Exception $e) - { - if(!$sock = @fsockopen('api.imagekit.io', 443)) - { - throw new Exception('Network Error'); - } - else - { - throw $e; - } - } - - /** - * @return Response - */ - public function delete() - { - try { - return $this->client->request('DELETE', $this->getUri(), $this->getOptions('json')); - } catch (RequestException $e) { - return $this->handleRequestException($e); - } catch (Exception $e) { - return $this->handleException($e); - } - } - - /** - * @return Response - */ - public function postMultipart() - { - try { - $options = [ - 'headers' => $this->headers, - 'multipart' => self::getMultipartData($this->datas) - ]; - - return $this->client->request('POST', $this->getUri(), $options); - } catch (RequestException $e) { - return $this->handleRequestException($e); - } catch (Exception $e) { - return $this->handleException($e); - } - } - - - /** - * @param $data - * @return array - */ - public static function getMultipartData($data) - { - $multipartData = []; - - foreach ($data as $key => $value) { - if (is_bool($value)) { - $data[$key] = json_encode($value); - } - } - - foreach ($data as $key => $value) { - if (!is_array($value)) { - $multipartData[] = ['name' => $key, 'contents' => $value]; - continue; - } - - foreach ($value as $multiKey => $multiValue) { - $multiName = $key . '[' . $multiKey . ']' . (is_array($multiValue) ? '[' . key($multiValue) . ']' : '') . ''; - $multipartData[] = ['name' => $multiName, 'contents' => (is_array($multiValue) ? reset($multiValue) : $multiValue)]; - } - } - - return $multipartData; - } - - /** - * @return Response - */ - public function post() - { - try { - $options = [ - 'headers' => $this->headers, - 'json' => $this->datas - ]; - - return $this->client->request('POST', $this->getUri(), $options); - } catch (RequestException $e) { - return $this->handleRequestException($e); - } catch (Exception $e) { - return $this->handleException($e); - } - } - - /** - * @return Response - */ - public function rawPost() - { - try { - $options = [ - 'body' => json_encode($this->datas), - 'headers' => ['Content-Type' => 'application/json'] - ]; - - return $this->client->request('POST', $this->getUri(), $options); - } catch (RequestException $e) { - return $this->handleRequestException($e); - } catch (Exception $e) { - return $this->handleException($e); - } - } - - /** - * @return Response - */ - public function patch() - { - try { - $options = [ - 'headers' => $this->headers, - 'json' => $this->datas - ]; - return $this->client->request('PATCH', $this->getUri(), $options); - } catch (RequestException $e) { - return $this->handleRequestException($e); - } catch (Exception $e) { - return $this->handleException($e); - } - } - - /** - * @return Response - */ - public function put() - { - try { - $options = [ - 'headers' => $this->headers, - 'json' => $this->datas - ]; - return $this->client->request('PUT', $this->getUri(), $options); - } catch (RequestException $e) { - return $this->handleRequestException($e); - } catch (Exception $e) { - return $this->handleException($e); - } - } - - -} diff --git a/src/ImageKit/Resource/HttpRequest.php b/src/ImageKit/Resource/HttpRequest.php deleted file mode 100644 index 63c72000..00000000 --- a/src/ImageKit/Resource/HttpRequest.php +++ /dev/null @@ -1,41 +0,0 @@ - isset($token) ? $token : '', - 'expire' => isset($expire) ? $expire : 0, - 'signature' => '' - ]; - - $obj = (object)($configuration); - - if (!empty($obj->privateKey) and !empty($defaultExpire)) { - - $tok = isset($token) && strlen($token) > 0 ? $token : GuzzleHttpWrapper::gen_uuid(); - $exp = isset($expire) && $expire > 0 ? $expire : $defaultExpire; - $data = $tok . $exp; - $signature = hash_hmac('sha1', $data, $obj->privateKey); - - $authParameters['token'] = $tok; - $authParameters['expire'] = $exp; - $authParameters['signature'] = $signature; - - } - - return (object)$authParameters; - - } - -} diff --git a/src/ImageKit/Upload/Upload.php b/src/ImageKit/Upload/Upload.php deleted file mode 100644 index 4f397d0b..00000000 --- a/src/ImageKit/Upload/Upload.php +++ /dev/null @@ -1,87 +0,0 @@ -file; - $fileName = $opts->fileName; - - $payload = []; - if (isset($opts->options) && is_array($opts->options)) { - $payload = $opts->options; - } - else{ - $payload = (array)$opts; - } - $payload['file'] = $file; - $payload['fileName'] = $fileName; - - if (isset($payload['tags']) && is_array($payload['tags'])) { - $payload['tags'] = implode(',', $payload['tags']); - } - - if (isset($payload['customCoordinates']) && is_array($payload['customCoordinates'])) { - $payload['customCoordinates'] = implode(',', $payload['customCoordinates']); - } - - if (isset($payload['responseFields']) && is_array($payload['responseFields'])) { - $payload['responseFields'] = implode(',', $payload['responseFields']); - } - - if (isset($payload['extensions']) && is_array($payload['extensions'])) { - $payload['extensions'] = json_encode($payload['extensions']); - } - - if (isset($payload['customMetadata']) && is_array($payload['customMetadata'])) { - $payload['customMetadata'] = json_encode($payload['customMetadata']); - } - - if (isset($payload['transformation'])) { - $payload['transformation'] = json_encode($payload['transformation']); - } - - $resource->setDatas((array)$payload); - try { - $res = $resource->postMultipart(); - } catch (\Throwable $th) { - return Response::respond(true, $th->getMessage()); - } - if($res && $res->getBody() && $res->getHeaders() && $res->getStatusCode()){ - $stream = $res->getBody(); - $content = []; - $content['body'] = json_decode($stream->getContents()); - $headers = $res->getHeaders(); - $content['headers'] = $headers; - $content['statusCode'] = (int)$res->getStatusCode(); - - if ($res->getStatusCode() && ($res->getStatusCode() < 200 || $res->getStatusCode() > 300)) { - return Response::respond(true, ($content)); - } - - return Response::respond(false, ($content)); - } - else{ - $errorObject = (object) ErrorMessages::$INVALID_REQUEST; - return Response::respond(true, $errorObject->message); - } - - - } -} diff --git a/src/ImageKit/Url/Url.php b/src/ImageKit/Url/Url.php deleted file mode 100644 index 4bc8a70a..00000000 --- a/src/ImageKit/Url/Url.php +++ /dev/null @@ -1,420 +0,0 @@ -removeTrailingSlash($obj->urlEndpoint); - $transformation = null; - $signed = false; - $expireSeconds = null; - - if (isset($obj->signed)) { - $signed = $obj->signed; - } - - if (isset($obj->expireSeconds)) { - $expireSeconds = $obj->expireSeconds; - } - - if (isset($obj->path)) { - $path = ltrim($obj->path, '/'); - $path = $this->addLeadingSlash($path); - } - - if (isset($obj->src)) { - $src = $obj->src; - } - - if (isset($obj->transformation)) { - $transformation = $obj->transformation; - } - - if ($path == null && $src == null) { - return ''; - } - - // Create Correct query parameter - $parsedHost = ''; - - if (!empty($path)) { - $parsedURL = [parse_url($path)]; - $parsedHost = [parse_url($urlEndpoint)]; - $isSrcParameterUsedForURL = false; - } else { - $parsedURL = [parse_url($src)]; - $isSrcParameterUsedForURL = true; - } - - //Initial URL Construction Object - $urlArray = [ - 'host' => '', - 'pathname' => '', - 'search' => [], - 'queryParameters' => [], - ]; - $urlObject = (object)($urlArray); - if (!empty($path)) { - $urlObject->scheme = $parsedHost[0]['scheme']; - $urlObject->host = $parsedHost[0]['host']; - if (isset($parsedHost[0]['path'])) { - $urlObject->pathname = $parsedHost[0]['path']; - } - } else { - $urlObject->scheme = $parsedURL[0]['scheme']; - $urlObject->host = $parsedURL[0]['host']; - $urlObject->pathname = $parsedURL[0]['path']; - } - if (isset($parsedURL[0]['query'])) { - parse_str($parsedURL[0]['query'], $urlObject->search); - } - if(isset($obj->transformationPosition)){ - if($obj->transformationPosition=='query'){ - if (isset($obj->queryParameters)) { - $urlObject->search = array_merge($urlObject->search, $obj->queryParameters); - } - } - else if($obj->transformationPosition=='path'){ - if (isset($obj->queryParameters)) { - $urlObject->queryParameters = $obj->queryParameters; - } - } - else{ - throw new \InvalidArgumentException(ErrorMessages::$URL_GENERATION_TRANSFORMATION_QUERY_INVALID['message']); - } - - } - else{ - if (isset($obj->queryParameters)) { - $urlObject->queryParameters = $obj->queryParameters; - } - } - - - ksort($urlObject->search); - - // Create Transformation String - $transformationString = $this->constructTransformationString($transformation); - if ($transformationString) { - if (Transformation::addAsQueryParameter($urlOptions) || $isSrcParameterUsedForURL) { - $transformationQueryParam = [self::TRANSFORMATION_PARAMETER => $transformationString]; - $urlObject->search = array_merge($transformationQueryParam, $urlObject->search); - } else { - $originalPath = $this->removeTrailingSlash($urlObject->pathname); - $transformationQuery = self::TRANSFORMATION_PARAMETER; - $transformationQuery .= Transformation::getChainTransformDelimiter(); - $transformationQuery .= $transformationString; - if (!$this->startsWithSlash($originalPath)) { - $urlObject->pathname .= '/'; - } - $urlObject->pathname = $originalPath; - $urlObject->pathname .= '/'; - $urlObject->pathname .= $transformationQuery; - } - } - $urlObject->pathname .= $this->addLeadingSlash($path); - $urlObject->host = $this->removeTrailingSlash($urlObject->host); - $urlObject->pathname = $this->addLeadingSlash($urlObject->pathname); - - // Build Search Params here - $urlObject->search = urldecode(http_build_query($urlObject->search)); - - // Build queryParameters here - $urlObject->queryParameters = urldecode(http_build_query($urlObject->queryParameters)); - - // transformationPosition - $urlObject->transformationPosition = $obj->transformationPosition; - // Signature String and Timestamp - // We can do this only for URLs that are created using urlEndpoint and path parameter - // because we need to know the endpoint to be able to remove it from the URL to create a signature - // for the remaining. With the src parameter, we would not know the "pattern" in the URL - if ($signed === true) { - $expiryTimestamp = $this->getSignatureTimestamp($expireSeconds); - $myArray = json_decode(json_encode($urlObject), true); - $intermediateURL = $this->unparsed_url($myArray); - $urlSignatureArray = [ - 'privateKey' => $urlOptions['privateKey'], - 'url' => $intermediateURL, - 'urlEndpoint' => $urlOptions['urlEndpoint'], - 'expiryTimestamp' => $expiryTimestamp, - ]; - - $urlSignature = $this->getSignature($urlSignatureArray); - if ($expiryTimestamp && $expiryTimestamp != self::DEFAULT_TIMESTAMP) { - $timestampParameter = [ - self::TIMESTAMP_PARAMETER => $expiryTimestamp - ]; - $timestampParameterString = http_build_query($timestampParameter); - $urlObject->timestampParameterString = $timestampParameterString; - } - $signatureParameter = [ - self::SIGNATURE_PARAMETER => $urlSignature - ]; - $signatureParameterString = http_build_query($signatureParameter); - - $urlObject->signatureParameterString = $signatureParameterString; - } - $urlObjectArray = json_decode(json_encode($urlObject), true); - - return $this->unparsed_url($urlObjectArray); - } - - /** - * @param $str - * @return false|mixed|string - */ - private function removeTrailingSlash($str) - { - if (is_string($str) and strlen($str) > 0 and substr($str, -1) == '/') { - $str = substr($str, 0, -1); - } - return $str; - } - - /** - * @param $str - * @return mixed|string - */ - private function addLeadingSlash($str) - { - if (is_string($str) and strlen($str) > 0 and $str[0] != '/') { - $str = '/' . $str; - } - return $str; - } - - /** - * @param $transformation - * @return string - */ - private function constructTransformationString($transformation) - { - if (!is_array($transformation)) { - return ''; - } - $parsedTransforms = []; - for ($i = 0; $i < count($transformation); $i++) { - $parsedTransformStep = []; - foreach ($transformation[$i] as $key => $value) { - if($key=='raw'){ - array_push($parsedTransformStep, $value); - } - else if($key!=''){ - $transform_block = $this->buildingTransformationBlocks($key,$value); - array_push($parsedTransformStep, $transform_block); - } - - } - $delimiter = Transformation::getTransformDelimiter(); - $List = implode($delimiter, $parsedTransformStep); - array_push($parsedTransforms, $List); - } - $setChainDelimiter = Transformation::getChainTransformDelimiter(); - return implode($setChainDelimiter, $parsedTransforms); - } - - /** - * @param $key - * @param $value - * @return array - */ - private function buildingTransformationBlocks($key, $value){ - if (is_bool($value)) { - $value = $value ? 'true' : 'false'; - } - - $value = (string)$value; - $transformKey = Transformation::getTransformKey($key); - if (empty($transformKey)) { - return []; - } - if ((empty($value) && $value !== '0') || $value === '-') { - return $transformKey; - } else { - $transformationUtils = Transformation::getTransformKeyValueDelimiter(); - $finalTransformation = $transformKey . $transformationUtils; - if (strpos($value, '/') !== false) { - $finalTransformation .= str_replace('/', '@@', rtrim(ltrim($value, '/'), '/')); - } else { - $finalTransformation .= $value; - } - - return $finalTransformation; - } - } - - /** - * @param $string - * @return bool - */ - private function startsWithSlash($string) - { - $len = strlen('/'); - return (substr($string, 0, $len) === '/'); - } - - /** - * @param $expireSeconds - * @return string - */ - private function getSignatureTimestamp($expireSeconds) - { - if (empty($expireSeconds)) { - return self::DEFAULT_TIMESTAMP; - } - $sec = intval($expireSeconds); - if (empty($sec)) { - return self::DEFAULT_TIMESTAMP; - } - $currentTimestamp = time(); - return (string)($currentTimestamp + $sec); - } - - /** - * @param array $parsed - * @return string - */ - public function unparsed_url(array $parsed) - { - - $get = function ($key) use ($parsed) { - return isset($parsed[$key]) ? $parsed[$key] : null; - }; - $scheme = $get('scheme'); - $host = $get('host'); - - $pathname = $get('pathname'); - $last_slash_index = strripos($pathname,'/'); - $file_name = substr($pathname,$last_slash_index+1); - $pathname = str_replace('/'.$file_name,'',$pathname); - $pathname = $pathname.'/'; - $search = $get('search'); - $queryParameters = $get('queryParameters'); - $transformationPosition = $get('transformationPosition'); - - $signatureParameterString = $get('signatureParameterString'); - - $timestampParameterString = $get('timestampParameterString'); - - if($transformationPosition=='query'){ - return (strlen($scheme) > 0 ? "$scheme:" : '') . - (strlen($host) > 0 ? "//$host" : '') . - (strlen($pathname) > 0 ? "$pathname" : '') . - $file_name . - (strlen($search) > 0 ? '?' .$search : '') . - (strlen($timestampParameterString) > 0 ? ((strlen($search)?'&':'?') . $timestampParameterString): '') . - (strlen($signatureParameterString) > 0 ? ('&' . $signatureParameterString): ''); - } - else{ - - return (strlen($scheme) > 0 ? "$scheme:" : '') . - (strlen($host) > 0 ? "//$host" : '') . - (strlen($pathname) > 0 ? "$pathname" : '') . - (strlen($search) > 0 ? str_replace('=',':',$search).'/' : '') . - $file_name . - (strlen($queryParameters) > 0 ? ( '?' . $queryParameters): '') . - ((!empty($timestampParameterString) && strlen($timestampParameterString) > 0) ? (((!empty($queryParameters) && strlen($queryParameters)>0)?'&':'?') . $timestampParameterString): '') . - ((!empty($signatureParameterString) && strlen($signatureParameterString) > 0) ? (((!empty($queryParameters) && strlen($queryParameters)>0)?'&': - ((!empty($timestampParameterString) && strlen($timestampParameterString) > 0)?'&':'?') - ) . $signatureParameterString): ''); - - } - } - - /** - * @param $options - * @return false|string - */ - public function getSignature($options) - { - if (empty($options['privateKey']) or empty($options['url']) or empty($options['urlEndpoint'])) { - return ''; - } else { - $data = (str_replace($this->addTrailingSlash($options['urlEndpoint']), '', $options['url']) . $options['expiryTimestamp']); - $data = $this->encodeStringIfRequired($data); - return hash_hmac('sha1', $data, $options['privateKey']); - } - } - - /** - * @param $str - * @return string - */ - private function addTrailingSlash($str) - { - if (is_string($str) and strlen($str) > 0 and substr($str, -1) != '/') { - $str = $str . '/'; - } - return $str; - } - - // Used to check if special char is present in string (you'll need to encode it to utf-8 if it does) - private function hasMoreThanAscii($str) - { - $chars = str_split($str); - foreach ($chars as $char) { - if (ord($char) > 127) { - return true; - } - } - return false; - } - - function encodeURI($str) - { - // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/encodeURI - $encoded_str = rawurlencode($str); - $encoded_str = - str_replace( - array('%21', '%2A', '%27', '%28', '%29', '%3B', '%2F', '%3F', '%3A', '%40', '%26', '%3D', '%2B', '%24', '%2C', '%23'), - array('!', '*', "'", '(', ')', ';', '/', '?', ':', '@', '&', '=', '+', '$', ',', '#'), - $encoded_str - ); - return $encoded_str; - } - - function custom_encodeURIComponent($url_str) { - $parsed_url = parse_url($url_str); - $encoded_url = ""; - if (isset($parsed_url['query'])) { - $encoded_url .= $this->encodeURI(explode("?", $url_str)[0]).'?' . $this->encodeURI($parsed_url['query']); - } - else - $encoded_url = $this->encodeURI($url_str); - return $encoded_url; - } - - /** - * @param $str - * @return string - */ - public function encodeStringIfRequired($str) - { - return $this->hasMoreThanAscii($str) ? $this->custom_encodeURIComponent($str) : $str; - } -} \ No newline at end of file diff --git a/src/ImageKit/Utils/Authorization.php b/src/ImageKit/Utils/Authorization.php deleted file mode 100644 index e3cfe832..00000000 --- a/src/ImageKit/Utils/Authorization.php +++ /dev/null @@ -1,26 +0,0 @@ - [ - $configuration->privateKey, '' - ], - 'handler'=>$handlerStack - ]; - } -} - diff --git a/src/ImageKit/Utils/Response.php b/src/ImageKit/Utils/Response.php deleted file mode 100644 index 1ecb73db..00000000 --- a/src/ImageKit/Utils/Response.php +++ /dev/null @@ -1,71 +0,0 @@ -null, - 'raw'=>null, - 'statusCode'=>null - ]; - - /** - * @param $isError - * @param $response - * @return Response - */ - public static function respond($isError, $response) - { - $responseObject = new Response(); - if($response && is_array($response)){ - if ($isError) { - $responseObject->error = $response['body']; - } else { - $responseObject->result = $response['body']; - } - $headers = []; - foreach ($response['headers'] as $key => $value) { - if(is_array($value)){ - $headers[$key] = implode(',',$value); - } - else{ - $headers[$key] = $value; - } - } - - $responseObject->responseMetadata['headers'] = $headers; - $responseObject->responseMetadata['raw'] = $response['body']; - $responseObject->responseMetadata['statusCode'] = $response['statusCode']; - - } - else{ - $responseObject->error = $response; - $responseObject->responseMetadata = null; - } - - return $responseObject; - } -} diff --git a/src/ImageKit/Utils/Transformation.php b/src/ImageKit/Utils/Transformation.php deleted file mode 100644 index 3d6a6c3e..00000000 --- a/src/ImageKit/Utils/Transformation.php +++ /dev/null @@ -1,72 +0,0 @@ -transformationPosition)) { - return $optionsObject->transformationPosition === self::QUERY_TRANSFORMATION_POSITION; - } - return false; - } - -} diff --git a/src/ImageOverlay.php b/src/ImageOverlay.php new file mode 100644 index 00000000..ead19e1b --- /dev/null +++ b/src/ImageOverlay.php @@ -0,0 +1,136 @@ +|null, + * } + */ +final class ImageOverlay implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + #[Api] + public string $type = 'image'; + + /** + * Specifies the relative path to the image used as an overlay. + */ + #[Api] + public string $input; + + /** + * The input path can be included in the layer as either `i-{input}` or `ie-{base64_encoded_input}`. + * By default, the SDK determines the appropriate format automatically. + * To always use base64 encoding (`ie-{base64}`), set this parameter to `base64`. + * To always use plain text (`i-{input}`), set it to `plain`. + * + * @var Encoding::*|null $encoding + */ + #[Api(enum: Encoding::class, optional: true)] + public ?string $encoding; + + /** + * Array of transformations to be applied to the overlay image. Supported transformations depends on the base/parent asset. + * See overlays on [Images](https://imagekit.io/docs/add-overlays-on-images#list-of-supported-image-transformations-in-image-layers) and [Videos](https://imagekit.io/docs/add-overlays-on-videos#list-of-transformations-supported-on-image-overlay). + * + * @var list|null $transformation + */ + #[Api(list: Transformation::class, optional: true)] + public ?array $transformation; + + /** + * `new ImageOverlay()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * ImageOverlay::with(input: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new ImageOverlay)->withInput(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Encoding::* $encoding + * @param list $transformation + */ + public static function with( + string $input, + ?string $encoding = null, + ?array $transformation = null + ): self { + $obj = new self; + + $obj->input = $input; + + null !== $encoding && $obj->encoding = $encoding; + null !== $transformation && $obj->transformation = $transformation; + + return $obj; + } + + /** + * Specifies the relative path to the image used as an overlay. + */ + public function withInput(string $input): self + { + $obj = clone $this; + $obj->input = $input; + + return $obj; + } + + /** + * The input path can be included in the layer as either `i-{input}` or `ie-{base64_encoded_input}`. + * By default, the SDK determines the appropriate format automatically. + * To always use base64 encoding (`ie-{base64}`), set this parameter to `base64`. + * To always use plain text (`i-{input}`), set it to `plain`. + * + * @param Encoding::* $encoding + */ + public function withEncoding(string $encoding): self + { + $obj = clone $this; + $obj->encoding = $encoding; + + return $obj; + } + + /** + * Array of transformations to be applied to the overlay image. Supported transformations depends on the base/parent asset. + * See overlays on [Images](https://imagekit.io/docs/add-overlays-on-images#list-of-supported-image-transformations-in-image-layers) and [Videos](https://imagekit.io/docs/add-overlays-on-videos#list-of-transformations-supported-on-image-overlay). + * + * @param list $transformation + */ + public function withTransformation(array $transformation): self + { + $obj = clone $this; + $obj->transformation = $transformation; + + return $obj; + } +} diff --git a/src/ImageOverlay/Encoding.php b/src/ImageOverlay/Encoding.php new file mode 100644 index 00000000..aad5a95d --- /dev/null +++ b/src/ImageOverlay/Encoding.php @@ -0,0 +1,25 @@ +|array + */ + public static function variants(): array + { + return [ + 'text' => TextOverlay::class, + 'image' => ImageOverlay::class, + 'video' => VideoOverlay::class, + 'subtitle' => SubtitleOverlay::class, + 'solidColor' => SolidColorOverlay::class, + ]; + } +} diff --git a/src/OverlayPosition.php b/src/OverlayPosition.php new file mode 100644 index 00000000..41a18ad9 --- /dev/null +++ b/src/OverlayPosition.php @@ -0,0 +1,116 @@ + */ + use SdkModel; + + /** + * Specifies the position of the overlay relative to the parent image or video. + * Maps to `lfo` in the URL. + * + * @var Focus::*|null $focus + */ + #[Api(enum: Focus::class, optional: true)] + public ?string $focus; + + /** + * Specifies the x-coordinate of the top-left corner of the base asset where the overlay's top-left corner will be positioned. + * It also accepts arithmetic expressions such as `bw_mul_0.4` or `bw_sub_cw`. + * Maps to `lx` in the URL. + * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + */ + #[Api(optional: true)] + public float|string|null $x; + + /** + * Specifies the y-coordinate of the top-left corner of the base asset where the overlay's top-left corner will be positioned. + * It also accepts arithmetic expressions such as `bh_mul_0.4` or `bh_sub_ch`. + * Maps to `ly` in the URL. + * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + */ + #[Api(optional: true)] + public float|string|null $y; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Focus::* $focus + */ + public static function with( + ?string $focus = null, + float|string|null $x = null, + float|string|null $y = null + ): self { + $obj = new self; + + null !== $focus && $obj->focus = $focus; + null !== $x && $obj->x = $x; + null !== $y && $obj->y = $y; + + return $obj; + } + + /** + * Specifies the position of the overlay relative to the parent image or video. + * Maps to `lfo` in the URL. + * + * @param Focus::* $focus + */ + public function withFocus(string $focus): self + { + $obj = clone $this; + $obj->focus = $focus; + + return $obj; + } + + /** + * Specifies the x-coordinate of the top-left corner of the base asset where the overlay's top-left corner will be positioned. + * It also accepts arithmetic expressions such as `bw_mul_0.4` or `bw_sub_cw`. + * Maps to `lx` in the URL. + * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + */ + public function withX(float|string $x): self + { + $obj = clone $this; + $obj->x = $x; + + return $obj; + } + + /** + * Specifies the y-coordinate of the top-left corner of the base asset where the overlay's top-left corner will be positioned. + * It also accepts arithmetic expressions such as `bh_mul_0.4` or `bh_sub_ch`. + * Maps to `ly` in the URL. + * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + */ + public function withY(float|string $y): self + { + $obj = clone $this; + $obj->y = $y; + + return $obj; + } +} diff --git a/src/OverlayPosition/Focus.php b/src/OverlayPosition/Focus.php new file mode 100644 index 00000000..120f5ce8 --- /dev/null +++ b/src/OverlayPosition/Focus.php @@ -0,0 +1,35 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/OverlayPosition/Y.php b/src/OverlayPosition/Y.php new file mode 100644 index 00000000..b5af671a --- /dev/null +++ b/src/OverlayPosition/Y.php @@ -0,0 +1,29 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/OverlayTiming.php b/src/OverlayTiming.php new file mode 100644 index 00000000..f7498c10 --- /dev/null +++ b/src/OverlayTiming.php @@ -0,0 +1,117 @@ + */ + use SdkModel; + + /** + * Specifies the duration (in seconds) during which the overlay should appear on the base video. + * Accepts a positive number up to two decimal places (e.g., `20` or `20.50`) and arithmetic expressions such as `bdu_mul_0.4` or `bdu_sub_idu`. + * Applies only if the base asset is a video. + * Maps to `ldu` in the URL. + */ + #[Api(optional: true)] + public float|string|null $duration; + + /** + * Specifies the end time (in seconds) for when the overlay should disappear from the base video. + * If both end and duration are provided, duration is ignored. + * Accepts a positive number up to two decimal places (e.g., `20` or `20.50`) and arithmetic expressions such as `bdu_mul_0.4` or `bdu_sub_idu`. + * Applies only if the base asset is a video. + * Maps to `leo` in the URL. + */ + #[Api(optional: true)] + public float|string|null $end; + + /** + * Specifies the start time (in seconds) for when the overlay should appear on the base video. + * Accepts a positive number up to two decimal places (e.g., `20` or `20.50`) and arithmetic expressions such as `bdu_mul_0.4` or `bdu_sub_idu`. + * Applies only if the base asset is a video. + * Maps to `lso` in the URL. + */ + #[Api(optional: true)] + public float|string|null $start; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + float|string|null $duration = null, + float|string|null $end = null, + float|string|null $start = null, + ): self { + $obj = new self; + + null !== $duration && $obj->duration = $duration; + null !== $end && $obj->end = $end; + null !== $start && $obj->start = $start; + + return $obj; + } + + /** + * Specifies the duration (in seconds) during which the overlay should appear on the base video. + * Accepts a positive number up to two decimal places (e.g., `20` or `20.50`) and arithmetic expressions such as `bdu_mul_0.4` or `bdu_sub_idu`. + * Applies only if the base asset is a video. + * Maps to `ldu` in the URL. + */ + public function withDuration(float|string $duration): self + { + $obj = clone $this; + $obj->duration = $duration; + + return $obj; + } + + /** + * Specifies the end time (in seconds) for when the overlay should disappear from the base video. + * If both end and duration are provided, duration is ignored. + * Accepts a positive number up to two decimal places (e.g., `20` or `20.50`) and arithmetic expressions such as `bdu_mul_0.4` or `bdu_sub_idu`. + * Applies only if the base asset is a video. + * Maps to `leo` in the URL. + */ + public function withEnd(float|string $end): self + { + $obj = clone $this; + $obj->end = $end; + + return $obj; + } + + /** + * Specifies the start time (in seconds) for when the overlay should appear on the base video. + * Accepts a positive number up to two decimal places (e.g., `20` or `20.50`) and arithmetic expressions such as `bdu_mul_0.4` or `bdu_sub_idu`. + * Applies only if the base asset is a video. + * Maps to `lso` in the URL. + */ + public function withStart(float|string $start): self + { + $obj = clone $this; + $obj->start = $start; + + return $obj; + } +} diff --git a/src/OverlayTiming/Duration.php b/src/OverlayTiming/Duration.php new file mode 100644 index 00000000..64ae7c3e --- /dev/null +++ b/src/OverlayTiming/Duration.php @@ -0,0 +1,29 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/OverlayTiming/End.php b/src/OverlayTiming/End.php new file mode 100644 index 00000000..afc953c5 --- /dev/null +++ b/src/OverlayTiming/End.php @@ -0,0 +1,30 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/OverlayTiming/Start.php b/src/OverlayTiming/Start.php new file mode 100644 index 00000000..28b73db9 --- /dev/null +++ b/src/OverlayTiming/Start.php @@ -0,0 +1,29 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/RequestOptions.php b/src/RequestOptions.php new file mode 100644 index 00000000..0881a16a --- /dev/null +++ b/src/RequestOptions.php @@ -0,0 +1,219 @@ +>|null, + * extraQueryParams?: array|null, + * extraBodyParams?: mixed, + * transporter?: ClientInterface|null, + * uriFactory?: UriFactoryInterface|null, + * streamFactory?: StreamFactoryInterface|null, + * requestFactory?: RequestFactoryInterface|null, + * } + * @phpstan-type request_opts = null|RequestOptions|request_options + */ +final class RequestOptions implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + #[Property] + public float $timeout = 60; + + #[Property] + public int $maxRetries = 2; + + #[Property] + public float $initialRetryDelay = 0.5; + + #[Property] + public float $maxRetryDelay = 8.0; + + /** @var array|null>|null $extraHeaders */ + #[Property(optional: true)] + public ?array $extraHeaders; + + /** @var array|null $extraQueryParams */ + #[Property(optional: true)] + public ?array $extraQueryParams; + + #[Property(optional: true)] + public mixed $extraBodyParams; + + #[Property(optional: true)] + public ?ClientInterface $transporter; + + #[Property(optional: true)] + public ?UriFactoryInterface $uriFactory; + + #[Property(optional: true)] + public ?StreamFactoryInterface $streamFactory; + + #[Property(optional: true)] + public ?RequestFactoryInterface $requestFactory; + + public function __construct() + { + $this->initialize(); + } + + /** + * @param request_opts|null $options + */ + public static function parse(RequestOptions|array|null ...$options): self + { + $parsed = array_map(static fn ($o) => $o instanceof self ? $o->toArray() : $o ?? [], array: $options); + + return self::with(...array_merge(...$parsed)); // @phpstan-ignore-line + } + + /** + * @param array|null>|null $extraHeaders + * @param array|null $extraQueryParams + * @param mixed|Omit $extraBodyParams + */ + public static function with( + ?float $timeout = null, + ?int $maxRetries = null, + ?float $initialRetryDelay = null, + ?float $maxRetryDelay = null, + ?array $extraHeaders = null, + ?array $extraQueryParams = null, + mixed $extraBodyParams = omit, + ?ClientInterface $transporter = null, + ?UriFactoryInterface $uriFactory = null, + ?StreamFactoryInterface $streamFactory = null, + ?RequestFactoryInterface $requestFactory = null, + ): self { + $obj = new self; + + null !== $timeout && $obj->timeout = $timeout; + null !== $maxRetries && $obj->maxRetries = $maxRetries; + null !== $initialRetryDelay && $obj->initialRetryDelay = $initialRetryDelay; + null !== $maxRetryDelay && $obj->maxRetryDelay = $maxRetryDelay; + null !== $extraHeaders && $obj->extraHeaders = $extraHeaders; + null !== $extraQueryParams && $obj->extraQueryParams = $extraQueryParams; + omit !== $extraBodyParams && $obj->extraBodyParams = $extraBodyParams; + null !== $transporter && $obj->transporter = $transporter; + null !== $uriFactory && $obj->uriFactory = $uriFactory; + null !== $streamFactory && $obj->streamFactory = $streamFactory; + null !== $requestFactory && $obj->requestFactory = $requestFactory; + + return $obj; + } + + public function withTimeout(float $timeout): self + { + $obj = clone $this; + $obj->timeout = $timeout; + + return $obj; + } + + public function withMaxRetries(int $maxRetries): self + { + $obj = clone $this; + $obj->maxRetries = $maxRetries; + + return $obj; + } + + public function withInitialRetryDelay(float $initialRetryDelay): self + { + $obj = clone $this; + $obj->initialRetryDelay = $initialRetryDelay; + + return $obj; + } + + public function withMaxRetryDelay(float $maxRetryDelay): self + { + $obj = clone $this; + $obj->maxRetryDelay = $maxRetryDelay; + + return $obj; + } + + /** + * @param array|null> $extraHeaders + */ + public function withExtraHeaders(array $extraHeaders): self + { + $obj = clone $this; + $obj->extraHeaders = $extraHeaders; + + return $obj; + } + + /** + * @param array $extraQueryParams + */ + public function withExtraQueryParams(array $extraQueryParams): self + { + $obj = clone $this; + $obj->extraQueryParams = $extraQueryParams; + + return $obj; + } + + public function withExtraBodyParams(mixed $extraBodyParams): self + { + $obj = clone $this; + $obj->extraBodyParams = $extraBodyParams; + + return $obj; + } + + public function withTransporter(ClientInterface $transporter): self + { + $obj = clone $this; + $obj->transporter = $transporter; + + return $obj; + } + + public function withUriFactory(UriFactoryInterface $uriFactory): self + { + $obj = clone $this; + $obj->uriFactory = $uriFactory; + + return $obj; + } + + public function withStreamFactory( + StreamFactoryInterface $streamFactory + ): self { + $obj = clone $this; + $obj->streamFactory = $streamFactory; + + return $obj; + } + + public function withRequestFactory( + RequestFactoryInterface $requestFactory + ): self { + $obj = clone $this; + $obj->requestFactory = $requestFactory; + + return $obj; + } +} diff --git a/src/SolidColorOverlay.php b/src/SolidColorOverlay.php new file mode 100644 index 00000000..95867fb4 --- /dev/null +++ b/src/SolidColorOverlay.php @@ -0,0 +1,106 @@ +|null, + * } + */ +final class SolidColorOverlay implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + #[Api] + public string $type = 'solidColor'; + + /** + * Specifies the color of the block using an RGB hex code (e.g., `FF0000`), an RGBA code (e.g., `FFAABB50`), or a color name (e.g., `red`). + * If an 8-character value is provided, the last two characters represent the opacity level (from `00` for 0.00 to `99` for 0.99). + */ + #[Api] + public string $color; + + /** + * Control width and height of the solid color overlay. Supported transformations depend on the base/parent asset. + * See overlays on [Images](https://imagekit.io/docs/add-overlays-on-images#apply-transformation-on-solid-color-overlay) and [Videos](https://imagekit.io/docs/add-overlays-on-videos#apply-transformations-on-solid-color-block-overlay). + * + * @var list|null $transformation + */ + #[Api(list: SolidColorOverlayTransformation::class, optional: true)] + public ?array $transformation; + + /** + * `new SolidColorOverlay()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SolidColorOverlay::with(color: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SolidColorOverlay)->withColor(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $transformation + */ + public static function with( + string $color, + ?array $transformation = null + ): self { + $obj = new self; + + $obj->color = $color; + + null !== $transformation && $obj->transformation = $transformation; + + return $obj; + } + + /** + * Specifies the color of the block using an RGB hex code (e.g., `FF0000`), an RGBA code (e.g., `FFAABB50`), or a color name (e.g., `red`). + * If an 8-character value is provided, the last two characters represent the opacity level (from `00` for 0.00 to `99` for 0.99). + */ + public function withColor(string $color): self + { + $obj = clone $this; + $obj->color = $color; + + return $obj; + } + + /** + * Control width and height of the solid color overlay. Supported transformations depend on the base/parent asset. + * See overlays on [Images](https://imagekit.io/docs/add-overlays-on-images#apply-transformation-on-solid-color-overlay) and [Videos](https://imagekit.io/docs/add-overlays-on-videos#apply-transformations-on-solid-color-block-overlay). + * + * @param list $transformation + */ + public function withTransformation(array $transformation): self + { + $obj = clone $this; + $obj->transformation = $transformation; + + return $obj; + } +} diff --git a/src/SolidColorOverlayTransformation.php b/src/SolidColorOverlayTransformation.php new file mode 100644 index 00000000..dccceb17 --- /dev/null +++ b/src/SolidColorOverlayTransformation.php @@ -0,0 +1,165 @@ + */ + use SdkModel; + + /** + * Specifies the transparency level of the solid color overlay. Accepts integers from `1` to `9`. + */ + #[Api(optional: true)] + public ?float $alpha; + + /** + * Specifies the background color of the solid color overlay. Accepts an RGB hex code (e.g., `FF0000`), an RGBA code (e.g., `FFAABB50`), or a color name. + */ + #[Api(optional: true)] + public ?string $background; + + /** + * Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. + * Only works if the base asset is an image. See [gradient](https://imagekit.io/docs/effects-and-enhancements#gradient---e-gradient). + */ + #[Api(optional: true)] + public bool|string|null $gradient; + + /** + * Controls the height of the solid color overlay. Accepts a numeric value or an arithmetic expression. + * Learn about [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + */ + #[Api(optional: true)] + public float|string|null $height; + + /** + * Specifies the corner radius of the solid color overlay. Set to `max` for circular or oval shape. + * See [radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). + */ + #[Api(optional: true)] + public float|string|null $radius; + + /** + * Controls the width of the solid color overlay. Accepts a numeric value or an arithmetic expression (e.g., `bw_mul_0.2` or `bh_div_2`). + * Learn about [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + */ + #[Api(optional: true)] + public float|string|null $width; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + ?float $alpha = null, + ?string $background = null, + bool|string|null $gradient = null, + float|string|null $height = null, + float|string|null $radius = null, + float|string|null $width = null, + ): self { + $obj = new self; + + null !== $alpha && $obj->alpha = $alpha; + null !== $background && $obj->background = $background; + null !== $gradient && $obj->gradient = $gradient; + null !== $height && $obj->height = $height; + null !== $radius && $obj->radius = $radius; + null !== $width && $obj->width = $width; + + return $obj; + } + + /** + * Specifies the transparency level of the solid color overlay. Accepts integers from `1` to `9`. + */ + public function withAlpha(float $alpha): self + { + $obj = clone $this; + $obj->alpha = $alpha; + + return $obj; + } + + /** + * Specifies the background color of the solid color overlay. Accepts an RGB hex code (e.g., `FF0000`), an RGBA code (e.g., `FFAABB50`), or a color name. + */ + public function withBackground(string $background): self + { + $obj = clone $this; + $obj->background = $background; + + return $obj; + } + + /** + * Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. + * Only works if the base asset is an image. See [gradient](https://imagekit.io/docs/effects-and-enhancements#gradient---e-gradient). + */ + public function withGradient(bool|string $gradient): self + { + $obj = clone $this; + $obj->gradient = $gradient; + + return $obj; + } + + /** + * Controls the height of the solid color overlay. Accepts a numeric value or an arithmetic expression. + * Learn about [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + */ + public function withHeight(float|string $height): self + { + $obj = clone $this; + $obj->height = $height; + + return $obj; + } + + /** + * Specifies the corner radius of the solid color overlay. Set to `max` for circular or oval shape. + * See [radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). + */ + public function withRadius(float|string $radius): self + { + $obj = clone $this; + $obj->radius = $radius; + + return $obj; + } + + /** + * Controls the width of the solid color overlay. Accepts a numeric value or an arithmetic expression (e.g., `bw_mul_0.2` or `bh_div_2`). + * Learn about [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + */ + public function withWidth(float|string $width): self + { + $obj = clone $this; + $obj->width = $width; + + return $obj; + } +} diff --git a/src/SolidColorOverlayTransformation/Gradient.php b/src/SolidColorOverlayTransformation/Gradient.php new file mode 100644 index 00000000..eb408f77 --- /dev/null +++ b/src/SolidColorOverlayTransformation/Gradient.php @@ -0,0 +1,27 @@ +|array + */ + public static function variants(): array + { + return [STAINLESS_FIXME_::class, 'string']; + } +} diff --git a/src/SolidColorOverlayTransformation/Height.php b/src/SolidColorOverlayTransformation/Height.php new file mode 100644 index 00000000..1f458195 --- /dev/null +++ b/src/SolidColorOverlayTransformation/Height.php @@ -0,0 +1,27 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/SolidColorOverlayTransformation/Radius.php b/src/SolidColorOverlayTransformation/Radius.php new file mode 100644 index 00000000..273bf7ce --- /dev/null +++ b/src/SolidColorOverlayTransformation/Radius.php @@ -0,0 +1,27 @@ +|array + */ + public static function variants(): array + { + return ['float', STAINLESS_FIXME_::class]; + } +} diff --git a/src/SolidColorOverlayTransformation/Width.php b/src/SolidColorOverlayTransformation/Width.php new file mode 100644 index 00000000..9b727c04 --- /dev/null +++ b/src/SolidColorOverlayTransformation/Width.php @@ -0,0 +1,27 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/SrcOptions.php b/src/SrcOptions.php new file mode 100644 index 00000000..6513f4d1 --- /dev/null +++ b/src/SrcOptions.php @@ -0,0 +1,243 @@ +|null, + * signed?: bool|null, + * transformation?: list|null, + * transformationPosition?: TransformationPosition::*|null, + * } + */ +final class SrcOptions implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Accepts a relative or absolute path of the resource. If a relative path is provided, it is appended to the `urlEndpoint`. + * If an absolute path is provided, `urlEndpoint` is ignored. + */ + #[Api] + public string $src; + + /** + * Get your urlEndpoint from the [ImageKit dashboard](https://imagekit.io/dashboard/url-endpoints). + */ + #[Api] + public string $urlEndpoint; + + /** + * When you want the signed URL to expire, specified in seconds. If `expiresIn` is anything above 0, + * the URL will always be signed even if `signed` is set to false. If not specified and `signed` is `true`, + * the signed URL will not expire (valid indefinitely). + * + * Example: Setting `expiresIn: 3600` will make the URL expire 1 hour from generation time. After the expiry time, the signed URL will no longer be valid and ImageKit will return + * a 401 Unauthorized status code. + * + * [Learn more](https://imagekit.io/docs/media-delivery-basic-security#how-to-generate-signed-urls). + */ + #[Api(optional: true)] + public ?float $expiresIn; + + /** + * These are additional query parameters that you want to add to the final URL. + * They can be any query parameters and not necessarily related to ImageKit. + * This is especially useful if you want to add a versioning parameter to your URLs. + * + * @var array|null $queryParameters + */ + #[Api(map: 'string', optional: true)] + public ?array $queryParameters; + + /** + * Whether to sign the URL or not. Set this to `true` if you want to generate a signed URL. + * If `signed` is `true` and `expiresIn` is not specified, the signed URL will not expire (valid indefinitely). + * Note: If `expiresIn` is set to any value above 0, the URL will always be signed regardless of this setting. + * [Learn more](https://imagekit.io/docs/media-delivery-basic-security#how-to-generate-signed-urls). + */ + #[Api(optional: true)] + public ?bool $signed; + + /** + * An array of objects specifying the transformations to be applied in the URL. If more than one transformation is specified, they are applied in the order they are specified as chained transformations. + * See [Chained transformations](https://imagekit.io/docs/transformations#chained-transformations). + * + * @var list|null $transformation + */ + #[Api(list: Transformation::class, optional: true)] + public ?array $transformation; + + /** + * By default, the transformation string is added as a query parameter in the URL, e.g., `?tr=w-100,h-100`. + * If you want to add the transformation string in the path of the URL, set this to `path`. + * Learn more in the [Transformations guide](https://imagekit.io/docs/transformations). + * + * @var TransformationPosition::*|null $transformationPosition + */ + #[Api(enum: TransformationPosition::class, optional: true)] + public ?string $transformationPosition; + + /** + * `new SrcOptions()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SrcOptions::with(src: ..., urlEndpoint: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SrcOptions)->withSrc(...)->withURLEndpoint(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param array $queryParameters + * @param list $transformation + * @param TransformationPosition::* $transformationPosition + */ + public static function with( + string $src, + string $urlEndpoint, + ?float $expiresIn = null, + ?array $queryParameters = null, + ?bool $signed = null, + ?array $transformation = null, + ?string $transformationPosition = null, + ): self { + $obj = new self; + + $obj->src = $src; + $obj->urlEndpoint = $urlEndpoint; + + null !== $expiresIn && $obj->expiresIn = $expiresIn; + null !== $queryParameters && $obj->queryParameters = $queryParameters; + null !== $signed && $obj->signed = $signed; + null !== $transformation && $obj->transformation = $transformation; + null !== $transformationPosition && $obj->transformationPosition = $transformationPosition; + + return $obj; + } + + /** + * Accepts a relative or absolute path of the resource. If a relative path is provided, it is appended to the `urlEndpoint`. + * If an absolute path is provided, `urlEndpoint` is ignored. + */ + public function withSrc(string $src): self + { + $obj = clone $this; + $obj->src = $src; + + return $obj; + } + + /** + * Get your urlEndpoint from the [ImageKit dashboard](https://imagekit.io/dashboard/url-endpoints). + */ + public function withURLEndpoint(string $urlEndpoint): self + { + $obj = clone $this; + $obj->urlEndpoint = $urlEndpoint; + + return $obj; + } + + /** + * When you want the signed URL to expire, specified in seconds. If `expiresIn` is anything above 0, + * the URL will always be signed even if `signed` is set to false. If not specified and `signed` is `true`, + * the signed URL will not expire (valid indefinitely). + * + * Example: Setting `expiresIn: 3600` will make the URL expire 1 hour from generation time. After the expiry time, the signed URL will no longer be valid and ImageKit will return + * a 401 Unauthorized status code. + * + * [Learn more](https://imagekit.io/docs/media-delivery-basic-security#how-to-generate-signed-urls). + */ + public function withExpiresIn(float $expiresIn): self + { + $obj = clone $this; + $obj->expiresIn = $expiresIn; + + return $obj; + } + + /** + * These are additional query parameters that you want to add to the final URL. + * They can be any query parameters and not necessarily related to ImageKit. + * This is especially useful if you want to add a versioning parameter to your URLs. + * + * @param array $queryParameters + */ + public function withQueryParameters(array $queryParameters): self + { + $obj = clone $this; + $obj->queryParameters = $queryParameters; + + return $obj; + } + + /** + * Whether to sign the URL or not. Set this to `true` if you want to generate a signed URL. + * If `signed` is `true` and `expiresIn` is not specified, the signed URL will not expire (valid indefinitely). + * Note: If `expiresIn` is set to any value above 0, the URL will always be signed regardless of this setting. + * [Learn more](https://imagekit.io/docs/media-delivery-basic-security#how-to-generate-signed-urls). + */ + public function withSigned(bool $signed): self + { + $obj = clone $this; + $obj->signed = $signed; + + return $obj; + } + + /** + * An array of objects specifying the transformations to be applied in the URL. If more than one transformation is specified, they are applied in the order they are specified as chained transformations. + * See [Chained transformations](https://imagekit.io/docs/transformations#chained-transformations). + * + * @param list $transformation + */ + public function withTransformation(array $transformation): self + { + $obj = clone $this; + $obj->transformation = $transformation; + + return $obj; + } + + /** + * By default, the transformation string is added as a query parameter in the URL, e.g., `?tr=w-100,h-100`. + * If you want to add the transformation string in the path of the URL, set this to `path`. + * Learn more in the [Transformations guide](https://imagekit.io/docs/transformations). + * + * @param TransformationPosition::* $transformationPosition + */ + public function withTransformationPosition( + string $transformationPosition + ): self { + $obj = clone $this; + $obj->transformationPosition = $transformationPosition; + + return $obj; + } +} diff --git a/src/StreamingResolution.php b/src/StreamingResolution.php new file mode 100644 index 00000000..2b494e8b --- /dev/null +++ b/src/StreamingResolution.php @@ -0,0 +1,30 @@ +|null, + * } + */ +final class SubtitleOverlay implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + #[Api] + public string $type = 'subtitle'; + + /** + * Specifies the relative path to the subtitle file used as an overlay. + */ + #[Api] + public string $input; + + /** + * The input path can be included in the layer as either `i-{input}` or `ie-{base64_encoded_input}`. + * By default, the SDK determines the appropriate format automatically. + * To always use base64 encoding (`ie-{base64}`), set this parameter to `base64`. + * To always use plain text (`i-{input}`), set it to `plain`. + * + * @var Encoding::*|null $encoding + */ + #[Api(enum: Encoding::class, optional: true)] + public ?string $encoding; + + /** + * Control styling of the subtitle. See [Styling subtitles](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer). + * + * @var list|null $transformation + */ + #[Api(list: SubtitleOverlayTransformation::class, optional: true)] + public ?array $transformation; + + /** + * `new SubtitleOverlay()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SubtitleOverlay::with(input: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SubtitleOverlay)->withInput(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Encoding::* $encoding + * @param list $transformation + */ + public static function with( + string $input, + ?string $encoding = null, + ?array $transformation = null + ): self { + $obj = new self; + + $obj->input = $input; + + null !== $encoding && $obj->encoding = $encoding; + null !== $transformation && $obj->transformation = $transformation; + + return $obj; + } + + /** + * Specifies the relative path to the subtitle file used as an overlay. + */ + public function withInput(string $input): self + { + $obj = clone $this; + $obj->input = $input; + + return $obj; + } + + /** + * The input path can be included in the layer as either `i-{input}` or `ie-{base64_encoded_input}`. + * By default, the SDK determines the appropriate format automatically. + * To always use base64 encoding (`ie-{base64}`), set this parameter to `base64`. + * To always use plain text (`i-{input}`), set it to `plain`. + * + * @param Encoding::* $encoding + */ + public function withEncoding(string $encoding): self + { + $obj = clone $this; + $obj->encoding = $encoding; + + return $obj; + } + + /** + * Control styling of the subtitle. See [Styling subtitles](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer). + * + * @param list $transformation + */ + public function withTransformation(array $transformation): self + { + $obj = clone $this; + $obj->transformation = $transformation; + + return $obj; + } +} diff --git a/src/SubtitleOverlay/Encoding.php b/src/SubtitleOverlay/Encoding.php new file mode 100644 index 00000000..fef7e323 --- /dev/null +++ b/src/SubtitleOverlay/Encoding.php @@ -0,0 +1,25 @@ + */ + use SdkModel; + + /** + * Specifies the subtitle background color using a standard color name, an RGB color code (e.g., FF0000), or an RGBA color code (e.g., FFAABB50). + * + * [Subtitle styling options](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) + */ + #[Api(optional: true)] + public ?string $background; + + /** + * Sets the font color of the subtitle text using a standard color name, an RGB color code (e.g., FF0000), or an RGBA color code (e.g., FFAABB50). + * + * [Subtitle styling options](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) + */ + #[Api(optional: true)] + public ?string $color; + + /** + * Font family for subtitles. Refer to the [supported fonts](https://imagekit.io/docs/add-overlays-on-images#supported-text-font-list). + */ + #[Api(optional: true)] + public ?string $fontFamily; + + /** + * Sets the font outline of the subtitle text. + * Requires the outline width (an integer) and the outline color (as an RGB color code, RGBA color code, or standard web color name) separated by an underscore. + * Example: `fol-2_blue` (outline width of 2px and outline color blue), `fol-2_A1CCDD` (outline width of 2px and outline color `#A1CCDD`) and `fol-2_A1CCDD50` (outline width of 2px and outline color `#A1CCDD` at 50% opacity). + * + * [Subtitle styling options](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) + */ + #[Api(optional: true)] + public ?string $fontOutline; + + /** + * Sets the font shadow for the subtitle text. + * Requires the shadow color (as an RGB color code, RGBA color code, or standard web color name) and shadow indent (an integer) separated by an underscore. + * Example: `fsh-blue_2` (shadow color blue, indent of 2px), `fsh-A1CCDD_3` (shadow color `#A1CCDD`, indent of 3px), `fsh-A1CCDD50_3` (shadow color `#A1CCDD` at 50% opacity, indent of 3px). + * + * [Subtitle styling options](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) + */ + #[Api(optional: true)] + public ?string $fontShadow; + + /** + * Sets the font size of subtitle text. + * + * [Subtitle styling options](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) + */ + #[Api(optional: true)] + public ?float $fontSize; + + /** + * Sets the typography style of the subtitle text. Supports values are `b` for bold, `i` for italics, and `b_i` for bold with italics. + * + * [Subtitle styling options](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) + * + * @var Typography::*|null $typography + */ + #[Api(enum: Typography::class, optional: true)] + public ?string $typography; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Typography::* $typography + */ + public static function with( + ?string $background = null, + ?string $color = null, + ?string $fontFamily = null, + ?string $fontOutline = null, + ?string $fontShadow = null, + ?float $fontSize = null, + ?string $typography = null, + ): self { + $obj = new self; + + null !== $background && $obj->background = $background; + null !== $color && $obj->color = $color; + null !== $fontFamily && $obj->fontFamily = $fontFamily; + null !== $fontOutline && $obj->fontOutline = $fontOutline; + null !== $fontShadow && $obj->fontShadow = $fontShadow; + null !== $fontSize && $obj->fontSize = $fontSize; + null !== $typography && $obj->typography = $typography; + + return $obj; + } + + /** + * Specifies the subtitle background color using a standard color name, an RGB color code (e.g., FF0000), or an RGBA color code (e.g., FFAABB50). + * + * [Subtitle styling options](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) + */ + public function withBackground(string $background): self + { + $obj = clone $this; + $obj->background = $background; + + return $obj; + } + + /** + * Sets the font color of the subtitle text using a standard color name, an RGB color code (e.g., FF0000), or an RGBA color code (e.g., FFAABB50). + * + * [Subtitle styling options](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) + */ + public function withColor(string $color): self + { + $obj = clone $this; + $obj->color = $color; + + return $obj; + } + + /** + * Font family for subtitles. Refer to the [supported fonts](https://imagekit.io/docs/add-overlays-on-images#supported-text-font-list). + */ + public function withFontFamily(string $fontFamily): self + { + $obj = clone $this; + $obj->fontFamily = $fontFamily; + + return $obj; + } + + /** + * Sets the font outline of the subtitle text. + * Requires the outline width (an integer) and the outline color (as an RGB color code, RGBA color code, or standard web color name) separated by an underscore. + * Example: `fol-2_blue` (outline width of 2px and outline color blue), `fol-2_A1CCDD` (outline width of 2px and outline color `#A1CCDD`) and `fol-2_A1CCDD50` (outline width of 2px and outline color `#A1CCDD` at 50% opacity). + * + * [Subtitle styling options](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) + */ + public function withFontOutline(string $fontOutline): self + { + $obj = clone $this; + $obj->fontOutline = $fontOutline; + + return $obj; + } + + /** + * Sets the font shadow for the subtitle text. + * Requires the shadow color (as an RGB color code, RGBA color code, or standard web color name) and shadow indent (an integer) separated by an underscore. + * Example: `fsh-blue_2` (shadow color blue, indent of 2px), `fsh-A1CCDD_3` (shadow color `#A1CCDD`, indent of 3px), `fsh-A1CCDD50_3` (shadow color `#A1CCDD` at 50% opacity, indent of 3px). + * + * [Subtitle styling options](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) + */ + public function withFontShadow(string $fontShadow): self + { + $obj = clone $this; + $obj->fontShadow = $fontShadow; + + return $obj; + } + + /** + * Sets the font size of subtitle text. + * + * [Subtitle styling options](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) + */ + public function withFontSize(float $fontSize): self + { + $obj = clone $this; + $obj->fontSize = $fontSize; + + return $obj; + } + + /** + * Sets the typography style of the subtitle text. Supports values are `b` for bold, `i` for italics, and `b_i` for bold with italics. + * + * [Subtitle styling options](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) + * + * @param Typography::* $typography + */ + public function withTypography(string $typography): self + { + $obj = clone $this; + $obj->typography = $typography; + + return $obj; + } +} diff --git a/src/SubtitleOverlayTransformation/Typography.php b/src/SubtitleOverlayTransformation/Typography.php new file mode 100644 index 00000000..e5a94c37 --- /dev/null +++ b/src/SubtitleOverlayTransformation/Typography.php @@ -0,0 +1,24 @@ +|null, + * } + */ +final class TextOverlay implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + #[Api] + public string $type = 'text'; + + /** + * Specifies the text to be displayed in the overlay. The SDK automatically handles special characters and encoding. + */ + #[Api] + public string $text; + + /** + * Text can be included in the layer as either `i-{input}` (plain text) or `ie-{base64_encoded_input}` (base64). + * By default, the SDK selects the appropriate format based on the input text. + * To always use base64 (`ie-{base64}`), set this parameter to `base64`. + * To always use plain text (`i-{input}`), set it to `plain`. + * + * @var Encoding::*|null $encoding + */ + #[Api(enum: Encoding::class, optional: true)] + public ?string $encoding; + + /** + * Control styling of the text overlay. See [Text overlays](https://imagekit.io/docs/add-overlays-on-images#text-overlay). + * + * @var list|null $transformation + */ + #[Api(list: TextOverlayTransformation::class, optional: true)] + public ?array $transformation; + + /** + * `new TextOverlay()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * TextOverlay::with(text: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new TextOverlay)->withText(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Encoding::* $encoding + * @param list $transformation + */ + public static function with( + string $text, + ?string $encoding = null, + ?array $transformation = null + ): self { + $obj = new self; + + $obj->text = $text; + + null !== $encoding && $obj->encoding = $encoding; + null !== $transformation && $obj->transformation = $transformation; + + return $obj; + } + + /** + * Specifies the text to be displayed in the overlay. The SDK automatically handles special characters and encoding. + */ + public function withText(string $text): self + { + $obj = clone $this; + $obj->text = $text; + + return $obj; + } + + /** + * Text can be included in the layer as either `i-{input}` (plain text) or `ie-{base64_encoded_input}` (base64). + * By default, the SDK selects the appropriate format based on the input text. + * To always use base64 (`ie-{base64}`), set this parameter to `base64`. + * To always use plain text (`i-{input}`), set it to `plain`. + * + * @param Encoding::* $encoding + */ + public function withEncoding(string $encoding): self + { + $obj = clone $this; + $obj->encoding = $encoding; + + return $obj; + } + + /** + * Control styling of the text overlay. See [Text overlays](https://imagekit.io/docs/add-overlays-on-images#text-overlay). + * + * @param list $transformation + */ + public function withTransformation(array $transformation): self + { + $obj = clone $this; + $obj->transformation = $transformation; + + return $obj; + } +} diff --git a/src/TextOverlay/Encoding.php b/src/TextOverlay/Encoding.php new file mode 100644 index 00000000..9b23bed7 --- /dev/null +++ b/src/TextOverlay/Encoding.php @@ -0,0 +1,25 @@ + */ + use SdkModel; + + /** + * Specifies the transparency level of the text overlay. Accepts integers from `1` to `9`. + */ + #[Api(optional: true)] + public ?float $alpha; + + /** + * Specifies the background color of the text overlay. + * Accepts an RGB hex code, an RGBA code, or a color name. + */ + #[Api(optional: true)] + public ?string $background; + + /** + * Flip the text overlay horizontally, vertically, or both. + * + * @var Flip::*|null $flip + */ + #[Api(enum: Flip::class, optional: true)] + public ?string $flip; + + /** + * Specifies the font color of the overlaid text. Accepts an RGB hex code (e.g., `FF0000`), an RGBA code (e.g., `FFAABB50`), or a color name. + */ + #[Api(optional: true)] + public ?string $fontColor; + + /** + * Specifies the font family of the overlaid text. Choose from the supported fonts list or use a custom font. + * See [Supported fonts](https://imagekit.io/docs/add-overlays-on-images#supported-text-font-list) and [Custom font](https://imagekit.io/docs/add-overlays-on-images#change-font-family-in-text-overlay). + */ + #[Api(optional: true)] + public ?string $fontFamily; + + /** + * Specifies the font size of the overlaid text. Accepts a numeric value or an arithmetic expression. + */ + #[Api(optional: true)] + public float|string|null $fontSize; + + /** + * Specifies the inner alignment of the text when width is more than the text length. + * + * @var InnerAlignment::*|null $innerAlignment + */ + #[Api(enum: InnerAlignment::class, optional: true)] + public ?string $innerAlignment; + + /** + * Specifies the line height of the text overlay. + * Accepts integer values representing line height in points. It can also accept [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations) such as `bw_mul_0.2`, or `bh_div_20`. + */ + #[Api(optional: true)] + public float|string|null $lineHeight; + + /** + * Specifies the padding around the overlaid text. + * Can be provided as a single positive integer or multiple values separated by underscores (following CSS shorthand order). + * Arithmetic expressions are also accepted. + */ + #[Api(optional: true)] + public float|string|null $padding; + + /** + * Specifies the corner radius of the text overlay. + * Set to `max` to achieve a circular or oval shape. + */ + #[Api(optional: true)] + public float|string|null $radius; + + /** + * Specifies the rotation angle of the text overlay. + * Accepts a numeric value for clockwise rotation or a string prefixed with "N" for counter-clockwise rotation. + */ + #[Api(optional: true)] + public float|string|null $rotation; + + /** + * Specifies the typography style of the text. + * Supported values: + * - Single styles: `b` (bold), `i` (italic), `strikethrough`. + * - Combinations: Any combination separated by underscores, e.g., `b_i`, `b_i_strikethrough`. + */ + #[Api(optional: true)] + public ?string $typography; + + /** + * Specifies the maximum width (in pixels) of the overlaid text. The text wraps automatically, and arithmetic expressions (e.g., `bw_mul_0.2` or `bh_div_2`) are supported. Useful when used in conjunction with the `background`. + * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + */ + #[Api(optional: true)] + public float|string|null $width; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Flip::* $flip + * @param InnerAlignment::* $innerAlignment + */ + public static function with( + ?float $alpha = null, + ?string $background = null, + ?string $flip = null, + ?string $fontColor = null, + ?string $fontFamily = null, + float|string|null $fontSize = null, + ?string $innerAlignment = null, + float|string|null $lineHeight = null, + float|string|null $padding = null, + float|string|null $radius = null, + float|string|null $rotation = null, + ?string $typography = null, + float|string|null $width = null, + ): self { + $obj = new self; + + null !== $alpha && $obj->alpha = $alpha; + null !== $background && $obj->background = $background; + null !== $flip && $obj->flip = $flip; + null !== $fontColor && $obj->fontColor = $fontColor; + null !== $fontFamily && $obj->fontFamily = $fontFamily; + null !== $fontSize && $obj->fontSize = $fontSize; + null !== $innerAlignment && $obj->innerAlignment = $innerAlignment; + null !== $lineHeight && $obj->lineHeight = $lineHeight; + null !== $padding && $obj->padding = $padding; + null !== $radius && $obj->radius = $radius; + null !== $rotation && $obj->rotation = $rotation; + null !== $typography && $obj->typography = $typography; + null !== $width && $obj->width = $width; + + return $obj; + } + + /** + * Specifies the transparency level of the text overlay. Accepts integers from `1` to `9`. + */ + public function withAlpha(float $alpha): self + { + $obj = clone $this; + $obj->alpha = $alpha; + + return $obj; + } + + /** + * Specifies the background color of the text overlay. + * Accepts an RGB hex code, an RGBA code, or a color name. + */ + public function withBackground(string $background): self + { + $obj = clone $this; + $obj->background = $background; + + return $obj; + } + + /** + * Flip the text overlay horizontally, vertically, or both. + * + * @param Flip::* $flip + */ + public function withFlip(string $flip): self + { + $obj = clone $this; + $obj->flip = $flip; + + return $obj; + } + + /** + * Specifies the font color of the overlaid text. Accepts an RGB hex code (e.g., `FF0000`), an RGBA code (e.g., `FFAABB50`), or a color name. + */ + public function withFontColor(string $fontColor): self + { + $obj = clone $this; + $obj->fontColor = $fontColor; + + return $obj; + } + + /** + * Specifies the font family of the overlaid text. Choose from the supported fonts list or use a custom font. + * See [Supported fonts](https://imagekit.io/docs/add-overlays-on-images#supported-text-font-list) and [Custom font](https://imagekit.io/docs/add-overlays-on-images#change-font-family-in-text-overlay). + */ + public function withFontFamily(string $fontFamily): self + { + $obj = clone $this; + $obj->fontFamily = $fontFamily; + + return $obj; + } + + /** + * Specifies the font size of the overlaid text. Accepts a numeric value or an arithmetic expression. + */ + public function withFontSize(float|string $fontSize): self + { + $obj = clone $this; + $obj->fontSize = $fontSize; + + return $obj; + } + + /** + * Specifies the inner alignment of the text when width is more than the text length. + * + * @param InnerAlignment::* $innerAlignment + */ + public function withInnerAlignment(string $innerAlignment): self + { + $obj = clone $this; + $obj->innerAlignment = $innerAlignment; + + return $obj; + } + + /** + * Specifies the line height of the text overlay. + * Accepts integer values representing line height in points. It can also accept [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations) such as `bw_mul_0.2`, or `bh_div_20`. + */ + public function withLineHeight(float|string $lineHeight): self + { + $obj = clone $this; + $obj->lineHeight = $lineHeight; + + return $obj; + } + + /** + * Specifies the padding around the overlaid text. + * Can be provided as a single positive integer or multiple values separated by underscores (following CSS shorthand order). + * Arithmetic expressions are also accepted. + */ + public function withPadding(float|string $padding): self + { + $obj = clone $this; + $obj->padding = $padding; + + return $obj; + } + + /** + * Specifies the corner radius of the text overlay. + * Set to `max` to achieve a circular or oval shape. + */ + public function withRadius(float|string $radius): self + { + $obj = clone $this; + $obj->radius = $radius; + + return $obj; + } + + /** + * Specifies the rotation angle of the text overlay. + * Accepts a numeric value for clockwise rotation or a string prefixed with "N" for counter-clockwise rotation. + */ + public function withRotation(float|string $rotation): self + { + $obj = clone $this; + $obj->rotation = $rotation; + + return $obj; + } + + /** + * Specifies the typography style of the text. + * Supported values: + * - Single styles: `b` (bold), `i` (italic), `strikethrough`. + * - Combinations: Any combination separated by underscores, e.g., `b_i`, `b_i_strikethrough`. + */ + public function withTypography(string $typography): self + { + $obj = clone $this; + $obj->typography = $typography; + + return $obj; + } + + /** + * Specifies the maximum width (in pixels) of the overlaid text. The text wraps automatically, and arithmetic expressions (e.g., `bw_mul_0.2` or `bh_div_2`) are supported. Useful when used in conjunction with the `background`. + * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + */ + public function withWidth(float|string $width): self + { + $obj = clone $this; + $obj->width = $width; + + return $obj; + } +} diff --git a/src/TextOverlayTransformation/Flip.php b/src/TextOverlayTransformation/Flip.php new file mode 100644 index 00000000..f51373b3 --- /dev/null +++ b/src/TextOverlayTransformation/Flip.php @@ -0,0 +1,24 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/TextOverlayTransformation/InnerAlignment.php b/src/TextOverlayTransformation/InnerAlignment.php new file mode 100644 index 00000000..885e71a4 --- /dev/null +++ b/src/TextOverlayTransformation/InnerAlignment.php @@ -0,0 +1,22 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/TextOverlayTransformation/Padding.php b/src/TextOverlayTransformation/Padding.php new file mode 100644 index 00000000..bbe361d2 --- /dev/null +++ b/src/TextOverlayTransformation/Padding.php @@ -0,0 +1,28 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/TextOverlayTransformation/Radius.php b/src/TextOverlayTransformation/Radius.php new file mode 100644 index 00000000..51754284 --- /dev/null +++ b/src/TextOverlayTransformation/Radius.php @@ -0,0 +1,27 @@ +|array + */ + public static function variants(): array + { + return ['float', STAINLESS_FIXME_::class]; + } +} diff --git a/src/TextOverlayTransformation/Rotation.php b/src/TextOverlayTransformation/Rotation.php new file mode 100644 index 00000000..98d464fe --- /dev/null +++ b/src/TextOverlayTransformation/Rotation.php @@ -0,0 +1,27 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/TextOverlayTransformation/Width.php b/src/TextOverlayTransformation/Width.php new file mode 100644 index 00000000..ea42449f --- /dev/null +++ b/src/TextOverlayTransformation/Width.php @@ -0,0 +1,27 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/Transformation.php b/src/Transformation.php new file mode 100644 index 00000000..86d77e87 --- /dev/null +++ b/src/Transformation.php @@ -0,0 +1,1334 @@ +|null, + * trim?: bool|float|null, + * unsharpMask?: bool|string|null, + * videoCodec?: VideoCodec::*|null, + * width?: float|string|null, + * x?: float|string|null, + * xCenter?: float|string|null, + * y?: float|string|null, + * yCenter?: float|string|null, + * zoom?: float|null, + * } + */ +final class Transformation implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Uses AI to change the background. Provide a text prompt or a base64-encoded prompt, + * e.g., `prompt-snow road` or `prompte-[urlencoded_base64_encoded_text]`. + * Not supported inside overlay. + * See [AI Change Background](https://imagekit.io/docs/ai-transformations#change-background-e-changebg). + */ + #[Api(optional: true)] + public ?string $aiChangeBackground; + + /** + * Adds an AI-based drop shadow around a foreground object on a transparent or removed background. + * Optionally, control the direction, elevation, and saturation of the light source (e.g., `az-45` to change light direction). + * Pass `true` for the default drop shadow, or provide a string for a custom drop shadow. + * Supported inside overlay. + * See [AI Drop Shadow](https://imagekit.io/docs/ai-transformations#ai-drop-shadow-e-dropshadow). + */ + #[Api(optional: true)] + public bool|string|null $aiDropShadow; + + /** + * Uses AI to edit images based on a text prompt. Provide a text prompt or a base64-encoded prompt, + * e.g., `prompt-snow road` or `prompte-[urlencoded_base64_encoded_text]`. + * Not supported inside overlay. + * See [AI Edit](https://imagekit.io/docs/ai-transformations#edit-image-e-edit). + */ + #[Api(optional: true)] + public ?string $aiEdit; + + /** + * Applies ImageKit's in-house background removal. + * Supported inside overlay. + * See [AI Background Removal](https://imagekit.io/docs/ai-transformations#imagekit-background-removal-e-bgremove). + * + * @var AIRemoveBackground::*|null $aiRemoveBackground + */ + #[Api(enum: AIRemoveBackground::class, optional: true)] + public ?bool $aiRemoveBackground; + + /** + * Uses third-party background removal. + * Note: It is recommended to use aiRemoveBackground, ImageKit's in-house solution, which is more cost-effective. + * Supported inside overlay. + * See [External Background Removal](https://imagekit.io/docs/ai-transformations#background-removal-e-removedotbg). + * + * @var AIRemoveBackgroundExternal::*|null $aiRemoveBackgroundExternal + */ + #[Api(enum: AIRemoveBackgroundExternal::class, optional: true)] + public ?bool $aiRemoveBackgroundExternal; + + /** + * Performs AI-based retouching to improve faces or product shots. Not supported inside overlay. + * See [AI Retouch](https://imagekit.io/docs/ai-transformations#retouch-e-retouch). + * + * @var AIRetouch::*|null $aiRetouch + */ + #[Api(enum: AIRetouch::class, optional: true)] + public ?bool $aiRetouch; + + /** + * Upscales images beyond their original dimensions using AI. Not supported inside overlay. + * See [AI Upscale](https://imagekit.io/docs/ai-transformations#upscale-e-upscale). + * + * @var AIUpscale::*|null $aiUpscale + */ + #[Api(enum: AIUpscale::class, optional: true)] + public ?bool $aiUpscale; + + /** + * Generates a variation of an image using AI. This produces a new image with slight variations from the original, + * such as changes in color, texture, and other visual elements, while preserving the structure and essence of the original image. Not supported inside overlay. + * See [AI Generate Variations](https://imagekit.io/docs/ai-transformations#generate-variations-of-an-image-e-genvar). + * + * @var AIVariation::*|null $aiVariation + */ + #[Api(enum: AIVariation::class, optional: true)] + public ?bool $aiVariation; + + /** + * Specifies the aspect ratio for the output, e.g., "ar-4-3". Typically used with either width or height (but not both). + * For example: aspectRatio = `4:3`, `4_3`, or an expression like `iar_div_2`. + * See [Image resize and crop – Aspect ratio](https://imagekit.io/docs/image-resize-and-crop#aspect-ratio---ar). + */ + #[Api(optional: true)] + public float|string|null $aspectRatio; + + /** + * Specifies the audio codec, e.g., `aac`, `opus`, or `none`. See [Audio codec](https://imagekit.io/docs/video-optimization#audio-codec---ac). + * + * @var AudioCodec::*|null $audioCodec + */ + #[Api(enum: AudioCodec::class, optional: true)] + public ?string $audioCodec; + + /** + * Specifies the background to be used in conjunction with certain cropping strategies when resizing an image. + * - A solid color: e.g., `red`, `F3F3F3`, `AAFF0010`. See [Solid color background](https://imagekit.io/docs/effects-and-enhancements#solid-color-background). + * - A blurred background: e.g., `blurred`, `blurred_25_N15`, etc. See [Blurred background](https://imagekit.io/docs/effects-and-enhancements#blurred-background). + * - Expand the image boundaries using generative fill: `genfill`. Not supported inside overlay. Optionally, control the background scene by passing a text prompt: + * `genfill[:-prompt-${text}]` or `genfill[:-prompte-${urlencoded_base64_encoded_text}]`. See [Generative fill background](https://imagekit.io/docs/ai-transformations#generative-fill-bg-genfill). + */ + #[Api(optional: true)] + public ?string $background; + + /** + * Specifies the Gaussian blur level. Accepts an integer value between 1 and 100, or an expression like `bl-10`. + * See [Blur](https://imagekit.io/docs/effects-and-enhancements#blur---bl). + */ + #[Api(optional: true)] + public ?float $blur; + + /** + * Adds a border to the output media. Accepts a string in the format `_` + * (e.g., `5_FFF000` for a 5px yellow border), or an expression like `ih_div_20_FF00FF`. + * See [Border](https://imagekit.io/docs/effects-and-enhancements#border---b). + */ + #[Api(optional: true)] + public ?string $border; + + /** + * Indicates whether the output image should retain the original color profile. + * See [Color profile](https://imagekit.io/docs/image-optimization#color-profile---cp). + */ + #[Api(optional: true)] + public ?bool $colorProfile; + + /** + * Automatically enhances the contrast of an image (contrast stretch). + * See [Contrast Stretch](https://imagekit.io/docs/effects-and-enhancements#contrast-stretch---e-contrast). + * + * @var ContrastStretch::*|null $contrastStretch + */ + #[Api(enum: ContrastStretch::class, optional: true)] + public ?bool $contrastStretch; + + /** + * Crop modes for image resizing. See [Crop modes & focus](https://imagekit.io/docs/image-resize-and-crop#crop-crop-modes--focus). + * + * @var Crop::*|null $crop + */ + #[Api(enum: Crop::class, optional: true)] + public ?string $crop; + + /** + * Additional crop modes for image resizing. See [Crop modes & focus](https://imagekit.io/docs/image-resize-and-crop#crop-crop-modes--focus). + * + * @var CropMode::*|null $cropMode + */ + #[Api(enum: CropMode::class, optional: true)] + public ?string $cropMode; + + /** + * Specifies a fallback image if the resource is not found, e.g., a URL or file path. + * See [Default image](https://imagekit.io/docs/image-transformation#default-image---di). + */ + #[Api(optional: true)] + public ?string $defaultImage; + + /** + * Accepts values between 0.1 and 5, or `auto` for automatic device pixel ratio (DPR) calculation. + * See [DPR](https://imagekit.io/docs/image-resize-and-crop#dpr---dpr). + */ + #[Api(optional: true)] + public ?float $dpr; + + /** + * Specifies the duration (in seconds) for trimming videos, e.g., `5` or `10.5`. + * Typically used with startOffset to indicate the length from the start offset. Arithmetic expressions are supported. + * See [Trim videos – Duration](https://imagekit.io/docs/trim-videos#duration---du). + */ + #[Api(optional: true)] + public float|string|null $duration; + + /** + * Specifies the end offset (in seconds) for trimming videos, e.g., `5` or `10.5`. + * Typically used with startOffset to define a time window. Arithmetic expressions are supported. + * See [Trim videos – End offset](https://imagekit.io/docs/trim-videos#end-offset---eo). + */ + #[Api(optional: true)] + public float|string|null $endOffset; + + /** + * Flips or mirrors an image either horizontally, vertically, or both. + * Acceptable values: `h` (horizontal), `v` (vertical), `h_v` (horizontal and vertical), or `v_h`. + * See [Flip](https://imagekit.io/docs/effects-and-enhancements#flip---fl). + * + * @var Flip::*|null $flip + */ + #[Api(enum: Flip::class, optional: true)] + public ?string $flip; + + /** + * Refines padding and cropping behavior for pad resize, maintain ratio, and extract crop modes. + * Supports manual positions and coordinate-based focus. With AI-based cropping, you can automatically + * keep key subjects in frame—such as faces or detected objects (e.g., `fo-face`, `fo-person`, `fo-car`)— + * while resizing. + * - See [Focus](https://imagekit.io/docs/image-resize-and-crop#focus---fo). + * - [Object aware cropping](https://imagekit.io/docs/image-resize-and-crop#object-aware-cropping---fo-object-name). + */ + #[Api(optional: true)] + public ?string $focus; + + /** + * Specifies the output format for images or videos, e.g., `jpg`, `png`, `webp`, `mp4`, or `auto`. + * You can also pass `orig` for images to return the original format. + * ImageKit automatically delivers images and videos in the optimal format based on device support unless overridden by the dashboard settings or the format parameter. + * See [Image format](https://imagekit.io/docs/image-optimization#format---f) and [Video format](https://imagekit.io/docs/video-optimization#format---f). + * + * @var Format::*|null $format + */ + #[Api(enum: Format::class, optional: true)] + public ?string $format; + + /** + * Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. + * See [Gradient](https://imagekit.io/docs/effects-and-enhancements#gradient---e-gradient). + */ + #[Api(optional: true)] + public bool|string|null $gradient; + + /** + * Enables a grayscale effect for images. See [Grayscale](https://imagekit.io/docs/effects-and-enhancements#grayscale---e-grayscale). + * + * @var Grayscale::*|null $grayscale + */ + #[Api(enum: Grayscale::class, optional: true)] + public ?bool $grayscale; + + /** + * Specifies the height of the output. If a value between 0 and 1 is provided, it is treated as a percentage (e.g., `0.5` represents 50% of the original height). + * You can also supply arithmetic expressions (e.g., `ih_mul_0.5`). + * Height transformation – [Images](https://imagekit.io/docs/image-resize-and-crop#height---h) · [Videos](https://imagekit.io/docs/video-resize-and-crop#height---h). + */ + #[Api(optional: true)] + public float|string|null $height; + + /** + * Specifies whether the output image (in JPEG or PNG) should be compressed losslessly. + * See [Lossless compression](https://imagekit.io/docs/image-optimization#lossless-webp-and-png---lo). + */ + #[Api(optional: true)] + public ?bool $lossless; + + /** + * By default, ImageKit removes all metadata during automatic image compression. + * Set this to true to preserve metadata. + * See [Image metadata](https://imagekit.io/docs/image-optimization#image-metadata---md). + */ + #[Api(optional: true)] + public ?bool $metadata; + + /** + * Named transformation reference. See [Named transformations](https://imagekit.io/docs/transformations#named-transformations). + */ + #[Api(optional: true)] + public ?string $named; + + /** + * Specifies the opacity level of the output image. See [Opacity](https://imagekit.io/docs/effects-and-enhancements#opacity---o). + */ + #[Api(optional: true)] + public ?float $opacity; + + /** + * If set to true, serves the original file without applying any transformations. + * See [Deliver original file as-is](https://imagekit.io/docs/core-delivery-features#deliver-original-file-as-is---orig-true). + */ + #[Api(optional: true)] + public ?bool $original; + + /** + * Specifies an overlay to be applied on the parent image or video. + * ImageKit supports overlays including images, text, videos, subtitles, and solid colors. + * See [Overlay using layers](https://imagekit.io/docs/transformations#overlay-using-layers). + */ + #[Api(union: Overlay::class, optional: true)] + public TextOverlay|ImageOverlay|VideoOverlay|SubtitleOverlay|SolidColorOverlay|null $overlay; + + /** + * Extracts a specific page or frame from multi-page or layered files (PDF, PSD, AI). + * For example, specify by number (e.g., `2`), a range (e.g., `3-4` for the 2nd and 3rd layers), + * or by name (e.g., `name-layer-4` for a PSD layer). + * See [Thumbnail extraction](https://imagekit.io/docs/vector-and-animated-images#get-thumbnail-from-psd-pdf-ai-eps-and-animated-files). + */ + #[Api(optional: true)] + public float|string|null $page; + + /** + * Specifies whether the output JPEG image should be rendered progressively. Progressive loading begins with a low-quality, + * pixelated version of the full image, which gradually improves to provide a faster perceived load time. + * See [Progressive images](https://imagekit.io/docs/image-optimization#progressive-image---pr). + */ + #[Api(optional: true)] + public ?bool $progressive; + + /** + * Specifies the quality of the output image for lossy formats such as JPEG, WebP, and AVIF. + * A higher quality value results in a larger file size with better quality, while a lower value produces a smaller file size with reduced quality. + * See [Quality](https://imagekit.io/docs/image-optimization#quality---q). + */ + #[Api(optional: true)] + public ?float $quality; + + /** + * Specifies the corner radius for rounded corners (e.g., 20) or `max` for circular or oval shape. + * See [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). + */ + #[Api(optional: true)] + public float|string|null $radius; + + /** + * Pass any transformation not directly supported by the SDK. + * This transformation string is appended to the URL as provided. + */ + #[Api(optional: true)] + public ?string $raw; + + /** + * Specifies the rotation angle in degrees. Positive values rotate the image clockwise; you can also use, for example, `N40` for counterclockwise rotation + * or `auto` to use the orientation specified in the image's EXIF data. + * For videos, only the following values are supported: 0, 90, 180, 270, or 360. + * See [Rotate](https://imagekit.io/docs/effects-and-enhancements#rotate---rt). + */ + #[Api(optional: true)] + public float|string|null $rotation; + + /** + * Adds a shadow beneath solid objects in an image with a transparent background. + * For AI-based drop shadows, refer to aiDropShadow. + * Pass `true` for a default shadow, or provide a string for a custom shadow. + * See [Shadow](https://imagekit.io/docs/effects-and-enhancements#shadow---e-shadow). + */ + #[Api(optional: true)] + public bool|string|null $shadow; + + /** + * Sharpens the input image, highlighting edges and finer details. + * Pass `true` for default sharpening, or provide a numeric value for custom sharpening. + * See [Sharpen](https://imagekit.io/docs/effects-and-enhancements#sharpen---e-sharpen). + */ + #[Api(optional: true)] + public bool|float|null $sharpen; + + /** + * Specifies the start offset (in seconds) for trimming videos, e.g., `5` or `10.5`. + * Arithmetic expressions are also supported. + * See [Trim videos – Start offset](https://imagekit.io/docs/trim-videos#start-offset---so). + */ + #[Api(optional: true)] + public float|string|null $startOffset; + + /** + * An array of resolutions for adaptive bitrate streaming, e.g., [`240`, `360`, `480`, `720`, `1080`]. + * See [Adaptive Bitrate Streaming](https://imagekit.io/docs/adaptive-bitrate-streaming). + * + * @var list|null $streamingResolutions + */ + #[Api(list: StreamingResolution::class, optional: true)] + public ?array $streamingResolutions; + + /** + * Useful for images with a solid or nearly solid background and a central object. This parameter trims the background, + * leaving only the central object in the output image. + * See [Trim edges](https://imagekit.io/docs/effects-and-enhancements#trim-edges---t). + */ + #[Api(optional: true)] + public bool|float|null $trim; + + /** + * Applies Unsharp Masking (USM), an image sharpening technique. + * Pass `true` for a default unsharp mask, or provide a string for a custom unsharp mask. + * See [Unsharp Mask](https://imagekit.io/docs/effects-and-enhancements#unsharp-mask---e-usm). + */ + #[Api(optional: true)] + public bool|string|null $unsharpMask; + + /** + * Specifies the video codec, e.g., `h264`, `vp9`, `av1`, or `none`. See [Video codec](https://imagekit.io/docs/video-optimization#video-codec---vc). + * + * @var VideoCodec::*|null $videoCodec + */ + #[Api(enum: VideoCodec::class, optional: true)] + public ?string $videoCodec; + + /** + * Specifies the width of the output. If a value between 0 and 1 is provided, it is treated as a percentage (e.g., `0.4` represents 40% of the original width). + * You can also supply arithmetic expressions (e.g., `iw_div_2`). + * Width transformation – [Images](https://imagekit.io/docs/image-resize-and-crop#width---w) · [Videos](https://imagekit.io/docs/video-resize-and-crop#width---w). + */ + #[Api(optional: true)] + public float|string|null $width; + + /** + * Focus using cropped image coordinates - X coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). + */ + #[Api(optional: true)] + public float|string|null $x; + + /** + * Focus using cropped image coordinates - X center coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). + */ + #[Api(optional: true)] + public float|string|null $xCenter; + + /** + * Focus using cropped image coordinates - Y coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). + */ + #[Api(optional: true)] + public float|string|null $y; + + /** + * Focus using cropped image coordinates - Y center coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). + */ + #[Api(optional: true)] + public float|string|null $yCenter; + + /** + * Accepts a numeric value that determines how much to zoom in or out of the cropped area. + * It should be used in conjunction with fo-face or fo-. + * See [Zoom](https://imagekit.io/docs/image-resize-and-crop#zoom---z). + */ + #[Api(optional: true)] + public ?float $zoom; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param AIRemoveBackground::* $aiRemoveBackground + * @param AIRemoveBackgroundExternal::* $aiRemoveBackgroundExternal + * @param AIRetouch::* $aiRetouch + * @param AIUpscale::* $aiUpscale + * @param AIVariation::* $aiVariation + * @param AudioCodec::* $audioCodec + * @param ContrastStretch::* $contrastStretch + * @param Crop::* $crop + * @param CropMode::* $cropMode + * @param Flip::* $flip + * @param Format::* $format + * @param Grayscale::* $grayscale + * @param list $streamingResolutions + * @param VideoCodec::* $videoCodec + */ + public static function with( + ?string $aiChangeBackground = null, + bool|string|null $aiDropShadow = null, + ?string $aiEdit = null, + ?bool $aiRemoveBackground = null, + ?bool $aiRemoveBackgroundExternal = null, + ?bool $aiRetouch = null, + ?bool $aiUpscale = null, + ?bool $aiVariation = null, + float|string|null $aspectRatio = null, + ?string $audioCodec = null, + ?string $background = null, + ?float $blur = null, + ?string $border = null, + ?bool $colorProfile = null, + ?bool $contrastStretch = null, + ?string $crop = null, + ?string $cropMode = null, + ?string $defaultImage = null, + ?float $dpr = null, + float|string|null $duration = null, + float|string|null $endOffset = null, + ?string $flip = null, + ?string $focus = null, + ?string $format = null, + bool|string|null $gradient = null, + ?bool $grayscale = null, + float|string|null $height = null, + ?bool $lossless = null, + ?bool $metadata = null, + ?string $named = null, + ?float $opacity = null, + ?bool $original = null, + TextOverlay|ImageOverlay|VideoOverlay|SubtitleOverlay|SolidColorOverlay|null $overlay = null, + float|string|null $page = null, + ?bool $progressive = null, + ?float $quality = null, + float|string|null $radius = null, + ?string $raw = null, + float|string|null $rotation = null, + bool|string|null $shadow = null, + bool|float|null $sharpen = null, + float|string|null $startOffset = null, + ?array $streamingResolutions = null, + bool|float|null $trim = null, + bool|string|null $unsharpMask = null, + ?string $videoCodec = null, + float|string|null $width = null, + float|string|null $x = null, + float|string|null $xCenter = null, + float|string|null $y = null, + float|string|null $yCenter = null, + ?float $zoom = null, + ): self { + $obj = new self; + + null !== $aiChangeBackground && $obj->aiChangeBackground = $aiChangeBackground; + null !== $aiDropShadow && $obj->aiDropShadow = $aiDropShadow; + null !== $aiEdit && $obj->aiEdit = $aiEdit; + null !== $aiRemoveBackground && $obj->aiRemoveBackground = $aiRemoveBackground; + null !== $aiRemoveBackgroundExternal && $obj->aiRemoveBackgroundExternal = $aiRemoveBackgroundExternal; + null !== $aiRetouch && $obj->aiRetouch = $aiRetouch; + null !== $aiUpscale && $obj->aiUpscale = $aiUpscale; + null !== $aiVariation && $obj->aiVariation = $aiVariation; + null !== $aspectRatio && $obj->aspectRatio = $aspectRatio; + null !== $audioCodec && $obj->audioCodec = $audioCodec; + null !== $background && $obj->background = $background; + null !== $blur && $obj->blur = $blur; + null !== $border && $obj->border = $border; + null !== $colorProfile && $obj->colorProfile = $colorProfile; + null !== $contrastStretch && $obj->contrastStretch = $contrastStretch; + null !== $crop && $obj->crop = $crop; + null !== $cropMode && $obj->cropMode = $cropMode; + null !== $defaultImage && $obj->defaultImage = $defaultImage; + null !== $dpr && $obj->dpr = $dpr; + null !== $duration && $obj->duration = $duration; + null !== $endOffset && $obj->endOffset = $endOffset; + null !== $flip && $obj->flip = $flip; + null !== $focus && $obj->focus = $focus; + null !== $format && $obj->format = $format; + null !== $gradient && $obj->gradient = $gradient; + null !== $grayscale && $obj->grayscale = $grayscale; + null !== $height && $obj->height = $height; + null !== $lossless && $obj->lossless = $lossless; + null !== $metadata && $obj->metadata = $metadata; + null !== $named && $obj->named = $named; + null !== $opacity && $obj->opacity = $opacity; + null !== $original && $obj->original = $original; + null !== $overlay && $obj->overlay = $overlay; + null !== $page && $obj->page = $page; + null !== $progressive && $obj->progressive = $progressive; + null !== $quality && $obj->quality = $quality; + null !== $radius && $obj->radius = $radius; + null !== $raw && $obj->raw = $raw; + null !== $rotation && $obj->rotation = $rotation; + null !== $shadow && $obj->shadow = $shadow; + null !== $sharpen && $obj->sharpen = $sharpen; + null !== $startOffset && $obj->startOffset = $startOffset; + null !== $streamingResolutions && $obj->streamingResolutions = $streamingResolutions; + null !== $trim && $obj->trim = $trim; + null !== $unsharpMask && $obj->unsharpMask = $unsharpMask; + null !== $videoCodec && $obj->videoCodec = $videoCodec; + null !== $width && $obj->width = $width; + null !== $x && $obj->x = $x; + null !== $xCenter && $obj->xCenter = $xCenter; + null !== $y && $obj->y = $y; + null !== $yCenter && $obj->yCenter = $yCenter; + null !== $zoom && $obj->zoom = $zoom; + + return $obj; + } + + /** + * Uses AI to change the background. Provide a text prompt or a base64-encoded prompt, + * e.g., `prompt-snow road` or `prompte-[urlencoded_base64_encoded_text]`. + * Not supported inside overlay. + * See [AI Change Background](https://imagekit.io/docs/ai-transformations#change-background-e-changebg). + */ + public function withAIChangeBackground(string $aiChangeBackground): self + { + $obj = clone $this; + $obj->aiChangeBackground = $aiChangeBackground; + + return $obj; + } + + /** + * Adds an AI-based drop shadow around a foreground object on a transparent or removed background. + * Optionally, control the direction, elevation, and saturation of the light source (e.g., `az-45` to change light direction). + * Pass `true` for the default drop shadow, or provide a string for a custom drop shadow. + * Supported inside overlay. + * See [AI Drop Shadow](https://imagekit.io/docs/ai-transformations#ai-drop-shadow-e-dropshadow). + */ + public function withAIDropShadow(bool|string $aiDropShadow): self + { + $obj = clone $this; + $obj->aiDropShadow = $aiDropShadow; + + return $obj; + } + + /** + * Uses AI to edit images based on a text prompt. Provide a text prompt or a base64-encoded prompt, + * e.g., `prompt-snow road` or `prompte-[urlencoded_base64_encoded_text]`. + * Not supported inside overlay. + * See [AI Edit](https://imagekit.io/docs/ai-transformations#edit-image-e-edit). + */ + public function withAIEdit(string $aiEdit): self + { + $obj = clone $this; + $obj->aiEdit = $aiEdit; + + return $obj; + } + + /** + * Applies ImageKit's in-house background removal. + * Supported inside overlay. + * See [AI Background Removal](https://imagekit.io/docs/ai-transformations#imagekit-background-removal-e-bgremove). + * + * @param AIRemoveBackground::* $aiRemoveBackground + */ + public function withAIRemoveBackground(bool $aiRemoveBackground): self + { + $obj = clone $this; + $obj->aiRemoveBackground = $aiRemoveBackground; + + return $obj; + } + + /** + * Uses third-party background removal. + * Note: It is recommended to use aiRemoveBackground, ImageKit's in-house solution, which is more cost-effective. + * Supported inside overlay. + * See [External Background Removal](https://imagekit.io/docs/ai-transformations#background-removal-e-removedotbg). + * + * @param AIRemoveBackgroundExternal::* $aiRemoveBackgroundExternal + */ + public function withAIRemoveBackgroundExternal( + bool $aiRemoveBackgroundExternal + ): self { + $obj = clone $this; + $obj->aiRemoveBackgroundExternal = $aiRemoveBackgroundExternal; + + return $obj; + } + + /** + * Performs AI-based retouching to improve faces or product shots. Not supported inside overlay. + * See [AI Retouch](https://imagekit.io/docs/ai-transformations#retouch-e-retouch). + * + * @param AIRetouch::* $aiRetouch + */ + public function withAIRetouch(bool $aiRetouch): self + { + $obj = clone $this; + $obj->aiRetouch = $aiRetouch; + + return $obj; + } + + /** + * Upscales images beyond their original dimensions using AI. Not supported inside overlay. + * See [AI Upscale](https://imagekit.io/docs/ai-transformations#upscale-e-upscale). + * + * @param AIUpscale::* $aiUpscale + */ + public function withAIUpscale(bool $aiUpscale): self + { + $obj = clone $this; + $obj->aiUpscale = $aiUpscale; + + return $obj; + } + + /** + * Generates a variation of an image using AI. This produces a new image with slight variations from the original, + * such as changes in color, texture, and other visual elements, while preserving the structure and essence of the original image. Not supported inside overlay. + * See [AI Generate Variations](https://imagekit.io/docs/ai-transformations#generate-variations-of-an-image-e-genvar). + * + * @param AIVariation::* $aiVariation + */ + public function withAIVariation(bool $aiVariation): self + { + $obj = clone $this; + $obj->aiVariation = $aiVariation; + + return $obj; + } + + /** + * Specifies the aspect ratio for the output, e.g., "ar-4-3". Typically used with either width or height (but not both). + * For example: aspectRatio = `4:3`, `4_3`, or an expression like `iar_div_2`. + * See [Image resize and crop – Aspect ratio](https://imagekit.io/docs/image-resize-and-crop#aspect-ratio---ar). + */ + public function withAspectRatio(float|string $aspectRatio): self + { + $obj = clone $this; + $obj->aspectRatio = $aspectRatio; + + return $obj; + } + + /** + * Specifies the audio codec, e.g., `aac`, `opus`, or `none`. See [Audio codec](https://imagekit.io/docs/video-optimization#audio-codec---ac). + * + * @param AudioCodec::* $audioCodec + */ + public function withAudioCodec(string $audioCodec): self + { + $obj = clone $this; + $obj->audioCodec = $audioCodec; + + return $obj; + } + + /** + * Specifies the background to be used in conjunction with certain cropping strategies when resizing an image. + * - A solid color: e.g., `red`, `F3F3F3`, `AAFF0010`. See [Solid color background](https://imagekit.io/docs/effects-and-enhancements#solid-color-background). + * - A blurred background: e.g., `blurred`, `blurred_25_N15`, etc. See [Blurred background](https://imagekit.io/docs/effects-and-enhancements#blurred-background). + * - Expand the image boundaries using generative fill: `genfill`. Not supported inside overlay. Optionally, control the background scene by passing a text prompt: + * `genfill[:-prompt-${text}]` or `genfill[:-prompte-${urlencoded_base64_encoded_text}]`. See [Generative fill background](https://imagekit.io/docs/ai-transformations#generative-fill-bg-genfill). + */ + public function withBackground(string $background): self + { + $obj = clone $this; + $obj->background = $background; + + return $obj; + } + + /** + * Specifies the Gaussian blur level. Accepts an integer value between 1 and 100, or an expression like `bl-10`. + * See [Blur](https://imagekit.io/docs/effects-and-enhancements#blur---bl). + */ + public function withBlur(float $blur): self + { + $obj = clone $this; + $obj->blur = $blur; + + return $obj; + } + + /** + * Adds a border to the output media. Accepts a string in the format `_` + * (e.g., `5_FFF000` for a 5px yellow border), or an expression like `ih_div_20_FF00FF`. + * See [Border](https://imagekit.io/docs/effects-and-enhancements#border---b). + */ + public function withBorder(string $border): self + { + $obj = clone $this; + $obj->border = $border; + + return $obj; + } + + /** + * Indicates whether the output image should retain the original color profile. + * See [Color profile](https://imagekit.io/docs/image-optimization#color-profile---cp). + */ + public function withColorProfile(bool $colorProfile): self + { + $obj = clone $this; + $obj->colorProfile = $colorProfile; + + return $obj; + } + + /** + * Automatically enhances the contrast of an image (contrast stretch). + * See [Contrast Stretch](https://imagekit.io/docs/effects-and-enhancements#contrast-stretch---e-contrast). + * + * @param ContrastStretch::* $contrastStretch + */ + public function withContrastStretch(bool $contrastStretch): self + { + $obj = clone $this; + $obj->contrastStretch = $contrastStretch; + + return $obj; + } + + /** + * Crop modes for image resizing. See [Crop modes & focus](https://imagekit.io/docs/image-resize-and-crop#crop-crop-modes--focus). + * + * @param Crop::* $crop + */ + public function withCrop(string $crop): self + { + $obj = clone $this; + $obj->crop = $crop; + + return $obj; + } + + /** + * Additional crop modes for image resizing. See [Crop modes & focus](https://imagekit.io/docs/image-resize-and-crop#crop-crop-modes--focus). + * + * @param CropMode::* $cropMode + */ + public function withCropMode(string $cropMode): self + { + $obj = clone $this; + $obj->cropMode = $cropMode; + + return $obj; + } + + /** + * Specifies a fallback image if the resource is not found, e.g., a URL or file path. + * See [Default image](https://imagekit.io/docs/image-transformation#default-image---di). + */ + public function withDefaultImage(string $defaultImage): self + { + $obj = clone $this; + $obj->defaultImage = $defaultImage; + + return $obj; + } + + /** + * Accepts values between 0.1 and 5, or `auto` for automatic device pixel ratio (DPR) calculation. + * See [DPR](https://imagekit.io/docs/image-resize-and-crop#dpr---dpr). + */ + public function withDpr(float $dpr): self + { + $obj = clone $this; + $obj->dpr = $dpr; + + return $obj; + } + + /** + * Specifies the duration (in seconds) for trimming videos, e.g., `5` or `10.5`. + * Typically used with startOffset to indicate the length from the start offset. Arithmetic expressions are supported. + * See [Trim videos – Duration](https://imagekit.io/docs/trim-videos#duration---du). + */ + public function withDuration(float|string $duration): self + { + $obj = clone $this; + $obj->duration = $duration; + + return $obj; + } + + /** + * Specifies the end offset (in seconds) for trimming videos, e.g., `5` or `10.5`. + * Typically used with startOffset to define a time window. Arithmetic expressions are supported. + * See [Trim videos – End offset](https://imagekit.io/docs/trim-videos#end-offset---eo). + */ + public function withEndOffset(float|string $endOffset): self + { + $obj = clone $this; + $obj->endOffset = $endOffset; + + return $obj; + } + + /** + * Flips or mirrors an image either horizontally, vertically, or both. + * Acceptable values: `h` (horizontal), `v` (vertical), `h_v` (horizontal and vertical), or `v_h`. + * See [Flip](https://imagekit.io/docs/effects-and-enhancements#flip---fl). + * + * @param Flip::* $flip + */ + public function withFlip(string $flip): self + { + $obj = clone $this; + $obj->flip = $flip; + + return $obj; + } + + /** + * Refines padding and cropping behavior for pad resize, maintain ratio, and extract crop modes. + * Supports manual positions and coordinate-based focus. With AI-based cropping, you can automatically + * keep key subjects in frame—such as faces or detected objects (e.g., `fo-face`, `fo-person`, `fo-car`)— + * while resizing. + * - See [Focus](https://imagekit.io/docs/image-resize-and-crop#focus---fo). + * - [Object aware cropping](https://imagekit.io/docs/image-resize-and-crop#object-aware-cropping---fo-object-name). + */ + public function withFocus(string $focus): self + { + $obj = clone $this; + $obj->focus = $focus; + + return $obj; + } + + /** + * Specifies the output format for images or videos, e.g., `jpg`, `png`, `webp`, `mp4`, or `auto`. + * You can also pass `orig` for images to return the original format. + * ImageKit automatically delivers images and videos in the optimal format based on device support unless overridden by the dashboard settings or the format parameter. + * See [Image format](https://imagekit.io/docs/image-optimization#format---f) and [Video format](https://imagekit.io/docs/video-optimization#format---f). + * + * @param Format::* $format + */ + public function withFormat(string $format): self + { + $obj = clone $this; + $obj->format = $format; + + return $obj; + } + + /** + * Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. + * See [Gradient](https://imagekit.io/docs/effects-and-enhancements#gradient---e-gradient). + */ + public function withGradient(bool|string $gradient): self + { + $obj = clone $this; + $obj->gradient = $gradient; + + return $obj; + } + + /** + * Enables a grayscale effect for images. See [Grayscale](https://imagekit.io/docs/effects-and-enhancements#grayscale---e-grayscale). + * + * @param Grayscale::* $grayscale + */ + public function withGrayscale(bool $grayscale): self + { + $obj = clone $this; + $obj->grayscale = $grayscale; + + return $obj; + } + + /** + * Specifies the height of the output. If a value between 0 and 1 is provided, it is treated as a percentage (e.g., `0.5` represents 50% of the original height). + * You can also supply arithmetic expressions (e.g., `ih_mul_0.5`). + * Height transformation – [Images](https://imagekit.io/docs/image-resize-and-crop#height---h) · [Videos](https://imagekit.io/docs/video-resize-and-crop#height---h). + */ + public function withHeight(float|string $height): self + { + $obj = clone $this; + $obj->height = $height; + + return $obj; + } + + /** + * Specifies whether the output image (in JPEG or PNG) should be compressed losslessly. + * See [Lossless compression](https://imagekit.io/docs/image-optimization#lossless-webp-and-png---lo). + */ + public function withLossless(bool $lossless): self + { + $obj = clone $this; + $obj->lossless = $lossless; + + return $obj; + } + + /** + * By default, ImageKit removes all metadata during automatic image compression. + * Set this to true to preserve metadata. + * See [Image metadata](https://imagekit.io/docs/image-optimization#image-metadata---md). + */ + public function withMetadata(bool $metadata): self + { + $obj = clone $this; + $obj->metadata = $metadata; + + return $obj; + } + + /** + * Named transformation reference. See [Named transformations](https://imagekit.io/docs/transformations#named-transformations). + */ + public function withNamed(string $named): self + { + $obj = clone $this; + $obj->named = $named; + + return $obj; + } + + /** + * Specifies the opacity level of the output image. See [Opacity](https://imagekit.io/docs/effects-and-enhancements#opacity---o). + */ + public function withOpacity(float $opacity): self + { + $obj = clone $this; + $obj->opacity = $opacity; + + return $obj; + } + + /** + * If set to true, serves the original file without applying any transformations. + * See [Deliver original file as-is](https://imagekit.io/docs/core-delivery-features#deliver-original-file-as-is---orig-true). + */ + public function withOriginal(bool $original): self + { + $obj = clone $this; + $obj->original = $original; + + return $obj; + } + + /** + * Specifies an overlay to be applied on the parent image or video. + * ImageKit supports overlays including images, text, videos, subtitles, and solid colors. + * See [Overlay using layers](https://imagekit.io/docs/transformations#overlay-using-layers). + */ + public function withOverlay( + TextOverlay|ImageOverlay|VideoOverlay|SubtitleOverlay|SolidColorOverlay $overlay, + ): self { + $obj = clone $this; + $obj->overlay = $overlay; + + return $obj; + } + + /** + * Extracts a specific page or frame from multi-page or layered files (PDF, PSD, AI). + * For example, specify by number (e.g., `2`), a range (e.g., `3-4` for the 2nd and 3rd layers), + * or by name (e.g., `name-layer-4` for a PSD layer). + * See [Thumbnail extraction](https://imagekit.io/docs/vector-and-animated-images#get-thumbnail-from-psd-pdf-ai-eps-and-animated-files). + */ + public function withPage(float|string $page): self + { + $obj = clone $this; + $obj->page = $page; + + return $obj; + } + + /** + * Specifies whether the output JPEG image should be rendered progressively. Progressive loading begins with a low-quality, + * pixelated version of the full image, which gradually improves to provide a faster perceived load time. + * See [Progressive images](https://imagekit.io/docs/image-optimization#progressive-image---pr). + */ + public function withProgressive(bool $progressive): self + { + $obj = clone $this; + $obj->progressive = $progressive; + + return $obj; + } + + /** + * Specifies the quality of the output image for lossy formats such as JPEG, WebP, and AVIF. + * A higher quality value results in a larger file size with better quality, while a lower value produces a smaller file size with reduced quality. + * See [Quality](https://imagekit.io/docs/image-optimization#quality---q). + */ + public function withQuality(float $quality): self + { + $obj = clone $this; + $obj->quality = $quality; + + return $obj; + } + + /** + * Specifies the corner radius for rounded corners (e.g., 20) or `max` for circular or oval shape. + * See [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). + */ + public function withRadius(float|string $radius): self + { + $obj = clone $this; + $obj->radius = $radius; + + return $obj; + } + + /** + * Pass any transformation not directly supported by the SDK. + * This transformation string is appended to the URL as provided. + */ + public function withRaw(string $raw): self + { + $obj = clone $this; + $obj->raw = $raw; + + return $obj; + } + + /** + * Specifies the rotation angle in degrees. Positive values rotate the image clockwise; you can also use, for example, `N40` for counterclockwise rotation + * or `auto` to use the orientation specified in the image's EXIF data. + * For videos, only the following values are supported: 0, 90, 180, 270, or 360. + * See [Rotate](https://imagekit.io/docs/effects-and-enhancements#rotate---rt). + */ + public function withRotation(float|string $rotation): self + { + $obj = clone $this; + $obj->rotation = $rotation; + + return $obj; + } + + /** + * Adds a shadow beneath solid objects in an image with a transparent background. + * For AI-based drop shadows, refer to aiDropShadow. + * Pass `true` for a default shadow, or provide a string for a custom shadow. + * See [Shadow](https://imagekit.io/docs/effects-and-enhancements#shadow---e-shadow). + */ + public function withShadow(bool|string $shadow): self + { + $obj = clone $this; + $obj->shadow = $shadow; + + return $obj; + } + + /** + * Sharpens the input image, highlighting edges and finer details. + * Pass `true` for default sharpening, or provide a numeric value for custom sharpening. + * See [Sharpen](https://imagekit.io/docs/effects-and-enhancements#sharpen---e-sharpen). + */ + public function withSharpen(bool|float $sharpen): self + { + $obj = clone $this; + $obj->sharpen = $sharpen; + + return $obj; + } + + /** + * Specifies the start offset (in seconds) for trimming videos, e.g., `5` or `10.5`. + * Arithmetic expressions are also supported. + * See [Trim videos – Start offset](https://imagekit.io/docs/trim-videos#start-offset---so). + */ + public function withStartOffset(float|string $startOffset): self + { + $obj = clone $this; + $obj->startOffset = $startOffset; + + return $obj; + } + + /** + * An array of resolutions for adaptive bitrate streaming, e.g., [`240`, `360`, `480`, `720`, `1080`]. + * See [Adaptive Bitrate Streaming](https://imagekit.io/docs/adaptive-bitrate-streaming). + * + * @param list $streamingResolutions + */ + public function withStreamingResolutions(array $streamingResolutions): self + { + $obj = clone $this; + $obj->streamingResolutions = $streamingResolutions; + + return $obj; + } + + /** + * Useful for images with a solid or nearly solid background and a central object. This parameter trims the background, + * leaving only the central object in the output image. + * See [Trim edges](https://imagekit.io/docs/effects-and-enhancements#trim-edges---t). + */ + public function withTrim(bool|float $trim): self + { + $obj = clone $this; + $obj->trim = $trim; + + return $obj; + } + + /** + * Applies Unsharp Masking (USM), an image sharpening technique. + * Pass `true` for a default unsharp mask, or provide a string for a custom unsharp mask. + * See [Unsharp Mask](https://imagekit.io/docs/effects-and-enhancements#unsharp-mask---e-usm). + */ + public function withUnsharpMask(bool|string $unsharpMask): self + { + $obj = clone $this; + $obj->unsharpMask = $unsharpMask; + + return $obj; + } + + /** + * Specifies the video codec, e.g., `h264`, `vp9`, `av1`, or `none`. See [Video codec](https://imagekit.io/docs/video-optimization#video-codec---vc). + * + * @param VideoCodec::* $videoCodec + */ + public function withVideoCodec(string $videoCodec): self + { + $obj = clone $this; + $obj->videoCodec = $videoCodec; + + return $obj; + } + + /** + * Specifies the width of the output. If a value between 0 and 1 is provided, it is treated as a percentage (e.g., `0.4` represents 40% of the original width). + * You can also supply arithmetic expressions (e.g., `iw_div_2`). + * Width transformation – [Images](https://imagekit.io/docs/image-resize-and-crop#width---w) · [Videos](https://imagekit.io/docs/video-resize-and-crop#width---w). + */ + public function withWidth(float|string $width): self + { + $obj = clone $this; + $obj->width = $width; + + return $obj; + } + + /** + * Focus using cropped image coordinates - X coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). + */ + public function withX(float|string $x): self + { + $obj = clone $this; + $obj->x = $x; + + return $obj; + } + + /** + * Focus using cropped image coordinates - X center coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). + */ + public function withXCenter(float|string $xCenter): self + { + $obj = clone $this; + $obj->xCenter = $xCenter; + + return $obj; + } + + /** + * Focus using cropped image coordinates - Y coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). + */ + public function withY(float|string $y): self + { + $obj = clone $this; + $obj->y = $y; + + return $obj; + } + + /** + * Focus using cropped image coordinates - Y center coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). + */ + public function withYCenter(float|string $yCenter): self + { + $obj = clone $this; + $obj->yCenter = $yCenter; + + return $obj; + } + + /** + * Accepts a numeric value that determines how much to zoom in or out of the cropped area. + * It should be used in conjunction with fo-face or fo-. + * See [Zoom](https://imagekit.io/docs/image-resize-and-crop#zoom---z). + */ + public function withZoom(float $zoom): self + { + $obj = clone $this; + $obj->zoom = $zoom; + + return $obj; + } +} diff --git a/src/Transformation/AIDropShadow.php b/src/Transformation/AIDropShadow.php new file mode 100644 index 00000000..0956b9dc --- /dev/null +++ b/src/Transformation/AIDropShadow.php @@ -0,0 +1,30 @@ +|array + */ + public static function variants(): array + { + return [STAINLESS_FIXME_::class, 'string']; + } +} diff --git a/src/Transformation/AIRemoveBackground.php b/src/Transformation/AIRemoveBackground.php new file mode 100644 index 00000000..d5375dd4 --- /dev/null +++ b/src/Transformation/AIRemoveBackground.php @@ -0,0 +1,20 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/Transformation/AudioCodec.php b/src/Transformation/AudioCodec.php new file mode 100644 index 00000000..36649c03 --- /dev/null +++ b/src/Transformation/AudioCodec.php @@ -0,0 +1,22 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/Transformation/EndOffset.php b/src/Transformation/EndOffset.php new file mode 100644 index 00000000..812867ba --- /dev/null +++ b/src/Transformation/EndOffset.php @@ -0,0 +1,28 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/Transformation/Flip.php b/src/Transformation/Flip.php new file mode 100644 index 00000000..8aa3c49c --- /dev/null +++ b/src/Transformation/Flip.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return [STAINLESS_FIXME_::class, 'string']; + } +} diff --git a/src/Transformation/Grayscale.php b/src/Transformation/Grayscale.php new file mode 100644 index 00000000..322a1e50 --- /dev/null +++ b/src/Transformation/Grayscale.php @@ -0,0 +1,18 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/Transformation/Page.php b/src/Transformation/Page.php new file mode 100644 index 00000000..71856748 --- /dev/null +++ b/src/Transformation/Page.php @@ -0,0 +1,29 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/Transformation/Radius.php b/src/Transformation/Radius.php new file mode 100644 index 00000000..e0db8a3c --- /dev/null +++ b/src/Transformation/Radius.php @@ -0,0 +1,27 @@ +|array + */ + public static function variants(): array + { + return ['float', STAINLESS_FIXME_::class]; + } +} diff --git a/src/Transformation/Rotation.php b/src/Transformation/Rotation.php new file mode 100644 index 00000000..3131b9ad --- /dev/null +++ b/src/Transformation/Rotation.php @@ -0,0 +1,29 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/Transformation/Shadow.php b/src/Transformation/Shadow.php new file mode 100644 index 00000000..be32ac24 --- /dev/null +++ b/src/Transformation/Shadow.php @@ -0,0 +1,29 @@ +|array + */ + public static function variants(): array + { + return [STAINLESS_FIXME_::class, 'string']; + } +} diff --git a/src/Transformation/Sharpen.php b/src/Transformation/Sharpen.php new file mode 100644 index 00000000..760f37d1 --- /dev/null +++ b/src/Transformation/Sharpen.php @@ -0,0 +1,28 @@ +|array + */ + public static function variants(): array + { + return [STAINLESS_FIXME_::class, 'float']; + } +} diff --git a/src/Transformation/StartOffset.php b/src/Transformation/StartOffset.php new file mode 100644 index 00000000..654c0e6f --- /dev/null +++ b/src/Transformation/StartOffset.php @@ -0,0 +1,28 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/Transformation/Trim.php b/src/Transformation/Trim.php new file mode 100644 index 00000000..650352e3 --- /dev/null +++ b/src/Transformation/Trim.php @@ -0,0 +1,28 @@ +|array + */ + public static function variants(): array + { + return [STAINLESS_FIXME_::class, 'float']; + } +} diff --git a/src/Transformation/UnsharpMask.php b/src/Transformation/UnsharpMask.php new file mode 100644 index 00000000..5bd59aef --- /dev/null +++ b/src/Transformation/UnsharpMask.php @@ -0,0 +1,28 @@ +|array + */ + public static function variants(): array + { + return [STAINLESS_FIXME_::class, 'string']; + } +} diff --git a/src/Transformation/VideoCodec.php b/src/Transformation/VideoCodec.php new file mode 100644 index 00000000..36b0a0f9 --- /dev/null +++ b/src/Transformation/VideoCodec.php @@ -0,0 +1,24 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/Transformation/X.php b/src/Transformation/X.php new file mode 100644 index 00000000..0a5acbc2 --- /dev/null +++ b/src/Transformation/X.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/Transformation/XCenter.php b/src/Transformation/XCenter.php new file mode 100644 index 00000000..91b329dc --- /dev/null +++ b/src/Transformation/XCenter.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/Transformation/Y.php b/src/Transformation/Y.php new file mode 100644 index 00000000..5338015b --- /dev/null +++ b/src/Transformation/Y.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/Transformation/YCenter.php b/src/Transformation/YCenter.php new file mode 100644 index 00000000..2520968d --- /dev/null +++ b/src/Transformation/YCenter.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/TransformationPosition.php b/src/TransformationPosition.php new file mode 100644 index 00000000..ca606f89 --- /dev/null +++ b/src/TransformationPosition.php @@ -0,0 +1,22 @@ +|null, + * } + */ +final class VideoOverlay implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + #[Api] + public string $type = 'video'; + + /** + * Specifies the relative path to the video used as an overlay. + */ + #[Api] + public string $input; + + /** + * The input path can be included in the layer as either `i-{input}` or `ie-{base64_encoded_input}`. + * By default, the SDK determines the appropriate format automatically. + * To always use base64 encoding (`ie-{base64}`), set this parameter to `base64`. + * To always use plain text (`i-{input}`), set it to `plain`. + * + * @var Encoding::*|null $encoding + */ + #[Api(enum: Encoding::class, optional: true)] + public ?string $encoding; + + /** + * Array of transformation to be applied to the overlay video. Except `streamingResolutions`, all other video transformations are supported. + * See [Video transformations](https://imagekit.io/docs/video-transformation). + * + * @var list|null $transformation + */ + #[Api(list: Transformation::class, optional: true)] + public ?array $transformation; + + /** + * `new VideoOverlay()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * VideoOverlay::with(input: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new VideoOverlay)->withInput(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Encoding::* $encoding + * @param list $transformation + */ + public static function with( + string $input, + ?string $encoding = null, + ?array $transformation = null + ): self { + $obj = new self; + + $obj->input = $input; + + null !== $encoding && $obj->encoding = $encoding; + null !== $transformation && $obj->transformation = $transformation; + + return $obj; + } + + /** + * Specifies the relative path to the video used as an overlay. + */ + public function withInput(string $input): self + { + $obj = clone $this; + $obj->input = $input; + + return $obj; + } + + /** + * The input path can be included in the layer as either `i-{input}` or `ie-{base64_encoded_input}`. + * By default, the SDK determines the appropriate format automatically. + * To always use base64 encoding (`ie-{base64}`), set this parameter to `base64`. + * To always use plain text (`i-{input}`), set it to `plain`. + * + * @param Encoding::* $encoding + */ + public function withEncoding(string $encoding): self + { + $obj = clone $this; + $obj->encoding = $encoding; + + return $obj; + } + + /** + * Array of transformation to be applied to the overlay video. Except `streamingResolutions`, all other video transformations are supported. + * See [Video transformations](https://imagekit.io/docs/video-transformation). + * + * @param list $transformation + */ + public function withTransformation(array $transformation): self + { + $obj = clone $this; + $obj->transformation = $transformation; + + return $obj; + } +} diff --git a/src/VideoOverlay/Encoding.php b/src/VideoOverlay/Encoding.php new file mode 100644 index 00000000..1a789570 --- /dev/null +++ b/src/VideoOverlay/Encoding.php @@ -0,0 +1,25 @@ +|array + */ + public static function variants(): array + { + return [ + VideoTransformationAcceptedEvent::class, + VideoTransformationReadyEvent::class, + VideoTransformationErrorEvent::class, + UploadPreTransformSuccessEvent::class, + UploadPreTransformErrorEvent::class, + UploadPostTransformSuccessEvent::class, + UploadPostTransformErrorEvent::class, + ]; + } +} diff --git a/src/Webhooks/UnwrapWebhookEvent.php b/src/Webhooks/UnwrapWebhookEvent.php new file mode 100644 index 00000000..98b83129 --- /dev/null +++ b/src/Webhooks/UnwrapWebhookEvent.php @@ -0,0 +1,34 @@ +|array + */ + public static function variants(): array + { + return [ + VideoTransformationAcceptedEvent::class, + VideoTransformationReadyEvent::class, + VideoTransformationErrorEvent::class, + UploadPreTransformSuccessEvent::class, + UploadPreTransformErrorEvent::class, + UploadPostTransformSuccessEvent::class, + UploadPostTransformErrorEvent::class, + ]; + } +} diff --git a/src/Webhooks/UploadPostTransformErrorEvent.php b/src/Webhooks/UploadPostTransformErrorEvent.php new file mode 100644 index 00000000..840b2dd5 --- /dev/null +++ b/src/Webhooks/UploadPostTransformErrorEvent.php @@ -0,0 +1,133 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'upload.post-transform.error'; + + /** + * Unique identifier for the event. + */ + #[Api] + public string $id; + + /** + * Timestamp of when the event occurred in ISO8601 format. + */ + #[Api('created_at')] + public \DateTimeInterface $createdAt; + + #[Api] + public Data $data; + + #[Api] + public Request $request; + + /** + * `new UploadPostTransformErrorEvent()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * UploadPostTransformErrorEvent::with( + * id: ..., createdAt: ..., data: ..., request: ... + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new UploadPostTransformErrorEvent) + * ->withID(...) + * ->withCreatedAt(...) + * ->withData(...) + * ->withRequest(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $id, + \DateTimeInterface $createdAt, + Data $data, + Request $request + ): self { + $obj = new self; + + $obj->id = $id; + $obj->createdAt = $createdAt; + $obj->data = $data; + $obj->request = $request; + + return $obj; + } + + /** + * Unique identifier for the event. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * Timestamp of when the event occurred in ISO8601 format. + */ + public function withCreatedAt(\DateTimeInterface $createdAt): self + { + $obj = clone $this; + $obj->createdAt = $createdAt; + + return $obj; + } + + public function withData(Data $data): self + { + $obj = clone $this; + $obj->data = $data; + + return $obj; + } + + public function withRequest(Request $request): self + { + $obj = clone $this; + $obj->request = $request; + + return $obj; + } +} diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data.php b/src/Webhooks/UploadPostTransformErrorEvent/Data.php new file mode 100644 index 00000000..8c1dc160 --- /dev/null +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data.php @@ -0,0 +1,151 @@ + */ + use SdkModel; + + /** + * Unique identifier of the originally uploaded file. + */ + #[Api('fileId')] + public string $fileID; + + /** + * Name of the file. + */ + #[Api] + public string $name; + + /** + * Path of the file. + */ + #[Api] + public string $path; + + #[Api] + public Transformation $transformation; + + /** + * URL of the attempted post-transformation. + */ + #[Api] + public string $url; + + /** + * `new Data()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Data::with(fileID: ..., name: ..., path: ..., transformation: ..., url: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Data) + * ->withFileID(...) + * ->withName(...) + * ->withPath(...) + * ->withTransformation(...) + * ->withURL(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $fileID, + string $name, + string $path, + Transformation $transformation, + string $url, + ): self { + $obj = new self; + + $obj->fileID = $fileID; + $obj->name = $name; + $obj->path = $path; + $obj->transformation = $transformation; + $obj->url = $url; + + return $obj; + } + + /** + * Unique identifier of the originally uploaded file. + */ + public function withFileID(string $fileID): self + { + $obj = clone $this; + $obj->fileID = $fileID; + + return $obj; + } + + /** + * Name of the file. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * Path of the file. + */ + public function withPath(string $path): self + { + $obj = clone $this; + $obj->path = $path; + + return $obj; + } + + public function withTransformation(Transformation $transformation): self + { + $obj = clone $this; + $obj->transformation = $transformation; + + return $obj; + } + + /** + * URL of the attempted post-transformation. + */ + public function withURL(string $url): self + { + $obj = clone $this; + $obj->url = $url; + + return $obj; + } +} diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php new file mode 100644 index 00000000..7c789a94 --- /dev/null +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php @@ -0,0 +1,63 @@ + */ + use SdkModel; + + #[Api] + public Error $error; + + /** + * `new Transformation()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Transformation::with(error: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Transformation)->withError(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(Error $error): self + { + $obj = new self; + + $obj->error = $error; + + return $obj; + } + + public function withError(Error $error): self + { + $obj = clone $this; + $obj->error = $error; + + return $obj; + } +} diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php new file mode 100644 index 00000000..513fbcb2 --- /dev/null +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php @@ -0,0 +1,68 @@ + */ + use SdkModel; + + /** + * Reason for the post-transformation failure. + */ + #[Api] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $reason): self + { + $obj = new self; + + $obj->reason = $reason; + + return $obj; + } + + /** + * Reason for the post-transformation failure. + */ + public function withReason(string $reason): self + { + $obj = clone $this; + $obj->reason = $reason; + + return $obj; + } +} diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request.php b/src/Webhooks/UploadPostTransformErrorEvent/Request.php new file mode 100644 index 00000000..77b43cf4 --- /dev/null +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request.php @@ -0,0 +1,85 @@ + */ + use SdkModel; + + #[Api] + public Transformation $transformation; + + /** + * Unique identifier for the originating request. + */ + #[Api('x_request_id')] + public string $xRequestID; + + /** + * `new Request()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Request::with(transformation: ..., xRequestID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Request)->withTransformation(...)->withXRequestID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + Transformation $transformation, + string $xRequestID + ): self { + $obj = new self; + + $obj->transformation = $transformation; + $obj->xRequestID = $xRequestID; + + return $obj; + } + + public function withTransformation(Transformation $transformation): self + { + $obj = clone $this; + $obj->transformation = $transformation; + + return $obj; + } + + /** + * Unique identifier for the originating request. + */ + public function withXRequestID(string $xRequestID): self + { + $obj = clone $this; + $obj->xRequestID = $xRequestID; + + return $obj; + } +} diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php new file mode 100644 index 00000000..d527b693 --- /dev/null +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php @@ -0,0 +1,123 @@ + */ + use SdkModel; + + /** + * Type of the requested post-transformation. + * + * @var Type::* $type + */ + #[Api(enum: Type::class)] + public string $type; + + /** + * Only applicable if transformation type is 'abs'. Streaming protocol used. + * + * @var Protocol::*|null $protocol + */ + #[Api(enum: Protocol::class, optional: true)] + public ?string $protocol; + + /** + * Value for the requested transformation type. + */ + #[Api(optional: true)] + public ?string $value; + + /** + * `new Transformation()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Transformation::with(type: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Transformation)->withType(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Type::* $type + * @param Protocol::* $protocol + */ + public static function with( + string $type, + ?string $protocol = null, + ?string $value = null + ): self { + $obj = new self; + + $obj->type = $type; + + null !== $protocol && $obj->protocol = $protocol; + null !== $value && $obj->value = $value; + + return $obj; + } + + /** + * Type of the requested post-transformation. + * + * @param Type::* $type + */ + public function withType(string $type): self + { + $obj = clone $this; + $obj->type = $type; + + return $obj; + } + + /** + * Only applicable if transformation type is 'abs'. Streaming protocol used. + * + * @param Protocol::* $protocol + */ + public function withProtocol(string $protocol): self + { + $obj = clone $this; + $obj->protocol = $protocol; + + return $obj; + } + + /** + * Value for the requested transformation type. + */ + public function withValue(string $value): self + { + $obj = clone $this; + $obj->value = $value; + + return $obj; + } +} diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Protocol.php b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Protocol.php new file mode 100644 index 00000000..d33fb754 --- /dev/null +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Protocol.php @@ -0,0 +1,20 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'upload.post-transform.success'; + + /** + * Unique identifier for the event. + */ + #[Api] + public string $id; + + /** + * Timestamp of when the event occurred in ISO8601 format. + */ + #[Api('created_at')] + public \DateTimeInterface $createdAt; + + #[Api] + public Data $data; + + #[Api] + public Request $request; + + /** + * `new UploadPostTransformSuccessEvent()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * UploadPostTransformSuccessEvent::with( + * id: ..., createdAt: ..., data: ..., request: ... + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new UploadPostTransformSuccessEvent) + * ->withID(...) + * ->withCreatedAt(...) + * ->withData(...) + * ->withRequest(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $id, + \DateTimeInterface $createdAt, + Data $data, + Request $request + ): self { + $obj = new self; + + $obj->id = $id; + $obj->createdAt = $createdAt; + $obj->data = $data; + $obj->request = $request; + + return $obj; + } + + /** + * Unique identifier for the event. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * Timestamp of when the event occurred in ISO8601 format. + */ + public function withCreatedAt(\DateTimeInterface $createdAt): self + { + $obj = clone $this; + $obj->createdAt = $createdAt; + + return $obj; + } + + public function withData(Data $data): self + { + $obj = clone $this; + $obj->data = $data; + + return $obj; + } + + public function withRequest(Request $request): self + { + $obj = clone $this; + $obj->request = $request; + + return $obj; + } +} diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Data.php b/src/Webhooks/UploadPostTransformSuccessEvent/Data.php new file mode 100644 index 00000000..6b68558c --- /dev/null +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Data.php @@ -0,0 +1,104 @@ + */ + use SdkModel; + + /** + * Unique identifier of the originally uploaded file. + */ + #[Api('fileId')] + public string $fileID; + + /** + * Name of the file. + */ + #[Api] + public string $name; + + /** + * URL of the generated post-transformation. + */ + #[Api] + public string $url; + + /** + * `new Data()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Data::with(fileID: ..., name: ..., url: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Data)->withFileID(...)->withName(...)->withURL(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $fileID, string $name, string $url): self + { + $obj = new self; + + $obj->fileID = $fileID; + $obj->name = $name; + $obj->url = $url; + + return $obj; + } + + /** + * Unique identifier of the originally uploaded file. + */ + public function withFileID(string $fileID): self + { + $obj = clone $this; + $obj->fileID = $fileID; + + return $obj; + } + + /** + * Name of the file. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * URL of the generated post-transformation. + */ + public function withURL(string $url): self + { + $obj = clone $this; + $obj->url = $url; + + return $obj; + } +} diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request.php new file mode 100644 index 00000000..be526a86 --- /dev/null +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request.php @@ -0,0 +1,85 @@ + */ + use SdkModel; + + #[Api] + public Transformation $transformation; + + /** + * Unique identifier for the originating request. + */ + #[Api('x_request_id')] + public string $xRequestID; + + /** + * `new Request()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Request::with(transformation: ..., xRequestID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Request)->withTransformation(...)->withXRequestID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + Transformation $transformation, + string $xRequestID + ): self { + $obj = new self; + + $obj->transformation = $transformation; + $obj->xRequestID = $xRequestID; + + return $obj; + } + + public function withTransformation(Transformation $transformation): self + { + $obj = clone $this; + $obj->transformation = $transformation; + + return $obj; + } + + /** + * Unique identifier for the originating request. + */ + public function withXRequestID(string $xRequestID): self + { + $obj = clone $this; + $obj->xRequestID = $xRequestID; + + return $obj; + } +} diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php new file mode 100644 index 00000000..ce16b5b9 --- /dev/null +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php @@ -0,0 +1,123 @@ + */ + use SdkModel; + + /** + * Type of the requested post-transformation. + * + * @var Type::* $type + */ + #[Api(enum: Type::class)] + public string $type; + + /** + * Only applicable if transformation type is 'abs'. Streaming protocol used. + * + * @var Protocol::*|null $protocol + */ + #[Api(enum: Protocol::class, optional: true)] + public ?string $protocol; + + /** + * Value for the requested transformation type. + */ + #[Api(optional: true)] + public ?string $value; + + /** + * `new Transformation()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Transformation::with(type: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Transformation)->withType(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Type::* $type + * @param Protocol::* $protocol + */ + public static function with( + string $type, + ?string $protocol = null, + ?string $value = null + ): self { + $obj = new self; + + $obj->type = $type; + + null !== $protocol && $obj->protocol = $protocol; + null !== $value && $obj->value = $value; + + return $obj; + } + + /** + * Type of the requested post-transformation. + * + * @param Type::* $type + */ + public function withType(string $type): self + { + $obj = clone $this; + $obj->type = $type; + + return $obj; + } + + /** + * Only applicable if transformation type is 'abs'. Streaming protocol used. + * + * @param Protocol::* $protocol + */ + public function withProtocol(string $protocol): self + { + $obj = clone $this; + $obj->protocol = $protocol; + + return $obj; + } + + /** + * Value for the requested transformation type. + */ + public function withValue(string $value): self + { + $obj = clone $this; + $obj->value = $value; + + return $obj; + } +} diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Protocol.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Protocol.php new file mode 100644 index 00000000..35a3c151 --- /dev/null +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Protocol.php @@ -0,0 +1,20 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'upload.pre-transform.error'; + + /** + * Unique identifier for the event. + */ + #[Api] + public string $id; + + /** + * Timestamp of when the event occurred in ISO8601 format. + */ + #[Api('created_at')] + public \DateTimeInterface $createdAt; + + #[Api] + public Data $data; + + #[Api] + public Request $request; + + /** + * `new UploadPreTransformErrorEvent()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * UploadPreTransformErrorEvent::with( + * id: ..., createdAt: ..., data: ..., request: ... + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new UploadPreTransformErrorEvent) + * ->withID(...) + * ->withCreatedAt(...) + * ->withData(...) + * ->withRequest(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $id, + \DateTimeInterface $createdAt, + Data $data, + Request $request + ): self { + $obj = new self; + + $obj->id = $id; + $obj->createdAt = $createdAt; + $obj->data = $data; + $obj->request = $request; + + return $obj; + } + + /** + * Unique identifier for the event. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * Timestamp of when the event occurred in ISO8601 format. + */ + public function withCreatedAt(\DateTimeInterface $createdAt): self + { + $obj = clone $this; + $obj->createdAt = $createdAt; + + return $obj; + } + + public function withData(Data $data): self + { + $obj = clone $this; + $obj->data = $data; + + return $obj; + } + + public function withRequest(Request $request): self + { + $obj = clone $this; + $obj->request = $request; + + return $obj; + } +} diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data.php b/src/Webhooks/UploadPreTransformErrorEvent/Data.php new file mode 100644 index 00000000..b502228e --- /dev/null +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data.php @@ -0,0 +1,104 @@ + */ + use SdkModel; + + /** + * Name of the file. + */ + #[Api] + public string $name; + + /** + * Path of the file. + */ + #[Api] + public string $path; + + #[Api] + public Transformation $transformation; + + /** + * `new Data()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Data::with(name: ..., path: ..., transformation: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Data)->withName(...)->withPath(...)->withTransformation(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $name, + string $path, + Transformation $transformation + ): self { + $obj = new self; + + $obj->name = $name; + $obj->path = $path; + $obj->transformation = $transformation; + + return $obj; + } + + /** + * Name of the file. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * Path of the file. + */ + public function withPath(string $path): self + { + $obj = clone $this; + $obj->path = $path; + + return $obj; + } + + public function withTransformation(Transformation $transformation): self + { + $obj = clone $this; + $obj->transformation = $transformation; + + return $obj; + } +} diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php new file mode 100644 index 00000000..58bcc84a --- /dev/null +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php @@ -0,0 +1,63 @@ + */ + use SdkModel; + + #[Api] + public Error $error; + + /** + * `new Transformation()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Transformation::with(error: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Transformation)->withError(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(Error $error): self + { + $obj = new self; + + $obj->error = $error; + + return $obj; + } + + public function withError(Error $error): self + { + $obj = clone $this; + $obj->error = $error; + + return $obj; + } +} diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php new file mode 100644 index 00000000..cd34d2a7 --- /dev/null +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php @@ -0,0 +1,68 @@ + */ + use SdkModel; + + /** + * Reason for the pre-transformation failure. + */ + #[Api] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $reason): self + { + $obj = new self; + + $obj->reason = $reason; + + return $obj; + } + + /** + * Reason for the pre-transformation failure. + */ + public function withReason(string $reason): self + { + $obj = clone $this; + $obj->reason = $reason; + + return $obj; + } +} diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Request.php b/src/Webhooks/UploadPreTransformErrorEvent/Request.php new file mode 100644 index 00000000..30288322 --- /dev/null +++ b/src/Webhooks/UploadPreTransformErrorEvent/Request.php @@ -0,0 +1,88 @@ + */ + use SdkModel; + + /** + * The requested pre-transformation string. + */ + #[Api] + public string $transformation; + + /** + * Unique identifier for the originating request. + */ + #[Api('x_request_id')] + public string $xRequestID; + + /** + * `new Request()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Request::with(transformation: ..., xRequestID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Request)->withTransformation(...)->withXRequestID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $transformation, + string $xRequestID + ): self { + $obj = new self; + + $obj->transformation = $transformation; + $obj->xRequestID = $xRequestID; + + return $obj; + } + + /** + * The requested pre-transformation string. + */ + public function withTransformation(string $transformation): self + { + $obj = clone $this; + $obj->transformation = $transformation; + + return $obj; + } + + /** + * Unique identifier for the originating request. + */ + public function withXRequestID(string $xRequestID): self + { + $obj = clone $this; + $obj->xRequestID = $xRequestID; + + return $obj; + } +} diff --git a/src/Webhooks/UploadPreTransformSuccessEvent.php b/src/Webhooks/UploadPreTransformSuccessEvent.php new file mode 100644 index 00000000..77f3a5ce --- /dev/null +++ b/src/Webhooks/UploadPreTransformSuccessEvent.php @@ -0,0 +1,139 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'upload.pre-transform.success'; + + /** + * Unique identifier for the event. + */ + #[Api] + public string $id; + + /** + * Timestamp of when the event occurred in ISO8601 format. + */ + #[Api('created_at')] + public \DateTimeInterface $createdAt; + + /** + * Object containing details of a successful upload. + */ + #[Api] + public Data $data; + + #[Api] + public Request $request; + + /** + * `new UploadPreTransformSuccessEvent()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * UploadPreTransformSuccessEvent::with( + * id: ..., createdAt: ..., data: ..., request: ... + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new UploadPreTransformSuccessEvent) + * ->withID(...) + * ->withCreatedAt(...) + * ->withData(...) + * ->withRequest(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $id, + \DateTimeInterface $createdAt, + Data $data, + Request $request + ): self { + $obj = new self; + + $obj->id = $id; + $obj->createdAt = $createdAt; + $obj->data = $data; + $obj->request = $request; + + return $obj; + } + + /** + * Unique identifier for the event. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * Timestamp of when the event occurred in ISO8601 format. + */ + public function withCreatedAt(\DateTimeInterface $createdAt): self + { + $obj = clone $this; + $obj->createdAt = $createdAt; + + return $obj; + } + + /** + * Object containing details of a successful upload. + */ + public function withData(Data $data): self + { + $obj = clone $this; + $obj->data = $data; + + return $obj; + } + + public function withRequest(Request $request): self + { + $obj = clone $this; + $obj->request = $request; + + return $obj; + } +} diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php new file mode 100644 index 00000000..e4553404 --- /dev/null +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php @@ -0,0 +1,556 @@ +|null, + * audioCodec?: string|null, + * bitRate?: int|null, + * customCoordinates?: string|null, + * customMetadata?: array|null, + * description?: string|null, + * duration?: int|null, + * embeddedMetadata?: array|null, + * extensionStatus?: ExtensionStatus|null, + * fileID?: string|null, + * filePath?: string|null, + * fileType?: string|null, + * height?: float|null, + * isPrivateFile?: bool|null, + * isPublished?: bool|null, + * metadata?: Metadata|null, + * name?: string|null, + * size?: float|null, + * tags?: list|null, + * thumbnailURL?: string|null, + * url?: string|null, + * versionInfo?: VersionInfo|null, + * videoCodec?: string|null, + * width?: float|null, + * } + */ +final class Data implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * An array of tags assigned to the uploaded file by auto tagging. + * + * @var list|null $aiTags + */ + #[Api('AITags', list: AITag::class, nullable: true, optional: true)] + public ?array $aiTags; + + /** + * The audio codec used in the video (only for video). + */ + #[Api(optional: true)] + public ?string $audioCodec; + + /** + * The bit rate of the video in kbps (only for video). + */ + #[Api(optional: true)] + public ?int $bitRate; + + /** + * Value of custom coordinates associated with the image in the format `x,y,width,height`. If `customCoordinates` are not defined, then it is `null`. Send `customCoordinates` in `responseFields` in API request to get the value of this field. + */ + #[Api(nullable: true, optional: true)] + public ?string $customCoordinates; + + /** + * A key-value data associated with the asset. Use `responseField` in API request to get `customMetadata` in the upload API response. Before setting any custom metadata on an asset, you have to create the field using custom metadata fields API. Send `customMetadata` in `responseFields` in API request to get the value of this field. + * + * @var array|null $customMetadata + */ + #[Api(map: 'mixed', optional: true)] + public ?array $customMetadata; + + /** + * Optional text to describe the contents of the file. Can be set by the user or the ai-auto-description extension. + */ + #[Api(optional: true)] + public ?string $description; + + /** + * The duration of the video in seconds (only for video). + */ + #[Api(optional: true)] + public ?int $duration; + + /** + * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. Send `embeddedMetadata` in `responseFields` in API request to get embeddedMetadata in the upload API response. + * + * @var array|null $embeddedMetadata + */ + #[Api(map: 'mixed', optional: true)] + public ?array $embeddedMetadata; + + /** + * Extension names with their processing status at the time of completion of the request. It could have one of the following status values: + * + * `success`: The extension has been successfully applied. + * `failed`: The extension has failed and will not be retried. + * `pending`: The extension will finish processing in some time. On completion, the final status (success / failed) will be sent to the `webhookUrl` provided. + * + * If no extension was requested, then this parameter is not returned. + */ + #[Api(optional: true)] + public ?ExtensionStatus $extensionStatus; + + /** + * Unique fileId. Store this fileld in your database, as this will be used to perform update action on this file. + */ + #[Api('fileId', optional: true)] + public ?string $fileID; + + /** + * The relative path of the file in the media library e.g. `/marketing-assets/new-banner.jpg`. + */ + #[Api(optional: true)] + public ?string $filePath; + + /** + * Type of the uploaded file. Possible values are `image`, `non-image`. + */ + #[Api(optional: true)] + public ?string $fileType; + + /** + * Height of the image in pixels (Only for images). + */ + #[Api(optional: true)] + public ?float $height; + + /** + * Is the file marked as private. It can be either `true` or `false`. Send `isPrivateFile` in `responseFields` in API request to get the value of this field. + */ + #[Api(optional: true)] + public ?bool $isPrivateFile; + + /** + * Is the file published or in draft state. It can be either `true` or `false`. Send `isPublished` in `responseFields` in API request to get the value of this field. + */ + #[Api(optional: true)] + public ?bool $isPublished; + + /** + * Legacy metadata. Send `metadata` in `responseFields` in API request to get metadata in the upload API response. + */ + #[Api(optional: true)] + public ?Metadata $metadata; + + /** + * Name of the asset. + */ + #[Api(optional: true)] + public ?string $name; + + /** + * Size of the image file in Bytes. + */ + #[Api(optional: true)] + public ?float $size; + + /** + * The array of tags associated with the asset. If no tags are set, it will be `null`. Send `tags` in `responseFields` in API request to get the value of this field. + * + * @var list|null $tags + */ + #[Api(list: 'string', nullable: true, optional: true)] + public ?array $tags; + + /** + * In the case of an image, a small thumbnail URL. + */ + #[Api('thumbnailUrl', optional: true)] + public ?string $thumbnailURL; + + /** + * A publicly accessible URL of the file. + */ + #[Api(optional: true)] + public ?string $url; + + /** + * An object containing the file or file version's `id` (versionId) and `name`. + */ + #[Api(optional: true)] + public ?VersionInfo $versionInfo; + + /** + * The video codec used in the video (only for video). + */ + #[Api(optional: true)] + public ?string $videoCodec; + + /** + * Width of the image in pixels (Only for Images). + */ + #[Api(optional: true)] + public ?float $width; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list|null $aiTags + * @param array $customMetadata + * @param array $embeddedMetadata + * @param list|null $tags + */ + public static function with( + ?array $aiTags = null, + ?string $audioCodec = null, + ?int $bitRate = null, + ?string $customCoordinates = null, + ?array $customMetadata = null, + ?string $description = null, + ?int $duration = null, + ?array $embeddedMetadata = null, + ?ExtensionStatus $extensionStatus = null, + ?string $fileID = null, + ?string $filePath = null, + ?string $fileType = null, + ?float $height = null, + ?bool $isPrivateFile = null, + ?bool $isPublished = null, + ?Metadata $metadata = null, + ?string $name = null, + ?float $size = null, + ?array $tags = null, + ?string $thumbnailURL = null, + ?string $url = null, + ?VersionInfo $versionInfo = null, + ?string $videoCodec = null, + ?float $width = null, + ): self { + $obj = new self; + + null !== $aiTags && $obj->aiTags = $aiTags; + null !== $audioCodec && $obj->audioCodec = $audioCodec; + null !== $bitRate && $obj->bitRate = $bitRate; + null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; + null !== $customMetadata && $obj->customMetadata = $customMetadata; + null !== $description && $obj->description = $description; + null !== $duration && $obj->duration = $duration; + null !== $embeddedMetadata && $obj->embeddedMetadata = $embeddedMetadata; + null !== $extensionStatus && $obj->extensionStatus = $extensionStatus; + null !== $fileID && $obj->fileID = $fileID; + null !== $filePath && $obj->filePath = $filePath; + null !== $fileType && $obj->fileType = $fileType; + null !== $height && $obj->height = $height; + null !== $isPrivateFile && $obj->isPrivateFile = $isPrivateFile; + null !== $isPublished && $obj->isPublished = $isPublished; + null !== $metadata && $obj->metadata = $metadata; + null !== $name && $obj->name = $name; + null !== $size && $obj->size = $size; + null !== $tags && $obj->tags = $tags; + null !== $thumbnailURL && $obj->thumbnailURL = $thumbnailURL; + null !== $url && $obj->url = $url; + null !== $versionInfo && $obj->versionInfo = $versionInfo; + null !== $videoCodec && $obj->videoCodec = $videoCodec; + null !== $width && $obj->width = $width; + + return $obj; + } + + /** + * An array of tags assigned to the uploaded file by auto tagging. + * + * @param list|null $aiTags + */ + public function withAITags(?array $aiTags): self + { + $obj = clone $this; + $obj->aiTags = $aiTags; + + return $obj; + } + + /** + * The audio codec used in the video (only for video). + */ + public function withAudioCodec(string $audioCodec): self + { + $obj = clone $this; + $obj->audioCodec = $audioCodec; + + return $obj; + } + + /** + * The bit rate of the video in kbps (only for video). + */ + public function withBitRate(int $bitRate): self + { + $obj = clone $this; + $obj->bitRate = $bitRate; + + return $obj; + } + + /** + * Value of custom coordinates associated with the image in the format `x,y,width,height`. If `customCoordinates` are not defined, then it is `null`. Send `customCoordinates` in `responseFields` in API request to get the value of this field. + */ + public function withCustomCoordinates(?string $customCoordinates): self + { + $obj = clone $this; + $obj->customCoordinates = $customCoordinates; + + return $obj; + } + + /** + * A key-value data associated with the asset. Use `responseField` in API request to get `customMetadata` in the upload API response. Before setting any custom metadata on an asset, you have to create the field using custom metadata fields API. Send `customMetadata` in `responseFields` in API request to get the value of this field. + * + * @param array $customMetadata + */ + public function withCustomMetadata(array $customMetadata): self + { + $obj = clone $this; + $obj->customMetadata = $customMetadata; + + return $obj; + } + + /** + * Optional text to describe the contents of the file. Can be set by the user or the ai-auto-description extension. + */ + public function withDescription(string $description): self + { + $obj = clone $this; + $obj->description = $description; + + return $obj; + } + + /** + * The duration of the video in seconds (only for video). + */ + public function withDuration(int $duration): self + { + $obj = clone $this; + $obj->duration = $duration; + + return $obj; + } + + /** + * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. Send `embeddedMetadata` in `responseFields` in API request to get embeddedMetadata in the upload API response. + * + * @param array $embeddedMetadata + */ + public function withEmbeddedMetadata(array $embeddedMetadata): self + { + $obj = clone $this; + $obj->embeddedMetadata = $embeddedMetadata; + + return $obj; + } + + /** + * Extension names with their processing status at the time of completion of the request. It could have one of the following status values: + * + * `success`: The extension has been successfully applied. + * `failed`: The extension has failed and will not be retried. + * `pending`: The extension will finish processing in some time. On completion, the final status (success / failed) will be sent to the `webhookUrl` provided. + * + * If no extension was requested, then this parameter is not returned. + */ + public function withExtensionStatus(ExtensionStatus $extensionStatus): self + { + $obj = clone $this; + $obj->extensionStatus = $extensionStatus; + + return $obj; + } + + /** + * Unique fileId. Store this fileld in your database, as this will be used to perform update action on this file. + */ + public function withFileID(string $fileID): self + { + $obj = clone $this; + $obj->fileID = $fileID; + + return $obj; + } + + /** + * The relative path of the file in the media library e.g. `/marketing-assets/new-banner.jpg`. + */ + public function withFilePath(string $filePath): self + { + $obj = clone $this; + $obj->filePath = $filePath; + + return $obj; + } + + /** + * Type of the uploaded file. Possible values are `image`, `non-image`. + */ + public function withFileType(string $fileType): self + { + $obj = clone $this; + $obj->fileType = $fileType; + + return $obj; + } + + /** + * Height of the image in pixels (Only for images). + */ + public function withHeight(float $height): self + { + $obj = clone $this; + $obj->height = $height; + + return $obj; + } + + /** + * Is the file marked as private. It can be either `true` or `false`. Send `isPrivateFile` in `responseFields` in API request to get the value of this field. + */ + public function withIsPrivateFile(bool $isPrivateFile): self + { + $obj = clone $this; + $obj->isPrivateFile = $isPrivateFile; + + return $obj; + } + + /** + * Is the file published or in draft state. It can be either `true` or `false`. Send `isPublished` in `responseFields` in API request to get the value of this field. + */ + public function withIsPublished(bool $isPublished): self + { + $obj = clone $this; + $obj->isPublished = $isPublished; + + return $obj; + } + + /** + * Legacy metadata. Send `metadata` in `responseFields` in API request to get metadata in the upload API response. + */ + public function withMetadata(Metadata $metadata): self + { + $obj = clone $this; + $obj->metadata = $metadata; + + return $obj; + } + + /** + * Name of the asset. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * Size of the image file in Bytes. + */ + public function withSize(float $size): self + { + $obj = clone $this; + $obj->size = $size; + + return $obj; + } + + /** + * The array of tags associated with the asset. If no tags are set, it will be `null`. Send `tags` in `responseFields` in API request to get the value of this field. + * + * @param list|null $tags + */ + public function withTags(?array $tags): self + { + $obj = clone $this; + $obj->tags = $tags; + + return $obj; + } + + /** + * In the case of an image, a small thumbnail URL. + */ + public function withThumbnailURL(string $thumbnailURL): self + { + $obj = clone $this; + $obj->thumbnailURL = $thumbnailURL; + + return $obj; + } + + /** + * A publicly accessible URL of the file. + */ + public function withURL(string $url): self + { + $obj = clone $this; + $obj->url = $url; + + return $obj; + } + + /** + * An object containing the file or file version's `id` (versionId) and `name`. + */ + public function withVersionInfo(VersionInfo $versionInfo): self + { + $obj = clone $this; + $obj->versionInfo = $versionInfo; + + return $obj; + } + + /** + * The video codec used in the video (only for video). + */ + public function withVideoCodec(string $videoCodec): self + { + $obj = clone $this; + $obj->videoCodec = $videoCodec; + + return $obj; + } + + /** + * Width of the image in pixels (Only for Images). + */ + public function withWidth(float $width): self + { + $obj = clone $this; + $obj->width = $width; + + return $obj; + } +} diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php new file mode 100644 index 00000000..e749ce23 --- /dev/null +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php @@ -0,0 +1,95 @@ + */ + use SdkModel; + + /** + * Confidence score of the tag. + */ + #[Api(optional: true)] + public ?float $confidence; + + /** + * Name of the tag. + */ + #[Api(optional: true)] + public ?string $name; + + /** + * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + */ + #[Api(optional: true)] + public ?string $source; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + ?float $confidence = null, + ?string $name = null, + ?string $source = null + ): self { + $obj = new self; + + null !== $confidence && $obj->confidence = $confidence; + null !== $name && $obj->name = $name; + null !== $source && $obj->source = $source; + + return $obj; + } + + /** + * Confidence score of the tag. + */ + public function withConfidence(float $confidence): self + { + $obj = clone $this; + $obj->confidence = $confidence; + + return $obj; + } + + /** + * Name of the tag. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + */ + public function withSource(string $source): self + { + $obj = clone $this; + $obj->source = $source; + + return $obj; + } +} diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php new file mode 100644 index 00000000..66ec9040 --- /dev/null +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php @@ -0,0 +1,126 @@ + */ + use SdkModel; + + /** @var AIAutoDescription::*|null $aiAutoDescription */ + #[Api('ai-auto-description', enum: AIAutoDescription::class, optional: true)] + public ?string $aiAutoDescription; + + /** @var AwsAutoTagging::*|null $awsAutoTagging */ + #[Api('aws-auto-tagging', enum: AwsAutoTagging::class, optional: true)] + public ?string $awsAutoTagging; + + /** @var GoogleAutoTagging::*|null $googleAutoTagging */ + #[Api('google-auto-tagging', enum: GoogleAutoTagging::class, optional: true)] + public ?string $googleAutoTagging; + + /** @var RemoveBg::*|null $removeBg */ + #[Api('remove-bg', enum: RemoveBg::class, optional: true)] + public ?string $removeBg; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param AIAutoDescription::* $aiAutoDescription + * @param AwsAutoTagging::* $awsAutoTagging + * @param GoogleAutoTagging::* $googleAutoTagging + * @param RemoveBg::* $removeBg + */ + public static function with( + ?string $aiAutoDescription = null, + ?string $awsAutoTagging = null, + ?string $googleAutoTagging = null, + ?string $removeBg = null, + ): self { + $obj = new self; + + null !== $aiAutoDescription && $obj->aiAutoDescription = $aiAutoDescription; + null !== $awsAutoTagging && $obj->awsAutoTagging = $awsAutoTagging; + null !== $googleAutoTagging && $obj->googleAutoTagging = $googleAutoTagging; + null !== $removeBg && $obj->removeBg = $removeBg; + + return $obj; + } + + /** + * @param AIAutoDescription::* $aiAutoDescription + */ + public function withAIAutoDescription(string $aiAutoDescription): self + { + $obj = clone $this; + $obj->aiAutoDescription = $aiAutoDescription; + + return $obj; + } + + /** + * @param AwsAutoTagging::* $awsAutoTagging + */ + public function withAwsAutoTagging(string $awsAutoTagging): self + { + $obj = clone $this; + $obj->awsAutoTagging = $awsAutoTagging; + + return $obj; + } + + /** + * @param GoogleAutoTagging::* $googleAutoTagging + */ + public function withGoogleAutoTagging(string $googleAutoTagging): self + { + $obj = clone $this; + $obj->googleAutoTagging = $googleAutoTagging; + + return $obj; + } + + /** + * @param RemoveBg::* $removeBg + */ + public function withRemoveBg(string $removeBg): self + { + $obj = clone $this; + $obj->removeBg = $removeBg; + + return $obj; + } +} diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AIAutoDescription.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AIAutoDescription.php new file mode 100644 index 00000000..ed95d763 --- /dev/null +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AIAutoDescription.php @@ -0,0 +1,19 @@ + */ + use SdkModel; + + /** + * Unique identifier of the file version. + */ + #[Api(optional: true)] + public ?string $id; + + /** + * Name of the file version. + */ + #[Api(optional: true)] + public ?string $name; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(?string $id = null, ?string $name = null): self + { + $obj = new self; + + null !== $id && $obj->id = $id; + null !== $name && $obj->name = $name; + + return $obj; + } + + /** + * Unique identifier of the file version. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * Name of the file version. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } +} diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Request.php b/src/Webhooks/UploadPreTransformSuccessEvent/Request.php new file mode 100644 index 00000000..8071e5bd --- /dev/null +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Request.php @@ -0,0 +1,88 @@ + */ + use SdkModel; + + /** + * The requested pre-transformation string. + */ + #[Api] + public string $transformation; + + /** + * Unique identifier for the originating request. + */ + #[Api('x_request_id')] + public string $xRequestID; + + /** + * `new Request()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Request::with(transformation: ..., xRequestID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Request)->withTransformation(...)->withXRequestID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $transformation, + string $xRequestID + ): self { + $obj = new self; + + $obj->transformation = $transformation; + $obj->xRequestID = $xRequestID; + + return $obj; + } + + /** + * The requested pre-transformation string. + */ + public function withTransformation(string $transformation): self + { + $obj = clone $this; + $obj->transformation = $transformation; + + return $obj; + } + + /** + * Unique identifier for the originating request. + */ + public function withXRequestID(string $xRequestID): self + { + $obj = clone $this; + $obj->xRequestID = $xRequestID; + + return $obj; + } +} diff --git a/src/Webhooks/VideoTransformationAcceptedEvent.php b/src/Webhooks/VideoTransformationAcceptedEvent.php new file mode 100644 index 00000000..7c868c67 --- /dev/null +++ b/src/Webhooks/VideoTransformationAcceptedEvent.php @@ -0,0 +1,139 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'video.transformation.accepted'; + + /** + * Unique identifier for the event. + */ + #[Api] + public string $id; + + /** + * Timestamp when the event was created in ISO8601 format. + */ + #[Api('created_at')] + public \DateTimeInterface $createdAt; + + #[Api] + public Data $data; + + /** + * Information about the original request that triggered the video transformation. + */ + #[Api] + public Request $request; + + /** + * `new VideoTransformationAcceptedEvent()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * VideoTransformationAcceptedEvent::with( + * id: ..., createdAt: ..., data: ..., request: ... + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new VideoTransformationAcceptedEvent) + * ->withID(...) + * ->withCreatedAt(...) + * ->withData(...) + * ->withRequest(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $id, + \DateTimeInterface $createdAt, + Data $data, + Request $request + ): self { + $obj = new self; + + $obj->id = $id; + $obj->createdAt = $createdAt; + $obj->data = $data; + $obj->request = $request; + + return $obj; + } + + /** + * Unique identifier for the event. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * Timestamp when the event was created in ISO8601 format. + */ + public function withCreatedAt(\DateTimeInterface $createdAt): self + { + $obj = clone $this; + $obj->createdAt = $createdAt; + + return $obj; + } + + public function withData(Data $data): self + { + $obj = clone $this; + $obj->data = $data; + + return $obj; + } + + /** + * Information about the original request that triggered the video transformation. + */ + public function withRequest(Request $request): self + { + $obj = clone $this; + $obj->request = $request; + + return $obj; + } +} diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data.php new file mode 100644 index 00000000..bc3d56ce --- /dev/null +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data.php @@ -0,0 +1,90 @@ + */ + use SdkModel; + + /** + * Information about the source video asset being transformed. + */ + #[Api] + public Asset $asset; + + /** + * Base information about a video transformation request. + */ + #[Api] + public Transformation $transformation; + + /** + * `new Data()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Data::with(asset: ..., transformation: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Data)->withAsset(...)->withTransformation(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + Asset $asset, + Transformation $transformation + ): self { + $obj = new self; + + $obj->asset = $asset; + $obj->transformation = $transformation; + + return $obj; + } + + /** + * Information about the source video asset being transformed. + */ + public function withAsset(Asset $asset): self + { + $obj = clone $this; + $obj->asset = $asset; + + return $obj; + } + + /** + * Base information about a video transformation request. + */ + public function withTransformation(Transformation $transformation): self + { + $obj = clone $this; + $obj->transformation = $transformation; + + return $obj; + } +} diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php new file mode 100644 index 00000000..8f471cdb --- /dev/null +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php @@ -0,0 +1,70 @@ + */ + use SdkModel; + + /** + * URL to download or access the source video file. + */ + #[Api] + public string $url; + + /** + * `new Asset()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Asset::with(url: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Asset)->withURL(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $url): self + { + $obj = new self; + + $obj->url = $url; + + return $obj; + } + + /** + * URL to download or access the source video file. + */ + public function withURL(string $url): self + { + $obj = clone $this; + $obj->url = $url; + + return $obj; + } +} diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php new file mode 100644 index 00000000..cf837b26 --- /dev/null +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php @@ -0,0 +1,105 @@ + */ + use SdkModel; + + /** + * Type of video transformation: + * - `video-transformation`: Standard video processing (resize, format conversion, etc.) + * - `gif-to-video`: Convert animated GIF to video format + * - `video-thumbnail`: Generate thumbnail image from video + * + * @var Type::* $type + */ + #[Api(enum: Type::class)] + public string $type; + + /** + * Configuration options for video transformations. + */ + #[Api(optional: true)] + public ?Options $options; + + /** + * `new Transformation()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Transformation::with(type: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Transformation)->withType(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Type::* $type + */ + public static function with(string $type, ?Options $options = null): self + { + $obj = new self; + + $obj->type = $type; + + null !== $options && $obj->options = $options; + + return $obj; + } + + /** + * Type of video transformation: + * - `video-transformation`: Standard video processing (resize, format conversion, etc.) + * - `gif-to-video`: Convert animated GIF to video format + * - `video-thumbnail`: Generate thumbnail image from video + * + * @param Type::* $type + */ + public function withType(string $type): self + { + $obj = clone $this; + $obj->type = $type; + + return $obj; + } + + /** + * Configuration options for video transformations. + */ + public function withOptions(Options $options): self + { + $obj = clone $this; + $obj->options = $options; + + return $obj; + } +} diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php new file mode 100644 index 00000000..a0723d5b --- /dev/null +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php @@ -0,0 +1,209 @@ +|null, + * videoCodec?: VideoCodec::*|null, + * } + */ +final class Options implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Audio codec used for encoding (aac or opus). + * + * @var AudioCodec::*|null $audioCodec + */ + #[Api('audio_codec', enum: AudioCodec::class, optional: true)] + public ?string $audioCodec; + + /** + * Whether to automatically rotate the video based on metadata. + */ + #[Api('auto_rotate', optional: true)] + public ?bool $autoRotate; + + /** + * Output format for the transformed video or thumbnail. + * + * @var Format::*|null $format + */ + #[Api(enum: Format::class, optional: true)] + public ?string $format; + + /** + * Quality setting for the output video. + */ + #[Api(optional: true)] + public ?int $quality; + + /** + * Streaming protocol for adaptive bitrate streaming. + * + * @var StreamProtocol::*|null $streamProtocol + */ + #[Api('stream_protocol', enum: StreamProtocol::class, optional: true)] + public ?string $streamProtocol; + + /** + * Array of quality representations for adaptive bitrate streaming. + * + * @var list|null $variants + */ + #[Api(list: 'string', optional: true)] + public ?array $variants; + + /** + * Video codec used for encoding (h264, vp9, or av1). + * + * @var VideoCodec::*|null $videoCodec + */ + #[Api('video_codec', enum: VideoCodec::class, optional: true)] + public ?string $videoCodec; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param AudioCodec::* $audioCodec + * @param Format::* $format + * @param StreamProtocol::* $streamProtocol + * @param list $variants + * @param VideoCodec::* $videoCodec + */ + public static function with( + ?string $audioCodec = null, + ?bool $autoRotate = null, + ?string $format = null, + ?int $quality = null, + ?string $streamProtocol = null, + ?array $variants = null, + ?string $videoCodec = null, + ): self { + $obj = new self; + + null !== $audioCodec && $obj->audioCodec = $audioCodec; + null !== $autoRotate && $obj->autoRotate = $autoRotate; + null !== $format && $obj->format = $format; + null !== $quality && $obj->quality = $quality; + null !== $streamProtocol && $obj->streamProtocol = $streamProtocol; + null !== $variants && $obj->variants = $variants; + null !== $videoCodec && $obj->videoCodec = $videoCodec; + + return $obj; + } + + /** + * Audio codec used for encoding (aac or opus). + * + * @param AudioCodec::* $audioCodec + */ + public function withAudioCodec(string $audioCodec): self + { + $obj = clone $this; + $obj->audioCodec = $audioCodec; + + return $obj; + } + + /** + * Whether to automatically rotate the video based on metadata. + */ + public function withAutoRotate(bool $autoRotate): self + { + $obj = clone $this; + $obj->autoRotate = $autoRotate; + + return $obj; + } + + /** + * Output format for the transformed video or thumbnail. + * + * @param Format::* $format + */ + public function withFormat(string $format): self + { + $obj = clone $this; + $obj->format = $format; + + return $obj; + } + + /** + * Quality setting for the output video. + */ + public function withQuality(int $quality): self + { + $obj = clone $this; + $obj->quality = $quality; + + return $obj; + } + + /** + * Streaming protocol for adaptive bitrate streaming. + * + * @param StreamProtocol::* $streamProtocol + */ + public function withStreamProtocol(string $streamProtocol): self + { + $obj = clone $this; + $obj->streamProtocol = $streamProtocol; + + return $obj; + } + + /** + * Array of quality representations for adaptive bitrate streaming. + * + * @param list $variants + */ + public function withVariants(array $variants): self + { + $obj = clone $this; + $obj->variants = $variants; + + return $obj; + } + + /** + * Video codec used for encoding (h264, vp9, or av1). + * + * @param VideoCodec::* $videoCodec + */ + public function withVideoCodec(string $videoCodec): self + { + $obj = clone $this; + $obj->videoCodec = $videoCodec; + + return $obj; + } +} diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/AudioCodec.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/AudioCodec.php new file mode 100644 index 00000000..59206f99 --- /dev/null +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/AudioCodec.php @@ -0,0 +1,20 @@ + */ + use SdkModel; + + /** + * Full URL of the transformation request that was submitted. + */ + #[Api] + public string $url; + + /** + * Unique identifier for the originating transformation request. + */ + #[Api('x_request_id')] + public string $xRequestID; + + /** + * User-Agent header from the original request that triggered the transformation. + */ + #[Api('user_agent', optional: true)] + public ?string $userAgent; + + /** + * `new Request()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Request::with(url: ..., xRequestID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Request)->withURL(...)->withXRequestID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $url, + string $xRequestID, + ?string $userAgent = null + ): self { + $obj = new self; + + $obj->url = $url; + $obj->xRequestID = $xRequestID; + + null !== $userAgent && $obj->userAgent = $userAgent; + + return $obj; + } + + /** + * Full URL of the transformation request that was submitted. + */ + public function withURL(string $url): self + { + $obj = clone $this; + $obj->url = $url; + + return $obj; + } + + /** + * Unique identifier for the originating transformation request. + */ + public function withXRequestID(string $xRequestID): self + { + $obj = clone $this; + $obj->xRequestID = $xRequestID; + + return $obj; + } + + /** + * User-Agent header from the original request that triggered the transformation. + */ + public function withUserAgent(string $userAgent): self + { + $obj = clone $this; + $obj->userAgent = $userAgent; + + return $obj; + } +} diff --git a/src/Webhooks/VideoTransformationErrorEvent.php b/src/Webhooks/VideoTransformationErrorEvent.php new file mode 100644 index 00000000..71938723 --- /dev/null +++ b/src/Webhooks/VideoTransformationErrorEvent.php @@ -0,0 +1,139 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'video.transformation.error'; + + /** + * Unique identifier for the event. + */ + #[Api] + public string $id; + + /** + * Timestamp when the event was created in ISO8601 format. + */ + #[Api('created_at')] + public \DateTimeInterface $createdAt; + + #[Api] + public Data $data; + + /** + * Information about the original request that triggered the video transformation. + */ + #[Api] + public Request $request; + + /** + * `new VideoTransformationErrorEvent()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * VideoTransformationErrorEvent::with( + * id: ..., createdAt: ..., data: ..., request: ... + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new VideoTransformationErrorEvent) + * ->withID(...) + * ->withCreatedAt(...) + * ->withData(...) + * ->withRequest(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $id, + \DateTimeInterface $createdAt, + Data $data, + Request $request + ): self { + $obj = new self; + + $obj->id = $id; + $obj->createdAt = $createdAt; + $obj->data = $data; + $obj->request = $request; + + return $obj; + } + + /** + * Unique identifier for the event. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * Timestamp when the event was created in ISO8601 format. + */ + public function withCreatedAt(\DateTimeInterface $createdAt): self + { + $obj = clone $this; + $obj->createdAt = $createdAt; + + return $obj; + } + + public function withData(Data $data): self + { + $obj = clone $this; + $obj->data = $data; + + return $obj; + } + + /** + * Information about the original request that triggered the video transformation. + */ + public function withRequest(Request $request): self + { + $obj = clone $this; + $obj->request = $request; + + return $obj; + } +} diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data.php b/src/Webhooks/VideoTransformationErrorEvent/Data.php new file mode 100644 index 00000000..20fabdc8 --- /dev/null +++ b/src/Webhooks/VideoTransformationErrorEvent/Data.php @@ -0,0 +1,84 @@ + */ + use SdkModel; + + /** + * Information about the source video asset being transformed. + */ + #[Api] + public Asset $asset; + + #[Api] + public Transformation $transformation; + + /** + * `new Data()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Data::with(asset: ..., transformation: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Data)->withAsset(...)->withTransformation(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + Asset $asset, + Transformation $transformation + ): self { + $obj = new self; + + $obj->asset = $asset; + $obj->transformation = $transformation; + + return $obj; + } + + /** + * Information about the source video asset being transformed. + */ + public function withAsset(Asset $asset): self + { + $obj = clone $this; + $obj->asset = $asset; + + return $obj; + } + + public function withTransformation(Transformation $transformation): self + { + $obj = clone $this; + $obj->transformation = $transformation; + + return $obj; + } +} diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php new file mode 100644 index 00000000..7a282f1d --- /dev/null +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php @@ -0,0 +1,70 @@ + */ + use SdkModel; + + /** + * URL to download or access the source video file. + */ + #[Api] + public string $url; + + /** + * `new Asset()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Asset::with(url: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Asset)->withURL(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $url): self + { + $obj = new self; + + $obj->url = $url; + + return $obj; + } + + /** + * URL to download or access the source video file. + */ + public function withURL(string $url): self + { + $obj = clone $this; + $obj->url = $url; + + return $obj; + } +} diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php new file mode 100644 index 00000000..846bf6cf --- /dev/null +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php @@ -0,0 +1,125 @@ + */ + use SdkModel; + + /** + * Type of video transformation: + * - `video-transformation`: Standard video processing (resize, format conversion, etc.) + * - `gif-to-video`: Convert animated GIF to video format + * - `video-thumbnail`: Generate thumbnail image from video + * + * @var Type::* $type + */ + #[Api(enum: Type::class)] + public string $type; + + /** + * Details about the transformation error. + */ + #[Api(optional: true)] + public ?Error $error; + + /** + * Configuration options for video transformations. + */ + #[Api(optional: true)] + public ?Options $options; + + /** + * `new Transformation()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Transformation::with(type: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Transformation)->withType(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Type::* $type + */ + public static function with( + string $type, + ?Error $error = null, + ?Options $options = null + ): self { + $obj = new self; + + $obj->type = $type; + + null !== $error && $obj->error = $error; + null !== $options && $obj->options = $options; + + return $obj; + } + + /** + * Type of video transformation: + * - `video-transformation`: Standard video processing (resize, format conversion, etc.) + * - `gif-to-video`: Convert animated GIF to video format + * - `video-thumbnail`: Generate thumbnail image from video + * + * @param Type::* $type + */ + public function withType(string $type): self + { + $obj = clone $this; + $obj->type = $type; + + return $obj; + } + + /** + * Details about the transformation error. + */ + public function withError(Error $error): self + { + $obj = clone $this; + $obj->error = $error; + + return $obj; + } + + /** + * Configuration options for video transformations. + */ + public function withOptions(Options $options): self + { + $obj = clone $this; + $obj->options = $options; + + return $obj; + } +} diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php new file mode 100644 index 00000000..c6d6c648 --- /dev/null +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php @@ -0,0 +1,83 @@ + */ + use SdkModel; + + /** + * Specific reason for the transformation failure: + * - `encoding_failed`: Error during video encoding process + * - `download_failed`: Could not download source video + * - `internal_server_error`: Unexpected server error + * + * @var Reason::* $reason + */ + #[Api(enum: Reason::class)] + public string $reason; + + /** + * `new Error()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Error::with(reason: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Error)->withReason(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Reason::* $reason + */ + public static function with(string $reason): self + { + $obj = new self; + + $obj->reason = $reason; + + return $obj; + } + + /** + * Specific reason for the transformation failure: + * - `encoding_failed`: Error during video encoding process + * - `download_failed`: Could not download source video + * - `internal_server_error`: Unexpected server error + * + * @param Reason::* $reason + */ + public function withReason(string $reason): self + { + $obj = clone $this; + $obj->reason = $reason; + + return $obj; + } +} diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error/Reason.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error/Reason.php new file mode 100644 index 00000000..d5c1c151 --- /dev/null +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error/Reason.php @@ -0,0 +1,25 @@ +|null, + * videoCodec?: VideoCodec::*|null, + * } + */ +final class Options implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Audio codec used for encoding (aac or opus). + * + * @var AudioCodec::*|null $audioCodec + */ + #[Api('audio_codec', enum: AudioCodec::class, optional: true)] + public ?string $audioCodec; + + /** + * Whether to automatically rotate the video based on metadata. + */ + #[Api('auto_rotate', optional: true)] + public ?bool $autoRotate; + + /** + * Output format for the transformed video or thumbnail. + * + * @var Format::*|null $format + */ + #[Api(enum: Format::class, optional: true)] + public ?string $format; + + /** + * Quality setting for the output video. + */ + #[Api(optional: true)] + public ?int $quality; + + /** + * Streaming protocol for adaptive bitrate streaming. + * + * @var StreamProtocol::*|null $streamProtocol + */ + #[Api('stream_protocol', enum: StreamProtocol::class, optional: true)] + public ?string $streamProtocol; + + /** + * Array of quality representations for adaptive bitrate streaming. + * + * @var list|null $variants + */ + #[Api(list: 'string', optional: true)] + public ?array $variants; + + /** + * Video codec used for encoding (h264, vp9, or av1). + * + * @var VideoCodec::*|null $videoCodec + */ + #[Api('video_codec', enum: VideoCodec::class, optional: true)] + public ?string $videoCodec; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param AudioCodec::* $audioCodec + * @param Format::* $format + * @param StreamProtocol::* $streamProtocol + * @param list $variants + * @param VideoCodec::* $videoCodec + */ + public static function with( + ?string $audioCodec = null, + ?bool $autoRotate = null, + ?string $format = null, + ?int $quality = null, + ?string $streamProtocol = null, + ?array $variants = null, + ?string $videoCodec = null, + ): self { + $obj = new self; + + null !== $audioCodec && $obj->audioCodec = $audioCodec; + null !== $autoRotate && $obj->autoRotate = $autoRotate; + null !== $format && $obj->format = $format; + null !== $quality && $obj->quality = $quality; + null !== $streamProtocol && $obj->streamProtocol = $streamProtocol; + null !== $variants && $obj->variants = $variants; + null !== $videoCodec && $obj->videoCodec = $videoCodec; + + return $obj; + } + + /** + * Audio codec used for encoding (aac or opus). + * + * @param AudioCodec::* $audioCodec + */ + public function withAudioCodec(string $audioCodec): self + { + $obj = clone $this; + $obj->audioCodec = $audioCodec; + + return $obj; + } + + /** + * Whether to automatically rotate the video based on metadata. + */ + public function withAutoRotate(bool $autoRotate): self + { + $obj = clone $this; + $obj->autoRotate = $autoRotate; + + return $obj; + } + + /** + * Output format for the transformed video or thumbnail. + * + * @param Format::* $format + */ + public function withFormat(string $format): self + { + $obj = clone $this; + $obj->format = $format; + + return $obj; + } + + /** + * Quality setting for the output video. + */ + public function withQuality(int $quality): self + { + $obj = clone $this; + $obj->quality = $quality; + + return $obj; + } + + /** + * Streaming protocol for adaptive bitrate streaming. + * + * @param StreamProtocol::* $streamProtocol + */ + public function withStreamProtocol(string $streamProtocol): self + { + $obj = clone $this; + $obj->streamProtocol = $streamProtocol; + + return $obj; + } + + /** + * Array of quality representations for adaptive bitrate streaming. + * + * @param list $variants + */ + public function withVariants(array $variants): self + { + $obj = clone $this; + $obj->variants = $variants; + + return $obj; + } + + /** + * Video codec used for encoding (h264, vp9, or av1). + * + * @param VideoCodec::* $videoCodec + */ + public function withVideoCodec(string $videoCodec): self + { + $obj = clone $this; + $obj->videoCodec = $videoCodec; + + return $obj; + } +} diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/AudioCodec.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/AudioCodec.php new file mode 100644 index 00000000..796c5e40 --- /dev/null +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/AudioCodec.php @@ -0,0 +1,20 @@ + */ + use SdkModel; + + /** + * Full URL of the transformation request that was submitted. + */ + #[Api] + public string $url; + + /** + * Unique identifier for the originating transformation request. + */ + #[Api('x_request_id')] + public string $xRequestID; + + /** + * User-Agent header from the original request that triggered the transformation. + */ + #[Api('user_agent', optional: true)] + public ?string $userAgent; + + /** + * `new Request()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Request::with(url: ..., xRequestID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Request)->withURL(...)->withXRequestID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $url, + string $xRequestID, + ?string $userAgent = null + ): self { + $obj = new self; + + $obj->url = $url; + $obj->xRequestID = $xRequestID; + + null !== $userAgent && $obj->userAgent = $userAgent; + + return $obj; + } + + /** + * Full URL of the transformation request that was submitted. + */ + public function withURL(string $url): self + { + $obj = clone $this; + $obj->url = $url; + + return $obj; + } + + /** + * Unique identifier for the originating transformation request. + */ + public function withXRequestID(string $xRequestID): self + { + $obj = clone $this; + $obj->xRequestID = $xRequestID; + + return $obj; + } + + /** + * User-Agent header from the original request that triggered the transformation. + */ + public function withUserAgent(string $userAgent): self + { + $obj = clone $this; + $obj->userAgent = $userAgent; + + return $obj; + } +} diff --git a/src/Webhooks/VideoTransformationReadyEvent.php b/src/Webhooks/VideoTransformationReadyEvent.php new file mode 100644 index 00000000..691208d4 --- /dev/null +++ b/src/Webhooks/VideoTransformationReadyEvent.php @@ -0,0 +1,161 @@ + */ + use SdkModel; + + #[Api] + public string $type = 'video.transformation.ready'; + + /** + * Unique identifier for the event. + */ + #[Api] + public string $id; + + /** + * Timestamp when the event was created in ISO8601 format. + */ + #[Api('created_at')] + public \DateTimeInterface $createdAt; + + #[Api] + public Data $data; + + /** + * Information about the original request that triggered the video transformation. + */ + #[Api] + public Request $request; + + /** + * Performance metrics for the transformation process. + */ + #[Api(optional: true)] + public ?Timings $timings; + + /** + * `new VideoTransformationReadyEvent()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * VideoTransformationReadyEvent::with( + * id: ..., createdAt: ..., data: ..., request: ... + * ) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new VideoTransformationReadyEvent) + * ->withID(...) + * ->withCreatedAt(...) + * ->withData(...) + * ->withRequest(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $id, + \DateTimeInterface $createdAt, + Data $data, + Request $request, + ?Timings $timings = null, + ): self { + $obj = new self; + + $obj->id = $id; + $obj->createdAt = $createdAt; + $obj->data = $data; + $obj->request = $request; + + null !== $timings && $obj->timings = $timings; + + return $obj; + } + + /** + * Unique identifier for the event. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * Timestamp when the event was created in ISO8601 format. + */ + public function withCreatedAt(\DateTimeInterface $createdAt): self + { + $obj = clone $this; + $obj->createdAt = $createdAt; + + return $obj; + } + + public function withData(Data $data): self + { + $obj = clone $this; + $obj->data = $data; + + return $obj; + } + + /** + * Information about the original request that triggered the video transformation. + */ + public function withRequest(Request $request): self + { + $obj = clone $this; + $obj->request = $request; + + return $obj; + } + + /** + * Performance metrics for the transformation process. + */ + public function withTimings(Timings $timings): self + { + $obj = clone $this; + $obj->timings = $timings; + + return $obj; + } +} diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data.php b/src/Webhooks/VideoTransformationReadyEvent/Data.php new file mode 100644 index 00000000..3950a1ab --- /dev/null +++ b/src/Webhooks/VideoTransformationReadyEvent/Data.php @@ -0,0 +1,84 @@ + */ + use SdkModel; + + /** + * Information about the source video asset being transformed. + */ + #[Api] + public Asset $asset; + + #[Api] + public Transformation $transformation; + + /** + * `new Data()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Data::with(asset: ..., transformation: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Data)->withAsset(...)->withTransformation(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + Asset $asset, + Transformation $transformation + ): self { + $obj = new self; + + $obj->asset = $asset; + $obj->transformation = $transformation; + + return $obj; + } + + /** + * Information about the source video asset being transformed. + */ + public function withAsset(Asset $asset): self + { + $obj = clone $this; + $obj->asset = $asset; + + return $obj; + } + + public function withTransformation(Transformation $transformation): self + { + $obj = clone $this; + $obj->transformation = $transformation; + + return $obj; + } +} diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php new file mode 100644 index 00000000..ae5d9570 --- /dev/null +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php @@ -0,0 +1,70 @@ + */ + use SdkModel; + + /** + * URL to download or access the source video file. + */ + #[Api] + public string $url; + + /** + * `new Asset()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Asset::with(url: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Asset)->withURL(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $url): self + { + $obj = new self; + + $obj->url = $url; + + return $obj; + } + + /** + * URL to download or access the source video file. + */ + public function withURL(string $url): self + { + $obj = clone $this; + $obj->url = $url; + + return $obj; + } +} diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php new file mode 100644 index 00000000..b2fc39fa --- /dev/null +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php @@ -0,0 +1,125 @@ + */ + use SdkModel; + + /** + * Type of video transformation: + * - `video-transformation`: Standard video processing (resize, format conversion, etc.) + * - `gif-to-video`: Convert animated GIF to video format + * - `video-thumbnail`: Generate thumbnail image from video + * + * @var Type::* $type + */ + #[Api(enum: Type::class)] + public string $type; + + /** + * Configuration options for video transformations. + */ + #[Api(optional: true)] + public ?Options $options; + + /** + * Information about the transformed output video. + */ + #[Api(optional: true)] + public ?Output $output; + + /** + * `new Transformation()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Transformation::with(type: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Transformation)->withType(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Type::* $type + */ + public static function with( + string $type, + ?Options $options = null, + ?Output $output = null + ): self { + $obj = new self; + + $obj->type = $type; + + null !== $options && $obj->options = $options; + null !== $output && $obj->output = $output; + + return $obj; + } + + /** + * Type of video transformation: + * - `video-transformation`: Standard video processing (resize, format conversion, etc.) + * - `gif-to-video`: Convert animated GIF to video format + * - `video-thumbnail`: Generate thumbnail image from video + * + * @param Type::* $type + */ + public function withType(string $type): self + { + $obj = clone $this; + $obj->type = $type; + + return $obj; + } + + /** + * Configuration options for video transformations. + */ + public function withOptions(Options $options): self + { + $obj = clone $this; + $obj->options = $options; + + return $obj; + } + + /** + * Information about the transformed output video. + */ + public function withOutput(Output $output): self + { + $obj = clone $this; + $obj->output = $output; + + return $obj; + } +} diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php new file mode 100644 index 00000000..352cec53 --- /dev/null +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php @@ -0,0 +1,209 @@ +|null, + * videoCodec?: VideoCodec::*|null, + * } + */ +final class Options implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Audio codec used for encoding (aac or opus). + * + * @var AudioCodec::*|null $audioCodec + */ + #[Api('audio_codec', enum: AudioCodec::class, optional: true)] + public ?string $audioCodec; + + /** + * Whether to automatically rotate the video based on metadata. + */ + #[Api('auto_rotate', optional: true)] + public ?bool $autoRotate; + + /** + * Output format for the transformed video or thumbnail. + * + * @var Format::*|null $format + */ + #[Api(enum: Format::class, optional: true)] + public ?string $format; + + /** + * Quality setting for the output video. + */ + #[Api(optional: true)] + public ?int $quality; + + /** + * Streaming protocol for adaptive bitrate streaming. + * + * @var StreamProtocol::*|null $streamProtocol + */ + #[Api('stream_protocol', enum: StreamProtocol::class, optional: true)] + public ?string $streamProtocol; + + /** + * Array of quality representations for adaptive bitrate streaming. + * + * @var list|null $variants + */ + #[Api(list: 'string', optional: true)] + public ?array $variants; + + /** + * Video codec used for encoding (h264, vp9, or av1). + * + * @var VideoCodec::*|null $videoCodec + */ + #[Api('video_codec', enum: VideoCodec::class, optional: true)] + public ?string $videoCodec; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param AudioCodec::* $audioCodec + * @param Format::* $format + * @param StreamProtocol::* $streamProtocol + * @param list $variants + * @param VideoCodec::* $videoCodec + */ + public static function with( + ?string $audioCodec = null, + ?bool $autoRotate = null, + ?string $format = null, + ?int $quality = null, + ?string $streamProtocol = null, + ?array $variants = null, + ?string $videoCodec = null, + ): self { + $obj = new self; + + null !== $audioCodec && $obj->audioCodec = $audioCodec; + null !== $autoRotate && $obj->autoRotate = $autoRotate; + null !== $format && $obj->format = $format; + null !== $quality && $obj->quality = $quality; + null !== $streamProtocol && $obj->streamProtocol = $streamProtocol; + null !== $variants && $obj->variants = $variants; + null !== $videoCodec && $obj->videoCodec = $videoCodec; + + return $obj; + } + + /** + * Audio codec used for encoding (aac or opus). + * + * @param AudioCodec::* $audioCodec + */ + public function withAudioCodec(string $audioCodec): self + { + $obj = clone $this; + $obj->audioCodec = $audioCodec; + + return $obj; + } + + /** + * Whether to automatically rotate the video based on metadata. + */ + public function withAutoRotate(bool $autoRotate): self + { + $obj = clone $this; + $obj->autoRotate = $autoRotate; + + return $obj; + } + + /** + * Output format for the transformed video or thumbnail. + * + * @param Format::* $format + */ + public function withFormat(string $format): self + { + $obj = clone $this; + $obj->format = $format; + + return $obj; + } + + /** + * Quality setting for the output video. + */ + public function withQuality(int $quality): self + { + $obj = clone $this; + $obj->quality = $quality; + + return $obj; + } + + /** + * Streaming protocol for adaptive bitrate streaming. + * + * @param StreamProtocol::* $streamProtocol + */ + public function withStreamProtocol(string $streamProtocol): self + { + $obj = clone $this; + $obj->streamProtocol = $streamProtocol; + + return $obj; + } + + /** + * Array of quality representations for adaptive bitrate streaming. + * + * @param list $variants + */ + public function withVariants(array $variants): self + { + $obj = clone $this; + $obj->variants = $variants; + + return $obj; + } + + /** + * Video codec used for encoding (h264, vp9, or av1). + * + * @param VideoCodec::* $videoCodec + */ + public function withVideoCodec(string $videoCodec): self + { + $obj = clone $this; + $obj->videoCodec = $videoCodec; + + return $obj; + } +} diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/AudioCodec.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/AudioCodec.php new file mode 100644 index 00000000..779ccde7 --- /dev/null +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/AudioCodec.php @@ -0,0 +1,20 @@ + */ + use SdkModel; + + /** + * URL to access the transformed video. + */ + #[Api] + public string $url; + + /** + * Metadata of the output video file. + */ + #[Api('video_metadata', optional: true)] + public ?VideoMetadata $videoMetadata; + + /** + * `new Output()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Output::with(url: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Output)->withURL(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $url, + ?VideoMetadata $videoMetadata = null + ): self { + $obj = new self; + + $obj->url = $url; + + null !== $videoMetadata && $obj->videoMetadata = $videoMetadata; + + return $obj; + } + + /** + * URL to access the transformed video. + */ + public function withURL(string $url): self + { + $obj = clone $this; + $obj->url = $url; + + return $obj; + } + + /** + * Metadata of the output video file. + */ + public function withVideoMetadata(VideoMetadata $videoMetadata): self + { + $obj = clone $this; + $obj->videoMetadata = $videoMetadata; + + return $obj; + } +} diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php new file mode 100644 index 00000000..7b8233e6 --- /dev/null +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php @@ -0,0 +1,134 @@ + */ + use SdkModel; + + /** + * Bitrate of the output video in bits per second. + */ + #[Api] + public int $bitrate; + + /** + * Duration of the output video in seconds. + */ + #[Api] + public float $duration; + + /** + * Height of the output video in pixels. + */ + #[Api] + public int $height; + + /** + * Width of the output video in pixels. + */ + #[Api] + public int $width; + + /** + * `new VideoMetadata()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * VideoMetadata::with(bitrate: ..., duration: ..., height: ..., width: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new VideoMetadata) + * ->withBitrate(...) + * ->withDuration(...) + * ->withHeight(...) + * ->withWidth(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + int $bitrate, + float $duration, + int $height, + int $width + ): self { + $obj = new self; + + $obj->bitrate = $bitrate; + $obj->duration = $duration; + $obj->height = $height; + $obj->width = $width; + + return $obj; + } + + /** + * Bitrate of the output video in bits per second. + */ + public function withBitrate(int $bitrate): self + { + $obj = clone $this; + $obj->bitrate = $bitrate; + + return $obj; + } + + /** + * Duration of the output video in seconds. + */ + public function withDuration(float $duration): self + { + $obj = clone $this; + $obj->duration = $duration; + + return $obj; + } + + /** + * Height of the output video in pixels. + */ + public function withHeight(int $height): self + { + $obj = clone $this; + $obj->height = $height; + + return $obj; + } + + /** + * Width of the output video in pixels. + */ + public function withWidth(int $width): self + { + $obj = clone $this; + $obj->width = $width; + + return $obj; + } +} diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Type.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Type.php new file mode 100644 index 00000000..9b2b35d3 --- /dev/null +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Type.php @@ -0,0 +1,25 @@ + */ + use SdkModel; + + /** + * Full URL of the transformation request that was submitted. + */ + #[Api] + public string $url; + + /** + * Unique identifier for the originating transformation request. + */ + #[Api('x_request_id')] + public string $xRequestID; + + /** + * User-Agent header from the original request that triggered the transformation. + */ + #[Api('user_agent', optional: true)] + public ?string $userAgent; + + /** + * `new Request()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Request::with(url: ..., xRequestID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Request)->withURL(...)->withXRequestID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $url, + string $xRequestID, + ?string $userAgent = null + ): self { + $obj = new self; + + $obj->url = $url; + $obj->xRequestID = $xRequestID; + + null !== $userAgent && $obj->userAgent = $userAgent; + + return $obj; + } + + /** + * Full URL of the transformation request that was submitted. + */ + public function withURL(string $url): self + { + $obj = clone $this; + $obj->url = $url; + + return $obj; + } + + /** + * Unique identifier for the originating transformation request. + */ + public function withXRequestID(string $xRequestID): self + { + $obj = clone $this; + $obj->xRequestID = $xRequestID; + + return $obj; + } + + /** + * User-Agent header from the original request that triggered the transformation. + */ + public function withUserAgent(string $userAgent): self + { + $obj = clone $this; + $obj->userAgent = $userAgent; + + return $obj; + } +} diff --git a/src/Webhooks/VideoTransformationReadyEvent/Timings.php b/src/Webhooks/VideoTransformationReadyEvent/Timings.php new file mode 100644 index 00000000..8ae42494 --- /dev/null +++ b/src/Webhooks/VideoTransformationReadyEvent/Timings.php @@ -0,0 +1,78 @@ + */ + use SdkModel; + + /** + * Time spent downloading the source video from your origin or media library, in milliseconds. + */ + #[Api('download_duration', optional: true)] + public ?int $downloadDuration; + + /** + * Time spent encoding the video, in milliseconds. + */ + #[Api('encoding_duration', optional: true)] + public ?int $encodingDuration; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + ?int $downloadDuration = null, + ?int $encodingDuration = null + ): self { + $obj = new self; + + null !== $downloadDuration && $obj->downloadDuration = $downloadDuration; + null !== $encodingDuration && $obj->encodingDuration = $encodingDuration; + + return $obj; + } + + /** + * Time spent downloading the source video from your origin or media library, in milliseconds. + */ + public function withDownloadDuration(int $downloadDuration): self + { + $obj = clone $this; + $obj->downloadDuration = $downloadDuration; + + return $obj; + } + + /** + * Time spent encoding the video, in milliseconds. + */ + public function withEncodingDuration(int $encodingDuration): self + { + $obj = clone $this; + $obj->encodingDuration = $encodingDuration; + + return $obj; + } +} diff --git a/tests/Core/TestModel.php b/tests/Core/TestModel.php new file mode 100644 index 00000000..06a5ebde --- /dev/null +++ b/tests/Core/TestModel.php @@ -0,0 +1,180 @@ +> */ + use SdkModel; + + #[Api] + public string $name; + + #[Api('age_years')] + public int $ageYears; + + /** @var list|null */ + #[Api(optional: true)] + public ?array $friends; + + #[Api] + public ?string $owner; + + /** + * @param list|null $friends + */ + public function __construct( + string $name, + int $ageYears, + ?string $owner, + ?array $friends = null, + ) { + $this->initialize(); + + $this->name = $name; + $this->ageYears = $ageYears; + $this->owner = $owner; + + null != $friends && $this->friends = $friends; + } +} + +/** + * @internal + * + * @coversNothing + */ +#[CoversNothing] +class TestModelTest extends TestCase +{ + #[Test] + public function testBasicGetAndSet(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertEquals(12, $model->ageYears); + + ++$model->ageYears; + $this->assertEquals(13, $model->ageYears); + } + + #[Test] + public function testNullAccess(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertNull($model->owner); + $this->assertNull($model->friends); + } + + #[Test] + public function testArrayGetAndSet(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $model->friends ??= []; + $this->assertEquals([], $model->friends); + $model->friends[] = 'Alice'; + $this->assertEquals(['Alice'], $model->friends); + } + + #[Test] + public function testDiscernsBetweenNullAndUnset(): void + { + $modelUnsetFriends = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $modelNullFriends = new TestModel( + name: 'bob', + ageYears: 12, + owner: null, + ); + $modelNullFriends->friends = null; + + $this->assertEquals(12, $modelUnsetFriends->ageYears); + $this->assertEquals(12, $modelNullFriends->ageYears); + + $this->assertTrue($modelUnsetFriends->offsetExists('ageYears')); + $this->assertTrue($modelNullFriends->offsetExists('ageYears')); + + $this->assertNull($modelUnsetFriends->friends); + $this->assertNull($modelNullFriends->friends); + + $this->assertFalse($modelUnsetFriends->offsetExists('friends')); + $this->assertTrue($modelNullFriends->offsetExists('friends')); + } + + #[Test] + public function testIssetOnOmittedProperties(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertFalse(isset($model->owner)); + $this->assertFalse(isset($model->friends)); + } + + #[Test] + public function testSerializeBasicModel(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: 'Eve', + friends: ['Alice', 'Charlie'], + ); + $this->assertEquals( + '{"name":"Bob","age_years":12,"friends":["Alice","Charlie"],"owner":"Eve"}', + json_encode($model) + ); + } + + #[Test] + public function testSerializeModelWithOmittedProperties(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertEquals( + '{"name":"Bob","age_years":12,"owner":null}', + json_encode($model) + ); + } + + #[Test] + public function testSerializeModelWithExplicitNull(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $model->friends = null; + $this->assertEquals( + '{"name":"Bob","age_years":12,"friends":null,"owner":null}', + json_encode($model) + ); + } +} diff --git a/tests/ImageKit/ImageKitTest.php b/tests/ImageKit/ImageKitTest.php deleted file mode 100644 index 666330ac..00000000 --- a/tests/ImageKit/ImageKitTest.php +++ /dev/null @@ -1,337 +0,0 @@ -configuration, "\$configuration should be an instance of Configuration"); - Assert::assertEquals('testing_public_key', $this->configuration->publicKey, 'Public Key should be equal to testing_public_key'); - Assert::assertEquals('testing_private_key', $this->configuration->privateKey, 'Private Key should be equal to testing_private_key'); - Assert::assertEquals('https://ik.imagekit.io/testing', $this->configuration->urlEndpoint, 'Url Endpoint should be equal to https://ik.imagekit.io/testing'); - Assert::assertEquals('path', $this->configuration->transformationPosition, 'Transformation Position should be equal to path'); - }; - $doAssertClosure = $assertionClosure->bindTo($imagekit, ImageKit::class); - $doAssertClosure(); - } - - /** - * Successful initialization with TransformationPosition as Path - */ - public function test__constructSuccessfulWithTransformationPositionPath() - { - $imagekit = new ImageKit('testing_public_key', 'testing_private_key', 'https://ik.imagekit.io/testing', 'path'); - $assertionClosure = function () { - Assert::assertInstanceOf(Configuration::class, $this->configuration, "\$configuration should be an instance of Configuration"); - Assert::assertEquals('testing_public_key', $this->configuration->publicKey, 'Public Key should be equal to testing_public_key'); - Assert::assertEquals('testing_private_key', $this->configuration->privateKey, 'Private Key should be equal to testing_private_key'); - Assert::assertEquals('https://ik.imagekit.io/testing', $this->configuration->urlEndpoint, 'Url Endpoint should be equal to https://ik.imagekit.io/testing'); - Assert::assertEquals('path', $this->configuration->transformationPosition, 'Transformation Position should be equal to path'); - }; - $doAssertClosure = $assertionClosure->bindTo($imagekit, ImageKit::class); - $doAssertClosure(); - } - - /** - * Successful initialization with TransformationPosition as Query - */ - public function test__constructSuccessfulWithTransformationPositionQuery() - { - $imagekit = new ImageKit('testing_public_key', 'testing_private_key', 'https://ik.imagekit.io/testing', 'query'); - $assertionClosure = function () { - Assert::assertInstanceOf(Configuration::class, $this->configuration, "\$configuration should be an instance of Configuration"); - Assert::assertEquals('testing_public_key', $this->configuration->publicKey, 'Public Key should be equal to testing_public_key'); - Assert::assertEquals('testing_private_key', $this->configuration->privateKey, 'Private Key should be equal to testing_private_key'); - Assert::assertEquals('https://ik.imagekit.io/testing', $this->configuration->urlEndpoint, 'Url Endpoint should be equal to https://ik.imagekit.io/testing'); - Assert::assertEquals('query', $this->configuration->transformationPosition, 'Transformation Position should be equal to path'); - }; - $doAssertClosure = $assertionClosure->bindTo($imagekit, ImageKit::class); - $doAssertClosure(); - } - - /** - * Failed initialization Missing Public Key - */ - public function test__constructFailedEmptyPublicKey() - { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Missing publicKey during ImageKit initialization'); - new ImageKit('', '', '', ''); - } - - /** - * Failed initialization Missing Private Key - */ - public function test__constructFailedEmptyPrivateKey() - { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Missing privateKey during ImageKit initialization'); - new ImageKit('testing_public_key', '', '', ''); - } - - /** - * Failed initialization Missing Url Endpoint - */ - public function test__constructFailedEmptyUrlEndpoint() - { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Missing urlEndpoint during ImageKit initialization'); - new ImageKit('testing_public_key', 'testing_private_key', '', ''); - } - - /** - * Failed initialization Missing Transformation Position - */ - public function test__constructFailedEmptyTransformationPosition() - { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid transformationPosition during ImageKit initialization. Can be one of path or query'); - new ImageKit('testing_public_key', 'testing_private_key', 'https://ik.imagekit.io/testing', ''); - } - - /** - * Failed initialization Invalid Transformation Position - */ - public function test__constructFailedInvalidTransformationPosition() - { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('Invalid transformationPosition during ImageKit initialization. Can be one of path or query'); - new ImageKit('testing_public_key', 'testing_private_key', 'https://ik.imagekit.io/testing', 'testing'); - } - - - /** - * Failed initialization Invalid URL Endpoint - */ - public function test__constructFailedInvalidURLEndpoint() - { - $this->expectException(InvalidArgumentException::class); - $this->expectExceptionMessage('urlEndpoint should be a valid URL'); - new ImageKit('testing_public_key', 'testing_private_key', 'wrong_url', 'path'); - } - - /** - * Generate Authentication Parameters With Token - */ - public function testGetAuthenticationParametersWithToken() - { - $token = 'your_token'; - $expire = 1582269249; - $signature = 'e71bcd6031016b060d349d212e23e85c791decdd'; - - $imagekit = new ImageKit('public_key_test', 'private_key_test', 'https://ik.imagekit.io/testing'); - $response = $imagekit->getAuthenticationParameters('your_token', 1582269249); - - - Assert::assertEquals(json_encode([ - 'token' => $token, - 'expire' => $expire, - 'signature' => $signature, - ]), json_encode($response)); - } - - /** - * Test Phash Distance - */ - public function testPHashDistance() - { - $imagekit = new ImageKit( - 'testing_public_key', - 'testing_private_key', - 'https://ik.imagekit.io/demo' - ); - - $phash1 = '63433b3ccf8e1ebe'; - $phash2 = 'f5d2226cd9d32b16'; - - $distance = $imagekit->pHashDistance($phash1, $phash2); - - Assert::assertEquals(27, $distance); - } - - /** - * Test Phash Distance - */ - public function testPHashDistanceEmptyPhash1() - { - $imagekit = new ImageKit( - 'testing_public_key', - 'testing_private_key', - 'https://ik.imagekit.io/demo' - ); - - $phash1 = ''; - $phash2 = 'f5d2226cd9d32b16'; - - $response = $imagekit->pHashDistance($phash1, $phash2); - - ImageKitTest::assertEquals('Missing First pHash parameter for this request',$response->error->message); - } - - /** - * Test Phash Distance - */ - public function testPHashDistanceEmptyPhash2() - { - $imagekit = new ImageKit( - 'testing_public_key', - 'testing_private_key', - 'https://ik.imagekit.io/demo' - ); - - $phash1 = 'f5d2226cd9d32b16'; - $phash2 = ''; - - - $response = $imagekit->pHashDistance($phash1, $phash2); - - ImageKitTest::assertEquals('Missing Second pHash parameter for this request',$response->error->message); - } - - /** - * Test Phash Distance - */ - public function testPHashDistanceInvalidPhash1() - { - $imagekit = new ImageKit( - 'testing_public_key', - 'testing_private_key', - 'https://ik.imagekit.io/demo' - ); - - $phash1 = 'asdadasda'; - $phash2 = 'f5d2226cd9d32b16'; - - $this->expectException(Exception::class); - $this->expectExceptionMessage('Invalid pHash value'); - - $imagekit->pHashDistance($phash1, $phash2); - } - - /** - * Test Phash Distance - */ - public function testPHashDistanceInvalidPhash2() - { - $imagekit = new ImageKit( - 'testing_public_key', - 'testing_private_key', - 'https://ik.imagekit.io/demo' - ); - - $phash1 = 'f5d2226cd9d32b16'; - $phash2 = 'asjdkajlkda'; - - $this->expectException(Exception::class); - $this->expectExceptionMessage('Invalid pHash value'); - - $imagekit->pHashDistance($phash1, $phash2); - } - - /** - * Test Phash Distance - */ - public function testPHashDistancePhashesLengthNotEqual() - { - $imagekit = new ImageKit( - 'testing_public_key', - 'testing_private_key', - 'https://ik.imagekit.io/demo' - ); - - $phash1 = 'f5d2226cd9d32b16'; - $phash2 = 'f5d2226cd9d32b16f5d2226cd9d32b16'; - - $this->expectException(Exception::class); - $this->expectExceptionMessage('Invalid pHash value'); - - $imagekit->pHashDistance($phash1, $phash2); - } - - - /** - * - */ - public function testGetBulkJobStatus() - { - $jobId = '598821f949c0a938d57563bd'; - - $responseBody = [ - "jobId" => "598821f949c0a938d57563bd", - "type" => "COPY_FOLDER", - "status" => "Completed" - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($responseBody)); - - $this->stubHttpClient('get', new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse)); - - $response = $this->client->getBulkJobStatus($jobId); - - ImageKitTest::assertEquals(json_encode($responseBody), json_encode($response->result)); - } - - /** - * - */ - public function testGetBulkJobStatusMissingJobId() - { - $jobId = ''; - - $response = $this->client->getBulkJobStatus($jobId); - - ImageKitTest::assertEquals('Missing Job ID parameter for this request',$response->error->message); - } - - /** - * - */ - private function stubHttpClient($methodName, $response) - { - $stub = $this->createMock(GuzzleHttpWrapper::class); - $stub->method('setDatas'); - $stub->method($methodName)->willReturn($response); - - $closure = function () use ($stub) { - $this->httpClient = $stub; - }; - $doClosure = $closure->bindTo($this->client, ImageKit::class); - $doClosure(); - } - - protected function setUp() - { - $this->client = new ImageKit( - 'testing_public_key', - 'testing_private_key', - 'https://ik.imagekit.io/demo' - ); - } - - protected function tearDown() - { - $this->client = null; - } -} diff --git a/tests/ImageKit/Manage/CacheTest.php b/tests/ImageKit/Manage/CacheTest.php deleted file mode 100644 index cf3a5711..00000000 --- a/tests/ImageKit/Manage/CacheTest.php +++ /dev/null @@ -1,192 +0,0 @@ - "598821f949c0a938d57563bd" - ]; - $mockBodyResponse = Utils::streamFor(json_encode($responseBody)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->purgeCache($image_url); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $stream = Utils::streamFor($request->getBody())->getContents(); - $stream = json_decode($stream,true); - - // Request Check - CacheTest::assertEquals("/v1/files/purge",$requestPath); - CacheTest::assertEquals($stream['url'],$image_url); - - // Response Check - CacheTest::assertEquals(json_encode($responseBody), json_encode($response->result)); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'POST'); - } - - /** - * - */ - public function testPurgeCacheWithMissingImageURL() - { - $image_url = ''; - - $response = $this->client->purgeCache($image_url); - - CacheTest::assertEquals('Missing URL parameter for this request', $response->error->message); - } - - /** - * - */ - public function testPurgeCacheWithInvalidImageURL() - { - $image_url = 'image_url'; - - $response = $this->client->purgeCache($image_url); - - CacheTest::assertEquals('Invalid URL provided for this request', $response->error->message); - } - - /** - * - */ - public function testPurgeCacheStatus() - { - $cacheRequestId = '598821f949c0a938d57563bd'; - - $responseBody = [ - "status" => "Pending" - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($responseBody)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->purgeCacheStatus($cacheRequestId); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $stream = Utils::streamFor($request->getBody())->getContents(); - $stream = json_decode($stream,true); - - // Request Check - CacheTest::assertEquals("/v1/files/purge/{$cacheRequestId}",$requestPath); - CacheTest::assertEmpty($stream); - - // Response Check - CacheTest::assertEquals(json_encode($responseBody), json_encode($response->result)); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'GET'); - } - - /** - * - */ - public function testPurgeCacheStatusWithMissingCacheRequestId() - { - $cacheRequestId = ''; - - $response = $this->client->purgeCacheStatus($cacheRequestId); - - CacheTest::assertEquals('Missing Request ID parameter for this request', $response->error->message); - } - - - - private function stubHttpClient($methodName, $response) - { - $stub = $this->createMock(GuzzleHttpWrapper::class); - $stub->method('setDatas'); - $stub->method($methodName)->willReturn($response); - - $closure = function () use ($stub) { - $this->httpClient = $stub; - }; - $doClosure = $closure->bindTo($this->client, ImageKit::class); - $doClosure(); - } - - protected function setUp() - { - $this->client = new ImageKit( - 'testing_public_key', - 'testing_private_key', - 'https://ik.imagekit.io/demo' - ); - - } - - /** - * - */ - private function createMockClient($handler){ - $this->mockClient = new ImageKit( - 'testing_public_key', - 'testing_private_key', - 'https://ik.imagekit.io/demo', - Transformation::DEFAULT_TRANSFORMATION_POSITION, - $handler - ); - } - - - protected function tearDown() - { - $this->client = null; - } -} diff --git a/tests/ImageKit/Manage/CustomMetadataTest.php b/tests/ImageKit/Manage/CustomMetadataTest.php deleted file mode 100644 index a3fb06ae..00000000 --- a/tests/ImageKit/Manage/CustomMetadataTest.php +++ /dev/null @@ -1,627 +0,0 @@ - "price", - "label" => "Unit Price", - "schema" => [ - "type" => 'Number', - "minValue" => 1000, - "maxValue" => 5000, - ], - ]; - - $responseBody = [ - "id" => "598821f949c0a938d57563dd", - "name" => "price", - "label" => "Unit Price", - "schema" => [ - "type" => "Number", - "minValue" => 1000, - "maxValue" => 5000 - ] - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($responseBody)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->createCustomMetadataField($requestBody); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $stream = Utils::streamFor($request->getBody())->getContents(); - $stream = json_decode($stream,true); - - // Request Check - CacheTest::assertEquals("/v1/customMetadataFields",$requestPath); - CacheTest::assertEquals($stream['name'],$requestBody['name']); - CacheTest::assertEquals($stream['label'],$requestBody['label']); - CacheTest::assertEquals($stream['schema'],$requestBody['schema']); - CacheTest::assertEquals($stream['schema']['type'],$requestBody['schema']['type']); - CacheTest::assertEquals($stream['schema']['minValue'],$requestBody['schema']['minValue']); - CacheTest::assertEquals($stream['schema']['maxValue'],$requestBody['schema']['maxValue']); - - // Response Check - CacheTest::assertEquals(json_encode($responseBody), json_encode($response->result)); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'POST'); - } - - /** - * - */ - public function testCreateFieldsInvalidRequest() - { - - $response = $this->client->createCustomMetadataField(); - - CacheTest::assertEquals('Create Custom Metadata API accepts an array, null passed', $response->error->message); - - } - - /** - * - */ - public function testCreateFieldsWithNonArrayParameter() - { - $requestBody = 'field_name'; - - $response = $this->client->createCustomMetadataField($requestBody); - - CacheTest::assertEquals('Create Custom Metadata API accepts an array of parameters, non array value passed', $response->error->message); - - } - - /** - * - */ - public function testCreateFieldsWithEmptyArrayParameter() - { - $requestBody = []; - - $response = $this->client->createCustomMetadataField($requestBody); - - CacheTest::assertEquals('Create Custom Metadata API accepts an array of parameters, empty array passed', $response->error->message); - } - - /** - * - */ - public function testCreateFieldsWithMissingName() - { - $requestBody = [ - "name" => "", - "label" => "Unit Price", - "schema" => [ - "type" => 'Number', - "minValue" => 1000, - "maxValue" => 5000, - ], - ]; - - $response = $this->client->createCustomMetadataField($requestBody); - - CacheTest::assertEquals('Missing parameter name and/or label and/or schema for this request', $response->error->message); - } - - /** - * - */ - public function testCreateFieldsWithMissingLabel() - { - $requestBody = [ - "name" => "price", - "label" => "", - "schema" => [ - "type" => 'Number', - "minValue" => 1000, - "maxValue" => 5000, - ], - ]; - - $response = $this->client->createCustomMetadataField($requestBody); - - CacheTest::assertEquals('Missing parameter name and/or label and/or schema for this request', $response->error->message); - } - - /** - * - */ - public function testCreateFieldsWithMissingSchema() - { - $requestBody = [ - "name" => "price", - "label" => "Unit Price", - ]; - - $response = $this->client->createCustomMetadataField($requestBody); - - CacheTest::assertEquals('Missing parameter name and/or label and/or schema for this request', $response->error->message); - } - - - /** - * - */ - public function testCreateFieldsWithMissingSchemaType() - { - $requestBody = [ - "name" => "price", - "label" => "Unit Price", - "schema" => [ - ], - ]; - - $response = $this->client->createCustomMetadataField($requestBody); - - CacheTest::assertEquals('Invalid parameter schema', $response->error->message); - } - - - /** - * - */ - public function testGetFields() - { - $includeDeleted = false; - - $responseBody = [ - [ - "id" => "598821f949c0a938d57563dd", - "name" => "brand", - "label" => "brand", - "schema" => [ - "type" => "Text", - "defaultValue" => "Nike" - ] - ], - [ - "id" => "865421f949c0a835d57563dd", - "name" => "price", - "label" => "price", - "schema" => [ - "type" => "Number", - "minValue" => 1000, - "maxValue" => 3000 - ] - ] - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($responseBody)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->getCustomMetadataFields($includeDeleted); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $queryString = $request->getUri()->getQuery(); - $stream = Utils::streamFor($request->getBody())->getContents(); - $stream = json_decode($stream,true); - - // Request Check - CacheTest::assertEquals("/v1/customMetadataFields",$requestPath); - CacheTest::assertEquals($queryString,http_build_query(['includeDeleted'=>$includeDeleted])); - - // Response Check - CacheTest::assertEquals(json_encode($responseBody), json_encode($response->result)); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'GET'); - } - - - /** - * - */ - public function testGetFieldsWithoutIncludeDeleted() - { - - $responseBody = [ - [ - "id" => "598821f949c0a938d57563dd", - "name" => "brand", - "label" => "brand", - "schema" => [ - "type" => "Text", - "defaultValue" => "Nike" - ] - ], - [ - "id" => "865421f949c0a835d57563dd", - "name" => "price", - "label" => "price", - "schema" => [ - "type" => "Number", - "minValue" => 1000, - "maxValue" => 3000 - ] - ] - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($responseBody)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->getCustomMetadataFields(); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $queryString = $request->getUri()->getQuery(); - $stream = Utils::streamFor($request->getBody())->getContents(); - $stream = json_decode($stream,true); - - // Request Check - CacheTest::assertEquals("/v1/customMetadataFields",$requestPath); - CacheTest::assertEquals($queryString,http_build_query(['includeDeleted'=>false])); - - // Response Check - CacheTest::assertEquals(json_encode($responseBody), json_encode($response->result)); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'GET'); - } - - /** - * - */ - public function testGetFieldsWithInvalidIncludeDeleted() - { - $includeDeleted = 'includeDeleted'; - - $response = $this->client->getCustomMetadataFields($includeDeleted); - - CacheTest::assertEquals('Invalid parameter includeDeleted', $response->error->message); - } - - /** - * - */ - public function testUpdateFields() - { - $customMetadataFieldId = '598821f949c0a938d57563dd'; - - $requestBody = [ - "label" => "Net Price", - "schema" => [ - "type"=>'Number' - ], - ]; - - $responseBody = [ - "id" => "598821f949c0a938d57563dd", - "name" => "price", - "label" => "Net Price", - "schema" => [ - "type" => "Number" - ] - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($responseBody)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->updateCustomMetadataField($customMetadataFieldId, $requestBody); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $stream = Utils::streamFor($request->getBody())->getContents(); - $stream = json_decode($stream,true); - - // Request Check - CacheTest::assertEquals("/v1/customMetadataFields/" . $customMetadataFieldId,$requestPath); - CacheTest::assertEquals($stream['label'],$requestBody['label']); - CacheTest::assertEquals($stream['schema'],$requestBody['schema']);CacheTest::assertEquals($stream['schema']['type'],$requestBody['schema']['type']); - - // Response Check - CacheTest::assertEquals(json_encode($responseBody), json_encode($response->result)); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'PATCH'); - } - - /** - * - */ - public function testUpdateFieldsInvalidRequest() - { - - $response = $this->client->updateCustomMetadataField(); - - CacheTest::assertEquals('Update Custom Metadata API accepts an id and requestBody, null passed', $response->error->message); - - } - - - /** - * - */ - public function testUpdateFieldsWithMissingCustomMetadataFieldId() - { - $customMetadataFieldId = ''; - - $requestBody = [ - "label" => "Net Price", - "schema" => [ - "type"=>'Number' - ], - ]; - - $response = $this->client->updateCustomMetadataField($customMetadataFieldId, $requestBody); - - CacheTest::assertEquals('Missing Custom Metadata Field ID parameter for this request', $response->error->message); - - } - - - /** - * - */ - public function testUpdateFieldsWithMissingBody() - { - $customMetadataFieldId = '598821f949c0a938d57563dd'; - - $response = $this->client->updateCustomMetadataField($customMetadataFieldId); - - CacheTest::assertEquals('Missing body parameter for this request', $response->error->message); - - } - - /** - * - */ - public function testUpdateFieldsWithNonArrayBodyParameter() - { - $customMetadataFieldId = '598821f949c0a938d57563dd'; - - $requestBody = "Net Price"; - - $response = $this->client->updateCustomMetadataField($customMetadataFieldId, $requestBody); - - CacheTest::assertEquals('Update Custom Metadata API accepts requestBody as an array of parameters, non array value passed', $response->error->message); - - } - - /** - * - */ - public function testUpdateFieldsWithEmptyArrayBodyParameter() - { - $customMetadataFieldId = '598821f949c0a938d57563dd'; - - $requestBody = []; - - $response = $this->client->updateCustomMetadataField($customMetadataFieldId, $requestBody); - - CacheTest::assertEquals('Update Custom Metadata API accepts an array of parameters, empty array passed', $response->error->message); - - } - - /** - * - */ - public function testUpdateFieldsWithMissingLabel() - { - $customMetadataFieldId = '598821f949c0a938d57563dd'; - - $requestBody = [ - "label" => "", - "schema" => [ - "type"=>'Number' - ], - ]; - - $response = $this->client->updateCustomMetadataField($customMetadataFieldId, $requestBody); - - CacheTest::assertEquals('Missing parameter label and/or schema for this request', $response->error->message); - - } - - /** - * - */ - public function testUpdateFieldsWithMissingSchema() - { - $customMetadataFieldId = '598821f949c0a938d57563dd'; - - $requestBody = [ - "label" => "Net Price", - ]; - - $response = $this->client->updateCustomMetadataField($customMetadataFieldId, $requestBody); - - CacheTest::assertEquals('Missing parameter label and/or schema for this request', $response->error->message); - - } - - /** - * - */ - public function testUpdateFieldsWithMissingSchemaType() - { - $customMetadataFieldId = '598821f949c0a938d57563dd'; - - $requestBody = [ - "label" => "Net Price", - "schema" => [ - "type"=>'' - ], - ]; - - $response = $this->client->updateCustomMetadataField($customMetadataFieldId, $requestBody); - - CacheTest::assertEquals('Invalid parameter schema', $response->error->message); - - } - - /** - * - */ - public function testDeleteFields() - { - $customMetadataFieldId = '598821f949c0a938d57563dd'; - - $mockBodyResponse = Utils::streamFor(); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->deleteCustomMetadataField($customMetadataFieldId); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $stream = Utils::streamFor($request->getBody())->getContents(); - $stream = json_decode($stream,true); - - // Request Check - CacheTest::assertEquals("/v1/customMetadataFields/" . $customMetadataFieldId,$requestPath); - CacheTest::assertEmpty($stream); - - // Response Check - CacheTest::assertNull($response->result); - CacheTest::assertNull($response->error); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'DELETE'); - } - - /** - * - */ - public function testDeleteFieldsWithMissingCustomMetadataFieldId() - { - $customMetadataFieldId = ''; - - $response = $this->client->deleteCustomMetadataField($customMetadataFieldId); - - CacheTest::assertEquals('Missing Custom Metadata Field ID parameter for this request',$response->error->message); - } - - - private function stubHttpClient($methodName, $response) - { - $stub = $this->createMock(GuzzleHttpWrapper::class); - $stub->method('setDatas'); - $stub->method($methodName)->willReturn($response); - - $closure = function () use ($stub) { - $this->httpClient = $stub; - }; - $doClosure = $closure->bindTo($this->client, ImageKit::class); - $doClosure(); - } - - protected function setUp() - { - $this->client = new ImageKit( - 'testing_public_key', - 'testing_private_key', - 'https://ik.imagekit.io/demo' - ); - - } - - /** - * - */ - private function createMockClient($handler){ - $this->mockClient = new ImageKit( - 'testing_public_key', - 'testing_private_key', - 'https://ik.imagekit.io/demo', - Transformation::DEFAULT_TRANSFORMATION_POSITION, - $handler - ); - } - - - protected function tearDown() - { - $this->client = null; - } -} diff --git a/tests/ImageKit/Manage/FileTest.php b/tests/ImageKit/Manage/FileTest.php deleted file mode 100644 index d53ecfd0..00000000 --- a/tests/ImageKit/Manage/FileTest.php +++ /dev/null @@ -1,2035 +0,0 @@ - "help", - "message" => "message" - ]; - - /** - * - */ - public function testListFiles() - { - $responseBody = [ - [ - 'type' => 'file', - 'name' => 'default-image.jpg', - 'fileId' => '5de4fb65c851e55df73abe8d', - 'tags' => ["tag1","tag2"], - 'customCoordinates' => null, - 'isPrivateFile' => false, - 'url' => 'https://ik.imagekit.io/ot2cky3ujwa/default-image.jpg', - 'thumbnail' => 'https://ik.imagekit.io/ot2cky3ujwa/tr:n-media_library_thumbnail/default-image.jpg', - 'fileType' => 'image', - 'filePath' => '/default-image.jpg', - ], - ]; - $mockBodyResponse = Utils::streamFor(json_encode($responseBody)); - - $this->stubHttpClient('get', new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse)); - - $response = $this->client->listFiles(); - - FileTest::assertEquals(json_encode($responseBody), json_encode($response->result)); - } - - /** - * - */ - public function testListFilesWithOptions() - { - $listOptions = [ - "type" => "file", - "sort" => "ASC_CREATED", - "path" => "/sample-folder", - "fileType" => "all", - "limit" => 10, - "skip" => 0, - "tags" => ["tag3","tag4"], - ]; - - $responseBody = [ - [ - 'type' => 'file', - 'name' => 'default-image.jpg', - 'fileId' => '5de4fb65c851e55df73abe8d', - 'tags' => null, - 'customCoordinates' => null, - 'isPrivateFile' => false, - 'url' => 'https://ik.imagekit.io/ot2cky3ujwa/default-image.jpg', - 'thumbnail' => 'https://ik.imagekit.io/ot2cky3ujwa/tr:n-media_library_thumbnail/default-image.jpg', - 'fileType' => 'image', - 'filePath' => '/default-image.jpg', - ], - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($responseBody)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->listFiles($listOptions); - - $request = $container[0]['request']; - $queryString = $request->getUri()->getQuery(); - $requestBody = $request->getBody(); - $stream = Utils::streamFor($requestBody)->getContents(); - - FileTest::assertEmpty($stream); - - // Response Check - FileTest::assertEquals(json_encode($responseBody), json_encode($response->result)); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'GET'); - } - - - - /** - * - */ - public function testListFilesWithEmptyOptions() - { - $listOptions = []; - - $responseBody = [ - [ - 'type' => 'file', - 'name' => 'default-image.jpg', - 'fileId' => '5de4fb65c851e55df73abe8d', - 'tags' => null, - 'customCoordinates' => null, - 'isPrivateFile' => false, - 'url' => 'https://ik.imagekit.io/ot2cky3ujwa/default-image.jpg', - 'thumbnail' => 'https://ik.imagekit.io/ot2cky3ujwa/tr:n-media_library_thumbnail/default-image.jpg', - 'fileType' => 'image', - 'filePath' => '/default-image.jpg', - ], - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($responseBody)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->listFiles($listOptions); - - $request = $container[0]['request']; - $queryString = $request->getUri()->getQuery(); - $requestBody = $request->getBody(); - $stream = Utils::streamFor($requestBody)->getContents(); - - FileTest::assertEmpty($queryString); - FileTest::assertEmpty($stream); - - // Response Check - FileTest::assertEquals(json_encode($responseBody), json_encode($response->result)); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'GET'); - } - - /** - * - */ - public function testListFilesWithInvalidOptions() - { - $listOptions = 'invalid'; - - $response = $this->client->listFiles($listOptions); - - FileTest::assertEquals('List File Options accepts an array of parameters, non array value passed', $response->error->message); - } - - /** - * - */ - public function testGetFileDetails() - { - $fileId = '23902390239203923'; - - $responseBody = [ - 'type' => 'file', - 'name' => 'default-image.jpg', - 'fileId' => '5de4fb65c851e55df73abe8d', - 'tags' => null, - 'customCoordinates' => null, - 'isPrivateFile' => false, - 'url' => 'https://ik.imagekit.io/ot2cky3ujwa/default-image.jpg', - 'thumbnail' => 'https://ik.imagekit.io/ot2cky3ujwa/tr:n-media_library_thumbnail/default-image.jpg', - 'fileType' => 'image', - 'filePath' => '/default-image.jpg', - ]; - $mockBodyResponse = Utils::streamFor(json_encode($responseBody)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->getFileDetails($fileId); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $requestBody = $request->getBody(); - $stream = Utils::streamFor($requestBody)->getContents(); - - // Request Check - FileTest::assertEquals("/v1/files/{$fileId}/details",$requestPath); - - // Response Check - FileTest::assertEquals(json_encode($responseBody), json_encode($response->result)); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'GET'); - } - - /** - * - */ - public function testGetFileDetailsWithMissingFileId() - { - $fileId = ''; - - $mockBodyResponse = Utils::streamFor(); - - $this->stubHttpClient('get', new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse)); - - $response = $this->client->getFileDetails($fileId); - - FileTest::assertEquals('Missing File ID parameter for this request',$response->error->message); - } - - /** - * - */ - public function testGetFileDetailsWithError() - { - $fileId = '23902390239203923'; - - $this->stubHttpClient('get', new Response(500, ['X-Foo' => 'Bar'], json_encode($this->dummyAPIErrorResponse))); - - $response = $this->client->getFileDetails($fileId); - - FileTest::assertEquals(json_encode($this->dummyAPIErrorResponse),json_encode($response->error)); - } - - /** - * - */ - public function testGetFileVersionDetails() - { - $fileId = '23902390239203923'; - $versionId = '23902390239203923'; - - $responseBody = [ - 'type' => 'file', - 'name' => 'default-image.jpg', - 'fileId' => '5de4fb65c851e55df73abe8d', - 'tags' => null, - 'customCoordinates' => null, - 'isPrivateFile' => false, - 'url' => 'https://ik.imagekit.io/ot2cky3ujwa/default-image.jpg', - 'thumbnail' => 'https://ik.imagekit.io/ot2cky3ujwa/tr:n-media_library_thumbnail/default-image.jpg', - 'fileType' => 'image', - 'filePath' => '/default-image.jpg', - "versionInfo" => [ - "id" => "598821f949c0a938d57563bd", - "name" => "Version 1" - ], - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($responseBody)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->getFileVersionDetails($fileId, $versionId); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $requestBody = $request->getBody(); - $stream = Utils::streamFor($requestBody)->getContents(); - - - // Request Check - FileTest::assertEquals("/v1/files/{$fileId}/versions/{$versionId}",$requestPath); - - // Response Check - FileTest::assertEquals(json_encode($responseBody), json_encode($response->result)); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'GET'); - } - - /** - * - */ - public function testGetFileVersionDetailsWithMissingFileId() - { - $fileId = ''; - $versionId = '23902390239203923'; - - $response = $this->client->getFileVersionDetails($fileId, $versionId); - - FileTest::assertEquals('Missing File ID parameter for this request', $response->error->message); - } - - /** - * - */ - public function testGetFileVersionDetailsWithMissingVersionId() - { - $fileId = '23902390239203923'; - $versionId = ''; - - $response = $this->client->getFileVersionDetails($fileId, $versionId); - - FileTest::assertEquals('Missing Version ID parameter for this request', $response->error->message); - } - - /** - * - */ - public function testGetFileVersions() - { - $fileId = '23902390239203923'; - - $responseBody = [ - [ - 'type' => 'file', - 'name' => 'default-image.jpg', - 'fileId' => '5de4fb65c851e55df73abe8d', - 'tags' => null, - 'customCoordinates' => null, - 'isPrivateFile' => false, - 'url' => 'https://ik.imagekit.io/ot2cky3ujwa/default-image.jpg', - 'thumbnail' => 'https://ik.imagekit.io/ot2cky3ujwa/tr:n-media_library_thumbnail/default-image.jpg', - 'fileType' => 'image', - 'filePath' => '/default-image.jpg', - "versionInfo" => [ - "id" => "598821f949c0a938d57563bd", - "name" => "Version 1" - ] - ], - [ - 'type' => 'file', - 'name' => 'default-image.jpg', - 'fileId' => '5de4fb65c851e55df73abe8d', - 'tags' => null, - 'customCoordinates' => null, - 'isPrivateFile' => false, - 'url' => 'https://ik.imagekit.io/ot2cky3ujwa/default-image.jpg', - 'thumbnail' => 'https://ik.imagekit.io/ot2cky3ujwa/tr:n-media_library_thumbnail/default-image.jpg', - 'fileType' => 'image', - 'filePath' => '/default-image.jpg', - "versionInfo" => [ - "id" => "330a81i1f949c0a938d57563bd", - "name" => "Version 2" - ] - ], - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($responseBody)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->getFileVersions($fileId); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $requestBody = $request->getBody(); - $stream = Utils::streamFor($requestBody)->getContents(); - - // Request Check - FileTest::assertEquals("/v1/files/{$fileId}/versions",$requestPath); - - // Response Check - FileTest::assertEquals(json_encode($responseBody), json_encode($response->result)); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'GET'); - } - - - /** - * - */ - public function testGetFileVersionsWithMissingFileId() - { - $fileId = ''; - - $response = $this->client->getFileVersions($fileId); - - FileTest::assertEquals('Missing File ID parameter for this request', $response->error->message); - } - - - /** - * - */ - public function testUpdateFileDetails() - { - $fileId = '5df36759adf3f523d81dd94f'; - - $updateData = [ - 'customCoordinates' => '10,10,100,100', - 'tags' => ['tag1', 'tag2'], - 'removeAITags'=>['car','vehicle','motorsports'], - 'extensions'=>[ - [ - "name" => "google-auto-tagging", - "maxTags" => 5, - "minConfidence" => 95 - ] - ], - "customMetadata" => [ - "SKU" => "VS882HJ2JD", - "price" => 599.99, - ] - ]; - - $responseBody = [ - 'fileId' => '598821f949c0a938d57563bd', - 'type' => 'file', - 'name' => 'file1.jpg', - 'filePath' => '/images/products/file1.jpg', - 'tags' => ['t-shirt', 'round-neck', 'sale2019'], - 'isPrivateFile' => false, - 'customCoordinates' => null, - 'url' => 'https://ik.imagekit.io/your_imagekit_id/images/products/file1.jpg', - 'thumbnail' => 'https://ik.imagekit.io/your_imagekit_id/tr:n-media_library_thumbnail/images/products/file1.jpg', - 'fileType' => 'image' - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($responseBody)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->updateFileDetails($fileId, $updateData); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $requestBody = $request->getBody(); - $stream = Utils::streamFor($requestBody)->getContents(); - - // Request Check - FileTest::assertEquals("/v1/files/{$fileId}/details",$requestPath); - FileTest::assertEquals($stream,json_encode($updateData)); - - // Response Check - FileTest::assertNull($response->error); - FileTest::assertEquals(json_encode($responseBody), json_encode($response->result)); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'PATCH'); - } - - /** - * - */ - public function testUpdateFilePublishStatus() - { - $fileId = '5df36759adf3f523d81dd94f'; - - $updateData = [ - "publish" => [ - "isPublished" => true, - "includeFileVersions" => true - ] - ]; - - $responseBody = [ - 'fileId' => '598821f949c0a938d57563bd', - 'type' => 'file', - 'name' => 'file1.jpg', - 'filePath' => '/images/products/file1.jpg', - 'tags' => ['t-shirt', 'round-neck', 'sale2019'], - 'isPrivateFile' => false, - 'isPublished' => true, - 'customCoordinates' => null, - 'url' => 'https://ik.imagekit.io/your_imagekit_id/images/products/file1.jpg', - 'thumbnail' => 'https://ik.imagekit.io/your_imagekit_id/tr:n-media_library_thumbnail/images/products/file1.jpg', - 'fileType' => 'image' - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($responseBody)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->updateFileDetails($fileId, $updateData); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $requestBody = $request->getBody(); - $stream = Utils::streamFor($requestBody)->getContents(); - - // Request Check - FileTest::assertEquals("/v1/files/{$fileId}/details",$requestPath); - FileTest::assertEquals($stream,json_encode($updateData)); - - // Response Check - FileTest::assertNull($response->error); - FileTest::assertEquals(json_encode($responseBody), json_encode($response->result)); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'PATCH'); - } - - public function testUpdateFileDetailsWithInvalidTags() - { - $fileId = '5df36759adf3f523d81dd94f'; - - $updateData = [ - 'customCoordinates' => '10,10,100,100', - 'tags' => 'tag1,tag2', - 'removeAITags'=>['car','vehicle','motorsports'], - 'extensions'=>[ - [ - "name" => "google-auto-tagging", - "maxTags" => 5, - "minConfidence" => 95 - ] - ], - "customMetadata" => [ - "SKU" => "VS882HJ2JD", - "price" => 599.99, - ] - ]; - - $response = $this->client->updateFileDetails($fileId, $updateData); - - FileTest::assertNull($response->result); - FileTest::assertEquals('Invalid tags parameter for this request', $response->error->message); - } - - /** - * - */ - public function testUpdateFileDetailsWithMissingFileId() - { - $fileId = ''; - - $updateData = [ - 'customCoordinates' => '10,10,100,100', - 'tags' => ['tag1', 'tag2'] - ]; - - $response = $this->client->updateFileDetails($fileId, $updateData); - - FileTest::assertNull($response->result); - FileTest::assertEquals('Missing File ID parameter for this request', $response->error->message); - } - - - /** - * - */ - public function testUpdateFileDetailsWithInvalidUpdateData() - { - $fileId = '5df36759adf3f523d81dd94f'; - - $updateData = []; - - $response = $this->client->updateFileDetails($fileId, $updateData); - - FileTest::assertNull($response->result); - FileTest::assertEquals('Missing file update data for this request', $response->error->message); - } - - - /** - * - */ - public function testUpdateFileDetailsWithError() - { - $fileId = '5df36759adf3f523d81dd94f'; - - $updateData = [ - 'customCoordinates' => '10,10,100,100', - 'tags' => ['tag1', 'tag2'] - ]; - - $this->stubHttpClient('patch', new Response(500, ['X-Foo' => 'Bar'], json_encode($this->dummyAPIErrorResponse))); - - $response = $this->client->updateFileDetails($fileId, $updateData); - - FileTest::assertEquals(json_encode($this->dummyAPIErrorResponse),json_encode($response->error)); - } - - - /** - * - */ - public function testBulkAddTags() - { - $fileIds = ['5e21880d5efe355febd4bccd','5e1c13c1c55ec3437c451403']; - $tags = ['testing_tag1']; - - $responseBody = [ - "successfullyUpdatedFileIds" => [ - "5e21880d5efe355febd4bccd", - "5e1c13c1c55ec3437c451403" - ] - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($responseBody)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->bulkAddTags($fileIds, $tags); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $requestBody = $request->getBody(); - $stream = Utils::streamFor($requestBody)->getContents(); - $stream = json_decode($stream,true); - - // Request Check - FileTest::assertEquals($stream['fileIds'],$fileIds); - FileTest::assertEquals($stream['tags'],$tags); - FileTest::assertEquals("/v1/files/addTags",$requestPath); - - // Response Check - FileTest::assertEquals(json_encode($responseBody), json_encode($response->result)); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'POST'); - } - - - /** - * - */ - public function testBulkAddTagsMissingFileIds() - { - $fileIds = []; - $tags = ['testing_tag1']; - - $response = $this->client->bulkAddTags($fileIds, $tags); - - FileTest::assertNull($response->result); - FileTest::assertEquals('Bulk Tags API accepts FileIds as an array of ids, empty array passed', $response->error->message); - } - - - /** - * - */ - public function testBulkAddTagsMissingTags() - { - $fileIds = ['23902390239203923']; - $tags = []; - - $response = $this->client->bulkAddTags($fileIds, $tags); - - FileTest::assertNull($response->result); - FileTest::assertEquals('Bulk Tags API accepts Tags as an array of tags, empty array passed', $response->error->message); - } - - /** - * - */ - public function testBulkAddTagsNonArrayFileId() - { - $fileIds = '23902390239203923'; - $tags = ['testing_tag1']; - - $response = $this->client->bulkAddTags($fileIds, $tags); - - FileTest::assertNull($response->result); - FileTest::assertEquals('Bulk Tags API accepts FileIds as an array, non array passed', $response->error->message); - } - - /** - * - */ - public function testBulkAddTagsNonArrayTags() - { - $fileIds = ['23902390239203923']; - $tags = 'testing_tag1'; - - $response = $this->client->bulkAddTags($fileIds, $tags); - - FileTest::assertNull($response->result); - FileTest::assertEquals('Bulk Tags API accepts Tags as an array, non array passed', $response->error->message); - } - - /** - * - */ - public function testBulkRemoveTags() - { - $fileIds = ['23902390239203923']; - $tags = ['testing_tag1']; - - $responseBody = [ - "successfullyUpdatedFileIds" => [ - "23902390239203923", - ] - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($responseBody)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->bulkRemoveTags($fileIds, $tags); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $requestBody = $request->getBody(); - $stream = Utils::streamFor($requestBody)->getContents(); - $stream = json_decode($stream,true); - - // Request Check - FileTest::assertEquals($stream['fileIds'],$fileIds); - FileTest::assertEquals($stream['tags'],$tags); - FileTest::assertEquals("/v1/files/removeTags",$requestPath); - - // Response Check - FileTest::assertEquals(json_encode($responseBody), json_encode($response->result)); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'POST'); - } - - /** - * - */ - public function testBulkRemoveTagsMissingFileIds() - { - $fileIds = []; - $tags = ['testing_tag1']; - - $response = $this->client->bulkRemoveTags($fileIds, $tags); - - FileTest::assertNull($response->result); - FileTest::assertEquals('Bulk Tags API accepts FileIds as an array of ids, empty array passed', $response->error->message); - } - - /** - * - */ - public function testBulkRemoveTagsMissingTags() - { - $fileIds = ['23902390239203923']; - $tags = []; - - $response = $this->client->bulkRemoveTags($fileIds, $tags); - - FileTest::assertNull($response->result); - FileTest::assertEquals('Bulk Tags API accepts Tags as an array of tags, empty array passed', $response->error->message); - } - - - /** - * - */ - public function testBulkRemoveTagsNonArrayFileId() - { - $fileIds = '23902390239203923'; - $tags = ['testing_tag1']; - - $response = $this->client->bulkRemoveTags($fileIds, $tags); - - FileTest::assertNull($response->result); - FileTest::assertEquals('Bulk Tags API accepts FileIds as an array, non array passed', $response->error->message); - } - - /** - * - */ - public function testBulkRemoveTagsNonArrayTags() - { - $fileIds = ['23902390239203923']; - $tags = 'testing_tag1'; - - $response = $this->client->bulkRemoveTags($fileIds, $tags); - - FileTest::assertNull($response->result); - FileTest::assertEquals('Bulk Tags API accepts Tags as an array, non array passed', $response->error->message); - } - - /** - * - */ - public function testBulkRemoveAITags() - { - $fileIds = ['5e21880d5efe355febd4bccd','5e1c13c1c55ec3437c451403']; - $AItags = ['image_AITag_1','image_AITag_2']; - - $responseBody = [ - "successfullyUpdatedFileIds" => [ - "5e21880d5efe355febd4bccd", - "5e1c13c1c55ec3437c451403" - ] - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($responseBody)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->bulkRemoveAITags($fileIds, $AItags); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $requestBody = $request->getBody(); - $stream = Utils::streamFor($requestBody)->getContents(); - $stream = json_decode($stream,true); - - // Request Check - FileTest::assertEquals($stream['fileIds'],$fileIds); - FileTest::assertEquals($stream['AITags'],$AItags); - FileTest::assertEquals("/v1/files/removeAITags",$requestPath); - - // Response Check - FileTest::assertEquals(json_encode($responseBody), json_encode($response->result)); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'POST'); - } - - /** - * - */ - public function testBulkRemoveAITagsMissingFileIds() - { - $fileIds = []; - $tags = ['image_AITag_1']; - - $response = $this->client->bulkRemoveAITags($fileIds, $tags); - - FileTest::assertNull($response->result); - FileTest::assertEquals('Bulk Tags API accepts FileIds as an array of ids, empty array passed', $response->error->message); - } - - /** - * - */ - public function testBulkRemoveAITagsMissingTags() - { - $fileIds = ['23902390239203923']; - $tags = []; - - $response = $this->client->bulkRemoveAITags($fileIds, $tags); - - FileTest::assertNull($response->result); - FileTest::assertEquals('Bulk Tags API accepts Tags as an array of tags, empty array passed', $response->error->message); - } - - - /** - * - */ - public function testBulkRemoveAITagsNonArrayFileId() - { - $fileIds = '23902390239203923'; - $tags = ['testing_tag1']; - - $response = $this->client->bulkRemoveAITags($fileIds, $tags); - - FileTest::assertNull($response->result); - FileTest::assertEquals('Bulk Tags API accepts FileIds as an array, non array passed', $response->error->message); - } - - /** - * - */ - public function testBulkRemoveAITagsNonArrayTags() - { - $fileIds = ['23902390239203923']; - $tags = 'testing_tag1'; - - $response = $this->client->bulkRemoveAITags($fileIds, $tags); - - FileTest::assertNull($response->result); - FileTest::assertEquals('Bulk Tags API accepts Tags as an array, non array passed', $response->error->message); - } - - /** - * - */ - public function testDeleteSingleFile() - { - $fileId = "23902390239203923"; - - $mockBodyResponse = Utils::streamFor(); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->deleteFile($fileId); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $requestBody = $request->getBody(); - $stream = Utils::streamFor($requestBody)->getContents(); - $stream = json_decode($stream,true); - - // Request Check - FileTest::assertEquals("/v1/files/".$fileId,$requestPath); - FileTest::assertEquals($stream[0],$fileId); - - // Response Check - FolderTest::assertNull($response->result); - FolderTest::assertNull($response->error); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'DELETE'); - } - - /** - * - */ - public function testDeleteSingleFileMissingFileId() - { - $fileId = ""; - - $response = $this->client->deleteFile($fileId); - - FileTest::assertEquals('Missing File ID parameter for this request',$response->error->message); - } - - /** - * - */ - public function testDeleteFileVersion() - { - $fileId = '23902390239203923'; - $versionId = "123213239023902392"; - - $mockBodyResponse = Utils::streamFor(); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->deleteFileVersion($fileId, $versionId); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $requestBody = $request->getBody(); - $stream = Utils::streamFor($requestBody)->getContents(); - $stream = json_decode($stream,true); - - // Request Check - FileTest::assertEquals("/v1/files/{$fileId}/versions/{$versionId}",$requestPath); - FileTest::assertEquals($stream[0],$fileId); - FileTest::assertEquals($stream[1],$versionId); - - // Response Check - FolderTest::assertNull($response->result); - FolderTest::assertNull($response->error); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'DELETE'); - } - - /** - * - */ - public function testDeleteFileVersionWithMissingFileId() - { - $fileId = ""; - $versionId = "version_id"; - - $response = $this->client->deleteFileVersion($fileId, $versionId); - - FileTest::assertEquals('Missing File ID parameter for this request',$response->error->message); - } - - /** - * - */ - public function testDeleteFileVersionWithMissingVisionId() - { - $fileId = "file_id"; - $versionId = ""; - - $response = $this->client->deleteFileVersion($fileId, $versionId); - - FileTest::assertEquals('Missing Version ID parameter for this request',$response->error->message); - } - - /** - * - */ - public function testBulkDeleteFiles() - { - $fileIds = ['file_id1','file_id2']; - - $responseBody = [ - "successfullyDeletedFileIds" => [ - "5e21880d5efe355febd4bccd", - "5e1c13c1c55ec3437c451403" - ] - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($responseBody)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->bulkDeleteFiles($fileIds); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $requestBody = $request->getBody(); - $stream = Utils::streamFor($requestBody)->getContents(); - $stream = json_decode($stream,true); - - // Request Check - FileTest::assertEquals("/v1/files/batch/deleteByFileIds",$requestPath); - FileTest::assertEquals($stream['fileIds'],$fileIds); - - // Response Check - FileTest::assertEquals(json_encode($responseBody), json_encode($response->result)); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'POST'); - } - - /** - * - */ - public function testBulkDeleteFilesInvalidRequest() - { - $response = $this->client->bulkDeleteFiles(); - - FileTest::assertEquals('Missing Parameter FileIds', $response->error->message); - } - - /** - * - */ - public function testBulkDeleteFilesMissingFileIds() - { - $fileIds = []; - $response = $this->client->bulkDeleteFiles($fileIds); - - FileTest::assertEquals('File ids should be passed as an array of file ids, empty array passed', $response->error->message); - } - - /** - * - */ - public function testBulkDeleteFilesNonArrayFileIds() - { - $fileIds = 'file_id'; - $response = $this->client->bulkDeleteFiles($fileIds); - - FileTest::assertEquals('File ids should be passed in an array', $response->error->message); - } - - /** - * - */ - public function testCopyFile() - { - $sourceFilePath = '/file.jpg'; - $destinationPath = '/'; - $includeFileVersions = true; - - $requestBody = [ - 'sourceFilePath' => $sourceFilePath, - 'destinationPath' => $destinationPath, - 'includeFileVersions' => $includeFileVersions - ]; - - $mockBodyResponse = Utils::streamFor(); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->copy($requestBody); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $stream = Utils::streamFor($request->getBody())->getContents(); - // $stream = json_decode($stream,true); - - // Request Check - FileTest::assertEquals("/v1/files/copy",$requestPath); - FileTest::assertEquals($stream,json_encode($requestBody)); - - // Response Check - FolderTest::assertNull($response->result); - FolderTest::assertNull($response->error); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'POST'); - } - - - /** - * - */ - public function testCopyFileWithoutIncludeFileVersions() - { - $sourceFilePath = '/file.jpg'; - $destinationPath = '/'; - $includeFileVersions = true; - - $requestBody = [ - 'sourceFilePath' => $sourceFilePath, - 'destinationPath' => $destinationPath, - ]; - - $mockBodyResponse = Utils::streamFor(); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->copy($requestBody); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $stream = Utils::streamFor($request->getBody())->getContents(); - // $stream = json_decode($stream,true); - - // Request Check - FileTest::assertEquals("/v1/files/copy",$requestPath); - FileTest::assertEquals($stream,json_encode([ - 'sourceFilePath' => '/file.jpg', - 'destinationPath' => '/', - 'includeFileVersions' => false - ])); - - // Response Check - FolderTest::assertNull($response->result); - FolderTest::assertNull($response->error); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'POST'); - } - - /** - * - */ - public function testCopyFileInvalidParameter() - { - $sourceFilePath = '/file.jpg'; - $destinationPath = '/'; - $includeVersions = true; - - $requestBody = []; - - $response = $this->client->copy($requestBody); - - FileTest::assertNull($response->result); - FileTest::assertEquals('Copy File API accepts an array of parameters, empty array passed',$response->error->message); - - } - - - /** - * - */ - public function testCopyFileMissingSourceFilePath() - { - $sourceFilePath = '/file.jpg'; - $destinationPath = '/'; - $includeVersions = true; - - $requestBody = [ - 'destinationPath' => $destinationPath, - 'includeVersions' => $includeVersions - ]; - - $response = $this->client->copy($requestBody); - - - FileTest::assertNull($response->result); - FileTest::assertEquals('Missing parameter sourceFilePath and/or destinationPath for Copy File API',$response->error->message); - } - - /** - * - */ - public function testCopyFileMissingDestinationPath() - { - $sourceFilePath = '/file.jpg'; - $destinationPath = '/'; - $includeVersions = true; - - $requestBody = [ - 'sourceFilePath' => $sourceFilePath, - 'includeVersions' => $includeVersions - ]; - - $response = $this->client->copy($requestBody); - - - FileTest::assertNull($response->result); - FileTest::assertEquals('Missing parameter sourceFilePath and/or destinationPath for Copy File API',$response->error->message); - - } - - /** - * - */ - public function testMoveFile() - { - $sourceFilePath = '/file.jpg'; - $destinationPath = '/'; - - $requestBody = [ - 'sourceFilePath' => $sourceFilePath, - 'destinationPath' => $destinationPath - ]; - - $mockBodyResponse = Utils::streamFor(); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->move($requestBody); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $stream = Utils::streamFor($request->getBody())->getContents(); - - // Request Check - FileTest::assertEquals("/v1/files/move",$requestPath); - FileTest::assertEquals($stream,json_encode($requestBody)); - - // Response Check - FolderTest::assertNull($response->result); - FolderTest::assertNull($response->error); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'POST'); - } - - /** - * - */ - public function testMoveFileInvalidParameter() - { - $sourceFilePath = '/file.jpg'; - $destinationPath = '/'; - - $requestBody = []; - - $response = $this->client->move($requestBody); - - FileTest::assertNull($response->result); - FileTest::assertEquals('Move File API accepts an array of parameters, empty array passed',$response->error->message); - } - - /** - * - */ - public function testMoveFileMissingSourceFilePath() - { - $sourceFilePath = '/file.jpg'; - $destinationPath = '/'; - - $requestBody = [ - 'destinationPath' => $destinationPath, - ]; - - $response = $this->client->move($requestBody); - - FileTest::assertNull($response->result); - FileTest::assertEquals('Missing parameter sourceFilePath and/or destinationPath for Move File API',$response->error->message); - } - - /** - * - */ - public function testMoveFileMissingDestinationPath() - { - $sourceFilePath = '/file.jpg'; - $destinationPath = '/'; - - $requestBody = [ - 'sourceFilePath' => $sourceFilePath, - ]; - - $response = $this->client->move($requestBody); - - FileTest::assertNull($response->result); - FileTest::assertEquals('Missing parameter sourceFilePath and/or destinationPath for Move File API',$response->error->message); - - } - - /** - * - */ - public function testRenameFile() - { - $filePath = '/sample-folder/sample-file.jpg'; - $newFileName = 'sample-file2.jpg'; - - $requestBody = [ - 'filePath' => $filePath, - 'newFileName' => $newFileName, - 'purgeCache' => true - ]; - - $mockBodyResponse = Utils::streamFor(); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->rename($requestBody); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $stream = Utils::streamFor($request->getBody())->getContents(); - - // Request Check - FileTest::assertEquals("/v1/files/rename",$requestPath); - FileTest::assertEquals($stream,json_encode($requestBody)); - - // Response Check - FolderTest::assertNull($response->result); - FolderTest::assertNull($response->error); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'PUT'); - } - - - /** - * - */ - public function testRenameFileWithoutPurgeCache() - { - $filePath = '/sample-folder/sample-file.jpg'; - $newFileName = 'sample-file2.jpg'; - - $requestBody = [ - 'filePath' => $filePath, - 'newFileName' => $newFileName, - ]; - - $mockBodyResponse = Utils::streamFor(); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->rename($requestBody); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $stream = Utils::streamFor($request->getBody())->getContents(); - - // Request Check - FileTest::assertEquals("/v1/files/rename",$requestPath); - FileTest::assertEquals($stream,json_encode([ - 'filePath' => '/sample-folder/sample-file.jpg', - 'newFileName' => 'sample-file2.jpg', - 'purgeCache' => false - ])); - - // Response Check - FolderTest::assertNull($response->result); - FolderTest::assertNull($response->error); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'PUT'); - } - - /** - * - */ - public function testRenameFileWithInvalidRequest() - { - $response = $this->client->rename(); - - FileTest::assertEquals('Rename File API accepts an array, null passed',$response->error->message); - } - - /** - * - */ - public function testRenameFileWithNonArrayParameter() - { - $filePath = '/sample-folder/sample-file.jpg'; - $newFileName = 'sample-file2.jpg'; - - $requestBody = $filePath; - - $response = $this->client->rename($requestBody); - - FileTest::assertEquals('Rename File API accepts an array of parameters, non array value passed',$response->error->message); - } - - /** - * - */ - public function testRenameFileWithEmptyArrayParameter() - { - $requestBody = []; - - $response = $this->client->rename($requestBody); - - FileTest::assertEquals('Rename File API accepts an array of parameters, empty array passed',$response->error->message); - } - - /** - * - */ - public function testRenameFileWithMissingFilePath() - { - $filePath = ''; - $newFileName = 'sample-file2.jpg'; - - $requestBody = [ - 'filePath' => $filePath, - 'newFileName' => $newFileName, - ]; - - $response = $this->client->rename($requestBody); - - FileTest::assertEquals('Missing parameter filePath and/or newFileName for Rename File API',$response->error->message); - } - - /** - * - */ - public function testRenameFileWithMissingNewFileName() - { - $filePath = '/sample-folder/sample-file.jpg'; - $newFileName = ''; - - $requestBody = [ - 'filePath' => $filePath, - 'newFileName' => $newFileName, - ]; - - $response = $this->client->rename($requestBody); - - FileTest::assertEquals('Missing parameter filePath and/or newFileName for Rename File API',$response->error->message); - } - - /** - * - */ - public function testRestoreFileVersion() - { - $fileId = 'fileId'; - $versionId = 'versionId'; - - $requestBody = [ - 'fileId' => $fileId, - 'versionId' => $versionId, - ]; - - $responseBody = [ - 'type' => 'file', - 'name' => 'default-image.jpg', - 'fileId' => '5de4fb65c851e55df73abe8d', - 'tags' => null, - 'customCoordinates' => null, - 'isPrivateFile' => false, - 'url' => 'https://ik.imagekit.io/ot2cky3ujwa/default-image.jpg', - 'thumbnail' => 'https://ik.imagekit.io/ot2cky3ujwa/tr:n-media_library_thumbnail/default-image.jpg', - 'fileType' => 'image', - 'filePath' => '/default-image.jpg', - "versionInfo" => [ - "id" => "598821f949c0a938d57563bd", - "name" => "Version 1" - ], - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($responseBody)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->restoreFileVersion($requestBody); - - $request = $container[0]['request']; - $queryString = $request->getUri()->getQuery(); - $requestPath = $request->getUri()->getPath(); - - $stream = Utils::streamFor($request->getBody())->getContents(); - $stream = json_decode($stream,true); - // Request Check - FileTest::assertEquals("/v1/files/{$fileId}/versions/{$versionId}/restore",$requestPath); - FileTest::assertEmpty($stream); - - // Response Check - FileTest::assertEquals(json_encode($responseBody), json_encode($response->result)); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'PUT'); - } - - /** - * - */ - public function testRestoreFileVersionWithInvalidRequest() - { - $response = $this->client->restoreFileVersion(); - - FileTest::assertEquals('Restore File Version API accepts an array, null passed',$response->error->message); - } - - /** - * - */ - public function testRestoreFileVersionWithNonArrayParameter() - { - $fileId = 'fileId'; - $versionId = 'versionId'; - - $requestBody = $fileId; - - $response = $this->client->restoreFileVersion($requestBody); - - FileTest::assertEquals('Restore File Version API accepts an array of parameters, non array value passed',$response->error->message); - } - - /** - * - */ - public function testRestoreFileVersionWithEmptyArrayParameter() - { - $requestBody = []; - - $response = $this->client->restoreFileVersion($requestBody); - - FileTest::assertEquals('Restore File Version API accepts an array of parameters, empty array passed',$response->error->message); - } - - /** - * - */ - public function testRestoreFileVersionWithMissingFileId() - { - $fileId = ''; - $versionId = 'versionId'; - - $requestBody = [ - 'fileId' => $fileId, - 'versionId' => $versionId, - ]; - - $response = $this->client->restoreFileVersion($requestBody); - - FileTest::assertEquals('Missing parameter fileId and/or versionId for Restore File Version API',$response->error->message); - } - - /** - * - */ - public function testRestoreFileVersionWithMissingVersionId() - { - $fileId = 'fileId'; - $versionId = ''; - - $requestBody = [ - 'fileId' => $fileId, - 'versionId' => $versionId, - ]; - - $response = $this->client->restoreFileVersion($requestBody); - - FileTest::assertEquals('Missing parameter fileId and/or versionId for Restore File Version API',$response->error->message); - } - - - - /** - * - */ - public function testGetFileMetadataUsingFileId() - { - $fileId = '5de4fb65c851e55df73abe8d'; - - $responseBody = [ - 'height' => 3214, - 'width' => 3948, - 'size' => 207097, - 'format' => 'jpg', - 'hasColorProfile' => true, - 'quality' => 90, - 'density' => 300, - 'hasTransparency' => false, - 'exif' => [ - 'image' => [ - 'ImageWidth' => 4584, - 'ImageHeight' => 3334, - 'BitsPerSample' => [8, 8, 8], - 'PhotometricInterpretation' => 2, - 'ImageDescription' => 'Character illustration of people holding creative ideas icons', - 'Orientation' => 1, - 'SamplesPerPixel' => 3, - 'XResolution' => 300, - 'YResolution' => 300, - 'ResolutionUnit' => 2, - 'Software' => 'Adobe Photoshop CC 2019 (Windows)', - 'ModifyDate' => '2019=>05=>25 10=>16=>49', - 'Artist' => 'busbus', - 'Copyright' => 'Rawpixel Ltd.', - 'ExifOffset' => 356 - ], - 'thumbnail' => [ - 'Compression' => 6, - 'XResolution' => 72, - 'YResolution' => 72, - 'ResolutionUnit' => 2, - 'ThumbnailOffset' => 506, - 'ThumbnailLength' => 6230, - ], - 'exif' => [ - 'ExifVersion' => '0221', - 'ColorSpace' => 65535, - 'ExifImageWidth' => 3948, - 'ExifImageHeight' => 3214 - ], - 'gps' => [], - 'interoperability' => [], - 'makernote' => [], - ], - 'pHash' => 'd1813e2fc22c7b2f', - ]; - $mockBodyResponse = Utils::streamFor(json_encode($responseBody)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->getFileMetaData($fileId); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $queryString = $request->getUri()->getQuery(); - $stream = Utils::streamFor($request->getBody())->getContents(); - // $stream = json_decode($stream,true); - - // Request Check - FileTest::assertEquals("/v1/files/{$fileId}/metadata",$requestPath); - FileTest::assertEmpty($stream); - - // Response Check - FileTest::assertEquals(json_encode($responseBody), json_encode($response->result)); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'GET'); - } - - - /** - * - */ - public function testGetFileMetadataUsingFileIdWithMissingFileId() - { - $fileId = ''; - - $response = $this->client->getFileMetaData($fileId); - - FileTest::assertEquals('Missing File ID parameter for this request', $response->error->message); - } - - /** - * - */ - public function testGetFileMetadataUsingRemoteURL() - { - $remoteURL = 'https://ik.imagekit.io/demo/sample-folder/default-image.jpg'; - - $requestBody = [ - 'height' => 3214, - 'width' => 3948, - 'size' => 207097, - 'format' => 'jpg', - 'hasColorProfile' => true, - 'quality' => 90, - 'density' => 300, - 'hasTransparency' => false, - 'exif' => [ - 'image' => [ - 'ImageWidth' => 4584, - 'ImageHeight' => 3334, - 'BitsPerSample' => [8, 8, 8], - 'PhotometricInterpretation' => 2, - 'ImageDescription' => 'Character illustration of people holding creative ideas icons', - 'Orientation' => 1, - 'SamplesPerPixel' => 3, - 'XResolution' => 300, - 'YResolution' => 300, - 'ResolutionUnit' => 2, - 'Software' => 'Adobe Photoshop CC 2019 (Windows)', - 'ModifyDate' => '2019=>05=>25 10=>16=>49', - 'Artist' => 'busbus', - 'Copyright' => 'Rawpixel Ltd.', - 'ExifOffset' => 356 - ], - 'thumbnail' => [ - 'Compression' => 6, - 'XResolution' => 72, - 'YResolution' => 72, - 'ResolutionUnit' => 2, - 'ThumbnailOffset' => 506, - 'ThumbnailLength' => 6230, - ], - 'exif' => [ - 'ExifVersion' => '0221', - 'ColorSpace' => 65535, - 'ExifImageWidth' => 3948, - 'ExifImageHeight' => 3214 - ], - 'gps' => [], - 'interoperability' => [], - 'makernote' => [], - ], - 'pHash' => 'd1813e2fc22c7b2f', - ]; - $mockBodyResponse = Utils::streamFor(json_encode($requestBody)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->getFileMetadataFromRemoteURL($remoteURL); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $queryString = $request->getUri()->getQuery(); - $stream = Utils::streamFor($request->getBody())->getContents(); - $stream = json_decode($stream,true); - - // Request Check - FileTest::assertEquals("/v1/metadata",$requestPath); - FileTest::assertEquals($queryString,http_build_query(['url'=>$remoteURL])); - - // Response Check - FileTest::assertEquals(json_encode($requestBody), json_encode($response->result)); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'GET'); - } - - - - /** - * - */ - public function testGetFileMetadataUsingRemoteURLMissingURL() - { - $remoteURL = ''; - - $response = $this->client->getFileMetadataFromRemoteURL($remoteURL); - - FileTest::assertEquals('Your request is missing the url query paramater', $response->error->message); - } - - /** - * - */ - public function testGetFileMetadataUsingRemoteURLInvalidURL() - { - $remoteURL = 'invalid_url'; - - $response = $this->client->getFileMetadataFromRemoteURL($remoteURL); - - FileTest::assertEquals('Invalid URL provided for this request', $response->error->message); - } - - /** - * - */ - private function stubHttpClient($methodName, $response) - { - $stub = $this->createMock(GuzzleHttpWrapper::class); - $stub->method('setDatas'); - $stub->method($methodName)->willReturn($response); - - $closure = function () use ($stub) { - $this->httpClient = $stub; - }; - $doClosure = $closure->bindTo($this->client, ImageKit::class); - $doClosure(); - } - - /** - * - */ - private function createMockClient($handler){ - $this->mockClient = new ImageKit( - 'testing_public_key', - 'testing_private_key', - 'https://ik.imagekit.io/demo', - Transformation::DEFAULT_TRANSFORMATION_POSITION, - $handler - ); - } - - protected function setUp() - { - $this->client = new ImageKit( - 'testing_public_key', - 'testing_private_key', - 'https://ik.imagekit.io/demo' - ); - - } - - protected function tearDown() - { - $this->client = null; - } -} diff --git a/tests/ImageKit/Manage/FolderTest.php b/tests/ImageKit/Manage/FolderTest.php deleted file mode 100644 index e0fa83a2..00000000 --- a/tests/ImageKit/Manage/FolderTest.php +++ /dev/null @@ -1,565 +0,0 @@ - $parentFolderPath, - 'folderName' => $folderName, - ]; - - $mockBodyResponse = Utils::streamFor(); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->createFolder($requestBody); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $stream = Utils::streamFor($request->getBody())->getContents(); - - // Request Check - FileTest::assertEquals("/v1/folder/",$requestPath); - FileTest::assertEquals($stream,json_encode($requestBody)); - - // Response Check - FolderTest::assertNull($response->result); - FolderTest::assertNull($response->error); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'POST'); - } - - /** - * - */ - public function testCreateFolderInvalidRequest() - { - $response = $this->client->createFolder(); - - FolderTest::assertEquals('Create Folder API accepts an array, null passed',$response->error->message); - } - - /** - * - */ - public function testCreateFolderWithNonArrayParameter() - { - $folderName = 'new-folder'; - $parentFolderPath = '/'; - - $requestBody = $folderName; - - $response = $this->client->createFolder($requestBody); - - FolderTest::assertEquals('Create Folder API accepts an array of parameters, non array value passed',$response->error->message); - } - - /** - * - */ - public function testCreateFolderWithEmptyArrayParameter() - { - $requestBody = []; - - $response = $this->client->createFolder($requestBody); - - FolderTest::assertEquals('Create Folder API accepts an array of parameters, empty array passed',$response->error->message); - } - - - public function testCreateFolderWithMissingFolderName() - { - $folderName = ''; - $parentFolderPath = '/'; - - $requestBody = [ - 'folderName' => $folderName, - 'parentFolderPath' => $parentFolderPath, - ]; - - $response = $this->client->createFolder($requestBody); - - FolderTest::assertEquals('Missing parameter folderName and/or parentFolderPath for Create Folder API', $response->error->message); - } - - public function testCreateFolderWithMissingParentFolderPath() - { - $folderName = 'new-folder'; - $parentFolderPath = ''; - - $requestBody = [ - 'folderName' => $folderName, - 'parentFolderPath' => $parentFolderPath, - ]; - - $response = $this->client->createFolder($requestBody); - - FolderTest::assertEquals('Missing parameter folderName and/or parentFolderPath for Create Folder API', $response->error->message); - } - - /** - * - */ - public function testDeleteFolder() - { - $folderPath = '/new-folder'; - - $mockBodyResponse = Utils::streamFor(); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->deleteFolder($folderPath); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $stream = Utils::streamFor($request->getBody())->getContents(); - $stream = json_decode($stream,true); - - // Request Check - FileTest::assertEquals("/v1/folder/",$requestPath); - FileTest::assertEquals($stream['folderPath'],$folderPath); - - // Response Check - FolderTest::assertNull($response->result); - FolderTest::assertNull($response->error); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'DELETE'); - } - - /** - * - */ - public function testDeleteFolderMissingFolderPath() - { - $folderPath = ''; - - $response = $this->client->deleteFolder($folderPath); - - FolderTest::assertEquals('Missing folderPath for Delete Folder API',$response->error->message); - } - - public function testCopyFolder(){ - - $sourceFolderPath = "/source-folder/"; - $destinationPath = "/destination-folder/"; - $includeFileVersions = false; - - $requestBody = [ - 'sourceFolderPath' => $sourceFolderPath, - 'destinationPath' => $destinationPath, - 'includeFileVersions' => $includeFileVersions - ]; - - $responseBody = [ - "jobId" => "598821f949c0a938d57563bd" - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($responseBody)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->copyFolder($requestBody); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $stream = Utils::streamFor($request->getBody())->getContents(); - - // Request Check - FileTest::assertEquals("/v1/bulkJobs/copyFolder",$requestPath); - FileTest::assertEquals($stream,json_encode($requestBody)); - - // Response Check - FolderTest::assertEquals(json_encode($responseBody), json_encode($response->result)); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'POST'); - } - - - public function testCopyFolderWithoutIncludeFileVersions(){ - - $sourceFolderPath = "/source-folder/"; - $destinationPath = "/destination-folder/"; - - $requestBody = [ - 'sourceFolderPath' => $sourceFolderPath, - 'destinationPath' => $destinationPath, - ]; - - $responseBody = [ - "jobId" => "598821f949c0a938d57563bd" - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($responseBody)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->copyFolder($requestBody); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $stream = Utils::streamFor($request->getBody())->getContents(); - - // Request Check - FileTest::assertEquals("/v1/bulkJobs/copyFolder",$requestPath); - FileTest::assertEquals($stream,json_encode([ - 'sourceFolderPath' => '/source-folder/', - 'destinationPath' => '/destination-folder/', - 'includeFileVersions' => false - ])); - - // Response Check - FolderTest::assertEquals(json_encode($responseBody), json_encode($response->result)); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'POST'); - } - - - public function testCopyFolderInvalidRequest(){ - - $response = $this->client->copyFolder(); - - FolderTest::assertEquals("Copy Folder API accepts an array, null passed", $response->error->message); - - } - - public function testCopyFolderNonArray(){ - - $sourceFolderPath = "/source-folder/"; - $destinationPath = "/destination-folder/"; - $includeVersions = false; - - $requestBody = $sourceFolderPath; - $response = $this->client->copyFolder($requestBody); - - FolderTest::assertEquals("Copy Folder API accepts an array of parameters, non array value passed", $response->error->message); - - } - - public function testCopyFolderEmptyArray(){ - - $sourceFolderPath = "/source-folder/"; - $destinationPath = "/destination-folder/"; - $includeVersions = false; - - $requestBody = []; - $response = $this->client->copyFolder($requestBody); - - FolderTest::assertEquals("Copy Folder API accepts an array of parameters, empty array passed", $response->error->message); - - } - - public function testCopyFolderWithMissingSourceFolderPath(){ - - $sourceFolderPath = ""; - $destinationPath = "/destination-folder/"; - $includeVersions = false; - - $requestBody = [ - 'sourceFolderPath' => $sourceFolderPath, - 'destinationPath' => $destinationPath, - 'includeVersions' => $includeVersions - ]; - - $response = $this->client->copyFolder($requestBody); - - FolderTest::assertEquals("Missing parameter sourceFolderPath and/or destinationPath for Copy Folder API", $response->error->message); - - } - - public function testCopyFolderWithMissingDestinationPath(){ - - $sourceFolderPath = "/source-folder/"; - $destinationPath = ""; - $includeVersions = false; - - $requestBody = [ - 'sourceFolderPath' => $sourceFolderPath, - 'destinationPath' => $destinationPath, - 'includeVersions' => $includeVersions - ]; - - $response = $this->client->copyFolder($requestBody); - - FolderTest::assertEquals("Missing parameter sourceFolderPath and/or destinationPath for Copy Folder API", $response->error->message); - - } - - public function testCopyFolderWithNullIncludeVersions(){ - - $sourceFolderPath = "/source-folder/"; - $destinationPath = "/destination-folder/"; - $includeVersions = null; - - $requestBody = [ - 'sourceFolderPath' => $sourceFolderPath, - 'destinationPath' => $destinationPath, - 'includeVersions' => $includeVersions - ]; - - $mockBodyResponse = Utils::streamFor(); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->copyFolder($requestBody); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $stream = Utils::streamFor($request->getBody())->getContents(); - - // Request Check - FileTest::assertEquals("/v1/bulkJobs/copyFolder",$requestPath); - FileTest::assertEquals($stream,json_encode([ - 'sourceFolderPath' => '/source-folder/', - 'destinationPath' => '/destination-folder/', - 'includeFileVersions' => false - ])); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'POST'); - } - - - public function testMoveFolder(){ - - $sourceFolderPath = "/source-folder/"; - $destinationPath = "/destination-folder/"; - - $requestBody = [ - 'sourceFolderPath' => $sourceFolderPath, - 'destinationPath' => $destinationPath, - ]; - - $responseBody = [ - "jobId" => "598821f949c0a938d57563bd" - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($responseBody)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->moveFolder($requestBody); - - $request = $container[0]['request']; - $requestPath = $request->getUri()->getPath(); - $stream = Utils::streamFor($request->getBody())->getContents(); - - // Request Check - FileTest::assertEquals("/v1/bulkJobs/moveFolder",$requestPath); - FileTest::assertEquals($stream,json_encode($requestBody)); - - // Response Check - FolderTest::assertEquals(json_encode($responseBody), json_encode($response->result)); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - FileTest::assertEquals($requestMethod,'POST'); - } - - - public function testMoveFolderInvalidRequest(){ - - $response = $this->client->moveFolder(); - - FolderTest::assertEquals("Move Folder API accepts an array, null passed", $response->error->message); - - } - - public function testMoveFolderNonArray(){ - - $sourceFolderPath = "/source-folder/"; - $destinationPath = "/destination-folder/"; - - $requestBody = $sourceFolderPath; - $response = $this->client->moveFolder($requestBody); - - FolderTest::assertEquals("Move Folder API accepts an array of parameters, non array value passed", $response->error->message); - - } - - public function testMoveFolderEmptyArray(){ - - $sourceFolderPath = "/source-folder/"; - $destinationPath = "/destination-folder/"; - - $requestBody = []; - $response = $this->client->moveFolder($requestBody); - - FolderTest::assertEquals("Move Folder API accepts an array of parameters, empty array passed", $response->error->message); - - } - - public function testMoveFolderWithMissingSourceFolderPath(){ - - $sourceFolderPath = ""; - $destinationPath = "/destination-folder/"; - - $requestBody = [ - 'sourceFolderPath' => $sourceFolderPath, - 'destinationPath' => $destinationPath, - ]; - - $response = $this->client->moveFolder($requestBody); - - FolderTest::assertEquals("Missing parameter sourceFolderPath and/or destinationPath for Move Folder API", $response->error->message); - - } - - public function testMoveFolderWithMissingDestinationPath(){ - - $sourceFolderPath = "/source-folder/"; - $destinationPath = ""; - - $requestBody = [ - 'sourceFolderPath' => $sourceFolderPath, - 'destinationPath' => $destinationPath, - ]; - - $response = $this->client->moveFolder($requestBody); - - FolderTest::assertEquals("Missing parameter sourceFolderPath and/or destinationPath for Move Folder API", $response->error->message); - - } - - - private function stubHttpClient($methodName, $response) - { - $stub = $this->createMock(GuzzleHttpWrapper::class); - $stub->method('setDatas'); - $stub->method($methodName)->willReturn($response); - - $closure = function () use ($stub) { - $this->httpClient = $stub; - }; - $doClosure = $closure->bindTo($this->client, ImageKit::class); - $doClosure(); - } - - protected function setUp() - { - $this->client = new ImageKit( - 'testing_public_key', - 'testing_private_key', - 'https://ik.imagekit.io/demo' - ); - } - - /** - * - */ - private function createMockClient($handler){ - $this->mockClient = new ImageKit( - 'testing_public_key', - 'testing_private_key', - 'https://ik.imagekit.io/demo', - Transformation::DEFAULT_TRANSFORMATION_POSITION, - $handler - ); - } - - protected function tearDown() - { - $this->client = null; - } -} diff --git a/tests/ImageKit/Phash/PhashTest.php b/tests/ImageKit/Phash/PhashTest.php deleted file mode 100644 index 0578e0c3..00000000 --- a/tests/ImageKit/Phash/PhashTest.php +++ /dev/null @@ -1,55 +0,0 @@ -pHashDistance($firstHash, $secondHash); - PhashTest::assertEquals(0, $response); - } - - /** - * - */ - public function testPHashDistanceForSimilarImages() - { - $firstHash = '2d5ad3936d2e015b'; - $secondHash = '2d6ed293db36a4fb'; - - $pHash = new Phash(); - $response = $pHash->pHashDistance($firstHash, $secondHash); - PhashTest::assertEquals(17, $response); - } - - /** - * - */ - public function testPHashDistanceForDissimilarImages() - { - $firstHash = '33699c96619cc69e'; - $secondHash = '968e978414fe04ea'; - - $pHash = new Phash(); - $response = $pHash->pHashDistance($firstHash, $secondHash); - PhashTest::assertEquals(30, $response); - } -} diff --git a/tests/ImageKit/Resource/GuzzleHttpWrapperTest.php b/tests/ImageKit/Resource/GuzzleHttpWrapperTest.php deleted file mode 100644 index 72e29efb..00000000 --- a/tests/ImageKit/Resource/GuzzleHttpWrapperTest.php +++ /dev/null @@ -1,41 +0,0 @@ - 'Test', - 'param2' => '', - 'param3' => null, - 'param4' => [], - 'param5' => [], - 'param6' => true, - 'param7' => false, - 'param8' => 0 - ]; - - $stub = $this->createMock(Client::class); - - $resource = new GuzzleHttpWrapper($stub); - $resource->setDatas($data); - - GuzzleHttpWrapperTest::assertEquals(['param1' => 'Test', 'param6' => true, 'param7' => false, 'param8' => 0], $resource->getDatas()); - } -} diff --git a/tests/ImageKit/Upload/UploadTest.php b/tests/ImageKit/Upload/UploadTest.php deleted file mode 100644 index 8c8b1df9..00000000 --- a/tests/ImageKit/Upload/UploadTest.php +++ /dev/null @@ -1,856 +0,0 @@ - "598821f949c0a938d57563bd", - "name"=> "file1.jpg", - "url"=> "https://ik.imagekit.io/your_imagekit_id/images/products/file1.jpg", - "thumbnailUrl"=> "https://ik.imagekit.io/your_imagekit_id/tr:n-media_library_thumbnail/images/products/file1.jpg", - "height"=> 300, - "width"=> 200, - "size"=> 83622, - "filePath"=> "/images/products/file1.jpg", - "tags"=> ["t-shirt", "round-neck", "sale2019"], - "isPrivateFile"=> false, - "customCoordinates"=> null, - "fileType"=> "image", - "AITags"=>[["name"=>"Face","confidence"=>99.95,"source"=>"aws-auto-tagging"]], - "extensionStatus"=>["aws-auto-tagging"=>"success"] - ]; - - /** - * - */ - private function stubHttpClient($response) - { - $stub = $this->createMock(GuzzleHttpWrapper::class); - $stub->method('setDatas'); - $stub->method('postMultipart')->willReturn($response); - - $closure = function () use ($stub) { - $this->httpClient = $stub; - }; - $doClosure = $closure->bindTo($this->client, ImageKit::class); - $doClosure(); - } - - /** - * - */ - private function createMockClient($handler){ - $this->mockClient = new ImageKit( - 'testing_public_key', - 'testing_private_key', - 'https://ik.imagekit.io/demo', - Transformation::DEFAULT_TRANSFORMATION_POSITION, - $handler - ); - } - - private function checkFormData($requestBody, $boundary, $fieldName, $fieldValue) { - - $string = '--'.$boundary.' Content-Disposition: form-data; name="'.$fieldName.'" Content-Length: '.strlen($fieldValue).' '.$fieldValue; - $string = substr(json_encode($string),1,-1); - - UploadTest::assertContains($string,$requestBody); - } - - /** - * - */ - public function testFileUploadIfInvalidUploadParams() - { - - $mockBodyResponse = Utils::streamFor(); - - $response = $this->client->uploadFile(null); - - UploadTest::assertNull($response->result); - UploadTest::assertEquals('Upload API accepts an array of parameters, null passed', $response->error->message); - } - - /** - * - */ - public function testFileUploadIfMissingFileName() - { - - $fileOptions = [ - 'file' => 'http://lorempixel.com/640/480/', - ]; - - $response = $this->client->uploadFile($fileOptions); - - UploadTest::assertNull($response->result); - UploadTest::assertEquals('Missing fileName parameter for upload', $response->error->message); - } - - /** - * - */ - public function testFileUploadIfMissingFile() - { - $fileOptions = [ - 'fileName' => 'default-image.png', - ]; - - $response = $this->client->uploadFile($fileOptions); - - UploadTest::assertNull($response->result); - UploadTest::assertEquals('Missing file parameter for upload', $response->error->message); - } - - - /** - * - */ - public function testFileUploadIfSuccessful() - { - $fileOptions = [ - 'file' => 'http://lorempixel.com/640/480/', - 'fileName' => 'test_file_name', - "useUniqueFileName" => false, // true|false - "tags" => implode(',',["abd", "def"]), // Comma Separated, Max length: 500 chars - "folder" => "/sample-folder", // Using multiple forward slash (/) creates a nested folder - "isPrivateFile" => true, // true|false - "customCoordinates" => implode(",", ["10", "10", "100", "100"]), // Comma Separated, Max length: 500 chars - "responseFields" => implode(",", ["tags", "customMetadata"]), // Comma Separated, check docs for more responseFields - "extensions" => [ // An array of extensions, for more extensions refer to docs - [ - "name" => "remove-bg", - "options" => [ // all parameters inside this object are sent directly to the third-party service - "add_shadow" => true - ] - ] - ], - "webhookUrl" => "https://example.com/webhook", // Notification URL to receive the final status of pending extensions - "overwriteFile" => true, // true|false, in case of false useUniqueFileName should be true - "overwriteAITags" => false, // true|false, set to false in order to preserve overwriteAITags - "overwriteTags" => false, // true|false - "overwriteCustomMetadata" => true, // true|false - "customMetadata" => [ // An array of created custom fields, for more details refer to docs - "SKU" => "VS882HJ2JD", - "price" => 599.99, - ], - 'transformation' => [ - 'pre' => 'l-text,i-Imagekit,fs-50,l-end', - 'post' => [ - [ - 'type' => 'transformation', - 'value' => 'h-100' - ] - ] - ], - 'checks' => "'request.folder' : '/sample-folder'", - 'isPublished' => true - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($this->uploadSuccessResponseObj)); - - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->uploadFile($fileOptions); - - $requestBody = $container[0]['request']->getBody(); - $requestHeaders = $container[0]['request']->getHeaders(); - $boundary = str_replace("multipart/form-data; boundary=","",$requestHeaders["Content-Type"][0]); - - UploadTest::assertArrayHasKey("Content-Type",$requestHeaders); - UploadTest::assertStringStartsWith("multipart/form-data; boundary=",$requestHeaders['Content-Type'][0]); - - $stream = Utils::streamFor($requestBody); - $stream = str_replace('\r\n',' ',json_encode($stream->getContents())); - - $this->checkFormData($stream,$boundary,"file",$fileOptions['file']); - $this->checkFormData($stream,$boundary,"fileName",$fileOptions['fileName']); - $this->checkFormData($stream,$boundary,"tags",implode(',',["abd", "def"])); - $this->checkFormData($stream,$boundary,"isPrivateFile","true"); - $this->checkFormData($stream,$boundary,"useUniqueFileName","false"); - $this->checkFormData($stream,$boundary,"responseFields",implode(",", ["tags", "customMetadata"])); - $this->checkFormData($stream,$boundary,"extensions",json_encode($fileOptions['extensions'])); - $this->checkFormData($stream,$boundary,"webhookUrl","https://example.com/webhook"); - $this->checkFormData($stream,$boundary,"overwriteFile","true"); - $this->checkFormData($stream,$boundary,"overwriteAITags","false"); - $this->checkFormData($stream,$boundary,"overwriteCustomMetadata","true"); - $this->checkFormData($stream,$boundary,"customMetadata",json_encode($fileOptions['customMetadata'])); - $this->checkFormData($stream,$boundary,"transformation",json_encode($fileOptions['transformation'])); - $this->checkFormData($stream,$boundary,"checks",$fileOptions['checks']); - $this->checkFormData($stream,$boundary,"isPublished","true"); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - UploadTest::assertEquals($requestMethod,'POST'); - - // Response Check - UploadTest::assertEquals(json_encode($this->uploadSuccessResponseObj), json_encode($response->result)); - } - - /** - * - */ - public function testFileUploadWithOnlyPreTransformationIfSuccessful() - { - $fileOptions = [ - 'file' => 'http://lorempixel.com/640/480/', - 'fileName' => 'test_file_name', - "useUniqueFileName" => true, // true|false - "responseFields" => implode(",", ["tags", "customMetadata"]), // Comma Separated, check docs for more responseFields - 'transformation' => [ - 'pre' => 'l-text,i-Imagekit,fs-50,l-end', - ], - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($this->uploadSuccessResponseObj)); - - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->uploadFile($fileOptions); - - $requestBody = $container[0]['request']->getBody(); - $requestHeaders = $container[0]['request']->getHeaders(); - $boundary = str_replace("multipart/form-data; boundary=","",$requestHeaders["Content-Type"][0]); - - UploadTest::assertArrayHasKey("Content-Type",$requestHeaders); - UploadTest::assertStringStartsWith("multipart/form-data; boundary=",$requestHeaders['Content-Type'][0]); - - $stream = Utils::streamFor($requestBody); - $stream = str_replace('\r\n',' ',json_encode($stream->getContents())); - - $this->checkFormData($stream,$boundary,"file",$fileOptions['file']); - $this->checkFormData($stream,$boundary,"fileName",$fileOptions['fileName']); - $this->checkFormData($stream,$boundary,"useUniqueFileName","true"); - $this->checkFormData($stream,$boundary,"responseFields",implode(",", ["tags", "customMetadata"])); - $this->checkFormData($stream,$boundary,"transformation",json_encode($fileOptions['transformation'])); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - UploadTest::assertEquals($requestMethod,'POST'); - - // Response Check - UploadTest::assertEquals(json_encode($this->uploadSuccessResponseObj), json_encode($response->result)); - } - - /** - * - */ - public function testFileUploadWithOnlyPostTransformationIfSuccessful() - { - $fileOptions = [ - 'file' => 'http://lorempixel.com/640/480/', - 'fileName' => 'test_file_name', - "useUniqueFileName" => true, // true|false - "responseFields" => implode(",", ["tags", "customMetadata"]), // Comma Separated, check docs for more responseFields - 'transformation' => [ - 'post' => [ - [ - 'type' => 'transformation', - 'value' => 'h-100' - ] - ] - ], - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($this->uploadSuccessResponseObj)); - - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->uploadFile($fileOptions); - - $requestBody = $container[0]['request']->getBody(); - $requestHeaders = $container[0]['request']->getHeaders(); - $boundary = str_replace("multipart/form-data; boundary=","",$requestHeaders["Content-Type"][0]); - - UploadTest::assertArrayHasKey("Content-Type",$requestHeaders); - UploadTest::assertStringStartsWith("multipart/form-data; boundary=",$requestHeaders['Content-Type'][0]); - - $stream = Utils::streamFor($requestBody); - $stream = str_replace('\r\n',' ',json_encode($stream->getContents())); - - $this->checkFormData($stream,$boundary,"file",$fileOptions['file']); - $this->checkFormData($stream,$boundary,"fileName",$fileOptions['fileName']); - $this->checkFormData($stream,$boundary,"useUniqueFileName","true"); - $this->checkFormData($stream,$boundary,"responseFields",implode(",", ["tags", "customMetadata"])); - $this->checkFormData($stream,$boundary,"transformation",json_encode($fileOptions['transformation'])); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - UploadTest::assertEquals($requestMethod,'POST'); - - // Response Check - UploadTest::assertEquals(json_encode($this->uploadSuccessResponseObj), json_encode($response->result)); - } - - /** - * - */ - public function testFileUploadMissingUseUniqueFileName() - { - $fileOptions = [ - 'file' => 'http://lorempixel.com/640/480/', - 'fileName' => 'test_file_name', - 'isPrivateFile' => true - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($fileOptions)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->uploadFile($fileOptions); - - $requestBody = $container[0]['request']->getBody(); - $requestHeaders = $container[0]['request']->getHeaders(); - $boundary = str_replace("multipart/form-data; boundary=","",$requestHeaders["Content-Type"][0]); - - UploadTest::assertArrayHasKey("Content-Type",$requestHeaders); - UploadTest::assertStringStartsWith("multipart/form-data; boundary=",$requestHeaders['Content-Type'][0]); - - $stream = Utils::streamFor($requestBody); - $stream = str_replace('\r\n',' ',json_encode($stream->getContents())); - - $this->checkFormData($stream,$boundary,"file",$fileOptions['file']); - $this->checkFormData($stream,$boundary,"fileName",$fileOptions['fileName']); - $this->checkFormData($stream,$boundary,"isPrivateFile","true"); - UploadTest::assertNotContains("useUniqueFileName",$stream); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - UploadTest::assertEquals($requestMethod,'POST'); - } - - /** - * - */ - public function testFileUploadMissingIsPrivateFileUseUniqueFileName() - { - $fileOptions = [ - 'file' => 'http://lorempixel.com/640/480/', - 'fileName' => 'test_file_name', - "tags" => implode(",",["abd", "def"]), - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($fileOptions)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->uploadFile($fileOptions); - - $requestBody = $container[0]['request']->getBody(); - $requestHeaders = $container[0]['request']->getHeaders(); - $boundary = str_replace("multipart/form-data; boundary=","",$requestHeaders["Content-Type"][0]); - - UploadTest::assertArrayHasKey("Content-Type",$requestHeaders); - UploadTest::assertStringStartsWith("multipart/form-data; boundary=",$requestHeaders['Content-Type'][0]); - - $stream = Utils::streamFor($requestBody); - $stream = str_replace('\r\n',' ',json_encode($stream->getContents())); - - $this->checkFormData($stream,$boundary,"file",$fileOptions['file']); - $this->checkFormData($stream,$boundary,"fileName",$fileOptions['fileName']); - $this->checkFormData($stream,$boundary,"tags","abd,def"); - UploadTest::assertNotContains("isPrivateFile",$stream); - UploadTest::assertNotContains("useUniqueFileName",$stream); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - UploadTest::assertEquals($requestMethod,'POST'); - } - - /** - * - */ - public function testFileUploadTagsAsArray() - { - $fileOptions = [ - 'file' => 'http://lorempixel.com/640/480/', - 'fileName' => 'test_file_name', - "tags" => ["abd", "def"], - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($fileOptions)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->uploadFile($fileOptions); - - $requestBody = $container[0]['request']->getBody(); - $requestHeaders = $container[0]['request']->getHeaders(); - $boundary = str_replace("multipart/form-data; boundary=","",$requestHeaders["Content-Type"][0]); - - UploadTest::assertArrayHasKey("Content-Type",$requestHeaders); - UploadTest::assertStringStartsWith("multipart/form-data; boundary=",$requestHeaders['Content-Type'][0]); - - $stream = Utils::streamFor($requestBody); - $stream = str_replace('\r\n',' ',json_encode($stream->getContents())); - - $this->checkFormData($stream,$boundary,"file",$fileOptions['file']); - $this->checkFormData($stream,$boundary,"fileName",$fileOptions['fileName']); - $this->checkFormData($stream,$boundary,"tags","abd,def"); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - UploadTest::assertEquals($requestMethod,'POST'); - } - - /** - * - */ - public function testFileUploadCustomCoordinatesAsArray() - { - $fileOptions = [ - 'file' => 'http://lorempixel.com/640/480/', - 'fileName' => 'test_file_name', - "customCoordinates" => ["10", "10", "100", "100"], - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($fileOptions)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->uploadFile($fileOptions); - - $requestBody = $container[0]['request']->getBody(); - $requestHeaders = $container[0]['request']->getHeaders(); - $boundary = str_replace("multipart/form-data; boundary=","",$requestHeaders["Content-Type"][0]); - - UploadTest::assertArrayHasKey("Content-Type",$requestHeaders); - UploadTest::assertStringStartsWith("multipart/form-data; boundary=",$requestHeaders['Content-Type'][0]); - - $stream = Utils::streamFor($requestBody); - $stream = str_replace('\r\n',' ',json_encode($stream->getContents())); - - $this->checkFormData($stream,$boundary,"file",$fileOptions['file']); - $this->checkFormData($stream,$boundary,"fileName",$fileOptions['fileName']); - $this->checkFormData($stream,$boundary,"customCoordinates","10,10,100,100"); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - UploadTest::assertEquals($requestMethod,'POST'); - } - - - /** - * - */ - public function testFileUploadResponseFieldsAsArray() - { - $fileOptions = [ - 'file' => 'http://lorempixel.com/640/480/', - 'fileName' => 'test_file_name', - "responseFields" => ["tags", "customMetadata"], - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($fileOptions)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->uploadFile($fileOptions); - - $requestBody = $container[0]['request']->getBody(); - $requestHeaders = $container[0]['request']->getHeaders(); - $boundary = str_replace("multipart/form-data; boundary=","",$requestHeaders["Content-Type"][0]); - - UploadTest::assertArrayHasKey("Content-Type",$requestHeaders); - UploadTest::assertStringStartsWith("multipart/form-data; boundary=",$requestHeaders['Content-Type'][0]); - - $stream = Utils::streamFor($requestBody); - $stream = str_replace('\r\n',' ',json_encode($stream->getContents())); - - $this->checkFormData($stream,$boundary,"file",$fileOptions['file']); - $this->checkFormData($stream,$boundary,"fileName",$fileOptions['fileName']); - $this->checkFormData($stream,$boundary,"responseFields","tags,customMetadata"); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - UploadTest::assertEquals($requestMethod,'POST'); - } - - /** - * - */ - public function testFileUploadBareMinimumRequest() - { - $fileOptions = [ - 'file' => 'http://lorempixel.com/640/480/', - 'fileName' => 'test_file_name', - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($fileOptions)); - - $mock = new MockHandler([ - new Response(200, ['X-Foo' => 'Bar'], $mockBodyResponse) - ]); - - $handlerStack = HandlerStack::create($mock); - - $container = []; - $history = Middleware::history($container); - - $handlerStack->push($history); - - $this->createMockClient($handlerStack); - - $response = $this->mockClient->uploadFile($fileOptions); - - $requestBody = $container[0]['request']->getBody(); - $requestHeaders = $container[0]['request']->getHeaders(); - $boundary = str_replace("multipart/form-data; boundary=","",$requestHeaders["Content-Type"][0]); - - UploadTest::assertArrayHasKey("Content-Type",$requestHeaders); - UploadTest::assertStringStartsWith("multipart/form-data; boundary=",$requestHeaders['Content-Type'][0]); - - $stream = Utils::streamFor($requestBody); - $stream = str_replace('\r\n',' ',json_encode($stream->getContents())); - - $this->checkFormData($stream,$boundary,"file",$fileOptions['file']); - $this->checkFormData($stream,$boundary,"fileName",$fileOptions['fileName']); - UploadTest::assertNotContains("tags",$stream); - UploadTest::assertNotContains("isPrivateFile",$stream); - UploadTest::assertNotContains("useUniqueFileName",$stream); - UploadTest::assertNotContains("customCoordinates",$stream); - UploadTest::assertNotContains("responseFields",$stream); - - // Assert Method - $requestMethod = $container[0]['request']->getMethod(); - UploadTest::assertEquals($requestMethod,'POST'); - } - - /** - * - */ - public function testServerSideError() - { - $fileOptions = [ - 'file' => 'http://lorempixel.com/640/480/', - 'fileName' => 'test_file_name', - ]; - - $error = [ - "help" => "For support kindly contact us at support@imagekit.io .", - "message" => "Your account cannot be authenticated." - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($fileOptions)); - - $this->stubHttpClient(new Response(403, ['X-Foo' => 'Bar'], json_encode($error))); - - $response = $this->client->uploadFile($fileOptions); - - // Request Body Check - UploadTest::assertEquals(json_encode($error),json_encode($response->error)); - } - - /** - * - */ - public function testFileUploadWithInvalidTransformation() - { - $fileOptions = [ - 'file' => 'http://lorempixel.com/640/480/', - 'fileName' => 'test_file_name', - "useUniqueFileName" => true, // true|false - "responseFields" => implode(",", ["tags", "customMetadata"]), // Comma Separated, check docs for more responseFields - 'transformation' => [], - ]; - - $error = [ - "message" => "Invalid transformation parameter. Please include at least pre, post, or both.", - "help" => "For support kindly contact us at support@imagekit.io ." - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($fileOptions)); - - $this->stubHttpClient(new Response(403, ['X-Foo' => 'Bar'], json_encode($error))); - - $response = $this->client->uploadFile($fileOptions); - - // Request Body Check - UploadTest::assertEquals(json_encode($error),json_encode($response->error)); - } - - /** - * - */ - public function testFileUploadWithInvalidPreTransformation() - { - $fileOptions = [ - 'file' => 'http://lorempixel.com/640/480/', - 'fileName' => 'test_file_name', - "useUniqueFileName" => true, // true|false - "responseFields" => implode(",", ["tags", "customMetadata"]), // Comma Separated, check docs for more responseFields - 'transformation' => [ - 'pre' => '', - ], - ]; - - $error = [ - "message" => "Invalid pre transformation parameter.", - "help" => "For support kindly contact us at support@imagekit.io ." - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($fileOptions)); - - $this->stubHttpClient(new Response(403, ['X-Foo' => 'Bar'], json_encode($error))); - - $response = $this->client->uploadFile($fileOptions); - - // Request Body Check - UploadTest::assertEquals(json_encode($error),json_encode($response->error)); - } - - /** - * - */ - public function testFileUploadWithInvalidAbsTypePostTransformation() - { - $fileOptions = [ - 'file' => 'http://lorempixel.com/640/480/', - 'fileName' => 'test_file_name', - "useUniqueFileName" => true, // true|false - "responseFields" => implode(",", ["tags", "customMetadata"]), // Comma Separated, check docs for more responseFields - 'transformation' => [ - 'post' => [ - [ - 'type' => 'abs', - 'value' => '' - ] - ] - ], - ]; - - $error = [ - "message" => "Invalid post transformation parameter.", - "help" => "For support kindly contact us at support@imagekit.io ." - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($fileOptions)); - - $this->stubHttpClient(new Response(403, ['X-Foo' => 'Bar'], json_encode($error))); - - $response = $this->client->uploadFile($fileOptions); - - // Request Body Check - UploadTest::assertEquals(json_encode($error),json_encode($response->error)); - } - - /** - * - */ - public function testFileUploadWithInvalidTransformationTypePostTransformation() - { - $fileOptions = [ - 'file' => 'http://lorempixel.com/640/480/', - 'fileName' => 'test_file_name', - "useUniqueFileName" => true, // true|false - "responseFields" => implode(",", ["tags", "customMetadata"]), // Comma Separated, check docs for more responseFields - 'transformation' => [ - 'post' => [ - [ - 'type' => 'transformation', - 'value' => '' - ] - ] - ], - ]; - - $error = [ - "message" => "Invalid post transformation parameter.", - "help" => "For support kindly contact us at support@imagekit.io ." - ]; - - $mockBodyResponse = Utils::streamFor(json_encode($fileOptions)); - - $this->stubHttpClient(new Response(403, ['X-Foo' => 'Bar'], json_encode($error))); - - $response = $this->client->uploadFile($fileOptions); - - // Request Body Check - UploadTest::assertEquals(json_encode($error),json_encode($response->error)); - } - - - /** - * - */ - public function testFileUploadWithInvalidChecks() - { - $fileOptions = [ - 'file' => 'http://lorempixel.com/640/480/', - 'fileName' => 'test_file_name', - "useUniqueFileName" => true, // true|false - "responseFields" => implode(",", ["tags", "customMetadata"]), // Comma Separated, check docs for more responseFields - 'checks' => true - ]; - - $error = [ - "message" => "The value provided for the checks parameter is invalid.", - "help" => "For support kindly contact us at support@imagekit.io ." - ]; - - $this->stubHttpClient(new Response(403, ['X-Foo' => 'Bar'], json_encode($error))); - - $response = $this->client->uploadFile($fileOptions); - - // Request Body Check - UploadTest::assertEquals(json_encode($error),json_encode($response->error)); - } - - public function testFileUploadWithInvalidPublishStatus() - { - $fileOptions = [ - 'file' => 'http://lorempixel.com/640/480/', - 'fileName' => 'test_file_name', - "useUniqueFileName" => true, // true|false - "responseFields" => implode(",", ["tags", "customMetadata"]), // Comma Separated, check docs for more responseFields - 'isPublished' => '' - ]; - - $error = [ - "message" => "isPublished must be boolean.", - "help" => "For support kindly contact us at support@imagekit.io ." - ]; - - $this->stubHttpClient(new Response(403, ['X-Foo' => 'Bar'], json_encode($error))); - - $response = $this->client->uploadFile($fileOptions); - - // Request Body Check - UploadTest::assertEquals(json_encode($error),json_encode($response->error)); - } - - protected function setUp() - { - $this->client = new ImageKit( - 'testing_public_key', - 'testing_private_key', - 'https://ik.imagekit.io/demo' - ); - - } - - protected function tearDown() - { - $this->client = null; - } -} diff --git a/tests/ImageKit/Url/UrlTest.php b/tests/ImageKit/Url/UrlTest.php deleted file mode 100644 index 29f87739..00000000 --- a/tests/ImageKit/Url/UrlTest.php +++ /dev/null @@ -1,1283 +0,0 @@ -client = new ImageKit( - 'testing_public_key', - 'testing_private_key', - 'https://ik.imagekit.io/demo' - ); - } - - /** - * - */ - public function testUrlNoPathNoSrc() - { - $url = $this->client->url(); - UrlTest::assertEquals('URL Generation Method accepts an array, null passed', json_decode($url)->error->message); - } - - /** - * - */ - public function testUrlNoTransformationPath() - { - $url = $this->client->url(['path' => '/default-image.jpg']); - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/default-image.jpg', - $url - ); - } - - /** - * - */ - public function testUrlNoTransformationSrc() - { - $url = $this->client->url(['src' => 'https://ik.imagekit.io/demo/default-image.jpg']); - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/default-image.jpg', - $url - ); - } - - /** - * - */ - public function testUrlNullParametersWithPath() - { - $url = $this->client->url([ - 'path' => '/default-image.jpg', - 'transformation' => null, - 'transformationPosition' => null, - 'src' => null - ]); - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/default-image.jpg', - $url - ); - } - - /** - * - */ - public function testUrlSignedUrl() - { - $url = $this->client->url([ - 'path' => '/default-image.jpg', - 'signed' => true - ]); - UrlTest::assertContains( - 'ik-s=', - $url - ); - } - - /** - * - */ - public function testUrlSignedUrlWithEmptyExpiryString() - { - $url = $this->client->url([ - 'path' => '/default-image.jpg', - 'signed' => true, - 'expireSeconds' => '' - ]); - - UrlTest::assertContains( - 'ik-s=', - $url - ); - } - - /** - * - */ - public function testUrlSignedUrlWithInvalidExpiryString() - { - $url = $this->client->url([ - 'path' => '/default-image.jpg', - 'signed' => true, - 'expireSeconds' => 'asdad' - ]); - UrlTest::assertEquals('expireSeconds accepts an integer value, non integer value provided.',json_decode($url)->error->message); - } - - /** - * - */ - public function testUrlSignedUrlWithoutExpiry() - { - $url = $this->client->url([ - 'path' => '/default-image.jpg', - 'signed' => true - ]); - UrlTest::assertContains( - '?ik-s=', - $url - ); - } - - /** - * - */ - public function testUrlSignedUrlWithExpiryWithTransformation() - { - $url = $this->client->url([ - 'path' => '/default-image.jpg', - "transformation" => [ - [ - "height" => "300", - ] - ], - 'signed' => true, - 'expireSeconds' => 300 - ]); - UrlTest::assertContains( - '?ik-t=', - $url - ); - UrlTest::assertContains( - '&ik-s=', - $url - ); - } - - /** - * - */ - public function testUrlSignedUrlWithExpiryWithQueryParameters() - { - $url = $this->client->url([ - 'path' => '/default-image.jpg', - "queryParameters" => - [ - "key" => "value" - ], - 'signed' => true, - 'expireSeconds' => 300 - ]); - UrlTest::assertContains( - '&ik-t=', - $url - ); - UrlTest::assertContains( - '&ik-s=', - $url - ); - } - - /** - * - */ - public function testUrlSignedUrlWithExpiryWithTransformationWithQueryParameters() - { - $url = $this->client->url([ - 'path' => '/default-image.jpg', - "queryParameters" => - [ - "key" => "value" - ], - "transformation" => [ - [ - "height" => "300", - ] - ], - 'signed' => true, - 'expireSeconds' => 300 - ]); - UrlTest::assertContains( - '&ik-t=', - $url - ); - UrlTest::assertContains( - '&ik-s=', - $url - ); - } - - /** - * - */ - public function testUrlSignedUrlWithoutExpiryWithTransformationWithQueryParameters() - { - $url = $this->client->url([ - 'path' => '/default-image.jpg', - "queryParameters" => - [ - "key" => "value" - ], - "transformation" => [ - [ - "height" => "300", - ] - ], - 'signed' => true - ]); - UrlTest::assertNotContains( - '&ik-t=', - $url - ); - UrlTest::assertContains( - '&ik-s=', - $url - ); - } - - /** - * - */ - public function testUrlSignedUrlWithExpiry() - { - $url = $this->client->url([ - 'path' => '/default-image.jpg', - 'signed' => true, - 'expireSeconds' => 100 - ]); - UrlTest::assertStringStartsWith( - 'https://ik.imagekit.io/demo/default-image.jpg', - $url - ); - UrlTest::assertContains( - 'ik-s=', - $url - ); - UrlTest::assertContains( - 'ik-t=', - $url - ); - } - - /** - * - */ - public function testUrlSignedWithDiacriticInFilename() - { - $url = 'https://ik.imagekit.io/demo/test_é_path_alt.jpg'; - $urlInstance = new Url(); - $encodedUrl = $urlInstance->encodeStringIfRequired($url); - UrlTest::assertEquals('https://ik.imagekit.io/demo/test_%C3%A9_path_alt.jpg', $encodedUrl); - - $opts = [ - 'privateKey' => 'testing_private_key', - 'url' => $url, - 'urlEndpoint' => 'https://ik.imagekit.io/demo', - 'expiryTimestamp' => '9999999999' - ]; - $signature = $urlInstance->getSignature($opts); - $url = $this->client->url([ - 'path' => '/test_é_path_alt.jpg', - 'signed' => true, - 'expireSeconds' => '' - ]); - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/test_é_path_alt.jpg?ik-s='. $signature, - $url - ); - } - - /** - * - */ - public function testUrlSignedWithDiacriticInFilenameAndPath() - { - $url = 'https://ik.imagekit.io/demo/aéb/test_é_path_alt.jpg'; - $urlInstance = new Url(); - $encodedUrl = $urlInstance->encodeStringIfRequired($url); - UrlTest::assertEquals('https://ik.imagekit.io/demo/a%C3%A9b/test_%C3%A9_path_alt.jpg', $encodedUrl); - - $opts = [ - 'privateKey' => 'testing_private_key', - 'url' => $url, - 'urlEndpoint' => 'https://ik.imagekit.io/demo', - 'expiryTimestamp' => '9999999999' - ]; - $signature = $urlInstance->getSignature($opts); - $url = $this->client->url([ - 'path' => '/aéb/test_é_path_alt.jpg', - 'signed' => true, - 'expireSeconds' => '' - ]); - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/aéb/test_é_path_alt.jpg?ik-s='. $signature, - $url - ); - } - - /** - * - */ - public function testUrlSignedWithDiacriticInFilenamePathTransforamtionInPath() - { - $url = 'https://ik.imagekit.io/demo/tr:l-text,i-Imagekité,fs-50,l-end/aéb/test_é_path_alt.jpg'; - $urlInstance = new Url(); - $encodedUrl = $urlInstance->encodeStringIfRequired($url); - UrlTest::assertEquals('https://ik.imagekit.io/demo/tr:l-text,i-Imagekit%C3%A9,fs-50,l-end/a%C3%A9b/test_%C3%A9_path_alt.jpg', $encodedUrl); - - $opts = [ - 'privateKey' => 'testing_private_key', - 'url' => $url, - 'urlEndpoint' => 'https://ik.imagekit.io/demo', - 'expiryTimestamp' => '9999999999' - ]; - $signature = $urlInstance->getSignature($opts); - $url = $this->client->url([ - 'path' => '/aéb/test_é_path_alt.jpg', - 'signed' => true, - "transformation" => [ - [ - "raw" => "l-text,i-Imagekité,fs-50,l-end" - ] - ], - "transformationPosition" => "path", - 'expireSeconds' => '' - ]); - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/tr:l-text,i-Imagekité,fs-50,l-end/aéb/test_é_path_alt.jpg?ik-s='. $signature, - $url - ); - } - - /** - * - */ - public function testUrlSignedWithDiacriticInFilenamePathTransforamtionInQuery() - { - $url = 'https://ik.imagekit.io/demo/aéb/test_é_path_alt.jpg?tr=l-text,i-Imagekité,fs-50,l-end'; - $urlInstance = new Url(); - $encodedUrl = $urlInstance->encodeStringIfRequired($url); - UrlTest::assertEquals('https://ik.imagekit.io/demo/a%C3%A9b/test_%C3%A9_path_alt.jpg?tr=l-text,i-Imagekit%C3%A9,fs-50,l-end', $encodedUrl); - - $opts = [ - 'privateKey' => 'testing_private_key', - 'url' => $url, - 'urlEndpoint' => 'https://ik.imagekit.io/demo', - 'expiryTimestamp' => '9999999999' - ]; - $signature = $urlInstance->getSignature($opts); - $url = $this->client->url([ - 'path' => '/aéb/test_é_path_alt.jpg', - 'signed' => true, - "transformation" => [ - [ - "raw" => "l-text,i-Imagekité,fs-50,l-end" - ] - ], - "transformationPosition" => "query", - 'expireSeconds' => '' - ]); - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/aéb/test_é_path_alt.jpg?tr=l-text,i-Imagekité,fs-50,l-end&ik-s='. $signature, - $url - ); - } - - /** - * - */ - public function testUrlURLWithPath() - { - $url = $this->client->url([ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'height' => 300, - 'width' => 400 - ] - ] - ]); - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/tr:h-300,w-400/default-image.jpg', - $url - ); - } - - /** - * - */ - public function testUrlURLWithPathNoLeadingSlash() - { - $url = $this->client->url([ - 'path' => 'default-image.jpg', - 'transformation' => [ - [ - 'height' => 300, - 'width' => 400 - ] - ] - ]); - - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/tr:h-300,w-400/default-image.jpg', - $url - ); - } - - - /** - * - */ - public function testUrlURLWithPathMultipleLeadingSlash() - { - $url = $this->client->url([ - 'path' => '////default-image.jpg', - 'transformation' => [ - [ - 'height' => 300, - 'width' => 400 - ] - ] - ]); - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/tr:h-300,w-400/default-image.jpg', - $url - ); - } - - /** - * - */ - public function testUrlURLOverrideUrlEndpoint() - { - $url = $this->client->url([ - 'urlEndpoint' => 'https://ik.imagekit.io/test/', - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'height' => 300, - 'width' => 400 - ] - ] - ]); - UrlTest::assertEquals( - 'https://ik.imagekit.io/test/tr:h-300,w-400/default-image.jpg', - $url - ); - } - - /** - * - */ - public function testUrlPathTransformationQuery() - { - $url = $this->client->url([ - 'path' => '/default-image.jpg', - 'transformationPosition' => 'query', - 'transformation' => [ - [ - 'height' => 300, - 'width' => 400 - ] - ] - ]); - - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/default-image.jpg?tr=h-300,w-400', - $url - ); - } - - /** - * - */ - public function testUrlSrcTransformation() - { - $url = $this->client->url([ - 'src' => 'https://ik.imagekit.io/demo/default-image.jpg', - 'transformation' => [ - [ - 'height' => 300, - 'width' => 400 - ] - ] - ]); - - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/tr:h-300,w-400/default-image.jpg', - $url - ); - } - - /** - * - */ - public function testUrlSrcTransformationQuery() - { - $url = $this->client->url([ - 'src' => 'https://ik.imagekit.io/demo/default-image.jpg', - 'transformationPosition' => 'query', - 'transformation' => [ - [ - 'height' => 300, - 'width' => 400 - ] - ] - ]); - - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/default-image.jpg?tr=h-300,w-400', - $url - ); - } - - /** - * - */ - public function testUrlSrcMergeQueryParams() - { - $url = $this->client->url([ - 'src' => 'https://ik.imagekit.io/demo/default-image.jpg?t1=v1&t3=v3', - 'queryParameters' => ['t2' => 'v2'], - 'transformationPosition' => 'query', - 'transformation' => [ - [ - 'height' => 300, - 'width' => 400 - ] - ] - ]); - - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/default-image.jpg?tr=h-300,w-400&t1=v1&t2=v2&t3=v3', - $url - ); - } - - /** - * - */ - public function testUrlPathMergeQueryParams() - { - $url = $this->client->url([ - 'path' => '/default-image.jpg', - 'queryParameters' => ['t1' => 'v1', 't2' => 'v2', 't3' => 'v3'], - 'transformationPosition' => 'query', - 'transformation' => [ - [ - 'height' => 300, - 'width' => 400 - ] - ] - ]); - - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/default-image.jpg?tr=h-300,w-400&t1=v1&t2=v2&t3=v3', - $url - ); - } - - /** - * - */ - public function testUrlChainedTransformation() - { - $url = $this->client->url([ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'height' => 300, - 'width' => 400 - ], [ - 'rotate' => 90 - ] - ] - ]); - - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/tr:h-300,w-400:rt-90/default-image.jpg', - $url - ); - } - - /** - * - */ - public function testUrlUndocumentedTransformation() - { - $url = $this->client->url([ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'undocumented' => 'param' - ] - ] - ]); - - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/tr:undocumented-param/default-image.jpg', - $url - ); - } - - /** - * - */ - public function testUrlChainedTransformationUndocumentedTransformation() - { - $url = $this->client->url([ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'height' => 300, - 'width' => 400 - ], [ - 'undocumented' => 'param' - ] - ] - ]); - - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/tr:h-300,w-400:undocumented-param/default-image.jpg', - $url - ); - } - - /** - * - */ - public function testUrlOverLayImage() - { - $url = $this->client->url([ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'height' => 300, - 'width' => 400, - 'raw' => "l-image,i-default-image.jpg,w-100,b-10_CDDC39,l-end" - ] - ] - ]); - - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/tr:h-300,w-400,l-image,i-default-image.jpg,w-100,b-10_CDDC39,l-end/default-image.jpg', - $url - ); - } - - /** - * - */ - public function testUrlOverLayImageWithPath() - { - $url = $this->client->url([ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'height' => 300, - 'width' => 400, - 'raw' => "l-image,i-/path/to/overlay.jpg,w-100,b-10_CDDC39,l-end" - ] - ] - ]); - - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/tr:h-300,w-400,l-image,i-/path/to/overlay.jpg,w-100,b-10_CDDC39,l-end/default-image.jpg', - $url - ); - } - - /** - * - */ - public function testUrlBorder() - { - $url = $this->client->url([ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'height' => 300, - 'width' => 400, - 'border' => '20_FF0000' - ] - ] - ]); - - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/tr:h-300,w-400,b-20_FF0000/default-image.jpg', - $url - ); - } - - /** - * - */ - public function testUrlESharpen() - { - $url = $this->client->url([ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'height' => 300, - 'width' => 400, - 'e-sharpen' => '-', - ] - ] - ]); - - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/tr:h-300,w-400,e-sharpen/default-image.jpg', - $url - ); - } - - /** - * - */ - public function testUrlRaw() - { - $url = $this->client->url([ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'raw' => 'h-300,w-400' - ] - ] - ]); - - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/tr:h-300,w-400/default-image.jpg', - $url - ); - } - - - /** - * - */ - public function testUrlAllCombined() - { - $url = $this->client->url([ - 'path' => '/default-image.jpg', - 'transformation' => [ - [ - 'height' => 300, - 'width' => 400, - 'aspectRatio' => '4-3', - 'quality' => 40, - 'crop' => 'force', - 'cropMode' => 'extract', - 'focus' => 'left', - 'format' => 'jpeg', - 'radius' => 50, - 'bg' => 'A94D34', - 'border' => '5-A94D34', - 'rotation' => 90, - 'blur' => 10, - 'named' => 'some_name', - 'progressive' => true, - 'lossless' => true, - 'trim' => 5, - 'metadata' => true, - 'colorProfile' => true, - 'defaultImage' => 'folder/file.jpg/', //trailing slash case - 'dpr' => 3, - 'effectSharpen' => 10, - 'effectUSM' => '2-2-0.8-0.024', - 'effectContrast' => true, - 'effectGray' => true, - 'effectShadow' => 'bl-15_st-40_x-10_y-N5', - 'effectGradient' => 'from-red_to-white', - 'original' => true, - 'raw' => 'h-500,w-450' - ] - ] - ]); - - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/tr:h-300,w-400,ar-4-3,q-40,c-force,cm-extract,fo-left,f-jpeg,r-50,bg-A94D34,b-5-A94D34,rt-90,bl-10,n-some_name,pr-true,lo-true,t-5,md-true,cp-true,di-folder@@file.jpg,dpr-3,e-sharpen-10,e-usm-2-2-0.8-0.024,e-contrast-true,e-grayscale-true,e-shadow-bl-15_st-40_x-10_y-N5,e-gradient-from-red_to-white,orig-true,h-500,w-450/default-image.jpg', - $url - ); - } - - /** - * - */ - public function testUrlGenerationIfTransformationPositionIsPath() - { - $url = $this->client->url([ - 'urlEndpoint' => 'https://ik.imagekit.io/demo/pattern', - 'path' => 'path/to/my/image.jpg', - 'transformation' => [['width' => '200', 'height' => '300'], ['rotation' => '90']], - 'queryParameters' => ['v' => '123123'] - ]); - - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/pattern/tr:w-200,h-300:rt-90/path/to/my/image.jpg?v=123123', - $url - ); - } - - /** - * - */ - public function testUrlGenerationCustomDomain() - { - $url = $this->client->url([ - 'urlEndpoint' => 'https://images.example.com', - 'path' => 'path/to/my/image.jpg', - 'transformation' => [['width' => '200', 'height' => '300'], ['rotation' => '90']], - 'queryParameters' => ['v' => '123123'] - ]); - - UrlTest::assertEquals( - 'https://images.example.com/tr:w-200,h-300:rt-90/path/to/my/image.jpg?v=123123', - $url - ); - } - - /** - * - */ - public function testUrlGenerationIfTransformationPositionIsQuery() - { - $url = $this->client->url([ - 'urlEndpoint' => 'https://ik.imagekit.io/demo/pattern', - 'path' => 'path/to/my/image.jpg', - 'transformation' => [['width' => '200', 'height' => '300']], - 'queryParameters' => ['v' => '123123'], - 'transformationPosition' => 'query', - ]); - - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/pattern/path/to/my/image.jpg?tr=w-200,h-300&v=123123', - $url - ); - } - - /** - * - */ - public function testUrlGenerationIfPathAndSrcEmpty() - { - $url = $this->client->url([ - 'urlEndpoint' => 'https://ik.imagekit.io/demo/pattern', - 'path' => '', - 'src' => '', - 'transformationPosition' => 'path', - 'transformation' => [['width' => '200', 'height' => '300']], - 'queryParameters' => ['v' => '123123'], - 'signed' => true, - 'expireSeconds' => 300, - ]); - - UrlTest::assertEquals('src is not a valid URL', json_decode($url)->error->message); - - } - - /** - * - */ - public function testUrlGenerationIfUrlEmptyEmpty() - { - $url = $this->client->url([ - 'urlEndpoint' => '', - 'transformationPosition' => 'path', - 'transformation' => [['width' => '200', 'height' => '300']], - 'queryParameters' => ['v' => '123123'], - 'signed' => true, - 'expireSeconds' => 300, - ]); - - UrlTest::assertEquals('Invalid urlEndpoint value', json_decode($url)->error->message); - - } - - /** - * - */ - public function testUrlGenerationUsingFullImageUrlWhenPassedSrc() - { - $url = $this->client->url([ - 'transformation' => [['width' => '200', 'height' => '300'], ['rotation' => '90']], - 'src' => 'https://ik.imagekit.io/your_imagekit_id/endpoint/default-image.jpg', - 'queryParameters' => ['v' => '123123'], - 'expireSeconds' => 300, - ]); - UrlTest::assertEquals( - 'https://ik.imagekit.io/your_imagekit_id/endpoint/tr:w-200,h-300:rt-90/default-image.jpg?v=123123', - $url - ); - } - - /** - * - */ - public function testUrlGenerationUsingFullImageUrlWhenPassedSrcWithQueryParameters() - { - - $url = $this->client->url([ - 'transformation' => [['width' => '200', 'height' => '300'], ['rotation' => '90']], - 'src' => 'https://ik.imagekit.io/your_imagekit_id/endpoint/default-image.jpg', - 'queryParameters' => ['test' => 'params', 'test2' => 'param2'], - 'expireSeconds' => 300, - ]); - - // UrlTest::assertNotRegExp('/??/', $url); - // UrlTest::assertNotRegExp('/&&/', $url); - UrlTest::assertEquals( - 'https://ik.imagekit.io/your_imagekit_id/endpoint/tr:w-200,h-300:rt-90/default-image.jpg?test=params&test2=param2', - $url - ); - } - - /** - * - */ - public function testUrlGenerationUsingFullImageUrlWhenPassedSrcWithQueryParametersAndTransforamtionPositionIsPath() - { - $url = $this->client->url([ - 'src' => 'https://ik.imagekit.io/your_imagekit_id/endpoint/default-image.jpg', - 'transformationPosition' => 'path', - 'expireSeconds' => 300, - ]); - - UrlTest::assertEquals( - 'https://ik.imagekit.io/your_imagekit_id/endpoint/default-image.jpg', - $url - ); - } - - /** - * - */ - public function testSignedUrlGeneration() - { - $url = $this->client->url([ - 'urlEndpoint' => 'https://ik.imagekit.io/demo/pattern', - 'path' => 'path/to/my/image.jpg', - 'transformation' => [['width' => '200', 'height' => '300'], ['rotation' => '90']], - 'transformationPosition' => 'path', - 'queryParameters' => ['v' => '123123'], - 'signed' => true, - 'expireSeconds' => 300, - ]); - - $url_components = parse_url($url); - parse_str($url_components['query'], $params); - - UrlTest::assertNotEmpty($params['ik-s']); - UrlTest::assertNotEmpty($params['ik-t']); - } - - /** - * - */ - public function testUrlGenerationIfInitializationUrlEndpointIsOverriddenByNewUrlEndpoint() - { - - $url = $this->client->url([ - 'urlEndpoint' => 'https://ik.imagekit.io/demo/pattern', - 'path' => 'path/to/my/image.jpg', - 'transformation' => [['width' => '200', 'height' => '300'], ['rotation' => '90']], - 'transformationPosition' => 'path', - 'queryParameters' => ['v' => '123123'], - 'expireSeconds' => 300, - ]); - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/pattern/tr:w-200,h-300:rt-90/path/to/my/image.jpg?v=123123', - $url - ); - } - - /** - * - */ - public function testUrlGenerationIfPresenceOfTrailingSlashInUrlEndpointWillGenerateValidUrl() - { - $url = $this->client->url([ - 'urlEndpoint' => 'https://ik.imagekit.io/demo/pattern/', - 'path' => 'path/to/my/image.jpg', - 'transformation' => [['width' => '200', 'height' => '300'], ['rotation' => '90']], - 'transformationPosition' => 'path', - 'queryParameters' => ['v' => '123123'], - 'expireSeconds' => 300, - ]); - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/pattern/tr:w-200,h-300:rt-90/path/to/my/image.jpg?v=123123', - $url - ); - } - - /** - * - */ - public function testUrlGenerationIfPresenceOfLeadingSlashInPathWillGenerateValidUrl() - { - $url = $this->client->url([ - 'urlEndpoint' => 'https://ik.imagekit.io/demo/pattern', - 'path' => '/path/to/my/image.jpg', - 'transformation' => [['width' => '200', 'height' => '300'], ['rotation' => '90']], - 'transformationPosition' => 'path', - 'queryParameters' => ['v' => '123123'], - 'expireSeconds' => 300, - ]); - - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/pattern/tr:w-200,h-300:rt-90/path/to/my/image.jpg?v=123123', - $url - ); - } - - /** - * - */ - public function testUrlGenerationIfNewTransformationParameterIsPassedWillBePresentInGeneratedUrl() - { - $url = $this->client->url([ - 'urlEndpoint' => 'https://ik.imagekit.io/demo/pattern', - 'path' => 'path/to/my/image.jpg', - 'transformation' => [['width' => '200', 'height' => '300'], ['rotation' => '90'], ['test' => 'param']], - 'transformationPosition' => 'path', - 'queryParameters' => ['v' => '123123'], - 'expireSeconds' => 300, - ]); - - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/pattern/tr:w-200,h-300:rt-90:test-param/path/to/my/image.jpg?v=123123', - $url - ); - } - - // /** - // * - // */ - // public function testUrlGenerationIfGeneratedUrlContainsSDKVersion() - // { - // $url = $this->client->url([ - // 'urlEndpoint' => 'https://ik.imagekit.io/demo/pattern', - // 'transformation' => [['width' => '200', 'height' => '300']], - // 'path' => 'path/to/my/image.jpg', - // 'transformationPosition' => 'query', - // 'queryParameters' => ['v' => '123123'], - // 'expireSeconds' => 300, - // ]); - - // $url_components = parse_url($url); - // parse_str($url_components['query'], $params); - - // UrlTest::assertNotEmpty($params['ik-sdk-version']); - // UrlTest::assertEquals('php-', $params['ik-sdk-version']); - // } - - /** - * - */ - public function testUrlGenerationIfTransformationPositionIsQueryAndTransformationArePresentInUrlAsQueryParams() - { - $url = $this->client->url([ - 'urlEndpoint' => 'https://ik.imagekit.io/demo/pattern', - 'transformation' => [['width' => '200', 'height' => '300']], - 'path' => 'path/to/my/image.jpg', - 'transformationPosition' => 'query', - 'queryParameters' => ['v' => '123123'], - 'expireSeconds' => 300, - ]); - - $url_components = parse_url($url); - parse_str($url_components['query'], $params); - - UrlTest::assertNotEmpty($params['tr']); - UrlTest::assertEquals('w-200,h-300', $params['tr']); - } - - /** - * - */ - public function testUrlGenerationWithChainedTransformationIfTransformationPositionIsPath() - { - $url = $this->client->url([ - 'urlEndpoint' => 'https://ik.imagekit.io/demo/pattern', - 'path' => 'path/to/my/image.jpg', - 'transformation' => [['width' => '200', 'height' => '300'], ['rotation' => '90']], - 'transformationPosition' => 'path', - 'queryParameters' => ['v' => '123123'], - 'expireSeconds' => 300, - ]); - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/pattern/tr:w-200,h-300:rt-90/path/to/my/image.jpg?v=123123', - $url - ); - } - - /** - * - */ - public function testUrlGenerationWithChainedTransformationIfTransformationPositionIsQuery() - { - $url = $this->client->url([ - 'urlEndpoint' => 'https://ik.imagekit.io/demo/pattern', - 'path' => 'path/to/my/image.jpg', - 'transformation' => [['width' => '200', 'height' => '300'], ['rotation' => '90']], - 'transformationPosition' => 'query', - 'queryParameters' => ['v' => '123123'], - 'expireSeconds' => 300, - ]); - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/pattern/path/to/my/image.jpg?tr=w-200,h-300:rt-90&v=123123', - $url - ); - } - - /** - * - */ - public function testUrlGenerationWithQueryParametersIfTransformationPositionIsPath() - { - $url = $this->client->url([ - 'urlEndpoint' => 'https://ik.imagekit.io/demo/pattern', - 'path' => 'path/to/my/image.jpg', - 'transformation' => [['width' => '200', 'height' => '300'], ['rotation' => '90']], - 'transformationPosition' => 'path', - 'queryParameters' => ['test' => 'param'], - 'expireSeconds' => 300, - ]); - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/pattern/tr:w-200,h-300:rt-90/path/to/my/image.jpg?test=param', - $url - ); - } - - /** - * - */ - public function testUrlGenerationWithQueryParametersIfTransformationPositionIsQuery() - { - $url = $this->client->url([ - 'urlEndpoint' => 'https://ik.imagekit.io/demo/pattern', - 'path' => 'path/to/my/image.jpg', - 'transformation' => [['width' => '200', 'height' => '300'], ['rotation' => '90']], - 'transformationPosition' => 'query', - 'queryParameters' => ['test' => 'param'], - 'expireSeconds' => 300, - ]); - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/pattern/path/to/my/image.jpg?tr=w-200,h-300:rt-90&test=param', - $url - ); - } - - // /** - // * - // */ - // public function testUrlGenerationWithDefaultExpiredSeconds() - // { - // $url = $this->client->url([ - // 'path' => '/test-signed-url.png', - // 'transformation' => [['width' => '100']], - // 'signed' => true, - // ]); - - // $url_components = parse_url($url); - // parse_str($url_components['query'], $params); - - // UrlTest::assertStringNotContainsString('?&', $url); - // UrlTest::assertNotEmpty($params['ik-s']); - // } - - /** - * - */ - public function testUrlGenerationWithCustomExpiredSeconds() - { - $url = $this->client->url([ - 'path' => '/test-signed-url.png', - 'transformation' => [['width' => '100']], - 'signed' => true, - 'expireSeconds' => 300 - ]); - - $url_components = parse_url($url); - parse_str($url_components['query'], $params); - - // UrlTest::assertNotRegExp('/?&/', $url); - UrlTest::assertNotEmpty($params['ik-t']); - } - - /** - * - */ - public function testTransformationWithoutValueShouldNotHaveHypen() - { - $url = $this->client->url([ - 'urlEndpoint' => 'https://ik.imagekit.io/demo/pattern', - 'path' => 'path/to/my/image.jpg', - 'transformation' => [['orig' => '']], - ]); - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/pattern/tr:orig/path/to/my/image.jpg', - $url - ); - } - - /** - * - */ - public function testTransformationValueShouldBeConvertedToString() - { - $url = $this->client->url([ - 'urlEndpoint' => 'https://ik.imagekit.io/demo/pattern', - 'path' => 'path/to/my/image.jpg', - 'transformation' => [['rt' => 90, 'orig' => true]], - ]); - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/pattern/tr:rt-90,orig-true/path/to/my/image.jpg', - $url - ); - } - - /** - * - */ - public function testTransformationNonMappedSupportedTransform() - { - $url = $this->client->url([ - 'urlEndpoint' => 'https://ik.imagekit.io/demo/pattern', - 'path' => 'path/to/my/image.jpg', - 'transformation' => [['not_mapped' => 'value', '' => '']], - ]); - - UrlTest::assertEquals( - 'https://ik.imagekit.io/demo/pattern/tr:not_mapped-value/path/to/my/image.jpg', - $url - ); - } - - /** - * - */ - public function testUnitTestGeneratedSignature() - { - $opts = [ - 'privateKey' => 'private_key_test', - 'url' => 'https://test-domain.com/test-endpoint/tr:w-100/test-signed-url.png', - 'urlEndpoint' => 'https://test-domain.com/test-endpoint', - 'expiryTimestamp' => '9999999999' - ]; - - $urlInstance = new Url(); - $signature = $urlInstance->getSignature($opts); - - UrlTest::assertEquals('41b3075c40bc84147eb71b8b49ae7fbf349d0f00', $signature); - } - -} diff --git a/tests/Services/Accounts/OriginsTest.php b/tests/Services/Accounts/OriginsTest.php new file mode 100644 index 00000000..eac91e2e --- /dev/null +++ b/tests/Services/Accounts/OriginsTest.php @@ -0,0 +1,153 @@ +client = $client; + } + + #[Test] + public function testCreate(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->accounts->origins->create( + S3::with( + accessKey: 'AKIATEST123', + bucket: 'test-bucket', + name: 'My S3 Origin', + secretKey: 'secrettest123', + ), + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testCreateWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->accounts->origins->create( + S3::with( + accessKey: 'AKIATEST123', + bucket: 'test-bucket', + name: 'My S3 Origin', + secretKey: 'secrettest123', + ) + ->withBaseURLForCanonicalHeader('https://cdn.example.com') + ->withIncludeCanonicalHeader(false) + ->withPrefix('images'), + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testUpdate(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->accounts->origins->update( + 'id', + S3::with( + accessKey: 'AKIATEST123', + bucket: 'test-bucket', + name: 'My S3 Origin', + secretKey: 'secrettest123', + ), + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testUpdateWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->accounts->origins->update( + 'id', + S3::with( + accessKey: 'AKIATEST123', + bucket: 'test-bucket', + name: 'My S3 Origin', + secretKey: 'secrettest123', + ) + ->withBaseURLForCanonicalHeader('https://cdn.example.com') + ->withIncludeCanonicalHeader(false) + ->withPrefix('images'), + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testList(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->accounts->origins->list(); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testDelete(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->accounts->origins->delete('id'); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testGet(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->accounts->origins->get('id'); + + $this->assertTrue(true); // @phpstan-ignore-line + } +} diff --git a/tests/Services/Accounts/URLEndpointsTest.php b/tests/Services/Accounts/URLEndpointsTest.php new file mode 100644 index 00000000..7c0bf515 --- /dev/null +++ b/tests/Services/Accounts/URLEndpointsTest.php @@ -0,0 +1,126 @@ +client = $client; + } + + #[Test] + public function testCreate(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->accounts->urlEndpoints->create( + description: 'My custom URL endpoint' + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testCreateWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->accounts->urlEndpoints->create( + description: 'My custom URL endpoint' + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testUpdate(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->accounts->urlEndpoints->update( + 'id', + description: 'My custom URL endpoint' + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testUpdateWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->accounts->urlEndpoints->update( + 'id', + description: 'My custom URL endpoint' + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testList(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->accounts->urlEndpoints->list(); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testDelete(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->accounts->urlEndpoints->delete('id'); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testGet(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->accounts->urlEndpoints->get('id'); + + $this->assertTrue(true); // @phpstan-ignore-line + } +} diff --git a/tests/Services/Accounts/UsageTest.php b/tests/Services/Accounts/UsageTest.php new file mode 100644 index 00000000..714169a6 --- /dev/null +++ b/tests/Services/Accounts/UsageTest.php @@ -0,0 +1,62 @@ +client = $client; + } + + #[Test] + public function testGet(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->accounts->usage->get( + endDate: new \DateTimeImmutable('2019-12-27'), + startDate: new \DateTimeImmutable('2019-12-27'), + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testGetWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->accounts->usage->get( + endDate: new \DateTimeImmutable('2019-12-27'), + startDate: new \DateTimeImmutable('2019-12-27'), + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } +} diff --git a/tests/Services/AssetsTest.php b/tests/Services/AssetsTest.php new file mode 100644 index 00000000..0b3ed342 --- /dev/null +++ b/tests/Services/AssetsTest.php @@ -0,0 +1,44 @@ +client = $client; + } + + #[Test] + public function testList(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->assets->list(); + + $this->assertTrue(true); // @phpstan-ignore-line + } +} diff --git a/tests/Services/Beta/V2/FilesTest.php b/tests/Services/Beta/V2/FilesTest.php new file mode 100644 index 00000000..ced4540e --- /dev/null +++ b/tests/Services/Beta/V2/FilesTest.php @@ -0,0 +1,62 @@ +client = $client; + } + + #[Test] + public function testUpload(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->beta->v2->files->upload( + file: 'file', + fileName: 'fileName' + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testUploadWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->beta->v2->files->upload( + file: 'file', + fileName: 'fileName' + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } +} diff --git a/tests/Services/Cache/InvalidationTest.php b/tests/Services/Cache/InvalidationTest.php new file mode 100644 index 00000000..276c6107 --- /dev/null +++ b/tests/Services/Cache/InvalidationTest.php @@ -0,0 +1,72 @@ +client = $client; + } + + #[Test] + public function testCreate(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->cache->invalidation->create( + 'https://ik.imagekit.io/your_imagekit_id/default-image.jpg' + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testCreateWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->cache->invalidation->create( + 'https://ik.imagekit.io/your_imagekit_id/default-image.jpg' + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testGet(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->cache->invalidation->get('requestId'); + + $this->assertTrue(true); // @phpstan-ignore-line + } +} diff --git a/tests/Services/CustomMetadataFieldsTest.php b/tests/Services/CustomMetadataFieldsTest.php new file mode 100644 index 00000000..92459823 --- /dev/null +++ b/tests/Services/CustomMetadataFieldsTest.php @@ -0,0 +1,108 @@ +client = $client; + } + + #[Test] + public function testCreate(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->customMetadataFields->create( + label: 'price', + name: 'price', + schema: Schema::with(type: 'Number') + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testCreateWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->customMetadataFields->create( + label: 'price', + name: 'price', + schema: Schema::with(type: 'Number') + ->withDefaultValue('string') + ->withIsValueRequired(true) + ->withMaxLength(0) + ->withMaxValue(3000) + ->withMinLength(0) + ->withMinValue(1000) + ->withSelectOptions(['small', 'medium', 'large', 30, 40, true]), + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testUpdate(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->customMetadataFields->update('id'); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testList(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->customMetadataFields->list(); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testDelete(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->customMetadataFields->delete('id'); + + $this->assertTrue(true); // @phpstan-ignore-line + } +} diff --git a/tests/Services/Files/BulkTest.php b/tests/Services/Files/BulkTest.php new file mode 100644 index 00000000..dc17a9c6 --- /dev/null +++ b/tests/Services/Files/BulkTest.php @@ -0,0 +1,150 @@ +client = $client; + } + + #[Test] + public function testDelete(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->bulk->delete( + ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'] + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testDeleteWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->bulk->delete( + ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'] + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testAddTags(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->bulk->addTags( + fileIDs: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + tags: ['t-shirt', 'round-neck', 'sale2019'], + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testAddTagsWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->bulk->addTags( + fileIDs: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + tags: ['t-shirt', 'round-neck', 'sale2019'], + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testRemoveAITags(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->bulk->removeAITags( + aiTags: ['t-shirt', 'round-neck', 'sale2019'], + fileIDs: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testRemoveAITagsWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->bulk->removeAITags( + aiTags: ['t-shirt', 'round-neck', 'sale2019'], + fileIDs: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testRemoveTags(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->bulk->removeTags( + fileIDs: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + tags: ['t-shirt', 'round-neck', 'sale2019'], + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testRemoveTagsWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->bulk->removeTags( + fileIDs: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + tags: ['t-shirt', 'round-neck', 'sale2019'], + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } +} diff --git a/tests/Services/Files/MetadataTest.php b/tests/Services/Files/MetadataTest.php new file mode 100644 index 00000000..c0cd9366 --- /dev/null +++ b/tests/Services/Files/MetadataTest.php @@ -0,0 +1,68 @@ +client = $client; + } + + #[Test] + public function testGet(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->metadata->get('fileId'); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testGetFromURL(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->metadata->getFromURL('https://example.com'); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testGetFromURLWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->metadata->getFromURL('https://example.com'); + + $this->assertTrue(true); // @phpstan-ignore-line + } +} diff --git a/tests/Services/Files/VersionsTest.php b/tests/Services/Files/VersionsTest.php new file mode 100644 index 00000000..c88bff80 --- /dev/null +++ b/tests/Services/Files/VersionsTest.php @@ -0,0 +1,116 @@ +client = $client; + } + + #[Test] + public function testList(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->versions->list('fileId'); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testDelete(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->versions->delete('versionId', 'fileId'); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testDeleteWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->versions->delete('versionId', 'fileId'); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testGet(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->versions->get('versionId', 'fileId'); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testGetWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->versions->get('versionId', 'fileId'); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testRestore(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->versions->restore('versionId', 'fileId'); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testRestoreWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->versions->restore('versionId', 'fileId'); + + $this->assertTrue(true); // @phpstan-ignore-line + } +} diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php new file mode 100644 index 00000000..457d84a4 --- /dev/null +++ b/tests/Services/FilesTest.php @@ -0,0 +1,182 @@ +client = $client; + } + + #[Test] + public function testUpdate(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->update('fileId'); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testDelete(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->delete('fileId'); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testCopy(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->copy( + destinationPath: '/folder/to/copy/into/', + sourceFilePath: '/path/to/file.jpg', + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testCopyWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->copy( + destinationPath: '/folder/to/copy/into/', + sourceFilePath: '/path/to/file.jpg', + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testGet(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->get('fileId'); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testMove(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->move( + destinationPath: '/folder/to/move/into/', + sourceFilePath: '/path/to/file.jpg', + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testMoveWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->move( + destinationPath: '/folder/to/move/into/', + sourceFilePath: '/path/to/file.jpg', + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testRename(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->rename( + filePath: '/path/to/file.jpg', + newFileName: 'newFileName.jpg' + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testRenameWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->rename( + filePath: '/path/to/file.jpg', + newFileName: 'newFileName.jpg' + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testUpload(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->upload(file: 'file', fileName: 'fileName'); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testUploadWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->upload(file: 'file', fileName: 'fileName'); + + $this->assertTrue(true); // @phpstan-ignore-line + } +} diff --git a/tests/Services/Folders/JobTest.php b/tests/Services/Folders/JobTest.php new file mode 100644 index 00000000..e4e4b467 --- /dev/null +++ b/tests/Services/Folders/JobTest.php @@ -0,0 +1,44 @@ +client = $client; + } + + #[Test] + public function testGet(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->folders->job->get('jobId'); + + $this->assertTrue(true); // @phpstan-ignore-line + } +} diff --git a/tests/Services/FoldersTest.php b/tests/Services/FoldersTest.php new file mode 100644 index 00000000..ab2bc197 --- /dev/null +++ b/tests/Services/FoldersTest.php @@ -0,0 +1,176 @@ +client = $client; + } + + #[Test] + public function testCreate(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->folders->create( + folderName: 'summer', + parentFolderPath: '/product/images/' + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testCreateWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->folders->create( + folderName: 'summer', + parentFolderPath: '/product/images/' + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testDelete(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->folders->delete('/folder/to/delete/'); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testDeleteWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->folders->delete('/folder/to/delete/'); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testCopy(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->folders->copy( + destinationPath: '/path/of/destination/folder', + sourceFolderPath: '/path/of/source/folder', + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testCopyWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->folders->copy( + destinationPath: '/path/of/destination/folder', + sourceFolderPath: '/path/of/source/folder', + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testMove(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->folders->move( + destinationPath: '/path/of/destination/folder', + sourceFolderPath: '/path/of/source/folder', + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testMoveWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->folders->move( + destinationPath: '/path/of/destination/folder', + sourceFolderPath: '/path/of/source/folder', + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testRename(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->folders->rename( + folderPath: '/path/of/folder', + newFolderName: 'new-folder-name' + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } + + #[Test] + public function testRenameWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->folders->rename( + folderPath: '/path/of/folder', + newFolderName: 'new-folder-name' + ); + + $this->assertTrue(true); // @phpstan-ignore-line + } +} diff --git a/tests/Services/WebhooksTest.php b/tests/Services/WebhooksTest.php new file mode 100644 index 00000000..c94df4e3 --- /dev/null +++ b/tests/Services/WebhooksTest.php @@ -0,0 +1,30 @@ +client = $client; + } +} diff --git a/tests/UnsupportedMockTests.php b/tests/UnsupportedMockTests.php new file mode 100644 index 00000000..f57ac900 --- /dev/null +++ b/tests/UnsupportedMockTests.php @@ -0,0 +1,8 @@ + Date: Mon, 1 Sep 2025 13:51:13 +0000 Subject: [PATCH 002/193] chore: update SDK settings --- .github/workflows/create-releases.yml | 30 --------------------------- .github/workflows/release-doctor.yml | 6 ++---- .stats.yml | 2 +- README.md | 10 ++++++--- bin/check-release-environment | 4 ---- 5 files changed, 10 insertions(+), 42 deletions(-) delete mode 100644 .github/workflows/create-releases.yml diff --git a/.github/workflows/create-releases.yml b/.github/workflows/create-releases.yml deleted file mode 100644 index 8e723adf..00000000 --- a/.github/workflows/create-releases.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Create releases -on: - schedule: - - cron: '0 5 * * *' # every day at 5am UTC - push: - branches: - - main - -jobs: - release: - name: release - if: github.ref == 'refs/heads/main' && github.repository == 'stainless-sdks/imagekit-php' - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - uses: stainless-api/trigger-release-please@v1 - id: release - with: - repo: ${{ github.event.repository.full_name }} - stainless-api-key: ${{ secrets.STAINLESS_API_KEY }} - - - name: Publish to Packagist - if: ${{ steps.release.outputs.releases_created }} - run: |- - curl --fail-with-body -X POST -H 'Content-Type: application/json' "https://packagist.org/api/update-package?username=${PACKAGIST_USERNAME}&apiToken=${PACKAGIST_SAFE_KEY}" -d '{"repository":"https://www.github.com/stainless-sdks/imagekit-php"}' - env: - PACKAGIST_USERNAME: ${{ secrets.IMAGE_KIT_PACKAGIST_USERNAME || secrets.PACKAGIST_USERNAME }} - PACKAGIST_SAFE_KEY: ${{ secrets.IMAGE_KIT_PACKAGIST_SAFE_KEY || secrets.PACKAGIST_SAFE_KEY }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index c789d348..6619e3f0 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -2,14 +2,14 @@ name: Release Doctor on: pull_request: branches: - - main + - master workflow_dispatch: jobs: release_doctor: name: release doctor runs-on: ubuntu-latest - if: github.repository == 'stainless-sdks/imagekit-php' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + if: github.repository == 'imagekit-developer/imagekit-php' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - uses: actions/checkout@v4 @@ -17,5 +17,3 @@ jobs: - name: Check release environment run: | bash ./bin/check-release-environment - env: - STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }} diff --git a/.stats.yml b/.stats.yml index ad85869b..5d25590d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-3d7da4b8ef2ed30aa32c4fb3e98e498e67402e91aaa5fd4c628fc080bfe82ea1.yml openapi_spec_hash: aaa50fcbccec6f2cf1165f34bc6ac886 -config_hash: cf9d50fe62973f4e91ef65c147aabcc1 +config_hash: 9f8a678d9d4d06daec522e8deb49e3ad diff --git a/README.md b/README.md index 4a52aaa4..0325e391 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ > > This library has not yet been exhaustively tested in production environments and may be missing some features you'd expect in a stable release. As we continue development, there may be breaking changes that require updates to your code. > -> **We'd love your feedback!** Please share any suggestions, bug reports, feature requests, or general thoughts by [filing an issue](https://www.github.com/stainless-sdks/imagekit-php/issues/new). +> **We'd love your feedback!** Please share any suggestions, bug reports, feature requests, or general thoughts by [filing an issue](https://www.github.com/imagekit-developer/imagekit-php/issues/new). The Image Kit PHP library provides convenient access to the Image Kit REST API from any PHP 8.1.0+ application. @@ -19,12 +19,14 @@ The REST API documentation can be found on [imagekit.io](https://imagekit.io/doc To use this package, install via Composer by adding the following to your application's `composer.json`: + + ```json { "repositories": [ { "type": "vcs", - "url": "git@github.com:stainless-sdks/imagekit-php.git" + "url": "git@github.com:imagekit-developer/imagekit-php.git" } ], "require": { @@ -33,6 +35,8 @@ To use this package, install via Composer by adding the following to your applic } ``` + + ## Usage This library uses named parameters to specify optional arguments. @@ -184,4 +188,4 @@ PHP 8.1.0 or higher. ## Contributing -See [the contributing documentation](https://github.com/stainless-sdks/imagekit-php/tree/main/CONTRIBUTING.md). +See [the contributing documentation](https://github.com/imagekit-developer/imagekit-php/tree/master/CONTRIBUTING.md). diff --git a/bin/check-release-environment b/bin/check-release-environment index 0d9c55da..cf571b62 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -2,10 +2,6 @@ errors=() -if [ -z "${STAINLESS_API_KEY}" ]; then - errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organization secrets on GitHub.") -fi - if [ -z "${PACKAGIST_USERNAME}" ]; then errors+=("The PACKAGIST_USERNAME secret has not been set. Please set it in either this repository's secrets or your organization secrets") fi From 84f5b7c65eb1b7b23fdda823aca71c51b73023e3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 07:19:41 +0000 Subject: [PATCH 003/193] feat(api): add BaseWebhookEvent --- .stats.yml | 6 +++--- src/Webhooks/UnsafeUnwrapWebhookEvent.php | 3 --- src/Webhooks/UnwrapWebhookEvent.php | 3 --- src/Webhooks/UploadPostTransformErrorEvent.php | 2 -- src/Webhooks/UploadPostTransformSuccessEvent.php | 2 -- src/Webhooks/UploadPreTransformErrorEvent.php | 2 -- src/Webhooks/UploadPreTransformSuccessEvent.php | 2 -- src/Webhooks/VideoTransformationAcceptedEvent.php | 2 -- src/Webhooks/VideoTransformationErrorEvent.php | 2 -- src/Webhooks/VideoTransformationReadyEvent.php | 2 -- 10 files changed, 3 insertions(+), 23 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5d25590d..08185446 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-3d7da4b8ef2ed30aa32c4fb3e98e498e67402e91aaa5fd4c628fc080bfe82ea1.yml -openapi_spec_hash: aaa50fcbccec6f2cf1165f34bc6ac886 -config_hash: 9f8a678d9d4d06daec522e8deb49e3ad +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-667f7f4988b44bc587d6eb9960ff5c8326e9f7e9b072f3f724f9f54166eff8b1.yml +openapi_spec_hash: f2081864a4abee0480e5ff991b4c936a +config_hash: 4e73c7e12a531edcd1366dab7eccc360 diff --git a/src/Webhooks/UnsafeUnwrapWebhookEvent.php b/src/Webhooks/UnsafeUnwrapWebhookEvent.php index 508250a3..eb843b16 100644 --- a/src/Webhooks/UnsafeUnwrapWebhookEvent.php +++ b/src/Webhooks/UnsafeUnwrapWebhookEvent.php @@ -8,9 +8,6 @@ use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; -/** - * Triggered when a new video transformation request is accepted for processing. This event confirms that ImageKit has received and queued your transformation request. Use this for debugging and tracking transformation lifecycle. - */ final class UnsafeUnwrapWebhookEvent implements ConverterSource { use SdkUnion; diff --git a/src/Webhooks/UnwrapWebhookEvent.php b/src/Webhooks/UnwrapWebhookEvent.php index 98b83129..d1bf3871 100644 --- a/src/Webhooks/UnwrapWebhookEvent.php +++ b/src/Webhooks/UnwrapWebhookEvent.php @@ -8,9 +8,6 @@ use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; -/** - * Triggered when a new video transformation request is accepted for processing. This event confirms that ImageKit has received and queued your transformation request. Use this for debugging and tracking transformation lifecycle. - */ final class UnwrapWebhookEvent implements ConverterSource { use SdkUnion; diff --git a/src/Webhooks/UploadPostTransformErrorEvent.php b/src/Webhooks/UploadPostTransformErrorEvent.php index 840b2dd5..e1fbe36a 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent.php +++ b/src/Webhooks/UploadPostTransformErrorEvent.php @@ -11,8 +11,6 @@ use ImageKit\Webhooks\UploadPostTransformErrorEvent\Request; /** - * Triggered when a post-transformation fails. The original file remains available, but the requested transformation could not be generated. - * * @phpstan-type upload_post_transform_error_event = array{ * id: string, * createdAt: \DateTimeInterface, diff --git a/src/Webhooks/UploadPostTransformSuccessEvent.php b/src/Webhooks/UploadPostTransformSuccessEvent.php index 732eae27..670314c4 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent.php @@ -11,8 +11,6 @@ use ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request; /** - * Triggered when a post-transformation completes successfully. The transformed version of the file is now ready and can be accessed via the provided URL. Note that each post-transformation generates a separate webhook event. - * * @phpstan-type upload_post_transform_success_event = array{ * id: string, * createdAt: \DateTimeInterface, diff --git a/src/Webhooks/UploadPreTransformErrorEvent.php b/src/Webhooks/UploadPreTransformErrorEvent.php index d8af26e0..5fb564db 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent.php +++ b/src/Webhooks/UploadPreTransformErrorEvent.php @@ -11,8 +11,6 @@ use ImageKit\Webhooks\UploadPreTransformErrorEvent\Request; /** - * Triggered when a pre-transformation fails. The file upload may have been accepted, but the requested transformation could not be applied. - * * @phpstan-type upload_pre_transform_error_event = array{ * id: string, * createdAt: \DateTimeInterface, diff --git a/src/Webhooks/UploadPreTransformSuccessEvent.php b/src/Webhooks/UploadPreTransformSuccessEvent.php index 77f3a5ce..5fd482bd 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent.php @@ -11,8 +11,6 @@ use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Request; /** - * Triggered when a pre-transformation completes successfully. The file has been processed with the requested transformation and is now available in the Media Library. - * * @phpstan-type upload_pre_transform_success_event = array{ * id: string, * createdAt: \DateTimeInterface, diff --git a/src/Webhooks/VideoTransformationAcceptedEvent.php b/src/Webhooks/VideoTransformationAcceptedEvent.php index 7c868c67..c63eb4ea 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent.php @@ -11,8 +11,6 @@ use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Request; /** - * Triggered when a new video transformation request is accepted for processing. This event confirms that ImageKit has received and queued your transformation request. Use this for debugging and tracking transformation lifecycle. - * * @phpstan-type video_transformation_accepted_event = array{ * id: string, * createdAt: \DateTimeInterface, diff --git a/src/Webhooks/VideoTransformationErrorEvent.php b/src/Webhooks/VideoTransformationErrorEvent.php index 71938723..746d1d33 100644 --- a/src/Webhooks/VideoTransformationErrorEvent.php +++ b/src/Webhooks/VideoTransformationErrorEvent.php @@ -11,8 +11,6 @@ use ImageKit\Webhooks\VideoTransformationErrorEvent\Request; /** - * Triggered when an error occurs during video encoding. Listen to this webhook to log error reasons and debug issues. Check your origin and URL endpoint settings if the reason is related to download failure. For other errors, contact ImageKit support. - * * @phpstan-type video_transformation_error_event = array{ * id: string, * createdAt: \DateTimeInterface, diff --git a/src/Webhooks/VideoTransformationReadyEvent.php b/src/Webhooks/VideoTransformationReadyEvent.php index 691208d4..449578b9 100644 --- a/src/Webhooks/VideoTransformationReadyEvent.php +++ b/src/Webhooks/VideoTransformationReadyEvent.php @@ -12,8 +12,6 @@ use ImageKit\Webhooks\VideoTransformationReadyEvent\Timings; /** - * Triggered when video encoding is finished and the transformed resource is ready to be served. This is the key event to listen for - update your database or CMS flags when you receive this so your application can start showing the transformed video to users. - * * @phpstan-type video_transformation_ready_event = array{ * id: string, * createdAt: \DateTimeInterface, From 864a1aa121d394cbc89a9b305d03177777fe173e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 07:21:11 +0000 Subject: [PATCH 004/193] feat(api): manual updates --- .stats.yml | 2 +- src/Webhooks/BaseWebhookEvent.php | 86 +++++++++++++++++++ src/Webhooks/UnsafeUnwrapWebhookEvent.php | 3 + src/Webhooks/UnwrapWebhookEvent.php | 3 + .../UploadPostTransformErrorEvent.php | 32 +------ .../UploadPostTransformSuccessEvent.php | 32 +------ src/Webhooks/UploadPreTransformErrorEvent.php | 32 +------ .../UploadPreTransformSuccessEvent.php | 32 +------ .../VideoTransformationAcceptedEvent.php | 32 +------ .../VideoTransformationErrorEvent.php | 32 +------ .../VideoTransformationReadyEvent.php | 27 +----- 11 files changed, 120 insertions(+), 193 deletions(-) create mode 100644 src/Webhooks/BaseWebhookEvent.php diff --git a/.stats.yml b/.stats.yml index 08185446..52f982ba 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-667f7f4988b44bc587d6eb9960ff5c8326e9f7e9b072f3f724f9f54166eff8b1.yml openapi_spec_hash: f2081864a4abee0480e5ff991b4c936a -config_hash: 4e73c7e12a531edcd1366dab7eccc360 +config_hash: 08e12746cdca1c59c897cf2e50893c3c diff --git a/src/Webhooks/BaseWebhookEvent.php b/src/Webhooks/BaseWebhookEvent.php new file mode 100644 index 00000000..b5b8aa22 --- /dev/null +++ b/src/Webhooks/BaseWebhookEvent.php @@ -0,0 +1,86 @@ + */ + use SdkModel; + + /** + * Unique identifier for the event. + */ + #[Api] + public string $id; + + /** + * The type of webhook event. + */ + #[Api] + public string $type; + + /** + * `new BaseWebhookEvent()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * BaseWebhookEvent::with(id: ..., type: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new BaseWebhookEvent)->withID(...)->withType(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id, string $type): self + { + $obj = new self; + + $obj->id = $id; + $obj->type = $type; + + return $obj; + } + + /** + * Unique identifier for the event. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * The type of webhook event. + */ + public function withType(string $type): self + { + $obj = clone $this; + $obj->type = $type; + + return $obj; + } +} diff --git a/src/Webhooks/UnsafeUnwrapWebhookEvent.php b/src/Webhooks/UnsafeUnwrapWebhookEvent.php index eb843b16..508250a3 100644 --- a/src/Webhooks/UnsafeUnwrapWebhookEvent.php +++ b/src/Webhooks/UnsafeUnwrapWebhookEvent.php @@ -8,6 +8,9 @@ use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; +/** + * Triggered when a new video transformation request is accepted for processing. This event confirms that ImageKit has received and queued your transformation request. Use this for debugging and tracking transformation lifecycle. + */ final class UnsafeUnwrapWebhookEvent implements ConverterSource { use SdkUnion; diff --git a/src/Webhooks/UnwrapWebhookEvent.php b/src/Webhooks/UnwrapWebhookEvent.php index d1bf3871..98b83129 100644 --- a/src/Webhooks/UnwrapWebhookEvent.php +++ b/src/Webhooks/UnwrapWebhookEvent.php @@ -8,6 +8,9 @@ use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; +/** + * Triggered when a new video transformation request is accepted for processing. This event confirms that ImageKit has received and queued your transformation request. Use this for debugging and tracking transformation lifecycle. + */ final class UnwrapWebhookEvent implements ConverterSource { use SdkUnion; diff --git a/src/Webhooks/UploadPostTransformErrorEvent.php b/src/Webhooks/UploadPostTransformErrorEvent.php index e1fbe36a..22ad5804 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent.php +++ b/src/Webhooks/UploadPostTransformErrorEvent.php @@ -11,12 +11,10 @@ use ImageKit\Webhooks\UploadPostTransformErrorEvent\Request; /** + * Triggered when a post-transformation fails. The original file remains available, but the requested transformation could not be generated. + * * @phpstan-type upload_post_transform_error_event = array{ - * id: string, - * createdAt: \DateTimeInterface, - * data: Data, - * request: Request, - * type: string, + * createdAt: \DateTimeInterface, data: Data, request: Request, type: string * } */ final class UploadPostTransformErrorEvent implements BaseModel @@ -27,12 +25,6 @@ final class UploadPostTransformErrorEvent implements BaseModel #[Api] public string $type = 'upload.post-transform.error'; - /** - * Unique identifier for the event. - */ - #[Api] - public string $id; - /** * Timestamp of when the event occurred in ISO8601 format. */ @@ -50,16 +42,13 @@ final class UploadPostTransformErrorEvent implements BaseModel * * To enforce required parameters use * ``` - * UploadPostTransformErrorEvent::with( - * id: ..., createdAt: ..., data: ..., request: ... - * ) + * UploadPostTransformErrorEvent::with(createdAt: ..., data: ..., request: ...) * ``` * * Otherwise ensure the following setters are called * * ``` * (new UploadPostTransformErrorEvent) - * ->withID(...) * ->withCreatedAt(...) * ->withData(...) * ->withRequest(...) @@ -76,14 +65,12 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - string $id, \DateTimeInterface $createdAt, Data $data, Request $request ): self { $obj = new self; - $obj->id = $id; $obj->createdAt = $createdAt; $obj->data = $data; $obj->request = $request; @@ -91,17 +78,6 @@ public static function with( return $obj; } - /** - * Unique identifier for the event. - */ - public function withID(string $id): self - { - $obj = clone $this; - $obj->id = $id; - - return $obj; - } - /** * Timestamp of when the event occurred in ISO8601 format. */ diff --git a/src/Webhooks/UploadPostTransformSuccessEvent.php b/src/Webhooks/UploadPostTransformSuccessEvent.php index 670314c4..f5cb4919 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent.php @@ -11,12 +11,10 @@ use ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request; /** + * Triggered when a post-transformation completes successfully. The transformed version of the file is now ready and can be accessed via the provided URL. Note that each post-transformation generates a separate webhook event. + * * @phpstan-type upload_post_transform_success_event = array{ - * id: string, - * createdAt: \DateTimeInterface, - * data: Data, - * request: Request, - * type: string, + * createdAt: \DateTimeInterface, data: Data, request: Request, type: string * } */ final class UploadPostTransformSuccessEvent implements BaseModel @@ -27,12 +25,6 @@ final class UploadPostTransformSuccessEvent implements BaseModel #[Api] public string $type = 'upload.post-transform.success'; - /** - * Unique identifier for the event. - */ - #[Api] - public string $id; - /** * Timestamp of when the event occurred in ISO8601 format. */ @@ -50,16 +42,13 @@ final class UploadPostTransformSuccessEvent implements BaseModel * * To enforce required parameters use * ``` - * UploadPostTransformSuccessEvent::with( - * id: ..., createdAt: ..., data: ..., request: ... - * ) + * UploadPostTransformSuccessEvent::with(createdAt: ..., data: ..., request: ...) * ``` * * Otherwise ensure the following setters are called * * ``` * (new UploadPostTransformSuccessEvent) - * ->withID(...) * ->withCreatedAt(...) * ->withData(...) * ->withRequest(...) @@ -76,14 +65,12 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - string $id, \DateTimeInterface $createdAt, Data $data, Request $request ): self { $obj = new self; - $obj->id = $id; $obj->createdAt = $createdAt; $obj->data = $data; $obj->request = $request; @@ -91,17 +78,6 @@ public static function with( return $obj; } - /** - * Unique identifier for the event. - */ - public function withID(string $id): self - { - $obj = clone $this; - $obj->id = $id; - - return $obj; - } - /** * Timestamp of when the event occurred in ISO8601 format. */ diff --git a/src/Webhooks/UploadPreTransformErrorEvent.php b/src/Webhooks/UploadPreTransformErrorEvent.php index 5fb564db..03f76019 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent.php +++ b/src/Webhooks/UploadPreTransformErrorEvent.php @@ -11,12 +11,10 @@ use ImageKit\Webhooks\UploadPreTransformErrorEvent\Request; /** + * Triggered when a pre-transformation fails. The file upload may have been accepted, but the requested transformation could not be applied. + * * @phpstan-type upload_pre_transform_error_event = array{ - * id: string, - * createdAt: \DateTimeInterface, - * data: Data, - * request: Request, - * type: string, + * createdAt: \DateTimeInterface, data: Data, request: Request, type: string * } */ final class UploadPreTransformErrorEvent implements BaseModel @@ -27,12 +25,6 @@ final class UploadPreTransformErrorEvent implements BaseModel #[Api] public string $type = 'upload.pre-transform.error'; - /** - * Unique identifier for the event. - */ - #[Api] - public string $id; - /** * Timestamp of when the event occurred in ISO8601 format. */ @@ -50,16 +42,13 @@ final class UploadPreTransformErrorEvent implements BaseModel * * To enforce required parameters use * ``` - * UploadPreTransformErrorEvent::with( - * id: ..., createdAt: ..., data: ..., request: ... - * ) + * UploadPreTransformErrorEvent::with(createdAt: ..., data: ..., request: ...) * ``` * * Otherwise ensure the following setters are called * * ``` * (new UploadPreTransformErrorEvent) - * ->withID(...) * ->withCreatedAt(...) * ->withData(...) * ->withRequest(...) @@ -76,14 +65,12 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - string $id, \DateTimeInterface $createdAt, Data $data, Request $request ): self { $obj = new self; - $obj->id = $id; $obj->createdAt = $createdAt; $obj->data = $data; $obj->request = $request; @@ -91,17 +78,6 @@ public static function with( return $obj; } - /** - * Unique identifier for the event. - */ - public function withID(string $id): self - { - $obj = clone $this; - $obj->id = $id; - - return $obj; - } - /** * Timestamp of when the event occurred in ISO8601 format. */ diff --git a/src/Webhooks/UploadPreTransformSuccessEvent.php b/src/Webhooks/UploadPreTransformSuccessEvent.php index 5fd482bd..ef1c0670 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent.php @@ -11,12 +11,10 @@ use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Request; /** + * Triggered when a pre-transformation completes successfully. The file has been processed with the requested transformation and is now available in the Media Library. + * * @phpstan-type upload_pre_transform_success_event = array{ - * id: string, - * createdAt: \DateTimeInterface, - * data: Data, - * request: Request, - * type: string, + * createdAt: \DateTimeInterface, data: Data, request: Request, type: string * } */ final class UploadPreTransformSuccessEvent implements BaseModel @@ -27,12 +25,6 @@ final class UploadPreTransformSuccessEvent implements BaseModel #[Api] public string $type = 'upload.pre-transform.success'; - /** - * Unique identifier for the event. - */ - #[Api] - public string $id; - /** * Timestamp of when the event occurred in ISO8601 format. */ @@ -53,16 +45,13 @@ final class UploadPreTransformSuccessEvent implements BaseModel * * To enforce required parameters use * ``` - * UploadPreTransformSuccessEvent::with( - * id: ..., createdAt: ..., data: ..., request: ... - * ) + * UploadPreTransformSuccessEvent::with(createdAt: ..., data: ..., request: ...) * ``` * * Otherwise ensure the following setters are called * * ``` * (new UploadPreTransformSuccessEvent) - * ->withID(...) * ->withCreatedAt(...) * ->withData(...) * ->withRequest(...) @@ -79,14 +68,12 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - string $id, \DateTimeInterface $createdAt, Data $data, Request $request ): self { $obj = new self; - $obj->id = $id; $obj->createdAt = $createdAt; $obj->data = $data; $obj->request = $request; @@ -94,17 +81,6 @@ public static function with( return $obj; } - /** - * Unique identifier for the event. - */ - public function withID(string $id): self - { - $obj = clone $this; - $obj->id = $id; - - return $obj; - } - /** * Timestamp of when the event occurred in ISO8601 format. */ diff --git a/src/Webhooks/VideoTransformationAcceptedEvent.php b/src/Webhooks/VideoTransformationAcceptedEvent.php index c63eb4ea..6957bcca 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent.php @@ -11,12 +11,10 @@ use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Request; /** + * Triggered when a new video transformation request is accepted for processing. This event confirms that ImageKit has received and queued your transformation request. Use this for debugging and tracking transformation lifecycle. + * * @phpstan-type video_transformation_accepted_event = array{ - * id: string, - * createdAt: \DateTimeInterface, - * data: Data, - * request: Request, - * type: string, + * createdAt: \DateTimeInterface, data: Data, request: Request, type: string * } */ final class VideoTransformationAcceptedEvent implements BaseModel @@ -27,12 +25,6 @@ final class VideoTransformationAcceptedEvent implements BaseModel #[Api] public string $type = 'video.transformation.accepted'; - /** - * Unique identifier for the event. - */ - #[Api] - public string $id; - /** * Timestamp when the event was created in ISO8601 format. */ @@ -53,16 +45,13 @@ final class VideoTransformationAcceptedEvent implements BaseModel * * To enforce required parameters use * ``` - * VideoTransformationAcceptedEvent::with( - * id: ..., createdAt: ..., data: ..., request: ... - * ) + * VideoTransformationAcceptedEvent::with(createdAt: ..., data: ..., request: ...) * ``` * * Otherwise ensure the following setters are called * * ``` * (new VideoTransformationAcceptedEvent) - * ->withID(...) * ->withCreatedAt(...) * ->withData(...) * ->withRequest(...) @@ -79,14 +68,12 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - string $id, \DateTimeInterface $createdAt, Data $data, Request $request ): self { $obj = new self; - $obj->id = $id; $obj->createdAt = $createdAt; $obj->data = $data; $obj->request = $request; @@ -94,17 +81,6 @@ public static function with( return $obj; } - /** - * Unique identifier for the event. - */ - public function withID(string $id): self - { - $obj = clone $this; - $obj->id = $id; - - return $obj; - } - /** * Timestamp when the event was created in ISO8601 format. */ diff --git a/src/Webhooks/VideoTransformationErrorEvent.php b/src/Webhooks/VideoTransformationErrorEvent.php index 746d1d33..31aa4b8a 100644 --- a/src/Webhooks/VideoTransformationErrorEvent.php +++ b/src/Webhooks/VideoTransformationErrorEvent.php @@ -11,12 +11,10 @@ use ImageKit\Webhooks\VideoTransformationErrorEvent\Request; /** + * Triggered when an error occurs during video encoding. Listen to this webhook to log error reasons and debug issues. Check your origin and URL endpoint settings if the reason is related to download failure. For other errors, contact ImageKit support. + * * @phpstan-type video_transformation_error_event = array{ - * id: string, - * createdAt: \DateTimeInterface, - * data: Data, - * request: Request, - * type: string, + * createdAt: \DateTimeInterface, data: Data, request: Request, type: string * } */ final class VideoTransformationErrorEvent implements BaseModel @@ -27,12 +25,6 @@ final class VideoTransformationErrorEvent implements BaseModel #[Api] public string $type = 'video.transformation.error'; - /** - * Unique identifier for the event. - */ - #[Api] - public string $id; - /** * Timestamp when the event was created in ISO8601 format. */ @@ -53,16 +45,13 @@ final class VideoTransformationErrorEvent implements BaseModel * * To enforce required parameters use * ``` - * VideoTransformationErrorEvent::with( - * id: ..., createdAt: ..., data: ..., request: ... - * ) + * VideoTransformationErrorEvent::with(createdAt: ..., data: ..., request: ...) * ``` * * Otherwise ensure the following setters are called * * ``` * (new VideoTransformationErrorEvent) - * ->withID(...) * ->withCreatedAt(...) * ->withData(...) * ->withRequest(...) @@ -79,14 +68,12 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - string $id, \DateTimeInterface $createdAt, Data $data, Request $request ): self { $obj = new self; - $obj->id = $id; $obj->createdAt = $createdAt; $obj->data = $data; $obj->request = $request; @@ -94,17 +81,6 @@ public static function with( return $obj; } - /** - * Unique identifier for the event. - */ - public function withID(string $id): self - { - $obj = clone $this; - $obj->id = $id; - - return $obj; - } - /** * Timestamp when the event was created in ISO8601 format. */ diff --git a/src/Webhooks/VideoTransformationReadyEvent.php b/src/Webhooks/VideoTransformationReadyEvent.php index 449578b9..688f66a9 100644 --- a/src/Webhooks/VideoTransformationReadyEvent.php +++ b/src/Webhooks/VideoTransformationReadyEvent.php @@ -12,8 +12,9 @@ use ImageKit\Webhooks\VideoTransformationReadyEvent\Timings; /** + * Triggered when video encoding is finished and the transformed resource is ready to be served. This is the key event to listen for - update your database or CMS flags when you receive this so your application can start showing the transformed video to users. + * * @phpstan-type video_transformation_ready_event = array{ - * id: string, * createdAt: \DateTimeInterface, * data: Data, * request: Request, @@ -29,12 +30,6 @@ final class VideoTransformationReadyEvent implements BaseModel #[Api] public string $type = 'video.transformation.ready'; - /** - * Unique identifier for the event. - */ - #[Api] - public string $id; - /** * Timestamp when the event was created in ISO8601 format. */ @@ -61,16 +56,13 @@ final class VideoTransformationReadyEvent implements BaseModel * * To enforce required parameters use * ``` - * VideoTransformationReadyEvent::with( - * id: ..., createdAt: ..., data: ..., request: ... - * ) + * VideoTransformationReadyEvent::with(createdAt: ..., data: ..., request: ...) * ``` * * Otherwise ensure the following setters are called * * ``` * (new VideoTransformationReadyEvent) - * ->withID(...) * ->withCreatedAt(...) * ->withData(...) * ->withRequest(...) @@ -87,7 +79,6 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - string $id, \DateTimeInterface $createdAt, Data $data, Request $request, @@ -95,7 +86,6 @@ public static function with( ): self { $obj = new self; - $obj->id = $id; $obj->createdAt = $createdAt; $obj->data = $data; $obj->request = $request; @@ -105,17 +95,6 @@ public static function with( return $obj; } - /** - * Unique identifier for the event. - */ - public function withID(string $id): self - { - $obj = clone $this; - $obj->id = $id; - - return $obj; - } - /** * Timestamp when the event was created in ISO8601 format. */ From d47d5315bc6aac956a2e12ba539c7a07d1d95f83 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 08:16:06 +0000 Subject: [PATCH 005/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 52f982ba..cfcbd7f7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-667f7f4988b44bc587d6eb9960ff5c8326e9f7e9b072f3f724f9f54166eff8b1.yml openapi_spec_hash: f2081864a4abee0480e5ff991b4c936a -config_hash: 08e12746cdca1c59c897cf2e50893c3c +config_hash: 70f9408b8d1dfbcf262a20d6eed50e1c From 3ac5bb60ab1b828c27a17e8d499309c1ac077dd9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 08:18:51 +0000 Subject: [PATCH 006/193] feat(api): manual updates --- .stats.yml | 4 ++-- README.md | 12 ++++++++---- tests/Services/FilesTest.php | 10 ++++++++-- 3 files changed, 18 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index cfcbd7f7..282d18eb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-667f7f4988b44bc587d6eb9960ff5c8326e9f7e9b072f3f724f9f54166eff8b1.yml -openapi_spec_hash: f2081864a4abee0480e5ff991b4c936a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-eab9713fd85da68b41e881dfd9cd71f654e8620132da2023bab7dd01e5f7852e.yml +openapi_spec_hash: b5037b26fbe7360c6bfaf9947a65bb85 config_hash: 70f9408b8d1dfbcf262a20d6eed50e1c diff --git a/README.md b/README.md index 0325e391..1263fdc0 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,9 @@ $client = new Client( password: getenv("OPTIONAL_IMAGEKIT_IGNORES_THIS") ?: "do_not_set", ); -$response = $client->files->upload(file: 'file', fileName: "file-name.jpg"); +$response = $client->files->upload( + file: "https://www.example.com/public-url.jpg", fileName: "file-name.jpg" +); var_dump($response->videoCodec); ``` @@ -74,7 +76,9 @@ When the library is unable to connect to the API, or if the API returns a non-su use ImageKit\Core\Exceptions\APIConnectionException; try { - $response = $client->files->upload(file: 'file', fileName: "file-name.jpg"); + $response = $client->files->upload( + file: "https://www.example.com/public-url.jpg", fileName: "file-name.jpg" + ); } catch (APIConnectionException $e) { echo "The server could not be reached", PHP_EOL; var_dump($e->getPrevious()); @@ -122,7 +126,7 @@ $client = new Client(maxRetries: 0); // Or, configure per-request: $result = $client->files->upload( - file: 'file', + file: "https://www.example.com/public-url.jpg", fileName: "file-name.jpg", requestOptions: RequestOptions::with(maxRetries: 5), ); @@ -144,7 +148,7 @@ Note: the `extra*` parameters of the same name overrides the documented paramete use ImageKit\RequestOptions; $response = $client->files->upload( - file: 'file', + file: "https://www.example.com/public-url.jpg", fileName: "file-name.jpg", requestOptions: RequestOptions::with( extraQueryParams: ["my_query_parameter" => "value"], diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index 457d84a4..e5d99bdf 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -163,7 +163,10 @@ public function testUpload(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->upload(file: 'file', fileName: 'fileName'); + $result = $this->client->files->upload( + file: 'https://www.example.com/path/to-image.jpg', + fileName: 'fileName' + ); $this->assertTrue(true); // @phpstan-ignore-line } @@ -175,7 +178,10 @@ public function testUploadWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->upload(file: 'file', fileName: 'fileName'); + $result = $this->client->files->upload( + file: 'https://www.example.com/path/to-image.jpg', + fileName: 'fileName' + ); $this->assertTrue(true); // @phpstan-ignore-line } From 8aecc6ee1d42589a554687c3a8138ff764ba223f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 08:21:48 +0000 Subject: [PATCH 007/193] feat(api): manual updates --- .stats.yml | 4 ++-- tests/Services/FilesTest.php | 10 ++-------- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index 282d18eb..7698a81b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-eab9713fd85da68b41e881dfd9cd71f654e8620132da2023bab7dd01e5f7852e.yml -openapi_spec_hash: b5037b26fbe7360c6bfaf9947a65bb85 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-911102f2eaf3be4b34381f6ba089330bed099bb72eb93667ce2f6e72b5934c8c.yml +openapi_spec_hash: 637ad417a580137914441bd790b04cc2 config_hash: 70f9408b8d1dfbcf262a20d6eed50e1c diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index e5d99bdf..457d84a4 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -163,10 +163,7 @@ public function testUpload(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->upload( - file: 'https://www.example.com/path/to-image.jpg', - fileName: 'fileName' - ); + $result = $this->client->files->upload(file: 'file', fileName: 'fileName'); $this->assertTrue(true); // @phpstan-ignore-line } @@ -178,10 +175,7 @@ public function testUploadWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->upload( - file: 'https://www.example.com/path/to-image.jpg', - fileName: 'fileName' - ); + $result = $this->client->files->upload(file: 'file', fileName: 'fileName'); $this->assertTrue(true); // @phpstan-ignore-line } From 2ebe4bffb958f8cd8c923b285bdb79b4d93ea755 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 08:23:52 +0000 Subject: [PATCH 008/193] feat(api): manual updates --- .stats.yml | 4 ++-- README.md | 12 ++++-------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7698a81b..d42605f1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-911102f2eaf3be4b34381f6ba089330bed099bb72eb93667ce2f6e72b5934c8c.yml -openapi_spec_hash: 637ad417a580137914441bd790b04cc2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-0726d89b19f532c7fb92990d688a9bfb5aa4a9a871d64f49d4ba45bac6998e4a.yml +openapi_spec_hash: 9525bb02ab496b3459a1f93ac50968e3 config_hash: 70f9408b8d1dfbcf262a20d6eed50e1c diff --git a/README.md b/README.md index 1263fdc0..0325e391 100644 --- a/README.md +++ b/README.md @@ -52,9 +52,7 @@ $client = new Client( password: getenv("OPTIONAL_IMAGEKIT_IGNORES_THIS") ?: "do_not_set", ); -$response = $client->files->upload( - file: "https://www.example.com/public-url.jpg", fileName: "file-name.jpg" -); +$response = $client->files->upload(file: 'file', fileName: "file-name.jpg"); var_dump($response->videoCodec); ``` @@ -76,9 +74,7 @@ When the library is unable to connect to the API, or if the API returns a non-su use ImageKit\Core\Exceptions\APIConnectionException; try { - $response = $client->files->upload( - file: "https://www.example.com/public-url.jpg", fileName: "file-name.jpg" - ); + $response = $client->files->upload(file: 'file', fileName: "file-name.jpg"); } catch (APIConnectionException $e) { echo "The server could not be reached", PHP_EOL; var_dump($e->getPrevious()); @@ -126,7 +122,7 @@ $client = new Client(maxRetries: 0); // Or, configure per-request: $result = $client->files->upload( - file: "https://www.example.com/public-url.jpg", + file: 'file', fileName: "file-name.jpg", requestOptions: RequestOptions::with(maxRetries: 5), ); @@ -148,7 +144,7 @@ Note: the `extra*` parameters of the same name overrides the documented paramete use ImageKit\RequestOptions; $response = $client->files->upload( - file: "https://www.example.com/public-url.jpg", + file: 'file', fileName: "file-name.jpg", requestOptions: RequestOptions::with( extraQueryParams: ["my_query_parameter" => "value"], From 5bce0a417f3c5dd63a13ccc28477977863ee9ed2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 08:33:06 +0000 Subject: [PATCH 009/193] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index d42605f1..cfcbd7f7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-0726d89b19f532c7fb92990d688a9bfb5aa4a9a871d64f49d4ba45bac6998e4a.yml -openapi_spec_hash: 9525bb02ab496b3459a1f93ac50968e3 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-667f7f4988b44bc587d6eb9960ff5c8326e9f7e9b072f3f724f9f54166eff8b1.yml +openapi_spec_hash: f2081864a4abee0480e5ff991b4c936a config_hash: 70f9408b8d1dfbcf262a20d6eed50e1c From 6ec4a94508922f91f34d9b58226e047de6c40399 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 09:03:37 +0000 Subject: [PATCH 010/193] feat(api): manual updates --- .stats.yml | 4 ++-- README.md | 12 ++++++++---- src/Core/ServiceContracts/FilesContract.php | 8 +------- src/Core/Services/FilesService.php | 8 +------- src/Files/FileUploadParams.php | 16 ++-------------- tests/Services/FilesTest.php | 10 ++++++++-- 6 files changed, 22 insertions(+), 36 deletions(-) diff --git a/.stats.yml b/.stats.yml index cfcbd7f7..d458a07c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-667f7f4988b44bc587d6eb9960ff5c8326e9f7e9b072f3f724f9f54166eff8b1.yml -openapi_spec_hash: f2081864a4abee0480e5ff991b4c936a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-e7bc47a9221d7da9c8c9653d3fd1d4cfdf2408588e32c4aa62bd02a50ec93c36.yml +openapi_spec_hash: 8d061396a2fff9d1add4d5baf03ab939 config_hash: 70f9408b8d1dfbcf262a20d6eed50e1c diff --git a/README.md b/README.md index 0325e391..1263fdc0 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,9 @@ $client = new Client( password: getenv("OPTIONAL_IMAGEKIT_IGNORES_THIS") ?: "do_not_set", ); -$response = $client->files->upload(file: 'file', fileName: "file-name.jpg"); +$response = $client->files->upload( + file: "https://www.example.com/public-url.jpg", fileName: "file-name.jpg" +); var_dump($response->videoCodec); ``` @@ -74,7 +76,9 @@ When the library is unable to connect to the API, or if the API returns a non-su use ImageKit\Core\Exceptions\APIConnectionException; try { - $response = $client->files->upload(file: 'file', fileName: "file-name.jpg"); + $response = $client->files->upload( + file: "https://www.example.com/public-url.jpg", fileName: "file-name.jpg" + ); } catch (APIConnectionException $e) { echo "The server could not be reached", PHP_EOL; var_dump($e->getPrevious()); @@ -122,7 +126,7 @@ $client = new Client(maxRetries: 0); // Or, configure per-request: $result = $client->files->upload( - file: 'file', + file: "https://www.example.com/public-url.jpg", fileName: "file-name.jpg", requestOptions: RequestOptions::with(maxRetries: 5), ); @@ -144,7 +148,7 @@ Note: the `extra*` parameters of the same name overrides the documented paramete use ImageKit\RequestOptions; $response = $client->files->upload( - file: 'file', + file: "https://www.example.com/public-url.jpg", fileName: "file-name.jpg", requestOptions: RequestOptions::with( extraQueryParams: ["my_query_parameter" => "value"], diff --git a/src/Core/ServiceContracts/FilesContract.php b/src/Core/ServiceContracts/FilesContract.php index c698af13..b6dc0ac5 100644 --- a/src/Core/ServiceContracts/FilesContract.php +++ b/src/Core/ServiceContracts/FilesContract.php @@ -104,13 +104,7 @@ public function rename( /** * @api * - * @param string $file The API accepts any of the following: - * - * - **Binary data** – send the raw bytes as `multipart/form-data`. - * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. - * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. - * - * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + * @param string $file A publicly reachable URL that ImageKit’s servers can fetch. The server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. * @param string $fileName The name with which the file has to be uploaded. * The file name can contain: * diff --git a/src/Core/Services/FilesService.php b/src/Core/Services/FilesService.php index 5eb5ecbf..ed58094f 100644 --- a/src/Core/Services/FilesService.php +++ b/src/Core/Services/FilesService.php @@ -257,13 +257,7 @@ public function rename( * - A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more. * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. * - * @param string $file The API accepts any of the following: - * - * - **Binary data** – send the raw bytes as `multipart/form-data`. - * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. - * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. - * - * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + * @param string $file A publicly reachable URL that ImageKit’s servers can fetch. The server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. * @param string $fileName The name with which the file has to be uploaded. * The file name can contain: * diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index f16f74cd..46cec26e 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -66,13 +66,7 @@ final class FileUploadParams implements BaseModel use SdkParams; /** - * The API accepts any of the following: - * - * - **Binary data** – send the raw bytes as `multipart/form-data`. - * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. - * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. - * - * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + * A publicly reachable URL that ImageKit’s servers can fetch. The server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. */ #[Api] public string $file; @@ -344,13 +338,7 @@ public static function with( } /** - * The API accepts any of the following: - * - * - **Binary data** – send the raw bytes as `multipart/form-data`. - * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. - * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. - * - * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + * A publicly reachable URL that ImageKit’s servers can fetch. The server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. */ public function withFile(string $file): self { diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index 457d84a4..e5d99bdf 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -163,7 +163,10 @@ public function testUpload(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->upload(file: 'file', fileName: 'fileName'); + $result = $this->client->files->upload( + file: 'https://www.example.com/path/to-image.jpg', + fileName: 'fileName' + ); $this->assertTrue(true); // @phpstan-ignore-line } @@ -175,7 +178,10 @@ public function testUploadWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->upload(file: 'file', fileName: 'fileName'); + $result = $this->client->files->upload( + file: 'https://www.example.com/path/to-image.jpg', + fileName: 'fileName' + ); $this->assertTrue(true); // @phpstan-ignore-line } From 0daa17580a73ebd447e344f01fa36f1fb593dd4d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 2 Sep 2025 09:11:06 +0000 Subject: [PATCH 011/193] feat(api): manual updates --- .stats.yml | 4 ++-- README.md | 12 ++++-------- src/Core/ServiceContracts/FilesContract.php | 8 +++++++- src/Core/Services/FilesService.php | 8 +++++++- src/Files/FileUploadParams.php | 16 ++++++++++++++-- tests/Services/FilesTest.php | 10 ++-------- 6 files changed, 36 insertions(+), 22 deletions(-) diff --git a/.stats.yml b/.stats.yml index d458a07c..cfcbd7f7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-e7bc47a9221d7da9c8c9653d3fd1d4cfdf2408588e32c4aa62bd02a50ec93c36.yml -openapi_spec_hash: 8d061396a2fff9d1add4d5baf03ab939 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-667f7f4988b44bc587d6eb9960ff5c8326e9f7e9b072f3f724f9f54166eff8b1.yml +openapi_spec_hash: f2081864a4abee0480e5ff991b4c936a config_hash: 70f9408b8d1dfbcf262a20d6eed50e1c diff --git a/README.md b/README.md index 1263fdc0..0325e391 100644 --- a/README.md +++ b/README.md @@ -52,9 +52,7 @@ $client = new Client( password: getenv("OPTIONAL_IMAGEKIT_IGNORES_THIS") ?: "do_not_set", ); -$response = $client->files->upload( - file: "https://www.example.com/public-url.jpg", fileName: "file-name.jpg" -); +$response = $client->files->upload(file: 'file', fileName: "file-name.jpg"); var_dump($response->videoCodec); ``` @@ -76,9 +74,7 @@ When the library is unable to connect to the API, or if the API returns a non-su use ImageKit\Core\Exceptions\APIConnectionException; try { - $response = $client->files->upload( - file: "https://www.example.com/public-url.jpg", fileName: "file-name.jpg" - ); + $response = $client->files->upload(file: 'file', fileName: "file-name.jpg"); } catch (APIConnectionException $e) { echo "The server could not be reached", PHP_EOL; var_dump($e->getPrevious()); @@ -126,7 +122,7 @@ $client = new Client(maxRetries: 0); // Or, configure per-request: $result = $client->files->upload( - file: "https://www.example.com/public-url.jpg", + file: 'file', fileName: "file-name.jpg", requestOptions: RequestOptions::with(maxRetries: 5), ); @@ -148,7 +144,7 @@ Note: the `extra*` parameters of the same name overrides the documented paramete use ImageKit\RequestOptions; $response = $client->files->upload( - file: "https://www.example.com/public-url.jpg", + file: 'file', fileName: "file-name.jpg", requestOptions: RequestOptions::with( extraQueryParams: ["my_query_parameter" => "value"], diff --git a/src/Core/ServiceContracts/FilesContract.php b/src/Core/ServiceContracts/FilesContract.php index b6dc0ac5..c698af13 100644 --- a/src/Core/ServiceContracts/FilesContract.php +++ b/src/Core/ServiceContracts/FilesContract.php @@ -104,7 +104,13 @@ public function rename( /** * @api * - * @param string $file A publicly reachable URL that ImageKit’s servers can fetch. The server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + * @param string $file The API accepts any of the following: + * + * - **Binary data** – send the raw bytes as `multipart/form-data`. + * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. + * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. + * + * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. * @param string $fileName The name with which the file has to be uploaded. * The file name can contain: * diff --git a/src/Core/Services/FilesService.php b/src/Core/Services/FilesService.php index ed58094f..5eb5ecbf 100644 --- a/src/Core/Services/FilesService.php +++ b/src/Core/Services/FilesService.php @@ -257,7 +257,13 @@ public function rename( * - A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more. * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. * - * @param string $file A publicly reachable URL that ImageKit’s servers can fetch. The server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + * @param string $file The API accepts any of the following: + * + * - **Binary data** – send the raw bytes as `multipart/form-data`. + * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. + * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. + * + * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. * @param string $fileName The name with which the file has to be uploaded. * The file name can contain: * diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index 46cec26e..f16f74cd 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -66,7 +66,13 @@ final class FileUploadParams implements BaseModel use SdkParams; /** - * A publicly reachable URL that ImageKit’s servers can fetch. The server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + * The API accepts any of the following: + * + * - **Binary data** – send the raw bytes as `multipart/form-data`. + * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. + * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. + * + * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. */ #[Api] public string $file; @@ -338,7 +344,13 @@ public static function with( } /** - * A publicly reachable URL that ImageKit’s servers can fetch. The server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + * The API accepts any of the following: + * + * - **Binary data** – send the raw bytes as `multipart/form-data`. + * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. + * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. + * + * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. */ public function withFile(string $file): self { diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index e5d99bdf..457d84a4 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -163,10 +163,7 @@ public function testUpload(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->upload( - file: 'https://www.example.com/path/to-image.jpg', - fileName: 'fileName' - ); + $result = $this->client->files->upload(file: 'file', fileName: 'fileName'); $this->assertTrue(true); // @phpstan-ignore-line } @@ -178,10 +175,7 @@ public function testUploadWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->upload( - file: 'https://www.example.com/path/to-image.jpg', - fileName: 'fileName' - ); + $result = $this->client->files->upload(file: 'file', fileName: 'fileName'); $this->assertTrue(true); // @phpstan-ignore-line } From aba7242684bdef5c8926ef4f1e7b0909650cbf17 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 3 Sep 2025 02:30:13 +0000 Subject: [PATCH 012/193] chore(internal): refactor base client internals --- src/Core/BaseClient.php | 88 +++++++++++++++++++++++++++++----- src/Core/Concerns/SdkModel.php | 2 +- 2 files changed, 78 insertions(+), 12 deletions(-) diff --git a/src/Core/BaseClient.php b/src/Core/BaseClient.php index d0a5c00a..f3229494 100644 --- a/src/Core/BaseClient.php +++ b/src/Core/BaseClient.php @@ -8,8 +8,10 @@ use ImageKit\Core\Contracts\BaseStream; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Exceptions\APIConnectionException; use ImageKit\Core\Exceptions\APIStatusException; use ImageKit\RequestOptions; +use Psr\Http\Client\ClientExceptionInterface; use Psr\Http\Client\ClientInterface; use Psr\Http\Message\RequestFactoryInterface; use Psr\Http\Message\RequestInterface; @@ -41,7 +43,7 @@ public function __construct( string $baseUrl, protected RequestOptions $options = new RequestOptions, ) { - assert(null !== $this->options->uriFactory); + assert(!is_null($this->options->uriFactory)); $this->baseUrl = $this->options->uriFactory->createUri($baseUrl); } @@ -67,7 +69,7 @@ public function request( // @phpstan-ignore-next-line [$req, $opts] = $this->buildRequest(method: $method, path: $path, query: $query, headers: $headers, body: $body, opts: $options); ['method' => $method, 'path' => $uri, 'headers' => $headers] = $req; - assert(null !== $opts->requestFactory); + assert(!is_null($opts->requestFactory)); $request = $opts->requestFactory->createRequest($method, uri: $uri); $request = Util::withSetHeaders($request, headers: $headers); @@ -170,7 +172,7 @@ protected function followRedirect( ): RequestInterface { $location = $rsp->getHeaderLine('Location'); if (!$location) { - throw new \RuntimeException('Redirection without Location header'); + throw new APIConnectionException($req, message: 'Redirection without Location header'); } $uri = Util::joinUri($req->getUri(), path: $location); @@ -178,6 +180,55 @@ protected function followRedirect( return $req->withUri($uri); } + /** + * @internal + */ + protected function shouldRetry( + RequestOptions $opts, + int $retryCount, + ?ResponseInterface $rsp + ): bool { + if ($retryCount >= $opts->maxRetries) { + return false; + } + + $code = $rsp?->getStatusCode(); + if (408 == $code || 409 == $code || 429 == $code || $code >= 500) { + return true; + } + + return false; + } + + /** + * @internal + */ + protected function retryDelay( + RequestOptions $opts, + int $retryCount, + ?ResponseInterface $rsp + ): float { + if (!empty($header = $rsp?->getHeaderLine('retry-after'))) { + if (is_numeric($header)) { + return floatval($header); + } + + try { + $date = new \DateTimeImmutable($header); + $span = time() - $date->getTimestamp(); + + return max(0.0, $span); + } catch (\DateMalformedStringException) { + } + } + + $scale = $retryCount ** 2; + $jitter = 1 - (0.25 * mt_rand() / mt_getrandmax()); + $naive = $opts->initialRetryDelay * $scale * $jitter; + + return max(0.0, min($naive, $opts->maxRetryDelay)); + } + /** * @internal * @@ -194,12 +245,23 @@ protected function sendRequest( assert(null !== $opts->streamFactory && null !== $opts->transporter); $req = Util::withSetBody($opts->streamFactory, req: $req, body: $data); - $rsp = $opts->transporter->sendRequest($req); - $code = $rsp->getStatusCode(); + + $rsp = null; + $err = null; + + try { + $rsp = $opts->transporter->sendRequest($req); + } catch (ClientExceptionInterface $e) { + $err = $e; + } + + $code = $rsp?->getStatusCode(); if ($code >= 300 && $code < 400) { + assert(!is_null($rsp)); + if ($redirectCount >= 20) { - throw new \RuntimeException('Maximum redirects exceeded'); + throw new APIConnectionException($req, message: 'Maximum redirects exceeded'); } $req = $this->followRedirect($rsp, req: $req); @@ -207,12 +269,16 @@ protected function sendRequest( return $this->sendRequest($opts, req: $req, data: $data, retryCount: $retryCount, redirectCount: ++$redirectCount); } - if ($code >= 400 && $code < 500) { - throw APIStatusException::from(request: $req, response: $rsp); - } + if ($code >= 400 || is_null($rsp)) { + if ($this->shouldRetry($opts, retryCount: $retryCount, rsp: $rsp)) { + $exn = is_null($rsp) ? new APIConnectionException($req, previous: $err) : APIStatusException::from(request: $req, response: $rsp); + + throw $exn; + } - if ($code >= 500 && $retryCount < $opts->maxRetries) { - usleep((int) $opts->initialRetryDelay); + $seconds = $this->retryDelay($opts, retryCount: $redirectCount, rsp: $rsp); + $floor = floor($seconds); + time_nanosleep((int) $floor, nanoseconds: (int) ($seconds - $floor) * 10 ** 9); return $this->sendRequest($opts, req: $req, data: $data, retryCount: ++$retryCount, redirectCount: $redirectCount); } diff --git a/src/Core/Concerns/SdkModel.php b/src/Core/Concerns/SdkModel.php index da86c0ad..35f52cf4 100644 --- a/src/Core/Concerns/SdkModel.php +++ b/src/Core/Concerns/SdkModel.php @@ -125,7 +125,7 @@ public function offsetExists(mixed $offset): bool return true; } - $property = self::$converter->properties[$offset]->property ?? new \ReflectionProperty($this, property: $offset); + $property = self::$converter->properties[$offset]->property; return $property->isInitialized($this); } From 79f9906770fee9602f9b1ed6397b5b00f015bcd2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 3 Sep 2025 11:41:15 +0000 Subject: [PATCH 013/193] feat(api): manual updates --- .stats.yml | 4 ++-- README.md | 12 ++++++++---- src/Core/ServiceContracts/FilesContract.php | 9 ++------- src/Core/Services/FilesService.php | 9 ++------- src/Files/FileUploadParams.php | 18 ++++-------------- tests/Services/FilesTest.php | 10 ++++++++-- 6 files changed, 26 insertions(+), 36 deletions(-) diff --git a/.stats.yml b/.stats.yml index cfcbd7f7..db7d8f1e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-667f7f4988b44bc587d6eb9960ff5c8326e9f7e9b072f3f724f9f54166eff8b1.yml -openapi_spec_hash: f2081864a4abee0480e5ff991b4c936a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-9ae7b43dcfd6208ca37c32c887630ae186ec338bcdd36902b6fe5d1cc66459dc.yml +openapi_spec_hash: 25fb64c067e64bcff6eaaabda26de397 config_hash: 70f9408b8d1dfbcf262a20d6eed50e1c diff --git a/README.md b/README.md index 0325e391..1263fdc0 100644 --- a/README.md +++ b/README.md @@ -52,7 +52,9 @@ $client = new Client( password: getenv("OPTIONAL_IMAGEKIT_IGNORES_THIS") ?: "do_not_set", ); -$response = $client->files->upload(file: 'file', fileName: "file-name.jpg"); +$response = $client->files->upload( + file: "https://www.example.com/public-url.jpg", fileName: "file-name.jpg" +); var_dump($response->videoCodec); ``` @@ -74,7 +76,9 @@ When the library is unable to connect to the API, or if the API returns a non-su use ImageKit\Core\Exceptions\APIConnectionException; try { - $response = $client->files->upload(file: 'file', fileName: "file-name.jpg"); + $response = $client->files->upload( + file: "https://www.example.com/public-url.jpg", fileName: "file-name.jpg" + ); } catch (APIConnectionException $e) { echo "The server could not be reached", PHP_EOL; var_dump($e->getPrevious()); @@ -122,7 +126,7 @@ $client = new Client(maxRetries: 0); // Or, configure per-request: $result = $client->files->upload( - file: 'file', + file: "https://www.example.com/public-url.jpg", fileName: "file-name.jpg", requestOptions: RequestOptions::with(maxRetries: 5), ); @@ -144,7 +148,7 @@ Note: the `extra*` parameters of the same name overrides the documented paramete use ImageKit\RequestOptions; $response = $client->files->upload( - file: 'file', + file: "https://www.example.com/public-url.jpg", fileName: "file-name.jpg", requestOptions: RequestOptions::with( extraQueryParams: ["my_query_parameter" => "value"], diff --git a/src/Core/ServiceContracts/FilesContract.php b/src/Core/ServiceContracts/FilesContract.php index c698af13..918e01b4 100644 --- a/src/Core/ServiceContracts/FilesContract.php +++ b/src/Core/ServiceContracts/FilesContract.php @@ -104,13 +104,8 @@ public function rename( /** * @api * - * @param string $file The API accepts any of the following: - * - * - **Binary data** – send the raw bytes as `multipart/form-data`. - * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. - * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. - * - * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + * @param string $file The URL of the file to upload. A publicly reachable URL that ImageKit servers can fetch. + * The server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. * @param string $fileName The name with which the file has to be uploaded. * The file name can contain: * diff --git a/src/Core/Services/FilesService.php b/src/Core/Services/FilesService.php index 5eb5ecbf..b6566ce5 100644 --- a/src/Core/Services/FilesService.php +++ b/src/Core/Services/FilesService.php @@ -257,13 +257,8 @@ public function rename( * - A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more. * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. * - * @param string $file The API accepts any of the following: - * - * - **Binary data** – send the raw bytes as `multipart/form-data`. - * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. - * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. - * - * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + * @param string $file The URL of the file to upload. A publicly reachable URL that ImageKit servers can fetch. + * The server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. * @param string $fileName The name with which the file has to be uploaded. * The file name can contain: * diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index f16f74cd..d955b8f1 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -66,13 +66,8 @@ final class FileUploadParams implements BaseModel use SdkParams; /** - * The API accepts any of the following: - * - * - **Binary data** – send the raw bytes as `multipart/form-data`. - * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. - * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. - * - * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + * The URL of the file to upload. A publicly reachable URL that ImageKit servers can fetch. + * The server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. */ #[Api] public string $file; @@ -344,13 +339,8 @@ public static function with( } /** - * The API accepts any of the following: - * - * - **Binary data** – send the raw bytes as `multipart/form-data`. - * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. - * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. - * - * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + * The URL of the file to upload. A publicly reachable URL that ImageKit servers can fetch. + * The server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. */ public function withFile(string $file): self { diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index 457d84a4..c3e46399 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -163,7 +163,10 @@ public function testUpload(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->upload(file: 'file', fileName: 'fileName'); + $result = $this->client->files->upload( + file: 'https://example.com', + fileName: 'fileName' + ); $this->assertTrue(true); // @phpstan-ignore-line } @@ -175,7 +178,10 @@ public function testUploadWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->upload(file: 'file', fileName: 'fileName'); + $result = $this->client->files->upload( + file: 'https://example.com', + fileName: 'fileName' + ); $this->assertTrue(true); // @phpstan-ignore-line } From e5c508410d385f8eff5f39db8e973c34ea78ef0d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 3 Sep 2025 11:45:31 +0000 Subject: [PATCH 014/193] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index db7d8f1e..f8166f44 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-9ae7b43dcfd6208ca37c32c887630ae186ec338bcdd36902b6fe5d1cc66459dc.yml -openapi_spec_hash: 25fb64c067e64bcff6eaaabda26de397 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-5ce78cb448cc4520f5fbcc753452e0237b50a4bf64902e0548a8ad24bbdc82cf.yml +openapi_spec_hash: fd8ac4c2cdddc3d3a0b0c81be6a9edfe config_hash: 70f9408b8d1dfbcf262a20d6eed50e1c From c959bcf6d18e0f078fbed9d50c05d6feb1d81a42 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 02:27:51 +0000 Subject: [PATCH 015/193] chore: document parameter object usage --- src/Accounts/Origins/OriginCreateParams.php | 11 +++++++++++ src/Accounts/Origins/OriginUpdateParams.php | 11 +++++++++++ src/Accounts/URLEndpoints/URLEndpointCreateParams.php | 11 +++++++++++ src/Accounts/URLEndpoints/URLEndpointUpdateParams.php | 11 +++++++++++ src/Accounts/Usage/UsageGetParams.php | 11 +++++++++++ src/Assets/AssetListParams.php | 11 +++++++++++ src/Beta/V2/Files/FileUploadParams.php | 11 +++++++++++ src/Cache/Invalidation/InvalidationCreateParams.php | 11 +++++++++++ .../CustomMetadataFieldCreateParams.php | 11 +++++++++++ .../CustomMetadataFieldListParams.php | 11 +++++++++++ .../CustomMetadataFieldUpdateParams.php | 11 +++++++++++ src/Files/Bulk/BulkAddTagsParams.php | 11 +++++++++++ src/Files/Bulk/BulkDeleteParams.php | 11 +++++++++++ src/Files/Bulk/BulkRemoveAITagsParams.php | 11 +++++++++++ src/Files/Bulk/BulkRemoveTagsParams.php | 11 +++++++++++ src/Files/FileCopyParams.php | 11 +++++++++++ src/Files/FileMoveParams.php | 11 +++++++++++ src/Files/FileRenameParams.php | 11 +++++++++++ src/Files/FileUpdateParams.php | 11 +++++++++++ src/Files/FileUploadParams.php | 11 +++++++++++ src/Files/Metadata/MetadataGetFromURLParams.php | 11 +++++++++++ src/Files/Versions/VersionDeleteParams.php | 11 +++++++++++ src/Files/Versions/VersionGetParams.php | 11 +++++++++++ src/Files/Versions/VersionRestoreParams.php | 11 +++++++++++ src/Folders/FolderCopyParams.php | 11 +++++++++++ src/Folders/FolderCreateParams.php | 11 +++++++++++ src/Folders/FolderDeleteParams.php | 11 +++++++++++ src/Folders/FolderMoveParams.php | 11 +++++++++++ src/Folders/FolderRenameParams.php | 11 +++++++++++ 29 files changed, 319 insertions(+) diff --git a/src/Accounts/Origins/OriginCreateParams.php b/src/Accounts/Origins/OriginCreateParams.php index 1ba42b68..9cd5822a 100644 --- a/src/Accounts/Origins/OriginCreateParams.php +++ b/src/Accounts/Origins/OriginCreateParams.php @@ -18,9 +18,20 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new OriginCreateParams); // set properties as needed + * $client->accounts.origins->create(...$params->toArray()); + * ``` * **Note:** This API is currently in beta. * Creates a new origin and returns the origin object. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->accounts.origins->create(...$params->toArray());` + * * @see ImageKit\Accounts\Origins->create * * @phpstan-type origin_create_params = array{ diff --git a/src/Accounts/Origins/OriginUpdateParams.php b/src/Accounts/Origins/OriginUpdateParams.php index bbcec186..e42e6c03 100644 --- a/src/Accounts/Origins/OriginUpdateParams.php +++ b/src/Accounts/Origins/OriginUpdateParams.php @@ -18,9 +18,20 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new OriginUpdateParams); // set properties as needed + * $client->accounts.origins->update(...$params->toArray()); + * ``` * **Note:** This API is currently in beta. * Updates the origin identified by `id` and returns the updated origin object. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->accounts.origins->update(...$params->toArray());` + * * @see ImageKit\Accounts\Origins->update * * @phpstan-type origin_update_params = array{ diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php index 9afd5302..050e4196 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php @@ -14,9 +14,20 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new URLEndpointCreateParams); // set properties as needed + * $client->accounts.urlEndpoints->create(...$params->toArray()); + * ``` * **Note:** This API is currently in beta. * Creates a new URL‑endpoint and returns the resulting object. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->accounts.urlEndpoints->create(...$params->toArray());` + * * @see ImageKit\Accounts\URLEndpoints->create * * @phpstan-type url_endpoint_create_params = array{ diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php index ff6de86b..7bcaea5c 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php @@ -14,9 +14,20 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new URLEndpointUpdateParams); // set properties as needed + * $client->accounts.urlEndpoints->update(...$params->toArray()); + * ``` * **Note:** This API is currently in beta. * Updates the URL‑endpoint identified by `id` and returns the updated object. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->accounts.urlEndpoints->update(...$params->toArray());` + * * @see ImageKit\Accounts\URLEndpoints->update * * @phpstan-type url_endpoint_update_params = array{ diff --git a/src/Accounts/Usage/UsageGetParams.php b/src/Accounts/Usage/UsageGetParams.php index b2a3c202..ebd52bda 100644 --- a/src/Accounts/Usage/UsageGetParams.php +++ b/src/Accounts/Usage/UsageGetParams.php @@ -10,8 +10,19 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new UsageGetParams); // set properties as needed + * $client->accounts.usage->get(...$params->toArray()); + * ``` * Get the account usage information between two dates. Note that the API response includes data from the start date while excluding data from the end date. In other words, the data covers the period starting from the specified start date up to, but not including, the end date. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->accounts.usage->get(...$params->toArray());` + * * @see ImageKit\Accounts\Usage->get * * @phpstan-type usage_get_params = array{ diff --git a/src/Assets/AssetListParams.php b/src/Assets/AssetListParams.php index b24fabb4..f788cfbd 100644 --- a/src/Assets/AssetListParams.php +++ b/src/Assets/AssetListParams.php @@ -13,8 +13,19 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new AssetListParams); // set properties as needed + * $client->assets->list(...$params->toArray()); + * ``` * This API can list all the uploaded files and folders in your ImageKit.io media library. In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and provide this generated string as the value of the `searchQuery`. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->assets->list(...$params->toArray());` + * * @see ImageKit\Assets->list * * @phpstan-type asset_list_params = array{ diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index cd83a4c0..f5742282 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -16,6 +16,12 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new FileUploadParams); // set properties as needed + * $client->beta.v2.files->upload(...$params->toArray()); + * ``` * The V2 API enhances security by verifying the entire payload using JWT. This API is in beta. * * ImageKit.io allows you to upload files directly from both the server and client sides. For server-side uploads, private API key authentication is used. For client-side uploads, generate a one-time `token` from your secure backend using private API. [Learn more](/docs/api-reference/upload-file/upload-file-v2#how-to-implement-secure-client-side-file-upload) about how to implement secure client-side file upload. @@ -31,6 +37,11 @@ * - A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more. * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->beta.v2.files->upload(...$params->toArray());` + * * @see ImageKit\Beta\V2\Files->upload * * @phpstan-type file_upload_params = array{ diff --git a/src/Cache/Invalidation/InvalidationCreateParams.php b/src/Cache/Invalidation/InvalidationCreateParams.php index ca1f5eeb..881250e3 100644 --- a/src/Cache/Invalidation/InvalidationCreateParams.php +++ b/src/Cache/Invalidation/InvalidationCreateParams.php @@ -10,8 +10,19 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new InvalidationCreateParams); // set properties as needed + * $client->cache.invalidation->create(...$params->toArray()); + * ``` * This API will purge CDN cache and ImageKit.io's internal cache for a file. Note: Purge cache is an asynchronous process and it may take some time to reflect the changes. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->cache.invalidation->create(...$params->toArray());` + * * @see ImageKit\Cache\Invalidation->create * * @phpstan-type invalidation_create_params = array{url: string} diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php index 5b8bc5a3..055c3d90 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php @@ -11,8 +11,19 @@ use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new CustomMetadataFieldCreateParams); // set properties as needed + * $client->customMetadataFields->create(...$params->toArray()); + * ``` * This API creates a new custom metadata field. Once a custom metadata field is created either through this API or using the dashboard UI, its value can be set on the assets. The value of a field for an asset can be set using the media library UI or programmatically through upload or update assets API. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->customMetadataFields->create(...$params->toArray());` + * * @see ImageKit\CustomMetadataFields->create * * @phpstan-type custom_metadata_field_create_params = array{ diff --git a/src/CustomMetadataFields/CustomMetadataFieldListParams.php b/src/CustomMetadataFields/CustomMetadataFieldListParams.php index 9e0ed855..852c124a 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldListParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldListParams.php @@ -10,8 +10,19 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new CustomMetadataFieldListParams); // set properties as needed + * $client->customMetadataFields->list(...$params->toArray()); + * ``` * This API returns the array of created custom metadata field objects. By default the API returns only non deleted field objects, but you can include deleted fields in the API response. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->customMetadataFields->list(...$params->toArray());` + * * @see ImageKit\CustomMetadataFields->list * * @phpstan-type custom_metadata_field_list_params = array{includeDeleted?: bool} diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php index 54fb7c37..0d72504d 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php @@ -11,8 +11,19 @@ use ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new CustomMetadataFieldUpdateParams); // set properties as needed + * $client->customMetadataFields->update(...$params->toArray()); + * ``` * This API updates the label or schema of an existing custom metadata field. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->customMetadataFields->update(...$params->toArray());` + * * @see ImageKit\CustomMetadataFields->update * * @phpstan-type custom_metadata_field_update_params = array{ diff --git a/src/Files/Bulk/BulkAddTagsParams.php b/src/Files/Bulk/BulkAddTagsParams.php index 53ffd749..6ce38baa 100644 --- a/src/Files/Bulk/BulkAddTagsParams.php +++ b/src/Files/Bulk/BulkAddTagsParams.php @@ -10,8 +10,19 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new BulkAddTagsParams); // set properties as needed + * $client->files.bulk->addTags(...$params->toArray()); + * ``` * This API adds tags to multiple files in bulk. A maximum of 50 files can be specified at a time. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->files.bulk->addTags(...$params->toArray());` + * * @see ImageKit\Files\Bulk->addTags * * @phpstan-type bulk_add_tags_params = array{ diff --git a/src/Files/Bulk/BulkDeleteParams.php b/src/Files/Bulk/BulkDeleteParams.php index c7b6e882..7898f84d 100644 --- a/src/Files/Bulk/BulkDeleteParams.php +++ b/src/Files/Bulk/BulkDeleteParams.php @@ -10,12 +10,23 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new BulkDeleteParams); // set properties as needed + * $client->files.bulk->delete(...$params->toArray()); + * ``` * This API deletes multiple files and all their file versions permanently. * * Note: If a file or specific transformation has been requested in the past, then the response is cached. Deleting a file does not purge the cache. You can purge the cache using purge cache API. * * A maximum of 100 files can be deleted at a time. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->files.bulk->delete(...$params->toArray());` + * * @see ImageKit\Files\Bulk->delete * * @phpstan-type bulk_delete_params = array{fileIDs: list} diff --git a/src/Files/Bulk/BulkRemoveAITagsParams.php b/src/Files/Bulk/BulkRemoveAITagsParams.php index 2fe76ca5..a5d9c1cb 100644 --- a/src/Files/Bulk/BulkRemoveAITagsParams.php +++ b/src/Files/Bulk/BulkRemoveAITagsParams.php @@ -10,8 +10,19 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new BulkRemoveAITagsParams); // set properties as needed + * $client->files.bulk->removeAITags(...$params->toArray()); + * ``` * This API removes AITags from multiple files in bulk. A maximum of 50 files can be specified at a time. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->files.bulk->removeAITags(...$params->toArray());` + * * @see ImageKit\Files\Bulk->removeAITags * * @phpstan-type bulk_remove_ai_tags_params = array{ diff --git a/src/Files/Bulk/BulkRemoveTagsParams.php b/src/Files/Bulk/BulkRemoveTagsParams.php index 678dc4ed..0f442e97 100644 --- a/src/Files/Bulk/BulkRemoveTagsParams.php +++ b/src/Files/Bulk/BulkRemoveTagsParams.php @@ -10,8 +10,19 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new BulkRemoveTagsParams); // set properties as needed + * $client->files.bulk->removeTags(...$params->toArray()); + * ``` * This API removes tags from multiple files in bulk. A maximum of 50 files can be specified at a time. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->files.bulk->removeTags(...$params->toArray());` + * * @see ImageKit\Files\Bulk->removeTags * * @phpstan-type bulk_remove_tags_params = array{ diff --git a/src/Files/FileCopyParams.php b/src/Files/FileCopyParams.php index fce0e5d8..2d2ae572 100644 --- a/src/Files/FileCopyParams.php +++ b/src/Files/FileCopyParams.php @@ -10,10 +10,21 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new FileCopyParams); // set properties as needed + * $client->files->copy(...$params->toArray()); + * ``` * This will copy a file from one folder to another. * * Note: If any file at the destination has the same name as the source file, then the source file and its versions (if `includeFileVersions` is set to true) will be appended to the destination file version history. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->files->copy(...$params->toArray());` + * * @see ImageKit\Files->copy * * @phpstan-type file_copy_params = array{ diff --git a/src/Files/FileMoveParams.php b/src/Files/FileMoveParams.php index 68c5a7a4..d9061fe0 100644 --- a/src/Files/FileMoveParams.php +++ b/src/Files/FileMoveParams.php @@ -10,10 +10,21 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new FileMoveParams); // set properties as needed + * $client->files->move(...$params->toArray()); + * ``` * This will move a file and all its versions from one folder to another. * * Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->files->move(...$params->toArray());` + * * @see ImageKit\Files->move * * @phpstan-type file_move_params = array{ diff --git a/src/Files/FileRenameParams.php b/src/Files/FileRenameParams.php index b41454d5..7ec02dea 100644 --- a/src/Files/FileRenameParams.php +++ b/src/Files/FileRenameParams.php @@ -10,10 +10,21 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new FileRenameParams); // set properties as needed + * $client->files->rename(...$params->toArray()); + * ``` * You can rename an already existing file in the media library using rename file API. This operation would rename all file versions of the file. * * Note: The old URLs will stop working. The file/file version URLs cached on CDN will continue to work unless a purge is requested. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->files->rename(...$params->toArray());` + * * @see ImageKit\Files->rename * * @phpstan-type file_rename_params = array{ diff --git a/src/Files/FileUpdateParams.php b/src/Files/FileUpdateParams.php index 6289a5c2..195b76da 100644 --- a/src/Files/FileUpdateParams.php +++ b/src/Files/FileUpdateParams.php @@ -12,8 +12,19 @@ use ImageKit\Files\FileUpdateParams\Update\UpdateFileDetails; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new FileUpdateParams); // set properties as needed + * $client->files->update(...$params->toArray()); + * ``` * This API updates the details or attributes of the current version of the file. You can update `tags`, `customCoordinates`, `customMetadata`, publication status, remove existing `AITags` and apply extensions using this API. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->files->update(...$params->toArray());` + * * @see ImageKit\Files->update * * @phpstan-type file_update_params = array{ diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index d955b8f1..aa14493c 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -16,6 +16,12 @@ use ImageKit\Files\FileUploadParams\Transformation; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new FileUploadParams); // set properties as needed + * $client->files->upload(...$params->toArray()); + * ``` * ImageKit.io allows you to upload files directly from both the server and client sides. For server-side uploads, private API key authentication is used. For client-side uploads, generate a one-time `token`, `signature`, and `expire` from your secure backend using private API. [Learn more](/docs/api-reference/upload-file/upload-file#how-to-implement-client-side-file-upload) about how to implement client-side file upload. * * The [V2 API](/docs/api-reference/upload-file/upload-file-v2) enhances security by verifying the entire payload using JWT. @@ -31,6 +37,11 @@ * - A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more. * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->files->upload(...$params->toArray());` + * * @see ImageKit\Files->upload * * @phpstan-type file_upload_params = array{ diff --git a/src/Files/Metadata/MetadataGetFromURLParams.php b/src/Files/Metadata/MetadataGetFromURLParams.php index d56164d9..cc871ebf 100644 --- a/src/Files/Metadata/MetadataGetFromURLParams.php +++ b/src/Files/Metadata/MetadataGetFromURLParams.php @@ -10,8 +10,19 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new MetadataGetFromURLParams); // set properties as needed + * $client->files.metadata->getFromURL(...$params->toArray()); + * ``` * Get image EXIF, pHash, and other metadata from ImageKit.io powered remote URL using this API. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->files.metadata->getFromURL(...$params->toArray());` + * * @see ImageKit\Files\Metadata->getFromURL * * @phpstan-type metadata_get_from_url_params = array{url: string} diff --git a/src/Files/Versions/VersionDeleteParams.php b/src/Files/Versions/VersionDeleteParams.php index a5c99a18..cb70f500 100644 --- a/src/Files/Versions/VersionDeleteParams.php +++ b/src/Files/Versions/VersionDeleteParams.php @@ -10,10 +10,21 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new VersionDeleteParams); // set properties as needed + * $client->files.versions->delete(...$params->toArray()); + * ``` * This API deletes a non-current file version permanently. The API returns an empty response. * * Note: If you want to delete all versions of a file, use the delete file API. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->files.versions->delete(...$params->toArray());` + * * @see ImageKit\Files\Versions->delete * * @phpstan-type version_delete_params = array{fileID: string} diff --git a/src/Files/Versions/VersionGetParams.php b/src/Files/Versions/VersionGetParams.php index e6d9ac37..d1cc4eb0 100644 --- a/src/Files/Versions/VersionGetParams.php +++ b/src/Files/Versions/VersionGetParams.php @@ -10,8 +10,19 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new VersionGetParams); // set properties as needed + * $client->files.versions->get(...$params->toArray()); + * ``` * This API returns an object with details or attributes of a file version. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->files.versions->get(...$params->toArray());` + * * @see ImageKit\Files\Versions->get * * @phpstan-type version_get_params = array{fileID: string} diff --git a/src/Files/Versions/VersionRestoreParams.php b/src/Files/Versions/VersionRestoreParams.php index e1deb729..30e9d03f 100644 --- a/src/Files/Versions/VersionRestoreParams.php +++ b/src/Files/Versions/VersionRestoreParams.php @@ -10,8 +10,19 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new VersionRestoreParams); // set properties as needed + * $client->files.versions->restore(...$params->toArray()); + * ``` * This API restores a file version as the current file version. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->files.versions->restore(...$params->toArray());` + * * @see ImageKit\Files\Versions->restore * * @phpstan-type version_restore_params = array{fileID: string} diff --git a/src/Folders/FolderCopyParams.php b/src/Folders/FolderCopyParams.php index c70ebbac..d1b48d1d 100644 --- a/src/Folders/FolderCopyParams.php +++ b/src/Folders/FolderCopyParams.php @@ -10,8 +10,19 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new FolderCopyParams); // set properties as needed + * $client->folders->copy(...$params->toArray()); + * ``` * This will copy one folder into another. The selected folder, its nested folders, files, and their versions (in `includeVersions` is set to true) are copied in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->folders->copy(...$params->toArray());` + * * @see ImageKit\Folders->copy * * @phpstan-type folder_copy_params = array{ diff --git a/src/Folders/FolderCreateParams.php b/src/Folders/FolderCreateParams.php index 7698adae..26230c90 100644 --- a/src/Folders/FolderCreateParams.php +++ b/src/Folders/FolderCreateParams.php @@ -10,8 +10,19 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new FolderCreateParams); // set properties as needed + * $client->folders->create(...$params->toArray()); + * ``` * This will create a new folder. You can specify the folder name and location of the parent folder where this new folder should be created. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->folders->create(...$params->toArray());` + * * @see ImageKit\Folders->create * * @phpstan-type folder_create_params = array{ diff --git a/src/Folders/FolderDeleteParams.php b/src/Folders/FolderDeleteParams.php index 0af429b0..b22108f9 100644 --- a/src/Folders/FolderDeleteParams.php +++ b/src/Folders/FolderDeleteParams.php @@ -10,8 +10,19 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new FolderDeleteParams); // set properties as needed + * $client->folders->delete(...$params->toArray()); + * ``` * This will delete a folder and all its contents permanently. The API returns an empty response. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->folders->delete(...$params->toArray());` + * * @see ImageKit\Folders->delete * * @phpstan-type folder_delete_params = array{folderPath: string} diff --git a/src/Folders/FolderMoveParams.php b/src/Folders/FolderMoveParams.php index f04be7df..d2819441 100644 --- a/src/Folders/FolderMoveParams.php +++ b/src/Folders/FolderMoveParams.php @@ -10,8 +10,19 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new FolderMoveParams); // set properties as needed + * $client->folders->move(...$params->toArray()); + * ``` * This will move one folder into another. The selected folder, its nested folders, files, and their versions are moved in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->folders->move(...$params->toArray());` + * * @see ImageKit\Folders->move * * @phpstan-type folder_move_params = array{ diff --git a/src/Folders/FolderRenameParams.php b/src/Folders/FolderRenameParams.php index e7260993..a6356be1 100644 --- a/src/Folders/FolderRenameParams.php +++ b/src/Folders/FolderRenameParams.php @@ -10,8 +10,19 @@ use ImageKit\Core\Contracts\BaseModel; /** + * An object containing the method's parameters. + * Example usage: + * ``` + * $params = (new FolderRenameParams); // set properties as needed + * $client->folders->rename(...$params->toArray()); + * ``` * This API allows you to rename an existing folder. The folder and all its nested assets and sub-folders will remain unchanged, but their paths will be updated to reflect the new folder name. * + * @method toArray() + * Returns the parameters as an associative array suitable for passing to the client method. + * + * `$client->folders->rename(...$params->toArray());` + * * @see ImageKit\Folders->rename * * @phpstan-type folder_rename_params = array{ From de13f687044f442b41ec1de7a72c2fd3ad27f1e1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 05:43:59 +0000 Subject: [PATCH 016/193] feat(api): manual updates --- .stats.yml | 4 ++-- README.md | 12 ++++-------- src/Core/ServiceContracts/FilesContract.php | 9 +++++++-- src/Core/Services/FilesService.php | 9 +++++++-- src/Files/FileUploadParams.php | 18 ++++++++++++++---- tests/Services/FilesTest.php | 10 ++-------- 6 files changed, 36 insertions(+), 26 deletions(-) diff --git a/.stats.yml b/.stats.yml index f8166f44..cfcbd7f7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-5ce78cb448cc4520f5fbcc753452e0237b50a4bf64902e0548a8ad24bbdc82cf.yml -openapi_spec_hash: fd8ac4c2cdddc3d3a0b0c81be6a9edfe +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-667f7f4988b44bc587d6eb9960ff5c8326e9f7e9b072f3f724f9f54166eff8b1.yml +openapi_spec_hash: f2081864a4abee0480e5ff991b4c936a config_hash: 70f9408b8d1dfbcf262a20d6eed50e1c diff --git a/README.md b/README.md index 1263fdc0..0325e391 100644 --- a/README.md +++ b/README.md @@ -52,9 +52,7 @@ $client = new Client( password: getenv("OPTIONAL_IMAGEKIT_IGNORES_THIS") ?: "do_not_set", ); -$response = $client->files->upload( - file: "https://www.example.com/public-url.jpg", fileName: "file-name.jpg" -); +$response = $client->files->upload(file: 'file', fileName: "file-name.jpg"); var_dump($response->videoCodec); ``` @@ -76,9 +74,7 @@ When the library is unable to connect to the API, or if the API returns a non-su use ImageKit\Core\Exceptions\APIConnectionException; try { - $response = $client->files->upload( - file: "https://www.example.com/public-url.jpg", fileName: "file-name.jpg" - ); + $response = $client->files->upload(file: 'file', fileName: "file-name.jpg"); } catch (APIConnectionException $e) { echo "The server could not be reached", PHP_EOL; var_dump($e->getPrevious()); @@ -126,7 +122,7 @@ $client = new Client(maxRetries: 0); // Or, configure per-request: $result = $client->files->upload( - file: "https://www.example.com/public-url.jpg", + file: 'file', fileName: "file-name.jpg", requestOptions: RequestOptions::with(maxRetries: 5), ); @@ -148,7 +144,7 @@ Note: the `extra*` parameters of the same name overrides the documented paramete use ImageKit\RequestOptions; $response = $client->files->upload( - file: "https://www.example.com/public-url.jpg", + file: 'file', fileName: "file-name.jpg", requestOptions: RequestOptions::with( extraQueryParams: ["my_query_parameter" => "value"], diff --git a/src/Core/ServiceContracts/FilesContract.php b/src/Core/ServiceContracts/FilesContract.php index 918e01b4..c698af13 100644 --- a/src/Core/ServiceContracts/FilesContract.php +++ b/src/Core/ServiceContracts/FilesContract.php @@ -104,8 +104,13 @@ public function rename( /** * @api * - * @param string $file The URL of the file to upload. A publicly reachable URL that ImageKit servers can fetch. - * The server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + * @param string $file The API accepts any of the following: + * + * - **Binary data** – send the raw bytes as `multipart/form-data`. + * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. + * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. + * + * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. * @param string $fileName The name with which the file has to be uploaded. * The file name can contain: * diff --git a/src/Core/Services/FilesService.php b/src/Core/Services/FilesService.php index b6566ce5..5eb5ecbf 100644 --- a/src/Core/Services/FilesService.php +++ b/src/Core/Services/FilesService.php @@ -257,8 +257,13 @@ public function rename( * - A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more. * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. * - * @param string $file The URL of the file to upload. A publicly reachable URL that ImageKit servers can fetch. - * The server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + * @param string $file The API accepts any of the following: + * + * - **Binary data** – send the raw bytes as `multipart/form-data`. + * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. + * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. + * + * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. * @param string $fileName The name with which the file has to be uploaded. * The file name can contain: * diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index aa14493c..50ba7ed6 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -77,8 +77,13 @@ final class FileUploadParams implements BaseModel use SdkParams; /** - * The URL of the file to upload. A publicly reachable URL that ImageKit servers can fetch. - * The server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + * The API accepts any of the following: + * + * - **Binary data** – send the raw bytes as `multipart/form-data`. + * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. + * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. + * + * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. */ #[Api] public string $file; @@ -350,8 +355,13 @@ public static function with( } /** - * The URL of the file to upload. A publicly reachable URL that ImageKit servers can fetch. - * The server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + * The API accepts any of the following: + * + * - **Binary data** – send the raw bytes as `multipart/form-data`. + * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. + * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. + * + * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. */ public function withFile(string $file): self { diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index c3e46399..457d84a4 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -163,10 +163,7 @@ public function testUpload(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->upload( - file: 'https://example.com', - fileName: 'fileName' - ); + $result = $this->client->files->upload(file: 'file', fileName: 'fileName'); $this->assertTrue(true); // @phpstan-ignore-line } @@ -178,10 +175,7 @@ public function testUploadWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->upload( - file: 'https://example.com', - fileName: 'fileName' - ); + $result = $this->client->files->upload(file: 'file', fileName: 'fileName'); $this->assertTrue(true); // @phpstan-ignore-line } From 2361086b4a3578fc04ac20da138d1ebcf3f92852 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 06:00:13 +0000 Subject: [PATCH 017/193] feat(api): manual updates --- .stats.yml | 4 ++-- src/Beta/V2/Files/FileUploadParams.php | 4 ++-- src/Core/ServiceContracts/Beta/V2/FilesContract.php | 2 +- src/Core/ServiceContracts/FilesContract.php | 2 +- src/Core/Services/Beta/V2/FilesService.php | 2 +- src/Core/Services/FilesService.php | 2 +- src/Files/FileUploadParams.php | 4 ++-- 7 files changed, 10 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index cfcbd7f7..5908457a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-667f7f4988b44bc587d6eb9960ff5c8326e9f7e9b072f3f724f9f54166eff8b1.yml -openapi_spec_hash: f2081864a4abee0480e5ff991b4c936a +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-0470196862abd722b09f1af798d6f2bcbdeba0f82d1162f57c287b1a43233531.yml +openapi_spec_hash: 043dd7c67d741d0034b86f2fc0bce072 config_hash: 70f9408b8d1dfbcf262a20d6eed50e1c diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index f5742282..dde14059 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -134,7 +134,7 @@ final class FileUploadParams implements BaseModel public ?string $description; /** - * Array of extensions to be applied to the image. Each extension can be configured with specific parameters based on the extension type. + * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * * @var list|null $extensions */ @@ -411,7 +411,7 @@ public function withDescription(string $description): self } /** - * Array of extensions to be applied to the image. Each extension can be configured with specific parameters based on the extension type. + * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * * @param list $extensions */ diff --git a/src/Core/ServiceContracts/Beta/V2/FilesContract.php b/src/Core/ServiceContracts/Beta/V2/FilesContract.php index cf4f4f19..ae026055 100644 --- a/src/Core/ServiceContracts/Beta/V2/FilesContract.php +++ b/src/Core/ServiceContracts/Beta/V2/FilesContract.php @@ -38,7 +38,7 @@ interface FilesContract * @param array $customMetadata JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. * @param string $description optional text to describe the contents of the file - * @param list $extensions Array of extensions to be applied to the image. Each extension can be configured with specific parameters based on the extension type. + * @param list $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * @param string $folder The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. Using multiple `/` creates a nested folder. * @param bool $isPrivateFile Whether to mark the file as private or not. * diff --git a/src/Core/ServiceContracts/FilesContract.php b/src/Core/ServiceContracts/FilesContract.php index c698af13..00aca4d8 100644 --- a/src/Core/ServiceContracts/FilesContract.php +++ b/src/Core/ServiceContracts/FilesContract.php @@ -132,7 +132,7 @@ public function rename( * mixed,> $customMetadata JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. * @param string $description optional text to describe the contents of the file * @param int $expire The time until your signature is valid. It must be a [Unix time](https://en.wikipedia.org/wiki/Unix_time) in less than 1 hour into the future. It should be in seconds. This field is only required for authentication when uploading a file from the client side. - * @param list $extensions Array of extensions to be applied to the image. Each extension can be configured with specific parameters based on the extension type. + * @param list $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * @param string $folder The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. * * The folder name can contain: diff --git a/src/Core/Services/Beta/V2/FilesService.php b/src/Core/Services/Beta/V2/FilesService.php index 9cb9ef2f..305ac939 100644 --- a/src/Core/Services/Beta/V2/FilesService.php +++ b/src/Core/Services/Beta/V2/FilesService.php @@ -61,7 +61,7 @@ public function __construct(private Client $client) {} * @param array $customMetadata JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. * @param string $description optional text to describe the contents of the file - * @param list $extensions Array of extensions to be applied to the image. Each extension can be configured with specific parameters based on the extension type. + * @param list $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * @param string $folder The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. Using multiple `/` creates a nested folder. * @param bool $isPrivateFile Whether to mark the file as private or not. * diff --git a/src/Core/Services/FilesService.php b/src/Core/Services/FilesService.php index 5eb5ecbf..c6010e84 100644 --- a/src/Core/Services/FilesService.php +++ b/src/Core/Services/FilesService.php @@ -285,7 +285,7 @@ public function rename( * mixed,> $customMetadata JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. * @param string $description optional text to describe the contents of the file * @param int $expire The time until your signature is valid. It must be a [Unix time](https://en.wikipedia.org/wiki/Unix_time) in less than 1 hour into the future. It should be in seconds. This field is only required for authentication when uploading a file from the client side. - * @param list $extensions Array of extensions to be applied to the image. Each extension can be configured with specific parameters based on the extension type. + * @param list $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * @param string $folder The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. * * The folder name can contain: diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index 50ba7ed6..26c31c0c 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -146,7 +146,7 @@ final class FileUploadParams implements BaseModel public ?int $expire; /** - * Array of extensions to be applied to the image. Each extension can be configured with specific parameters based on the extension type. + * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * * @var list|null $extensions */ @@ -464,7 +464,7 @@ public function withExpire(int $expire): self } /** - * Array of extensions to be applied to the image. Each extension can be configured with specific parameters based on the extension type. + * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * * @param list $extensions */ From e5c142868fae36f9f88f4142b98b47a1abbbaa1c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 06:03:21 +0000 Subject: [PATCH 018/193] feat(api): manual updates --- .stats.yml | 2 +- src/Beta/V2/Files/FileUploadParams.php | 10 +- .../V2/Files/FileUploadParams/Extension.php | 35 ------ .../Extension/AIAutoDescription.php | 39 ------ .../Extension/AutoTaggingExtension.php | 119 ------------------ .../Extension/AutoTaggingExtension/Name.php | 20 --- .../FileUploadParams/Extension/RemoveBg.php | 55 -------- .../Extension/RemoveBg/Options.php | 117 ----------------- .../Beta/V2/FilesContract.php | 6 +- src/Core/ServiceContracts/FilesContract.php | 6 +- src/Core/Services/Beta/V2/FilesService.php | 6 +- src/Core/Services/FilesService.php | 6 +- .../Extension.php => ExtensionItem.php} | 10 +- .../AIAutoDescription.php | 2 +- .../AutoTaggingExtension.php | 4 +- .../AutoTaggingExtension/Name.php | 2 +- .../Extension => ExtensionItem}/RemoveBg.php | 4 +- .../RemoveBg/Options.php | 2 +- .../Update/UpdateFileDetails.php | 10 +- .../Update/UpdateFileDetails/Extension.php | 35 ------ .../Extension/AIAutoDescription.php | 39 ------ .../Extension/AutoTaggingExtension.php | 119 ------------------ .../Extension/AutoTaggingExtension/Name.php | 20 --- .../UpdateFileDetails/Extension/RemoveBg.php | 55 -------- .../Extension/RemoveBg/Options.php | 117 ----------------- src/Files/FileUploadParams.php | 10 +- 26 files changed, 40 insertions(+), 810 deletions(-) delete mode 100644 src/Beta/V2/Files/FileUploadParams/Extension.php delete mode 100644 src/Beta/V2/Files/FileUploadParams/Extension/AIAutoDescription.php delete mode 100644 src/Beta/V2/Files/FileUploadParams/Extension/AutoTaggingExtension.php delete mode 100644 src/Beta/V2/Files/FileUploadParams/Extension/AutoTaggingExtension/Name.php delete mode 100644 src/Beta/V2/Files/FileUploadParams/Extension/RemoveBg.php delete mode 100644 src/Beta/V2/Files/FileUploadParams/Extension/RemoveBg/Options.php rename src/{Files/FileUploadParams/Extension.php => ExtensionItem.php} (69%) rename src/{Files/FileUploadParams/Extension => ExtensionItem}/AIAutoDescription.php (93%) rename src/{Files/FileUploadParams/Extension => ExtensionItem}/AutoTaggingExtension.php (95%) rename src/{Files/FileUploadParams/Extension => ExtensionItem}/AutoTaggingExtension/Name.php (83%) rename src/{Files/FileUploadParams/Extension => ExtensionItem}/RemoveBg.php (90%) rename src/{Files/FileUploadParams/Extension => ExtensionItem}/RemoveBg/Options.php (98%) delete mode 100644 src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension.php delete mode 100644 src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/AIAutoDescription.php delete mode 100644 src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/AutoTaggingExtension.php delete mode 100644 src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/AutoTaggingExtension/Name.php delete mode 100644 src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/RemoveBg.php delete mode 100644 src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/RemoveBg/Options.php diff --git a/.stats.yml b/.stats.yml index 5908457a..2dc65d21 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-0470196862abd722b09f1af798d6f2bcbdeba0f82d1162f57c287b1a43233531.yml openapi_spec_hash: 043dd7c67d741d0034b86f2fc0bce072 -config_hash: 70f9408b8d1dfbcf262a20d6eed50e1c +config_hash: da949a1217f48ac01676eab81ca9d1b1 diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index dde14059..d9c0c919 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -4,16 +4,16 @@ namespace ImageKit\Beta\V2\Files; -use ImageKit\Beta\V2\Files\FileUploadParams\Extension; -use ImageKit\Beta\V2\Files\FileUploadParams\Extension\AIAutoDescription; -use ImageKit\Beta\V2\Files\FileUploadParams\Extension\AutoTaggingExtension; -use ImageKit\Beta\V2\Files\FileUploadParams\Extension\RemoveBg; use ImageKit\Beta\V2\Files\FileUploadParams\ResponseField; use ImageKit\Beta\V2\Files\FileUploadParams\Transformation; use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Concerns\SdkParams; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionItem; +use ImageKit\ExtensionItem\AIAutoDescription; +use ImageKit\ExtensionItem\AutoTaggingExtension; +use ImageKit\ExtensionItem\RemoveBg; /** * An object containing the method's parameters. @@ -138,7 +138,7 @@ final class FileUploadParams implements BaseModel * * @var list|null $extensions */ - #[Api(list: Extension::class, optional: true)] + #[Api(list: ExtensionItem::class, optional: true)] public ?array $extensions; /** diff --git a/src/Beta/V2/Files/FileUploadParams/Extension.php b/src/Beta/V2/Files/FileUploadParams/Extension.php deleted file mode 100644 index fa3874f8..00000000 --- a/src/Beta/V2/Files/FileUploadParams/Extension.php +++ /dev/null @@ -1,35 +0,0 @@ -|array - */ - public static function variants(): array - { - return [ - AutoTaggingExtension::class, - 'remove-bg' => RemoveBg::class, - 'ai-auto-description' => AIAutoDescription::class, - ]; - } -} diff --git a/src/Beta/V2/Files/FileUploadParams/Extension/AIAutoDescription.php b/src/Beta/V2/Files/FileUploadParams/Extension/AIAutoDescription.php deleted file mode 100644 index 0f4d8b65..00000000 --- a/src/Beta/V2/Files/FileUploadParams/Extension/AIAutoDescription.php +++ /dev/null @@ -1,39 +0,0 @@ - */ - use SdkModel; - - /** - * Specifies the auto description extension. - */ - #[Api] - public string $name = 'ai-auto-description'; - - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - */ - public static function with(): self - { - return new self; - } -} diff --git a/src/Beta/V2/Files/FileUploadParams/Extension/AutoTaggingExtension.php b/src/Beta/V2/Files/FileUploadParams/Extension/AutoTaggingExtension.php deleted file mode 100644 index 2d9ba10c..00000000 --- a/src/Beta/V2/Files/FileUploadParams/Extension/AutoTaggingExtension.php +++ /dev/null @@ -1,119 +0,0 @@ - */ - use SdkModel; - - /** - * Maximum number of tags to attach to the asset. - */ - #[Api] - public int $maxTags; - - /** - * Minimum confidence level for tags to be considered valid. - */ - #[Api] - public int $minConfidence; - - /** - * Specifies the auto-tagging extension used. - * - * @var Name::* $name - */ - #[Api(enum: Name::class)] - public string $name; - - /** - * `new AutoTaggingExtension()` is missing required properties by the API. - * - * To enforce required parameters use - * ``` - * AutoTaggingExtension::with(maxTags: ..., minConfidence: ..., name: ...) - * ``` - * - * Otherwise ensure the following setters are called - * - * ``` - * (new AutoTaggingExtension) - * ->withMaxTags(...) - * ->withMinConfidence(...) - * ->withName(...) - * ``` - */ - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - * - * @param Name::* $name - */ - public static function with( - int $maxTags, - int $minConfidence, - string $name - ): self { - $obj = new self; - - $obj->maxTags = $maxTags; - $obj->minConfidence = $minConfidence; - $obj->name = $name; - - return $obj; - } - - /** - * Maximum number of tags to attach to the asset. - */ - public function withMaxTags(int $maxTags): self - { - $obj = clone $this; - $obj->maxTags = $maxTags; - - return $obj; - } - - /** - * Minimum confidence level for tags to be considered valid. - */ - public function withMinConfidence(int $minConfidence): self - { - $obj = clone $this; - $obj->minConfidence = $minConfidence; - - return $obj; - } - - /** - * Specifies the auto-tagging extension used. - * - * @param Name::* $name - */ - public function withName(string $name): self - { - $obj = clone $this; - $obj->name = $name; - - return $obj; - } -} diff --git a/src/Beta/V2/Files/FileUploadParams/Extension/AutoTaggingExtension/Name.php b/src/Beta/V2/Files/FileUploadParams/Extension/AutoTaggingExtension/Name.php deleted file mode 100644 index 7ad64d68..00000000 --- a/src/Beta/V2/Files/FileUploadParams/Extension/AutoTaggingExtension/Name.php +++ /dev/null @@ -1,20 +0,0 @@ - */ - use SdkModel; - - /** - * Specifies the background removal extension. - */ - #[Api] - public string $name = 'remove-bg'; - - #[Api(optional: true)] - public ?Options $options; - - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - */ - public static function with(?Options $options = null): self - { - $obj = new self; - - null !== $options && $obj->options = $options; - - return $obj; - } - - public function withOptions(Options $options): self - { - $obj = clone $this; - $obj->options = $options; - - return $obj; - } -} diff --git a/src/Beta/V2/Files/FileUploadParams/Extension/RemoveBg/Options.php b/src/Beta/V2/Files/FileUploadParams/Extension/RemoveBg/Options.php deleted file mode 100644 index 94bf0352..00000000 --- a/src/Beta/V2/Files/FileUploadParams/Extension/RemoveBg/Options.php +++ /dev/null @@ -1,117 +0,0 @@ - */ - use SdkModel; - - /** - * Whether to add an artificial shadow to the result. Default is false. Note: Adding shadows is currently only supported for car photos. - */ - #[Api('add_shadow', optional: true)] - public ?bool $addShadow; - - /** - * Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or color name (e.g., "green"). If this parameter is set, `bg_image_url` must be empty. - */ - #[Api('bg_color', optional: true)] - public ?string $bgColor; - - /** - * Sets a background image from a URL. If this parameter is set, `bg_color` must be empty. - */ - #[Api('bg_image_url', optional: true)] - public ?string $bgImageURL; - - /** - * Allows semi-transparent regions in the result. Default is true. Note: Semitransparency is currently only supported for car windows. - */ - #[Api(optional: true)] - public ?bool $semitransparency; - - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - */ - public static function with( - ?bool $addShadow = null, - ?string $bgColor = null, - ?string $bgImageURL = null, - ?bool $semitransparency = null, - ): self { - $obj = new self; - - null !== $addShadow && $obj->addShadow = $addShadow; - null !== $bgColor && $obj->bgColor = $bgColor; - null !== $bgImageURL && $obj->bgImageURL = $bgImageURL; - null !== $semitransparency && $obj->semitransparency = $semitransparency; - - return $obj; - } - - /** - * Whether to add an artificial shadow to the result. Default is false. Note: Adding shadows is currently only supported for car photos. - */ - public function withAddShadow(bool $addShadow): self - { - $obj = clone $this; - $obj->addShadow = $addShadow; - - return $obj; - } - - /** - * Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or color name (e.g., "green"). If this parameter is set, `bg_image_url` must be empty. - */ - public function withBgColor(string $bgColor): self - { - $obj = clone $this; - $obj->bgColor = $bgColor; - - return $obj; - } - - /** - * Sets a background image from a URL. If this parameter is set, `bg_color` must be empty. - */ - public function withBgImageURL(string $bgImageURL): self - { - $obj = clone $this; - $obj->bgImageURL = $bgImageURL; - - return $obj; - } - - /** - * Allows semi-transparent regions in the result. Default is true. Note: Semitransparency is currently only supported for car windows. - */ - public function withSemitransparency(bool $semitransparency): self - { - $obj = clone $this; - $obj->semitransparency = $semitransparency; - - return $obj; - } -} diff --git a/src/Core/ServiceContracts/Beta/V2/FilesContract.php b/src/Core/ServiceContracts/Beta/V2/FilesContract.php index ae026055..885eb107 100644 --- a/src/Core/ServiceContracts/Beta/V2/FilesContract.php +++ b/src/Core/ServiceContracts/Beta/V2/FilesContract.php @@ -4,12 +4,12 @@ namespace ImageKit\Core\ServiceContracts\Beta\V2; -use ImageKit\Beta\V2\Files\FileUploadParams\Extension\AIAutoDescription; -use ImageKit\Beta\V2\Files\FileUploadParams\Extension\AutoTaggingExtension; -use ImageKit\Beta\V2\Files\FileUploadParams\Extension\RemoveBg; use ImageKit\Beta\V2\Files\FileUploadParams\ResponseField; use ImageKit\Beta\V2\Files\FileUploadParams\Transformation; use ImageKit\Beta\V2\Files\FileUploadResponse; +use ImageKit\ExtensionItem\AIAutoDescription; +use ImageKit\ExtensionItem\AutoTaggingExtension; +use ImageKit\ExtensionItem\RemoveBg; use ImageKit\RequestOptions; use const ImageKit\Core\OMIT as omit; diff --git a/src/Core/ServiceContracts/FilesContract.php b/src/Core/ServiceContracts/FilesContract.php index 00aca4d8..20413c45 100644 --- a/src/Core/ServiceContracts/FilesContract.php +++ b/src/Core/ServiceContracts/FilesContract.php @@ -4,6 +4,9 @@ namespace ImageKit\Core\ServiceContracts; +use ImageKit\ExtensionItem\AIAutoDescription; +use ImageKit\ExtensionItem\AutoTaggingExtension; +use ImageKit\ExtensionItem\RemoveBg; use ImageKit\Files\File; use ImageKit\Files\FileCopyResponse; use ImageKit\Files\FileMoveResponse; @@ -11,9 +14,6 @@ use ImageKit\Files\FileUpdateParams\Update\ChangePublicationStatus; use ImageKit\Files\FileUpdateParams\Update\UpdateFileDetails; use ImageKit\Files\FileUpdateResponse; -use ImageKit\Files\FileUploadParams\Extension\AIAutoDescription; -use ImageKit\Files\FileUploadParams\Extension\AutoTaggingExtension; -use ImageKit\Files\FileUploadParams\Extension\RemoveBg; use ImageKit\Files\FileUploadParams\ResponseField; use ImageKit\Files\FileUploadParams\Transformation; use ImageKit\Files\FileUploadResponse; diff --git a/src/Core/Services/Beta/V2/FilesService.php b/src/Core/Services/Beta/V2/FilesService.php index 305ac939..06ba4a58 100644 --- a/src/Core/Services/Beta/V2/FilesService.php +++ b/src/Core/Services/Beta/V2/FilesService.php @@ -5,14 +5,14 @@ namespace ImageKit\Core\Services\Beta\V2; use ImageKit\Beta\V2\Files\FileUploadParams; -use ImageKit\Beta\V2\Files\FileUploadParams\Extension\AIAutoDescription; -use ImageKit\Beta\V2\Files\FileUploadParams\Extension\AutoTaggingExtension; -use ImageKit\Beta\V2\Files\FileUploadParams\Extension\RemoveBg; use ImageKit\Beta\V2\Files\FileUploadParams\ResponseField; use ImageKit\Beta\V2\Files\FileUploadParams\Transformation; use ImageKit\Beta\V2\Files\FileUploadResponse; use ImageKit\Client; use ImageKit\Core\ServiceContracts\Beta\V2\FilesContract; +use ImageKit\ExtensionItem\AIAutoDescription; +use ImageKit\ExtensionItem\AutoTaggingExtension; +use ImageKit\ExtensionItem\RemoveBg; use ImageKit\RequestOptions; use const ImageKit\Core\OMIT as omit; diff --git a/src/Core/Services/FilesService.php b/src/Core/Services/FilesService.php index c6010e84..2bdde777 100644 --- a/src/Core/Services/FilesService.php +++ b/src/Core/Services/FilesService.php @@ -9,6 +9,9 @@ use ImageKit\Core\Services\Files\BulkService; use ImageKit\Core\Services\Files\MetadataService; use ImageKit\Core\Services\Files\VersionsService; +use ImageKit\ExtensionItem\AIAutoDescription; +use ImageKit\ExtensionItem\AutoTaggingExtension; +use ImageKit\ExtensionItem\RemoveBg; use ImageKit\Files\File; use ImageKit\Files\FileCopyParams; use ImageKit\Files\FileCopyResponse; @@ -21,9 +24,6 @@ use ImageKit\Files\FileUpdateParams\Update\UpdateFileDetails; use ImageKit\Files\FileUpdateResponse; use ImageKit\Files\FileUploadParams; -use ImageKit\Files\FileUploadParams\Extension\AIAutoDescription; -use ImageKit\Files\FileUploadParams\Extension\AutoTaggingExtension; -use ImageKit\Files\FileUploadParams\Extension\RemoveBg; use ImageKit\Files\FileUploadParams\ResponseField; use ImageKit\Files\FileUploadParams\Transformation; use ImageKit\Files\FileUploadResponse; diff --git a/src/Files/FileUploadParams/Extension.php b/src/ExtensionItem.php similarity index 69% rename from src/Files/FileUploadParams/Extension.php rename to src/ExtensionItem.php index ace12834..3583b8d4 100644 --- a/src/Files/FileUploadParams/Extension.php +++ b/src/ExtensionItem.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadParams; +namespace ImageKit; use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Files\FileUploadParams\Extension\AIAutoDescription; -use ImageKit\Files\FileUploadParams\Extension\AutoTaggingExtension; -use ImageKit\Files\FileUploadParams\Extension\RemoveBg; +use ImageKit\ExtensionItem\AIAutoDescription; +use ImageKit\ExtensionItem\AutoTaggingExtension; +use ImageKit\ExtensionItem\RemoveBg; -final class Extension implements ConverterSource +final class ExtensionItem implements ConverterSource { use SdkUnion; diff --git a/src/Files/FileUploadParams/Extension/AIAutoDescription.php b/src/ExtensionItem/AIAutoDescription.php similarity index 93% rename from src/Files/FileUploadParams/Extension/AIAutoDescription.php rename to src/ExtensionItem/AIAutoDescription.php index 4affc0d4..3cd6fa98 100644 --- a/src/Files/FileUploadParams/Extension/AIAutoDescription.php +++ b/src/ExtensionItem/AIAutoDescription.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadParams\Extension; +namespace ImageKit\ExtensionItem; use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; diff --git a/src/Files/FileUploadParams/Extension/AutoTaggingExtension.php b/src/ExtensionItem/AutoTaggingExtension.php similarity index 95% rename from src/Files/FileUploadParams/Extension/AutoTaggingExtension.php rename to src/ExtensionItem/AutoTaggingExtension.php index f1042d04..262f220b 100644 --- a/src/Files/FileUploadParams/Extension/AutoTaggingExtension.php +++ b/src/ExtensionItem/AutoTaggingExtension.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadParams\Extension; +namespace ImageKit\ExtensionItem; use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Files\FileUploadParams\Extension\AutoTaggingExtension\Name; +use ImageKit\ExtensionItem\AutoTaggingExtension\Name; /** * @phpstan-type auto_tagging_extension = array{ diff --git a/src/Files/FileUploadParams/Extension/AutoTaggingExtension/Name.php b/src/ExtensionItem/AutoTaggingExtension/Name.php similarity index 83% rename from src/Files/FileUploadParams/Extension/AutoTaggingExtension/Name.php rename to src/ExtensionItem/AutoTaggingExtension/Name.php index 3e4be1ce..7289da91 100644 --- a/src/Files/FileUploadParams/Extension/AutoTaggingExtension/Name.php +++ b/src/ExtensionItem/AutoTaggingExtension/Name.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadParams\Extension\AutoTaggingExtension; +namespace ImageKit\ExtensionItem\AutoTaggingExtension; use ImageKit\Core\Concerns\SdkEnum; use ImageKit\Core\Conversion\Contracts\ConverterSource; diff --git a/src/Files/FileUploadParams/Extension/RemoveBg.php b/src/ExtensionItem/RemoveBg.php similarity index 90% rename from src/Files/FileUploadParams/Extension/RemoveBg.php rename to src/ExtensionItem/RemoveBg.php index b87e7fa4..fee287d2 100644 --- a/src/Files/FileUploadParams/Extension/RemoveBg.php +++ b/src/ExtensionItem/RemoveBg.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadParams\Extension; +namespace ImageKit\ExtensionItem; use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Files\FileUploadParams\Extension\RemoveBg\Options; +use ImageKit\ExtensionItem\RemoveBg\Options; /** * @phpstan-type remove_bg = array{name: string, options?: Options|null} diff --git a/src/Files/FileUploadParams/Extension/RemoveBg/Options.php b/src/ExtensionItem/RemoveBg/Options.php similarity index 98% rename from src/Files/FileUploadParams/Extension/RemoveBg/Options.php rename to src/ExtensionItem/RemoveBg/Options.php index dd170491..093cf8a6 100644 --- a/src/Files/FileUploadParams/Extension/RemoveBg/Options.php +++ b/src/ExtensionItem/RemoveBg/Options.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadParams\Extension\RemoveBg; +namespace ImageKit\ExtensionItem\RemoveBg; use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; diff --git a/src/Files/FileUpdateParams/Update/UpdateFileDetails.php b/src/Files/FileUpdateParams/Update/UpdateFileDetails.php index 47747047..0372ca7b 100644 --- a/src/Files/FileUpdateParams/Update/UpdateFileDetails.php +++ b/src/Files/FileUpdateParams/Update/UpdateFileDetails.php @@ -7,10 +7,10 @@ use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Files\FileUpdateParams\Update\UpdateFileDetails\Extension; -use ImageKit\Files\FileUpdateParams\Update\UpdateFileDetails\Extension\AIAutoDescription; -use ImageKit\Files\FileUpdateParams\Update\UpdateFileDetails\Extension\AutoTaggingExtension; -use ImageKit\Files\FileUpdateParams\Update\UpdateFileDetails\Extension\RemoveBg; +use ImageKit\ExtensionItem; +use ImageKit\ExtensionItem\AIAutoDescription; +use ImageKit\ExtensionItem\AutoTaggingExtension; +use ImageKit\ExtensionItem\RemoveBg; use ImageKit\Files\FileUpdateParams\Update\UpdateFileDetails\RemoveAITags; /** @@ -54,7 +54,7 @@ final class UpdateFileDetails implements BaseModel * * @var list|null $extensions */ - #[Api(list: Extension::class, optional: true)] + #[Api(list: ExtensionItem::class, optional: true)] public ?array $extensions; /** diff --git a/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension.php b/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension.php deleted file mode 100644 index 106a7ee7..00000000 --- a/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension.php +++ /dev/null @@ -1,35 +0,0 @@ -|array - */ - public static function variants(): array - { - return [ - AutoTaggingExtension::class, - 'remove-bg' => RemoveBg::class, - 'ai-auto-description' => AIAutoDescription::class, - ]; - } -} diff --git a/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/AIAutoDescription.php b/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/AIAutoDescription.php deleted file mode 100644 index 61040877..00000000 --- a/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/AIAutoDescription.php +++ /dev/null @@ -1,39 +0,0 @@ - */ - use SdkModel; - - /** - * Specifies the auto description extension. - */ - #[Api] - public string $name = 'ai-auto-description'; - - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - */ - public static function with(): self - { - return new self; - } -} diff --git a/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/AutoTaggingExtension.php b/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/AutoTaggingExtension.php deleted file mode 100644 index 95159c43..00000000 --- a/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/AutoTaggingExtension.php +++ /dev/null @@ -1,119 +0,0 @@ - */ - use SdkModel; - - /** - * Maximum number of tags to attach to the asset. - */ - #[Api] - public int $maxTags; - - /** - * Minimum confidence level for tags to be considered valid. - */ - #[Api] - public int $minConfidence; - - /** - * Specifies the auto-tagging extension used. - * - * @var Name::* $name - */ - #[Api(enum: Name::class)] - public string $name; - - /** - * `new AutoTaggingExtension()` is missing required properties by the API. - * - * To enforce required parameters use - * ``` - * AutoTaggingExtension::with(maxTags: ..., minConfidence: ..., name: ...) - * ``` - * - * Otherwise ensure the following setters are called - * - * ``` - * (new AutoTaggingExtension) - * ->withMaxTags(...) - * ->withMinConfidence(...) - * ->withName(...) - * ``` - */ - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - * - * @param Name::* $name - */ - public static function with( - int $maxTags, - int $minConfidence, - string $name - ): self { - $obj = new self; - - $obj->maxTags = $maxTags; - $obj->minConfidence = $minConfidence; - $obj->name = $name; - - return $obj; - } - - /** - * Maximum number of tags to attach to the asset. - */ - public function withMaxTags(int $maxTags): self - { - $obj = clone $this; - $obj->maxTags = $maxTags; - - return $obj; - } - - /** - * Minimum confidence level for tags to be considered valid. - */ - public function withMinConfidence(int $minConfidence): self - { - $obj = clone $this; - $obj->minConfidence = $minConfidence; - - return $obj; - } - - /** - * Specifies the auto-tagging extension used. - * - * @param Name::* $name - */ - public function withName(string $name): self - { - $obj = clone $this; - $obj->name = $name; - - return $obj; - } -} diff --git a/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/AutoTaggingExtension/Name.php b/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/AutoTaggingExtension/Name.php deleted file mode 100644 index 1b209a58..00000000 --- a/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/AutoTaggingExtension/Name.php +++ /dev/null @@ -1,20 +0,0 @@ - */ - use SdkModel; - - /** - * Specifies the background removal extension. - */ - #[Api] - public string $name = 'remove-bg'; - - #[Api(optional: true)] - public ?Options $options; - - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - */ - public static function with(?Options $options = null): self - { - $obj = new self; - - null !== $options && $obj->options = $options; - - return $obj; - } - - public function withOptions(Options $options): self - { - $obj = clone $this; - $obj->options = $options; - - return $obj; - } -} diff --git a/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/RemoveBg/Options.php b/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/RemoveBg/Options.php deleted file mode 100644 index d6122438..00000000 --- a/src/Files/FileUpdateParams/Update/UpdateFileDetails/Extension/RemoveBg/Options.php +++ /dev/null @@ -1,117 +0,0 @@ - */ - use SdkModel; - - /** - * Whether to add an artificial shadow to the result. Default is false. Note: Adding shadows is currently only supported for car photos. - */ - #[Api('add_shadow', optional: true)] - public ?bool $addShadow; - - /** - * Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or color name (e.g., "green"). If this parameter is set, `bg_image_url` must be empty. - */ - #[Api('bg_color', optional: true)] - public ?string $bgColor; - - /** - * Sets a background image from a URL. If this parameter is set, `bg_color` must be empty. - */ - #[Api('bg_image_url', optional: true)] - public ?string $bgImageURL; - - /** - * Allows semi-transparent regions in the result. Default is true. Note: Semitransparency is currently only supported for car windows. - */ - #[Api(optional: true)] - public ?bool $semitransparency; - - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - */ - public static function with( - ?bool $addShadow = null, - ?string $bgColor = null, - ?string $bgImageURL = null, - ?bool $semitransparency = null, - ): self { - $obj = new self; - - null !== $addShadow && $obj->addShadow = $addShadow; - null !== $bgColor && $obj->bgColor = $bgColor; - null !== $bgImageURL && $obj->bgImageURL = $bgImageURL; - null !== $semitransparency && $obj->semitransparency = $semitransparency; - - return $obj; - } - - /** - * Whether to add an artificial shadow to the result. Default is false. Note: Adding shadows is currently only supported for car photos. - */ - public function withAddShadow(bool $addShadow): self - { - $obj = clone $this; - $obj->addShadow = $addShadow; - - return $obj; - } - - /** - * Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or color name (e.g., "green"). If this parameter is set, `bg_image_url` must be empty. - */ - public function withBgColor(string $bgColor): self - { - $obj = clone $this; - $obj->bgColor = $bgColor; - - return $obj; - } - - /** - * Sets a background image from a URL. If this parameter is set, `bg_color` must be empty. - */ - public function withBgImageURL(string $bgImageURL): self - { - $obj = clone $this; - $obj->bgImageURL = $bgImageURL; - - return $obj; - } - - /** - * Allows semi-transparent regions in the result. Default is true. Note: Semitransparency is currently only supported for car windows. - */ - public function withSemitransparency(bool $semitransparency): self - { - $obj = clone $this; - $obj->semitransparency = $semitransparency; - - return $obj; - } -} diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index 26c31c0c..ddbf55fe 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -8,10 +8,10 @@ use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Concerns\SdkParams; use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Files\FileUploadParams\Extension; -use ImageKit\Files\FileUploadParams\Extension\AIAutoDescription; -use ImageKit\Files\FileUploadParams\Extension\AutoTaggingExtension; -use ImageKit\Files\FileUploadParams\Extension\RemoveBg; +use ImageKit\ExtensionItem; +use ImageKit\ExtensionItem\AIAutoDescription; +use ImageKit\ExtensionItem\AutoTaggingExtension; +use ImageKit\ExtensionItem\RemoveBg; use ImageKit\Files\FileUploadParams\ResponseField; use ImageKit\Files\FileUploadParams\Transformation; @@ -150,7 +150,7 @@ final class FileUploadParams implements BaseModel * * @var list|null $extensions */ - #[Api(list: Extension::class, optional: true)] + #[Api(list: ExtensionItem::class, optional: true)] public ?array $extensions; /** From 46dbc22461339a6be4f275f57b4f74a6fc2e4625 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 06:47:22 +0000 Subject: [PATCH 019/193] feat(api): manual updates --- .stats.yml | 2 +- src/Accounts/Origins/OriginCreateParams.php | 408 +++++++++++++++++- src/Accounts/Origins/OriginUpdateParams.php | 408 +++++++++++++++++- .../Accounts/OriginsContract.php | 126 ++++-- src/Core/ServiceContracts/FilesContract.php | 28 +- src/Core/Services/Accounts/OriginsService.php | 182 ++++++-- src/Core/Services/FilesService.php | 43 +- src/Files/FileUpdateParams.php | 198 ++++++++- .../ChangePublicationStatus => }/Publish.php | 2 +- .../UpdateFileDetails => }/RemoveAITags.php | 2 +- src/Files/FileUpdateParams/Update.php | 25 -- .../Update/ChangePublicationStatus.php | 55 --- .../Update/UpdateFileDetails.php | 211 --------- tests/Services/Accounts/OriginsTest.php | 95 ++-- 14 files changed, 1339 insertions(+), 446 deletions(-) rename src/Files/FileUpdateParams/{Update/ChangePublicationStatus => }/Publish.php (96%) rename src/Files/FileUpdateParams/{Update/UpdateFileDetails => }/RemoveAITags.php (92%) delete mode 100644 src/Files/FileUpdateParams/Update.php delete mode 100644 src/Files/FileUpdateParams/Update/ChangePublicationStatus.php delete mode 100644 src/Files/FileUpdateParams/Update/UpdateFileDetails.php diff --git a/.stats.yml b/.stats.yml index 2dc65d21..335e38ec 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-0470196862abd722b09f1af798d6f2bcbdeba0f82d1162f57c287b1a43233531.yml openapi_spec_hash: 043dd7c67d741d0034b86f2fc0bce072 -config_hash: da949a1217f48ac01676eab81ca9d1b1 +config_hash: a652d68098d82eaf611a49507fb4b831 diff --git a/src/Accounts/Origins/OriginCreateParams.php b/src/Accounts/Origins/OriginCreateParams.php index 9cd5822a..ea0572c7 100644 --- a/src/Accounts/Origins/OriginCreateParams.php +++ b/src/Accounts/Origins/OriginCreateParams.php @@ -4,14 +4,6 @@ namespace ImageKit\Accounts\Origins; -use ImageKit\Accounts\Origins\OriginRequest\AkeneoPim; -use ImageKit\Accounts\Origins\OriginRequest\AzureBlob; -use ImageKit\Accounts\Origins\OriginRequest\CloudinaryBackup; -use ImageKit\Accounts\Origins\OriginRequest\Gcs; -use ImageKit\Accounts\Origins\OriginRequest\S3; -use ImageKit\Accounts\Origins\OriginRequest\S3Compatible; -use ImageKit\Accounts\Origins\OriginRequest\WebFolder; -use ImageKit\Accounts\Origins\OriginRequest\WebProxy; use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Concerns\SdkParams; @@ -35,7 +27,27 @@ * @see ImageKit\Accounts\Origins->create * * @phpstan-type origin_create_params = array{ - * origin: S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim, + * accessKey: string, + * bucket: string, + * name: string, + * secretKey: string, + * type: string, + * baseURLForCanonicalHeader?: string, + * includeCanonicalHeader?: bool, + * prefix?: string, + * endpoint: string, + * s3ForcePathStyle?: bool, + * baseURL: string, + * forwardHostHeaderToOrigin?: bool, + * clientEmail: string, + * privateKey: string, + * accountName: string, + * container: string, + * sasToken: string, + * clientID: string, + * clientSecret: string, + * password: string, + * username: string, * } */ final class OriginCreateParams implements BaseModel @@ -44,24 +56,151 @@ final class OriginCreateParams implements BaseModel use SdkModel; use SdkParams; + #[Api] + public string $type = 'AKENEO_PIM'; + + /** + * Access key for the bucket. + */ + #[Api] + public string $accessKey; + + #[Api] + public string $bucket; + + /** + * Display name of the origin. + */ + #[Api] + public string $name; + + /** + * Secret key for the bucket. + */ + #[Api] + public string $secretKey; + + /** + * URL used in the Canonical header (if enabled). + */ + #[Api('baseUrlForCanonicalHeader', optional: true)] + public ?string $baseURLForCanonicalHeader; + + /** + * Whether to send a Canonical header. + */ + #[Api(optional: true)] + public ?bool $includeCanonicalHeader; + + #[Api(optional: true)] + public ?string $prefix; + + /** + * Custom S3-compatible endpoint. + */ + #[Api] + public string $endpoint; + + /** + * Use path-style S3 URLs? + */ + #[Api(optional: true)] + public ?bool $s3ForcePathStyle; + + /** + * Akeneo instance base URL. + */ + #[Api('baseUrl')] + public string $baseURL; + + /** + * Forward the Host header to origin? + */ + #[Api(optional: true)] + public ?bool $forwardHostHeaderToOrigin; + + #[Api] + public string $clientEmail; + + #[Api] + public string $privateKey; + + #[Api] + public string $accountName; + + #[Api] + public string $container; + + #[Api] + public string $sasToken; + /** - * Schema for origin request resources. + * Akeneo API client ID. */ - #[Api(union: OriginRequest::class)] - public S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim $origin; + #[Api('clientId')] + public string $clientID; + + /** + * Akeneo API client secret. + */ + #[Api] + public string $clientSecret; + + /** + * Akeneo API password. + */ + #[Api] + public string $password; + + /** + * Akeneo API username. + */ + #[Api] + public string $username; /** * `new OriginCreateParams()` is missing required properties by the API. * * To enforce required parameters use * ``` - * OriginCreateParams::with(origin: ...) + * OriginCreateParams::with( + * accessKey: ..., + * bucket: ..., + * name: ..., + * secretKey: ..., + * endpoint: ..., + * baseURL: ..., + * clientEmail: ..., + * privateKey: ..., + * accountName: ..., + * container: ..., + * sasToken: ..., + * clientID: ..., + * clientSecret: ..., + * password: ..., + * username: ..., + * ) * ``` * * Otherwise ensure the following setters are called * * ``` - * (new OriginCreateParams)->withOrigin(...) + * (new OriginCreateParams) + * ->withAccessKey(...) + * ->withBucket(...) + * ->withName(...) + * ->withSecretKey(...) + * ->withEndpoint(...) + * ->withBaseURL(...) + * ->withClientEmail(...) + * ->withPrivateKey(...) + * ->withAccountName(...) + * ->withContainer(...) + * ->withSasToken(...) + * ->withClientID(...) + * ->withClientSecret(...) + * ->withPassword(...) + * ->withUsername(...) * ``` */ public function __construct() @@ -75,23 +214,252 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim $origin, + string $accessKey, + string $bucket, + string $name, + string $secretKey, + string $endpoint, + string $baseURL, + string $clientEmail, + string $privateKey, + string $accountName, + string $container, + string $sasToken, + string $clientID, + string $clientSecret, + string $password, + string $username, + ?string $baseURLForCanonicalHeader = null, + ?bool $includeCanonicalHeader = null, + ?string $prefix = null, + ?bool $s3ForcePathStyle = null, + ?bool $forwardHostHeaderToOrigin = null, ): self { $obj = new self; - $obj->origin = $origin; + $obj->accessKey = $accessKey; + $obj->bucket = $bucket; + $obj->name = $name; + $obj->secretKey = $secretKey; + $obj->endpoint = $endpoint; + $obj->baseURL = $baseURL; + $obj->clientEmail = $clientEmail; + $obj->privateKey = $privateKey; + $obj->accountName = $accountName; + $obj->container = $container; + $obj->sasToken = $sasToken; + $obj->clientID = $clientID; + $obj->clientSecret = $clientSecret; + $obj->password = $password; + $obj->username = $username; + + null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; + null !== $prefix && $obj->prefix = $prefix; + null !== $s3ForcePathStyle && $obj->s3ForcePathStyle = $s3ForcePathStyle; + null !== $forwardHostHeaderToOrigin && $obj->forwardHostHeaderToOrigin = $forwardHostHeaderToOrigin; + + return $obj; + } + + /** + * Access key for the bucket. + */ + public function withAccessKey(string $accessKey): self + { + $obj = clone $this; + $obj->accessKey = $accessKey; + + return $obj; + } + + public function withBucket(string $bucket): self + { + $obj = clone $this; + $obj->bucket = $bucket; + + return $obj; + } + + /** + * Display name of the origin. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * Secret key for the bucket. + */ + public function withSecretKey(string $secretKey): self + { + $obj = clone $this; + $obj->secretKey = $secretKey; return $obj; } /** - * Schema for origin request resources. + * URL used in the Canonical header (if enabled). */ - public function withOrigin( - S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim $origin, + public function withBaseURLForCanonicalHeader( + string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->origin = $origin; + $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } + + /** + * Whether to send a Canonical header. + */ + public function withIncludeCanonicalHeader( + bool $includeCanonicalHeader + ): self { + $obj = clone $this; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + + return $obj; + } + + public function withPrefix(string $prefix): self + { + $obj = clone $this; + $obj->prefix = $prefix; + + return $obj; + } + + /** + * Custom S3-compatible endpoint. + */ + public function withEndpoint(string $endpoint): self + { + $obj = clone $this; + $obj->endpoint = $endpoint; + + return $obj; + } + + /** + * Use path-style S3 URLs? + */ + public function withS3ForcePathStyle(bool $s3ForcePathStyle): self + { + $obj = clone $this; + $obj->s3ForcePathStyle = $s3ForcePathStyle; + + return $obj; + } + + /** + * Akeneo instance base URL. + */ + public function withBaseURL(string $baseURL): self + { + $obj = clone $this; + $obj->baseURL = $baseURL; + + return $obj; + } + + /** + * Forward the Host header to origin? + */ + public function withForwardHostHeaderToOrigin( + bool $forwardHostHeaderToOrigin + ): self { + $obj = clone $this; + $obj->forwardHostHeaderToOrigin = $forwardHostHeaderToOrigin; + + return $obj; + } + + public function withClientEmail(string $clientEmail): self + { + $obj = clone $this; + $obj->clientEmail = $clientEmail; + + return $obj; + } + + public function withPrivateKey(string $privateKey): self + { + $obj = clone $this; + $obj->privateKey = $privateKey; + + return $obj; + } + + public function withAccountName(string $accountName): self + { + $obj = clone $this; + $obj->accountName = $accountName; + + return $obj; + } + + public function withContainer(string $container): self + { + $obj = clone $this; + $obj->container = $container; + + return $obj; + } + + public function withSasToken(string $sasToken): self + { + $obj = clone $this; + $obj->sasToken = $sasToken; + + return $obj; + } + + /** + * Akeneo API client ID. + */ + public function withClientID(string $clientID): self + { + $obj = clone $this; + $obj->clientID = $clientID; + + return $obj; + } + + /** + * Akeneo API client secret. + */ + public function withClientSecret(string $clientSecret): self + { + $obj = clone $this; + $obj->clientSecret = $clientSecret; + + return $obj; + } + + /** + * Akeneo API password. + */ + public function withPassword(string $password): self + { + $obj = clone $this; + $obj->password = $password; + + return $obj; + } + + /** + * Akeneo API username. + */ + public function withUsername(string $username): self + { + $obj = clone $this; + $obj->username = $username; return $obj; } diff --git a/src/Accounts/Origins/OriginUpdateParams.php b/src/Accounts/Origins/OriginUpdateParams.php index e42e6c03..2ce8e6c0 100644 --- a/src/Accounts/Origins/OriginUpdateParams.php +++ b/src/Accounts/Origins/OriginUpdateParams.php @@ -4,14 +4,6 @@ namespace ImageKit\Accounts\Origins; -use ImageKit\Accounts\Origins\OriginRequest\AkeneoPim; -use ImageKit\Accounts\Origins\OriginRequest\AzureBlob; -use ImageKit\Accounts\Origins\OriginRequest\CloudinaryBackup; -use ImageKit\Accounts\Origins\OriginRequest\Gcs; -use ImageKit\Accounts\Origins\OriginRequest\S3; -use ImageKit\Accounts\Origins\OriginRequest\S3Compatible; -use ImageKit\Accounts\Origins\OriginRequest\WebFolder; -use ImageKit\Accounts\Origins\OriginRequest\WebProxy; use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Concerns\SdkParams; @@ -35,7 +27,27 @@ * @see ImageKit\Accounts\Origins->update * * @phpstan-type origin_update_params = array{ - * origin: S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim, + * accessKey: string, + * bucket: string, + * name: string, + * secretKey: string, + * type: string, + * baseURLForCanonicalHeader?: string, + * includeCanonicalHeader?: bool, + * prefix?: string, + * endpoint: string, + * s3ForcePathStyle?: bool, + * baseURL: string, + * forwardHostHeaderToOrigin?: bool, + * clientEmail: string, + * privateKey: string, + * accountName: string, + * container: string, + * sasToken: string, + * clientID: string, + * clientSecret: string, + * password: string, + * username: string, * } */ final class OriginUpdateParams implements BaseModel @@ -44,24 +56,151 @@ final class OriginUpdateParams implements BaseModel use SdkModel; use SdkParams; + #[Api] + public string $type = 'AKENEO_PIM'; + + /** + * Access key for the bucket. + */ + #[Api] + public string $accessKey; + + #[Api] + public string $bucket; + + /** + * Display name of the origin. + */ + #[Api] + public string $name; + + /** + * Secret key for the bucket. + */ + #[Api] + public string $secretKey; + + /** + * URL used in the Canonical header (if enabled). + */ + #[Api('baseUrlForCanonicalHeader', optional: true)] + public ?string $baseURLForCanonicalHeader; + + /** + * Whether to send a Canonical header. + */ + #[Api(optional: true)] + public ?bool $includeCanonicalHeader; + + #[Api(optional: true)] + public ?string $prefix; + + /** + * Custom S3-compatible endpoint. + */ + #[Api] + public string $endpoint; + + /** + * Use path-style S3 URLs? + */ + #[Api(optional: true)] + public ?bool $s3ForcePathStyle; + + /** + * Akeneo instance base URL. + */ + #[Api('baseUrl')] + public string $baseURL; + + /** + * Forward the Host header to origin? + */ + #[Api(optional: true)] + public ?bool $forwardHostHeaderToOrigin; + + #[Api] + public string $clientEmail; + + #[Api] + public string $privateKey; + + #[Api] + public string $accountName; + + #[Api] + public string $container; + + #[Api] + public string $sasToken; + /** - * Schema for origin request resources. + * Akeneo API client ID. */ - #[Api(union: OriginRequest::class)] - public S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim $origin; + #[Api('clientId')] + public string $clientID; + + /** + * Akeneo API client secret. + */ + #[Api] + public string $clientSecret; + + /** + * Akeneo API password. + */ + #[Api] + public string $password; + + /** + * Akeneo API username. + */ + #[Api] + public string $username; /** * `new OriginUpdateParams()` is missing required properties by the API. * * To enforce required parameters use * ``` - * OriginUpdateParams::with(origin: ...) + * OriginUpdateParams::with( + * accessKey: ..., + * bucket: ..., + * name: ..., + * secretKey: ..., + * endpoint: ..., + * baseURL: ..., + * clientEmail: ..., + * privateKey: ..., + * accountName: ..., + * container: ..., + * sasToken: ..., + * clientID: ..., + * clientSecret: ..., + * password: ..., + * username: ..., + * ) * ``` * * Otherwise ensure the following setters are called * * ``` - * (new OriginUpdateParams)->withOrigin(...) + * (new OriginUpdateParams) + * ->withAccessKey(...) + * ->withBucket(...) + * ->withName(...) + * ->withSecretKey(...) + * ->withEndpoint(...) + * ->withBaseURL(...) + * ->withClientEmail(...) + * ->withPrivateKey(...) + * ->withAccountName(...) + * ->withContainer(...) + * ->withSasToken(...) + * ->withClientID(...) + * ->withClientSecret(...) + * ->withPassword(...) + * ->withUsername(...) * ``` */ public function __construct() @@ -75,23 +214,252 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim $origin, + string $accessKey, + string $bucket, + string $name, + string $secretKey, + string $endpoint, + string $baseURL, + string $clientEmail, + string $privateKey, + string $accountName, + string $container, + string $sasToken, + string $clientID, + string $clientSecret, + string $password, + string $username, + ?string $baseURLForCanonicalHeader = null, + ?bool $includeCanonicalHeader = null, + ?string $prefix = null, + ?bool $s3ForcePathStyle = null, + ?bool $forwardHostHeaderToOrigin = null, ): self { $obj = new self; - $obj->origin = $origin; + $obj->accessKey = $accessKey; + $obj->bucket = $bucket; + $obj->name = $name; + $obj->secretKey = $secretKey; + $obj->endpoint = $endpoint; + $obj->baseURL = $baseURL; + $obj->clientEmail = $clientEmail; + $obj->privateKey = $privateKey; + $obj->accountName = $accountName; + $obj->container = $container; + $obj->sasToken = $sasToken; + $obj->clientID = $clientID; + $obj->clientSecret = $clientSecret; + $obj->password = $password; + $obj->username = $username; + + null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; + null !== $prefix && $obj->prefix = $prefix; + null !== $s3ForcePathStyle && $obj->s3ForcePathStyle = $s3ForcePathStyle; + null !== $forwardHostHeaderToOrigin && $obj->forwardHostHeaderToOrigin = $forwardHostHeaderToOrigin; + + return $obj; + } + + /** + * Access key for the bucket. + */ + public function withAccessKey(string $accessKey): self + { + $obj = clone $this; + $obj->accessKey = $accessKey; + + return $obj; + } + + public function withBucket(string $bucket): self + { + $obj = clone $this; + $obj->bucket = $bucket; + + return $obj; + } + + /** + * Display name of the origin. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * Secret key for the bucket. + */ + public function withSecretKey(string $secretKey): self + { + $obj = clone $this; + $obj->secretKey = $secretKey; return $obj; } /** - * Schema for origin request resources. + * URL used in the Canonical header (if enabled). */ - public function withOrigin( - S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim $origin, + public function withBaseURLForCanonicalHeader( + string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->origin = $origin; + $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + + return $obj; + } + + /** + * Whether to send a Canonical header. + */ + public function withIncludeCanonicalHeader( + bool $includeCanonicalHeader + ): self { + $obj = clone $this; + $obj->includeCanonicalHeader = $includeCanonicalHeader; + + return $obj; + } + + public function withPrefix(string $prefix): self + { + $obj = clone $this; + $obj->prefix = $prefix; + + return $obj; + } + + /** + * Custom S3-compatible endpoint. + */ + public function withEndpoint(string $endpoint): self + { + $obj = clone $this; + $obj->endpoint = $endpoint; + + return $obj; + } + + /** + * Use path-style S3 URLs? + */ + public function withS3ForcePathStyle(bool $s3ForcePathStyle): self + { + $obj = clone $this; + $obj->s3ForcePathStyle = $s3ForcePathStyle; + + return $obj; + } + + /** + * Akeneo instance base URL. + */ + public function withBaseURL(string $baseURL): self + { + $obj = clone $this; + $obj->baseURL = $baseURL; + + return $obj; + } + + /** + * Forward the Host header to origin? + */ + public function withForwardHostHeaderToOrigin( + bool $forwardHostHeaderToOrigin + ): self { + $obj = clone $this; + $obj->forwardHostHeaderToOrigin = $forwardHostHeaderToOrigin; + + return $obj; + } + + public function withClientEmail(string $clientEmail): self + { + $obj = clone $this; + $obj->clientEmail = $clientEmail; + + return $obj; + } + + public function withPrivateKey(string $privateKey): self + { + $obj = clone $this; + $obj->privateKey = $privateKey; + + return $obj; + } + + public function withAccountName(string $accountName): self + { + $obj = clone $this; + $obj->accountName = $accountName; + + return $obj; + } + + public function withContainer(string $container): self + { + $obj = clone $this; + $obj->container = $container; + + return $obj; + } + + public function withSasToken(string $sasToken): self + { + $obj = clone $this; + $obj->sasToken = $sasToken; + + return $obj; + } + + /** + * Akeneo API client ID. + */ + public function withClientID(string $clientID): self + { + $obj = clone $this; + $obj->clientID = $clientID; + + return $obj; + } + + /** + * Akeneo API client secret. + */ + public function withClientSecret(string $clientSecret): self + { + $obj = clone $this; + $obj->clientSecret = $clientSecret; + + return $obj; + } + + /** + * Akeneo API password. + */ + public function withPassword(string $password): self + { + $obj = clone $this; + $obj->password = $password; + + return $obj; + } + + /** + * Akeneo API username. + */ + public function withUsername(string $username): self + { + $obj = clone $this; + $obj->username = $username; return $obj; } diff --git a/src/Core/ServiceContracts/Accounts/OriginsContract.php b/src/Core/ServiceContracts/Accounts/OriginsContract.php index e8873d10..9a560ffd 100644 --- a/src/Core/ServiceContracts/Accounts/OriginsContract.php +++ b/src/Core/ServiceContracts/Accounts/OriginsContract.php @@ -4,51 +4,125 @@ namespace ImageKit\Core\ServiceContracts\Accounts; -use ImageKit\Accounts\Origins\OriginRequest\AkeneoPim; -use ImageKit\Accounts\Origins\OriginRequest\AzureBlob; -use ImageKit\Accounts\Origins\OriginRequest\CloudinaryBackup; -use ImageKit\Accounts\Origins\OriginRequest\Gcs; -use ImageKit\Accounts\Origins\OriginRequest\S3; -use ImageKit\Accounts\Origins\OriginRequest\S3Compatible; -use ImageKit\Accounts\Origins\OriginRequest\WebFolder; -use ImageKit\Accounts\Origins\OriginRequest\WebProxy; -use ImageKit\Accounts\Origins\OriginResponse\AkeneoPim as AkeneoPim1; -use ImageKit\Accounts\Origins\OriginResponse\AzureBlob as AzureBlob1; -use ImageKit\Accounts\Origins\OriginResponse\CloudinaryBackup as CloudinaryBackup1; -use ImageKit\Accounts\Origins\OriginResponse\Gcs as Gcs1; -use ImageKit\Accounts\Origins\OriginResponse\S3 as S31; -use ImageKit\Accounts\Origins\OriginResponse\S3Compatible as S3Compatible1; -use ImageKit\Accounts\Origins\OriginResponse\WebFolder as WebFolder1; -use ImageKit\Accounts\Origins\OriginResponse\WebProxy as WebProxy1; +use ImageKit\Accounts\Origins\OriginResponse\AkeneoPim; +use ImageKit\Accounts\Origins\OriginResponse\AzureBlob; +use ImageKit\Accounts\Origins\OriginResponse\CloudinaryBackup; +use ImageKit\Accounts\Origins\OriginResponse\Gcs; +use ImageKit\Accounts\Origins\OriginResponse\S3; +use ImageKit\Accounts\Origins\OriginResponse\S3Compatible; +use ImageKit\Accounts\Origins\OriginResponse\WebFolder; +use ImageKit\Accounts\Origins\OriginResponse\WebProxy; use ImageKit\RequestOptions; +use const ImageKit\Core\OMIT as omit; + interface OriginsContract { /** * @api * - * @param S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim $origin schema for origin request resources + * @param string $accessKey access key for the bucket + * @param string $bucket + * @param string $name display name of the origin + * @param string $secretKey secret key for the bucket + * @param string $type + * @param string $baseURLForCanonicalHeader URL used in the Canonical header (if enabled) + * @param bool $includeCanonicalHeader whether to send a Canonical header + * @param string $prefix + * @param string $endpoint custom S3-compatible endpoint + * @param bool $s3ForcePathStyle Use path-style S3 URLs? + * @param string $baseURL akeneo instance base URL + * @param bool $forwardHostHeaderToOrigin Forward the Host header to origin? + * @param string $clientEmail + * @param string $privateKey + * @param string $accountName + * @param string $container + * @param string $sasToken + * @param string $clientID akeneo API client ID + * @param string $clientSecret akeneo API client secret + * @param string $password akeneo API password + * @param string $username akeneo API username */ public function create( - $origin, - ?RequestOptions $requestOptions = null - ): S31|S3Compatible1|CloudinaryBackup1|WebFolder1|WebProxy1|Gcs1|AzureBlob1|AkeneoPim1; + $accessKey, + $bucket, + $name, + $secretKey, + $type, + $baseURLForCanonicalHeader = omit, + $includeCanonicalHeader = omit, + $prefix = omit, + $endpoint, + $s3ForcePathStyle = omit, + $baseURL, + $forwardHostHeaderToOrigin = omit, + $clientEmail, + $privateKey, + $accountName, + $container, + $sasToken, + $clientID, + $clientSecret, + $password, + $username, + ?RequestOptions $requestOptions = null, + ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim; /** * @api * - * @param S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim $origin schema for origin request resources + * @param string $accessKey access key for the bucket + * @param string $bucket + * @param string $name display name of the origin + * @param string $secretKey secret key for the bucket + * @param string $type + * @param string $baseURLForCanonicalHeader URL used in the Canonical header (if enabled) + * @param bool $includeCanonicalHeader whether to send a Canonical header + * @param string $prefix + * @param string $endpoint custom S3-compatible endpoint + * @param bool $s3ForcePathStyle Use path-style S3 URLs? + * @param string $baseURL akeneo instance base URL + * @param bool $forwardHostHeaderToOrigin Forward the Host header to origin? + * @param string $clientEmail + * @param string $privateKey + * @param string $accountName + * @param string $container + * @param string $sasToken + * @param string $clientID akeneo API client ID + * @param string $clientSecret akeneo API client secret + * @param string $password akeneo API password + * @param string $username akeneo API username */ public function update( string $id, - $origin, - ?RequestOptions $requestOptions = null - ): S31|S3Compatible1|CloudinaryBackup1|WebFolder1|WebProxy1|Gcs1|AzureBlob1|AkeneoPim1; + $accessKey, + $bucket, + $name, + $secretKey, + $type, + $baseURLForCanonicalHeader = omit, + $includeCanonicalHeader = omit, + $prefix = omit, + $endpoint, + $s3ForcePathStyle = omit, + $baseURL, + $forwardHostHeaderToOrigin = omit, + $clientEmail, + $privateKey, + $accountName, + $container, + $sasToken, + $clientID, + $clientSecret, + $password, + $username, + ?RequestOptions $requestOptions = null, + ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim; /** * @api * - * @return list + * @return list */ public function list( ?RequestOptions $requestOptions = null @@ -68,5 +142,5 @@ public function delete( public function get( string $id, ?RequestOptions $requestOptions = null - ): S31|S3Compatible1|CloudinaryBackup1|WebFolder1|WebProxy1|Gcs1|AzureBlob1|AkeneoPim1; + ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim; } diff --git a/src/Core/ServiceContracts/FilesContract.php b/src/Core/ServiceContracts/FilesContract.php index 20413c45..c5f265c5 100644 --- a/src/Core/ServiceContracts/FilesContract.php +++ b/src/Core/ServiceContracts/FilesContract.php @@ -11,8 +11,7 @@ use ImageKit\Files\FileCopyResponse; use ImageKit\Files\FileMoveResponse; use ImageKit\Files\FileRenameResponse; -use ImageKit\Files\FileUpdateParams\Update\ChangePublicationStatus; -use ImageKit\Files\FileUpdateParams\Update\UpdateFileDetails; +use ImageKit\Files\FileUpdateParams\Publish; use ImageKit\Files\FileUpdateResponse; use ImageKit\Files\FileUploadParams\ResponseField; use ImageKit\Files\FileUploadParams\Transformation; @@ -26,12 +25,31 @@ interface FilesContract /** * @api * - * @param UpdateFileDetails|ChangePublicationStatus $update + * @param string|null $customCoordinates Define an important area in the image in the format `x,y,width,height` e.g. `10,10,100,100`. Send `null` to unset this value. + * @param array $customMetadata A key-value data to be associated with the asset. To unset a key, send `null` value for that key. Before setting any custom metadata on an asset you have to create the field using custom metadata fields API. + * @param string $description optional text to describe the contents of the file + * @param list $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. + * @param string|list $removeAITags An array of AITags associated with the file that you want to remove, e.g. `["car", "vehicle", "motorsports"]`. + * + * If you want to remove all AITags associated with the file, send a string - "all". + * + * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. + * @param list|null $tags An array of tags associated with the file, such as `["tag1", "tag2"]`. Send `null` to unset all tags associated with the file. + * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + * @param Publish $publish configure the publication status of a file and its versions */ public function update( string $fileID, - $update = omit, - ?RequestOptions $requestOptions = null + $customCoordinates = omit, + $customMetadata = omit, + $description = omit, + $extensions = omit, + $removeAITags = omit, + $tags = omit, + $webhookURL = omit, + $publish = omit, + ?RequestOptions $requestOptions = null, ): FileUpdateResponse; /** diff --git a/src/Core/Services/Accounts/OriginsService.php b/src/Core/Services/Accounts/OriginsService.php index 05a2f31a..d52dda85 100644 --- a/src/Core/Services/Accounts/OriginsService.php +++ b/src/Core/Services/Accounts/OriginsService.php @@ -5,29 +5,23 @@ namespace ImageKit\Core\Services\Accounts; use ImageKit\Accounts\Origins\OriginCreateParams; -use ImageKit\Accounts\Origins\OriginRequest\AkeneoPim; -use ImageKit\Accounts\Origins\OriginRequest\AzureBlob; -use ImageKit\Accounts\Origins\OriginRequest\CloudinaryBackup; -use ImageKit\Accounts\Origins\OriginRequest\Gcs; -use ImageKit\Accounts\Origins\OriginRequest\S3; -use ImageKit\Accounts\Origins\OriginRequest\S3Compatible; -use ImageKit\Accounts\Origins\OriginRequest\WebFolder; -use ImageKit\Accounts\Origins\OriginRequest\WebProxy; use ImageKit\Accounts\Origins\OriginResponse; -use ImageKit\Accounts\Origins\OriginResponse\AkeneoPim as AkeneoPim1; -use ImageKit\Accounts\Origins\OriginResponse\AzureBlob as AzureBlob1; -use ImageKit\Accounts\Origins\OriginResponse\CloudinaryBackup as CloudinaryBackup1; -use ImageKit\Accounts\Origins\OriginResponse\Gcs as Gcs1; -use ImageKit\Accounts\Origins\OriginResponse\S3 as S31; -use ImageKit\Accounts\Origins\OriginResponse\S3Compatible as S3Compatible1; -use ImageKit\Accounts\Origins\OriginResponse\WebFolder as WebFolder1; -use ImageKit\Accounts\Origins\OriginResponse\WebProxy as WebProxy1; +use ImageKit\Accounts\Origins\OriginResponse\AkeneoPim; +use ImageKit\Accounts\Origins\OriginResponse\AzureBlob; +use ImageKit\Accounts\Origins\OriginResponse\CloudinaryBackup; +use ImageKit\Accounts\Origins\OriginResponse\Gcs; +use ImageKit\Accounts\Origins\OriginResponse\S3; +use ImageKit\Accounts\Origins\OriginResponse\S3Compatible; +use ImageKit\Accounts\Origins\OriginResponse\WebFolder; +use ImageKit\Accounts\Origins\OriginResponse\WebProxy; use ImageKit\Accounts\Origins\OriginUpdateParams; use ImageKit\Client; use ImageKit\Core\Conversion\ListOf; use ImageKit\Core\ServiceContracts\Accounts\OriginsContract; use ImageKit\RequestOptions; +use const ImageKit\Core\OMIT as omit; + final class OriginsService implements OriginsContract { /** @@ -41,22 +35,84 @@ public function __construct(private Client $client) {} * **Note:** This API is currently in beta. * Creates a new origin and returns the origin object. * - * @param S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim $origin schema for origin request resources + * @param string $accessKey access key for the bucket + * @param string $bucket + * @param string $name display name of the origin + * @param string $secretKey secret key for the bucket + * @param string $type + * @param string $baseURLForCanonicalHeader URL used in the Canonical header (if enabled) + * @param bool $includeCanonicalHeader whether to send a Canonical header + * @param string $prefix + * @param string $endpoint custom S3-compatible endpoint + * @param bool $s3ForcePathStyle Use path-style S3 URLs? + * @param string $baseURL akeneo instance base URL + * @param bool $forwardHostHeaderToOrigin Forward the Host header to origin? + * @param string $clientEmail + * @param string $privateKey + * @param string $accountName + * @param string $container + * @param string $sasToken + * @param string $clientID akeneo API client ID + * @param string $clientSecret akeneo API client secret + * @param string $password akeneo API password + * @param string $username akeneo API username */ public function create( - $origin, - ?RequestOptions $requestOptions = null - ): S31|S3Compatible1|CloudinaryBackup1|WebFolder1|WebProxy1|Gcs1|AzureBlob1|AkeneoPim1 { + $accessKey, + $bucket, + $name, + $secretKey, + $type, + $baseURLForCanonicalHeader = omit, + $includeCanonicalHeader = omit, + $prefix = omit, + $endpoint, + $s3ForcePathStyle = omit, + $baseURL, + $forwardHostHeaderToOrigin = omit, + $clientEmail, + $privateKey, + $accountName, + $container, + $sasToken, + $clientID, + $clientSecret, + $password, + $username, + ?RequestOptions $requestOptions = null, + ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { [$parsed, $options] = OriginCreateParams::parseRequest( - ['origin' => $origin], - $requestOptions + [ + 'accessKey' => $accessKey, + 'bucket' => $bucket, + 'name' => $name, + 'secretKey' => $secretKey, + 'type' => $type, + 'baseURLForCanonicalHeader' => $baseURLForCanonicalHeader, + 'includeCanonicalHeader' => $includeCanonicalHeader, + 'prefix' => $prefix, + 'endpoint' => $endpoint, + 's3ForcePathStyle' => $s3ForcePathStyle, + 'baseURL' => $baseURL, + 'forwardHostHeaderToOrigin' => $forwardHostHeaderToOrigin, + 'clientEmail' => $clientEmail, + 'privateKey' => $privateKey, + 'accountName' => $accountName, + 'container' => $container, + 'sasToken' => $sasToken, + 'clientID' => $clientID, + 'clientSecret' => $clientSecret, + 'password' => $password, + 'username' => $username, + ], + $requestOptions, ); // @phpstan-ignore-next-line; return $this->client->request( method: 'post', path: 'v1/accounts/origins', - body: (object) $parsed['origin'], + body: (object) $parsed, options: $options, convert: OriginResponse::class, ); @@ -68,23 +124,85 @@ public function create( * **Note:** This API is currently in beta. * Updates the origin identified by `id` and returns the updated origin object. * - * @param S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim $origin schema for origin request resources + * @param string $accessKey access key for the bucket + * @param string $bucket + * @param string $name display name of the origin + * @param string $secretKey secret key for the bucket + * @param string $type + * @param string $baseURLForCanonicalHeader URL used in the Canonical header (if enabled) + * @param bool $includeCanonicalHeader whether to send a Canonical header + * @param string $prefix + * @param string $endpoint custom S3-compatible endpoint + * @param bool $s3ForcePathStyle Use path-style S3 URLs? + * @param string $baseURL akeneo instance base URL + * @param bool $forwardHostHeaderToOrigin Forward the Host header to origin? + * @param string $clientEmail + * @param string $privateKey + * @param string $accountName + * @param string $container + * @param string $sasToken + * @param string $clientID akeneo API client ID + * @param string $clientSecret akeneo API client secret + * @param string $password akeneo API password + * @param string $username akeneo API username */ public function update( string $id, - $origin, - ?RequestOptions $requestOptions = null - ): S31|S3Compatible1|CloudinaryBackup1|WebFolder1|WebProxy1|Gcs1|AzureBlob1|AkeneoPim1 { + $accessKey, + $bucket, + $name, + $secretKey, + $type, + $baseURLForCanonicalHeader = omit, + $includeCanonicalHeader = omit, + $prefix = omit, + $endpoint, + $s3ForcePathStyle = omit, + $baseURL, + $forwardHostHeaderToOrigin = omit, + $clientEmail, + $privateKey, + $accountName, + $container, + $sasToken, + $clientID, + $clientSecret, + $password, + $username, + ?RequestOptions $requestOptions = null, + ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { [$parsed, $options] = OriginUpdateParams::parseRequest( - ['origin' => $origin], - $requestOptions + [ + 'accessKey' => $accessKey, + 'bucket' => $bucket, + 'name' => $name, + 'secretKey' => $secretKey, + 'type' => $type, + 'baseURLForCanonicalHeader' => $baseURLForCanonicalHeader, + 'includeCanonicalHeader' => $includeCanonicalHeader, + 'prefix' => $prefix, + 'endpoint' => $endpoint, + 's3ForcePathStyle' => $s3ForcePathStyle, + 'baseURL' => $baseURL, + 'forwardHostHeaderToOrigin' => $forwardHostHeaderToOrigin, + 'clientEmail' => $clientEmail, + 'privateKey' => $privateKey, + 'accountName' => $accountName, + 'container' => $container, + 'sasToken' => $sasToken, + 'clientID' => $clientID, + 'clientSecret' => $clientSecret, + 'password' => $password, + 'username' => $username, + ], + $requestOptions, ); // @phpstan-ignore-next-line; return $this->client->request( method: 'put', path: ['v1/accounts/origins/%1$s', $id], - body: (object) $parsed['origin'], + body: (object) $parsed, options: $options, convert: OriginResponse::class, ); @@ -96,7 +214,7 @@ public function update( * **Note:** This API is currently in beta. * Returns an array of all configured origins for the current account. * - * @return list + * @return list */ public function list(?RequestOptions $requestOptions = null): array { @@ -137,7 +255,7 @@ public function delete( public function get( string $id, ?RequestOptions $requestOptions = null - ): S31|S3Compatible1|CloudinaryBackup1|WebFolder1|WebProxy1|Gcs1|AzureBlob1|AkeneoPim1 { + ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { // @phpstan-ignore-next-line; return $this->client->request( method: 'get', diff --git a/src/Core/Services/FilesService.php b/src/Core/Services/FilesService.php index 2bdde777..c421314f 100644 --- a/src/Core/Services/FilesService.php +++ b/src/Core/Services/FilesService.php @@ -20,8 +20,7 @@ use ImageKit\Files\FileRenameParams; use ImageKit\Files\FileRenameResponse; use ImageKit\Files\FileUpdateParams; -use ImageKit\Files\FileUpdateParams\Update\ChangePublicationStatus; -use ImageKit\Files\FileUpdateParams\Update\UpdateFileDetails; +use ImageKit\Files\FileUpdateParams\Publish; use ImageKit\Files\FileUpdateResponse; use ImageKit\Files\FileUploadParams; use ImageKit\Files\FileUploadParams\ResponseField; @@ -63,23 +62,51 @@ public function __construct(private Client $client) * * This API updates the details or attributes of the current version of the file. You can update `tags`, `customCoordinates`, `customMetadata`, publication status, remove existing `AITags` and apply extensions using this API. * - * @param UpdateFileDetails|ChangePublicationStatus $update + * @param string|null $customCoordinates Define an important area in the image in the format `x,y,width,height` e.g. `10,10,100,100`. Send `null` to unset this value. + * @param array $customMetadata A key-value data to be associated with the asset. To unset a key, send `null` value for that key. Before setting any custom metadata on an asset you have to create the field using custom metadata fields API. + * @param string $description optional text to describe the contents of the file + * @param list $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. + * @param string|list $removeAITags An array of AITags associated with the file that you want to remove, e.g. `["car", "vehicle", "motorsports"]`. + * + * If you want to remove all AITags associated with the file, send a string - "all". + * + * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. + * @param list|null $tags An array of tags associated with the file, such as `["tag1", "tag2"]`. Send `null` to unset all tags associated with the file. + * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + * @param Publish $publish configure the publication status of a file and its versions */ public function update( string $fileID, - $update = omit, - ?RequestOptions $requestOptions = null + $customCoordinates = omit, + $customMetadata = omit, + $description = omit, + $extensions = omit, + $removeAITags = omit, + $tags = omit, + $webhookURL = omit, + $publish = omit, + ?RequestOptions $requestOptions = null, ): FileUpdateResponse { [$parsed, $options] = FileUpdateParams::parseRequest( - ['update' => $update], - $requestOptions + [ + 'customCoordinates' => $customCoordinates, + 'customMetadata' => $customMetadata, + 'description' => $description, + 'extensions' => $extensions, + 'removeAITags' => $removeAITags, + 'tags' => $tags, + 'webhookURL' => $webhookURL, + 'publish' => $publish, + ], + $requestOptions, ); // @phpstan-ignore-next-line; return $this->client->request( method: 'patch', path: ['v1/files/%1$s/details', $fileID], - body: (object) $parsed['update'], + body: (object) $parsed, options: $options, convert: FileUpdateResponse::class, ); diff --git a/src/Files/FileUpdateParams.php b/src/Files/FileUpdateParams.php index 195b76da..0fb8c92e 100644 --- a/src/Files/FileUpdateParams.php +++ b/src/Files/FileUpdateParams.php @@ -8,8 +8,12 @@ use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Concerns\SdkParams; use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Files\FileUpdateParams\Update\ChangePublicationStatus; -use ImageKit\Files\FileUpdateParams\Update\UpdateFileDetails; +use ImageKit\ExtensionItem; +use ImageKit\ExtensionItem\AIAutoDescription; +use ImageKit\ExtensionItem\AutoTaggingExtension; +use ImageKit\ExtensionItem\RemoveBg; +use ImageKit\Files\FileUpdateParams\Publish; +use ImageKit\Files\FileUpdateParams\RemoveAITags; /** * An object containing the method's parameters. @@ -28,7 +32,14 @@ * @see ImageKit\Files->update * * @phpstan-type file_update_params = array{ - * update?: UpdateFileDetails|ChangePublicationStatus + * customCoordinates?: string|null, + * customMetadata?: array, + * description?: string, + * extensions?: list, + * removeAITags?: string|list, + * tags?: list|null, + * webhookURL?: string, + * publish?: Publish, * } */ final class FileUpdateParams implements BaseModel @@ -37,8 +48,65 @@ final class FileUpdateParams implements BaseModel use SdkModel; use SdkParams; + /** + * Define an important area in the image in the format `x,y,width,height` e.g. `10,10,100,100`. Send `null` to unset this value. + */ + #[Api(nullable: true, optional: true)] + public ?string $customCoordinates; + + /** + * A key-value data to be associated with the asset. To unset a key, send `null` value for that key. Before setting any custom metadata on an asset you have to create the field using custom metadata fields API. + * + * @var array|null $customMetadata + */ + #[Api(map: 'mixed', optional: true)] + public ?array $customMetadata; + + /** + * Optional text to describe the contents of the file. + */ #[Api(optional: true)] - public UpdateFileDetails|ChangePublicationStatus|null $update; + public ?string $description; + + /** + * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. + * + * @var list|null $extensions + */ + #[Api(list: ExtensionItem::class, optional: true)] + public ?array $extensions; + + /** + * An array of AITags associated with the file that you want to remove, e.g. `["car", "vehicle", "motorsports"]`. + * + * If you want to remove all AITags associated with the file, send a string - "all". + * + * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. + * + * @var string|list|null $removeAITags + */ + #[Api(union: RemoveAITags::class, optional: true)] + public string|array|null $removeAITags; + + /** + * An array of tags associated with the file, such as `["tag1", "tag2"]`. Send `null` to unset all tags associated with the file. + * + * @var list|null $tags + */ + #[Api(list: 'string', nullable: true, optional: true)] + public ?array $tags; + + /** + * The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + */ + #[Api('webhookUrl', optional: true)] + public ?string $webhookURL; + + /** + * Configure the publication status of a file and its versions. + */ + #[Api(optional: true)] + public ?Publish $publish; public function __construct() { @@ -49,22 +117,132 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param array $customMetadata + * @param list $extensions + * @param string|list $removeAITags + * @param list|null $tags */ public static function with( - UpdateFileDetails|ChangePublicationStatus|null $update = null + ?string $customCoordinates = null, + ?array $customMetadata = null, + ?string $description = null, + ?array $extensions = null, + string|array|null $removeAITags = null, + ?array $tags = null, + ?string $webhookURL = null, + ?Publish $publish = null, ): self { $obj = new self; - null !== $update && $obj->update = $update; + null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; + null !== $customMetadata && $obj->customMetadata = $customMetadata; + null !== $description && $obj->description = $description; + null !== $extensions && $obj->extensions = $extensions; + null !== $removeAITags && $obj->removeAITags = $removeAITags; + null !== $tags && $obj->tags = $tags; + null !== $webhookURL && $obj->webhookURL = $webhookURL; + null !== $publish && $obj->publish = $publish; return $obj; } - public function withUpdate( - UpdateFileDetails|ChangePublicationStatus $update - ): self { + /** + * Define an important area in the image in the format `x,y,width,height` e.g. `10,10,100,100`. Send `null` to unset this value. + */ + public function withCustomCoordinates(?string $customCoordinates): self + { + $obj = clone $this; + $obj->customCoordinates = $customCoordinates; + + return $obj; + } + + /** + * A key-value data to be associated with the asset. To unset a key, send `null` value for that key. Before setting any custom metadata on an asset you have to create the field using custom metadata fields API. + * + * @param array $customMetadata + */ + public function withCustomMetadata(array $customMetadata): self + { + $obj = clone $this; + $obj->customMetadata = $customMetadata; + + return $obj; + } + + /** + * Optional text to describe the contents of the file. + */ + public function withDescription(string $description): self + { + $obj = clone $this; + $obj->description = $description; + + return $obj; + } + + /** + * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. + * + * @param list $extensions + */ + public function withExtensions(array $extensions): self + { + $obj = clone $this; + $obj->extensions = $extensions; + + return $obj; + } + + /** + * An array of AITags associated with the file that you want to remove, e.g. `["car", "vehicle", "motorsports"]`. + * + * If you want to remove all AITags associated with the file, send a string - "all". + * + * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. + * + * @param string|list $removeAITags + */ + public function withRemoveAITags(string|array $removeAITags): self + { + $obj = clone $this; + $obj->removeAITags = $removeAITags; + + return $obj; + } + + /** + * An array of tags associated with the file, such as `["tag1", "tag2"]`. Send `null` to unset all tags associated with the file. + * + * @param list|null $tags + */ + public function withTags(?array $tags): self + { + $obj = clone $this; + $obj->tags = $tags; + + return $obj; + } + + /** + * The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + */ + public function withWebhookURL(string $webhookURL): self + { + $obj = clone $this; + $obj->webhookURL = $webhookURL; + + return $obj; + } + + /** + * Configure the publication status of a file and its versions. + */ + public function withPublish(Publish $publish): self + { $obj = clone $this; - $obj->update = $update; + $obj->publish = $publish; return $obj; } diff --git a/src/Files/FileUpdateParams/Update/ChangePublicationStatus/Publish.php b/src/Files/FileUpdateParams/Publish.php similarity index 96% rename from src/Files/FileUpdateParams/Update/ChangePublicationStatus/Publish.php rename to src/Files/FileUpdateParams/Publish.php index ffd75ef1..37535e9f 100644 --- a/src/Files/FileUpdateParams/Update/ChangePublicationStatus/Publish.php +++ b/src/Files/FileUpdateParams/Publish.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUpdateParams\Update\ChangePublicationStatus; +namespace ImageKit\Files\FileUpdateParams; use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; diff --git a/src/Files/FileUpdateParams/Update/UpdateFileDetails/RemoveAITags.php b/src/Files/FileUpdateParams/RemoveAITags.php similarity index 92% rename from src/Files/FileUpdateParams/Update/UpdateFileDetails/RemoveAITags.php rename to src/Files/FileUpdateParams/RemoveAITags.php index e30a5980..46ffd4ad 100644 --- a/src/Files/FileUpdateParams/Update/UpdateFileDetails/RemoveAITags.php +++ b/src/Files/FileUpdateParams/RemoveAITags.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUpdateParams\Update\UpdateFileDetails; +namespace ImageKit\Files\FileUpdateParams; use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; diff --git a/src/Files/FileUpdateParams/Update.php b/src/Files/FileUpdateParams/Update.php deleted file mode 100644 index 452427d7..00000000 --- a/src/Files/FileUpdateParams/Update.php +++ /dev/null @@ -1,25 +0,0 @@ -|array - */ - public static function variants(): array - { - return [UpdateFileDetails::class, ChangePublicationStatus::class]; - } -} diff --git a/src/Files/FileUpdateParams/Update/ChangePublicationStatus.php b/src/Files/FileUpdateParams/Update/ChangePublicationStatus.php deleted file mode 100644 index 876df8c0..00000000 --- a/src/Files/FileUpdateParams/Update/ChangePublicationStatus.php +++ /dev/null @@ -1,55 +0,0 @@ - */ - use SdkModel; - - /** - * Configure the publication status of a file and its versions. - */ - #[Api(optional: true)] - public ?Publish $publish; - - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - */ - public static function with(?Publish $publish = null): self - { - $obj = new self; - - null !== $publish && $obj->publish = $publish; - - return $obj; - } - - /** - * Configure the publication status of a file and its versions. - */ - public function withPublish(Publish $publish): self - { - $obj = clone $this; - $obj->publish = $publish; - - return $obj; - } -} diff --git a/src/Files/FileUpdateParams/Update/UpdateFileDetails.php b/src/Files/FileUpdateParams/Update/UpdateFileDetails.php deleted file mode 100644 index 0372ca7b..00000000 --- a/src/Files/FileUpdateParams/Update/UpdateFileDetails.php +++ /dev/null @@ -1,211 +0,0 @@ -|null, - * description?: string|null, - * extensions?: list|null, - * removeAITags?: string|null|list, - * tags?: list|null, - * webhookURL?: string|null, - * } - */ -final class UpdateFileDetails implements BaseModel -{ - /** @use SdkModel */ - use SdkModel; - - /** - * Define an important area in the image in the format `x,y,width,height` e.g. `10,10,100,100`. Send `null` to unset this value. - */ - #[Api(nullable: true, optional: true)] - public ?string $customCoordinates; - - /** - * A key-value data to be associated with the asset. To unset a key, send `null` value for that key. Before setting any custom metadata on an asset you have to create the field using custom metadata fields API. - * - * @var array|null $customMetadata - */ - #[Api(map: 'mixed', optional: true)] - public ?array $customMetadata; - - /** - * Optional text to describe the contents of the file. - */ - #[Api(optional: true)] - public ?string $description; - - /** - * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. - * - * @var list|null $extensions - */ - #[Api(list: ExtensionItem::class, optional: true)] - public ?array $extensions; - - /** - * An array of AITags associated with the file that you want to remove, e.g. `["car", "vehicle", "motorsports"]`. - * - * If you want to remove all AITags associated with the file, send a string - "all". - * - * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. - * - * @var string|list|null $removeAITags - */ - #[Api(union: RemoveAITags::class, optional: true)] - public string|array|null $removeAITags; - - /** - * An array of tags associated with the file, such as `["tag1", "tag2"]`. Send `null` to unset all tags associated with the file. - * - * @var list|null $tags - */ - #[Api(list: 'string', nullable: true, optional: true)] - public ?array $tags; - - /** - * The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. - */ - #[Api('webhookUrl', optional: true)] - public ?string $webhookURL; - - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - * - * @param array $customMetadata - * @param list $extensions - * @param string|list $removeAITags - * @param list|null $tags - */ - public static function with( - ?string $customCoordinates = null, - ?array $customMetadata = null, - ?string $description = null, - ?array $extensions = null, - string|array|null $removeAITags = null, - ?array $tags = null, - ?string $webhookURL = null, - ): self { - $obj = new self; - - null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; - null !== $customMetadata && $obj->customMetadata = $customMetadata; - null !== $description && $obj->description = $description; - null !== $extensions && $obj->extensions = $extensions; - null !== $removeAITags && $obj->removeAITags = $removeAITags; - null !== $tags && $obj->tags = $tags; - null !== $webhookURL && $obj->webhookURL = $webhookURL; - - return $obj; - } - - /** - * Define an important area in the image in the format `x,y,width,height` e.g. `10,10,100,100`. Send `null` to unset this value. - */ - public function withCustomCoordinates(?string $customCoordinates): self - { - $obj = clone $this; - $obj->customCoordinates = $customCoordinates; - - return $obj; - } - - /** - * A key-value data to be associated with the asset. To unset a key, send `null` value for that key. Before setting any custom metadata on an asset you have to create the field using custom metadata fields API. - * - * @param array $customMetadata - */ - public function withCustomMetadata(array $customMetadata): self - { - $obj = clone $this; - $obj->customMetadata = $customMetadata; - - return $obj; - } - - /** - * Optional text to describe the contents of the file. - */ - public function withDescription(string $description): self - { - $obj = clone $this; - $obj->description = $description; - - return $obj; - } - - /** - * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. - * - * @param list $extensions - */ - public function withExtensions(array $extensions): self - { - $obj = clone $this; - $obj->extensions = $extensions; - - return $obj; - } - - /** - * An array of AITags associated with the file that you want to remove, e.g. `["car", "vehicle", "motorsports"]`. - * - * If you want to remove all AITags associated with the file, send a string - "all". - * - * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. - * - * @param string|list $removeAITags - */ - public function withRemoveAITags(string|array $removeAITags): self - { - $obj = clone $this; - $obj->removeAITags = $removeAITags; - - return $obj; - } - - /** - * An array of tags associated with the file, such as `["tag1", "tag2"]`. Send `null` to unset all tags associated with the file. - * - * @param list|null $tags - */ - public function withTags(?array $tags): self - { - $obj = clone $this; - $obj->tags = $tags; - - return $obj; - } - - /** - * The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. - */ - public function withWebhookURL(string $webhookURL): self - { - $obj = clone $this; - $obj->webhookURL = $webhookURL; - - return $obj; - } -} diff --git a/tests/Services/Accounts/OriginsTest.php b/tests/Services/Accounts/OriginsTest.php index eac91e2e..8dbcbec7 100644 --- a/tests/Services/Accounts/OriginsTest.php +++ b/tests/Services/Accounts/OriginsTest.php @@ -2,7 +2,6 @@ namespace Tests\Services\Accounts; -use ImageKit\Accounts\Origins\OriginRequest\S3; use ImageKit\Client; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; @@ -39,12 +38,22 @@ public function testCreate(): void } $result = $this->client->accounts->origins->create( - S3::with( - accessKey: 'AKIATEST123', - bucket: 'test-bucket', - name: 'My S3 Origin', - secretKey: 'secrettest123', - ), + accessKey: 'AKIAIOSFODNN7EXAMPLE', + bucket: 'gcs-media', + name: 'US S3 Storage', + secretKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', + type: 'AKENEO_PIM', + endpoint: 'https://s3.eu-central-1.wasabisys.com', + baseURL: 'https://akeneo.company.com', + clientEmail: 'service-account@project.iam.gserviceaccount.com', + privateKey: '-----BEGIN PRIVATE KEY-----\\nMIIEv...', + accountName: 'account123', + container: 'images', + sasToken: '?sv=2023-01-03&sr=c&sig=abc123', + clientID: 'akeneo-client-id', + clientSecret: 'akeneo-client-secret', + password: 'strongpassword123', + username: 'integration-user', ); $this->assertTrue(true); // @phpstan-ignore-line @@ -58,15 +67,22 @@ public function testCreateWithOptionalParams(): void } $result = $this->client->accounts->origins->create( - S3::with( - accessKey: 'AKIATEST123', - bucket: 'test-bucket', - name: 'My S3 Origin', - secretKey: 'secrettest123', - ) - ->withBaseURLForCanonicalHeader('https://cdn.example.com') - ->withIncludeCanonicalHeader(false) - ->withPrefix('images'), + accessKey: 'AKIAIOSFODNN7EXAMPLE', + bucket: 'gcs-media', + name: 'US S3 Storage', + secretKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', + type: 'AKENEO_PIM', + endpoint: 'https://s3.eu-central-1.wasabisys.com', + baseURL: 'https://akeneo.company.com', + clientEmail: 'service-account@project.iam.gserviceaccount.com', + privateKey: '-----BEGIN PRIVATE KEY-----\\nMIIEv...', + accountName: 'account123', + container: 'images', + sasToken: '?sv=2023-01-03&sr=c&sig=abc123', + clientID: 'akeneo-client-id', + clientSecret: 'akeneo-client-secret', + password: 'strongpassword123', + username: 'integration-user', ); $this->assertTrue(true); // @phpstan-ignore-line @@ -81,12 +97,22 @@ public function testUpdate(): void $result = $this->client->accounts->origins->update( 'id', - S3::with( - accessKey: 'AKIATEST123', - bucket: 'test-bucket', - name: 'My S3 Origin', - secretKey: 'secrettest123', - ), + accessKey: 'AKIAIOSFODNN7EXAMPLE', + bucket: 'gcs-media', + name: 'US S3 Storage', + secretKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', + type: 'AKENEO_PIM', + endpoint: 'https://s3.eu-central-1.wasabisys.com', + baseURL: 'https://akeneo.company.com', + clientEmail: 'service-account@project.iam.gserviceaccount.com', + privateKey: '-----BEGIN PRIVATE KEY-----\\nMIIEv...', + accountName: 'account123', + container: 'images', + sasToken: '?sv=2023-01-03&sr=c&sig=abc123', + clientID: 'akeneo-client-id', + clientSecret: 'akeneo-client-secret', + password: 'strongpassword123', + username: 'integration-user', ); $this->assertTrue(true); // @phpstan-ignore-line @@ -101,15 +127,22 @@ public function testUpdateWithOptionalParams(): void $result = $this->client->accounts->origins->update( 'id', - S3::with( - accessKey: 'AKIATEST123', - bucket: 'test-bucket', - name: 'My S3 Origin', - secretKey: 'secrettest123', - ) - ->withBaseURLForCanonicalHeader('https://cdn.example.com') - ->withIncludeCanonicalHeader(false) - ->withPrefix('images'), + accessKey: 'AKIAIOSFODNN7EXAMPLE', + bucket: 'gcs-media', + name: 'US S3 Storage', + secretKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', + type: 'AKENEO_PIM', + endpoint: 'https://s3.eu-central-1.wasabisys.com', + baseURL: 'https://akeneo.company.com', + clientEmail: 'service-account@project.iam.gserviceaccount.com', + privateKey: '-----BEGIN PRIVATE KEY-----\\nMIIEv...', + accountName: 'account123', + container: 'images', + sasToken: '?sv=2023-01-03&sr=c&sig=abc123', + clientID: 'akeneo-client-id', + clientSecret: 'akeneo-client-secret', + password: 'strongpassword123', + username: 'integration-user', ); $this->assertTrue(true); // @phpstan-ignore-line From 4008775b50e0674f77e0c3ad3d8ba1577ebb806d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 07:05:33 +0000 Subject: [PATCH 020/193] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 335e38ec..e13d3275 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-0470196862abd722b09f1af798d6f2bcbdeba0f82d1162f57c287b1a43233531.yml -openapi_spec_hash: 043dd7c67d741d0034b86f2fc0bce072 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-afb67c3a2098b1a2dca37d0995d183fa6cf59dd144ed47bcdb924f14e3cc90a3.yml +openapi_spec_hash: 55a2f38df85126a87d1be0b27b9b8470 config_hash: a652d68098d82eaf611a49507fb4b831 From a635441aafc3f0cfa5e686073fa9d5e55b273536 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 4 Sep 2025 07:11:21 +0000 Subject: [PATCH 021/193] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index e13d3275..bbfdcb43 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-afb67c3a2098b1a2dca37d0995d183fa6cf59dd144ed47bcdb924f14e3cc90a3.yml -openapi_spec_hash: 55a2f38df85126a87d1be0b27b9b8470 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-bc7c0d27962b30c19c778656988e154b54696819389289f34420a5e5fdfbd3b8.yml +openapi_spec_hash: 1bfde02a63416c036e9545927f727459 config_hash: a652d68098d82eaf611a49507fb4b831 From c3ea060ee47054167b8db064d3b423065fb106c1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 5 Sep 2025 02:40:16 +0000 Subject: [PATCH 022/193] fix: decorate with enum label for all enum classes --- src/Files/FileUpdateParams/RemoveAITags.php | 3 ++- src/SolidColorOverlayTransformation/Gradient.php | 3 ++- src/SolidColorOverlayTransformation/Radius.php | 3 ++- src/TextOverlayTransformation/Radius.php | 3 ++- src/Transformation/AIDropShadow.php | 3 ++- src/Transformation/Gradient.php | 3 ++- src/Transformation/Radius.php | 3 ++- src/Transformation/Shadow.php | 3 ++- src/Transformation/Sharpen.php | 3 ++- src/Transformation/Trim.php | 3 ++- src/Transformation/UnsharpMask.php | 3 ++- 11 files changed, 22 insertions(+), 11 deletions(-) diff --git a/src/Files/FileUpdateParams/RemoveAITags.php b/src/Files/FileUpdateParams/RemoveAITags.php index 46ffd4ad..6ded3696 100644 --- a/src/Files/FileUpdateParams/RemoveAITags.php +++ b/src/Files/FileUpdateParams/RemoveAITags.php @@ -7,6 +7,7 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\EnumOf; use ImageKit\Core\Conversion\ListOf; /** @@ -26,6 +27,6 @@ final class RemoveAITags implements ConverterSource */ public static function variants(): array { - return [new ListOf('string'), STAINLESS_FIXME_::class]; + return [new ListOf('string'), new EnumOf(['all'])]; } } diff --git a/src/SolidColorOverlayTransformation/Gradient.php b/src/SolidColorOverlayTransformation/Gradient.php index eb408f77..04bc6598 100644 --- a/src/SolidColorOverlayTransformation/Gradient.php +++ b/src/SolidColorOverlayTransformation/Gradient.php @@ -7,6 +7,7 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\EnumOf; /** * Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. @@ -22,6 +23,6 @@ final class Gradient implements ConverterSource */ public static function variants(): array { - return [STAINLESS_FIXME_::class, 'string']; + return [new EnumOf([true]), 'string']; } } diff --git a/src/SolidColorOverlayTransformation/Radius.php b/src/SolidColorOverlayTransformation/Radius.php index 273bf7ce..eeaf5961 100644 --- a/src/SolidColorOverlayTransformation/Radius.php +++ b/src/SolidColorOverlayTransformation/Radius.php @@ -7,6 +7,7 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\EnumOf; /** * Specifies the corner radius of the solid color overlay. Set to `max` for circular or oval shape. @@ -22,6 +23,6 @@ final class Radius implements ConverterSource */ public static function variants(): array { - return ['float', STAINLESS_FIXME_::class]; + return ['float', new EnumOf(['max'])]; } } diff --git a/src/TextOverlayTransformation/Radius.php b/src/TextOverlayTransformation/Radius.php index 51754284..798d59cd 100644 --- a/src/TextOverlayTransformation/Radius.php +++ b/src/TextOverlayTransformation/Radius.php @@ -7,6 +7,7 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\EnumOf; /** * Specifies the corner radius of the text overlay. @@ -22,6 +23,6 @@ final class Radius implements ConverterSource */ public static function variants(): array { - return ['float', STAINLESS_FIXME_::class]; + return ['float', new EnumOf(['max'])]; } } diff --git a/src/Transformation/AIDropShadow.php b/src/Transformation/AIDropShadow.php index 0956b9dc..cc58b5d5 100644 --- a/src/Transformation/AIDropShadow.php +++ b/src/Transformation/AIDropShadow.php @@ -7,6 +7,7 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\EnumOf; /** * Adds an AI-based drop shadow around a foreground object on a transparent or removed background. @@ -25,6 +26,6 @@ final class AIDropShadow implements ConverterSource */ public static function variants(): array { - return [STAINLESS_FIXME_::class, 'string']; + return [new EnumOf([true]), 'string']; } } diff --git a/src/Transformation/Gradient.php b/src/Transformation/Gradient.php index e3092355..62d7045a 100644 --- a/src/Transformation/Gradient.php +++ b/src/Transformation/Gradient.php @@ -7,6 +7,7 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\EnumOf; /** * Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. @@ -22,6 +23,6 @@ final class Gradient implements ConverterSource */ public static function variants(): array { - return [STAINLESS_FIXME_::class, 'string']; + return [new EnumOf([true]), 'string']; } } diff --git a/src/Transformation/Radius.php b/src/Transformation/Radius.php index e0db8a3c..755730dc 100644 --- a/src/Transformation/Radius.php +++ b/src/Transformation/Radius.php @@ -7,6 +7,7 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\EnumOf; /** * Specifies the corner radius for rounded corners (e.g., 20) or `max` for circular or oval shape. @@ -22,6 +23,6 @@ final class Radius implements ConverterSource */ public static function variants(): array { - return ['float', STAINLESS_FIXME_::class]; + return ['float', new EnumOf(['max'])]; } } diff --git a/src/Transformation/Shadow.php b/src/Transformation/Shadow.php index be32ac24..b07eae0c 100644 --- a/src/Transformation/Shadow.php +++ b/src/Transformation/Shadow.php @@ -7,6 +7,7 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\EnumOf; /** * Adds a shadow beneath solid objects in an image with a transparent background. @@ -24,6 +25,6 @@ final class Shadow implements ConverterSource */ public static function variants(): array { - return [STAINLESS_FIXME_::class, 'string']; + return [new EnumOf([true]), 'string']; } } diff --git a/src/Transformation/Sharpen.php b/src/Transformation/Sharpen.php index 760f37d1..f1f9b359 100644 --- a/src/Transformation/Sharpen.php +++ b/src/Transformation/Sharpen.php @@ -7,6 +7,7 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\EnumOf; /** * Sharpens the input image, highlighting edges and finer details. @@ -23,6 +24,6 @@ final class Sharpen implements ConverterSource */ public static function variants(): array { - return [STAINLESS_FIXME_::class, 'float']; + return [new EnumOf([true]), 'float']; } } diff --git a/src/Transformation/Trim.php b/src/Transformation/Trim.php index 650352e3..c0ebce32 100644 --- a/src/Transformation/Trim.php +++ b/src/Transformation/Trim.php @@ -7,6 +7,7 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\EnumOf; /** * Useful for images with a solid or nearly solid background and a central object. This parameter trims the background, @@ -23,6 +24,6 @@ final class Trim implements ConverterSource */ public static function variants(): array { - return [STAINLESS_FIXME_::class, 'float']; + return [new EnumOf([true]), 'float']; } } diff --git a/src/Transformation/UnsharpMask.php b/src/Transformation/UnsharpMask.php index 5bd59aef..687edf59 100644 --- a/src/Transformation/UnsharpMask.php +++ b/src/Transformation/UnsharpMask.php @@ -7,6 +7,7 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\EnumOf; /** * Applies Unsharp Masking (USM), an image sharpening technique. @@ -23,6 +24,6 @@ final class UnsharpMask implements ConverterSource */ public static function variants(): array { - return [STAINLESS_FIXME_::class, 'string']; + return [new EnumOf([true]), 'string']; } } From 76b7d1a3bec0ff36b996eceb7af07a54f4a8439a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 5 Sep 2025 14:56:02 +0000 Subject: [PATCH 023/193] chore(internal): codegen related update --- src/Core/Util.php | 11 +++++----- tests/Services/Accounts/OriginsTest.php | 14 ++++++------- tests/Services/Accounts/URLEndpointsTest.php | 14 ++++++------- tests/Services/Accounts/UsageTest.php | 4 ++-- tests/Services/AssetsTest.php | 2 +- tests/Services/Beta/V2/FilesTest.php | 4 ++-- tests/Services/Cache/InvalidationTest.php | 6 +++--- tests/Services/CustomMetadataFieldsTest.php | 10 ++++----- tests/Services/Files/BulkTest.php | 16 +++++++------- tests/Services/Files/MetadataTest.php | 6 +++--- tests/Services/Files/VersionsTest.php | 14 ++++++------- tests/Services/FilesTest.php | 22 ++++++++++---------- tests/Services/Folders/JobTest.php | 2 +- tests/Services/FoldersTest.php | 20 +++++++++--------- 14 files changed, 73 insertions(+), 72 deletions(-) diff --git a/src/Core/Util.php b/src/Core/Util.php index 9c18b892..84dc703e 100644 --- a/src/Core/Util.php +++ b/src/Core/Util.php @@ -10,6 +10,11 @@ use Psr\Http\Message\StreamInterface; use Psr\Http\Message\UriInterface; +/** + * @phpstan-type SSEvent = array{ + * event?: string|null, data?: string|null, id?: string|null, retry?: int|null + * } + */ final class Util { public const BUF_SIZE = 8192; @@ -239,11 +244,7 @@ public static function decodeLines(\Iterator $stream): \Iterator /** * @param \Iterator $lines * - * @return \Generator< - * array{ - * event?: string|null, data?: string|null, id?: string|null, retry?: int|null - * }, - * > + * @return \Generator */ public static function decodeSSE(\Iterator $lines): \Generator { diff --git a/tests/Services/Accounts/OriginsTest.php b/tests/Services/Accounts/OriginsTest.php index 8dbcbec7..eb26a0f1 100644 --- a/tests/Services/Accounts/OriginsTest.php +++ b/tests/Services/Accounts/OriginsTest.php @@ -56,7 +56,7 @@ public function testCreate(): void username: 'integration-user', ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -85,7 +85,7 @@ public function testCreateWithOptionalParams(): void username: 'integration-user', ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -115,7 +115,7 @@ public function testUpdate(): void username: 'integration-user', ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -145,7 +145,7 @@ public function testUpdateWithOptionalParams(): void username: 'integration-user', ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -157,7 +157,7 @@ public function testList(): void $result = $this->client->accounts->origins->list(); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -169,7 +169,7 @@ public function testDelete(): void $result = $this->client->accounts->origins->delete('id'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -181,6 +181,6 @@ public function testGet(): void $result = $this->client->accounts->origins->get('id'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } } diff --git a/tests/Services/Accounts/URLEndpointsTest.php b/tests/Services/Accounts/URLEndpointsTest.php index 7c0bf515..e8d90155 100644 --- a/tests/Services/Accounts/URLEndpointsTest.php +++ b/tests/Services/Accounts/URLEndpointsTest.php @@ -41,7 +41,7 @@ public function testCreate(): void description: 'My custom URL endpoint' ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -55,7 +55,7 @@ public function testCreateWithOptionalParams(): void description: 'My custom URL endpoint' ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -70,7 +70,7 @@ public function testUpdate(): void description: 'My custom URL endpoint' ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -85,7 +85,7 @@ public function testUpdateWithOptionalParams(): void description: 'My custom URL endpoint' ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -97,7 +97,7 @@ public function testList(): void $result = $this->client->accounts->urlEndpoints->list(); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -109,7 +109,7 @@ public function testDelete(): void $result = $this->client->accounts->urlEndpoints->delete('id'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -121,6 +121,6 @@ public function testGet(): void $result = $this->client->accounts->urlEndpoints->get('id'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } } diff --git a/tests/Services/Accounts/UsageTest.php b/tests/Services/Accounts/UsageTest.php index 714169a6..9bbfac6e 100644 --- a/tests/Services/Accounts/UsageTest.php +++ b/tests/Services/Accounts/UsageTest.php @@ -42,7 +42,7 @@ public function testGet(): void startDate: new \DateTimeImmutable('2019-12-27'), ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -57,6 +57,6 @@ public function testGetWithOptionalParams(): void startDate: new \DateTimeImmutable('2019-12-27'), ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } } diff --git a/tests/Services/AssetsTest.php b/tests/Services/AssetsTest.php index 0b3ed342..3aae8c19 100644 --- a/tests/Services/AssetsTest.php +++ b/tests/Services/AssetsTest.php @@ -39,6 +39,6 @@ public function testList(): void $result = $this->client->assets->list(); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } } diff --git a/tests/Services/Beta/V2/FilesTest.php b/tests/Services/Beta/V2/FilesTest.php index ced4540e..345801e4 100644 --- a/tests/Services/Beta/V2/FilesTest.php +++ b/tests/Services/Beta/V2/FilesTest.php @@ -42,7 +42,7 @@ public function testUpload(): void fileName: 'fileName' ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -57,6 +57,6 @@ public function testUploadWithOptionalParams(): void fileName: 'fileName' ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } } diff --git a/tests/Services/Cache/InvalidationTest.php b/tests/Services/Cache/InvalidationTest.php index 276c6107..1575824f 100644 --- a/tests/Services/Cache/InvalidationTest.php +++ b/tests/Services/Cache/InvalidationTest.php @@ -41,7 +41,7 @@ public function testCreate(): void 'https://ik.imagekit.io/your_imagekit_id/default-image.jpg' ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -55,7 +55,7 @@ public function testCreateWithOptionalParams(): void 'https://ik.imagekit.io/your_imagekit_id/default-image.jpg' ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -67,6 +67,6 @@ public function testGet(): void $result = $this->client->cache->invalidation->get('requestId'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } } diff --git a/tests/Services/CustomMetadataFieldsTest.php b/tests/Services/CustomMetadataFieldsTest.php index 92459823..bccfc446 100644 --- a/tests/Services/CustomMetadataFieldsTest.php +++ b/tests/Services/CustomMetadataFieldsTest.php @@ -44,7 +44,7 @@ public function testCreate(): void schema: Schema::with(type: 'Number') ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -67,7 +67,7 @@ public function testCreateWithOptionalParams(): void ->withSelectOptions(['small', 'medium', 'large', 30, 40, true]), ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -79,7 +79,7 @@ public function testUpdate(): void $result = $this->client->customMetadataFields->update('id'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -91,7 +91,7 @@ public function testList(): void $result = $this->client->customMetadataFields->list(); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -103,6 +103,6 @@ public function testDelete(): void $result = $this->client->customMetadataFields->delete('id'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } } diff --git a/tests/Services/Files/BulkTest.php b/tests/Services/Files/BulkTest.php index dc17a9c6..73a5d80a 100644 --- a/tests/Services/Files/BulkTest.php +++ b/tests/Services/Files/BulkTest.php @@ -41,7 +41,7 @@ public function testDelete(): void ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'] ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -55,7 +55,7 @@ public function testDeleteWithOptionalParams(): void ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'] ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -70,7 +70,7 @@ public function testAddTags(): void tags: ['t-shirt', 'round-neck', 'sale2019'], ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -85,7 +85,7 @@ public function testAddTagsWithOptionalParams(): void tags: ['t-shirt', 'round-neck', 'sale2019'], ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -100,7 +100,7 @@ public function testRemoveAITags(): void fileIDs: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -115,7 +115,7 @@ public function testRemoveAITagsWithOptionalParams(): void fileIDs: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -130,7 +130,7 @@ public function testRemoveTags(): void tags: ['t-shirt', 'round-neck', 'sale2019'], ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -145,6 +145,6 @@ public function testRemoveTagsWithOptionalParams(): void tags: ['t-shirt', 'round-neck', 'sale2019'], ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } } diff --git a/tests/Services/Files/MetadataTest.php b/tests/Services/Files/MetadataTest.php index c0cd9366..1e8517ff 100644 --- a/tests/Services/Files/MetadataTest.php +++ b/tests/Services/Files/MetadataTest.php @@ -39,7 +39,7 @@ public function testGet(): void $result = $this->client->files->metadata->get('fileId'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -51,7 +51,7 @@ public function testGetFromURL(): void $result = $this->client->files->metadata->getFromURL('https://example.com'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -63,6 +63,6 @@ public function testGetFromURLWithOptionalParams(): void $result = $this->client->files->metadata->getFromURL('https://example.com'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } } diff --git a/tests/Services/Files/VersionsTest.php b/tests/Services/Files/VersionsTest.php index c88bff80..c92db397 100644 --- a/tests/Services/Files/VersionsTest.php +++ b/tests/Services/Files/VersionsTest.php @@ -39,7 +39,7 @@ public function testList(): void $result = $this->client->files->versions->list('fileId'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -51,7 +51,7 @@ public function testDelete(): void $result = $this->client->files->versions->delete('versionId', 'fileId'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -63,7 +63,7 @@ public function testDeleteWithOptionalParams(): void $result = $this->client->files->versions->delete('versionId', 'fileId'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -75,7 +75,7 @@ public function testGet(): void $result = $this->client->files->versions->get('versionId', 'fileId'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -87,7 +87,7 @@ public function testGetWithOptionalParams(): void $result = $this->client->files->versions->get('versionId', 'fileId'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -99,7 +99,7 @@ public function testRestore(): void $result = $this->client->files->versions->restore('versionId', 'fileId'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -111,6 +111,6 @@ public function testRestoreWithOptionalParams(): void $result = $this->client->files->versions->restore('versionId', 'fileId'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } } diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index 457d84a4..665d0714 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -39,7 +39,7 @@ public function testUpdate(): void $result = $this->client->files->update('fileId'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -51,7 +51,7 @@ public function testDelete(): void $result = $this->client->files->delete('fileId'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -66,7 +66,7 @@ public function testCopy(): void sourceFilePath: '/path/to/file.jpg', ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -81,7 +81,7 @@ public function testCopyWithOptionalParams(): void sourceFilePath: '/path/to/file.jpg', ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -93,7 +93,7 @@ public function testGet(): void $result = $this->client->files->get('fileId'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -108,7 +108,7 @@ public function testMove(): void sourceFilePath: '/path/to/file.jpg', ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -123,7 +123,7 @@ public function testMoveWithOptionalParams(): void sourceFilePath: '/path/to/file.jpg', ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -138,7 +138,7 @@ public function testRename(): void newFileName: 'newFileName.jpg' ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -153,7 +153,7 @@ public function testRenameWithOptionalParams(): void newFileName: 'newFileName.jpg' ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -165,7 +165,7 @@ public function testUpload(): void $result = $this->client->files->upload(file: 'file', fileName: 'fileName'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -177,6 +177,6 @@ public function testUploadWithOptionalParams(): void $result = $this->client->files->upload(file: 'file', fileName: 'fileName'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } } diff --git a/tests/Services/Folders/JobTest.php b/tests/Services/Folders/JobTest.php index e4e4b467..ce51df1f 100644 --- a/tests/Services/Folders/JobTest.php +++ b/tests/Services/Folders/JobTest.php @@ -39,6 +39,6 @@ public function testGet(): void $result = $this->client->folders->job->get('jobId'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } } diff --git a/tests/Services/FoldersTest.php b/tests/Services/FoldersTest.php index ab2bc197..5aacd840 100644 --- a/tests/Services/FoldersTest.php +++ b/tests/Services/FoldersTest.php @@ -42,7 +42,7 @@ public function testCreate(): void parentFolderPath: '/product/images/' ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -57,7 +57,7 @@ public function testCreateWithOptionalParams(): void parentFolderPath: '/product/images/' ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -69,7 +69,7 @@ public function testDelete(): void $result = $this->client->folders->delete('/folder/to/delete/'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -81,7 +81,7 @@ public function testDeleteWithOptionalParams(): void $result = $this->client->folders->delete('/folder/to/delete/'); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -96,7 +96,7 @@ public function testCopy(): void sourceFolderPath: '/path/of/source/folder', ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -111,7 +111,7 @@ public function testCopyWithOptionalParams(): void sourceFolderPath: '/path/of/source/folder', ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -126,7 +126,7 @@ public function testMove(): void sourceFolderPath: '/path/of/source/folder', ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -141,7 +141,7 @@ public function testMoveWithOptionalParams(): void sourceFolderPath: '/path/of/source/folder', ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -156,7 +156,7 @@ public function testRename(): void newFolderName: 'new-folder-name' ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } #[Test] @@ -171,6 +171,6 @@ public function testRenameWithOptionalParams(): void newFolderName: 'new-folder-name' ); - $this->assertTrue(true); // @phpstan-ignore-line + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } } From 8628e12e2bdb99f3755bb1ea960547876fcccf00 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 5 Sep 2025 20:07:56 +0000 Subject: [PATCH 024/193] feat(api): extract UpdateFileDetailsRequest to model --- .stats.yml | 2 +- src/Files/UpdateFileDetailsRequest.php | 25 +++ .../ChangePublicationStatus.php | 55 +++++ .../ChangePublicationStatus/Publish.php | 93 ++++++++ .../UpdateFileDetails.php | 211 ++++++++++++++++++ .../UpdateFileDetails/RemoveAITags.php | 32 +++ 6 files changed, 417 insertions(+), 1 deletion(-) create mode 100644 src/Files/UpdateFileDetailsRequest.php create mode 100644 src/Files/UpdateFileDetailsRequest/ChangePublicationStatus.php create mode 100644 src/Files/UpdateFileDetailsRequest/ChangePublicationStatus/Publish.php create mode 100644 src/Files/UpdateFileDetailsRequest/UpdateFileDetails.php create mode 100644 src/Files/UpdateFileDetailsRequest/UpdateFileDetails/RemoveAITags.php diff --git a/.stats.yml b/.stats.yml index bbfdcb43..b0086e96 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-bc7c0d27962b30c19c778656988e154b54696819389289f34420a5e5fdfbd3b8.yml openapi_spec_hash: 1bfde02a63416c036e9545927f727459 -config_hash: a652d68098d82eaf611a49507fb4b831 +config_hash: b415c06a3b29485af4601beb94ae1aeb diff --git a/src/Files/UpdateFileDetailsRequest.php b/src/Files/UpdateFileDetailsRequest.php new file mode 100644 index 00000000..ee60beb4 --- /dev/null +++ b/src/Files/UpdateFileDetailsRequest.php @@ -0,0 +1,25 @@ +|array + */ + public static function variants(): array + { + return [UpdateFileDetails::class, ChangePublicationStatus::class]; + } +} diff --git a/src/Files/UpdateFileDetailsRequest/ChangePublicationStatus.php b/src/Files/UpdateFileDetailsRequest/ChangePublicationStatus.php new file mode 100644 index 00000000..77371818 --- /dev/null +++ b/src/Files/UpdateFileDetailsRequest/ChangePublicationStatus.php @@ -0,0 +1,55 @@ + */ + use SdkModel; + + /** + * Configure the publication status of a file and its versions. + */ + #[Api(optional: true)] + public ?Publish $publish; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(?Publish $publish = null): self + { + $obj = new self; + + null !== $publish && $obj->publish = $publish; + + return $obj; + } + + /** + * Configure the publication status of a file and its versions. + */ + public function withPublish(Publish $publish): self + { + $obj = clone $this; + $obj->publish = $publish; + + return $obj; + } +} diff --git a/src/Files/UpdateFileDetailsRequest/ChangePublicationStatus/Publish.php b/src/Files/UpdateFileDetailsRequest/ChangePublicationStatus/Publish.php new file mode 100644 index 00000000..0569b9d2 --- /dev/null +++ b/src/Files/UpdateFileDetailsRequest/ChangePublicationStatus/Publish.php @@ -0,0 +1,93 @@ + */ + use SdkModel; + + /** + * Set to `true` to publish the file. Set to `false` to unpublish the file. + */ + #[Api] + public bool $isPublished; + + /** + * Set to `true` to publish/unpublish all versions of the file. Set to `false` to publish/unpublish only the current version of the file. + */ + #[Api(optional: true)] + public ?bool $includeFileVersions; + + /** + * `new Publish()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Publish::with(isPublished: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Publish)->withIsPublished(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $isPublished, + ?bool $includeFileVersions = null + ): self { + $obj = new self; + + $obj->isPublished = $isPublished; + + null !== $includeFileVersions && $obj->includeFileVersions = $includeFileVersions; + + return $obj; + } + + /** + * Set to `true` to publish the file. Set to `false` to unpublish the file. + */ + public function withIsPublished(bool $isPublished): self + { + $obj = clone $this; + $obj->isPublished = $isPublished; + + return $obj; + } + + /** + * Set to `true` to publish/unpublish all versions of the file. Set to `false` to publish/unpublish only the current version of the file. + */ + public function withIncludeFileVersions(bool $includeFileVersions): self + { + $obj = clone $this; + $obj->includeFileVersions = $includeFileVersions; + + return $obj; + } +} diff --git a/src/Files/UpdateFileDetailsRequest/UpdateFileDetails.php b/src/Files/UpdateFileDetailsRequest/UpdateFileDetails.php new file mode 100644 index 00000000..7a5bb6ac --- /dev/null +++ b/src/Files/UpdateFileDetailsRequest/UpdateFileDetails.php @@ -0,0 +1,211 @@ +|null, + * description?: string|null, + * extensions?: list|null, + * removeAITags?: string|null|list, + * tags?: list|null, + * webhookURL?: string|null, + * } + */ +final class UpdateFileDetails implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Define an important area in the image in the format `x,y,width,height` e.g. `10,10,100,100`. Send `null` to unset this value. + */ + #[Api(nullable: true, optional: true)] + public ?string $customCoordinates; + + /** + * A key-value data to be associated with the asset. To unset a key, send `null` value for that key. Before setting any custom metadata on an asset you have to create the field using custom metadata fields API. + * + * @var array|null $customMetadata + */ + #[Api(map: 'mixed', optional: true)] + public ?array $customMetadata; + + /** + * Optional text to describe the contents of the file. + */ + #[Api(optional: true)] + public ?string $description; + + /** + * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. + * + * @var list|null $extensions + */ + #[Api(list: ExtensionItem::class, optional: true)] + public ?array $extensions; + + /** + * An array of AITags associated with the file that you want to remove, e.g. `["car", "vehicle", "motorsports"]`. + * + * If you want to remove all AITags associated with the file, send a string - "all". + * + * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. + * + * @var string|list|null $removeAITags + */ + #[Api(union: RemoveAITags::class, optional: true)] + public string|array|null $removeAITags; + + /** + * An array of tags associated with the file, such as `["tag1", "tag2"]`. Send `null` to unset all tags associated with the file. + * + * @var list|null $tags + */ + #[Api(list: 'string', nullable: true, optional: true)] + public ?array $tags; + + /** + * The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + */ + #[Api('webhookUrl', optional: true)] + public ?string $webhookURL; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param array $customMetadata + * @param list $extensions + * @param string|list $removeAITags + * @param list|null $tags + */ + public static function with( + ?string $customCoordinates = null, + ?array $customMetadata = null, + ?string $description = null, + ?array $extensions = null, + string|array|null $removeAITags = null, + ?array $tags = null, + ?string $webhookURL = null, + ): self { + $obj = new self; + + null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; + null !== $customMetadata && $obj->customMetadata = $customMetadata; + null !== $description && $obj->description = $description; + null !== $extensions && $obj->extensions = $extensions; + null !== $removeAITags && $obj->removeAITags = $removeAITags; + null !== $tags && $obj->tags = $tags; + null !== $webhookURL && $obj->webhookURL = $webhookURL; + + return $obj; + } + + /** + * Define an important area in the image in the format `x,y,width,height` e.g. `10,10,100,100`. Send `null` to unset this value. + */ + public function withCustomCoordinates(?string $customCoordinates): self + { + $obj = clone $this; + $obj->customCoordinates = $customCoordinates; + + return $obj; + } + + /** + * A key-value data to be associated with the asset. To unset a key, send `null` value for that key. Before setting any custom metadata on an asset you have to create the field using custom metadata fields API. + * + * @param array $customMetadata + */ + public function withCustomMetadata(array $customMetadata): self + { + $obj = clone $this; + $obj->customMetadata = $customMetadata; + + return $obj; + } + + /** + * Optional text to describe the contents of the file. + */ + public function withDescription(string $description): self + { + $obj = clone $this; + $obj->description = $description; + + return $obj; + } + + /** + * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. + * + * @param list $extensions + */ + public function withExtensions(array $extensions): self + { + $obj = clone $this; + $obj->extensions = $extensions; + + return $obj; + } + + /** + * An array of AITags associated with the file that you want to remove, e.g. `["car", "vehicle", "motorsports"]`. + * + * If you want to remove all AITags associated with the file, send a string - "all". + * + * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. + * + * @param string|list $removeAITags + */ + public function withRemoveAITags(string|array $removeAITags): self + { + $obj = clone $this; + $obj->removeAITags = $removeAITags; + + return $obj; + } + + /** + * An array of tags associated with the file, such as `["tag1", "tag2"]`. Send `null` to unset all tags associated with the file. + * + * @param list|null $tags + */ + public function withTags(?array $tags): self + { + $obj = clone $this; + $obj->tags = $tags; + + return $obj; + } + + /** + * The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + */ + public function withWebhookURL(string $webhookURL): self + { + $obj = clone $this; + $obj->webhookURL = $webhookURL; + + return $obj; + } +} diff --git a/src/Files/UpdateFileDetailsRequest/UpdateFileDetails/RemoveAITags.php b/src/Files/UpdateFileDetailsRequest/UpdateFileDetails/RemoveAITags.php new file mode 100644 index 00000000..f07ba68b --- /dev/null +++ b/src/Files/UpdateFileDetailsRequest/UpdateFileDetails/RemoveAITags.php @@ -0,0 +1,32 @@ +|array + */ + public static function variants(): array + { + return [new ListOf('string'), new EnumOf(['all'])]; + } +} From 13291847d68a49a7468bf64dac797124ad8b2178 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 6 Sep 2025 02:44:31 +0000 Subject: [PATCH 025/193] feat!: expose services and service contracts --- src/Client.php | 16 ++++++++-------- .../Accounts/OriginsContract.php | 2 +- .../Accounts/URLEndpointsContract.php | 2 +- .../ServiceContracts/Accounts/UsageContract.php | 2 +- .../ServiceContracts/AccountsContract.php | 2 +- .../ServiceContracts/AssetsContract.php | 2 +- .../ServiceContracts/Beta/V2/FilesContract.php | 2 +- .../ServiceContracts/Beta/V2Contract.php | 2 +- src/{Core => }/ServiceContracts/BetaContract.php | 2 +- .../Cache/InvalidationContract.php | 2 +- .../ServiceContracts/CacheContract.php | 2 +- .../CustomMetadataFieldsContract.php | 2 +- .../ServiceContracts/Files/BulkContract.php | 2 +- .../ServiceContracts/Files/MetadataContract.php | 2 +- .../ServiceContracts/Files/VersionsContract.php | 2 +- .../ServiceContracts/FilesContract.php | 2 +- .../ServiceContracts/Folders/JobContract.php | 2 +- .../ServiceContracts/FoldersContract.php | 2 +- .../ServiceContracts/WebhooksContract.php | 2 +- .../Services/Accounts/OriginsService.php | 4 ++-- .../Services/Accounts/URLEndpointsService.php | 4 ++-- .../Services/Accounts/UsageService.php | 4 ++-- src/{Core => }/Services/AccountsService.php | 10 +++++----- src/{Core => }/Services/AssetsService.php | 4 ++-- src/{Core => }/Services/Beta/V2/FilesService.php | 4 ++-- src/{Core => }/Services/Beta/V2Service.php | 6 +++--- src/{Core => }/Services/BetaService.php | 6 +++--- .../Services/Cache/InvalidationService.php | 4 ++-- src/{Core => }/Services/CacheService.php | 6 +++--- .../Services/CustomMetadataFieldsService.php | 4 ++-- src/{Core => }/Services/Files/BulkService.php | 4 ++-- .../Services/Files/MetadataService.php | 4 ++-- .../Services/Files/VersionsService.php | 4 ++-- src/{Core => }/Services/FilesService.php | 10 +++++----- src/{Core => }/Services/Folders/JobService.php | 4 ++-- src/{Core => }/Services/FoldersService.php | 6 +++--- src/{Core => }/Services/WebhooksService.php | 4 ++-- 37 files changed, 72 insertions(+), 72 deletions(-) rename src/{Core => }/ServiceContracts/Accounts/OriginsContract.php (98%) rename src/{Core => }/ServiceContracts/Accounts/URLEndpointsContract.php (98%) rename src/{Core => }/ServiceContracts/Accounts/UsageContract.php (93%) rename src/{Core => }/ServiceContracts/AccountsContract.php (60%) rename src/{Core => }/ServiceContracts/AssetsContract.php (98%) rename src/{Core => }/ServiceContracts/Beta/V2/FilesContract.php (99%) rename src/{Core => }/ServiceContracts/Beta/V2Contract.php (55%) rename src/{Core => }/ServiceContracts/BetaContract.php (58%) rename src/{Core => }/ServiceContracts/Cache/InvalidationContract.php (92%) rename src/{Core => }/ServiceContracts/CacheContract.php (59%) rename src/{Core => }/ServiceContracts/CustomMetadataFieldsContract.php (98%) rename src/{Core => }/ServiceContracts/Files/BulkContract.php (97%) rename src/{Core => }/ServiceContracts/Files/MetadataContract.php (91%) rename src/{Core => }/ServiceContracts/Files/VersionsContract.php (95%) rename src/{Core => }/ServiceContracts/FilesContract.php (99%) rename src/{Core => }/ServiceContracts/Folders/JobContract.php (84%) rename src/{Core => }/ServiceContracts/FoldersContract.php (98%) rename src/{Core => }/ServiceContracts/WebhooksContract.php (60%) rename src/{Core => }/Services/Accounts/OriginsService.php (98%) rename src/{Core => }/Services/Accounts/URLEndpointsService.php (98%) rename src/{Core => }/Services/Accounts/UsageService.php (94%) rename src/{Core => }/Services/AccountsService.php (71%) rename src/{Core => }/Services/AssetsService.php (97%) rename src/{Core => }/Services/Beta/V2/FilesService.php (98%) rename src/{Core => }/Services/Beta/V2Service.php (69%) rename src/{Core => }/Services/BetaService.php (71%) rename src/{Core => }/Services/Cache/InvalidationService.php (94%) rename src/{Core => }/Services/CacheService.php (72%) rename src/{Core => }/Services/CustomMetadataFieldsService.php (98%) rename src/{Core => }/Services/Files/BulkService.php (97%) rename src/{Core => }/Services/Files/MetadataService.php (94%) rename src/{Core => }/Services/Files/VersionsService.php (97%) rename src/{Core => }/Services/FilesService.php (98%) rename src/{Core => }/Services/Folders/JobService.php (88%) rename src/{Core => }/Services/FoldersService.php (98%) rename src/{Core => }/Services/WebhooksService.php (70%) diff --git a/src/Client.php b/src/Client.php index a7dabcc9..9cdd9aa3 100644 --- a/src/Client.php +++ b/src/Client.php @@ -7,14 +7,14 @@ use Http\Discovery\Psr17FactoryDiscovery; use Http\Discovery\Psr18ClientDiscovery; use ImageKit\Core\BaseClient; -use ImageKit\Core\Services\AccountsService; -use ImageKit\Core\Services\AssetsService; -use ImageKit\Core\Services\BetaService; -use ImageKit\Core\Services\CacheService; -use ImageKit\Core\Services\CustomMetadataFieldsService; -use ImageKit\Core\Services\FilesService; -use ImageKit\Core\Services\FoldersService; -use ImageKit\Core\Services\WebhooksService; +use ImageKit\Services\AccountsService; +use ImageKit\Services\AssetsService; +use ImageKit\Services\BetaService; +use ImageKit\Services\CacheService; +use ImageKit\Services\CustomMetadataFieldsService; +use ImageKit\Services\FilesService; +use ImageKit\Services\FoldersService; +use ImageKit\Services\WebhooksService; class Client extends BaseClient { diff --git a/src/Core/ServiceContracts/Accounts/OriginsContract.php b/src/ServiceContracts/Accounts/OriginsContract.php similarity index 98% rename from src/Core/ServiceContracts/Accounts/OriginsContract.php rename to src/ServiceContracts/Accounts/OriginsContract.php index 9a560ffd..0662e5b0 100644 --- a/src/Core/ServiceContracts/Accounts/OriginsContract.php +++ b/src/ServiceContracts/Accounts/OriginsContract.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Core\ServiceContracts\Accounts; +namespace ImageKit\ServiceContracts\Accounts; use ImageKit\Accounts\Origins\OriginResponse\AkeneoPim; use ImageKit\Accounts\Origins\OriginResponse\AzureBlob; diff --git a/src/Core/ServiceContracts/Accounts/URLEndpointsContract.php b/src/ServiceContracts/Accounts/URLEndpointsContract.php similarity index 98% rename from src/Core/ServiceContracts/Accounts/URLEndpointsContract.php rename to src/ServiceContracts/Accounts/URLEndpointsContract.php index 765c3efd..2f58ce7e 100644 --- a/src/Core/ServiceContracts/Accounts/URLEndpointsContract.php +++ b/src/ServiceContracts/Accounts/URLEndpointsContract.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Core\ServiceContracts\Accounts; +namespace ImageKit\ServiceContracts\Accounts; use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Akamai; use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Cloudinary; diff --git a/src/Core/ServiceContracts/Accounts/UsageContract.php b/src/ServiceContracts/Accounts/UsageContract.php similarity index 93% rename from src/Core/ServiceContracts/Accounts/UsageContract.php rename to src/ServiceContracts/Accounts/UsageContract.php index eeb5fac6..d9db2280 100644 --- a/src/Core/ServiceContracts/Accounts/UsageContract.php +++ b/src/ServiceContracts/Accounts/UsageContract.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Core\ServiceContracts\Accounts; +namespace ImageKit\ServiceContracts\Accounts; use ImageKit\Accounts\Usage\UsageGetResponse; use ImageKit\RequestOptions; diff --git a/src/Core/ServiceContracts/AccountsContract.php b/src/ServiceContracts/AccountsContract.php similarity index 60% rename from src/Core/ServiceContracts/AccountsContract.php rename to src/ServiceContracts/AccountsContract.php index a7722454..593d29a6 100644 --- a/src/Core/ServiceContracts/AccountsContract.php +++ b/src/ServiceContracts/AccountsContract.php @@ -2,6 +2,6 @@ declare(strict_types=1); -namespace ImageKit\Core\ServiceContracts; +namespace ImageKit\ServiceContracts; interface AccountsContract {} diff --git a/src/Core/ServiceContracts/AssetsContract.php b/src/ServiceContracts/AssetsContract.php similarity index 98% rename from src/Core/ServiceContracts/AssetsContract.php rename to src/ServiceContracts/AssetsContract.php index d7d795e1..413ad923 100644 --- a/src/Core/ServiceContracts/AssetsContract.php +++ b/src/ServiceContracts/AssetsContract.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Core\ServiceContracts; +namespace ImageKit\ServiceContracts; use ImageKit\Assets\AssetListParams\FileType; use ImageKit\Assets\AssetListParams\Sort; diff --git a/src/Core/ServiceContracts/Beta/V2/FilesContract.php b/src/ServiceContracts/Beta/V2/FilesContract.php similarity index 99% rename from src/Core/ServiceContracts/Beta/V2/FilesContract.php rename to src/ServiceContracts/Beta/V2/FilesContract.php index 885eb107..4365eb28 100644 --- a/src/Core/ServiceContracts/Beta/V2/FilesContract.php +++ b/src/ServiceContracts/Beta/V2/FilesContract.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Core\ServiceContracts\Beta\V2; +namespace ImageKit\ServiceContracts\Beta\V2; use ImageKit\Beta\V2\Files\FileUploadParams\ResponseField; use ImageKit\Beta\V2\Files\FileUploadParams\Transformation; diff --git a/src/Core/ServiceContracts/Beta/V2Contract.php b/src/ServiceContracts/Beta/V2Contract.php similarity index 55% rename from src/Core/ServiceContracts/Beta/V2Contract.php rename to src/ServiceContracts/Beta/V2Contract.php index a76de06f..c3c8cd8c 100644 --- a/src/Core/ServiceContracts/Beta/V2Contract.php +++ b/src/ServiceContracts/Beta/V2Contract.php @@ -2,6 +2,6 @@ declare(strict_types=1); -namespace ImageKit\Core\ServiceContracts\Beta; +namespace ImageKit\ServiceContracts\Beta; interface V2Contract {} diff --git a/src/Core/ServiceContracts/BetaContract.php b/src/ServiceContracts/BetaContract.php similarity index 58% rename from src/Core/ServiceContracts/BetaContract.php rename to src/ServiceContracts/BetaContract.php index 1ee521b4..675430fc 100644 --- a/src/Core/ServiceContracts/BetaContract.php +++ b/src/ServiceContracts/BetaContract.php @@ -2,6 +2,6 @@ declare(strict_types=1); -namespace ImageKit\Core\ServiceContracts; +namespace ImageKit\ServiceContracts; interface BetaContract {} diff --git a/src/Core/ServiceContracts/Cache/InvalidationContract.php b/src/ServiceContracts/Cache/InvalidationContract.php similarity index 92% rename from src/Core/ServiceContracts/Cache/InvalidationContract.php rename to src/ServiceContracts/Cache/InvalidationContract.php index 640f628f..0578aba6 100644 --- a/src/Core/ServiceContracts/Cache/InvalidationContract.php +++ b/src/ServiceContracts/Cache/InvalidationContract.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Core\ServiceContracts\Cache; +namespace ImageKit\ServiceContracts\Cache; use ImageKit\Cache\Invalidation\InvalidationGetResponse; use ImageKit\Cache\Invalidation\InvalidationNewResponse; diff --git a/src/Core/ServiceContracts/CacheContract.php b/src/ServiceContracts/CacheContract.php similarity index 59% rename from src/Core/ServiceContracts/CacheContract.php rename to src/ServiceContracts/CacheContract.php index 26bcfb84..aa3c07b6 100644 --- a/src/Core/ServiceContracts/CacheContract.php +++ b/src/ServiceContracts/CacheContract.php @@ -2,6 +2,6 @@ declare(strict_types=1); -namespace ImageKit\Core\ServiceContracts; +namespace ImageKit\ServiceContracts; interface CacheContract {} diff --git a/src/Core/ServiceContracts/CustomMetadataFieldsContract.php b/src/ServiceContracts/CustomMetadataFieldsContract.php similarity index 98% rename from src/Core/ServiceContracts/CustomMetadataFieldsContract.php rename to src/ServiceContracts/CustomMetadataFieldsContract.php index bac42df4..64f8b62b 100644 --- a/src/Core/ServiceContracts/CustomMetadataFieldsContract.php +++ b/src/ServiceContracts/CustomMetadataFieldsContract.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Core\ServiceContracts; +namespace ImageKit\ServiceContracts; use ImageKit\CustomMetadataFields\CustomMetadataField; use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; diff --git a/src/Core/ServiceContracts/Files/BulkContract.php b/src/ServiceContracts/Files/BulkContract.php similarity index 97% rename from src/Core/ServiceContracts/Files/BulkContract.php rename to src/ServiceContracts/Files/BulkContract.php index b8c4fb2d..c1c7de85 100644 --- a/src/Core/ServiceContracts/Files/BulkContract.php +++ b/src/ServiceContracts/Files/BulkContract.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Core\ServiceContracts\Files; +namespace ImageKit\ServiceContracts\Files; use ImageKit\Files\Bulk\BulkAddTagsResponse; use ImageKit\Files\Bulk\BulkDeleteResponse; diff --git a/src/Core/ServiceContracts/Files/MetadataContract.php b/src/ServiceContracts/Files/MetadataContract.php similarity index 91% rename from src/Core/ServiceContracts/Files/MetadataContract.php rename to src/ServiceContracts/Files/MetadataContract.php index 3c3d3a23..615b5b4a 100644 --- a/src/Core/ServiceContracts/Files/MetadataContract.php +++ b/src/ServiceContracts/Files/MetadataContract.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Core\ServiceContracts\Files; +namespace ImageKit\ServiceContracts\Files; use ImageKit\Files\Metadata; use ImageKit\RequestOptions; diff --git a/src/Core/ServiceContracts/Files/VersionsContract.php b/src/ServiceContracts/Files/VersionsContract.php similarity index 95% rename from src/Core/ServiceContracts/Files/VersionsContract.php rename to src/ServiceContracts/Files/VersionsContract.php index 0f60d856..ae4d43f6 100644 --- a/src/Core/ServiceContracts/Files/VersionsContract.php +++ b/src/ServiceContracts/Files/VersionsContract.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Core\ServiceContracts\Files; +namespace ImageKit\ServiceContracts\Files; use ImageKit\Files\File; use ImageKit\Files\Versions\VersionDeleteResponse; diff --git a/src/Core/ServiceContracts/FilesContract.php b/src/ServiceContracts/FilesContract.php similarity index 99% rename from src/Core/ServiceContracts/FilesContract.php rename to src/ServiceContracts/FilesContract.php index c5f265c5..b5d85db8 100644 --- a/src/Core/ServiceContracts/FilesContract.php +++ b/src/ServiceContracts/FilesContract.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Core\ServiceContracts; +namespace ImageKit\ServiceContracts; use ImageKit\ExtensionItem\AIAutoDescription; use ImageKit\ExtensionItem\AutoTaggingExtension; diff --git a/src/Core/ServiceContracts/Folders/JobContract.php b/src/ServiceContracts/Folders/JobContract.php similarity index 84% rename from src/Core/ServiceContracts/Folders/JobContract.php rename to src/ServiceContracts/Folders/JobContract.php index 85a41014..ba4dcfe0 100644 --- a/src/Core/ServiceContracts/Folders/JobContract.php +++ b/src/ServiceContracts/Folders/JobContract.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Core\ServiceContracts\Folders; +namespace ImageKit\ServiceContracts\Folders; use ImageKit\Folders\Job\JobGetResponse; use ImageKit\RequestOptions; diff --git a/src/Core/ServiceContracts/FoldersContract.php b/src/ServiceContracts/FoldersContract.php similarity index 98% rename from src/Core/ServiceContracts/FoldersContract.php rename to src/ServiceContracts/FoldersContract.php index f1b59283..04943640 100644 --- a/src/Core/ServiceContracts/FoldersContract.php +++ b/src/ServiceContracts/FoldersContract.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Core\ServiceContracts; +namespace ImageKit\ServiceContracts; use ImageKit\Folders\FolderCopyResponse; use ImageKit\Folders\FolderDeleteResponse; diff --git a/src/Core/ServiceContracts/WebhooksContract.php b/src/ServiceContracts/WebhooksContract.php similarity index 60% rename from src/Core/ServiceContracts/WebhooksContract.php rename to src/ServiceContracts/WebhooksContract.php index 4a7c5a51..cefb28f3 100644 --- a/src/Core/ServiceContracts/WebhooksContract.php +++ b/src/ServiceContracts/WebhooksContract.php @@ -2,6 +2,6 @@ declare(strict_types=1); -namespace ImageKit\Core\ServiceContracts; +namespace ImageKit\ServiceContracts; interface WebhooksContract {} diff --git a/src/Core/Services/Accounts/OriginsService.php b/src/Services/Accounts/OriginsService.php similarity index 98% rename from src/Core/Services/Accounts/OriginsService.php rename to src/Services/Accounts/OriginsService.php index d52dda85..17d341d7 100644 --- a/src/Core/Services/Accounts/OriginsService.php +++ b/src/Services/Accounts/OriginsService.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Core\Services\Accounts; +namespace ImageKit\Services\Accounts; use ImageKit\Accounts\Origins\OriginCreateParams; use ImageKit\Accounts\Origins\OriginResponse; @@ -17,8 +17,8 @@ use ImageKit\Accounts\Origins\OriginUpdateParams; use ImageKit\Client; use ImageKit\Core\Conversion\ListOf; -use ImageKit\Core\ServiceContracts\Accounts\OriginsContract; use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Accounts\OriginsContract; use const ImageKit\Core\OMIT as omit; diff --git a/src/Core/Services/Accounts/URLEndpointsService.php b/src/Services/Accounts/URLEndpointsService.php similarity index 98% rename from src/Core/Services/Accounts/URLEndpointsService.php rename to src/Services/Accounts/URLEndpointsService.php index a571f965..763e54d1 100644 --- a/src/Core/Services/Accounts/URLEndpointsService.php +++ b/src/Services/Accounts/URLEndpointsService.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Core\Services\Accounts; +namespace ImageKit\Services\Accounts; use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams; use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Akamai; @@ -15,8 +15,8 @@ use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Imgix as Imgix1; use ImageKit\Client; use ImageKit\Core\Conversion\ListOf; -use ImageKit\Core\ServiceContracts\Accounts\URLEndpointsContract; use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Accounts\URLEndpointsContract; use const ImageKit\Core\OMIT as omit; diff --git a/src/Core/Services/Accounts/UsageService.php b/src/Services/Accounts/UsageService.php similarity index 94% rename from src/Core/Services/Accounts/UsageService.php rename to src/Services/Accounts/UsageService.php index ffba52fa..b4fd1286 100644 --- a/src/Core/Services/Accounts/UsageService.php +++ b/src/Services/Accounts/UsageService.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Core\Services\Accounts; +namespace ImageKit\Services\Accounts; use ImageKit\Accounts\Usage\UsageGetParams; use ImageKit\Accounts\Usage\UsageGetResponse; use ImageKit\Client; -use ImageKit\Core\ServiceContracts\Accounts\UsageContract; use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Accounts\UsageContract; final class UsageService implements UsageContract { diff --git a/src/Core/Services/AccountsService.php b/src/Services/AccountsService.php similarity index 71% rename from src/Core/Services/AccountsService.php rename to src/Services/AccountsService.php index c65638a4..52fd692d 100644 --- a/src/Core/Services/AccountsService.php +++ b/src/Services/AccountsService.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Core\Services; +namespace ImageKit\Services; use ImageKit\Client; -use ImageKit\Core\ServiceContracts\AccountsContract; -use ImageKit\Core\Services\Accounts\OriginsService; -use ImageKit\Core\Services\Accounts\URLEndpointsService; -use ImageKit\Core\Services\Accounts\UsageService; +use ImageKit\ServiceContracts\AccountsContract; +use ImageKit\Services\Accounts\OriginsService; +use ImageKit\Services\Accounts\URLEndpointsService; +use ImageKit\Services\Accounts\UsageService; final class AccountsService implements AccountsContract { diff --git a/src/Core/Services/AssetsService.php b/src/Services/AssetsService.php similarity index 97% rename from src/Core/Services/AssetsService.php rename to src/Services/AssetsService.php index cd4a536f..8ae23f14 100644 --- a/src/Core/Services/AssetsService.php +++ b/src/Services/AssetsService.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Core\Services; +namespace ImageKit\Services; use ImageKit\Assets\AssetListParams; use ImageKit\Assets\AssetListParams\FileType; @@ -11,10 +11,10 @@ use ImageKit\Assets\AssetListResponseItem; use ImageKit\Client; use ImageKit\Core\Conversion\ListOf; -use ImageKit\Core\ServiceContracts\AssetsContract; use ImageKit\Files\File; use ImageKit\Files\Folder; use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\AssetsContract; use const ImageKit\Core\OMIT as omit; diff --git a/src/Core/Services/Beta/V2/FilesService.php b/src/Services/Beta/V2/FilesService.php similarity index 98% rename from src/Core/Services/Beta/V2/FilesService.php rename to src/Services/Beta/V2/FilesService.php index 06ba4a58..df9541c3 100644 --- a/src/Core/Services/Beta/V2/FilesService.php +++ b/src/Services/Beta/V2/FilesService.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace ImageKit\Core\Services\Beta\V2; +namespace ImageKit\Services\Beta\V2; use ImageKit\Beta\V2\Files\FileUploadParams; use ImageKit\Beta\V2\Files\FileUploadParams\ResponseField; use ImageKit\Beta\V2\Files\FileUploadParams\Transformation; use ImageKit\Beta\V2\Files\FileUploadResponse; use ImageKit\Client; -use ImageKit\Core\ServiceContracts\Beta\V2\FilesContract; use ImageKit\ExtensionItem\AIAutoDescription; use ImageKit\ExtensionItem\AutoTaggingExtension; use ImageKit\ExtensionItem\RemoveBg; use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Beta\V2\FilesContract; use const ImageKit\Core\OMIT as omit; diff --git a/src/Core/Services/Beta/V2Service.php b/src/Services/Beta/V2Service.php similarity index 69% rename from src/Core/Services/Beta/V2Service.php rename to src/Services/Beta/V2Service.php index 425c2750..4cddd5bd 100644 --- a/src/Core/Services/Beta/V2Service.php +++ b/src/Services/Beta/V2Service.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Core\Services\Beta; +namespace ImageKit\Services\Beta; use ImageKit\Client; -use ImageKit\Core\ServiceContracts\Beta\V2Contract; -use ImageKit\Core\Services\Beta\V2\FilesService; +use ImageKit\ServiceContracts\Beta\V2Contract; +use ImageKit\Services\Beta\V2\FilesService; final class V2Service implements V2Contract { diff --git a/src/Core/Services/BetaService.php b/src/Services/BetaService.php similarity index 71% rename from src/Core/Services/BetaService.php rename to src/Services/BetaService.php index 82b57a59..d6cecb03 100644 --- a/src/Core/Services/BetaService.php +++ b/src/Services/BetaService.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Core\Services; +namespace ImageKit\Services; use ImageKit\Client; -use ImageKit\Core\ServiceContracts\BetaContract; -use ImageKit\Core\Services\Beta\V2Service; +use ImageKit\ServiceContracts\BetaContract; +use ImageKit\Services\Beta\V2Service; final class BetaService implements BetaContract { diff --git a/src/Core/Services/Cache/InvalidationService.php b/src/Services/Cache/InvalidationService.php similarity index 94% rename from src/Core/Services/Cache/InvalidationService.php rename to src/Services/Cache/InvalidationService.php index 4d66728b..6cc46054 100644 --- a/src/Core/Services/Cache/InvalidationService.php +++ b/src/Services/Cache/InvalidationService.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace ImageKit\Core\Services\Cache; +namespace ImageKit\Services\Cache; use ImageKit\Cache\Invalidation\InvalidationCreateParams; use ImageKit\Cache\Invalidation\InvalidationGetResponse; use ImageKit\Cache\Invalidation\InvalidationNewResponse; use ImageKit\Client; -use ImageKit\Core\ServiceContracts\Cache\InvalidationContract; use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Cache\InvalidationContract; final class InvalidationService implements InvalidationContract { diff --git a/src/Core/Services/CacheService.php b/src/Services/CacheService.php similarity index 72% rename from src/Core/Services/CacheService.php rename to src/Services/CacheService.php index 1fd48de0..89184440 100644 --- a/src/Core/Services/CacheService.php +++ b/src/Services/CacheService.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Core\Services; +namespace ImageKit\Services; use ImageKit\Client; -use ImageKit\Core\ServiceContracts\CacheContract; -use ImageKit\Core\Services\Cache\InvalidationService; +use ImageKit\ServiceContracts\CacheContract; +use ImageKit\Services\Cache\InvalidationService; final class CacheService implements CacheContract { diff --git a/src/Core/Services/CustomMetadataFieldsService.php b/src/Services/CustomMetadataFieldsService.php similarity index 98% rename from src/Core/Services/CustomMetadataFieldsService.php rename to src/Services/CustomMetadataFieldsService.php index 1c8a67bd..928b43a8 100644 --- a/src/Core/Services/CustomMetadataFieldsService.php +++ b/src/Services/CustomMetadataFieldsService.php @@ -2,11 +2,10 @@ declare(strict_types=1); -namespace ImageKit\Core\Services; +namespace ImageKit\Services; use ImageKit\Client; use ImageKit\Core\Conversion\ListOf; -use ImageKit\Core\ServiceContracts\CustomMetadataFieldsContract; use ImageKit\CustomMetadataFields\CustomMetadataField; use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams; use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; @@ -15,6 +14,7 @@ use ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams; use ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema as Schema1; use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\CustomMetadataFieldsContract; use const ImageKit\Core\OMIT as omit; diff --git a/src/Core/Services/Files/BulkService.php b/src/Services/Files/BulkService.php similarity index 97% rename from src/Core/Services/Files/BulkService.php rename to src/Services/Files/BulkService.php index 23fc95dd..731db603 100644 --- a/src/Core/Services/Files/BulkService.php +++ b/src/Services/Files/BulkService.php @@ -2,10 +2,9 @@ declare(strict_types=1); -namespace ImageKit\Core\Services\Files; +namespace ImageKit\Services\Files; use ImageKit\Client; -use ImageKit\Core\ServiceContracts\Files\BulkContract; use ImageKit\Files\Bulk\BulkAddTagsParams; use ImageKit\Files\Bulk\BulkAddTagsResponse; use ImageKit\Files\Bulk\BulkDeleteParams; @@ -15,6 +14,7 @@ use ImageKit\Files\Bulk\BulkRemoveTagsParams; use ImageKit\Files\Bulk\BulkRemoveTagsResponse; use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Files\BulkContract; final class BulkService implements BulkContract { diff --git a/src/Core/Services/Files/MetadataService.php b/src/Services/Files/MetadataService.php similarity index 94% rename from src/Core/Services/Files/MetadataService.php rename to src/Services/Files/MetadataService.php index 4c47b2ec..6d94f3f3 100644 --- a/src/Core/Services/Files/MetadataService.php +++ b/src/Services/Files/MetadataService.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Core\Services\Files; +namespace ImageKit\Services\Files; use ImageKit\Client; -use ImageKit\Core\ServiceContracts\Files\MetadataContract; use ImageKit\Files\Metadata; use ImageKit\Files\Metadata\MetadataGetFromURLParams; use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Files\MetadataContract; final class MetadataService implements MetadataContract { diff --git a/src/Core/Services/Files/VersionsService.php b/src/Services/Files/VersionsService.php similarity index 97% rename from src/Core/Services/Files/VersionsService.php rename to src/Services/Files/VersionsService.php index 0c62d1e2..62bb23b0 100644 --- a/src/Core/Services/Files/VersionsService.php +++ b/src/Services/Files/VersionsService.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace ImageKit\Core\Services\Files; +namespace ImageKit\Services\Files; use ImageKit\Client; use ImageKit\Core\Conversion\ListOf; -use ImageKit\Core\ServiceContracts\Files\VersionsContract; use ImageKit\Files\File; use ImageKit\Files\Versions\VersionDeleteParams; use ImageKit\Files\Versions\VersionDeleteResponse; use ImageKit\Files\Versions\VersionGetParams; use ImageKit\Files\Versions\VersionRestoreParams; use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Files\VersionsContract; final class VersionsService implements VersionsContract { diff --git a/src/Core/Services/FilesService.php b/src/Services/FilesService.php similarity index 98% rename from src/Core/Services/FilesService.php rename to src/Services/FilesService.php index c421314f..78da9fae 100644 --- a/src/Core/Services/FilesService.php +++ b/src/Services/FilesService.php @@ -2,13 +2,9 @@ declare(strict_types=1); -namespace ImageKit\Core\Services; +namespace ImageKit\Services; use ImageKit\Client; -use ImageKit\Core\ServiceContracts\FilesContract; -use ImageKit\Core\Services\Files\BulkService; -use ImageKit\Core\Services\Files\MetadataService; -use ImageKit\Core\Services\Files\VersionsService; use ImageKit\ExtensionItem\AIAutoDescription; use ImageKit\ExtensionItem\AutoTaggingExtension; use ImageKit\ExtensionItem\RemoveBg; @@ -27,6 +23,10 @@ use ImageKit\Files\FileUploadParams\Transformation; use ImageKit\Files\FileUploadResponse; use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\FilesContract; +use ImageKit\Services\Files\BulkService; +use ImageKit\Services\Files\MetadataService; +use ImageKit\Services\Files\VersionsService; use const ImageKit\Core\OMIT as omit; diff --git a/src/Core/Services/Folders/JobService.php b/src/Services/Folders/JobService.php similarity index 88% rename from src/Core/Services/Folders/JobService.php rename to src/Services/Folders/JobService.php index bb21f3bf..b7be4ac6 100644 --- a/src/Core/Services/Folders/JobService.php +++ b/src/Services/Folders/JobService.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\Core\Services\Folders; +namespace ImageKit\Services\Folders; use ImageKit\Client; -use ImageKit\Core\ServiceContracts\Folders\JobContract; use ImageKit\Folders\Job\JobGetResponse; use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Folders\JobContract; final class JobService implements JobContract { diff --git a/src/Core/Services/FoldersService.php b/src/Services/FoldersService.php similarity index 98% rename from src/Core/Services/FoldersService.php rename to src/Services/FoldersService.php index 31fd4ac5..4a6bd748 100644 --- a/src/Core/Services/FoldersService.php +++ b/src/Services/FoldersService.php @@ -2,11 +2,9 @@ declare(strict_types=1); -namespace ImageKit\Core\Services; +namespace ImageKit\Services; use ImageKit\Client; -use ImageKit\Core\ServiceContracts\FoldersContract; -use ImageKit\Core\Services\Folders\JobService; use ImageKit\Folders\FolderCopyParams; use ImageKit\Folders\FolderCopyResponse; use ImageKit\Folders\FolderCreateParams; @@ -18,6 +16,8 @@ use ImageKit\Folders\FolderRenameParams; use ImageKit\Folders\FolderRenameResponse; use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\FoldersContract; +use ImageKit\Services\Folders\JobService; use const ImageKit\Core\OMIT as omit; diff --git a/src/Core/Services/WebhooksService.php b/src/Services/WebhooksService.php similarity index 70% rename from src/Core/Services/WebhooksService.php rename to src/Services/WebhooksService.php index bbcf1195..4b4150a7 100644 --- a/src/Core/Services/WebhooksService.php +++ b/src/Services/WebhooksService.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace ImageKit\Core\Services; +namespace ImageKit\Services; use ImageKit\Client; -use ImageKit\Core\ServiceContracts\WebhooksContract; +use ImageKit\ServiceContracts\WebhooksContract; final class WebhooksService implements WebhooksContract { From 0b65863c45d58bf52bca76cfa8f7560e381d7dc9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Sep 2025 02:21:44 +0000 Subject: [PATCH 026/193] feat(client): use real enums --- src/Assets/AssetListParams.php | 48 ++--- src/Assets/AssetListParams/FileType.php | 13 +- src/Assets/AssetListParams/Sort.php | 35 ++-- src/Assets/AssetListParams/Type.php | 15 +- src/Beta/V2/Files/FileUploadParams.php | 12 +- .../Files/FileUploadParams/ResponseField.php | 21 +- .../Transformation/Post/Abs.php | 16 +- .../Transformation/Post/Abs/Protocol.php | 11 +- .../FileUploadResponse/ExtensionStatus.php | 73 +++---- .../ExtensionStatus/AIAutoDescription.php | 13 +- .../ExtensionStatus/AwsAutoTagging.php | 13 +- .../ExtensionStatus/GoogleAutoTagging.php | 13 +- .../ExtensionStatus/RemoveBg.php | 13 +- .../Invalidation/InvalidationGetResponse.php | 16 +- .../InvalidationGetResponse/Status.php | 11 +- src/Core/Attributes/Api.php | 34 +++- .../CustomMetadataField/Schema.php | 16 +- .../CustomMetadataField/Schema/Type.php | 21 +- .../Schema.php | 16 +- .../Schema/Type.php | 21 +- src/ExtensionItem/AutoTaggingExtension.php | 16 +- .../AutoTaggingExtension/Name.php | 11 +- src/Files/File.php | 16 +- src/Files/File/Type.php | 11 +- .../FileUpdateResponse/ExtensionStatus.php | 73 +++---- .../ExtensionStatus/AIAutoDescription.php | 13 +- .../ExtensionStatus/AwsAutoTagging.php | 13 +- .../ExtensionStatus/GoogleAutoTagging.php | 13 +- .../ExtensionStatus/RemoveBg.php | 13 +- src/Files/FileUploadParams.php | 12 +- src/Files/FileUploadParams/ResponseField.php | 21 +- .../Transformation/Post/Abs.php | 16 +- .../Transformation/Post/Abs/Protocol.php | 11 +- .../FileUploadResponse/ExtensionStatus.php | 73 +++---- .../ExtensionStatus/AIAutoDescription.php | 13 +- .../ExtensionStatus/AwsAutoTagging.php | 13 +- .../ExtensionStatus/GoogleAutoTagging.php | 13 +- .../ExtensionStatus/RemoveBg.php | 13 +- src/Files/Folder.php | 16 +- src/Files/Folder/Type.php | 9 +- src/Folders/Job/JobGetResponse.php | 32 ++-- src/Folders/Job/JobGetResponse/Status.php | 11 +- src/Folders/Job/JobGetResponse/Type.php | 13 +- src/ImageOverlay.php | 18 +- src/ImageOverlay/Encoding.php | 13 +- src/OverlayPosition.php | 16 +- src/OverlayPosition/Focus.php | 25 +-- src/ServiceContracts/AssetsContract.php | 6 +- .../Beta/V2/FilesContract.php | 2 +- src/ServiceContracts/FilesContract.php | 2 +- src/Services/AssetsService.php | 6 +- src/Services/Beta/V2/FilesService.php | 2 +- src/Services/FilesService.php | 2 +- src/SrcOptions.php | 16 +- src/StreamingResolution.php | 21 +- src/SubtitleOverlay.php | 18 +- src/SubtitleOverlay/Encoding.php | 13 +- src/SubtitleOverlayTransformation.php | 16 +- .../Typography.php | 13 +- src/TextOverlay.php | 16 +- src/TextOverlay/Encoding.php | 13 +- src/TextOverlayTransformation.php | 35 ++-- src/TextOverlayTransformation/Flip.php | 15 +- .../InnerAlignment.php | 13 +- src/Transformation.php | 181 +++++++----------- src/Transformation/AIRemoveBackground.php | 20 -- .../AIRemoveBackgroundExternal.php | 21 -- src/Transformation/AIRetouch.php | 19 -- src/Transformation/AIUpscale.php | 19 -- src/Transformation/AIVariation.php | 20 -- src/Transformation/AudioCodec.php | 13 +- src/Transformation/ContrastStretch.php | 19 -- src/Transformation/Crop.php | 17 +- src/Transformation/CropMode.php | 13 +- src/Transformation/Flip.php | 15 +- src/Transformation/Format.php | 29 ++- src/Transformation/Grayscale.php | 18 -- src/Transformation/VideoCodec.php | 15 +- src/TransformationPosition.php | 11 +- src/VideoOverlay.php | 18 +- src/VideoOverlay/Encoding.php | 13 +- .../Request/Transformation.php | 30 +-- .../Request/Transformation/Protocol.php | 11 +- .../Request/Transformation/Type.php | 15 +- .../Request/Transformation.php | 30 +-- .../Request/Transformation/Protocol.php | 11 +- .../Request/Transformation/Type.php | 15 +- .../Data/ExtensionStatus.php | 73 +++---- .../ExtensionStatus/AIAutoDescription.php | 13 +- .../Data/ExtensionStatus/AwsAutoTagging.php | 13 +- .../ExtensionStatus/GoogleAutoTagging.php | 13 +- .../Data/ExtensionStatus/RemoveBg.php | 13 +- .../Data/Transformation.php | 20 +- .../Data/Transformation/Options.php | 67 +++---- .../Transformation/Options/AudioCodec.php | 11 +- .../Data/Transformation/Options/Format.php | 17 +- .../Transformation/Options/StreamProtocol.php | 11 +- .../Transformation/Options/VideoCodec.php | 13 +- .../Data/Transformation/Type.php | 13 +- .../Data/Transformation.php | 16 +- .../Data/Transformation/Error.php | 16 +- .../Data/Transformation/Error/Reason.php | 13 +- .../Data/Transformation/Options.php | 67 +++---- .../Transformation/Options/AudioCodec.php | 11 +- .../Data/Transformation/Options/Format.php | 17 +- .../Transformation/Options/StreamProtocol.php | 11 +- .../Transformation/Options/VideoCodec.php | 13 +- .../Data/Transformation/Type.php | 13 +- .../Data/Transformation.php | 16 +- .../Data/Transformation/Options.php | 67 +++---- .../Transformation/Options/AudioCodec.php | 11 +- .../Data/Transformation/Options/Format.php | 17 +- .../Transformation/Options/StreamProtocol.php | 11 +- .../Transformation/Options/VideoCodec.php | 13 +- .../Data/Transformation/Type.php | 13 +- 115 files changed, 932 insertions(+), 1400 deletions(-) delete mode 100644 src/Transformation/AIRemoveBackground.php delete mode 100644 src/Transformation/AIRemoveBackgroundExternal.php delete mode 100644 src/Transformation/AIRetouch.php delete mode 100644 src/Transformation/AIUpscale.php delete mode 100644 src/Transformation/AIVariation.php delete mode 100644 src/Transformation/ContrastStretch.php delete mode 100644 src/Transformation/Grayscale.php diff --git a/src/Assets/AssetListParams.php b/src/Assets/AssetListParams.php index f788cfbd..1802e6a4 100644 --- a/src/Assets/AssetListParams.php +++ b/src/Assets/AssetListParams.php @@ -29,13 +29,13 @@ * @see ImageKit\Assets->list * * @phpstan-type asset_list_params = array{ - * fileType?: FileType::*, + * fileType?: FileType|value-of, * limit?: int, * path?: string, * searchQuery?: string, * skip?: int, - * sort?: Sort::*, - * type?: Type::*, + * sort?: Sort|value-of, + * type?: Type|value-of, * } */ final class AssetListParams implements BaseModel @@ -51,7 +51,7 @@ final class AssetListParams implements BaseModel * - `image` — include only image files * - `non-image` — include only non-image files (e.g., JS, CSS, video) * - * @var FileType::*|null $fileType + * @var value-of|null $fileType */ #[Api(enum: FileType::class, optional: true)] public ?string $fileType; @@ -94,7 +94,7 @@ final class AssetListParams implements BaseModel /** * Sort the results by one of the supported fields in ascending or descending order. * - * @var Sort::*|null $sort + * @var value-of|null $sort */ #[Api(enum: Sort::class, optional: true)] public ?string $sort; @@ -107,7 +107,7 @@ final class AssetListParams implements BaseModel * - `folder` — returns only folders * - `all` — returns both files and folders (excludes `file-version`) * - * @var Type::*|null $type + * @var value-of|null $type */ #[Api(enum: Type::class, optional: true)] public ?string $type; @@ -122,28 +122,28 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param FileType::* $fileType - * @param Sort::* $sort - * @param Type::* $type + * @param FileType|value-of $fileType + * @param Sort|value-of $sort + * @param Type|value-of $type */ public static function with( - ?string $fileType = null, + FileType|string|null $fileType = null, ?int $limit = null, ?string $path = null, ?string $searchQuery = null, ?int $skip = null, - ?string $sort = null, - ?string $type = null, + Sort|string|null $sort = null, + Type|string|null $type = null, ): self { $obj = new self; - null !== $fileType && $obj->fileType = $fileType; + null !== $fileType && $obj->fileType = $fileType instanceof FileType ? $fileType->value : $fileType; null !== $limit && $obj->limit = $limit; null !== $path && $obj->path = $path; null !== $searchQuery && $obj->searchQuery = $searchQuery; null !== $skip && $obj->skip = $skip; - null !== $sort && $obj->sort = $sort; - null !== $type && $obj->type = $type; + null !== $sort && $obj->sort = $sort instanceof Sort ? $sort->value : $sort; + null !== $type && $obj->type = $type instanceof Type ? $type->value : $type; return $obj; } @@ -155,12 +155,12 @@ public static function with( * - `image` — include only image files * - `non-image` — include only non-image files (e.g., JS, CSS, video) * - * @param FileType::* $fileType + * @param FileType|value-of $fileType */ - public function withFileType(string $fileType): self + public function withFileType(FileType|string $fileType): self { $obj = clone $this; - $obj->fileType = $fileType; + $obj->fileType = $fileType instanceof FileType ? $fileType->value : $fileType; return $obj; } @@ -223,12 +223,12 @@ public function withSkip(int $skip): self /** * Sort the results by one of the supported fields in ascending or descending order. * - * @param Sort::* $sort + * @param Sort|value-of $sort */ - public function withSort(string $sort): self + public function withSort(Sort|string $sort): self { $obj = clone $this; - $obj->sort = $sort; + $obj->sort = $sort instanceof Sort ? $sort->value : $sort; return $obj; } @@ -241,12 +241,12 @@ public function withSort(string $sort): self * - `folder` — returns only folders * - `all` — returns both files and folders (excludes `file-version`) * - * @param Type::* $type + * @param Type|value-of $type */ - public function withType(string $type): self + public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type; + $obj->type = $type instanceof Type ? $type->value : $type; return $obj; } diff --git a/src/Assets/AssetListParams/FileType.php b/src/Assets/AssetListParams/FileType.php index 65c88ef3..8c812108 100644 --- a/src/Assets/AssetListParams/FileType.php +++ b/src/Assets/AssetListParams/FileType.php @@ -4,9 +4,6 @@ namespace ImageKit\Assets\AssetListParams; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Filter results by file type. * @@ -14,13 +11,11 @@ * - `image` — include only image files * - `non-image` — include only non-image files (e.g., JS, CSS, video) */ -final class FileType implements ConverterSource +enum FileType: string { - use SdkEnum; - - public const ALL = 'all'; + case ALL = 'all'; - public const IMAGE = 'image'; + case IMAGE = 'image'; - public const NON_IMAGE = 'non-image'; + case NON_IMAGE = 'non-image'; } diff --git a/src/Assets/AssetListParams/Sort.php b/src/Assets/AssetListParams/Sort.php index 1afe0e65..ff5a2378 100644 --- a/src/Assets/AssetListParams/Sort.php +++ b/src/Assets/AssetListParams/Sort.php @@ -4,41 +4,36 @@ namespace ImageKit\Assets\AssetListParams; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Sort the results by one of the supported fields in ascending or descending order. */ -final class Sort implements ConverterSource +enum Sort: string { - use SdkEnum; - - public const ASC_NAME = 'ASC_NAME'; + case ASC_NAME = 'ASC_NAME'; - public const DESC_NAME = 'DESC_NAME'; + case DESC_NAME = 'DESC_NAME'; - public const ASC_CREATED = 'ASC_CREATED'; + case ASC_CREATED = 'ASC_CREATED'; - public const DESC_CREATED = 'DESC_CREATED'; + case DESC_CREATED = 'DESC_CREATED'; - public const ASC_UPDATED = 'ASC_UPDATED'; + case ASC_UPDATED = 'ASC_UPDATED'; - public const DESC_UPDATED = 'DESC_UPDATED'; + case DESC_UPDATED = 'DESC_UPDATED'; - public const ASC_HEIGHT = 'ASC_HEIGHT'; + case ASC_HEIGHT = 'ASC_HEIGHT'; - public const DESC_HEIGHT = 'DESC_HEIGHT'; + case DESC_HEIGHT = 'DESC_HEIGHT'; - public const ASC_WIDTH = 'ASC_WIDTH'; + case ASC_WIDTH = 'ASC_WIDTH'; - public const DESC_WIDTH = 'DESC_WIDTH'; + case DESC_WIDTH = 'DESC_WIDTH'; - public const ASC_SIZE = 'ASC_SIZE'; + case ASC_SIZE = 'ASC_SIZE'; - public const DESC_SIZE = 'DESC_SIZE'; + case DESC_SIZE = 'DESC_SIZE'; - public const ASC_RELEVANCE = 'ASC_RELEVANCE'; + case ASC_RELEVANCE = 'ASC_RELEVANCE'; - public const DESC_RELEVANCE = 'DESC_RELEVANCE'; + case DESC_RELEVANCE = 'DESC_RELEVANCE'; } diff --git a/src/Assets/AssetListParams/Type.php b/src/Assets/AssetListParams/Type.php index 1fc3cce5..a4d41c10 100644 --- a/src/Assets/AssetListParams/Type.php +++ b/src/Assets/AssetListParams/Type.php @@ -4,9 +4,6 @@ namespace ImageKit\Assets\AssetListParams; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Filter results by asset type. * @@ -15,15 +12,13 @@ * - `folder` — returns only folders * - `all` — returns both files and folders (excludes `file-version`) */ -final class Type implements ConverterSource +enum Type: string { - use SdkEnum; - - public const FILE = 'file'; + case FILE = 'file'; - public const FILE_VERSION = 'file-version'; + case FILE_VERSION = 'file-version'; - public const FOLDER = 'folder'; + case FOLDER = 'folder'; - public const ALL = 'all'; + case ALL = 'all'; } diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index d9c0c919..b59205d6 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -60,7 +60,7 @@ * overwriteCustomMetadata?: bool, * overwriteFile?: bool, * overwriteTags?: bool, - * responseFields?: list, + * responseFields?: list>, * tags?: list, * transformation?: Transformation, * useUniqueFileName?: bool, @@ -192,7 +192,7 @@ final class FileUploadParams implements BaseModel /** * Array of response field keys to include in the API response body. * - * @var list|null $responseFields + * @var list>|null $responseFields */ #[Api(list: ResponseField::class, optional: true)] public ?array $responseFields; @@ -263,7 +263,7 @@ public function __construct() * * @param array $customMetadata * @param list $extensions - * @param list $responseFields + * @param list> $responseFields * @param list $tags */ public static function with( @@ -306,7 +306,7 @@ public static function with( null !== $overwriteCustomMetadata && $obj->overwriteCustomMetadata = $overwriteCustomMetadata; null !== $overwriteFile && $obj->overwriteFile = $overwriteFile; null !== $overwriteTags && $obj->overwriteTags = $overwriteTags; - null !== $responseFields && $obj->responseFields = $responseFields; + null !== $responseFields && $obj->responseFields = array_map(fn ($v) => $v instanceof ResponseField ? $v->value : $v, $responseFields); null !== $tags && $obj->tags = $tags; null !== $transformation && $obj->transformation = $transformation; null !== $useUniqueFileName && $obj->useUniqueFileName = $useUniqueFileName; @@ -510,12 +510,12 @@ public function withOverwriteTags(bool $overwriteTags): self /** * Array of response field keys to include in the API response body. * - * @param list $responseFields + * @param list> $responseFields */ public function withResponseFields(array $responseFields): self { $obj = clone $this; - $obj->responseFields = $responseFields; + $obj->responseFields = array_map(fn ($v) => $v instanceof ResponseField ? $v->value : $v, $responseFields); return $obj; } diff --git a/src/Beta/V2/Files/FileUploadParams/ResponseField.php b/src/Beta/V2/Files/FileUploadParams/ResponseField.php index 19cd2bcd..acc888ab 100644 --- a/src/Beta/V2/Files/FileUploadParams/ResponseField.php +++ b/src/Beta/V2/Files/FileUploadParams/ResponseField.php @@ -4,24 +4,19 @@ namespace ImageKit\Beta\V2\Files\FileUploadParams; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - -final class ResponseField implements ConverterSource +enum ResponseField: string { - use SdkEnum; - - public const TAGS = 'tags'; + case TAGS = 'tags'; - public const CUSTOM_COORDINATES = 'customCoordinates'; + case CUSTOM_COORDINATES = 'customCoordinates'; - public const IS_PRIVATE_FILE = 'isPrivateFile'; + case IS_PRIVATE_FILE = 'isPrivateFile'; - public const EMBEDDED_METADATA = 'embeddedMetadata'; + case EMBEDDED_METADATA = 'embeddedMetadata'; - public const IS_PUBLISHED = 'isPublished'; + case IS_PUBLISHED = 'isPublished'; - public const CUSTOM_METADATA = 'customMetadata'; + case CUSTOM_METADATA = 'customMetadata'; - public const METADATA = 'metadata'; + case METADATA = 'metadata'; } diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php index 5e1747c1..fe04123a 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php @@ -11,7 +11,7 @@ /** * @phpstan-type abs_alias = array{ - * protocol: Protocol::*, type: string, value: string + * protocol: value-of, type: string, value: string * } */ final class Abs implements BaseModel @@ -28,7 +28,7 @@ final class Abs implements BaseModel /** * Streaming protocol to use (`hls` or `dash`). * - * @var Protocol::* $protocol + * @var value-of $protocol */ #[Api(enum: Protocol::class)] public string $protocol; @@ -63,13 +63,13 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Protocol::* $protocol + * @param Protocol|value-of $protocol */ - public static function with(string $protocol, string $value): self + public static function with(Protocol|string $protocol, string $value): self { $obj = new self; - $obj->protocol = $protocol; + $obj->protocol = $protocol instanceof Protocol ? $protocol->value : $protocol; $obj->value = $value; return $obj; @@ -78,12 +78,12 @@ public static function with(string $protocol, string $value): self /** * Streaming protocol to use (`hls` or `dash`). * - * @param Protocol::* $protocol + * @param Protocol|value-of $protocol */ - public function withProtocol(string $protocol): self + public function withProtocol(Protocol|string $protocol): self { $obj = clone $this; - $obj->protocol = $protocol; + $obj->protocol = $protocol instanceof Protocol ? $protocol->value : $protocol; return $obj; } diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php index 2220d490..a24c22af 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php @@ -4,17 +4,12 @@ namespace ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Streaming protocol to use (`hls` or `dash`). */ -final class Protocol implements ConverterSource +enum Protocol: string { - use SdkEnum; - - public const HLS = 'hls'; + case HLS = 'hls'; - public const DASH = 'dash'; + case DASH = 'dash'; } diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php index 84aa7475..bad49098 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php @@ -22,10 +22,10 @@ * If no extension was requested, then this parameter is not returned. * * @phpstan-type extension_status = array{ - * aiAutoDescription?: AIAutoDescription::*|null, - * awsAutoTagging?: AwsAutoTagging::*|null, - * googleAutoTagging?: GoogleAutoTagging::*|null, - * removeBg?: RemoveBg::*|null, + * aiAutoDescription?: value-of|null, + * awsAutoTagging?: value-of|null, + * googleAutoTagging?: value-of|null, + * removeBg?: value-of|null, * } */ final class ExtensionStatus implements BaseModel @@ -33,19 +33,19 @@ final class ExtensionStatus implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var AIAutoDescription::*|null $aiAutoDescription */ + /** @var value-of|null $aiAutoDescription */ #[Api('ai-auto-description', enum: AIAutoDescription::class, optional: true)] public ?string $aiAutoDescription; - /** @var AwsAutoTagging::*|null $awsAutoTagging */ + /** @var value-of|null $awsAutoTagging */ #[Api('aws-auto-tagging', enum: AwsAutoTagging::class, optional: true)] public ?string $awsAutoTagging; - /** @var GoogleAutoTagging::*|null $googleAutoTagging */ + /** @var value-of|null $googleAutoTagging */ #[Api('google-auto-tagging', enum: GoogleAutoTagging::class, optional: true)] public ?string $googleAutoTagging; - /** @var RemoveBg::*|null $removeBg */ + /** @var value-of|null $removeBg */ #[Api('remove-bg', enum: RemoveBg::class, optional: true)] public ?string $removeBg; @@ -59,67 +59,70 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AIAutoDescription::* $aiAutoDescription - * @param AwsAutoTagging::* $awsAutoTagging - * @param GoogleAutoTagging::* $googleAutoTagging - * @param RemoveBg::* $removeBg + * @param AIAutoDescription|value-of $aiAutoDescription + * @param AwsAutoTagging|value-of $awsAutoTagging + * @param GoogleAutoTagging|value-of $googleAutoTagging + * @param RemoveBg|value-of $removeBg */ public static function with( - ?string $aiAutoDescription = null, - ?string $awsAutoTagging = null, - ?string $googleAutoTagging = null, - ?string $removeBg = null, + AIAutoDescription|string|null $aiAutoDescription = null, + AwsAutoTagging|string|null $awsAutoTagging = null, + GoogleAutoTagging|string|null $googleAutoTagging = null, + RemoveBg|string|null $removeBg = null, ): self { $obj = new self; - null !== $aiAutoDescription && $obj->aiAutoDescription = $aiAutoDescription; - null !== $awsAutoTagging && $obj->awsAutoTagging = $awsAutoTagging; - null !== $googleAutoTagging && $obj->googleAutoTagging = $googleAutoTagging; - null !== $removeBg && $obj->removeBg = $removeBg; + null !== $aiAutoDescription && $obj->aiAutoDescription = $aiAutoDescription instanceof AIAutoDescription ? $aiAutoDescription->value : $aiAutoDescription; + null !== $awsAutoTagging && $obj->awsAutoTagging = $awsAutoTagging instanceof AwsAutoTagging ? $awsAutoTagging->value : $awsAutoTagging; + null !== $googleAutoTagging && $obj->googleAutoTagging = $googleAutoTagging instanceof GoogleAutoTagging ? $googleAutoTagging->value : $googleAutoTagging; + null !== $removeBg && $obj->removeBg = $removeBg instanceof RemoveBg ? $removeBg->value : $removeBg; return $obj; } /** - * @param AIAutoDescription::* $aiAutoDescription + * @param AIAutoDescription|value-of $aiAutoDescription */ - public function withAIAutoDescription(string $aiAutoDescription): self - { + public function withAIAutoDescription( + AIAutoDescription|string $aiAutoDescription + ): self { $obj = clone $this; - $obj->aiAutoDescription = $aiAutoDescription; + $obj->aiAutoDescription = $aiAutoDescription instanceof AIAutoDescription ? $aiAutoDescription->value : $aiAutoDescription; return $obj; } /** - * @param AwsAutoTagging::* $awsAutoTagging + * @param AwsAutoTagging|value-of $awsAutoTagging */ - public function withAwsAutoTagging(string $awsAutoTagging): self - { + public function withAwsAutoTagging( + AwsAutoTagging|string $awsAutoTagging + ): self { $obj = clone $this; - $obj->awsAutoTagging = $awsAutoTagging; + $obj->awsAutoTagging = $awsAutoTagging instanceof AwsAutoTagging ? $awsAutoTagging->value : $awsAutoTagging; return $obj; } /** - * @param GoogleAutoTagging::* $googleAutoTagging + * @param GoogleAutoTagging|value-of $googleAutoTagging */ - public function withGoogleAutoTagging(string $googleAutoTagging): self - { + public function withGoogleAutoTagging( + GoogleAutoTagging|string $googleAutoTagging + ): self { $obj = clone $this; - $obj->googleAutoTagging = $googleAutoTagging; + $obj->googleAutoTagging = $googleAutoTagging instanceof GoogleAutoTagging ? $googleAutoTagging->value : $googleAutoTagging; return $obj; } /** - * @param RemoveBg::* $removeBg + * @param RemoveBg|value-of $removeBg */ - public function withRemoveBg(string $removeBg): self + public function withRemoveBg(RemoveBg|string $removeBg): self { $obj = clone $this; - $obj->removeBg = $removeBg; + $obj->removeBg = $removeBg instanceof RemoveBg ? $removeBg->value : $removeBg; return $obj; } diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php index c1579539..c38a0dcf 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php @@ -4,16 +4,11 @@ namespace ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - -final class AIAutoDescription implements ConverterSource +enum AIAutoDescription: string { - use SdkEnum; - - public const SUCCESS = 'success'; + case SUCCESS = 'success'; - public const PENDING = 'pending'; + case PENDING = 'pending'; - public const FAILED = 'failed'; + case FAILED = 'failed'; } diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php index f912c9d7..ac0ff91d 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php @@ -4,16 +4,11 @@ namespace ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - -final class AwsAutoTagging implements ConverterSource +enum AwsAutoTagging: string { - use SdkEnum; - - public const SUCCESS = 'success'; + case SUCCESS = 'success'; - public const PENDING = 'pending'; + case PENDING = 'pending'; - public const FAILED = 'failed'; + case FAILED = 'failed'; } diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php index 7a2b9aa7..740091fe 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php @@ -4,16 +4,11 @@ namespace ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - -final class GoogleAutoTagging implements ConverterSource +enum GoogleAutoTagging: string { - use SdkEnum; - - public const SUCCESS = 'success'; + case SUCCESS = 'success'; - public const PENDING = 'pending'; + case PENDING = 'pending'; - public const FAILED = 'failed'; + case FAILED = 'failed'; } diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php index 5eda5fb5..5b1468d3 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php @@ -4,16 +4,11 @@ namespace ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - -final class RemoveBg implements ConverterSource +enum RemoveBg: string { - use SdkEnum; - - public const SUCCESS = 'success'; + case SUCCESS = 'success'; - public const PENDING = 'pending'; + case PENDING = 'pending'; - public const FAILED = 'failed'; + case FAILED = 'failed'; } diff --git a/src/Cache/Invalidation/InvalidationGetResponse.php b/src/Cache/Invalidation/InvalidationGetResponse.php index 8a114e35..7b60dad2 100644 --- a/src/Cache/Invalidation/InvalidationGetResponse.php +++ b/src/Cache/Invalidation/InvalidationGetResponse.php @@ -10,7 +10,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type invalidation_get_response = array{status?: Status::*|null} + * @phpstan-type invalidation_get_response = array{status?: value-of|null} */ final class InvalidationGetResponse implements BaseModel { @@ -20,7 +20,7 @@ final class InvalidationGetResponse implements BaseModel /** * Status of the purge request. * - * @var Status::*|null $status + * @var value-of|null $status */ #[Api(enum: Status::class, optional: true)] public ?string $status; @@ -35,13 +35,13 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Status::* $status + * @param Status|value-of $status */ - public static function with(?string $status = null): self + public static function with(Status|string|null $status = null): self { $obj = new self; - null !== $status && $obj->status = $status; + null !== $status && $obj->status = $status instanceof Status ? $status->value : $status; return $obj; } @@ -49,12 +49,12 @@ public static function with(?string $status = null): self /** * Status of the purge request. * - * @param Status::* $status + * @param Status|value-of $status */ - public function withStatus(string $status): self + public function withStatus(Status|string $status): self { $obj = clone $this; - $obj->status = $status; + $obj->status = $status instanceof Status ? $status->value : $status; return $obj; } diff --git a/src/Cache/Invalidation/InvalidationGetResponse/Status.php b/src/Cache/Invalidation/InvalidationGetResponse/Status.php index d446c2de..3b72a61a 100644 --- a/src/Cache/Invalidation/InvalidationGetResponse/Status.php +++ b/src/Cache/Invalidation/InvalidationGetResponse/Status.php @@ -4,17 +4,12 @@ namespace ImageKit\Cache\Invalidation\InvalidationGetResponse; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Status of the purge request. */ -final class Status implements ConverterSource +enum Status: string { - use SdkEnum; - - public const PENDING = 'Pending'; + case PENDING = 'Pending'; - public const COMPLETED = 'Completed'; + case COMPLETED = 'Completed'; } diff --git a/src/Core/Attributes/Api.php b/src/Core/Attributes/Api.php index b5a02264..8a1e3e0f 100644 --- a/src/Core/Attributes/Api.php +++ b/src/Core/Attributes/Api.php @@ -6,6 +6,7 @@ use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\EnumOf; use ImageKit\Core\Conversion\ListOf; use ImageKit\Core\Conversion\MapOf; @@ -15,14 +16,15 @@ #[\Attribute(\Attribute::TARGET_PROPERTY)] final class Api { - /** - * @var class-string|Converter|string|null - */ + /** @var class-string|Converter|string|null */ public readonly Converter|string|null $type; + /** @var array */ + private static array $enumConverters = []; + /** * @param class-string|Converter|string|null $type - * @param class-string|Converter|null $enum + * @param class-string<\BackedEnum>|Converter|null $enum * @param class-string|Converter|null $union * @param class-string|Converter|string|null $list * @param class-string|Converter|string|null $map @@ -37,6 +39,28 @@ public function __construct( public readonly bool $nullable = false, public readonly bool $optional = false, ) { - $this->type = $type ?? $enum ?? $union ?? ($list ? new ListOf($list) : ($map ? new MapOf($map) : null)); + $type ??= $union; + if (null !== $list) { + $type ??= new ListOf($list); + } + if (null !== $map) { + $type ??= new MapOf($map); + } + if (null !== $enum) { + $type ??= $enum instanceof Converter ? $enum : $this->getEnumConverter($enum); + } + + $this->type = $type; + } + + /** @property class-string<\BackedEnum> $enum */ + private function getEnumConverter(string $enum): Converter + { + if (!isset(self::$enumConverters[$enum])) { + $converter = new EnumOf(array_column($enum::cases(), 'value')); // @phpstan-ignore-line + self::$enumConverters[$enum] = $converter; + } + + return self::$enumConverters[$enum]; } } diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema.php b/src/CustomMetadataFields/CustomMetadataField/Schema.php index c1f7bead..b3d6b0f4 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema.php @@ -15,7 +15,7 @@ * An object that describes the rules for the custom metadata field value. * * @phpstan-type schema_alias = array{ - * type: Type::*, + * type: value-of, * defaultValue?: string|float|bool|null|list, * isValueRequired?: bool|null, * maxLength?: float|null, @@ -33,7 +33,7 @@ final class Schema implements BaseModel /** * Type of the custom metadata field. * - * @var Type::* $type + * @var value-of $type */ #[Api(enum: Type::class)] public string $type; @@ -108,12 +108,12 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Type::* $type + * @param Type|value-of $type * @param string|float|bool|list $defaultValue * @param list $selectOptions */ public static function with( - string $type, + Type|string $type, string|float|bool|array|null $defaultValue = null, ?bool $isValueRequired = null, ?float $maxLength = null, @@ -124,7 +124,7 @@ public static function with( ): self { $obj = new self; - $obj->type = $type; + $obj->type = $type instanceof Type ? $type->value : $type; null !== $defaultValue && $obj->defaultValue = $defaultValue; null !== $isValueRequired && $obj->isValueRequired = $isValueRequired; @@ -140,12 +140,12 @@ public static function with( /** * Type of the custom metadata field. * - * @param Type::* $type + * @param Type|value-of $type */ - public function withType(string $type): self + public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type; + $obj->type = $type instanceof Type ? $type->value : $type; return $obj; } diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/Type.php b/src/CustomMetadataFields/CustomMetadataField/Schema/Type.php index 2e567bd1..3c5e1691 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/Type.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/Type.php @@ -4,27 +4,22 @@ namespace ImageKit\CustomMetadataFields\CustomMetadataField\Schema; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Type of the custom metadata field. */ -final class Type implements ConverterSource +enum Type: string { - use SdkEnum; - - public const TEXT = 'Text'; + case TEXT = 'Text'; - public const TEXTAREA = 'Textarea'; + case TEXTAREA = 'Textarea'; - public const NUMBER = 'Number'; + case NUMBER = 'Number'; - public const DATE = 'Date'; + case DATE = 'Date'; - public const BOOLEAN = 'Boolean'; + case BOOLEAN = 'Boolean'; - public const SINGLE_SELECT = 'SingleSelect'; + case SINGLE_SELECT = 'SingleSelect'; - public const MULTI_SELECT = 'MultiSelect'; + case MULTI_SELECT = 'MultiSelect'; } diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php index 397ec2bb..1bd8911f 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php @@ -13,7 +13,7 @@ /** * @phpstan-type schema_alias = array{ - * type: Type::*, + * type: value-of, * defaultValue?: string|float|bool|null|list, * isValueRequired?: bool|null, * maxLength?: float|null, @@ -31,7 +31,7 @@ final class Schema implements BaseModel /** * Type of the custom metadata field. * - * @var Type::* $type + * @var value-of $type */ #[Api(enum: Type::class)] public string $type; @@ -106,12 +106,12 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Type::* $type + * @param Type|value-of $type * @param string|float|bool|list $defaultValue * @param list $selectOptions */ public static function with( - string $type, + Type|string $type, string|float|bool|array|null $defaultValue = null, ?bool $isValueRequired = null, ?float $maxLength = null, @@ -122,7 +122,7 @@ public static function with( ): self { $obj = new self; - $obj->type = $type; + $obj->type = $type instanceof Type ? $type->value : $type; null !== $defaultValue && $obj->defaultValue = $defaultValue; null !== $isValueRequired && $obj->isValueRequired = $isValueRequired; @@ -138,12 +138,12 @@ public static function with( /** * Type of the custom metadata field. * - * @param Type::* $type + * @param Type|value-of $type */ - public function withType(string $type): self + public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type; + $obj->type = $type instanceof Type ? $type->value : $type; return $obj; } diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/Type.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/Type.php index 048a6f6e..9918b486 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/Type.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/Type.php @@ -4,27 +4,22 @@ namespace ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Type of the custom metadata field. */ -final class Type implements ConverterSource +enum Type: string { - use SdkEnum; - - public const TEXT = 'Text'; + case TEXT = 'Text'; - public const TEXTAREA = 'Textarea'; + case TEXTAREA = 'Textarea'; - public const NUMBER = 'Number'; + case NUMBER = 'Number'; - public const DATE = 'Date'; + case DATE = 'Date'; - public const BOOLEAN = 'Boolean'; + case BOOLEAN = 'Boolean'; - public const SINGLE_SELECT = 'SingleSelect'; + case SINGLE_SELECT = 'SingleSelect'; - public const MULTI_SELECT = 'MultiSelect'; + case MULTI_SELECT = 'MultiSelect'; } diff --git a/src/ExtensionItem/AutoTaggingExtension.php b/src/ExtensionItem/AutoTaggingExtension.php index 262f220b..d8547ca0 100644 --- a/src/ExtensionItem/AutoTaggingExtension.php +++ b/src/ExtensionItem/AutoTaggingExtension.php @@ -11,7 +11,7 @@ /** * @phpstan-type auto_tagging_extension = array{ - * maxTags: int, minConfidence: int, name: Name::* + * maxTags: int, minConfidence: int, name: value-of * } */ final class AutoTaggingExtension implements BaseModel @@ -34,7 +34,7 @@ final class AutoTaggingExtension implements BaseModel /** * Specifies the auto-tagging extension used. * - * @var Name::* $name + * @var value-of $name */ #[Api(enum: Name::class)] public string $name; @@ -66,18 +66,18 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Name::* $name + * @param Name|value-of $name */ public static function with( int $maxTags, int $minConfidence, - string $name + Name|string $name ): self { $obj = new self; $obj->maxTags = $maxTags; $obj->minConfidence = $minConfidence; - $obj->name = $name; + $obj->name = $name instanceof Name ? $name->value : $name; return $obj; } @@ -107,12 +107,12 @@ public function withMinConfidence(int $minConfidence): self /** * Specifies the auto-tagging extension used. * - * @param Name::* $name + * @param Name|value-of $name */ - public function withName(string $name): self + public function withName(Name|string $name): self { $obj = clone $this; - $obj->name = $name; + $obj->name = $name instanceof Name ? $name->value : $name; return $obj; } diff --git a/src/ExtensionItem/AutoTaggingExtension/Name.php b/src/ExtensionItem/AutoTaggingExtension/Name.php index 7289da91..853dc5ad 100644 --- a/src/ExtensionItem/AutoTaggingExtension/Name.php +++ b/src/ExtensionItem/AutoTaggingExtension/Name.php @@ -4,17 +4,12 @@ namespace ImageKit\ExtensionItem\AutoTaggingExtension; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Specifies the auto-tagging extension used. */ -final class Name implements ConverterSource +enum Name: string { - use SdkEnum; - - public const GOOGLE_AUTO_TAGGING = 'google-auto-tagging'; + case GOOGLE_AUTO_TAGGING = 'google-auto-tagging'; - public const AWS_AUTO_TAGGING = 'aws-auto-tagging'; + case AWS_AUTO_TAGGING = 'aws-auto-tagging'; } diff --git a/src/Files/File.php b/src/Files/File.php index b2b612a5..9acd3c95 100644 --- a/src/Files/File.php +++ b/src/Files/File.php @@ -32,7 +32,7 @@ * size?: float|null, * tags?: list|null, * thumbnail?: string|null, - * type?: Type::*|null, + * type?: value-of|null, * updatedAt?: \DateTimeInterface|null, * url?: string|null, * versionInfo?: VersionInfo|null, @@ -155,7 +155,7 @@ final class File implements BaseModel /** * Type of the asset. * - * @var Type::*|null $type + * @var value-of|null $type */ #[Api(enum: Type::class, optional: true)] public ?string $type; @@ -197,7 +197,7 @@ public function __construct() * @param list|null $aiTags * @param array $customMetadata * @param list|null $tags - * @param Type::* $type + * @param Type|value-of $type */ public static function with( ?array $aiTags = null, @@ -217,7 +217,7 @@ public static function with( ?float $size = null, ?array $tags = null, ?string $thumbnail = null, - ?string $type = null, + Type|string|null $type = null, ?\DateTimeInterface $updatedAt = null, ?string $url = null, ?VersionInfo $versionInfo = null, @@ -242,7 +242,7 @@ public static function with( null !== $size && $obj->size = $size; null !== $tags && $obj->tags = $tags; null !== $thumbnail && $obj->thumbnail = $thumbnail; - null !== $type && $obj->type = $type; + null !== $type && $obj->type = $type instanceof Type ? $type->value : $type; null !== $updatedAt && $obj->updatedAt = $updatedAt; null !== $url && $obj->url = $url; null !== $versionInfo && $obj->versionInfo = $versionInfo; @@ -447,12 +447,12 @@ public function withThumbnail(string $thumbnail): self /** * Type of the asset. * - * @param Type::* $type + * @param Type|value-of $type */ - public function withType(string $type): self + public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type; + $obj->type = $type instanceof Type ? $type->value : $type; return $obj; } diff --git a/src/Files/File/Type.php b/src/Files/File/Type.php index 8d6f266a..5c97f13f 100644 --- a/src/Files/File/Type.php +++ b/src/Files/File/Type.php @@ -4,17 +4,12 @@ namespace ImageKit\Files\File; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Type of the asset. */ -final class Type implements ConverterSource +enum Type: string { - use SdkEnum; - - public const FILE = 'file'; + case FILE = 'file'; - public const FILE_VERSION = 'file-version'; + case FILE_VERSION = 'file-version'; } diff --git a/src/Files/FileUpdateResponse/ExtensionStatus.php b/src/Files/FileUpdateResponse/ExtensionStatus.php index e9a8ebfb..918ed884 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus.php @@ -14,10 +14,10 @@ /** * @phpstan-type extension_status = array{ - * aiAutoDescription?: AIAutoDescription::*|null, - * awsAutoTagging?: AwsAutoTagging::*|null, - * googleAutoTagging?: GoogleAutoTagging::*|null, - * removeBg?: RemoveBg::*|null, + * aiAutoDescription?: value-of|null, + * awsAutoTagging?: value-of|null, + * googleAutoTagging?: value-of|null, + * removeBg?: value-of|null, * } */ final class ExtensionStatus implements BaseModel @@ -25,19 +25,19 @@ final class ExtensionStatus implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var AIAutoDescription::*|null $aiAutoDescription */ + /** @var value-of|null $aiAutoDescription */ #[Api('ai-auto-description', enum: AIAutoDescription::class, optional: true)] public ?string $aiAutoDescription; - /** @var AwsAutoTagging::*|null $awsAutoTagging */ + /** @var value-of|null $awsAutoTagging */ #[Api('aws-auto-tagging', enum: AwsAutoTagging::class, optional: true)] public ?string $awsAutoTagging; - /** @var GoogleAutoTagging::*|null $googleAutoTagging */ + /** @var value-of|null $googleAutoTagging */ #[Api('google-auto-tagging', enum: GoogleAutoTagging::class, optional: true)] public ?string $googleAutoTagging; - /** @var RemoveBg::*|null $removeBg */ + /** @var value-of|null $removeBg */ #[Api('remove-bg', enum: RemoveBg::class, optional: true)] public ?string $removeBg; @@ -51,67 +51,70 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AIAutoDescription::* $aiAutoDescription - * @param AwsAutoTagging::* $awsAutoTagging - * @param GoogleAutoTagging::* $googleAutoTagging - * @param RemoveBg::* $removeBg + * @param AIAutoDescription|value-of $aiAutoDescription + * @param AwsAutoTagging|value-of $awsAutoTagging + * @param GoogleAutoTagging|value-of $googleAutoTagging + * @param RemoveBg|value-of $removeBg */ public static function with( - ?string $aiAutoDescription = null, - ?string $awsAutoTagging = null, - ?string $googleAutoTagging = null, - ?string $removeBg = null, + AIAutoDescription|string|null $aiAutoDescription = null, + AwsAutoTagging|string|null $awsAutoTagging = null, + GoogleAutoTagging|string|null $googleAutoTagging = null, + RemoveBg|string|null $removeBg = null, ): self { $obj = new self; - null !== $aiAutoDescription && $obj->aiAutoDescription = $aiAutoDescription; - null !== $awsAutoTagging && $obj->awsAutoTagging = $awsAutoTagging; - null !== $googleAutoTagging && $obj->googleAutoTagging = $googleAutoTagging; - null !== $removeBg && $obj->removeBg = $removeBg; + null !== $aiAutoDescription && $obj->aiAutoDescription = $aiAutoDescription instanceof AIAutoDescription ? $aiAutoDescription->value : $aiAutoDescription; + null !== $awsAutoTagging && $obj->awsAutoTagging = $awsAutoTagging instanceof AwsAutoTagging ? $awsAutoTagging->value : $awsAutoTagging; + null !== $googleAutoTagging && $obj->googleAutoTagging = $googleAutoTagging instanceof GoogleAutoTagging ? $googleAutoTagging->value : $googleAutoTagging; + null !== $removeBg && $obj->removeBg = $removeBg instanceof RemoveBg ? $removeBg->value : $removeBg; return $obj; } /** - * @param AIAutoDescription::* $aiAutoDescription + * @param AIAutoDescription|value-of $aiAutoDescription */ - public function withAIAutoDescription(string $aiAutoDescription): self - { + public function withAIAutoDescription( + AIAutoDescription|string $aiAutoDescription + ): self { $obj = clone $this; - $obj->aiAutoDescription = $aiAutoDescription; + $obj->aiAutoDescription = $aiAutoDescription instanceof AIAutoDescription ? $aiAutoDescription->value : $aiAutoDescription; return $obj; } /** - * @param AwsAutoTagging::* $awsAutoTagging + * @param AwsAutoTagging|value-of $awsAutoTagging */ - public function withAwsAutoTagging(string $awsAutoTagging): self - { + public function withAwsAutoTagging( + AwsAutoTagging|string $awsAutoTagging + ): self { $obj = clone $this; - $obj->awsAutoTagging = $awsAutoTagging; + $obj->awsAutoTagging = $awsAutoTagging instanceof AwsAutoTagging ? $awsAutoTagging->value : $awsAutoTagging; return $obj; } /** - * @param GoogleAutoTagging::* $googleAutoTagging + * @param GoogleAutoTagging|value-of $googleAutoTagging */ - public function withGoogleAutoTagging(string $googleAutoTagging): self - { + public function withGoogleAutoTagging( + GoogleAutoTagging|string $googleAutoTagging + ): self { $obj = clone $this; - $obj->googleAutoTagging = $googleAutoTagging; + $obj->googleAutoTagging = $googleAutoTagging instanceof GoogleAutoTagging ? $googleAutoTagging->value : $googleAutoTagging; return $obj; } /** - * @param RemoveBg::* $removeBg + * @param RemoveBg|value-of $removeBg */ - public function withRemoveBg(string $removeBg): self + public function withRemoveBg(RemoveBg|string $removeBg): self { $obj = clone $this; - $obj->removeBg = $removeBg; + $obj->removeBg = $removeBg instanceof RemoveBg ? $removeBg->value : $removeBg; return $obj; } diff --git a/src/Files/FileUpdateResponse/ExtensionStatus/AIAutoDescription.php b/src/Files/FileUpdateResponse/ExtensionStatus/AIAutoDescription.php index 984373de..ae67f332 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus/AIAutoDescription.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus/AIAutoDescription.php @@ -4,16 +4,11 @@ namespace ImageKit\Files\FileUpdateResponse\ExtensionStatus; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - -final class AIAutoDescription implements ConverterSource +enum AIAutoDescription: string { - use SdkEnum; - - public const SUCCESS = 'success'; + case SUCCESS = 'success'; - public const PENDING = 'pending'; + case PENDING = 'pending'; - public const FAILED = 'failed'; + case FAILED = 'failed'; } diff --git a/src/Files/FileUpdateResponse/ExtensionStatus/AwsAutoTagging.php b/src/Files/FileUpdateResponse/ExtensionStatus/AwsAutoTagging.php index 5e2975be..0dba4e7e 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus/AwsAutoTagging.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus/AwsAutoTagging.php @@ -4,16 +4,11 @@ namespace ImageKit\Files\FileUpdateResponse\ExtensionStatus; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - -final class AwsAutoTagging implements ConverterSource +enum AwsAutoTagging: string { - use SdkEnum; - - public const SUCCESS = 'success'; + case SUCCESS = 'success'; - public const PENDING = 'pending'; + case PENDING = 'pending'; - public const FAILED = 'failed'; + case FAILED = 'failed'; } diff --git a/src/Files/FileUpdateResponse/ExtensionStatus/GoogleAutoTagging.php b/src/Files/FileUpdateResponse/ExtensionStatus/GoogleAutoTagging.php index 4ac56446..8613623f 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus/GoogleAutoTagging.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus/GoogleAutoTagging.php @@ -4,16 +4,11 @@ namespace ImageKit\Files\FileUpdateResponse\ExtensionStatus; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - -final class GoogleAutoTagging implements ConverterSource +enum GoogleAutoTagging: string { - use SdkEnum; - - public const SUCCESS = 'success'; + case SUCCESS = 'success'; - public const PENDING = 'pending'; + case PENDING = 'pending'; - public const FAILED = 'failed'; + case FAILED = 'failed'; } diff --git a/src/Files/FileUpdateResponse/ExtensionStatus/RemoveBg.php b/src/Files/FileUpdateResponse/ExtensionStatus/RemoveBg.php index 17a37c38..db5b4275 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus/RemoveBg.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus/RemoveBg.php @@ -4,16 +4,11 @@ namespace ImageKit\Files\FileUpdateResponse\ExtensionStatus; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - -final class RemoveBg implements ConverterSource +enum RemoveBg: string { - use SdkEnum; - - public const SUCCESS = 'success'; + case SUCCESS = 'success'; - public const PENDING = 'pending'; + case PENDING = 'pending'; - public const FAILED = 'failed'; + case FAILED = 'failed'; } diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index ddbf55fe..cc8b80b1 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -62,7 +62,7 @@ * overwriteFile?: bool, * overwriteTags?: bool, * publicKey?: string, - * responseFields?: list, + * responseFields?: list>, * signature?: string, * tags?: list, * transformation?: Transformation, @@ -217,7 +217,7 @@ final class FileUploadParams implements BaseModel /** * Array of response field keys to include in the API response body. * - * @var list|null $responseFields + * @var list>|null $responseFields */ #[Api(list: ResponseField::class, optional: true)] public ?array $responseFields; @@ -296,7 +296,7 @@ public function __construct() * * @param array $customMetadata * @param list $extensions - * @param list $responseFields + * @param list> $responseFields * @param list $tags */ public static function with( @@ -344,7 +344,7 @@ public static function with( null !== $overwriteFile && $obj->overwriteFile = $overwriteFile; null !== $overwriteTags && $obj->overwriteTags = $overwriteTags; null !== $publicKey && $obj->publicKey = $publicKey; - null !== $responseFields && $obj->responseFields = $responseFields; + null !== $responseFields && $obj->responseFields = array_map(fn ($v) => $v instanceof ResponseField ? $v->value : $v, $responseFields); null !== $signature && $obj->signature = $signature; null !== $tags && $obj->tags = $tags; null !== $transformation && $obj->transformation = $transformation; @@ -581,12 +581,12 @@ public function withPublicKey(string $publicKey): self /** * Array of response field keys to include in the API response body. * - * @param list $responseFields + * @param list> $responseFields */ public function withResponseFields(array $responseFields): self { $obj = clone $this; - $obj->responseFields = $responseFields; + $obj->responseFields = array_map(fn ($v) => $v instanceof ResponseField ? $v->value : $v, $responseFields); return $obj; } diff --git a/src/Files/FileUploadParams/ResponseField.php b/src/Files/FileUploadParams/ResponseField.php index dc6a9aa7..60d5dda6 100644 --- a/src/Files/FileUploadParams/ResponseField.php +++ b/src/Files/FileUploadParams/ResponseField.php @@ -4,24 +4,19 @@ namespace ImageKit\Files\FileUploadParams; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - -final class ResponseField implements ConverterSource +enum ResponseField: string { - use SdkEnum; - - public const TAGS = 'tags'; + case TAGS = 'tags'; - public const CUSTOM_COORDINATES = 'customCoordinates'; + case CUSTOM_COORDINATES = 'customCoordinates'; - public const IS_PRIVATE_FILE = 'isPrivateFile'; + case IS_PRIVATE_FILE = 'isPrivateFile'; - public const EMBEDDED_METADATA = 'embeddedMetadata'; + case EMBEDDED_METADATA = 'embeddedMetadata'; - public const IS_PUBLISHED = 'isPublished'; + case IS_PUBLISHED = 'isPublished'; - public const CUSTOM_METADATA = 'customMetadata'; + case CUSTOM_METADATA = 'customMetadata'; - public const METADATA = 'metadata'; + case METADATA = 'metadata'; } diff --git a/src/Files/FileUploadParams/Transformation/Post/Abs.php b/src/Files/FileUploadParams/Transformation/Post/Abs.php index 0bdb263e..21671f92 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Abs.php +++ b/src/Files/FileUploadParams/Transformation/Post/Abs.php @@ -11,7 +11,7 @@ /** * @phpstan-type abs_alias = array{ - * protocol: Protocol::*, type: string, value: string + * protocol: value-of, type: string, value: string * } */ final class Abs implements BaseModel @@ -28,7 +28,7 @@ final class Abs implements BaseModel /** * Streaming protocol to use (`hls` or `dash`). * - * @var Protocol::* $protocol + * @var value-of $protocol */ #[Api(enum: Protocol::class)] public string $protocol; @@ -63,13 +63,13 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Protocol::* $protocol + * @param Protocol|value-of $protocol */ - public static function with(string $protocol, string $value): self + public static function with(Protocol|string $protocol, string $value): self { $obj = new self; - $obj->protocol = $protocol; + $obj->protocol = $protocol instanceof Protocol ? $protocol->value : $protocol; $obj->value = $value; return $obj; @@ -78,12 +78,12 @@ public static function with(string $protocol, string $value): self /** * Streaming protocol to use (`hls` or `dash`). * - * @param Protocol::* $protocol + * @param Protocol|value-of $protocol */ - public function withProtocol(string $protocol): self + public function withProtocol(Protocol|string $protocol): self { $obj = clone $this; - $obj->protocol = $protocol; + $obj->protocol = $protocol instanceof Protocol ? $protocol->value : $protocol; return $obj; } diff --git a/src/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php b/src/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php index a31642c3..bbf2208f 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php +++ b/src/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php @@ -4,17 +4,12 @@ namespace ImageKit\Files\FileUploadParams\Transformation\Post\Abs; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Streaming protocol to use (`hls` or `dash`). */ -final class Protocol implements ConverterSource +enum Protocol: string { - use SdkEnum; - - public const HLS = 'hls'; + case HLS = 'hls'; - public const DASH = 'dash'; + case DASH = 'dash'; } diff --git a/src/Files/FileUploadResponse/ExtensionStatus.php b/src/Files/FileUploadResponse/ExtensionStatus.php index 1b0abced..498b1b07 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Files/FileUploadResponse/ExtensionStatus.php @@ -22,10 +22,10 @@ * If no extension was requested, then this parameter is not returned. * * @phpstan-type extension_status = array{ - * aiAutoDescription?: AIAutoDescription::*|null, - * awsAutoTagging?: AwsAutoTagging::*|null, - * googleAutoTagging?: GoogleAutoTagging::*|null, - * removeBg?: RemoveBg::*|null, + * aiAutoDescription?: value-of|null, + * awsAutoTagging?: value-of|null, + * googleAutoTagging?: value-of|null, + * removeBg?: value-of|null, * } */ final class ExtensionStatus implements BaseModel @@ -33,19 +33,19 @@ final class ExtensionStatus implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var AIAutoDescription::*|null $aiAutoDescription */ + /** @var value-of|null $aiAutoDescription */ #[Api('ai-auto-description', enum: AIAutoDescription::class, optional: true)] public ?string $aiAutoDescription; - /** @var AwsAutoTagging::*|null $awsAutoTagging */ + /** @var value-of|null $awsAutoTagging */ #[Api('aws-auto-tagging', enum: AwsAutoTagging::class, optional: true)] public ?string $awsAutoTagging; - /** @var GoogleAutoTagging::*|null $googleAutoTagging */ + /** @var value-of|null $googleAutoTagging */ #[Api('google-auto-tagging', enum: GoogleAutoTagging::class, optional: true)] public ?string $googleAutoTagging; - /** @var RemoveBg::*|null $removeBg */ + /** @var value-of|null $removeBg */ #[Api('remove-bg', enum: RemoveBg::class, optional: true)] public ?string $removeBg; @@ -59,67 +59,70 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AIAutoDescription::* $aiAutoDescription - * @param AwsAutoTagging::* $awsAutoTagging - * @param GoogleAutoTagging::* $googleAutoTagging - * @param RemoveBg::* $removeBg + * @param AIAutoDescription|value-of $aiAutoDescription + * @param AwsAutoTagging|value-of $awsAutoTagging + * @param GoogleAutoTagging|value-of $googleAutoTagging + * @param RemoveBg|value-of $removeBg */ public static function with( - ?string $aiAutoDescription = null, - ?string $awsAutoTagging = null, - ?string $googleAutoTagging = null, - ?string $removeBg = null, + AIAutoDescription|string|null $aiAutoDescription = null, + AwsAutoTagging|string|null $awsAutoTagging = null, + GoogleAutoTagging|string|null $googleAutoTagging = null, + RemoveBg|string|null $removeBg = null, ): self { $obj = new self; - null !== $aiAutoDescription && $obj->aiAutoDescription = $aiAutoDescription; - null !== $awsAutoTagging && $obj->awsAutoTagging = $awsAutoTagging; - null !== $googleAutoTagging && $obj->googleAutoTagging = $googleAutoTagging; - null !== $removeBg && $obj->removeBg = $removeBg; + null !== $aiAutoDescription && $obj->aiAutoDescription = $aiAutoDescription instanceof AIAutoDescription ? $aiAutoDescription->value : $aiAutoDescription; + null !== $awsAutoTagging && $obj->awsAutoTagging = $awsAutoTagging instanceof AwsAutoTagging ? $awsAutoTagging->value : $awsAutoTagging; + null !== $googleAutoTagging && $obj->googleAutoTagging = $googleAutoTagging instanceof GoogleAutoTagging ? $googleAutoTagging->value : $googleAutoTagging; + null !== $removeBg && $obj->removeBg = $removeBg instanceof RemoveBg ? $removeBg->value : $removeBg; return $obj; } /** - * @param AIAutoDescription::* $aiAutoDescription + * @param AIAutoDescription|value-of $aiAutoDescription */ - public function withAIAutoDescription(string $aiAutoDescription): self - { + public function withAIAutoDescription( + AIAutoDescription|string $aiAutoDescription + ): self { $obj = clone $this; - $obj->aiAutoDescription = $aiAutoDescription; + $obj->aiAutoDescription = $aiAutoDescription instanceof AIAutoDescription ? $aiAutoDescription->value : $aiAutoDescription; return $obj; } /** - * @param AwsAutoTagging::* $awsAutoTagging + * @param AwsAutoTagging|value-of $awsAutoTagging */ - public function withAwsAutoTagging(string $awsAutoTagging): self - { + public function withAwsAutoTagging( + AwsAutoTagging|string $awsAutoTagging + ): self { $obj = clone $this; - $obj->awsAutoTagging = $awsAutoTagging; + $obj->awsAutoTagging = $awsAutoTagging instanceof AwsAutoTagging ? $awsAutoTagging->value : $awsAutoTagging; return $obj; } /** - * @param GoogleAutoTagging::* $googleAutoTagging + * @param GoogleAutoTagging|value-of $googleAutoTagging */ - public function withGoogleAutoTagging(string $googleAutoTagging): self - { + public function withGoogleAutoTagging( + GoogleAutoTagging|string $googleAutoTagging + ): self { $obj = clone $this; - $obj->googleAutoTagging = $googleAutoTagging; + $obj->googleAutoTagging = $googleAutoTagging instanceof GoogleAutoTagging ? $googleAutoTagging->value : $googleAutoTagging; return $obj; } /** - * @param RemoveBg::* $removeBg + * @param RemoveBg|value-of $removeBg */ - public function withRemoveBg(string $removeBg): self + public function withRemoveBg(RemoveBg|string $removeBg): self { $obj = clone $this; - $obj->removeBg = $removeBg; + $obj->removeBg = $removeBg instanceof RemoveBg ? $removeBg->value : $removeBg; return $obj; } diff --git a/src/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php b/src/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php index ade7f05c..a12ba5f1 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php +++ b/src/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php @@ -4,16 +4,11 @@ namespace ImageKit\Files\FileUploadResponse\ExtensionStatus; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - -final class AIAutoDescription implements ConverterSource +enum AIAutoDescription: string { - use SdkEnum; - - public const SUCCESS = 'success'; + case SUCCESS = 'success'; - public const PENDING = 'pending'; + case PENDING = 'pending'; - public const FAILED = 'failed'; + case FAILED = 'failed'; } diff --git a/src/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php b/src/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php index 07b7bca9..06158e8a 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php +++ b/src/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php @@ -4,16 +4,11 @@ namespace ImageKit\Files\FileUploadResponse\ExtensionStatus; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - -final class AwsAutoTagging implements ConverterSource +enum AwsAutoTagging: string { - use SdkEnum; - - public const SUCCESS = 'success'; + case SUCCESS = 'success'; - public const PENDING = 'pending'; + case PENDING = 'pending'; - public const FAILED = 'failed'; + case FAILED = 'failed'; } diff --git a/src/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php b/src/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php index 0b4605fe..5289a3cf 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php +++ b/src/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php @@ -4,16 +4,11 @@ namespace ImageKit\Files\FileUploadResponse\ExtensionStatus; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - -final class GoogleAutoTagging implements ConverterSource +enum GoogleAutoTagging: string { - use SdkEnum; - - public const SUCCESS = 'success'; + case SUCCESS = 'success'; - public const PENDING = 'pending'; + case PENDING = 'pending'; - public const FAILED = 'failed'; + case FAILED = 'failed'; } diff --git a/src/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php b/src/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php index 1df505ee..2321fd44 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php +++ b/src/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php @@ -4,16 +4,11 @@ namespace ImageKit\Files\FileUploadResponse\ExtensionStatus; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - -final class RemoveBg implements ConverterSource +enum RemoveBg: string { - use SdkEnum; - - public const SUCCESS = 'success'; + case SUCCESS = 'success'; - public const PENDING = 'pending'; + case PENDING = 'pending'; - public const FAILED = 'failed'; + case FAILED = 'failed'; } diff --git a/src/Files/Folder.php b/src/Files/Folder.php index 5778cbeb..bc8e3e74 100644 --- a/src/Files/Folder.php +++ b/src/Files/Folder.php @@ -15,7 +15,7 @@ * folderID?: string|null, * folderPath?: string|null, * name?: string|null, - * type?: Type::*|null, + * type?: value-of|null, * updatedAt?: \DateTimeInterface|null, * } */ @@ -51,7 +51,7 @@ final class Folder implements BaseModel /** * Type of the asset. * - * @var Type::*|null $type + * @var value-of|null $type */ #[Api(enum: Type::class, optional: true)] public ?string $type; @@ -72,14 +72,14 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Type::* $type + * @param Type|value-of $type */ public static function with( ?\DateTimeInterface $createdAt = null, ?string $folderID = null, ?string $folderPath = null, ?string $name = null, - ?string $type = null, + Type|string|null $type = null, ?\DateTimeInterface $updatedAt = null, ): self { $obj = new self; @@ -88,7 +88,7 @@ public static function with( null !== $folderID && $obj->folderID = $folderID; null !== $folderPath && $obj->folderPath = $folderPath; null !== $name && $obj->name = $name; - null !== $type && $obj->type = $type; + null !== $type && $obj->type = $type instanceof Type ? $type->value : $type; null !== $updatedAt && $obj->updatedAt = $updatedAt; return $obj; @@ -141,12 +141,12 @@ public function withName(string $name): self /** * Type of the asset. * - * @param Type::* $type + * @param Type|value-of $type */ - public function withType(string $type): self + public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type; + $obj->type = $type instanceof Type ? $type->value : $type; return $obj; } diff --git a/src/Files/Folder/Type.php b/src/Files/Folder/Type.php index 42c52ca4..91836374 100644 --- a/src/Files/Folder/Type.php +++ b/src/Files/Folder/Type.php @@ -4,15 +4,10 @@ namespace ImageKit\Files\Folder; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Type of the asset. */ -final class Type implements ConverterSource +enum Type: string { - use SdkEnum; - - public const FOLDER = 'folder'; + case FOLDER = 'folder'; } diff --git a/src/Folders/Job/JobGetResponse.php b/src/Folders/Job/JobGetResponse.php index bf0953e6..5b84581e 100644 --- a/src/Folders/Job/JobGetResponse.php +++ b/src/Folders/Job/JobGetResponse.php @@ -14,8 +14,8 @@ * @phpstan-type job_get_response = array{ * jobID?: string|null, * purgeRequestID?: string|null, - * status?: Status::*|null, - * type?: Type::*|null, + * status?: value-of|null, + * type?: value-of|null, * } */ final class JobGetResponse implements BaseModel @@ -38,7 +38,7 @@ final class JobGetResponse implements BaseModel /** * Status of the bulk job. * - * @var Status::*|null $status + * @var value-of|null $status */ #[Api(enum: Status::class, optional: true)] public ?string $status; @@ -46,7 +46,7 @@ final class JobGetResponse implements BaseModel /** * Type of the bulk job. * - * @var Type::*|null $type + * @var value-of|null $type */ #[Api(enum: Type::class, optional: true)] public ?string $type; @@ -61,21 +61,21 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Status::* $status - * @param Type::* $type + * @param Status|value-of $status + * @param Type|value-of $type */ public static function with( ?string $jobID = null, ?string $purgeRequestID = null, - ?string $status = null, - ?string $type = null, + Status|string|null $status = null, + Type|string|null $type = null, ): self { $obj = new self; null !== $jobID && $obj->jobID = $jobID; null !== $purgeRequestID && $obj->purgeRequestID = $purgeRequestID; - null !== $status && $obj->status = $status; - null !== $type && $obj->type = $type; + null !== $status && $obj->status = $status instanceof Status ? $status->value : $status; + null !== $type && $obj->type = $type instanceof Type ? $type->value : $type; return $obj; } @@ -105,12 +105,12 @@ public function withPurgeRequestID(string $purgeRequestID): self /** * Status of the bulk job. * - * @param Status::* $status + * @param Status|value-of $status */ - public function withStatus(string $status): self + public function withStatus(Status|string $status): self { $obj = clone $this; - $obj->status = $status; + $obj->status = $status instanceof Status ? $status->value : $status; return $obj; } @@ -118,12 +118,12 @@ public function withStatus(string $status): self /** * Type of the bulk job. * - * @param Type::* $type + * @param Type|value-of $type */ - public function withType(string $type): self + public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type; + $obj->type = $type instanceof Type ? $type->value : $type; return $obj; } diff --git a/src/Folders/Job/JobGetResponse/Status.php b/src/Folders/Job/JobGetResponse/Status.php index 99b4b5f7..0d3bad1f 100644 --- a/src/Folders/Job/JobGetResponse/Status.php +++ b/src/Folders/Job/JobGetResponse/Status.php @@ -4,17 +4,12 @@ namespace ImageKit\Folders\Job\JobGetResponse; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Status of the bulk job. */ -final class Status implements ConverterSource +enum Status: string { - use SdkEnum; - - public const PENDING = 'Pending'; + case PENDING = 'Pending'; - public const COMPLETED = 'Completed'; + case COMPLETED = 'Completed'; } diff --git a/src/Folders/Job/JobGetResponse/Type.php b/src/Folders/Job/JobGetResponse/Type.php index 6659899d..d4b1bfa0 100644 --- a/src/Folders/Job/JobGetResponse/Type.php +++ b/src/Folders/Job/JobGetResponse/Type.php @@ -4,19 +4,14 @@ namespace ImageKit\Folders\Job\JobGetResponse; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Type of the bulk job. */ -final class Type implements ConverterSource +enum Type: string { - use SdkEnum; - - public const COPY_FOLDER = 'COPY_FOLDER'; + case COPY_FOLDER = 'COPY_FOLDER'; - public const MOVE_FOLDER = 'MOVE_FOLDER'; + case MOVE_FOLDER = 'MOVE_FOLDER'; - public const RENAME_FOLDER = 'RENAME_FOLDER'; + case RENAME_FOLDER = 'RENAME_FOLDER'; } diff --git a/src/ImageOverlay.php b/src/ImageOverlay.php index ead19e1b..4ccf310f 100644 --- a/src/ImageOverlay.php +++ b/src/ImageOverlay.php @@ -13,7 +13,7 @@ * @phpstan-type image_overlay = array{ * input: string, * type: string, - * encoding?: Encoding::*|null, + * encoding?: value-of|null, * transformation?: list|null, * } */ @@ -37,7 +37,7 @@ final class ImageOverlay implements BaseModel * To always use base64 encoding (`ie-{base64}`), set this parameter to `base64`. * To always use plain text (`i-{input}`), set it to `plain`. * - * @var Encoding::*|null $encoding + * @var value-of|null $encoding */ #[Api(enum: Encoding::class, optional: true)] public ?string $encoding; @@ -75,19 +75,19 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Encoding::* $encoding + * @param Encoding|value-of $encoding * @param list $transformation */ public static function with( string $input, - ?string $encoding = null, - ?array $transformation = null + Encoding|string|null $encoding = null, + ?array $transformation = null, ): self { $obj = new self; $obj->input = $input; - null !== $encoding && $obj->encoding = $encoding; + null !== $encoding && $obj->encoding = $encoding instanceof Encoding ? $encoding->value : $encoding; null !== $transformation && $obj->transformation = $transformation; return $obj; @@ -110,12 +110,12 @@ public function withInput(string $input): self * To always use base64 encoding (`ie-{base64}`), set this parameter to `base64`. * To always use plain text (`i-{input}`), set it to `plain`. * - * @param Encoding::* $encoding + * @param Encoding|value-of $encoding */ - public function withEncoding(string $encoding): self + public function withEncoding(Encoding|string $encoding): self { $obj = clone $this; - $obj->encoding = $encoding; + $obj->encoding = $encoding instanceof Encoding ? $encoding->value : $encoding; return $obj; } diff --git a/src/ImageOverlay/Encoding.php b/src/ImageOverlay/Encoding.php index aad5a95d..5cfb190b 100644 --- a/src/ImageOverlay/Encoding.php +++ b/src/ImageOverlay/Encoding.php @@ -4,22 +4,17 @@ namespace ImageKit\ImageOverlay; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * The input path can be included in the layer as either `i-{input}` or `ie-{base64_encoded_input}`. * By default, the SDK determines the appropriate format automatically. * To always use base64 encoding (`ie-{base64}`), set this parameter to `base64`. * To always use plain text (`i-{input}`), set it to `plain`. */ -final class Encoding implements ConverterSource +enum Encoding: string { - use SdkEnum; - - public const AUTO = 'auto'; + case AUTO = 'auto'; - public const PLAIN = 'plain'; + case PLAIN = 'plain'; - public const BASE64 = 'base64'; + case BASE64 = 'base64'; } diff --git a/src/OverlayPosition.php b/src/OverlayPosition.php index 41a18ad9..f93d46d2 100644 --- a/src/OverlayPosition.php +++ b/src/OverlayPosition.php @@ -11,7 +11,7 @@ /** * @phpstan-type overlay_position = array{ - * focus?: Focus::*|null, x?: float|string|null, y?: float|string|null + * focus?: value-of|null, x?: float|string|null, y?: float|string|null * } */ final class OverlayPosition implements BaseModel @@ -23,7 +23,7 @@ final class OverlayPosition implements BaseModel * Specifies the position of the overlay relative to the parent image or video. * Maps to `lfo` in the URL. * - * @var Focus::*|null $focus + * @var value-of|null $focus */ #[Api(enum: Focus::class, optional: true)] public ?string $focus; @@ -56,16 +56,16 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Focus::* $focus + * @param Focus|value-of $focus */ public static function with( - ?string $focus = null, + Focus|string|null $focus = null, float|string|null $x = null, float|string|null $y = null ): self { $obj = new self; - null !== $focus && $obj->focus = $focus; + null !== $focus && $obj->focus = $focus instanceof Focus ? $focus->value : $focus; null !== $x && $obj->x = $x; null !== $y && $obj->y = $y; @@ -76,12 +76,12 @@ public static function with( * Specifies the position of the overlay relative to the parent image or video. * Maps to `lfo` in the URL. * - * @param Focus::* $focus + * @param Focus|value-of $focus */ - public function withFocus(string $focus): self + public function withFocus(Focus|string $focus): self { $obj = clone $this; - $obj->focus = $focus; + $obj->focus = $focus instanceof Focus ? $focus->value : $focus; return $obj; } diff --git a/src/OverlayPosition/Focus.php b/src/OverlayPosition/Focus.php index 120f5ce8..fc41d92b 100644 --- a/src/OverlayPosition/Focus.php +++ b/src/OverlayPosition/Focus.php @@ -4,32 +4,27 @@ namespace ImageKit\OverlayPosition; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Specifies the position of the overlay relative to the parent image or video. * Maps to `lfo` in the URL. */ -final class Focus implements ConverterSource +enum Focus: string { - use SdkEnum; - - public const CENTER = 'center'; + case CENTER = 'center'; - public const TOP = 'top'; + case TOP = 'top'; - public const LEFT = 'left'; + case LEFT = 'left'; - public const BOTTOM = 'bottom'; + case BOTTOM = 'bottom'; - public const RIGHT = 'right'; + case RIGHT = 'right'; - public const TOP_LEFT = 'top_left'; + case TOP_LEFT = 'top_left'; - public const TOP_RIGHT = 'top_right'; + case TOP_RIGHT = 'top_right'; - public const BOTTOM_LEFT = 'bottom_left'; + case BOTTOM_LEFT = 'bottom_left'; - public const BOTTOM_RIGHT = 'bottom_right'; + case BOTTOM_RIGHT = 'bottom_right'; } diff --git a/src/ServiceContracts/AssetsContract.php b/src/ServiceContracts/AssetsContract.php index 413ad923..46d6c7d8 100644 --- a/src/ServiceContracts/AssetsContract.php +++ b/src/ServiceContracts/AssetsContract.php @@ -18,7 +18,7 @@ interface AssetsContract /** * @api * - * @param FileType::* $fileType Filter results by file type. + * @param FileType|value-of $fileType Filter results by file type. * * - `all` — include all file types * - `image` — include only image files @@ -38,8 +38,8 @@ interface AssetsContract * * [Learn more](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#advanced-search-queries) from examples. * @param int $skip the number of results to skip before returning results - * @param Sort::* $sort sort the results by one of the supported fields in ascending or descending order - * @param Type::* $type Filter results by asset type. + * @param Sort|value-of $sort sort the results by one of the supported fields in ascending or descending order + * @param Type|value-of $type Filter results by asset type. * * - `file` — returns only files * - `file-version` — returns specific file versions diff --git a/src/ServiceContracts/Beta/V2/FilesContract.php b/src/ServiceContracts/Beta/V2/FilesContract.php index 4365eb28..ddb27113 100644 --- a/src/ServiceContracts/Beta/V2/FilesContract.php +++ b/src/ServiceContracts/Beta/V2/FilesContract.php @@ -52,7 +52,7 @@ interface FilesContract * @param bool $overwriteCustomMetadata if the request does not have `customMetadata`, and a file already exists at the exact location, existing customMetadata will be removed * @param bool $overwriteFile if `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed - * @param list $responseFields array of response field keys to include in the API response body + * @param list> $responseFields array of response field keys to include in the API response body * @param list $tags Set the tags while uploading the file. * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. * If this field is not specified and the file is overwritten, the existing tags will be removed. diff --git a/src/ServiceContracts/FilesContract.php b/src/ServiceContracts/FilesContract.php index b5d85db8..a63bca0e 100644 --- a/src/ServiceContracts/FilesContract.php +++ b/src/ServiceContracts/FilesContract.php @@ -172,7 +172,7 @@ public function rename( * @param bool $overwriteFile if `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed * @param string $publicKey Your ImageKit.io public key. This field is only required for authentication when uploading a file from the client side. - * @param list $responseFields array of response field keys to include in the API response body + * @param list> $responseFields array of response field keys to include in the API response body * @param string $signature HMAC-SHA1 digest of the token+expire using your ImageKit.io private API key as a key. Learn how to create a signature on the page below. This should be in lowercase. * * Signature must be calculated on the server-side. This field is only required for authentication when uploading a file from the client side. diff --git a/src/Services/AssetsService.php b/src/Services/AssetsService.php index 8ae23f14..c065a8c9 100644 --- a/src/Services/AssetsService.php +++ b/src/Services/AssetsService.php @@ -30,7 +30,7 @@ public function __construct(private Client $client) {} * * This API can list all the uploaded files and folders in your ImageKit.io media library. In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and provide this generated string as the value of the `searchQuery`. * - * @param FileType::* $fileType Filter results by file type. + * @param FileType|value-of $fileType Filter results by file type. * * - `all` — include all file types * - `image` — include only image files @@ -50,8 +50,8 @@ public function __construct(private Client $client) {} * * [Learn more](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#advanced-search-queries) from examples. * @param int $skip the number of results to skip before returning results - * @param Sort::* $sort sort the results by one of the supported fields in ascending or descending order - * @param Type::* $type Filter results by asset type. + * @param Sort|value-of $sort sort the results by one of the supported fields in ascending or descending order + * @param Type|value-of $type Filter results by asset type. * * - `file` — returns only files * - `file-version` — returns specific file versions diff --git a/src/Services/Beta/V2/FilesService.php b/src/Services/Beta/V2/FilesService.php index df9541c3..66e9c39a 100644 --- a/src/Services/Beta/V2/FilesService.php +++ b/src/Services/Beta/V2/FilesService.php @@ -75,7 +75,7 @@ public function __construct(private Client $client) {} * @param bool $overwriteCustomMetadata if the request does not have `customMetadata`, and a file already exists at the exact location, existing customMetadata will be removed * @param bool $overwriteFile if `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed - * @param list $responseFields array of response field keys to include in the API response body + * @param list> $responseFields array of response field keys to include in the API response body * @param list $tags Set the tags while uploading the file. * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. * If this field is not specified and the file is overwritten, the existing tags will be removed. diff --git a/src/Services/FilesService.php b/src/Services/FilesService.php index 78da9fae..deaf7864 100644 --- a/src/Services/FilesService.php +++ b/src/Services/FilesService.php @@ -334,7 +334,7 @@ public function rename( * @param bool $overwriteFile if `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed * @param string $publicKey Your ImageKit.io public key. This field is only required for authentication when uploading a file from the client side. - * @param list $responseFields array of response field keys to include in the API response body + * @param list> $responseFields array of response field keys to include in the API response body * @param string $signature HMAC-SHA1 digest of the token+expire using your ImageKit.io private API key as a key. Learn how to create a signature on the page below. This should be in lowercase. * * Signature must be calculated on the server-side. This field is only required for authentication when uploading a file from the client side. diff --git a/src/SrcOptions.php b/src/SrcOptions.php index 6513f4d1..8cc167f5 100644 --- a/src/SrcOptions.php +++ b/src/SrcOptions.php @@ -18,7 +18,7 @@ * queryParameters?: array|null, * signed?: bool|null, * transformation?: list|null, - * transformationPosition?: TransformationPosition::*|null, + * transformationPosition?: value-of|null, * } */ final class SrcOptions implements BaseModel @@ -85,7 +85,7 @@ final class SrcOptions implements BaseModel * If you want to add the transformation string in the path of the URL, set this to `path`. * Learn more in the [Transformations guide](https://imagekit.io/docs/transformations). * - * @var TransformationPosition::*|null $transformationPosition + * @var value-of|null $transformationPosition */ #[Api(enum: TransformationPosition::class, optional: true)] public ?string $transformationPosition; @@ -116,7 +116,7 @@ public function __construct() * * @param array $queryParameters * @param list $transformation - * @param TransformationPosition::* $transformationPosition + * @param TransformationPosition|value-of $transformationPosition */ public static function with( string $src, @@ -125,7 +125,7 @@ public static function with( ?array $queryParameters = null, ?bool $signed = null, ?array $transformation = null, - ?string $transformationPosition = null, + TransformationPosition|string|null $transformationPosition = null, ): self { $obj = new self; @@ -136,7 +136,7 @@ public static function with( null !== $queryParameters && $obj->queryParameters = $queryParameters; null !== $signed && $obj->signed = $signed; null !== $transformation && $obj->transformation = $transformation; - null !== $transformationPosition && $obj->transformationPosition = $transformationPosition; + null !== $transformationPosition && $obj->transformationPosition = $transformationPosition instanceof TransformationPosition ? $transformationPosition->value : $transformationPosition; return $obj; } @@ -230,13 +230,13 @@ public function withTransformation(array $transformation): self * If you want to add the transformation string in the path of the URL, set this to `path`. * Learn more in the [Transformations guide](https://imagekit.io/docs/transformations). * - * @param TransformationPosition::* $transformationPosition + * @param TransformationPosition|value-of $transformationPosition */ public function withTransformationPosition( - string $transformationPosition + TransformationPosition|string $transformationPosition ): self { $obj = clone $this; - $obj->transformationPosition = $transformationPosition; + $obj->transformationPosition = $transformationPosition instanceof TransformationPosition ? $transformationPosition->value : $transformationPosition; return $obj; } diff --git a/src/StreamingResolution.php b/src/StreamingResolution.php index 2b494e8b..bf501235 100644 --- a/src/StreamingResolution.php +++ b/src/StreamingResolution.php @@ -4,27 +4,22 @@ namespace ImageKit; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Available streaming resolutions for [adaptive bitrate streaming](https://imagekit.io/docs/adaptive-bitrate-streaming). */ -final class StreamingResolution implements ConverterSource +enum StreamingResolution: string { - use SdkEnum; - - public const STREAMING_RESOLUTION_240 = '240'; + case STREAMING_RESOLUTION_240 = '240'; - public const STREAMING_RESOLUTION_360 = '360'; + case STREAMING_RESOLUTION_360 = '360'; - public const STREAMING_RESOLUTION_480 = '480'; + case STREAMING_RESOLUTION_480 = '480'; - public const STREAMING_RESOLUTION_720 = '720'; + case STREAMING_RESOLUTION_720 = '720'; - public const STREAMING_RESOLUTION_1080 = '1080'; + case STREAMING_RESOLUTION_1080 = '1080'; - public const STREAMING_RESOLUTION_1440 = '1440'; + case STREAMING_RESOLUTION_1440 = '1440'; - public const STREAMING_RESOLUTION_2160 = '2160'; + case STREAMING_RESOLUTION_2160 = '2160'; } diff --git a/src/SubtitleOverlay.php b/src/SubtitleOverlay.php index 18bcc1df..03537f39 100644 --- a/src/SubtitleOverlay.php +++ b/src/SubtitleOverlay.php @@ -13,7 +13,7 @@ * @phpstan-type subtitle_overlay = array{ * input: string, * type: string, - * encoding?: Encoding::*|null, + * encoding?: value-of|null, * transformation?: list|null, * } */ @@ -37,7 +37,7 @@ final class SubtitleOverlay implements BaseModel * To always use base64 encoding (`ie-{base64}`), set this parameter to `base64`. * To always use plain text (`i-{input}`), set it to `plain`. * - * @var Encoding::*|null $encoding + * @var value-of|null $encoding */ #[Api(enum: Encoding::class, optional: true)] public ?string $encoding; @@ -74,19 +74,19 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Encoding::* $encoding + * @param Encoding|value-of $encoding * @param list $transformation */ public static function with( string $input, - ?string $encoding = null, - ?array $transformation = null + Encoding|string|null $encoding = null, + ?array $transformation = null, ): self { $obj = new self; $obj->input = $input; - null !== $encoding && $obj->encoding = $encoding; + null !== $encoding && $obj->encoding = $encoding instanceof Encoding ? $encoding->value : $encoding; null !== $transformation && $obj->transformation = $transformation; return $obj; @@ -109,12 +109,12 @@ public function withInput(string $input): self * To always use base64 encoding (`ie-{base64}`), set this parameter to `base64`. * To always use plain text (`i-{input}`), set it to `plain`. * - * @param Encoding::* $encoding + * @param Encoding|value-of $encoding */ - public function withEncoding(string $encoding): self + public function withEncoding(Encoding|string $encoding): self { $obj = clone $this; - $obj->encoding = $encoding; + $obj->encoding = $encoding instanceof Encoding ? $encoding->value : $encoding; return $obj; } diff --git a/src/SubtitleOverlay/Encoding.php b/src/SubtitleOverlay/Encoding.php index fef7e323..fb012d60 100644 --- a/src/SubtitleOverlay/Encoding.php +++ b/src/SubtitleOverlay/Encoding.php @@ -4,22 +4,17 @@ namespace ImageKit\SubtitleOverlay; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * The input path can be included in the layer as either `i-{input}` or `ie-{base64_encoded_input}`. * By default, the SDK determines the appropriate format automatically. * To always use base64 encoding (`ie-{base64}`), set this parameter to `base64`. * To always use plain text (`i-{input}`), set it to `plain`. */ -final class Encoding implements ConverterSource +enum Encoding: string { - use SdkEnum; - - public const AUTO = 'auto'; + case AUTO = 'auto'; - public const PLAIN = 'plain'; + case PLAIN = 'plain'; - public const BASE64 = 'base64'; + case BASE64 = 'base64'; } diff --git a/src/SubtitleOverlayTransformation.php b/src/SubtitleOverlayTransformation.php index 0a5e0cd9..94ed6c23 100644 --- a/src/SubtitleOverlayTransformation.php +++ b/src/SubtitleOverlayTransformation.php @@ -19,7 +19,7 @@ * fontOutline?: string|null, * fontShadow?: string|null, * fontSize?: float|null, - * typography?: Typography::*|null, + * typography?: value-of|null, * } */ final class SubtitleOverlayTransformation implements BaseModel @@ -82,7 +82,7 @@ final class SubtitleOverlayTransformation implements BaseModel * * [Subtitle styling options](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) * - * @var Typography::*|null $typography + * @var value-of|null $typography */ #[Api(enum: Typography::class, optional: true)] public ?string $typography; @@ -97,7 +97,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Typography::* $typography + * @param Typography|value-of $typography */ public static function with( ?string $background = null, @@ -106,7 +106,7 @@ public static function with( ?string $fontOutline = null, ?string $fontShadow = null, ?float $fontSize = null, - ?string $typography = null, + Typography|string|null $typography = null, ): self { $obj = new self; @@ -116,7 +116,7 @@ public static function with( null !== $fontOutline && $obj->fontOutline = $fontOutline; null !== $fontShadow && $obj->fontShadow = $fontShadow; null !== $fontSize && $obj->fontSize = $fontSize; - null !== $typography && $obj->typography = $typography; + null !== $typography && $obj->typography = $typography instanceof Typography ? $typography->value : $typography; return $obj; } @@ -206,12 +206,12 @@ public function withFontSize(float $fontSize): self * * [Subtitle styling options](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) * - * @param Typography::* $typography + * @param Typography|value-of $typography */ - public function withTypography(string $typography): self + public function withTypography(Typography|string $typography): self { $obj = clone $this; - $obj->typography = $typography; + $obj->typography = $typography instanceof Typography ? $typography->value : $typography; return $obj; } diff --git a/src/SubtitleOverlayTransformation/Typography.php b/src/SubtitleOverlayTransformation/Typography.php index e5a94c37..da7d956d 100644 --- a/src/SubtitleOverlayTransformation/Typography.php +++ b/src/SubtitleOverlayTransformation/Typography.php @@ -4,21 +4,16 @@ namespace ImageKit\SubtitleOverlayTransformation; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Sets the typography style of the subtitle text. Supports values are `b` for bold, `i` for italics, and `b_i` for bold with italics. * * [Subtitle styling options](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) */ -final class Typography implements ConverterSource +enum Typography: string { - use SdkEnum; - - public const B = 'b'; + case B = 'b'; - public const I = 'i'; + case I = 'i'; - public const B_I = 'b_i'; + case B_I = 'b_i'; } diff --git a/src/TextOverlay.php b/src/TextOverlay.php index da021bb1..24072937 100644 --- a/src/TextOverlay.php +++ b/src/TextOverlay.php @@ -13,7 +13,7 @@ * @phpstan-type text_overlay = array{ * text: string, * type: string, - * encoding?: Encoding::*|null, + * encoding?: value-of|null, * transformation?: list|null, * } */ @@ -37,7 +37,7 @@ final class TextOverlay implements BaseModel * To always use base64 (`ie-{base64}`), set this parameter to `base64`. * To always use plain text (`i-{input}`), set it to `plain`. * - * @var Encoding::*|null $encoding + * @var value-of|null $encoding */ #[Api(enum: Encoding::class, optional: true)] public ?string $encoding; @@ -74,19 +74,19 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Encoding::* $encoding + * @param Encoding|value-of $encoding * @param list $transformation */ public static function with( string $text, - ?string $encoding = null, + Encoding|string|null $encoding = null, ?array $transformation = null ): self { $obj = new self; $obj->text = $text; - null !== $encoding && $obj->encoding = $encoding; + null !== $encoding && $obj->encoding = $encoding instanceof Encoding ? $encoding->value : $encoding; null !== $transformation && $obj->transformation = $transformation; return $obj; @@ -109,12 +109,12 @@ public function withText(string $text): self * To always use base64 (`ie-{base64}`), set this parameter to `base64`. * To always use plain text (`i-{input}`), set it to `plain`. * - * @param Encoding::* $encoding + * @param Encoding|value-of $encoding */ - public function withEncoding(string $encoding): self + public function withEncoding(Encoding|string $encoding): self { $obj = clone $this; - $obj->encoding = $encoding; + $obj->encoding = $encoding instanceof Encoding ? $encoding->value : $encoding; return $obj; } diff --git a/src/TextOverlay/Encoding.php b/src/TextOverlay/Encoding.php index 9b23bed7..4daa16ef 100644 --- a/src/TextOverlay/Encoding.php +++ b/src/TextOverlay/Encoding.php @@ -4,22 +4,17 @@ namespace ImageKit\TextOverlay; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Text can be included in the layer as either `i-{input}` (plain text) or `ie-{base64_encoded_input}` (base64). * By default, the SDK selects the appropriate format based on the input text. * To always use base64 (`ie-{base64}`), set this parameter to `base64`. * To always use plain text (`i-{input}`), set it to `plain`. */ -final class Encoding implements ConverterSource +enum Encoding: string { - use SdkEnum; - - public const AUTO = 'auto'; + case AUTO = 'auto'; - public const PLAIN = 'plain'; + case PLAIN = 'plain'; - public const BASE64 = 'base64'; + case BASE64 = 'base64'; } diff --git a/src/TextOverlayTransformation.php b/src/TextOverlayTransformation.php index 51b434dd..c38b2805 100644 --- a/src/TextOverlayTransformation.php +++ b/src/TextOverlayTransformation.php @@ -14,11 +14,11 @@ * @phpstan-type text_overlay_transformation = array{ * alpha?: float|null, * background?: string|null, - * flip?: Flip::*|null, + * flip?: value-of|null, * fontColor?: string|null, * fontFamily?: string|null, * fontSize?: float|string|null, - * innerAlignment?: InnerAlignment::*|null, + * innerAlignment?: value-of|null, * lineHeight?: float|string|null, * padding?: float|string|null, * radius?: float|string|null, @@ -48,7 +48,7 @@ final class TextOverlayTransformation implements BaseModel /** * Flip the text overlay horizontally, vertically, or both. * - * @var Flip::*|null $flip + * @var value-of|null $flip */ #[Api(enum: Flip::class, optional: true)] public ?string $flip; @@ -75,7 +75,7 @@ final class TextOverlayTransformation implements BaseModel /** * Specifies the inner alignment of the text when width is more than the text length. * - * @var InnerAlignment::*|null $innerAlignment + * @var value-of|null $innerAlignment */ #[Api(enum: InnerAlignment::class, optional: true)] public ?string $innerAlignment; @@ -135,17 +135,17 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Flip::* $flip - * @param InnerAlignment::* $innerAlignment + * @param Flip|value-of $flip + * @param InnerAlignment|value-of $innerAlignment */ public static function with( ?float $alpha = null, ?string $background = null, - ?string $flip = null, + Flip|string|null $flip = null, ?string $fontColor = null, ?string $fontFamily = null, float|string|null $fontSize = null, - ?string $innerAlignment = null, + InnerAlignment|string|null $innerAlignment = null, float|string|null $lineHeight = null, float|string|null $padding = null, float|string|null $radius = null, @@ -157,11 +157,11 @@ public static function with( null !== $alpha && $obj->alpha = $alpha; null !== $background && $obj->background = $background; - null !== $flip && $obj->flip = $flip; + null !== $flip && $obj->flip = $flip instanceof Flip ? $flip->value : $flip; null !== $fontColor && $obj->fontColor = $fontColor; null !== $fontFamily && $obj->fontFamily = $fontFamily; null !== $fontSize && $obj->fontSize = $fontSize; - null !== $innerAlignment && $obj->innerAlignment = $innerAlignment; + null !== $innerAlignment && $obj->innerAlignment = $innerAlignment instanceof InnerAlignment ? $innerAlignment->value : $innerAlignment; null !== $lineHeight && $obj->lineHeight = $lineHeight; null !== $padding && $obj->padding = $padding; null !== $radius && $obj->radius = $radius; @@ -198,12 +198,12 @@ public function withBackground(string $background): self /** * Flip the text overlay horizontally, vertically, or both. * - * @param Flip::* $flip + * @param Flip|value-of $flip */ - public function withFlip(string $flip): self + public function withFlip(Flip|string $flip): self { $obj = clone $this; - $obj->flip = $flip; + $obj->flip = $flip instanceof Flip ? $flip->value : $flip; return $obj; } @@ -245,12 +245,13 @@ public function withFontSize(float|string $fontSize): self /** * Specifies the inner alignment of the text when width is more than the text length. * - * @param InnerAlignment::* $innerAlignment + * @param InnerAlignment|value-of $innerAlignment */ - public function withInnerAlignment(string $innerAlignment): self - { + public function withInnerAlignment( + InnerAlignment|string $innerAlignment + ): self { $obj = clone $this; - $obj->innerAlignment = $innerAlignment; + $obj->innerAlignment = $innerAlignment instanceof InnerAlignment ? $innerAlignment->value : $innerAlignment; return $obj; } diff --git a/src/TextOverlayTransformation/Flip.php b/src/TextOverlayTransformation/Flip.php index f51373b3..45d99626 100644 --- a/src/TextOverlayTransformation/Flip.php +++ b/src/TextOverlayTransformation/Flip.php @@ -4,21 +4,16 @@ namespace ImageKit\TextOverlayTransformation; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Flip the text overlay horizontally, vertically, or both. */ -final class Flip implements ConverterSource +enum Flip: string { - use SdkEnum; - - public const H = 'h'; + case H = 'h'; - public const V = 'v'; + case V = 'v'; - public const H_V = 'h_v'; + case H_V = 'h_v'; - public const V_H = 'v_h'; + case V_H = 'v_h'; } diff --git a/src/TextOverlayTransformation/InnerAlignment.php b/src/TextOverlayTransformation/InnerAlignment.php index 885e71a4..e38cc502 100644 --- a/src/TextOverlayTransformation/InnerAlignment.php +++ b/src/TextOverlayTransformation/InnerAlignment.php @@ -4,19 +4,14 @@ namespace ImageKit\TextOverlayTransformation; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Specifies the inner alignment of the text when width is more than the text length. */ -final class InnerAlignment implements ConverterSource +enum InnerAlignment: string { - use SdkEnum; - - public const LEFT = 'left'; + case LEFT = 'left'; - public const RIGHT = 'right'; + case RIGHT = 'right'; - public const CENTER = 'center'; + case CENTER = 'center'; } diff --git a/src/Transformation.php b/src/Transformation.php index 86d77e87..cf555c31 100644 --- a/src/Transformation.php +++ b/src/Transformation.php @@ -7,18 +7,11 @@ use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Transformation\AIRemoveBackground; -use ImageKit\Transformation\AIRemoveBackgroundExternal; -use ImageKit\Transformation\AIRetouch; -use ImageKit\Transformation\AIUpscale; -use ImageKit\Transformation\AIVariation; use ImageKit\Transformation\AudioCodec; -use ImageKit\Transformation\ContrastStretch; use ImageKit\Transformation\Crop; use ImageKit\Transformation\CropMode; use ImageKit\Transformation\Flip; use ImageKit\Transformation\Format; -use ImageKit\Transformation\Grayscale; use ImageKit\Transformation\VideoCodec; /** @@ -31,29 +24,29 @@ * aiChangeBackground?: string|null, * aiDropShadow?: bool|string|null, * aiEdit?: string|null, - * aiRemoveBackground?: AIRemoveBackground::*|null, - * aiRemoveBackgroundExternal?: AIRemoveBackgroundExternal::*|null, - * aiRetouch?: AIRetouch::*|null, - * aiUpscale?: AIUpscale::*|null, - * aiVariation?: AIVariation::*|null, + * aiRemoveBackground?: bool|null, + * aiRemoveBackgroundExternal?: bool|null, + * aiRetouch?: bool|null, + * aiUpscale?: bool|null, + * aiVariation?: bool|null, * aspectRatio?: float|string|null, - * audioCodec?: AudioCodec::*|null, + * audioCodec?: value-of|null, * background?: string|null, * blur?: float|null, * border?: string|null, * colorProfile?: bool|null, - * contrastStretch?: ContrastStretch::*|null, - * crop?: Crop::*|null, - * cropMode?: CropMode::*|null, + * contrastStretch?: bool|null, + * crop?: value-of|null, + * cropMode?: value-of|null, * defaultImage?: string|null, * dpr?: float|null, * duration?: float|string|null, * endOffset?: float|string|null, - * flip?: Flip::*|null, + * flip?: value-of|null, * focus?: string|null, - * format?: Format::*|null, + * format?: value-of|null, * gradient?: bool|string|null, - * grayscale?: Grayscale::*|null, + * grayscale?: bool|null, * height?: float|string|null, * lossless?: bool|null, * metadata?: bool|null, @@ -70,10 +63,10 @@ * shadow?: bool|string|null, * sharpen?: bool|float|null, * startOffset?: float|string|null, - * streamingResolutions?: list|null, + * streamingResolutions?: list>|null, * trim?: bool|float|null, * unsharpMask?: bool|string|null, - * videoCodec?: VideoCodec::*|null, + * videoCodec?: value-of|null, * width?: float|string|null, * x?: float|string|null, * xCenter?: float|string|null, @@ -119,10 +112,8 @@ final class Transformation implements BaseModel * Applies ImageKit's in-house background removal. * Supported inside overlay. * See [AI Background Removal](https://imagekit.io/docs/ai-transformations#imagekit-background-removal-e-bgremove). - * - * @var AIRemoveBackground::*|null $aiRemoveBackground */ - #[Api(enum: AIRemoveBackground::class, optional: true)] + #[Api(enum: STAINLESS_FIXME_AIRemoveBackground::class, optional: true)] public ?bool $aiRemoveBackground; /** @@ -130,38 +121,33 @@ final class Transformation implements BaseModel * Note: It is recommended to use aiRemoveBackground, ImageKit's in-house solution, which is more cost-effective. * Supported inside overlay. * See [External Background Removal](https://imagekit.io/docs/ai-transformations#background-removal-e-removedotbg). - * - * @var AIRemoveBackgroundExternal::*|null $aiRemoveBackgroundExternal */ - #[Api(enum: AIRemoveBackgroundExternal::class, optional: true)] + #[Api( + enum: STAINLESS_FIXME_AIRemoveBackgroundExternal::class, + optional: true + )] public ?bool $aiRemoveBackgroundExternal; /** * Performs AI-based retouching to improve faces or product shots. Not supported inside overlay. * See [AI Retouch](https://imagekit.io/docs/ai-transformations#retouch-e-retouch). - * - * @var AIRetouch::*|null $aiRetouch */ - #[Api(enum: AIRetouch::class, optional: true)] + #[Api(enum: STAINLESS_FIXME_AIRetouch::class, optional: true)] public ?bool $aiRetouch; /** * Upscales images beyond their original dimensions using AI. Not supported inside overlay. * See [AI Upscale](https://imagekit.io/docs/ai-transformations#upscale-e-upscale). - * - * @var AIUpscale::*|null $aiUpscale */ - #[Api(enum: AIUpscale::class, optional: true)] + #[Api(enum: STAINLESS_FIXME_AIUpscale::class, optional: true)] public ?bool $aiUpscale; /** * Generates a variation of an image using AI. This produces a new image with slight variations from the original, * such as changes in color, texture, and other visual elements, while preserving the structure and essence of the original image. Not supported inside overlay. * See [AI Generate Variations](https://imagekit.io/docs/ai-transformations#generate-variations-of-an-image-e-genvar). - * - * @var AIVariation::*|null $aiVariation */ - #[Api(enum: AIVariation::class, optional: true)] + #[Api(enum: STAINLESS_FIXME_AIVariation::class, optional: true)] public ?bool $aiVariation; /** @@ -175,7 +161,7 @@ final class Transformation implements BaseModel /** * Specifies the audio codec, e.g., `aac`, `opus`, or `none`. See [Audio codec](https://imagekit.io/docs/video-optimization#audio-codec---ac). * - * @var AudioCodec::*|null $audioCodec + * @var value-of|null $audioCodec */ #[Api(enum: AudioCodec::class, optional: true)] public ?string $audioCodec; @@ -215,16 +201,14 @@ final class Transformation implements BaseModel /** * Automatically enhances the contrast of an image (contrast stretch). * See [Contrast Stretch](https://imagekit.io/docs/effects-and-enhancements#contrast-stretch---e-contrast). - * - * @var ContrastStretch::*|null $contrastStretch */ - #[Api(enum: ContrastStretch::class, optional: true)] + #[Api(enum: STAINLESS_FIXME_ContrastStretch::class, optional: true)] public ?bool $contrastStretch; /** * Crop modes for image resizing. See [Crop modes & focus](https://imagekit.io/docs/image-resize-and-crop#crop-crop-modes--focus). * - * @var Crop::*|null $crop + * @var value-of|null $crop */ #[Api(enum: Crop::class, optional: true)] public ?string $crop; @@ -232,7 +216,7 @@ final class Transformation implements BaseModel /** * Additional crop modes for image resizing. See [Crop modes & focus](https://imagekit.io/docs/image-resize-and-crop#crop-crop-modes--focus). * - * @var CropMode::*|null $cropMode + * @var value-of|null $cropMode */ #[Api(enum: CropMode::class, optional: true)] public ?string $cropMode; @@ -272,7 +256,7 @@ final class Transformation implements BaseModel * Acceptable values: `h` (horizontal), `v` (vertical), `h_v` (horizontal and vertical), or `v_h`. * See [Flip](https://imagekit.io/docs/effects-and-enhancements#flip---fl). * - * @var Flip::*|null $flip + * @var value-of|null $flip */ #[Api(enum: Flip::class, optional: true)] public ?string $flip; @@ -294,7 +278,7 @@ final class Transformation implements BaseModel * ImageKit automatically delivers images and videos in the optimal format based on device support unless overridden by the dashboard settings or the format parameter. * See [Image format](https://imagekit.io/docs/image-optimization#format---f) and [Video format](https://imagekit.io/docs/video-optimization#format---f). * - * @var Format::*|null $format + * @var value-of|null $format */ #[Api(enum: Format::class, optional: true)] public ?string $format; @@ -308,10 +292,8 @@ final class Transformation implements BaseModel /** * Enables a grayscale effect for images. See [Grayscale](https://imagekit.io/docs/effects-and-enhancements#grayscale---e-grayscale). - * - * @var Grayscale::*|null $grayscale */ - #[Api(enum: Grayscale::class, optional: true)] + #[Api(enum: STAINLESS_FIXME_Grayscale::class, optional: true)] public ?bool $grayscale; /** @@ -441,7 +423,7 @@ final class Transformation implements BaseModel * An array of resolutions for adaptive bitrate streaming, e.g., [`240`, `360`, `480`, `720`, `1080`]. * See [Adaptive Bitrate Streaming](https://imagekit.io/docs/adaptive-bitrate-streaming). * - * @var list|null $streamingResolutions + * @var list>|null $streamingResolutions */ #[Api(list: StreamingResolution::class, optional: true)] public ?array $streamingResolutions; @@ -465,7 +447,7 @@ final class Transformation implements BaseModel /** * Specifies the video codec, e.g., `h264`, `vp9`, `av1`, or `none`. See [Video codec](https://imagekit.io/docs/video-optimization#video-codec---vc). * - * @var VideoCodec::*|null $videoCodec + * @var value-of|null $videoCodec */ #[Api(enum: VideoCodec::class, optional: true)] public ?string $videoCodec; @@ -520,20 +502,13 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AIRemoveBackground::* $aiRemoveBackground - * @param AIRemoveBackgroundExternal::* $aiRemoveBackgroundExternal - * @param AIRetouch::* $aiRetouch - * @param AIUpscale::* $aiUpscale - * @param AIVariation::* $aiVariation - * @param AudioCodec::* $audioCodec - * @param ContrastStretch::* $contrastStretch - * @param Crop::* $crop - * @param CropMode::* $cropMode - * @param Flip::* $flip - * @param Format::* $format - * @param Grayscale::* $grayscale - * @param list $streamingResolutions - * @param VideoCodec::* $videoCodec + * @param AudioCodec|value-of $audioCodec + * @param Crop|value-of $crop + * @param CropMode|value-of $cropMode + * @param Flip|value-of $flip + * @param Format|value-of $format + * @param list> $streamingResolutions + * @param VideoCodec|value-of $videoCodec */ public static function with( ?string $aiChangeBackground = null, @@ -545,21 +520,21 @@ public static function with( ?bool $aiUpscale = null, ?bool $aiVariation = null, float|string|null $aspectRatio = null, - ?string $audioCodec = null, + AudioCodec|string|null $audioCodec = null, ?string $background = null, ?float $blur = null, ?string $border = null, ?bool $colorProfile = null, ?bool $contrastStretch = null, - ?string $crop = null, - ?string $cropMode = null, + Crop|string|null $crop = null, + CropMode|string|null $cropMode = null, ?string $defaultImage = null, ?float $dpr = null, float|string|null $duration = null, float|string|null $endOffset = null, - ?string $flip = null, + Flip|string|null $flip = null, ?string $focus = null, - ?string $format = null, + Format|string|null $format = null, bool|string|null $gradient = null, ?bool $grayscale = null, float|string|null $height = null, @@ -581,7 +556,7 @@ public static function with( ?array $streamingResolutions = null, bool|float|null $trim = null, bool|string|null $unsharpMask = null, - ?string $videoCodec = null, + VideoCodec|string|null $videoCodec = null, float|string|null $width = null, float|string|null $x = null, float|string|null $xCenter = null, @@ -600,21 +575,21 @@ public static function with( null !== $aiUpscale && $obj->aiUpscale = $aiUpscale; null !== $aiVariation && $obj->aiVariation = $aiVariation; null !== $aspectRatio && $obj->aspectRatio = $aspectRatio; - null !== $audioCodec && $obj->audioCodec = $audioCodec; + null !== $audioCodec && $obj->audioCodec = $audioCodec instanceof AudioCodec ? $audioCodec->value : $audioCodec; null !== $background && $obj->background = $background; null !== $blur && $obj->blur = $blur; null !== $border && $obj->border = $border; null !== $colorProfile && $obj->colorProfile = $colorProfile; null !== $contrastStretch && $obj->contrastStretch = $contrastStretch; - null !== $crop && $obj->crop = $crop; - null !== $cropMode && $obj->cropMode = $cropMode; + null !== $crop && $obj->crop = $crop instanceof Crop ? $crop->value : $crop; + null !== $cropMode && $obj->cropMode = $cropMode instanceof CropMode ? $cropMode->value : $cropMode; null !== $defaultImage && $obj->defaultImage = $defaultImage; null !== $dpr && $obj->dpr = $dpr; null !== $duration && $obj->duration = $duration; null !== $endOffset && $obj->endOffset = $endOffset; - null !== $flip && $obj->flip = $flip; + null !== $flip && $obj->flip = $flip instanceof Flip ? $flip->value : $flip; null !== $focus && $obj->focus = $focus; - null !== $format && $obj->format = $format; + null !== $format && $obj->format = $format instanceof Format ? $format->value : $format; null !== $gradient && $obj->gradient = $gradient; null !== $grayscale && $obj->grayscale = $grayscale; null !== $height && $obj->height = $height; @@ -633,10 +608,10 @@ public static function with( null !== $shadow && $obj->shadow = $shadow; null !== $sharpen && $obj->sharpen = $sharpen; null !== $startOffset && $obj->startOffset = $startOffset; - null !== $streamingResolutions && $obj->streamingResolutions = $streamingResolutions; + null !== $streamingResolutions && $obj->streamingResolutions = array_map(fn ($v) => $v instanceof StreamingResolution ? $v->value : $v, $streamingResolutions); null !== $trim && $obj->trim = $trim; null !== $unsharpMask && $obj->unsharpMask = $unsharpMask; - null !== $videoCodec && $obj->videoCodec = $videoCodec; + null !== $videoCodec && $obj->videoCodec = $videoCodec instanceof VideoCodec ? $videoCodec->value : $videoCodec; null !== $width && $obj->width = $width; null !== $x && $obj->x = $x; null !== $xCenter && $obj->xCenter = $xCenter; @@ -694,8 +669,6 @@ public function withAIEdit(string $aiEdit): self * Applies ImageKit's in-house background removal. * Supported inside overlay. * See [AI Background Removal](https://imagekit.io/docs/ai-transformations#imagekit-background-removal-e-bgremove). - * - * @param AIRemoveBackground::* $aiRemoveBackground */ public function withAIRemoveBackground(bool $aiRemoveBackground): self { @@ -710,8 +683,6 @@ public function withAIRemoveBackground(bool $aiRemoveBackground): self * Note: It is recommended to use aiRemoveBackground, ImageKit's in-house solution, which is more cost-effective. * Supported inside overlay. * See [External Background Removal](https://imagekit.io/docs/ai-transformations#background-removal-e-removedotbg). - * - * @param AIRemoveBackgroundExternal::* $aiRemoveBackgroundExternal */ public function withAIRemoveBackgroundExternal( bool $aiRemoveBackgroundExternal @@ -725,8 +696,6 @@ public function withAIRemoveBackgroundExternal( /** * Performs AI-based retouching to improve faces or product shots. Not supported inside overlay. * See [AI Retouch](https://imagekit.io/docs/ai-transformations#retouch-e-retouch). - * - * @param AIRetouch::* $aiRetouch */ public function withAIRetouch(bool $aiRetouch): self { @@ -739,8 +708,6 @@ public function withAIRetouch(bool $aiRetouch): self /** * Upscales images beyond their original dimensions using AI. Not supported inside overlay. * See [AI Upscale](https://imagekit.io/docs/ai-transformations#upscale-e-upscale). - * - * @param AIUpscale::* $aiUpscale */ public function withAIUpscale(bool $aiUpscale): self { @@ -754,8 +721,6 @@ public function withAIUpscale(bool $aiUpscale): self * Generates a variation of an image using AI. This produces a new image with slight variations from the original, * such as changes in color, texture, and other visual elements, while preserving the structure and essence of the original image. Not supported inside overlay. * See [AI Generate Variations](https://imagekit.io/docs/ai-transformations#generate-variations-of-an-image-e-genvar). - * - * @param AIVariation::* $aiVariation */ public function withAIVariation(bool $aiVariation): self { @@ -781,12 +746,12 @@ public function withAspectRatio(float|string $aspectRatio): self /** * Specifies the audio codec, e.g., `aac`, `opus`, or `none`. See [Audio codec](https://imagekit.io/docs/video-optimization#audio-codec---ac). * - * @param AudioCodec::* $audioCodec + * @param AudioCodec|value-of $audioCodec */ - public function withAudioCodec(string $audioCodec): self + public function withAudioCodec(AudioCodec|string $audioCodec): self { $obj = clone $this; - $obj->audioCodec = $audioCodec; + $obj->audioCodec = $audioCodec instanceof AudioCodec ? $audioCodec->value : $audioCodec; return $obj; } @@ -846,8 +811,6 @@ public function withColorProfile(bool $colorProfile): self /** * Automatically enhances the contrast of an image (contrast stretch). * See [Contrast Stretch](https://imagekit.io/docs/effects-and-enhancements#contrast-stretch---e-contrast). - * - * @param ContrastStretch::* $contrastStretch */ public function withContrastStretch(bool $contrastStretch): self { @@ -860,12 +823,12 @@ public function withContrastStretch(bool $contrastStretch): self /** * Crop modes for image resizing. See [Crop modes & focus](https://imagekit.io/docs/image-resize-and-crop#crop-crop-modes--focus). * - * @param Crop::* $crop + * @param Crop|value-of $crop */ - public function withCrop(string $crop): self + public function withCrop(Crop|string $crop): self { $obj = clone $this; - $obj->crop = $crop; + $obj->crop = $crop instanceof Crop ? $crop->value : $crop; return $obj; } @@ -873,12 +836,12 @@ public function withCrop(string $crop): self /** * Additional crop modes for image resizing. See [Crop modes & focus](https://imagekit.io/docs/image-resize-and-crop#crop-crop-modes--focus). * - * @param CropMode::* $cropMode + * @param CropMode|value-of $cropMode */ - public function withCropMode(string $cropMode): self + public function withCropMode(CropMode|string $cropMode): self { $obj = clone $this; - $obj->cropMode = $cropMode; + $obj->cropMode = $cropMode instanceof CropMode ? $cropMode->value : $cropMode; return $obj; } @@ -938,12 +901,12 @@ public function withEndOffset(float|string $endOffset): self * Acceptable values: `h` (horizontal), `v` (vertical), `h_v` (horizontal and vertical), or `v_h`. * See [Flip](https://imagekit.io/docs/effects-and-enhancements#flip---fl). * - * @param Flip::* $flip + * @param Flip|value-of $flip */ - public function withFlip(string $flip): self + public function withFlip(Flip|string $flip): self { $obj = clone $this; - $obj->flip = $flip; + $obj->flip = $flip instanceof Flip ? $flip->value : $flip; return $obj; } @@ -970,12 +933,12 @@ public function withFocus(string $focus): self * ImageKit automatically delivers images and videos in the optimal format based on device support unless overridden by the dashboard settings or the format parameter. * See [Image format](https://imagekit.io/docs/image-optimization#format---f) and [Video format](https://imagekit.io/docs/video-optimization#format---f). * - * @param Format::* $format + * @param Format|value-of $format */ - public function withFormat(string $format): self + public function withFormat(Format|string $format): self { $obj = clone $this; - $obj->format = $format; + $obj->format = $format instanceof Format ? $format->value : $format; return $obj; } @@ -994,8 +957,6 @@ public function withGradient(bool|string $gradient): self /** * Enables a grayscale effect for images. See [Grayscale](https://imagekit.io/docs/effects-and-enhancements#grayscale---e-grayscale). - * - * @param Grayscale::* $grayscale */ public function withGrayscale(bool $grayscale): self { @@ -1213,12 +1174,12 @@ public function withStartOffset(float|string $startOffset): self * An array of resolutions for adaptive bitrate streaming, e.g., [`240`, `360`, `480`, `720`, `1080`]. * See [Adaptive Bitrate Streaming](https://imagekit.io/docs/adaptive-bitrate-streaming). * - * @param list $streamingResolutions + * @param list> $streamingResolutions */ public function withStreamingResolutions(array $streamingResolutions): self { $obj = clone $this; - $obj->streamingResolutions = $streamingResolutions; + $obj->streamingResolutions = array_map(fn ($v) => $v instanceof StreamingResolution ? $v->value : $v, $streamingResolutions); return $obj; } @@ -1252,12 +1213,12 @@ public function withUnsharpMask(bool|string $unsharpMask): self /** * Specifies the video codec, e.g., `h264`, `vp9`, `av1`, or `none`. See [Video codec](https://imagekit.io/docs/video-optimization#video-codec---vc). * - * @param VideoCodec::* $videoCodec + * @param VideoCodec|value-of $videoCodec */ - public function withVideoCodec(string $videoCodec): self + public function withVideoCodec(VideoCodec|string $videoCodec): self { $obj = clone $this; - $obj->videoCodec = $videoCodec; + $obj->videoCodec = $videoCodec instanceof VideoCodec ? $videoCodec->value : $videoCodec; return $obj; } diff --git a/src/Transformation/AIRemoveBackground.php b/src/Transformation/AIRemoveBackground.php deleted file mode 100644 index d5375dd4..00000000 --- a/src/Transformation/AIRemoveBackground.php +++ /dev/null @@ -1,20 +0,0 @@ -|null, * transformation?: list|null, * } */ @@ -37,7 +37,7 @@ final class VideoOverlay implements BaseModel * To always use base64 encoding (`ie-{base64}`), set this parameter to `base64`. * To always use plain text (`i-{input}`), set it to `plain`. * - * @var Encoding::*|null $encoding + * @var value-of|null $encoding */ #[Api(enum: Encoding::class, optional: true)] public ?string $encoding; @@ -75,19 +75,19 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Encoding::* $encoding + * @param Encoding|value-of $encoding * @param list $transformation */ public static function with( string $input, - ?string $encoding = null, - ?array $transformation = null + Encoding|string|null $encoding = null, + ?array $transformation = null, ): self { $obj = new self; $obj->input = $input; - null !== $encoding && $obj->encoding = $encoding; + null !== $encoding && $obj->encoding = $encoding instanceof Encoding ? $encoding->value : $encoding; null !== $transformation && $obj->transformation = $transformation; return $obj; @@ -110,12 +110,12 @@ public function withInput(string $input): self * To always use base64 encoding (`ie-{base64}`), set this parameter to `base64`. * To always use plain text (`i-{input}`), set it to `plain`. * - * @param Encoding::* $encoding + * @param Encoding|value-of $encoding */ - public function withEncoding(string $encoding): self + public function withEncoding(Encoding|string $encoding): self { $obj = clone $this; - $obj->encoding = $encoding; + $obj->encoding = $encoding instanceof Encoding ? $encoding->value : $encoding; return $obj; } diff --git a/src/VideoOverlay/Encoding.php b/src/VideoOverlay/Encoding.php index 1a789570..ab03972f 100644 --- a/src/VideoOverlay/Encoding.php +++ b/src/VideoOverlay/Encoding.php @@ -4,22 +4,17 @@ namespace ImageKit\VideoOverlay; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * The input path can be included in the layer as either `i-{input}` or `ie-{base64_encoded_input}`. * By default, the SDK determines the appropriate format automatically. * To always use base64 encoding (`ie-{base64}`), set this parameter to `base64`. * To always use plain text (`i-{input}`), set it to `plain`. */ -final class Encoding implements ConverterSource +enum Encoding: string { - use SdkEnum; - - public const AUTO = 'auto'; + case AUTO = 'auto'; - public const PLAIN = 'plain'; + case PLAIN = 'plain'; - public const BASE64 = 'base64'; + case BASE64 = 'base64'; } diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php index d527b693..ae9c6c78 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php @@ -12,7 +12,7 @@ /** * @phpstan-type transformation_alias = array{ - * type: Type::*, protocol?: Protocol::*|null, value?: string|null + * type: value-of, protocol?: value-of|null, value?: string|null * } */ final class Transformation implements BaseModel @@ -23,7 +23,7 @@ final class Transformation implements BaseModel /** * Type of the requested post-transformation. * - * @var Type::* $type + * @var value-of $type */ #[Api(enum: Type::class)] public string $type; @@ -31,7 +31,7 @@ final class Transformation implements BaseModel /** * Only applicable if transformation type is 'abs'. Streaming protocol used. * - * @var Protocol::*|null $protocol + * @var value-of|null $protocol */ #[Api(enum: Protocol::class, optional: true)] public ?string $protocol; @@ -66,19 +66,19 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Type::* $type - * @param Protocol::* $protocol + * @param Type|value-of $type + * @param Protocol|value-of $protocol */ public static function with( - string $type, - ?string $protocol = null, + Type|string $type, + Protocol|string|null $protocol = null, ?string $value = null ): self { $obj = new self; - $obj->type = $type; + $obj->type = $type instanceof Type ? $type->value : $type; - null !== $protocol && $obj->protocol = $protocol; + null !== $protocol && $obj->protocol = $protocol instanceof Protocol ? $protocol->value : $protocol; null !== $value && $obj->value = $value; return $obj; @@ -87,12 +87,12 @@ public static function with( /** * Type of the requested post-transformation. * - * @param Type::* $type + * @param Type|value-of $type */ - public function withType(string $type): self + public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type; + $obj->type = $type instanceof Type ? $type->value : $type; return $obj; } @@ -100,12 +100,12 @@ public function withType(string $type): self /** * Only applicable if transformation type is 'abs'. Streaming protocol used. * - * @param Protocol::* $protocol + * @param Protocol|value-of $protocol */ - public function withProtocol(string $protocol): self + public function withProtocol(Protocol|string $protocol): self { $obj = clone $this; - $obj->protocol = $protocol; + $obj->protocol = $protocol instanceof Protocol ? $protocol->value : $protocol; return $obj; } diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Protocol.php b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Protocol.php index d33fb754..f6f399cc 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Protocol.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Protocol.php @@ -4,17 +4,12 @@ namespace ImageKit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Only applicable if transformation type is 'abs'. Streaming protocol used. */ -final class Protocol implements ConverterSource +enum Protocol: string { - use SdkEnum; - - public const HLS = 'hls'; + case HLS = 'hls'; - public const DASH = 'dash'; + case DASH = 'dash'; } diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Type.php b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Type.php index 6a8c8264..5a9dbbf8 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Type.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Type.php @@ -4,21 +4,16 @@ namespace ImageKit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Type of the requested post-transformation. */ -final class Type implements ConverterSource +enum Type: string { - use SdkEnum; - - public const TRANSFORMATION = 'transformation'; + case TRANSFORMATION = 'transformation'; - public const ABS = 'abs'; + case ABS = 'abs'; - public const GIF_TO_VIDEO = 'gif-to-video'; + case GIF_TO_VIDEO = 'gif-to-video'; - public const THUMBNAIL = 'thumbnail'; + case THUMBNAIL = 'thumbnail'; } diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php index ce16b5b9..f57cb838 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php @@ -12,7 +12,7 @@ /** * @phpstan-type transformation_alias = array{ - * type: Type::*, protocol?: Protocol::*|null, value?: string|null + * type: value-of, protocol?: value-of|null, value?: string|null * } */ final class Transformation implements BaseModel @@ -23,7 +23,7 @@ final class Transformation implements BaseModel /** * Type of the requested post-transformation. * - * @var Type::* $type + * @var value-of $type */ #[Api(enum: Type::class)] public string $type; @@ -31,7 +31,7 @@ final class Transformation implements BaseModel /** * Only applicable if transformation type is 'abs'. Streaming protocol used. * - * @var Protocol::*|null $protocol + * @var value-of|null $protocol */ #[Api(enum: Protocol::class, optional: true)] public ?string $protocol; @@ -66,19 +66,19 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Type::* $type - * @param Protocol::* $protocol + * @param Type|value-of $type + * @param Protocol|value-of $protocol */ public static function with( - string $type, - ?string $protocol = null, + Type|string $type, + Protocol|string|null $protocol = null, ?string $value = null ): self { $obj = new self; - $obj->type = $type; + $obj->type = $type instanceof Type ? $type->value : $type; - null !== $protocol && $obj->protocol = $protocol; + null !== $protocol && $obj->protocol = $protocol instanceof Protocol ? $protocol->value : $protocol; null !== $value && $obj->value = $value; return $obj; @@ -87,12 +87,12 @@ public static function with( /** * Type of the requested post-transformation. * - * @param Type::* $type + * @param Type|value-of $type */ - public function withType(string $type): self + public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type; + $obj->type = $type instanceof Type ? $type->value : $type; return $obj; } @@ -100,12 +100,12 @@ public function withType(string $type): self /** * Only applicable if transformation type is 'abs'. Streaming protocol used. * - * @param Protocol::* $protocol + * @param Protocol|value-of $protocol */ - public function withProtocol(string $protocol): self + public function withProtocol(Protocol|string $protocol): self { $obj = clone $this; - $obj->protocol = $protocol; + $obj->protocol = $protocol instanceof Protocol ? $protocol->value : $protocol; return $obj; } diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Protocol.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Protocol.php index 35a3c151..e9a8d491 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Protocol.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Protocol.php @@ -4,17 +4,12 @@ namespace ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Only applicable if transformation type is 'abs'. Streaming protocol used. */ -final class Protocol implements ConverterSource +enum Protocol: string { - use SdkEnum; - - public const HLS = 'hls'; + case HLS = 'hls'; - public const DASH = 'dash'; + case DASH = 'dash'; } diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Type.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Type.php index 91f2951b..9b9fa624 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Type.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Type.php @@ -4,21 +4,16 @@ namespace ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Type of the requested post-transformation. */ -final class Type implements ConverterSource +enum Type: string { - use SdkEnum; - - public const TRANSFORMATION = 'transformation'; + case TRANSFORMATION = 'transformation'; - public const ABS = 'abs'; + case ABS = 'abs'; - public const GIF_TO_VIDEO = 'gif-to-video'; + case GIF_TO_VIDEO = 'gif-to-video'; - public const THUMBNAIL = 'thumbnail'; + case THUMBNAIL = 'thumbnail'; } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php index 66ec9040..8cd45604 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php @@ -22,10 +22,10 @@ * If no extension was requested, then this parameter is not returned. * * @phpstan-type extension_status = array{ - * aiAutoDescription?: AIAutoDescription::*|null, - * awsAutoTagging?: AwsAutoTagging::*|null, - * googleAutoTagging?: GoogleAutoTagging::*|null, - * removeBg?: RemoveBg::*|null, + * aiAutoDescription?: value-of|null, + * awsAutoTagging?: value-of|null, + * googleAutoTagging?: value-of|null, + * removeBg?: value-of|null, * } */ final class ExtensionStatus implements BaseModel @@ -33,19 +33,19 @@ final class ExtensionStatus implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var AIAutoDescription::*|null $aiAutoDescription */ + /** @var value-of|null $aiAutoDescription */ #[Api('ai-auto-description', enum: AIAutoDescription::class, optional: true)] public ?string $aiAutoDescription; - /** @var AwsAutoTagging::*|null $awsAutoTagging */ + /** @var value-of|null $awsAutoTagging */ #[Api('aws-auto-tagging', enum: AwsAutoTagging::class, optional: true)] public ?string $awsAutoTagging; - /** @var GoogleAutoTagging::*|null $googleAutoTagging */ + /** @var value-of|null $googleAutoTagging */ #[Api('google-auto-tagging', enum: GoogleAutoTagging::class, optional: true)] public ?string $googleAutoTagging; - /** @var RemoveBg::*|null $removeBg */ + /** @var value-of|null $removeBg */ #[Api('remove-bg', enum: RemoveBg::class, optional: true)] public ?string $removeBg; @@ -59,67 +59,70 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AIAutoDescription::* $aiAutoDescription - * @param AwsAutoTagging::* $awsAutoTagging - * @param GoogleAutoTagging::* $googleAutoTagging - * @param RemoveBg::* $removeBg + * @param AIAutoDescription|value-of $aiAutoDescription + * @param AwsAutoTagging|value-of $awsAutoTagging + * @param GoogleAutoTagging|value-of $googleAutoTagging + * @param RemoveBg|value-of $removeBg */ public static function with( - ?string $aiAutoDescription = null, - ?string $awsAutoTagging = null, - ?string $googleAutoTagging = null, - ?string $removeBg = null, + AIAutoDescription|string|null $aiAutoDescription = null, + AwsAutoTagging|string|null $awsAutoTagging = null, + GoogleAutoTagging|string|null $googleAutoTagging = null, + RemoveBg|string|null $removeBg = null, ): self { $obj = new self; - null !== $aiAutoDescription && $obj->aiAutoDescription = $aiAutoDescription; - null !== $awsAutoTagging && $obj->awsAutoTagging = $awsAutoTagging; - null !== $googleAutoTagging && $obj->googleAutoTagging = $googleAutoTagging; - null !== $removeBg && $obj->removeBg = $removeBg; + null !== $aiAutoDescription && $obj->aiAutoDescription = $aiAutoDescription instanceof AIAutoDescription ? $aiAutoDescription->value : $aiAutoDescription; + null !== $awsAutoTagging && $obj->awsAutoTagging = $awsAutoTagging instanceof AwsAutoTagging ? $awsAutoTagging->value : $awsAutoTagging; + null !== $googleAutoTagging && $obj->googleAutoTagging = $googleAutoTagging instanceof GoogleAutoTagging ? $googleAutoTagging->value : $googleAutoTagging; + null !== $removeBg && $obj->removeBg = $removeBg instanceof RemoveBg ? $removeBg->value : $removeBg; return $obj; } /** - * @param AIAutoDescription::* $aiAutoDescription + * @param AIAutoDescription|value-of $aiAutoDescription */ - public function withAIAutoDescription(string $aiAutoDescription): self - { + public function withAIAutoDescription( + AIAutoDescription|string $aiAutoDescription + ): self { $obj = clone $this; - $obj->aiAutoDescription = $aiAutoDescription; + $obj->aiAutoDescription = $aiAutoDescription instanceof AIAutoDescription ? $aiAutoDescription->value : $aiAutoDescription; return $obj; } /** - * @param AwsAutoTagging::* $awsAutoTagging + * @param AwsAutoTagging|value-of $awsAutoTagging */ - public function withAwsAutoTagging(string $awsAutoTagging): self - { + public function withAwsAutoTagging( + AwsAutoTagging|string $awsAutoTagging + ): self { $obj = clone $this; - $obj->awsAutoTagging = $awsAutoTagging; + $obj->awsAutoTagging = $awsAutoTagging instanceof AwsAutoTagging ? $awsAutoTagging->value : $awsAutoTagging; return $obj; } /** - * @param GoogleAutoTagging::* $googleAutoTagging + * @param GoogleAutoTagging|value-of $googleAutoTagging */ - public function withGoogleAutoTagging(string $googleAutoTagging): self - { + public function withGoogleAutoTagging( + GoogleAutoTagging|string $googleAutoTagging + ): self { $obj = clone $this; - $obj->googleAutoTagging = $googleAutoTagging; + $obj->googleAutoTagging = $googleAutoTagging instanceof GoogleAutoTagging ? $googleAutoTagging->value : $googleAutoTagging; return $obj; } /** - * @param RemoveBg::* $removeBg + * @param RemoveBg|value-of $removeBg */ - public function withRemoveBg(string $removeBg): self + public function withRemoveBg(RemoveBg|string $removeBg): self { $obj = clone $this; - $obj->removeBg = $removeBg; + $obj->removeBg = $removeBg instanceof RemoveBg ? $removeBg->value : $removeBg; return $obj; } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AIAutoDescription.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AIAutoDescription.php index ed95d763..a9cc5f07 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AIAutoDescription.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AIAutoDescription.php @@ -4,16 +4,11 @@ namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - -final class AIAutoDescription implements ConverterSource +enum AIAutoDescription: string { - use SdkEnum; - - public const SUCCESS = 'success'; + case SUCCESS = 'success'; - public const PENDING = 'pending'; + case PENDING = 'pending'; - public const FAILED = 'failed'; + case FAILED = 'failed'; } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AwsAutoTagging.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AwsAutoTagging.php index 7b12b235..6ff57cec 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AwsAutoTagging.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AwsAutoTagging.php @@ -4,16 +4,11 @@ namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - -final class AwsAutoTagging implements ConverterSource +enum AwsAutoTagging: string { - use SdkEnum; - - public const SUCCESS = 'success'; + case SUCCESS = 'success'; - public const PENDING = 'pending'; + case PENDING = 'pending'; - public const FAILED = 'failed'; + case FAILED = 'failed'; } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/GoogleAutoTagging.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/GoogleAutoTagging.php index 9e210a3e..31f9d58b 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/GoogleAutoTagging.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/GoogleAutoTagging.php @@ -4,16 +4,11 @@ namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - -final class GoogleAutoTagging implements ConverterSource +enum GoogleAutoTagging: string { - use SdkEnum; - - public const SUCCESS = 'success'; + case SUCCESS = 'success'; - public const PENDING = 'pending'; + case PENDING = 'pending'; - public const FAILED = 'failed'; + case FAILED = 'failed'; } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/RemoveBg.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/RemoveBg.php index 7f184fd2..6e389314 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/RemoveBg.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/RemoveBg.php @@ -4,16 +4,11 @@ namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - -final class RemoveBg implements ConverterSource +enum RemoveBg: string { - use SdkEnum; - - public const SUCCESS = 'success'; + case SUCCESS = 'success'; - public const PENDING = 'pending'; + case PENDING = 'pending'; - public const FAILED = 'failed'; + case FAILED = 'failed'; } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php index cf837b26..3e0c84d3 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php @@ -14,7 +14,7 @@ * Base information about a video transformation request. * * @phpstan-type transformation_alias = array{ - * type: Type::*, options?: Options|null + * type: value-of, options?: Options|null * } */ final class Transformation implements BaseModel @@ -28,7 +28,7 @@ final class Transformation implements BaseModel * - `gif-to-video`: Convert animated GIF to video format * - `video-thumbnail`: Generate thumbnail image from video * - * @var Type::* $type + * @var value-of $type */ #[Api(enum: Type::class)] public string $type; @@ -63,13 +63,15 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Type::* $type + * @param Type|value-of $type */ - public static function with(string $type, ?Options $options = null): self - { + public static function with( + Type|string $type, + ?Options $options = null + ): self { $obj = new self; - $obj->type = $type; + $obj->type = $type instanceof Type ? $type->value : $type; null !== $options && $obj->options = $options; @@ -82,12 +84,12 @@ public static function with(string $type, ?Options $options = null): self * - `gif-to-video`: Convert animated GIF to video format * - `video-thumbnail`: Generate thumbnail image from video * - * @param Type::* $type + * @param Type|value-of $type */ - public function withType(string $type): self + public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type; + $obj->type = $type instanceof Type ? $type->value : $type; return $obj; } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php index a0723d5b..fb68a78c 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php @@ -16,13 +16,13 @@ * Configuration options for video transformations. * * @phpstan-type options_alias = array{ - * audioCodec?: AudioCodec::*|null, + * audioCodec?: value-of|null, * autoRotate?: bool|null, - * format?: Format::*|null, + * format?: value-of|null, * quality?: int|null, - * streamProtocol?: StreamProtocol::*|null, + * streamProtocol?: value-of|null, * variants?: list|null, - * videoCodec?: VideoCodec::*|null, + * videoCodec?: value-of|null, * } */ final class Options implements BaseModel @@ -33,7 +33,7 @@ final class Options implements BaseModel /** * Audio codec used for encoding (aac or opus). * - * @var AudioCodec::*|null $audioCodec + * @var value-of|null $audioCodec */ #[Api('audio_codec', enum: AudioCodec::class, optional: true)] public ?string $audioCodec; @@ -47,7 +47,7 @@ final class Options implements BaseModel /** * Output format for the transformed video or thumbnail. * - * @var Format::*|null $format + * @var value-of|null $format */ #[Api(enum: Format::class, optional: true)] public ?string $format; @@ -61,7 +61,7 @@ final class Options implements BaseModel /** * Streaming protocol for adaptive bitrate streaming. * - * @var StreamProtocol::*|null $streamProtocol + * @var value-of|null $streamProtocol */ #[Api('stream_protocol', enum: StreamProtocol::class, optional: true)] public ?string $streamProtocol; @@ -77,7 +77,7 @@ final class Options implements BaseModel /** * Video codec used for encoding (h264, vp9, or av1). * - * @var VideoCodec::*|null $videoCodec + * @var value-of|null $videoCodec */ #[Api('video_codec', enum: VideoCodec::class, optional: true)] public ?string $videoCodec; @@ -92,30 +92,30 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AudioCodec::* $audioCodec - * @param Format::* $format - * @param StreamProtocol::* $streamProtocol + * @param AudioCodec|value-of $audioCodec + * @param Format|value-of $format + * @param StreamProtocol|value-of $streamProtocol * @param list $variants - * @param VideoCodec::* $videoCodec + * @param VideoCodec|value-of $videoCodec */ public static function with( - ?string $audioCodec = null, + AudioCodec|string|null $audioCodec = null, ?bool $autoRotate = null, - ?string $format = null, + Format|string|null $format = null, ?int $quality = null, - ?string $streamProtocol = null, + StreamProtocol|string|null $streamProtocol = null, ?array $variants = null, - ?string $videoCodec = null, + VideoCodec|string|null $videoCodec = null, ): self { $obj = new self; - null !== $audioCodec && $obj->audioCodec = $audioCodec; + null !== $audioCodec && $obj->audioCodec = $audioCodec instanceof AudioCodec ? $audioCodec->value : $audioCodec; null !== $autoRotate && $obj->autoRotate = $autoRotate; - null !== $format && $obj->format = $format; + null !== $format && $obj->format = $format instanceof Format ? $format->value : $format; null !== $quality && $obj->quality = $quality; - null !== $streamProtocol && $obj->streamProtocol = $streamProtocol; + null !== $streamProtocol && $obj->streamProtocol = $streamProtocol instanceof StreamProtocol ? $streamProtocol->value : $streamProtocol; null !== $variants && $obj->variants = $variants; - null !== $videoCodec && $obj->videoCodec = $videoCodec; + null !== $videoCodec && $obj->videoCodec = $videoCodec instanceof VideoCodec ? $videoCodec->value : $videoCodec; return $obj; } @@ -123,12 +123,12 @@ public static function with( /** * Audio codec used for encoding (aac or opus). * - * @param AudioCodec::* $audioCodec + * @param AudioCodec|value-of $audioCodec */ - public function withAudioCodec(string $audioCodec): self + public function withAudioCodec(AudioCodec|string $audioCodec): self { $obj = clone $this; - $obj->audioCodec = $audioCodec; + $obj->audioCodec = $audioCodec instanceof AudioCodec ? $audioCodec->value : $audioCodec; return $obj; } @@ -147,12 +147,12 @@ public function withAutoRotate(bool $autoRotate): self /** * Output format for the transformed video or thumbnail. * - * @param Format::* $format + * @param Format|value-of $format */ - public function withFormat(string $format): self + public function withFormat(Format|string $format): self { $obj = clone $this; - $obj->format = $format; + $obj->format = $format instanceof Format ? $format->value : $format; return $obj; } @@ -171,12 +171,13 @@ public function withQuality(int $quality): self /** * Streaming protocol for adaptive bitrate streaming. * - * @param StreamProtocol::* $streamProtocol + * @param StreamProtocol|value-of $streamProtocol */ - public function withStreamProtocol(string $streamProtocol): self - { + public function withStreamProtocol( + StreamProtocol|string $streamProtocol + ): self { $obj = clone $this; - $obj->streamProtocol = $streamProtocol; + $obj->streamProtocol = $streamProtocol instanceof StreamProtocol ? $streamProtocol->value : $streamProtocol; return $obj; } @@ -197,12 +198,12 @@ public function withVariants(array $variants): self /** * Video codec used for encoding (h264, vp9, or av1). * - * @param VideoCodec::* $videoCodec + * @param VideoCodec|value-of $videoCodec */ - public function withVideoCodec(string $videoCodec): self + public function withVideoCodec(VideoCodec|string $videoCodec): self { $obj = clone $this; - $obj->videoCodec = $videoCodec; + $obj->videoCodec = $videoCodec instanceof VideoCodec ? $videoCodec->value : $videoCodec; return $obj; } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/AudioCodec.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/AudioCodec.php index 59206f99..e9034932 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/AudioCodec.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/AudioCodec.php @@ -4,17 +4,12 @@ namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Audio codec used for encoding (aac or opus). */ -final class AudioCodec implements ConverterSource +enum AudioCodec: string { - use SdkEnum; - - public const AAC = 'aac'; + case AAC = 'aac'; - public const OPUS = 'opus'; + case OPUS = 'opus'; } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/Format.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/Format.php index e240fe6d..46b26e0e 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/Format.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/Format.php @@ -4,23 +4,18 @@ namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Output format for the transformed video or thumbnail. */ -final class Format implements ConverterSource +enum Format: string { - use SdkEnum; - - public const MP4 = 'mp4'; + case MP4 = 'mp4'; - public const WEBM = 'webm'; + case WEBM = 'webm'; - public const JPG = 'jpg'; + case JPG = 'jpg'; - public const PNG = 'png'; + case PNG = 'png'; - public const WEBP = 'webp'; + case WEBP = 'webp'; } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/StreamProtocol.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/StreamProtocol.php index 52c3096d..c8b11edd 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/StreamProtocol.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/StreamProtocol.php @@ -4,17 +4,12 @@ namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Streaming protocol for adaptive bitrate streaming. */ -final class StreamProtocol implements ConverterSource +enum StreamProtocol: string { - use SdkEnum; - - public const HLS = 'HLS'; + case HLS = 'HLS'; - public const DASH = 'DASH'; + case DASH = 'DASH'; } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/VideoCodec.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/VideoCodec.php index 637812d1..f2afe7bf 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/VideoCodec.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/VideoCodec.php @@ -4,19 +4,14 @@ namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Video codec used for encoding (h264, vp9, or av1). */ -final class VideoCodec implements ConverterSource +enum VideoCodec: string { - use SdkEnum; - - public const H264 = 'h264'; + case H264 = 'h264'; - public const VP9 = 'vp9'; + case VP9 = 'vp9'; - public const AV1 = 'av1'; + case AV1 = 'av1'; } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Type.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Type.php index 79c11dfd..75f61460 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Type.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Type.php @@ -4,22 +4,17 @@ namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Type of video transformation: * - `video-transformation`: Standard video processing (resize, format conversion, etc.) * - `gif-to-video`: Convert animated GIF to video format * - `video-thumbnail`: Generate thumbnail image from video */ -final class Type implements ConverterSource +enum Type: string { - use SdkEnum; - - public const VIDEO_TRANSFORMATION = 'video-transformation'; + case VIDEO_TRANSFORMATION = 'video-transformation'; - public const GIF_TO_VIDEO = 'gif-to-video'; + case GIF_TO_VIDEO = 'gif-to-video'; - public const VIDEO_THUMBNAIL = 'video-thumbnail'; + case VIDEO_THUMBNAIL = 'video-thumbnail'; } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php index 846bf6cf..f7b4c774 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php @@ -13,7 +13,7 @@ /** * @phpstan-type transformation_alias = array{ - * type: Type::*, error?: Error|null, options?: Options|null + * type: value-of, error?: Error|null, options?: Options|null * } */ final class Transformation implements BaseModel @@ -27,7 +27,7 @@ final class Transformation implements BaseModel * - `gif-to-video`: Convert animated GIF to video format * - `video-thumbnail`: Generate thumbnail image from video * - * @var Type::* $type + * @var value-of $type */ #[Api(enum: Type::class)] public string $type; @@ -68,16 +68,16 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Type::* $type + * @param Type|value-of $type */ public static function with( - string $type, + Type|string $type, ?Error $error = null, ?Options $options = null ): self { $obj = new self; - $obj->type = $type; + $obj->type = $type instanceof Type ? $type->value : $type; null !== $error && $obj->error = $error; null !== $options && $obj->options = $options; @@ -91,12 +91,12 @@ public static function with( * - `gif-to-video`: Convert animated GIF to video format * - `video-thumbnail`: Generate thumbnail image from video * - * @param Type::* $type + * @param Type|value-of $type */ - public function withType(string $type): self + public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type; + $obj->type = $type instanceof Type ? $type->value : $type; return $obj; } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php index c6d6c648..bbb07048 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php @@ -12,7 +12,7 @@ /** * Details about the transformation error. * - * @phpstan-type error_alias = array{reason: Reason::*} + * @phpstan-type error_alias = array{reason: value-of} */ final class Error implements BaseModel { @@ -25,7 +25,7 @@ final class Error implements BaseModel * - `download_failed`: Could not download source video * - `internal_server_error`: Unexpected server error * - * @var Reason::* $reason + * @var value-of $reason */ #[Api(enum: Reason::class)] public string $reason; @@ -54,13 +54,13 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Reason::* $reason + * @param Reason|value-of $reason */ - public static function with(string $reason): self + public static function with(Reason|string $reason): self { $obj = new self; - $obj->reason = $reason; + $obj->reason = $reason instanceof Reason ? $reason->value : $reason; return $obj; } @@ -71,12 +71,12 @@ public static function with(string $reason): self * - `download_failed`: Could not download source video * - `internal_server_error`: Unexpected server error * - * @param Reason::* $reason + * @param Reason|value-of $reason */ - public function withReason(string $reason): self + public function withReason(Reason|string $reason): self { $obj = clone $this; - $obj->reason = $reason; + $obj->reason = $reason instanceof Reason ? $reason->value : $reason; return $obj; } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error/Reason.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error/Reason.php index d5c1c151..751baa9f 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error/Reason.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error/Reason.php @@ -4,22 +4,17 @@ namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Specific reason for the transformation failure: * - `encoding_failed`: Error during video encoding process * - `download_failed`: Could not download source video * - `internal_server_error`: Unexpected server error */ -final class Reason implements ConverterSource +enum Reason: string { - use SdkEnum; - - public const ENCODING_FAILED = 'encoding_failed'; + case ENCODING_FAILED = 'encoding_failed'; - public const DOWNLOAD_FAILED = 'download_failed'; + case DOWNLOAD_FAILED = 'download_failed'; - public const INTERNAL_SERVER_ERROR = 'internal_server_error'; + case INTERNAL_SERVER_ERROR = 'internal_server_error'; } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php index 8804185d..f5a618ed 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php @@ -16,13 +16,13 @@ * Configuration options for video transformations. * * @phpstan-type options_alias = array{ - * audioCodec?: AudioCodec::*|null, + * audioCodec?: value-of|null, * autoRotate?: bool|null, - * format?: Format::*|null, + * format?: value-of|null, * quality?: int|null, - * streamProtocol?: StreamProtocol::*|null, + * streamProtocol?: value-of|null, * variants?: list|null, - * videoCodec?: VideoCodec::*|null, + * videoCodec?: value-of|null, * } */ final class Options implements BaseModel @@ -33,7 +33,7 @@ final class Options implements BaseModel /** * Audio codec used for encoding (aac or opus). * - * @var AudioCodec::*|null $audioCodec + * @var value-of|null $audioCodec */ #[Api('audio_codec', enum: AudioCodec::class, optional: true)] public ?string $audioCodec; @@ -47,7 +47,7 @@ final class Options implements BaseModel /** * Output format for the transformed video or thumbnail. * - * @var Format::*|null $format + * @var value-of|null $format */ #[Api(enum: Format::class, optional: true)] public ?string $format; @@ -61,7 +61,7 @@ final class Options implements BaseModel /** * Streaming protocol for adaptive bitrate streaming. * - * @var StreamProtocol::*|null $streamProtocol + * @var value-of|null $streamProtocol */ #[Api('stream_protocol', enum: StreamProtocol::class, optional: true)] public ?string $streamProtocol; @@ -77,7 +77,7 @@ final class Options implements BaseModel /** * Video codec used for encoding (h264, vp9, or av1). * - * @var VideoCodec::*|null $videoCodec + * @var value-of|null $videoCodec */ #[Api('video_codec', enum: VideoCodec::class, optional: true)] public ?string $videoCodec; @@ -92,30 +92,30 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AudioCodec::* $audioCodec - * @param Format::* $format - * @param StreamProtocol::* $streamProtocol + * @param AudioCodec|value-of $audioCodec + * @param Format|value-of $format + * @param StreamProtocol|value-of $streamProtocol * @param list $variants - * @param VideoCodec::* $videoCodec + * @param VideoCodec|value-of $videoCodec */ public static function with( - ?string $audioCodec = null, + AudioCodec|string|null $audioCodec = null, ?bool $autoRotate = null, - ?string $format = null, + Format|string|null $format = null, ?int $quality = null, - ?string $streamProtocol = null, + StreamProtocol|string|null $streamProtocol = null, ?array $variants = null, - ?string $videoCodec = null, + VideoCodec|string|null $videoCodec = null, ): self { $obj = new self; - null !== $audioCodec && $obj->audioCodec = $audioCodec; + null !== $audioCodec && $obj->audioCodec = $audioCodec instanceof AudioCodec ? $audioCodec->value : $audioCodec; null !== $autoRotate && $obj->autoRotate = $autoRotate; - null !== $format && $obj->format = $format; + null !== $format && $obj->format = $format instanceof Format ? $format->value : $format; null !== $quality && $obj->quality = $quality; - null !== $streamProtocol && $obj->streamProtocol = $streamProtocol; + null !== $streamProtocol && $obj->streamProtocol = $streamProtocol instanceof StreamProtocol ? $streamProtocol->value : $streamProtocol; null !== $variants && $obj->variants = $variants; - null !== $videoCodec && $obj->videoCodec = $videoCodec; + null !== $videoCodec && $obj->videoCodec = $videoCodec instanceof VideoCodec ? $videoCodec->value : $videoCodec; return $obj; } @@ -123,12 +123,12 @@ public static function with( /** * Audio codec used for encoding (aac or opus). * - * @param AudioCodec::* $audioCodec + * @param AudioCodec|value-of $audioCodec */ - public function withAudioCodec(string $audioCodec): self + public function withAudioCodec(AudioCodec|string $audioCodec): self { $obj = clone $this; - $obj->audioCodec = $audioCodec; + $obj->audioCodec = $audioCodec instanceof AudioCodec ? $audioCodec->value : $audioCodec; return $obj; } @@ -147,12 +147,12 @@ public function withAutoRotate(bool $autoRotate): self /** * Output format for the transformed video or thumbnail. * - * @param Format::* $format + * @param Format|value-of $format */ - public function withFormat(string $format): self + public function withFormat(Format|string $format): self { $obj = clone $this; - $obj->format = $format; + $obj->format = $format instanceof Format ? $format->value : $format; return $obj; } @@ -171,12 +171,13 @@ public function withQuality(int $quality): self /** * Streaming protocol for adaptive bitrate streaming. * - * @param StreamProtocol::* $streamProtocol + * @param StreamProtocol|value-of $streamProtocol */ - public function withStreamProtocol(string $streamProtocol): self - { + public function withStreamProtocol( + StreamProtocol|string $streamProtocol + ): self { $obj = clone $this; - $obj->streamProtocol = $streamProtocol; + $obj->streamProtocol = $streamProtocol instanceof StreamProtocol ? $streamProtocol->value : $streamProtocol; return $obj; } @@ -197,12 +198,12 @@ public function withVariants(array $variants): self /** * Video codec used for encoding (h264, vp9, or av1). * - * @param VideoCodec::* $videoCodec + * @param VideoCodec|value-of $videoCodec */ - public function withVideoCodec(string $videoCodec): self + public function withVideoCodec(VideoCodec|string $videoCodec): self { $obj = clone $this; - $obj->videoCodec = $videoCodec; + $obj->videoCodec = $videoCodec instanceof VideoCodec ? $videoCodec->value : $videoCodec; return $obj; } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/AudioCodec.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/AudioCodec.php index 796c5e40..c33c2fef 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/AudioCodec.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/AudioCodec.php @@ -4,17 +4,12 @@ namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Audio codec used for encoding (aac or opus). */ -final class AudioCodec implements ConverterSource +enum AudioCodec: string { - use SdkEnum; - - public const AAC = 'aac'; + case AAC = 'aac'; - public const OPUS = 'opus'; + case OPUS = 'opus'; } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/Format.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/Format.php index c6699414..c37d8135 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/Format.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/Format.php @@ -4,23 +4,18 @@ namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Output format for the transformed video or thumbnail. */ -final class Format implements ConverterSource +enum Format: string { - use SdkEnum; - - public const MP4 = 'mp4'; + case MP4 = 'mp4'; - public const WEBM = 'webm'; + case WEBM = 'webm'; - public const JPG = 'jpg'; + case JPG = 'jpg'; - public const PNG = 'png'; + case PNG = 'png'; - public const WEBP = 'webp'; + case WEBP = 'webp'; } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/StreamProtocol.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/StreamProtocol.php index 9a67e9d8..73d64235 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/StreamProtocol.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/StreamProtocol.php @@ -4,17 +4,12 @@ namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Streaming protocol for adaptive bitrate streaming. */ -final class StreamProtocol implements ConverterSource +enum StreamProtocol: string { - use SdkEnum; - - public const HLS = 'HLS'; + case HLS = 'HLS'; - public const DASH = 'DASH'; + case DASH = 'DASH'; } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/VideoCodec.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/VideoCodec.php index d5e2da30..7540a5fb 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/VideoCodec.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/VideoCodec.php @@ -4,19 +4,14 @@ namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Video codec used for encoding (h264, vp9, or av1). */ -final class VideoCodec implements ConverterSource +enum VideoCodec: string { - use SdkEnum; - - public const H264 = 'h264'; + case H264 = 'h264'; - public const VP9 = 'vp9'; + case VP9 = 'vp9'; - public const AV1 = 'av1'; + case AV1 = 'av1'; } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Type.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Type.php index fb6b20a9..38869bb0 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Type.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Type.php @@ -4,22 +4,17 @@ namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Type of video transformation: * - `video-transformation`: Standard video processing (resize, format conversion, etc.) * - `gif-to-video`: Convert animated GIF to video format * - `video-thumbnail`: Generate thumbnail image from video */ -final class Type implements ConverterSource +enum Type: string { - use SdkEnum; - - public const VIDEO_TRANSFORMATION = 'video-transformation'; + case VIDEO_TRANSFORMATION = 'video-transformation'; - public const GIF_TO_VIDEO = 'gif-to-video'; + case GIF_TO_VIDEO = 'gif-to-video'; - public const VIDEO_THUMBNAIL = 'video-thumbnail'; + case VIDEO_THUMBNAIL = 'video-thumbnail'; } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php index b2fc39fa..794423d6 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php @@ -13,7 +13,7 @@ /** * @phpstan-type transformation_alias = array{ - * type: Type::*, options?: Options|null, output?: Output|null + * type: value-of, options?: Options|null, output?: Output|null * } */ final class Transformation implements BaseModel @@ -27,7 +27,7 @@ final class Transformation implements BaseModel * - `gif-to-video`: Convert animated GIF to video format * - `video-thumbnail`: Generate thumbnail image from video * - * @var Type::* $type + * @var value-of $type */ #[Api(enum: Type::class)] public string $type; @@ -68,16 +68,16 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Type::* $type + * @param Type|value-of $type */ public static function with( - string $type, + Type|string $type, ?Options $options = null, ?Output $output = null ): self { $obj = new self; - $obj->type = $type; + $obj->type = $type instanceof Type ? $type->value : $type; null !== $options && $obj->options = $options; null !== $output && $obj->output = $output; @@ -91,12 +91,12 @@ public static function with( * - `gif-to-video`: Convert animated GIF to video format * - `video-thumbnail`: Generate thumbnail image from video * - * @param Type::* $type + * @param Type|value-of $type */ - public function withType(string $type): self + public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type; + $obj->type = $type instanceof Type ? $type->value : $type; return $obj; } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php index 352cec53..d1524f17 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php @@ -16,13 +16,13 @@ * Configuration options for video transformations. * * @phpstan-type options_alias = array{ - * audioCodec?: AudioCodec::*|null, + * audioCodec?: value-of|null, * autoRotate?: bool|null, - * format?: Format::*|null, + * format?: value-of|null, * quality?: int|null, - * streamProtocol?: StreamProtocol::*|null, + * streamProtocol?: value-of|null, * variants?: list|null, - * videoCodec?: VideoCodec::*|null, + * videoCodec?: value-of|null, * } */ final class Options implements BaseModel @@ -33,7 +33,7 @@ final class Options implements BaseModel /** * Audio codec used for encoding (aac or opus). * - * @var AudioCodec::*|null $audioCodec + * @var value-of|null $audioCodec */ #[Api('audio_codec', enum: AudioCodec::class, optional: true)] public ?string $audioCodec; @@ -47,7 +47,7 @@ final class Options implements BaseModel /** * Output format for the transformed video or thumbnail. * - * @var Format::*|null $format + * @var value-of|null $format */ #[Api(enum: Format::class, optional: true)] public ?string $format; @@ -61,7 +61,7 @@ final class Options implements BaseModel /** * Streaming protocol for adaptive bitrate streaming. * - * @var StreamProtocol::*|null $streamProtocol + * @var value-of|null $streamProtocol */ #[Api('stream_protocol', enum: StreamProtocol::class, optional: true)] public ?string $streamProtocol; @@ -77,7 +77,7 @@ final class Options implements BaseModel /** * Video codec used for encoding (h264, vp9, or av1). * - * @var VideoCodec::*|null $videoCodec + * @var value-of|null $videoCodec */ #[Api('video_codec', enum: VideoCodec::class, optional: true)] public ?string $videoCodec; @@ -92,30 +92,30 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AudioCodec::* $audioCodec - * @param Format::* $format - * @param StreamProtocol::* $streamProtocol + * @param AudioCodec|value-of $audioCodec + * @param Format|value-of $format + * @param StreamProtocol|value-of $streamProtocol * @param list $variants - * @param VideoCodec::* $videoCodec + * @param VideoCodec|value-of $videoCodec */ public static function with( - ?string $audioCodec = null, + AudioCodec|string|null $audioCodec = null, ?bool $autoRotate = null, - ?string $format = null, + Format|string|null $format = null, ?int $quality = null, - ?string $streamProtocol = null, + StreamProtocol|string|null $streamProtocol = null, ?array $variants = null, - ?string $videoCodec = null, + VideoCodec|string|null $videoCodec = null, ): self { $obj = new self; - null !== $audioCodec && $obj->audioCodec = $audioCodec; + null !== $audioCodec && $obj->audioCodec = $audioCodec instanceof AudioCodec ? $audioCodec->value : $audioCodec; null !== $autoRotate && $obj->autoRotate = $autoRotate; - null !== $format && $obj->format = $format; + null !== $format && $obj->format = $format instanceof Format ? $format->value : $format; null !== $quality && $obj->quality = $quality; - null !== $streamProtocol && $obj->streamProtocol = $streamProtocol; + null !== $streamProtocol && $obj->streamProtocol = $streamProtocol instanceof StreamProtocol ? $streamProtocol->value : $streamProtocol; null !== $variants && $obj->variants = $variants; - null !== $videoCodec && $obj->videoCodec = $videoCodec; + null !== $videoCodec && $obj->videoCodec = $videoCodec instanceof VideoCodec ? $videoCodec->value : $videoCodec; return $obj; } @@ -123,12 +123,12 @@ public static function with( /** * Audio codec used for encoding (aac or opus). * - * @param AudioCodec::* $audioCodec + * @param AudioCodec|value-of $audioCodec */ - public function withAudioCodec(string $audioCodec): self + public function withAudioCodec(AudioCodec|string $audioCodec): self { $obj = clone $this; - $obj->audioCodec = $audioCodec; + $obj->audioCodec = $audioCodec instanceof AudioCodec ? $audioCodec->value : $audioCodec; return $obj; } @@ -147,12 +147,12 @@ public function withAutoRotate(bool $autoRotate): self /** * Output format for the transformed video or thumbnail. * - * @param Format::* $format + * @param Format|value-of $format */ - public function withFormat(string $format): self + public function withFormat(Format|string $format): self { $obj = clone $this; - $obj->format = $format; + $obj->format = $format instanceof Format ? $format->value : $format; return $obj; } @@ -171,12 +171,13 @@ public function withQuality(int $quality): self /** * Streaming protocol for adaptive bitrate streaming. * - * @param StreamProtocol::* $streamProtocol + * @param StreamProtocol|value-of $streamProtocol */ - public function withStreamProtocol(string $streamProtocol): self - { + public function withStreamProtocol( + StreamProtocol|string $streamProtocol + ): self { $obj = clone $this; - $obj->streamProtocol = $streamProtocol; + $obj->streamProtocol = $streamProtocol instanceof StreamProtocol ? $streamProtocol->value : $streamProtocol; return $obj; } @@ -197,12 +198,12 @@ public function withVariants(array $variants): self /** * Video codec used for encoding (h264, vp9, or av1). * - * @param VideoCodec::* $videoCodec + * @param VideoCodec|value-of $videoCodec */ - public function withVideoCodec(string $videoCodec): self + public function withVideoCodec(VideoCodec|string $videoCodec): self { $obj = clone $this; - $obj->videoCodec = $videoCodec; + $obj->videoCodec = $videoCodec instanceof VideoCodec ? $videoCodec->value : $videoCodec; return $obj; } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/AudioCodec.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/AudioCodec.php index 779ccde7..28919565 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/AudioCodec.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/AudioCodec.php @@ -4,17 +4,12 @@ namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Audio codec used for encoding (aac or opus). */ -final class AudioCodec implements ConverterSource +enum AudioCodec: string { - use SdkEnum; - - public const AAC = 'aac'; + case AAC = 'aac'; - public const OPUS = 'opus'; + case OPUS = 'opus'; } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/Format.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/Format.php index 5af7c679..8c7dfc76 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/Format.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/Format.php @@ -4,23 +4,18 @@ namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Output format for the transformed video or thumbnail. */ -final class Format implements ConverterSource +enum Format: string { - use SdkEnum; - - public const MP4 = 'mp4'; + case MP4 = 'mp4'; - public const WEBM = 'webm'; + case WEBM = 'webm'; - public const JPG = 'jpg'; + case JPG = 'jpg'; - public const PNG = 'png'; + case PNG = 'png'; - public const WEBP = 'webp'; + case WEBP = 'webp'; } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/StreamProtocol.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/StreamProtocol.php index 41dca438..604fb5cd 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/StreamProtocol.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/StreamProtocol.php @@ -4,17 +4,12 @@ namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Streaming protocol for adaptive bitrate streaming. */ -final class StreamProtocol implements ConverterSource +enum StreamProtocol: string { - use SdkEnum; - - public const HLS = 'HLS'; + case HLS = 'HLS'; - public const DASH = 'DASH'; + case DASH = 'DASH'; } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/VideoCodec.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/VideoCodec.php index e734c3c0..f8061f64 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/VideoCodec.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/VideoCodec.php @@ -4,19 +4,14 @@ namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Video codec used for encoding (h264, vp9, or av1). */ -final class VideoCodec implements ConverterSource +enum VideoCodec: string { - use SdkEnum; - - public const H264 = 'h264'; + case H264 = 'h264'; - public const VP9 = 'vp9'; + case VP9 = 'vp9'; - public const AV1 = 'av1'; + case AV1 = 'av1'; } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Type.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Type.php index 9b2b35d3..0dfcbeae 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Type.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Type.php @@ -4,22 +4,17 @@ namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; -use ImageKit\Core\Concerns\SdkEnum; -use ImageKit\Core\Conversion\Contracts\ConverterSource; - /** * Type of video transformation: * - `video-transformation`: Standard video processing (resize, format conversion, etc.) * - `gif-to-video`: Convert animated GIF to video format * - `video-thumbnail`: Generate thumbnail image from video */ -final class Type implements ConverterSource +enum Type: string { - use SdkEnum; - - public const VIDEO_TRANSFORMATION = 'video-transformation'; + case VIDEO_TRANSFORMATION = 'video-transformation'; - public const GIF_TO_VIDEO = 'gif-to-video'; + case GIF_TO_VIDEO = 'gif-to-video'; - public const VIDEO_THUMBNAIL = 'video-thumbnail'; + case VIDEO_THUMBNAIL = 'video-thumbnail'; } From a57c7cc9f5131daea2a45d261b414a3deed3adba Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 11 Sep 2025 02:25:08 +0000 Subject: [PATCH 027/193] chore: fix lints in UnionOf --- src/Core/Conversion/UnionOf.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/Core/Conversion/UnionOf.php b/src/Core/Conversion/UnionOf.php index 1502f9bb..ba0beb1f 100644 --- a/src/Core/Conversion/UnionOf.php +++ b/src/Core/Conversion/UnionOf.php @@ -65,7 +65,7 @@ public function coerce(mixed $value, CoerceState $state): mixed public function dump(mixed $value, DumpState $state): mixed { - if (!is_null($target = $this->resolveVariant(value: $value))) { + if (null !== ($target = $this->resolveVariant(value: $value))) { return Conversion::dump($target, value: $value, state: $state); } @@ -85,8 +85,15 @@ private function resolveVariant( return $value::class; } - if (!is_null($this->discriminator) && is_array($value) && array_key_exists($this->discriminator, array: $value)) { + if ( + null !== $this->discriminator + && is_array($value) + && array_key_exists($this->discriminator, array: $value) + ) { $discriminator = $value[$this->discriminator]; + if (!is_string($discriminator)) { + return null; + } return $this->variants[$discriminator] ?? null; } From cc5397ddbb7a5a58b22f25037a76cc502a972692 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 13 Sep 2025 02:35:50 +0000 Subject: [PATCH 028/193] feat(client): support raw responses --- .../Origins/OriginRequest/AkeneoPim.php | 4 +- .../Origins/OriginRequest/AzureBlob.php | 6 +- .../OriginRequest/CloudinaryBackup.php | 6 +- src/Accounts/Origins/OriginRequest/Gcs.php | 6 +- src/Accounts/Origins/OriginRequest/S3.php | 6 +- .../Origins/OriginRequest/S3Compatible.php | 8 +- .../Origins/OriginRequest/WebFolder.php | 6 +- .../Origins/OriginRequest/WebProxy.php | 4 +- .../Origins/OriginResponse/AkeneoPim.php | 2 +- .../Origins/OriginResponse/AzureBlob.php | 2 +- .../OriginResponse/CloudinaryBackup.php | 2 +- src/Accounts/Origins/OriginResponse/Gcs.php | 2 +- src/Accounts/Origins/OriginResponse/S3.php | 2 +- .../Origins/OriginResponse/S3Compatible.php | 2 +- .../Origins/OriginResponse/WebFolder.php | 2 +- .../Origins/OriginResponse/WebProxy.php | 2 +- .../URLRewriter/Cloudinary.php | 2 +- .../URLEndpoints/URLEndpointRequest.php | 6 +- .../URLRewriter/Cloudinary.php | 2 +- .../URLEndpoints/URLEndpointResponse.php | 6 +- .../URLRewriter/Cloudinary.php | 2 +- src/Accounts/Usage/UsageGetResponse.php | 14 ++- src/BaseOverlay.php | 2 +- .../Files/FileUploadParams/Transformation.php | 2 +- .../Transformation/Post/GifToVideo.php | 2 +- .../Transformation/Post/Thumbnail.php | 2 +- src/Beta/V2/Files/FileUploadResponse.php | 46 ++++---- .../V2/Files/FileUploadResponse/AITag.php | 4 +- .../FileUploadResponse/ExtensionStatus.php | 8 +- .../Files/FileUploadResponse/VersionInfo.php | 2 +- .../Invalidation/InvalidationGetResponse.php | 6 +- .../Invalidation/InvalidationNewResponse.php | 6 +- src/Core/Implementation/HasRawResponse.php | 10 ++ .../CustomMetadataField.php | 4 + .../CustomMetadataField/Schema.php | 14 +-- .../Schema.php | 14 +-- .../CustomMetadataFieldDeleteResponse.php | 4 + .../Schema.php | 14 +-- src/ExtensionItem/RemoveBg.php | 2 +- src/ExtensionItem/RemoveBg/Options.php | 8 +- src/Files/Bulk/BulkAddTagsResponse.php | 6 +- src/Files/Bulk/BulkDeleteResponse.php | 6 +- src/Files/Bulk/BulkRemoveAITagsResponse.php | 6 +- src/Files/Bulk/BulkRemoveTagsResponse.php | 6 +- src/Files/File.php | 42 +++---- src/Files/File/AITag.php | 4 +- src/Files/File/VersionInfo.php | 2 +- src/Files/FileCopyResponse.php | 4 + src/Files/FileMoveResponse.php | 4 + src/Files/FileRenameResponse.php | 6 +- src/Files/FileUpdateParams/Publish.php | 2 +- src/Files/FileUpdateResponse.php | 10 +- .../FileUpdateResponse/ExtensionStatus.php | 8 +- src/Files/FileUploadParams/Transformation.php | 2 +- .../Transformation/Post/GifToVideo.php | 2 +- .../Transformation/Post/Thumbnail.php | 2 +- src/Files/FileUploadResponse.php | 46 ++++---- src/Files/FileUploadResponse/AITag.php | 4 +- .../FileUploadResponse/ExtensionStatus.php | 8 +- src/Files/FileUploadResponse/VersionInfo.php | 2 +- src/Files/Folder.php | 12 +- src/Files/Metadata.php | 28 ++--- src/Files/Metadata/Exif.php | 12 +- src/Files/Metadata/Exif/Exif.php | 52 ++++----- src/Files/Metadata/Exif/Gps.php | 2 +- src/Files/Metadata/Exif/Image.php | 22 ++-- src/Files/Metadata/Exif/Interoperability.php | 2 +- src/Files/Metadata/Exif/Thumbnail.php | 12 +- .../ChangePublicationStatus.php | 2 +- .../ChangePublicationStatus/Publish.php | 2 +- .../UpdateFileDetails.php | 10 +- src/Files/Versions/VersionDeleteResponse.php | 4 + src/Folders/FolderCopyResponse.php | 4 + src/Folders/FolderDeleteResponse.php | 4 + src/Folders/FolderMoveResponse.php | 4 + src/Folders/FolderNewResponse.php | 4 + src/Folders/FolderRenameResponse.php | 4 + src/Folders/Job/JobGetResponse.php | 12 +- src/ImageOverlay.php | 8 +- src/OverlayPosition.php | 2 +- src/OverlayTiming.php | 4 +- .../Accounts/URLEndpointsContract.php | 7 ++ .../Accounts/UsageContract.php | 3 + .../Beta/V2/FilesContract.php | 3 + .../Cache/InvalidationContract.php | 5 + .../CustomMetadataFieldsContract.php | 7 ++ src/ServiceContracts/Files/BulkContract.php | 9 ++ .../Files/VersionsContract.php | 7 ++ src/ServiceContracts/FilesContract.php | 13 ++- src/ServiceContracts/Folders/JobContract.php | 3 + src/ServiceContracts/FoldersContract.php | 11 ++ src/Services/Accounts/URLEndpointsService.php | 7 ++ src/Services/Accounts/UsageService.php | 3 + src/Services/AccountsService.php | 6 +- src/Services/Beta/V2/FilesService.php | 3 + src/Services/Beta/V2Service.php | 2 +- src/Services/BetaService.php | 2 +- src/Services/Cache/InvalidationService.php | 5 + src/Services/CacheService.php | 2 +- src/Services/CustomMetadataFieldsService.php | 7 ++ src/Services/Files/BulkService.php | 9 ++ src/Services/Files/VersionsService.php | 7 ++ src/Services/FilesService.php | 19 +++- src/Services/Folders/JobService.php | 3 + src/Services/FoldersService.php | 13 ++- src/SolidColorOverlay.php | 6 +- src/SolidColorOverlayTransformation.php | 12 +- src/SrcOptions.php | 10 +- src/SubtitleOverlay.php | 8 +- src/SubtitleOverlayTransformation.php | 14 +-- src/TextOverlay.php | 8 +- src/TextOverlayTransformation.php | 26 ++--- src/Transformation.php | 104 +++++++++--------- src/VideoOverlay.php | 8 +- .../UploadPostTransformErrorEvent.php | 4 +- .../Request/Transformation.php | 2 +- .../UploadPostTransformSuccessEvent.php | 4 +- .../Request/Transformation.php | 2 +- src/Webhooks/UploadPreTransformErrorEvent.php | 4 +- .../UploadPreTransformSuccessEvent.php | 4 +- .../UploadPreTransformSuccessEvent/Data.php | 42 +++---- .../Data/AITag.php | 4 +- .../Data/ExtensionStatus.php | 8 +- .../Data/VersionInfo.php | 2 +- .../VideoTransformationAcceptedEvent.php | 4 +- .../Data/Transformation.php | 2 +- .../Data/Transformation/Options.php | 14 +-- .../Request.php | 2 +- .../VideoTransformationErrorEvent.php | 4 +- .../Data/Transformation.php | 2 +- .../Data/Transformation/Options.php | 14 +-- .../VideoTransformationErrorEvent/Request.php | 2 +- .../VideoTransformationReadyEvent.php | 6 +- .../Data/Transformation.php | 2 +- .../Data/Transformation/Options.php | 14 +-- .../Data/Transformation/Output.php | 4 +- .../VideoTransformationReadyEvent/Request.php | 2 +- .../VideoTransformationReadyEvent/Timings.php | 2 +- 138 files changed, 675 insertions(+), 449 deletions(-) create mode 100644 src/Core/Implementation/HasRawResponse.php diff --git a/src/Accounts/Origins/OriginRequest/AkeneoPim.php b/src/Accounts/Origins/OriginRequest/AkeneoPim.php index 9e48f720..600e8225 100644 --- a/src/Accounts/Origins/OriginRequest/AkeneoPim.php +++ b/src/Accounts/Origins/OriginRequest/AkeneoPim.php @@ -17,8 +17,8 @@ * password: string, * type: string, * username: string, - * baseURLForCanonicalHeader?: string|null, - * includeCanonicalHeader?: bool|null, + * baseURLForCanonicalHeader?: string, + * includeCanonicalHeader?: bool, * } */ final class AkeneoPim implements BaseModel diff --git a/src/Accounts/Origins/OriginRequest/AzureBlob.php b/src/Accounts/Origins/OriginRequest/AzureBlob.php index 822f1d72..7151a017 100644 --- a/src/Accounts/Origins/OriginRequest/AzureBlob.php +++ b/src/Accounts/Origins/OriginRequest/AzureBlob.php @@ -15,9 +15,9 @@ * name: string, * sasToken: string, * type: string, - * baseURLForCanonicalHeader?: string|null, - * includeCanonicalHeader?: bool|null, - * prefix?: string|null, + * baseURLForCanonicalHeader?: string, + * includeCanonicalHeader?: bool, + * prefix?: string, * } */ final class AzureBlob implements BaseModel diff --git a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php index b7c0652e..21405d2b 100644 --- a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php @@ -15,9 +15,9 @@ * name: string, * secretKey: string, * type: string, - * baseURLForCanonicalHeader?: string|null, - * includeCanonicalHeader?: bool|null, - * prefix?: string|null, + * baseURLForCanonicalHeader?: string, + * includeCanonicalHeader?: bool, + * prefix?: string, * } */ final class CloudinaryBackup implements BaseModel diff --git a/src/Accounts/Origins/OriginRequest/Gcs.php b/src/Accounts/Origins/OriginRequest/Gcs.php index 7ce89f65..10a9646e 100644 --- a/src/Accounts/Origins/OriginRequest/Gcs.php +++ b/src/Accounts/Origins/OriginRequest/Gcs.php @@ -15,9 +15,9 @@ * name: string, * privateKey: string, * type: string, - * baseURLForCanonicalHeader?: string|null, - * includeCanonicalHeader?: bool|null, - * prefix?: string|null, + * baseURLForCanonicalHeader?: string, + * includeCanonicalHeader?: bool, + * prefix?: string, * } */ final class Gcs implements BaseModel diff --git a/src/Accounts/Origins/OriginRequest/S3.php b/src/Accounts/Origins/OriginRequest/S3.php index 4f2b45ac..7e54eff2 100644 --- a/src/Accounts/Origins/OriginRequest/S3.php +++ b/src/Accounts/Origins/OriginRequest/S3.php @@ -15,9 +15,9 @@ * name: string, * secretKey: string, * type: string, - * baseURLForCanonicalHeader?: string|null, - * includeCanonicalHeader?: bool|null, - * prefix?: string|null, + * baseURLForCanonicalHeader?: string, + * includeCanonicalHeader?: bool, + * prefix?: string, * } */ final class S3 implements BaseModel diff --git a/src/Accounts/Origins/OriginRequest/S3Compatible.php b/src/Accounts/Origins/OriginRequest/S3Compatible.php index d0b9966e..157c882d 100644 --- a/src/Accounts/Origins/OriginRequest/S3Compatible.php +++ b/src/Accounts/Origins/OriginRequest/S3Compatible.php @@ -16,10 +16,10 @@ * name: string, * secretKey: string, * type: string, - * baseURLForCanonicalHeader?: string|null, - * includeCanonicalHeader?: bool|null, - * prefix?: string|null, - * s3ForcePathStyle?: bool|null, + * baseURLForCanonicalHeader?: string, + * includeCanonicalHeader?: bool, + * prefix?: string, + * s3ForcePathStyle?: bool, * } */ final class S3Compatible implements BaseModel diff --git a/src/Accounts/Origins/OriginRequest/WebFolder.php b/src/Accounts/Origins/OriginRequest/WebFolder.php index 4c634e60..f5e03aed 100644 --- a/src/Accounts/Origins/OriginRequest/WebFolder.php +++ b/src/Accounts/Origins/OriginRequest/WebFolder.php @@ -13,9 +13,9 @@ * baseURL: string, * name: string, * type: string, - * baseURLForCanonicalHeader?: string|null, - * forwardHostHeaderToOrigin?: bool|null, - * includeCanonicalHeader?: bool|null, + * baseURLForCanonicalHeader?: string, + * forwardHostHeaderToOrigin?: bool, + * includeCanonicalHeader?: bool, * } */ final class WebFolder implements BaseModel diff --git a/src/Accounts/Origins/OriginRequest/WebProxy.php b/src/Accounts/Origins/OriginRequest/WebProxy.php index 2b6404b7..e6bde50b 100644 --- a/src/Accounts/Origins/OriginRequest/WebProxy.php +++ b/src/Accounts/Origins/OriginRequest/WebProxy.php @@ -12,8 +12,8 @@ * @phpstan-type web_proxy = array{ * name: string, * type: string, - * baseURLForCanonicalHeader?: string|null, - * includeCanonicalHeader?: bool|null, + * baseURLForCanonicalHeader?: string, + * includeCanonicalHeader?: bool, * } */ final class WebProxy implements BaseModel diff --git a/src/Accounts/Origins/OriginResponse/AkeneoPim.php b/src/Accounts/Origins/OriginResponse/AkeneoPim.php index 2459a81d..d42bf0e8 100644 --- a/src/Accounts/Origins/OriginResponse/AkeneoPim.php +++ b/src/Accounts/Origins/OriginResponse/AkeneoPim.php @@ -15,7 +15,7 @@ * includeCanonicalHeader: bool, * name: string, * type: string, - * baseURLForCanonicalHeader?: string|null, + * baseURLForCanonicalHeader?: string, * } */ final class AkeneoPim implements BaseModel diff --git a/src/Accounts/Origins/OriginResponse/AzureBlob.php b/src/Accounts/Origins/OriginResponse/AzureBlob.php index 63c2a2db..83d2dc7c 100644 --- a/src/Accounts/Origins/OriginResponse/AzureBlob.php +++ b/src/Accounts/Origins/OriginResponse/AzureBlob.php @@ -17,7 +17,7 @@ * name: string, * prefix: string, * type: string, - * baseURLForCanonicalHeader?: string|null, + * baseURLForCanonicalHeader?: string, * } */ final class AzureBlob implements BaseModel diff --git a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php index e721eb2a..c58af4db 100644 --- a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php @@ -16,7 +16,7 @@ * name: string, * prefix: string, * type: string, - * baseURLForCanonicalHeader?: string|null, + * baseURLForCanonicalHeader?: string, * } */ final class CloudinaryBackup implements BaseModel diff --git a/src/Accounts/Origins/OriginResponse/Gcs.php b/src/Accounts/Origins/OriginResponse/Gcs.php index bd7bc41e..fba85c13 100644 --- a/src/Accounts/Origins/OriginResponse/Gcs.php +++ b/src/Accounts/Origins/OriginResponse/Gcs.php @@ -17,7 +17,7 @@ * name: string, * prefix: string, * type: string, - * baseURLForCanonicalHeader?: string|null, + * baseURLForCanonicalHeader?: string, * } */ final class Gcs implements BaseModel diff --git a/src/Accounts/Origins/OriginResponse/S3.php b/src/Accounts/Origins/OriginResponse/S3.php index 48050fed..abeac628 100644 --- a/src/Accounts/Origins/OriginResponse/S3.php +++ b/src/Accounts/Origins/OriginResponse/S3.php @@ -16,7 +16,7 @@ * name: string, * prefix: string, * type: string, - * baseURLForCanonicalHeader?: string|null, + * baseURLForCanonicalHeader?: string, * } */ final class S3 implements BaseModel diff --git a/src/Accounts/Origins/OriginResponse/S3Compatible.php b/src/Accounts/Origins/OriginResponse/S3Compatible.php index 74d8e0d6..3016348f 100644 --- a/src/Accounts/Origins/OriginResponse/S3Compatible.php +++ b/src/Accounts/Origins/OriginResponse/S3Compatible.php @@ -18,7 +18,7 @@ * prefix: string, * s3ForcePathStyle: bool, * type: string, - * baseURLForCanonicalHeader?: string|null, + * baseURLForCanonicalHeader?: string, * } */ final class S3Compatible implements BaseModel diff --git a/src/Accounts/Origins/OriginResponse/WebFolder.php b/src/Accounts/Origins/OriginResponse/WebFolder.php index 97d22763..9f56573a 100644 --- a/src/Accounts/Origins/OriginResponse/WebFolder.php +++ b/src/Accounts/Origins/OriginResponse/WebFolder.php @@ -16,7 +16,7 @@ * includeCanonicalHeader: bool, * name: string, * type: string, - * baseURLForCanonicalHeader?: string|null, + * baseURLForCanonicalHeader?: string, * } */ final class WebFolder implements BaseModel diff --git a/src/Accounts/Origins/OriginResponse/WebProxy.php b/src/Accounts/Origins/OriginResponse/WebProxy.php index 3a302c3b..b1c61e6c 100644 --- a/src/Accounts/Origins/OriginResponse/WebProxy.php +++ b/src/Accounts/Origins/OriginResponse/WebProxy.php @@ -14,7 +14,7 @@ * includeCanonicalHeader: bool, * name: string, * type: string, - * baseURLForCanonicalHeader?: string|null, + * baseURLForCanonicalHeader?: string, * } */ final class WebProxy implements BaseModel diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php index 48561fe6..b35d6c2f 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php @@ -10,7 +10,7 @@ /** * @phpstan-type cloudinary_alias = array{ - * type: string, preserveAssetDeliveryTypes?: bool|null + * type: string, preserveAssetDeliveryTypes?: bool * } */ final class Cloudinary implements BaseModel diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest.php b/src/Accounts/URLEndpoints/URLEndpointRequest.php index dd4177a6..f74ca34a 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest.php @@ -17,9 +17,9 @@ * * @phpstan-type url_endpoint_request = array{ * description: string, - * origins?: list|null, - * urlPrefix?: string|null, - * urlRewriter?: null|Cloudinary|Imgix|Akamai, + * origins?: list, + * urlPrefix?: string, + * urlRewriter?: Cloudinary|Imgix|Akamai, * } */ final class URLEndpointRequest implements BaseModel diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php index 17f95e0f..25a15b2f 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php @@ -10,7 +10,7 @@ /** * @phpstan-type cloudinary_alias = array{ - * type: string, preserveAssetDeliveryTypes?: bool|null + * type: string, preserveAssetDeliveryTypes?: bool * } */ final class Cloudinary implements BaseModel diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse.php b/src/Accounts/URLEndpoints/URLEndpointResponse.php index 6dcecef8..7199516a 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse.php @@ -20,8 +20,12 @@ * description: string, * origins: list, * urlPrefix: string, - * urlRewriter?: null|Cloudinary|Imgix|Akamai, + * urlRewriter?: Cloudinary|Imgix|Akamai, * } + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class URLEndpointResponse implements BaseModel { diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php index 74a44ba4..29ae7c45 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php @@ -10,7 +10,7 @@ /** * @phpstan-type cloudinary_alias = array{ - * type: string, preserveAssetDeliveryTypes?: bool|null + * type: string, preserveAssetDeliveryTypes?: bool * } */ final class Cloudinary implements BaseModel diff --git a/src/Accounts/Usage/UsageGetResponse.php b/src/Accounts/Usage/UsageGetResponse.php index 02fc093d..0ec69d79 100644 --- a/src/Accounts/Usage/UsageGetResponse.php +++ b/src/Accounts/Usage/UsageGetResponse.php @@ -10,12 +10,16 @@ /** * @phpstan-type usage_get_response = array{ - * bandwidthBytes?: int|null, - * extensionUnitsCount?: int|null, - * mediaLibraryStorageBytes?: int|null, - * originalCacheStorageBytes?: int|null, - * videoProcessingUnitsCount?: int|null, + * bandwidthBytes?: int, + * extensionUnitsCount?: int, + * mediaLibraryStorageBytes?: int, + * originalCacheStorageBytes?: int, + * videoProcessingUnitsCount?: int, * } + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class UsageGetResponse implements BaseModel { diff --git a/src/BaseOverlay.php b/src/BaseOverlay.php index 3dd79187..66c1fb87 100644 --- a/src/BaseOverlay.php +++ b/src/BaseOverlay.php @@ -10,7 +10,7 @@ /** * @phpstan-type base_overlay = array{ - * position?: OverlayPosition|null, timing?: OverlayTiming|null + * position?: OverlayPosition, timing?: OverlayTiming * } */ final class BaseOverlay implements BaseModel diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation.php index 5d8888b2..5a1da85d 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation.php @@ -25,7 +25,7 @@ * You can mix and match any combination of post-processing types. * * @phpstan-type transformation_alias = array{ - * post?: list|null, pre?: string|null + * post?: list, pre?: string * } */ final class Transformation implements BaseModel diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php index 629a3390..483f357e 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type gif_to_video = array{type: string, value?: string|null} + * @phpstan-type gif_to_video = array{type: string, value?: string} */ final class GifToVideo implements BaseModel { diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php index ca978f5f..e3e032c1 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type thumbnail_alias = array{type: string, value?: string|null} + * @phpstan-type thumbnail_alias = array{type: string, value?: string} */ final class Thumbnail implements BaseModel { diff --git a/src/Beta/V2/Files/FileUploadResponse.php b/src/Beta/V2/Files/FileUploadResponse.php index 7ae8aedc..74ab2e43 100644 --- a/src/Beta/V2/Files/FileUploadResponse.php +++ b/src/Beta/V2/Files/FileUploadResponse.php @@ -17,30 +17,34 @@ * * @phpstan-type file_upload_response = array{ * aiTags?: list|null, - * audioCodec?: string|null, - * bitRate?: int|null, + * audioCodec?: string, + * bitRate?: int, * customCoordinates?: string|null, - * customMetadata?: array|null, - * description?: string|null, - * duration?: int|null, - * embeddedMetadata?: array|null, - * extensionStatus?: ExtensionStatus|null, - * fileID?: string|null, - * filePath?: string|null, - * fileType?: string|null, - * height?: float|null, - * isPrivateFile?: bool|null, - * isPublished?: bool|null, - * metadata?: Metadata|null, - * name?: string|null, - * size?: float|null, + * customMetadata?: array, + * description?: string, + * duration?: int, + * embeddedMetadata?: array, + * extensionStatus?: ExtensionStatus, + * fileID?: string, + * filePath?: string, + * fileType?: string, + * height?: float, + * isPrivateFile?: bool, + * isPublished?: bool, + * metadata?: Metadata, + * name?: string, + * size?: float, * tags?: list|null, - * thumbnailURL?: string|null, - * url?: string|null, - * versionInfo?: VersionInfo|null, - * videoCodec?: string|null, - * width?: float|null, + * thumbnailURL?: string, + * url?: string, + * versionInfo?: VersionInfo, + * videoCodec?: string, + * width?: float, * } + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class FileUploadResponse implements BaseModel { diff --git a/src/Beta/V2/Files/FileUploadResponse/AITag.php b/src/Beta/V2/Files/FileUploadResponse/AITag.php index 0c2c4782..d54b479f 100644 --- a/src/Beta/V2/Files/FileUploadResponse/AITag.php +++ b/src/Beta/V2/Files/FileUploadResponse/AITag.php @@ -9,9 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type ai_tag = array{ - * confidence?: float|null, name?: string|null, source?: string|null - * } + * @phpstan-type ai_tag = array{confidence?: float, name?: string, source?: string} */ final class AITag implements BaseModel { diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php index bad49098..ff9ad751 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php @@ -22,10 +22,10 @@ * If no extension was requested, then this parameter is not returned. * * @phpstan-type extension_status = array{ - * aiAutoDescription?: value-of|null, - * awsAutoTagging?: value-of|null, - * googleAutoTagging?: value-of|null, - * removeBg?: value-of|null, + * aiAutoDescription?: value-of, + * awsAutoTagging?: value-of, + * googleAutoTagging?: value-of, + * removeBg?: value-of, * } */ final class ExtensionStatus implements BaseModel diff --git a/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php b/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php index 4fe4faec..7c4c0048 100644 --- a/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php +++ b/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php @@ -11,7 +11,7 @@ /** * An object containing the file or file version's `id` (versionId) and `name`. * - * @phpstan-type version_info = array{id?: string|null, name?: string|null} + * @phpstan-type version_info = array{id?: string, name?: string} */ final class VersionInfo implements BaseModel { diff --git a/src/Cache/Invalidation/InvalidationGetResponse.php b/src/Cache/Invalidation/InvalidationGetResponse.php index 7b60dad2..4a853e75 100644 --- a/src/Cache/Invalidation/InvalidationGetResponse.php +++ b/src/Cache/Invalidation/InvalidationGetResponse.php @@ -10,7 +10,11 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type invalidation_get_response = array{status?: value-of|null} + * @phpstan-type invalidation_get_response = array{status?: value-of} + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class InvalidationGetResponse implements BaseModel { diff --git a/src/Cache/Invalidation/InvalidationNewResponse.php b/src/Cache/Invalidation/InvalidationNewResponse.php index 839cdb18..4597a296 100644 --- a/src/Cache/Invalidation/InvalidationNewResponse.php +++ b/src/Cache/Invalidation/InvalidationNewResponse.php @@ -9,7 +9,11 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type invalidation_new_response = array{requestID?: string|null} + * @phpstan-type invalidation_new_response = array{requestID?: string} + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class InvalidationNewResponse implements BaseModel { diff --git a/src/Core/Implementation/HasRawResponse.php b/src/Core/Implementation/HasRawResponse.php new file mode 100644 index 00000000..5d9b26c3 --- /dev/null +++ b/src/Core/Implementation/HasRawResponse.php @@ -0,0 +1,10 @@ +, - * defaultValue?: string|float|bool|null|list, - * isValueRequired?: bool|null, - * maxLength?: float|null, - * maxValue?: string|float|null, - * minLength?: float|null, - * minValue?: string|float|null, - * selectOptions?: list|null, + * defaultValue?: string|float|bool|list, + * isValueRequired?: bool, + * maxLength?: float, + * maxValue?: string|float, + * minLength?: float, + * minValue?: string|float, + * selectOptions?: list, * } */ final class Schema implements BaseModel diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php index 1bd8911f..bc027136 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php @@ -14,13 +14,13 @@ /** * @phpstan-type schema_alias = array{ * type: value-of, - * defaultValue?: string|float|bool|null|list, - * isValueRequired?: bool|null, - * maxLength?: float|null, - * maxValue?: string|float|null, - * minLength?: float|null, - * minValue?: string|float|null, - * selectOptions?: list|null, + * defaultValue?: string|float|bool|list, + * isValueRequired?: bool, + * maxLength?: float, + * maxValue?: string|float, + * minLength?: float, + * minValue?: string|float, + * selectOptions?: list, * } */ final class Schema implements BaseModel diff --git a/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php b/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php index 954555c1..6bb1113d 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php +++ b/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php @@ -9,6 +9,10 @@ /** * @phpstan-type custom_metadata_field_delete_response = array{} + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class CustomMetadataFieldDeleteResponse implements BaseModel { diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php index 0367e1f6..d08fc33d 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php @@ -14,13 +14,13 @@ * An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. * * @phpstan-type schema_alias = array{ - * defaultValue?: string|float|bool|null|list, - * isValueRequired?: bool|null, - * maxLength?: float|null, - * maxValue?: string|float|null, - * minLength?: float|null, - * minValue?: string|float|null, - * selectOptions?: list|null, + * defaultValue?: string|float|bool|list, + * isValueRequired?: bool, + * maxLength?: float, + * maxValue?: string|float, + * minLength?: float, + * minValue?: string|float, + * selectOptions?: list, * } */ final class Schema implements BaseModel diff --git a/src/ExtensionItem/RemoveBg.php b/src/ExtensionItem/RemoveBg.php index fee287d2..1fedf875 100644 --- a/src/ExtensionItem/RemoveBg.php +++ b/src/ExtensionItem/RemoveBg.php @@ -10,7 +10,7 @@ use ImageKit\ExtensionItem\RemoveBg\Options; /** - * @phpstan-type remove_bg = array{name: string, options?: Options|null} + * @phpstan-type remove_bg = array{name: string, options?: Options} */ final class RemoveBg implements BaseModel { diff --git a/src/ExtensionItem/RemoveBg/Options.php b/src/ExtensionItem/RemoveBg/Options.php index 093cf8a6..f55764da 100644 --- a/src/ExtensionItem/RemoveBg/Options.php +++ b/src/ExtensionItem/RemoveBg/Options.php @@ -10,10 +10,10 @@ /** * @phpstan-type options_alias = array{ - * addShadow?: bool|null, - * bgColor?: string|null, - * bgImageURL?: string|null, - * semitransparency?: bool|null, + * addShadow?: bool, + * bgColor?: string, + * bgImageURL?: string, + * semitransparency?: bool, * } */ final class Options implements BaseModel diff --git a/src/Files/Bulk/BulkAddTagsResponse.php b/src/Files/Bulk/BulkAddTagsResponse.php index 45a93613..54a2b004 100644 --- a/src/Files/Bulk/BulkAddTagsResponse.php +++ b/src/Files/Bulk/BulkAddTagsResponse.php @@ -10,8 +10,12 @@ /** * @phpstan-type bulk_add_tags_response = array{ - * successfullyUpdatedFileIDs?: list|null + * successfullyUpdatedFileIDs?: list * } + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class BulkAddTagsResponse implements BaseModel { diff --git a/src/Files/Bulk/BulkDeleteResponse.php b/src/Files/Bulk/BulkDeleteResponse.php index 42f62916..b0da1da0 100644 --- a/src/Files/Bulk/BulkDeleteResponse.php +++ b/src/Files/Bulk/BulkDeleteResponse.php @@ -10,8 +10,12 @@ /** * @phpstan-type bulk_delete_response = array{ - * successfullyDeletedFileIDs?: list|null + * successfullyDeletedFileIDs?: list * } + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class BulkDeleteResponse implements BaseModel { diff --git a/src/Files/Bulk/BulkRemoveAITagsResponse.php b/src/Files/Bulk/BulkRemoveAITagsResponse.php index ec996967..2946c9de 100644 --- a/src/Files/Bulk/BulkRemoveAITagsResponse.php +++ b/src/Files/Bulk/BulkRemoveAITagsResponse.php @@ -10,8 +10,12 @@ /** * @phpstan-type bulk_remove_ai_tags_response = array{ - * successfullyUpdatedFileIDs?: list|null + * successfullyUpdatedFileIDs?: list * } + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class BulkRemoveAITagsResponse implements BaseModel { diff --git a/src/Files/Bulk/BulkRemoveTagsResponse.php b/src/Files/Bulk/BulkRemoveTagsResponse.php index a2c5ff1a..a82a0a8d 100644 --- a/src/Files/Bulk/BulkRemoveTagsResponse.php +++ b/src/Files/Bulk/BulkRemoveTagsResponse.php @@ -10,8 +10,12 @@ /** * @phpstan-type bulk_remove_tags_response = array{ - * successfullyUpdatedFileIDs?: list|null + * successfullyUpdatedFileIDs?: list * } + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class BulkRemoveTagsResponse implements BaseModel { diff --git a/src/Files/File.php b/src/Files/File.php index 9acd3c95..662ed6bd 100644 --- a/src/Files/File.php +++ b/src/Files/File.php @@ -16,28 +16,32 @@ * * @phpstan-type file_alias = array{ * aiTags?: list|null, - * createdAt?: \DateTimeInterface|null, + * createdAt?: \DateTimeInterface, * customCoordinates?: string|null, - * customMetadata?: array|null, - * description?: string|null, - * fileID?: string|null, - * filePath?: string|null, - * fileType?: string|null, - * hasAlpha?: bool|null, - * height?: float|null, - * isPrivateFile?: bool|null, - * isPublished?: bool|null, - * mime?: string|null, - * name?: string|null, - * size?: float|null, + * customMetadata?: array, + * description?: string, + * fileID?: string, + * filePath?: string, + * fileType?: string, + * hasAlpha?: bool, + * height?: float, + * isPrivateFile?: bool, + * isPublished?: bool, + * mime?: string, + * name?: string, + * size?: float, * tags?: list|null, - * thumbnail?: string|null, - * type?: value-of|null, - * updatedAt?: \DateTimeInterface|null, - * url?: string|null, - * versionInfo?: VersionInfo|null, - * width?: float|null, + * thumbnail?: string, + * type?: value-of, + * updatedAt?: \DateTimeInterface, + * url?: string, + * versionInfo?: VersionInfo, + * width?: float, * } + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class File implements BaseModel { diff --git a/src/Files/File/AITag.php b/src/Files/File/AITag.php index 1b692418..cdb68bd6 100644 --- a/src/Files/File/AITag.php +++ b/src/Files/File/AITag.php @@ -9,9 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type ai_tag = array{ - * confidence?: float|null, name?: string|null, source?: string|null - * } + * @phpstan-type ai_tag = array{confidence?: float, name?: string, source?: string} */ final class AITag implements BaseModel { diff --git a/src/Files/File/VersionInfo.php b/src/Files/File/VersionInfo.php index 554d7038..4026a2df 100644 --- a/src/Files/File/VersionInfo.php +++ b/src/Files/File/VersionInfo.php @@ -11,7 +11,7 @@ /** * An object with details of the file version. * - * @phpstan-type version_info = array{id?: string|null, name?: string|null} + * @phpstan-type version_info = array{id?: string, name?: string} */ final class VersionInfo implements BaseModel { diff --git a/src/Files/FileCopyResponse.php b/src/Files/FileCopyResponse.php index ae593ba5..418bd983 100644 --- a/src/Files/FileCopyResponse.php +++ b/src/Files/FileCopyResponse.php @@ -9,6 +9,10 @@ /** * @phpstan-type file_copy_response = array{} + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class FileCopyResponse implements BaseModel { diff --git a/src/Files/FileMoveResponse.php b/src/Files/FileMoveResponse.php index bcdaa4ce..78520bc8 100644 --- a/src/Files/FileMoveResponse.php +++ b/src/Files/FileMoveResponse.php @@ -9,6 +9,10 @@ /** * @phpstan-type file_move_response = array{} + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class FileMoveResponse implements BaseModel { diff --git a/src/Files/FileRenameResponse.php b/src/Files/FileRenameResponse.php index bea1adab..91c59847 100644 --- a/src/Files/FileRenameResponse.php +++ b/src/Files/FileRenameResponse.php @@ -9,7 +9,11 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type file_rename_response = array{purgeRequestID?: string|null} + * @phpstan-type file_rename_response = array{purgeRequestID?: string} + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class FileRenameResponse implements BaseModel { diff --git a/src/Files/FileUpdateParams/Publish.php b/src/Files/FileUpdateParams/Publish.php index 37535e9f..b49cd390 100644 --- a/src/Files/FileUpdateParams/Publish.php +++ b/src/Files/FileUpdateParams/Publish.php @@ -12,7 +12,7 @@ * Configure the publication status of a file and its versions. * * @phpstan-type publish_alias = array{ - * isPublished: bool, includeFileVersions?: bool|null + * isPublished: bool, includeFileVersions?: bool * } */ final class Publish implements BaseModel diff --git a/src/Files/FileUpdateResponse.php b/src/Files/FileUpdateResponse.php index 0a6596f9..7857e300 100644 --- a/src/Files/FileUpdateResponse.php +++ b/src/Files/FileUpdateResponse.php @@ -12,13 +12,17 @@ /** * Object containing details of a file or file version. * - * @phpstan-type file_update_response = array{ - * extensionStatus?: ExtensionStatus|null + * @phpstan-type unnamed_type_with_intersection_parent12 = array{ + * extensionStatus?: ExtensionStatus * } + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class FileUpdateResponse implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api(optional: true)] diff --git a/src/Files/FileUpdateResponse/ExtensionStatus.php b/src/Files/FileUpdateResponse/ExtensionStatus.php index 918ed884..c99928f4 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus.php @@ -14,10 +14,10 @@ /** * @phpstan-type extension_status = array{ - * aiAutoDescription?: value-of|null, - * awsAutoTagging?: value-of|null, - * googleAutoTagging?: value-of|null, - * removeBg?: value-of|null, + * aiAutoDescription?: value-of, + * awsAutoTagging?: value-of, + * googleAutoTagging?: value-of, + * removeBg?: value-of, * } */ final class ExtensionStatus implements BaseModel diff --git a/src/Files/FileUploadParams/Transformation.php b/src/Files/FileUploadParams/Transformation.php index b063104c..015f2267 100644 --- a/src/Files/FileUploadParams/Transformation.php +++ b/src/Files/FileUploadParams/Transformation.php @@ -25,7 +25,7 @@ * You can mix and match any combination of post-processing types. * * @phpstan-type transformation_alias = array{ - * post?: list|null, pre?: string|null + * post?: list, pre?: string * } */ final class Transformation implements BaseModel diff --git a/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php b/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php index 49785758..aec3eafc 100644 --- a/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php +++ b/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type gif_to_video = array{type: string, value?: string|null} + * @phpstan-type gif_to_video = array{type: string, value?: string} */ final class GifToVideo implements BaseModel { diff --git a/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php b/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php index 426e24d0..7d10b9e6 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php +++ b/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type thumbnail_alias = array{type: string, value?: string|null} + * @phpstan-type thumbnail_alias = array{type: string, value?: string} */ final class Thumbnail implements BaseModel { diff --git a/src/Files/FileUploadResponse.php b/src/Files/FileUploadResponse.php index 96f41701..d92d5898 100644 --- a/src/Files/FileUploadResponse.php +++ b/src/Files/FileUploadResponse.php @@ -16,30 +16,34 @@ * * @phpstan-type file_upload_response = array{ * aiTags?: list|null, - * audioCodec?: string|null, - * bitRate?: int|null, + * audioCodec?: string, + * bitRate?: int, * customCoordinates?: string|null, - * customMetadata?: array|null, - * description?: string|null, - * duration?: int|null, - * embeddedMetadata?: array|null, - * extensionStatus?: ExtensionStatus|null, - * fileID?: string|null, - * filePath?: string|null, - * fileType?: string|null, - * height?: float|null, - * isPrivateFile?: bool|null, - * isPublished?: bool|null, - * metadata?: Metadata|null, - * name?: string|null, - * size?: float|null, + * customMetadata?: array, + * description?: string, + * duration?: int, + * embeddedMetadata?: array, + * extensionStatus?: ExtensionStatus, + * fileID?: string, + * filePath?: string, + * fileType?: string, + * height?: float, + * isPrivateFile?: bool, + * isPublished?: bool, + * metadata?: Metadata, + * name?: string, + * size?: float, * tags?: list|null, - * thumbnailURL?: string|null, - * url?: string|null, - * versionInfo?: VersionInfo|null, - * videoCodec?: string|null, - * width?: float|null, + * thumbnailURL?: string, + * url?: string, + * versionInfo?: VersionInfo, + * videoCodec?: string, + * width?: float, * } + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class FileUploadResponse implements BaseModel { diff --git a/src/Files/FileUploadResponse/AITag.php b/src/Files/FileUploadResponse/AITag.php index 547bcb68..1b0ed295 100644 --- a/src/Files/FileUploadResponse/AITag.php +++ b/src/Files/FileUploadResponse/AITag.php @@ -9,9 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type ai_tag = array{ - * confidence?: float|null, name?: string|null, source?: string|null - * } + * @phpstan-type ai_tag = array{confidence?: float, name?: string, source?: string} */ final class AITag implements BaseModel { diff --git a/src/Files/FileUploadResponse/ExtensionStatus.php b/src/Files/FileUploadResponse/ExtensionStatus.php index 498b1b07..1223d021 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Files/FileUploadResponse/ExtensionStatus.php @@ -22,10 +22,10 @@ * If no extension was requested, then this parameter is not returned. * * @phpstan-type extension_status = array{ - * aiAutoDescription?: value-of|null, - * awsAutoTagging?: value-of|null, - * googleAutoTagging?: value-of|null, - * removeBg?: value-of|null, + * aiAutoDescription?: value-of, + * awsAutoTagging?: value-of, + * googleAutoTagging?: value-of, + * removeBg?: value-of, * } */ final class ExtensionStatus implements BaseModel diff --git a/src/Files/FileUploadResponse/VersionInfo.php b/src/Files/FileUploadResponse/VersionInfo.php index 3aa4fdcb..2cac6409 100644 --- a/src/Files/FileUploadResponse/VersionInfo.php +++ b/src/Files/FileUploadResponse/VersionInfo.php @@ -11,7 +11,7 @@ /** * An object containing the file or file version's `id` (versionId) and `name`. * - * @phpstan-type version_info = array{id?: string|null, name?: string|null} + * @phpstan-type version_info = array{id?: string, name?: string} */ final class VersionInfo implements BaseModel { diff --git a/src/Files/Folder.php b/src/Files/Folder.php index bc8e3e74..c3941041 100644 --- a/src/Files/Folder.php +++ b/src/Files/Folder.php @@ -11,12 +11,12 @@ /** * @phpstan-type folder_alias = array{ - * createdAt?: \DateTimeInterface|null, - * folderID?: string|null, - * folderPath?: string|null, - * name?: string|null, - * type?: value-of|null, - * updatedAt?: \DateTimeInterface|null, + * createdAt?: \DateTimeInterface, + * folderID?: string, + * folderPath?: string, + * name?: string, + * type?: value-of, + * updatedAt?: \DateTimeInterface, * } */ final class Folder implements BaseModel diff --git a/src/Files/Metadata.php b/src/Files/Metadata.php index 9350cf83..b8e41f1b 100644 --- a/src/Files/Metadata.php +++ b/src/Files/Metadata.php @@ -13,20 +13,20 @@ * JSON object containing metadata. * * @phpstan-type metadata_alias = array{ - * audioCodec?: string|null, - * bitRate?: int|null, - * density?: int|null, - * duration?: int|null, - * exif?: Exif|null, - * format?: string|null, - * hasColorProfile?: bool|null, - * hasTransparency?: bool|null, - * height?: int|null, - * pHash?: string|null, - * quality?: int|null, - * size?: int|null, - * videoCodec?: string|null, - * width?: int|null, + * audioCodec?: string, + * bitRate?: int, + * density?: int, + * duration?: int, + * exif?: Exif, + * format?: string, + * hasColorProfile?: bool, + * hasTransparency?: bool, + * height?: int, + * pHash?: string, + * quality?: int, + * size?: int, + * videoCodec?: string, + * width?: int, * } */ final class Metadata implements BaseModel diff --git a/src/Files/Metadata/Exif.php b/src/Files/Metadata/Exif.php index a1815e9d..d30c8329 100644 --- a/src/Files/Metadata/Exif.php +++ b/src/Files/Metadata/Exif.php @@ -15,12 +15,12 @@ /** * @phpstan-type exif_alias = array{ - * exif?: Exif1|null, - * gps?: Gps|null, - * image?: Image|null, - * interoperability?: Interoperability|null, - * makernote?: array|null, - * thumbnail?: Thumbnail|null, + * exif?: Exif1, + * gps?: Gps, + * image?: Image, + * interoperability?: Interoperability, + * makernote?: array, + * thumbnail?: Thumbnail, * } */ final class Exif implements BaseModel diff --git a/src/Files/Metadata/Exif/Exif.php b/src/Files/Metadata/Exif/Exif.php index 1bd947ab..a722094e 100644 --- a/src/Files/Metadata/Exif/Exif.php +++ b/src/Files/Metadata/Exif/Exif.php @@ -12,32 +12,32 @@ * Object containing Exif details. * * @phpstan-type exif_alias = array{ - * apertureValue?: float|null, - * colorSpace?: int|null, - * createDate?: string|null, - * customRendered?: int|null, - * dateTimeOriginal?: string|null, - * exifImageHeight?: int|null, - * exifImageWidth?: int|null, - * exifVersion?: string|null, - * exposureCompensation?: float|null, - * exposureMode?: int|null, - * exposureProgram?: int|null, - * exposureTime?: float|null, - * flash?: int|null, - * flashpixVersion?: string|null, - * fNumber?: float|null, - * focalLength?: int|null, - * focalPlaneResolutionUnit?: int|null, - * focalPlaneXResolution?: float|null, - * focalPlaneYResolution?: float|null, - * interopOffset?: int|null, - * iso?: int|null, - * meteringMode?: int|null, - * sceneCaptureType?: int|null, - * shutterSpeedValue?: float|null, - * subSecTime?: string|null, - * whiteBalance?: int|null, + * apertureValue?: float, + * colorSpace?: int, + * createDate?: string, + * customRendered?: int, + * dateTimeOriginal?: string, + * exifImageHeight?: int, + * exifImageWidth?: int, + * exifVersion?: string, + * exposureCompensation?: float, + * exposureMode?: int, + * exposureProgram?: int, + * exposureTime?: float, + * flash?: int, + * flashpixVersion?: string, + * fNumber?: float, + * focalLength?: int, + * focalPlaneResolutionUnit?: int, + * focalPlaneXResolution?: float, + * focalPlaneYResolution?: float, + * interopOffset?: int, + * iso?: int, + * meteringMode?: int, + * sceneCaptureType?: int, + * shutterSpeedValue?: float, + * subSecTime?: string, + * whiteBalance?: int, * } */ final class Exif implements BaseModel diff --git a/src/Files/Metadata/Exif/Gps.php b/src/Files/Metadata/Exif/Gps.php index 9f4d027f..b7504be0 100644 --- a/src/Files/Metadata/Exif/Gps.php +++ b/src/Files/Metadata/Exif/Gps.php @@ -11,7 +11,7 @@ /** * Object containing GPS information. * - * @phpstan-type gps_alias = array{gpsVersionID?: list|null} + * @phpstan-type gps_alias = array{gpsVersionID?: list} */ final class Gps implements BaseModel { diff --git a/src/Files/Metadata/Exif/Image.php b/src/Files/Metadata/Exif/Image.php index 2d66f0d4..08c520ff 100644 --- a/src/Files/Metadata/Exif/Image.php +++ b/src/Files/Metadata/Exif/Image.php @@ -12,17 +12,17 @@ * Object containing EXIF image information. * * @phpstan-type image_alias = array{ - * exifOffset?: int|null, - * gpsInfo?: int|null, - * make?: string|null, - * model?: string|null, - * modifyDate?: string|null, - * orientation?: int|null, - * resolutionUnit?: int|null, - * software?: string|null, - * xResolution?: int|null, - * yCbCrPositioning?: int|null, - * yResolution?: int|null, + * exifOffset?: int, + * gpsInfo?: int, + * make?: string, + * model?: string, + * modifyDate?: string, + * orientation?: int, + * resolutionUnit?: int, + * software?: string, + * xResolution?: int, + * yCbCrPositioning?: int, + * yResolution?: int, * } */ final class Image implements BaseModel diff --git a/src/Files/Metadata/Exif/Interoperability.php b/src/Files/Metadata/Exif/Interoperability.php index 80632026..bc7b65f2 100644 --- a/src/Files/Metadata/Exif/Interoperability.php +++ b/src/Files/Metadata/Exif/Interoperability.php @@ -12,7 +12,7 @@ * JSON object. * * @phpstan-type interoperability_alias = array{ - * interopIndex?: string|null, interopVersion?: string|null + * interopIndex?: string, interopVersion?: string * } */ final class Interoperability implements BaseModel diff --git a/src/Files/Metadata/Exif/Thumbnail.php b/src/Files/Metadata/Exif/Thumbnail.php index b1dd809c..886948fd 100644 --- a/src/Files/Metadata/Exif/Thumbnail.php +++ b/src/Files/Metadata/Exif/Thumbnail.php @@ -12,12 +12,12 @@ * Object containing Thumbnail information. * * @phpstan-type thumbnail_alias = array{ - * compression?: int|null, - * resolutionUnit?: int|null, - * thumbnailLength?: int|null, - * thumbnailOffset?: int|null, - * xResolution?: int|null, - * yResolution?: int|null, + * compression?: int, + * resolutionUnit?: int, + * thumbnailLength?: int, + * thumbnailOffset?: int, + * xResolution?: int, + * yResolution?: int, * } */ final class Thumbnail implements BaseModel diff --git a/src/Files/UpdateFileDetailsRequest/ChangePublicationStatus.php b/src/Files/UpdateFileDetailsRequest/ChangePublicationStatus.php index 77371818..4b005ce2 100644 --- a/src/Files/UpdateFileDetailsRequest/ChangePublicationStatus.php +++ b/src/Files/UpdateFileDetailsRequest/ChangePublicationStatus.php @@ -10,7 +10,7 @@ use ImageKit\Files\UpdateFileDetailsRequest\ChangePublicationStatus\Publish; /** - * @phpstan-type change_publication_status = array{publish?: Publish|null} + * @phpstan-type change_publication_status = array{publish?: Publish} */ final class ChangePublicationStatus implements BaseModel { diff --git a/src/Files/UpdateFileDetailsRequest/ChangePublicationStatus/Publish.php b/src/Files/UpdateFileDetailsRequest/ChangePublicationStatus/Publish.php index 0569b9d2..8fddee82 100644 --- a/src/Files/UpdateFileDetailsRequest/ChangePublicationStatus/Publish.php +++ b/src/Files/UpdateFileDetailsRequest/ChangePublicationStatus/Publish.php @@ -12,7 +12,7 @@ * Configure the publication status of a file and its versions. * * @phpstan-type publish_alias = array{ - * isPublished: bool, includeFileVersions?: bool|null + * isPublished: bool, includeFileVersions?: bool * } */ final class Publish implements BaseModel diff --git a/src/Files/UpdateFileDetailsRequest/UpdateFileDetails.php b/src/Files/UpdateFileDetailsRequest/UpdateFileDetails.php index 7a5bb6ac..5b6149f1 100644 --- a/src/Files/UpdateFileDetailsRequest/UpdateFileDetails.php +++ b/src/Files/UpdateFileDetailsRequest/UpdateFileDetails.php @@ -16,12 +16,12 @@ /** * @phpstan-type update_file_details = array{ * customCoordinates?: string|null, - * customMetadata?: array|null, - * description?: string|null, - * extensions?: list|null, - * removeAITags?: string|null|list, + * customMetadata?: array, + * description?: string, + * extensions?: list, + * removeAITags?: string|list, * tags?: list|null, - * webhookURL?: string|null, + * webhookURL?: string, * } */ final class UpdateFileDetails implements BaseModel diff --git a/src/Files/Versions/VersionDeleteResponse.php b/src/Files/Versions/VersionDeleteResponse.php index 39c07a2d..2ea1e5db 100644 --- a/src/Files/Versions/VersionDeleteResponse.php +++ b/src/Files/Versions/VersionDeleteResponse.php @@ -9,6 +9,10 @@ /** * @phpstan-type version_delete_response = array{} + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class VersionDeleteResponse implements BaseModel { diff --git a/src/Folders/FolderCopyResponse.php b/src/Folders/FolderCopyResponse.php index 81c8daa4..d5a6e512 100644 --- a/src/Folders/FolderCopyResponse.php +++ b/src/Folders/FolderCopyResponse.php @@ -12,6 +12,10 @@ * Job submitted successfully. A `jobId` will be returned. * * @phpstan-type folder_copy_response = array{jobID: string} + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class FolderCopyResponse implements BaseModel { diff --git a/src/Folders/FolderDeleteResponse.php b/src/Folders/FolderDeleteResponse.php index c7a62789..76a91706 100644 --- a/src/Folders/FolderDeleteResponse.php +++ b/src/Folders/FolderDeleteResponse.php @@ -9,6 +9,10 @@ /** * @phpstan-type folder_delete_response = array{} + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class FolderDeleteResponse implements BaseModel { diff --git a/src/Folders/FolderMoveResponse.php b/src/Folders/FolderMoveResponse.php index 5d767f7b..4c02d487 100644 --- a/src/Folders/FolderMoveResponse.php +++ b/src/Folders/FolderMoveResponse.php @@ -12,6 +12,10 @@ * Job submitted successfully. A `jobId` will be returned. * * @phpstan-type folder_move_response = array{jobID: string} + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class FolderMoveResponse implements BaseModel { diff --git a/src/Folders/FolderNewResponse.php b/src/Folders/FolderNewResponse.php index f8ce7b88..40b0344b 100644 --- a/src/Folders/FolderNewResponse.php +++ b/src/Folders/FolderNewResponse.php @@ -9,6 +9,10 @@ /** * @phpstan-type folder_new_response = array{} + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class FolderNewResponse implements BaseModel { diff --git a/src/Folders/FolderRenameResponse.php b/src/Folders/FolderRenameResponse.php index 15f1cacb..e8913e95 100644 --- a/src/Folders/FolderRenameResponse.php +++ b/src/Folders/FolderRenameResponse.php @@ -12,6 +12,10 @@ * Job submitted successfully. A `jobId` will be returned. * * @phpstan-type folder_rename_response = array{jobID: string} + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class FolderRenameResponse implements BaseModel { diff --git a/src/Folders/Job/JobGetResponse.php b/src/Folders/Job/JobGetResponse.php index 5b84581e..b7c91030 100644 --- a/src/Folders/Job/JobGetResponse.php +++ b/src/Folders/Job/JobGetResponse.php @@ -12,11 +12,15 @@ /** * @phpstan-type job_get_response = array{ - * jobID?: string|null, - * purgeRequestID?: string|null, - * status?: value-of|null, - * type?: value-of|null, + * jobID?: string, + * purgeRequestID?: string, + * status?: value-of, + * type?: value-of, * } + * When used in a response, this type parameter can be used to define a $rawResponse property. + * @template TRawResponse of object = object{} + * + * @mixin TRawResponse */ final class JobGetResponse implements BaseModel { diff --git a/src/ImageOverlay.php b/src/ImageOverlay.php index 4ccf310f..beae7150 100644 --- a/src/ImageOverlay.php +++ b/src/ImageOverlay.php @@ -10,16 +10,16 @@ use ImageKit\ImageOverlay\Encoding; /** - * @phpstan-type image_overlay = array{ + * @phpstan-type unnamed_type_with_intersection_parent0 = array{ * input: string, * type: string, - * encoding?: value-of|null, - * transformation?: list|null, + * encoding?: value-of, + * transformation?: list, * } */ final class ImageOverlay implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/OverlayPosition.php b/src/OverlayPosition.php index f93d46d2..8d2fab24 100644 --- a/src/OverlayPosition.php +++ b/src/OverlayPosition.php @@ -11,7 +11,7 @@ /** * @phpstan-type overlay_position = array{ - * focus?: value-of|null, x?: float|string|null, y?: float|string|null + * focus?: value-of, x?: float|string, y?: float|string * } */ final class OverlayPosition implements BaseModel diff --git a/src/OverlayTiming.php b/src/OverlayTiming.php index f7498c10..3a0bc5d4 100644 --- a/src/OverlayTiming.php +++ b/src/OverlayTiming.php @@ -10,9 +10,7 @@ /** * @phpstan-type overlay_timing = array{ - * duration?: float|string|null, - * end?: float|string|null, - * start?: float|string|null, + * duration?: float|string, end?: float|string, start?: float|string * } */ final class OverlayTiming implements BaseModel diff --git a/src/ServiceContracts/Accounts/URLEndpointsContract.php b/src/ServiceContracts/Accounts/URLEndpointsContract.php index 2f58ce7e..fa3c4c39 100644 --- a/src/ServiceContracts/Accounts/URLEndpointsContract.php +++ b/src/ServiceContracts/Accounts/URLEndpointsContract.php @@ -11,6 +11,7 @@ use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Akamai as Akamai1; use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Cloudinary as Cloudinary1; use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Imgix as Imgix1; +use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\RequestOptions; use const ImageKit\Core\OMIT as omit; @@ -24,6 +25,8 @@ interface URLEndpointsContract * @param list $origins Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) * @param Cloudinary|Imgix|Akamai $urlRewriter configuration for third-party URL rewriting + * + * @return URLEndpointResponse */ public function create( $description, @@ -40,6 +43,8 @@ public function create( * @param list $origins Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) * @param Cloudinary1|Imgix1|Akamai1 $urlRewriter configuration for third-party URL rewriting + * + * @return URLEndpointResponse */ public function update( string $id, @@ -69,6 +74,8 @@ public function delete( /** * @api + * + * @return URLEndpointResponse */ public function get( string $id, diff --git a/src/ServiceContracts/Accounts/UsageContract.php b/src/ServiceContracts/Accounts/UsageContract.php index d9db2280..e5394019 100644 --- a/src/ServiceContracts/Accounts/UsageContract.php +++ b/src/ServiceContracts/Accounts/UsageContract.php @@ -5,6 +5,7 @@ namespace ImageKit\ServiceContracts\Accounts; use ImageKit\Accounts\Usage\UsageGetResponse; +use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\RequestOptions; interface UsageContract @@ -14,6 +15,8 @@ interface UsageContract * * @param \DateTimeInterface $endDate Specify a `endDate` in `YYYY-MM-DD` format. It should be after the `startDate`. The difference between `startDate` and `endDate` should be less than 90 days. * @param \DateTimeInterface $startDate Specify a `startDate` in `YYYY-MM-DD` format. It should be before the `endDate`. The difference between `startDate` and `endDate` should be less than 90 days. + * + * @return UsageGetResponse */ public function get( $endDate, diff --git a/src/ServiceContracts/Beta/V2/FilesContract.php b/src/ServiceContracts/Beta/V2/FilesContract.php index ddb27113..1c3d78cc 100644 --- a/src/ServiceContracts/Beta/V2/FilesContract.php +++ b/src/ServiceContracts/Beta/V2/FilesContract.php @@ -7,6 +7,7 @@ use ImageKit\Beta\V2\Files\FileUploadParams\ResponseField; use ImageKit\Beta\V2\Files\FileUploadParams\Transformation; use ImageKit\Beta\V2\Files\FileUploadResponse; +use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\ExtensionItem\AIAutoDescription; use ImageKit\ExtensionItem\AutoTaggingExtension; use ImageKit\ExtensionItem\RemoveBg; @@ -71,6 +72,8 @@ interface FilesContract * * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + * + * @return FileUploadResponse */ public function upload( $file, diff --git a/src/ServiceContracts/Cache/InvalidationContract.php b/src/ServiceContracts/Cache/InvalidationContract.php index 0578aba6..0af6ded2 100644 --- a/src/ServiceContracts/Cache/InvalidationContract.php +++ b/src/ServiceContracts/Cache/InvalidationContract.php @@ -6,6 +6,7 @@ use ImageKit\Cache\Invalidation\InvalidationGetResponse; use ImageKit\Cache\Invalidation\InvalidationNewResponse; +use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\RequestOptions; interface InvalidationContract @@ -14,6 +15,8 @@ interface InvalidationContract * @api * * @param string $url the full URL of the file to be purged + * + * @return InvalidationNewResponse */ public function create( $url, @@ -22,6 +25,8 @@ public function create( /** * @api + * + * @return InvalidationGetResponse */ public function get( string $requestID, diff --git a/src/ServiceContracts/CustomMetadataFieldsContract.php b/src/ServiceContracts/CustomMetadataFieldsContract.php index 64f8b62b..a2df4699 100644 --- a/src/ServiceContracts/CustomMetadataFieldsContract.php +++ b/src/ServiceContracts/CustomMetadataFieldsContract.php @@ -4,6 +4,7 @@ namespace ImageKit\ServiceContracts; +use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\CustomMetadataFields\CustomMetadataField; use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; use ImageKit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; @@ -20,6 +21,8 @@ interface CustomMetadataFieldsContract * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. * @param string $name API name of the custom metadata field. This should be unique across all (including deleted) custom metadata fields. * @param Schema $schema + * + * @return CustomMetadataField */ public function create( $label, @@ -33,6 +36,8 @@ public function create( * * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. This parameter is required if `schema` is not provided. * @param Schema1 $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. + * + * @return CustomMetadataField */ public function update( string $id, @@ -55,6 +60,8 @@ public function list( /** * @api + * + * @return CustomMetadataFieldDeleteResponse */ public function delete( string $id, diff --git a/src/ServiceContracts/Files/BulkContract.php b/src/ServiceContracts/Files/BulkContract.php index c1c7de85..67447c41 100644 --- a/src/ServiceContracts/Files/BulkContract.php +++ b/src/ServiceContracts/Files/BulkContract.php @@ -4,6 +4,7 @@ namespace ImageKit\ServiceContracts\Files; +use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\Files\Bulk\BulkAddTagsResponse; use ImageKit\Files\Bulk\BulkDeleteResponse; use ImageKit\Files\Bulk\BulkRemoveAITagsResponse; @@ -16,6 +17,8 @@ interface BulkContract * @api * * @param list $fileIDs an array of fileIds which you want to delete + * + * @return BulkDeleteResponse */ public function delete( $fileIDs, @@ -27,6 +30,8 @@ public function delete( * * @param list $fileIDs an array of fileIds to which you want to add tags * @param list $tags an array of tags that you want to add to the files + * + * @return BulkAddTagsResponse */ public function addTags( $fileIDs, @@ -39,6 +44,8 @@ public function addTags( * * @param list $aiTags an array of AITags that you want to remove from the files * @param list $fileIDs an array of fileIds from which you want to remove AITags + * + * @return BulkRemoveAITagsResponse */ public function removeAITags( $aiTags, @@ -51,6 +58,8 @@ public function removeAITags( * * @param list $fileIDs an array of fileIds from which you want to remove tags * @param list $tags an array of tags that you want to remove from the files + * + * @return BulkRemoveTagsResponse */ public function removeTags( $fileIDs, diff --git a/src/ServiceContracts/Files/VersionsContract.php b/src/ServiceContracts/Files/VersionsContract.php index ae4d43f6..2b95b688 100644 --- a/src/ServiceContracts/Files/VersionsContract.php +++ b/src/ServiceContracts/Files/VersionsContract.php @@ -4,6 +4,7 @@ namespace ImageKit\ServiceContracts\Files; +use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\Files\File; use ImageKit\Files\Versions\VersionDeleteResponse; use ImageKit\RequestOptions; @@ -24,6 +25,8 @@ public function list( * @api * * @param string $fileID + * + * @return VersionDeleteResponse */ public function delete( string $versionID, @@ -35,6 +38,8 @@ public function delete( * @api * * @param string $fileID + * + * @return File */ public function get( string $versionID, @@ -46,6 +51,8 @@ public function get( * @api * * @param string $fileID + * + * @return File */ public function restore( string $versionID, diff --git a/src/ServiceContracts/FilesContract.php b/src/ServiceContracts/FilesContract.php index a63bca0e..5f2c79ea 100644 --- a/src/ServiceContracts/FilesContract.php +++ b/src/ServiceContracts/FilesContract.php @@ -4,6 +4,7 @@ namespace ImageKit\ServiceContracts; +use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\ExtensionItem\AIAutoDescription; use ImageKit\ExtensionItem\AutoTaggingExtension; use ImageKit\ExtensionItem\RemoveBg; @@ -38,6 +39,8 @@ interface FilesContract * @param list|null $tags An array of tags associated with the file, such as `["tag1", "tag2"]`. Send `null` to unset all tags associated with the file. * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. * @param Publish $publish configure the publication status of a file and its versions + * + * @return FileUpdateResponse */ public function update( string $fileID, @@ -66,6 +69,8 @@ public function delete( * @param string $destinationPath full path to the folder you want to copy the above file into * @param string $sourceFilePath the full path of the file you want to copy * @param bool $includeFileVersions Option to copy all versions of a file. By default, only the current version of the file is copied. When set to true, all versions of the file will be copied. Default value - `false`. + * + * @return FileCopyResponse */ public function copy( $destinationPath, @@ -76,6 +81,8 @@ public function copy( /** * @api + * + * @return File */ public function get( string $fileID, @@ -87,6 +94,8 @@ public function get( * * @param string $destinationPath full path to the folder you want to move the above file into * @param string $sourceFilePath the full path of the file you want to move + * + * @return FileMoveResponse */ public function move( $destinationPath, @@ -110,7 +119,7 @@ public function move( * * Note: If the old file were accessible at `https://ik.imagekit.io/demo/old-filename.jpg`, a purge cache request would be issued against `https://ik.imagekit.io/demo/old-filename.jpg*` (with a wildcard at the end). It will remove the file and its versions' URLs and any transformations made using query parameters on this file or its versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. * - * Default value - `false` + * @return FileRenameResponse */ public function rename( $filePath, @@ -194,6 +203,8 @@ public function rename( * * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + * + * @return FileUploadResponse */ public function upload( $file, diff --git a/src/ServiceContracts/Folders/JobContract.php b/src/ServiceContracts/Folders/JobContract.php index ba4dcfe0..8e59f85a 100644 --- a/src/ServiceContracts/Folders/JobContract.php +++ b/src/ServiceContracts/Folders/JobContract.php @@ -4,6 +4,7 @@ namespace ImageKit\ServiceContracts\Folders; +use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\Folders\Job\JobGetResponse; use ImageKit\RequestOptions; @@ -11,6 +12,8 @@ interface JobContract { /** * @api + * + * @return JobGetResponse */ public function get( string $jobID, diff --git a/src/ServiceContracts/FoldersContract.php b/src/ServiceContracts/FoldersContract.php index 04943640..e0cf7964 100644 --- a/src/ServiceContracts/FoldersContract.php +++ b/src/ServiceContracts/FoldersContract.php @@ -4,6 +4,7 @@ namespace ImageKit\ServiceContracts; +use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\Folders\FolderCopyResponse; use ImageKit\Folders\FolderDeleteResponse; use ImageKit\Folders\FolderMoveResponse; @@ -24,6 +25,8 @@ interface FoldersContract * @param string $parentFolderPath The folder where the new folder should be created, for root use `/` else the path e.g. `containing/folder/`. * * Note: If any folder(s) is not present in the parentFolderPath parameter, it will be automatically created. For example, if you pass `/product/images/summer`, then `product`, `images`, and `summer` folders will be created if they don't already exist. + * + * @return FolderNewResponse */ public function create( $folderName, @@ -35,6 +38,8 @@ public function create( * @api * * @param string $folderPath Full path to the folder you want to delete. For example `/folder/to/delete/`. + * + * @return FolderDeleteResponse */ public function delete( $folderPath, @@ -47,6 +52,8 @@ public function delete( * @param string $destinationPath full path to the destination folder where you want to copy the source folder into * @param string $sourceFolderPath the full path to the source folder you want to copy * @param bool $includeVersions Option to copy all versions of files that are nested inside the selected folder. By default, only the current version of each file will be copied. When set to true, all versions of each file will be copied. Default value - `false`. + * + * @return FolderCopyResponse */ public function copy( $destinationPath, @@ -60,6 +67,8 @@ public function copy( * * @param string $destinationPath full path to the destination folder where you want to move the source folder into * @param string $sourceFolderPath the full path to the source folder you want to move + * + * @return FolderMoveResponse */ public function move( $destinationPath, @@ -81,6 +90,8 @@ public function move( * Note: A purge cache request will be issued against `https://ik.imagekit.io/old/folder/path*` (with a wildcard at the end). This will remove all nested files, their versions' URLs, and any transformations made using query parameters on these files or their versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. * * Default value - `false` + * + * @return FolderRenameResponse */ public function rename( $folderPath, diff --git a/src/Services/Accounts/URLEndpointsService.php b/src/Services/Accounts/URLEndpointsService.php index 763e54d1..dc598951 100644 --- a/src/Services/Accounts/URLEndpointsService.php +++ b/src/Services/Accounts/URLEndpointsService.php @@ -15,6 +15,7 @@ use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Imgix as Imgix1; use ImageKit\Client; use ImageKit\Core\Conversion\ListOf; +use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\RequestOptions; use ImageKit\ServiceContracts\Accounts\URLEndpointsContract; @@ -37,6 +38,8 @@ public function __construct(private Client $client) {} * @param list $origins Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) * @param Cloudinary|Imgix|Akamai $urlRewriter configuration for third-party URL rewriting + * + * @return URLEndpointResponse */ public function create( $description, @@ -75,6 +78,8 @@ public function create( * @param list $origins Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) * @param Cloudinary1|Imgix1|Akamai1 $urlRewriter configuration for third-party URL rewriting + * + * @return URLEndpointResponse */ public function update( string $id, @@ -147,6 +152,8 @@ public function delete( * * **Note:** This API is currently in beta. * Retrieves the URL‑endpoint identified by `id`. + * + * @return URLEndpointResponse */ public function get( string $id, diff --git a/src/Services/Accounts/UsageService.php b/src/Services/Accounts/UsageService.php index b4fd1286..73f0843a 100644 --- a/src/Services/Accounts/UsageService.php +++ b/src/Services/Accounts/UsageService.php @@ -7,6 +7,7 @@ use ImageKit\Accounts\Usage\UsageGetParams; use ImageKit\Accounts\Usage\UsageGetResponse; use ImageKit\Client; +use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\RequestOptions; use ImageKit\ServiceContracts\Accounts\UsageContract; @@ -24,6 +25,8 @@ public function __construct(private Client $client) {} * * @param \DateTimeInterface $endDate Specify a `endDate` in `YYYY-MM-DD` format. It should be after the `startDate`. The difference between `startDate` and `endDate` should be less than 90 days. * @param \DateTimeInterface $startDate Specify a `startDate` in `YYYY-MM-DD` format. It should be before the `endDate`. The difference between `startDate` and `endDate` should be less than 90 days. + * + * @return UsageGetResponse */ public function get( $endDate, diff --git a/src/Services/AccountsService.php b/src/Services/AccountsService.php index 52fd692d..7c650ecd 100644 --- a/src/Services/AccountsService.php +++ b/src/Services/AccountsService.php @@ -32,8 +32,8 @@ final class AccountsService implements AccountsContract */ public function __construct(private Client $client) { - $this->usage = new UsageService($this->client); - $this->origins = new OriginsService($this->client); - $this->urlEndpoints = new URLEndpointsService($this->client); + $this->usage = new UsageService($client); + $this->origins = new OriginsService($client); + $this->urlEndpoints = new URLEndpointsService($client); } } diff --git a/src/Services/Beta/V2/FilesService.php b/src/Services/Beta/V2/FilesService.php index 66e9c39a..e9c3732f 100644 --- a/src/Services/Beta/V2/FilesService.php +++ b/src/Services/Beta/V2/FilesService.php @@ -9,6 +9,7 @@ use ImageKit\Beta\V2\Files\FileUploadParams\Transformation; use ImageKit\Beta\V2\Files\FileUploadResponse; use ImageKit\Client; +use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\ExtensionItem\AIAutoDescription; use ImageKit\ExtensionItem\AutoTaggingExtension; use ImageKit\ExtensionItem\RemoveBg; @@ -94,6 +95,8 @@ public function __construct(private Client $client) {} * * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + * + * @return FileUploadResponse */ public function upload( $file, diff --git a/src/Services/Beta/V2Service.php b/src/Services/Beta/V2Service.php index 4cddd5bd..0208080d 100644 --- a/src/Services/Beta/V2Service.php +++ b/src/Services/Beta/V2Service.php @@ -20,6 +20,6 @@ final class V2Service implements V2Contract */ public function __construct(private Client $client) { - $this->files = new FilesService($this->client); + $this->files = new FilesService($client); } } diff --git a/src/Services/BetaService.php b/src/Services/BetaService.php index d6cecb03..b7d9ee63 100644 --- a/src/Services/BetaService.php +++ b/src/Services/BetaService.php @@ -20,6 +20,6 @@ final class BetaService implements BetaContract */ public function __construct(private Client $client) { - $this->v2 = new V2Service($this->client); + $this->v2 = new V2Service($client); } } diff --git a/src/Services/Cache/InvalidationService.php b/src/Services/Cache/InvalidationService.php index 6cc46054..e4038f16 100644 --- a/src/Services/Cache/InvalidationService.php +++ b/src/Services/Cache/InvalidationService.php @@ -8,6 +8,7 @@ use ImageKit\Cache\Invalidation\InvalidationGetResponse; use ImageKit\Cache\Invalidation\InvalidationNewResponse; use ImageKit\Client; +use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\RequestOptions; use ImageKit\ServiceContracts\Cache\InvalidationContract; @@ -24,6 +25,8 @@ public function __construct(private Client $client) {} * This API will purge CDN cache and ImageKit.io's internal cache for a file. Note: Purge cache is an asynchronous process and it may take some time to reflect the changes. * * @param string $url the full URL of the file to be purged + * + * @return InvalidationNewResponse */ public function create( $url, @@ -48,6 +51,8 @@ public function create( * @api * * This API returns the status of a purge cache request. + * + * @return InvalidationGetResponse */ public function get( string $requestID, diff --git a/src/Services/CacheService.php b/src/Services/CacheService.php index 89184440..ec45da51 100644 --- a/src/Services/CacheService.php +++ b/src/Services/CacheService.php @@ -20,6 +20,6 @@ final class CacheService implements CacheContract */ public function __construct(private Client $client) { - $this->invalidation = new InvalidationService($this->client); + $this->invalidation = new InvalidationService($client); } } diff --git a/src/Services/CustomMetadataFieldsService.php b/src/Services/CustomMetadataFieldsService.php index 928b43a8..1bc4a815 100644 --- a/src/Services/CustomMetadataFieldsService.php +++ b/src/Services/CustomMetadataFieldsService.php @@ -6,6 +6,7 @@ use ImageKit\Client; use ImageKit\Core\Conversion\ListOf; +use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\CustomMetadataFields\CustomMetadataField; use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams; use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; @@ -33,6 +34,8 @@ public function __construct(private Client $client) {} * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. * @param string $name API name of the custom metadata field. This should be unique across all (including deleted) custom metadata fields. * @param Schema $schema + * + * @return CustomMetadataField */ public function create( $label, @@ -62,6 +65,8 @@ public function create( * * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. This parameter is required if `schema` is not provided. * @param Schema1 $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. + * + * @return CustomMetadataField */ public function update( string $id, @@ -116,6 +121,8 @@ public function list( * @api * * This API deletes a custom metadata field. Even after deleting a custom metadata field, you cannot create any new custom metadata field with the same name. + * + * @return CustomMetadataFieldDeleteResponse */ public function delete( string $id, diff --git a/src/Services/Files/BulkService.php b/src/Services/Files/BulkService.php index 731db603..de2b2073 100644 --- a/src/Services/Files/BulkService.php +++ b/src/Services/Files/BulkService.php @@ -5,6 +5,7 @@ namespace ImageKit\Services\Files; use ImageKit\Client; +use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\Files\Bulk\BulkAddTagsParams; use ImageKit\Files\Bulk\BulkAddTagsResponse; use ImageKit\Files\Bulk\BulkDeleteParams; @@ -33,6 +34,8 @@ public function __construct(private Client $client) {} * A maximum of 100 files can be deleted at a time. * * @param list $fileIDs an array of fileIds which you want to delete + * + * @return BulkDeleteResponse */ public function delete( $fileIDs, @@ -60,6 +63,8 @@ public function delete( * * @param list $fileIDs an array of fileIds to which you want to add tags * @param list $tags an array of tags that you want to add to the files + * + * @return BulkAddTagsResponse */ public function addTags( $fileIDs, @@ -88,6 +93,8 @@ public function addTags( * * @param list $aiTags an array of AITags that you want to remove from the files * @param list $fileIDs an array of fileIds from which you want to remove AITags + * + * @return BulkRemoveAITagsResponse */ public function removeAITags( $aiTags, @@ -116,6 +123,8 @@ public function removeAITags( * * @param list $fileIDs an array of fileIds from which you want to remove tags * @param list $tags an array of tags that you want to remove from the files + * + * @return BulkRemoveTagsResponse */ public function removeTags( $fileIDs, diff --git a/src/Services/Files/VersionsService.php b/src/Services/Files/VersionsService.php index 62bb23b0..efaed2f4 100644 --- a/src/Services/Files/VersionsService.php +++ b/src/Services/Files/VersionsService.php @@ -6,6 +6,7 @@ use ImageKit\Client; use ImageKit\Core\Conversion\ListOf; +use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\Files\File; use ImageKit\Files\Versions\VersionDeleteParams; use ImageKit\Files\Versions\VersionDeleteResponse; @@ -49,6 +50,8 @@ public function list( * Note: If you want to delete all versions of a file, use the delete file API. * * @param string $fileID + * + * @return VersionDeleteResponse */ public function delete( string $versionID, @@ -77,6 +80,8 @@ public function delete( * This API returns an object with details or attributes of a file version. * * @param string $fileID + * + * @return File */ public function get( string $versionID, @@ -105,6 +110,8 @@ public function get( * This API restores a file version as the current file version. * * @param string $fileID + * + * @return File */ public function restore( string $versionID, diff --git a/src/Services/FilesService.php b/src/Services/FilesService.php index deaf7864..3e5f6af1 100644 --- a/src/Services/FilesService.php +++ b/src/Services/FilesService.php @@ -5,6 +5,7 @@ namespace ImageKit\Services; use ImageKit\Client; +use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\ExtensionItem\AIAutoDescription; use ImageKit\ExtensionItem\AutoTaggingExtension; use ImageKit\ExtensionItem\RemoveBg; @@ -52,9 +53,9 @@ final class FilesService implements FilesContract */ public function __construct(private Client $client) { - $this->bulk = new BulkService($this->client); - $this->versions = new VersionsService($this->client); - $this->metadata = new MetadataService($this->client); + $this->bulk = new BulkService($client); + $this->versions = new VersionsService($client); + $this->metadata = new MetadataService($client); } /** @@ -75,6 +76,8 @@ public function __construct(private Client $client) * @param list|null $tags An array of tags associated with the file, such as `["tag1", "tag2"]`. Send `null` to unset all tags associated with the file. * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. * @param Publish $publish configure the publication status of a file and its versions + * + * @return FileUpdateResponse */ public function update( string $fileID, @@ -142,6 +145,8 @@ public function delete( * @param string $destinationPath full path to the folder you want to copy the above file into * @param string $sourceFilePath the full path of the file you want to copy * @param bool $includeFileVersions Option to copy all versions of a file. By default, only the current version of the file is copied. When set to true, all versions of the file will be copied. Default value - `false`. + * + * @return FileCopyResponse */ public function copy( $destinationPath, @@ -172,6 +177,8 @@ public function copy( * @api * * This API returns an object with details or attributes about the current version of the file. + * + * @return File */ public function get( string $fileID, @@ -195,6 +202,8 @@ public function get( * * @param string $destinationPath full path to the folder you want to move the above file into * @param string $sourceFilePath the full path of the file you want to move + * + * @return FileMoveResponse */ public function move( $destinationPath, @@ -239,7 +248,7 @@ public function move( * * Note: If the old file were accessible at `https://ik.imagekit.io/demo/old-filename.jpg`, a purge cache request would be issued against `https://ik.imagekit.io/demo/old-filename.jpg*` (with a wildcard at the end). It will remove the file and its versions' URLs and any transformations made using query parameters on this file or its versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. * - * Default value - `false` + * @return FileRenameResponse */ public function rename( $filePath, @@ -356,6 +365,8 @@ public function rename( * * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + * + * @return FileUploadResponse */ public function upload( $file, diff --git a/src/Services/Folders/JobService.php b/src/Services/Folders/JobService.php index b7be4ac6..b525dda7 100644 --- a/src/Services/Folders/JobService.php +++ b/src/Services/Folders/JobService.php @@ -5,6 +5,7 @@ namespace ImageKit\Services\Folders; use ImageKit\Client; +use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\Folders\Job\JobGetResponse; use ImageKit\RequestOptions; use ImageKit\ServiceContracts\Folders\JobContract; @@ -20,6 +21,8 @@ public function __construct(private Client $client) {} * @api * * This API returns the status of a bulk job like copy and move folder operations. + * + * @return JobGetResponse */ public function get( string $jobID, diff --git a/src/Services/FoldersService.php b/src/Services/FoldersService.php index 4a6bd748..d4f5d8e9 100644 --- a/src/Services/FoldersService.php +++ b/src/Services/FoldersService.php @@ -5,6 +5,7 @@ namespace ImageKit\Services; use ImageKit\Client; +use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\Folders\FolderCopyParams; use ImageKit\Folders\FolderCopyResponse; use ImageKit\Folders\FolderCreateParams; @@ -33,7 +34,7 @@ final class FoldersService implements FoldersContract */ public function __construct(private Client $client) { - $this->job = new JobService($this->client); + $this->job = new JobService($client); } /** @@ -47,6 +48,8 @@ public function __construct(private Client $client) * @param string $parentFolderPath The folder where the new folder should be created, for root use `/` else the path e.g. `containing/folder/`. * * Note: If any folder(s) is not present in the parentFolderPath parameter, it will be automatically created. For example, if you pass `/product/images/summer`, then `product`, `images`, and `summer` folders will be created if they don't already exist. + * + * @return FolderNewResponse */ public function create( $folderName, @@ -74,6 +77,8 @@ public function create( * This will delete a folder and all its contents permanently. The API returns an empty response. * * @param string $folderPath Full path to the folder you want to delete. For example `/folder/to/delete/`. + * + * @return FolderDeleteResponse */ public function delete( $folderPath, @@ -102,6 +107,8 @@ public function delete( * @param string $destinationPath full path to the destination folder where you want to copy the source folder into * @param string $sourceFolderPath the full path to the source folder you want to copy * @param bool $includeVersions Option to copy all versions of files that are nested inside the selected folder. By default, only the current version of each file will be copied. When set to true, all versions of each file will be copied. Default value - `false`. + * + * @return FolderCopyResponse */ public function copy( $destinationPath, @@ -135,6 +142,8 @@ public function copy( * * @param string $destinationPath full path to the destination folder where you want to move the source folder into * @param string $sourceFolderPath the full path to the source folder you want to move + * + * @return FolderMoveResponse */ public function move( $destinationPath, @@ -175,6 +184,8 @@ public function move( * Note: A purge cache request will be issued against `https://ik.imagekit.io/old/folder/path*` (with a wildcard at the end). This will remove all nested files, their versions' URLs, and any transformations made using query parameters on these files or their versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. * * Default value - `false` + * + * @return FolderRenameResponse */ public function rename( $folderPath, diff --git a/src/SolidColorOverlay.php b/src/SolidColorOverlay.php index 95867fb4..a979ac98 100644 --- a/src/SolidColorOverlay.php +++ b/src/SolidColorOverlay.php @@ -9,15 +9,15 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type solid_color_overlay = array{ + * @phpstan-type unnamed_type_with_intersection_parent1 = array{ * color: string, * type: string, - * transformation?: list|null, + * transformation?: list, * } */ final class SolidColorOverlay implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/SolidColorOverlayTransformation.php b/src/SolidColorOverlayTransformation.php index dccceb17..98bd2814 100644 --- a/src/SolidColorOverlayTransformation.php +++ b/src/SolidColorOverlayTransformation.php @@ -10,12 +10,12 @@ /** * @phpstan-type solid_color_overlay_transformation = array{ - * alpha?: float|null, - * background?: string|null, - * gradient?: bool|string|null, - * height?: float|string|null, - * radius?: float|string|null, - * width?: float|string|null, + * alpha?: float, + * background?: string, + * gradient?: bool|string, + * height?: float|string, + * radius?: float|string, + * width?: float|string, * } */ final class SolidColorOverlayTransformation implements BaseModel diff --git a/src/SrcOptions.php b/src/SrcOptions.php index 8cc167f5..317d3e76 100644 --- a/src/SrcOptions.php +++ b/src/SrcOptions.php @@ -14,11 +14,11 @@ * @phpstan-type src_options = array{ * src: string, * urlEndpoint: string, - * expiresIn?: float|null, - * queryParameters?: array|null, - * signed?: bool|null, - * transformation?: list|null, - * transformationPosition?: value-of|null, + * expiresIn?: float, + * queryParameters?: array, + * signed?: bool, + * transformation?: list, + * transformationPosition?: value-of, * } */ final class SrcOptions implements BaseModel diff --git a/src/SubtitleOverlay.php b/src/SubtitleOverlay.php index 03537f39..79c765b4 100644 --- a/src/SubtitleOverlay.php +++ b/src/SubtitleOverlay.php @@ -10,16 +10,16 @@ use ImageKit\SubtitleOverlay\Encoding; /** - * @phpstan-type subtitle_overlay = array{ + * @phpstan-type unnamed_type_with_intersection_parent2 = array{ * input: string, * type: string, - * encoding?: value-of|null, - * transformation?: list|null, + * encoding?: value-of, + * transformation?: list, * } */ final class SubtitleOverlay implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/SubtitleOverlayTransformation.php b/src/SubtitleOverlayTransformation.php index 94ed6c23..69ca7e07 100644 --- a/src/SubtitleOverlayTransformation.php +++ b/src/SubtitleOverlayTransformation.php @@ -13,13 +13,13 @@ * Subtitle styling options. [Learn more](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) from the docs. * * @phpstan-type subtitle_overlay_transformation = array{ - * background?: string|null, - * color?: string|null, - * fontFamily?: string|null, - * fontOutline?: string|null, - * fontShadow?: string|null, - * fontSize?: float|null, - * typography?: value-of|null, + * background?: string, + * color?: string, + * fontFamily?: string, + * fontOutline?: string, + * fontShadow?: string, + * fontSize?: float, + * typography?: value-of, * } */ final class SubtitleOverlayTransformation implements BaseModel diff --git a/src/TextOverlay.php b/src/TextOverlay.php index 24072937..b5747018 100644 --- a/src/TextOverlay.php +++ b/src/TextOverlay.php @@ -10,16 +10,16 @@ use ImageKit\TextOverlay\Encoding; /** - * @phpstan-type text_overlay = array{ + * @phpstan-type unnamed_type_with_intersection_parent3 = array{ * text: string, * type: string, - * encoding?: value-of|null, - * transformation?: list|null, + * encoding?: value-of, + * transformation?: list, * } */ final class TextOverlay implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/TextOverlayTransformation.php b/src/TextOverlayTransformation.php index c38b2805..6852822a 100644 --- a/src/TextOverlayTransformation.php +++ b/src/TextOverlayTransformation.php @@ -12,19 +12,19 @@ /** * @phpstan-type text_overlay_transformation = array{ - * alpha?: float|null, - * background?: string|null, - * flip?: value-of|null, - * fontColor?: string|null, - * fontFamily?: string|null, - * fontSize?: float|string|null, - * innerAlignment?: value-of|null, - * lineHeight?: float|string|null, - * padding?: float|string|null, - * radius?: float|string|null, - * rotation?: float|string|null, - * typography?: string|null, - * width?: float|string|null, + * alpha?: float, + * background?: string, + * flip?: value-of, + * fontColor?: string, + * fontFamily?: string, + * fontSize?: float|string, + * innerAlignment?: value-of, + * lineHeight?: float|string, + * padding?: float|string, + * radius?: float|string, + * rotation?: float|string, + * typography?: string, + * width?: float|string, * } */ final class TextOverlayTransformation implements BaseModel diff --git a/src/Transformation.php b/src/Transformation.php index cf555c31..6ac49613 100644 --- a/src/Transformation.php +++ b/src/Transformation.php @@ -21,58 +21,58 @@ * See the [Transformations documentation](https://imagekit.io/docs/transformations). * * @phpstan-type transformation_alias = array{ - * aiChangeBackground?: string|null, - * aiDropShadow?: bool|string|null, - * aiEdit?: string|null, - * aiRemoveBackground?: bool|null, - * aiRemoveBackgroundExternal?: bool|null, - * aiRetouch?: bool|null, - * aiUpscale?: bool|null, - * aiVariation?: bool|null, - * aspectRatio?: float|string|null, - * audioCodec?: value-of|null, - * background?: string|null, - * blur?: float|null, - * border?: string|null, - * colorProfile?: bool|null, - * contrastStretch?: bool|null, - * crop?: value-of|null, - * cropMode?: value-of|null, - * defaultImage?: string|null, - * dpr?: float|null, - * duration?: float|string|null, - * endOffset?: float|string|null, - * flip?: value-of|null, - * focus?: string|null, - * format?: value-of|null, - * gradient?: bool|string|null, - * grayscale?: bool|null, - * height?: float|string|null, - * lossless?: bool|null, - * metadata?: bool|null, - * named?: string|null, - * opacity?: float|null, - * original?: bool|null, - * overlay?: null|TextOverlay|ImageOverlay|VideoOverlay|SubtitleOverlay|SolidColorOverlay, - * page?: float|string|null, - * progressive?: bool|null, - * quality?: float|null, - * radius?: float|string|null, - * raw?: string|null, - * rotation?: float|string|null, - * shadow?: bool|string|null, - * sharpen?: bool|float|null, - * startOffset?: float|string|null, - * streamingResolutions?: list>|null, - * trim?: bool|float|null, - * unsharpMask?: bool|string|null, - * videoCodec?: value-of|null, - * width?: float|string|null, - * x?: float|string|null, - * xCenter?: float|string|null, - * y?: float|string|null, - * yCenter?: float|string|null, - * zoom?: float|null, + * aiChangeBackground?: string, + * aiDropShadow?: bool|string, + * aiEdit?: string, + * aiRemoveBackground?: bool, + * aiRemoveBackgroundExternal?: bool, + * aiRetouch?: bool, + * aiUpscale?: bool, + * aiVariation?: bool, + * aspectRatio?: float|string, + * audioCodec?: value-of, + * background?: string, + * blur?: float, + * border?: string, + * colorProfile?: bool, + * contrastStretch?: bool, + * crop?: value-of, + * cropMode?: value-of, + * defaultImage?: string, + * dpr?: float, + * duration?: float|string, + * endOffset?: float|string, + * flip?: value-of, + * focus?: string, + * format?: value-of, + * gradient?: bool|string, + * grayscale?: bool, + * height?: float|string, + * lossless?: bool, + * metadata?: bool, + * named?: string, + * opacity?: float, + * original?: bool, + * overlay?: Overlay, + * page?: float|string, + * progressive?: bool, + * quality?: float, + * radius?: float|string, + * raw?: string, + * rotation?: float|string, + * shadow?: bool|string, + * sharpen?: bool|float, + * startOffset?: float|string, + * streamingResolutions?: list>, + * trim?: bool|float, + * unsharpMask?: bool|string, + * videoCodec?: value-of, + * width?: float|string, + * x?: float|string, + * xCenter?: float|string, + * y?: float|string, + * yCenter?: float|string, + * zoom?: float, * } */ final class Transformation implements BaseModel diff --git a/src/VideoOverlay.php b/src/VideoOverlay.php index b754fd13..3135b391 100644 --- a/src/VideoOverlay.php +++ b/src/VideoOverlay.php @@ -10,16 +10,16 @@ use ImageKit\VideoOverlay\Encoding; /** - * @phpstan-type video_overlay = array{ + * @phpstan-type unnamed_type_with_intersection_parent4 = array{ * input: string, * type: string, - * encoding?: value-of|null, - * transformation?: list|null, + * encoding?: value-of, + * transformation?: list, * } */ final class VideoOverlay implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Webhooks/UploadPostTransformErrorEvent.php b/src/Webhooks/UploadPostTransformErrorEvent.php index 22ad5804..97b13e0b 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent.php +++ b/src/Webhooks/UploadPostTransformErrorEvent.php @@ -13,13 +13,13 @@ /** * Triggered when a post-transformation fails. The original file remains available, but the requested transformation could not be generated. * - * @phpstan-type upload_post_transform_error_event = array{ + * @phpstan-type unnamed_type_with_intersection_parent5 = array{ * createdAt: \DateTimeInterface, data: Data, request: Request, type: string * } */ final class UploadPostTransformErrorEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php index ae9c6c78..19628e2c 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php @@ -12,7 +12,7 @@ /** * @phpstan-type transformation_alias = array{ - * type: value-of, protocol?: value-of|null, value?: string|null + * type: value-of, protocol?: value-of, value?: string * } */ final class Transformation implements BaseModel diff --git a/src/Webhooks/UploadPostTransformSuccessEvent.php b/src/Webhooks/UploadPostTransformSuccessEvent.php index f5cb4919..d1cfd485 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent.php @@ -13,13 +13,13 @@ /** * Triggered when a post-transformation completes successfully. The transformed version of the file is now ready and can be accessed via the provided URL. Note that each post-transformation generates a separate webhook event. * - * @phpstan-type upload_post_transform_success_event = array{ + * @phpstan-type unnamed_type_with_intersection_parent6 = array{ * createdAt: \DateTimeInterface, data: Data, request: Request, type: string * } */ final class UploadPostTransformSuccessEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php index f57cb838..c0d9359f 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php @@ -12,7 +12,7 @@ /** * @phpstan-type transformation_alias = array{ - * type: value-of, protocol?: value-of|null, value?: string|null + * type: value-of, protocol?: value-of, value?: string * } */ final class Transformation implements BaseModel diff --git a/src/Webhooks/UploadPreTransformErrorEvent.php b/src/Webhooks/UploadPreTransformErrorEvent.php index 03f76019..50f990ef 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent.php +++ b/src/Webhooks/UploadPreTransformErrorEvent.php @@ -13,13 +13,13 @@ /** * Triggered when a pre-transformation fails. The file upload may have been accepted, but the requested transformation could not be applied. * - * @phpstan-type upload_pre_transform_error_event = array{ + * @phpstan-type unnamed_type_with_intersection_parent7 = array{ * createdAt: \DateTimeInterface, data: Data, request: Request, type: string * } */ final class UploadPreTransformErrorEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Webhooks/UploadPreTransformSuccessEvent.php b/src/Webhooks/UploadPreTransformSuccessEvent.php index ef1c0670..adf2b8e8 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent.php @@ -13,13 +13,13 @@ /** * Triggered when a pre-transformation completes successfully. The file has been processed with the requested transformation and is now available in the Media Library. * - * @phpstan-type upload_pre_transform_success_event = array{ + * @phpstan-type unnamed_type_with_intersection_parent8 = array{ * createdAt: \DateTimeInterface, data: Data, request: Request, type: string * } */ final class UploadPreTransformSuccessEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php index e4553404..92f3dfa2 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php @@ -17,29 +17,29 @@ * * @phpstan-type data_alias = array{ * aiTags?: list|null, - * audioCodec?: string|null, - * bitRate?: int|null, + * audioCodec?: string, + * bitRate?: int, * customCoordinates?: string|null, - * customMetadata?: array|null, - * description?: string|null, - * duration?: int|null, - * embeddedMetadata?: array|null, - * extensionStatus?: ExtensionStatus|null, - * fileID?: string|null, - * filePath?: string|null, - * fileType?: string|null, - * height?: float|null, - * isPrivateFile?: bool|null, - * isPublished?: bool|null, - * metadata?: Metadata|null, - * name?: string|null, - * size?: float|null, + * customMetadata?: array, + * description?: string, + * duration?: int, + * embeddedMetadata?: array, + * extensionStatus?: ExtensionStatus, + * fileID?: string, + * filePath?: string, + * fileType?: string, + * height?: float, + * isPrivateFile?: bool, + * isPublished?: bool, + * metadata?: Metadata, + * name?: string, + * size?: float, * tags?: list|null, - * thumbnailURL?: string|null, - * url?: string|null, - * versionInfo?: VersionInfo|null, - * videoCodec?: string|null, - * width?: float|null, + * thumbnailURL?: string, + * url?: string, + * versionInfo?: VersionInfo, + * videoCodec?: string, + * width?: float, * } */ final class Data implements BaseModel diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php index e749ce23..502fbddc 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php @@ -9,9 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type ai_tag = array{ - * confidence?: float|null, name?: string|null, source?: string|null - * } + * @phpstan-type ai_tag = array{confidence?: float, name?: string, source?: string} */ final class AITag implements BaseModel { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php index 8cd45604..e6e8f269 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php @@ -22,10 +22,10 @@ * If no extension was requested, then this parameter is not returned. * * @phpstan-type extension_status = array{ - * aiAutoDescription?: value-of|null, - * awsAutoTagging?: value-of|null, - * googleAutoTagging?: value-of|null, - * removeBg?: value-of|null, + * aiAutoDescription?: value-of, + * awsAutoTagging?: value-of, + * googleAutoTagging?: value-of, + * removeBg?: value-of, * } */ final class ExtensionStatus implements BaseModel diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php index 4fd4ef83..eef154fc 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php @@ -11,7 +11,7 @@ /** * An object containing the file or file version's `id` (versionId) and `name`. * - * @phpstan-type version_info = array{id?: string|null, name?: string|null} + * @phpstan-type version_info = array{id?: string, name?: string} */ final class VersionInfo implements BaseModel { diff --git a/src/Webhooks/VideoTransformationAcceptedEvent.php b/src/Webhooks/VideoTransformationAcceptedEvent.php index 6957bcca..931d780d 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent.php @@ -13,13 +13,13 @@ /** * Triggered when a new video transformation request is accepted for processing. This event confirms that ImageKit has received and queued your transformation request. Use this for debugging and tracking transformation lifecycle. * - * @phpstan-type video_transformation_accepted_event = array{ + * @phpstan-type unnamed_type_with_intersection_parent9 = array{ * createdAt: \DateTimeInterface, data: Data, request: Request, type: string * } */ final class VideoTransformationAcceptedEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php index 3e0c84d3..80b43edd 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php @@ -14,7 +14,7 @@ * Base information about a video transformation request. * * @phpstan-type transformation_alias = array{ - * type: value-of, options?: Options|null + * type: value-of, options?: Options * } */ final class Transformation implements BaseModel diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php index fb68a78c..34dfdffc 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php @@ -16,13 +16,13 @@ * Configuration options for video transformations. * * @phpstan-type options_alias = array{ - * audioCodec?: value-of|null, - * autoRotate?: bool|null, - * format?: value-of|null, - * quality?: int|null, - * streamProtocol?: value-of|null, - * variants?: list|null, - * videoCodec?: value-of|null, + * audioCodec?: value-of, + * autoRotate?: bool, + * format?: value-of, + * quality?: int, + * streamProtocol?: value-of, + * variants?: list, + * videoCodec?: value-of, * } */ final class Options implements BaseModel diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Request.php b/src/Webhooks/VideoTransformationAcceptedEvent/Request.php index 7b65fed1..122bc3fe 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Request.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Request.php @@ -12,7 +12,7 @@ * Information about the original request that triggered the video transformation. * * @phpstan-type request_alias = array{ - * url: string, xRequestID: string, userAgent?: string|null + * url: string, xRequestID: string, userAgent?: string * } */ final class Request implements BaseModel diff --git a/src/Webhooks/VideoTransformationErrorEvent.php b/src/Webhooks/VideoTransformationErrorEvent.php index 31aa4b8a..6b264bb8 100644 --- a/src/Webhooks/VideoTransformationErrorEvent.php +++ b/src/Webhooks/VideoTransformationErrorEvent.php @@ -13,13 +13,13 @@ /** * Triggered when an error occurs during video encoding. Listen to this webhook to log error reasons and debug issues. Check your origin and URL endpoint settings if the reason is related to download failure. For other errors, contact ImageKit support. * - * @phpstan-type video_transformation_error_event = array{ + * @phpstan-type unnamed_type_with_intersection_parent10 = array{ * createdAt: \DateTimeInterface, data: Data, request: Request, type: string * } */ final class VideoTransformationErrorEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php index f7b4c774..df13aca2 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php @@ -13,7 +13,7 @@ /** * @phpstan-type transformation_alias = array{ - * type: value-of, error?: Error|null, options?: Options|null + * type: value-of, error?: Error, options?: Options * } */ final class Transformation implements BaseModel diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php index f5a618ed..e8dacd9a 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php @@ -16,13 +16,13 @@ * Configuration options for video transformations. * * @phpstan-type options_alias = array{ - * audioCodec?: value-of|null, - * autoRotate?: bool|null, - * format?: value-of|null, - * quality?: int|null, - * streamProtocol?: value-of|null, - * variants?: list|null, - * videoCodec?: value-of|null, + * audioCodec?: value-of, + * autoRotate?: bool, + * format?: value-of, + * quality?: int, + * streamProtocol?: value-of, + * variants?: list, + * videoCodec?: value-of, * } */ final class Options implements BaseModel diff --git a/src/Webhooks/VideoTransformationErrorEvent/Request.php b/src/Webhooks/VideoTransformationErrorEvent/Request.php index d92cde1a..39fa8314 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Request.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Request.php @@ -12,7 +12,7 @@ * Information about the original request that triggered the video transformation. * * @phpstan-type request_alias = array{ - * url: string, xRequestID: string, userAgent?: string|null + * url: string, xRequestID: string, userAgent?: string * } */ final class Request implements BaseModel diff --git a/src/Webhooks/VideoTransformationReadyEvent.php b/src/Webhooks/VideoTransformationReadyEvent.php index 688f66a9..ecbda8e3 100644 --- a/src/Webhooks/VideoTransformationReadyEvent.php +++ b/src/Webhooks/VideoTransformationReadyEvent.php @@ -14,17 +14,17 @@ /** * Triggered when video encoding is finished and the transformed resource is ready to be served. This is the key event to listen for - update your database or CMS flags when you receive this so your application can start showing the transformed video to users. * - * @phpstan-type video_transformation_ready_event = array{ + * @phpstan-type unnamed_type_with_intersection_parent11 = array{ * createdAt: \DateTimeInterface, * data: Data, * request: Request, * type: string, - * timings?: Timings|null, + * timings?: Timings, * } */ final class VideoTransformationReadyEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php index 794423d6..9685a24e 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php @@ -13,7 +13,7 @@ /** * @phpstan-type transformation_alias = array{ - * type: value-of, options?: Options|null, output?: Output|null + * type: value-of, options?: Options, output?: Output * } */ final class Transformation implements BaseModel diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php index d1524f17..e44973ea 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php @@ -16,13 +16,13 @@ * Configuration options for video transformations. * * @phpstan-type options_alias = array{ - * audioCodec?: value-of|null, - * autoRotate?: bool|null, - * format?: value-of|null, - * quality?: int|null, - * streamProtocol?: value-of|null, - * variants?: list|null, - * videoCodec?: value-of|null, + * audioCodec?: value-of, + * autoRotate?: bool, + * format?: value-of, + * quality?: int, + * streamProtocol?: value-of, + * variants?: list, + * videoCodec?: value-of, * } */ final class Options implements BaseModel diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php index e620017b..83a5d424 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php @@ -12,9 +12,7 @@ /** * Information about the transformed output video. * - * @phpstan-type output_alias = array{ - * url: string, videoMetadata?: VideoMetadata|null - * } + * @phpstan-type output_alias = array{url: string, videoMetadata?: VideoMetadata} */ final class Output implements BaseModel { diff --git a/src/Webhooks/VideoTransformationReadyEvent/Request.php b/src/Webhooks/VideoTransformationReadyEvent/Request.php index 2c97f621..e457dbc0 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Request.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Request.php @@ -12,7 +12,7 @@ * Information about the original request that triggered the video transformation. * * @phpstan-type request_alias = array{ - * url: string, xRequestID: string, userAgent?: string|null + * url: string, xRequestID: string, userAgent?: string * } */ final class Request implements BaseModel diff --git a/src/Webhooks/VideoTransformationReadyEvent/Timings.php b/src/Webhooks/VideoTransformationReadyEvent/Timings.php index 8ae42494..09655f08 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Timings.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Timings.php @@ -12,7 +12,7 @@ * Performance metrics for the transformation process. * * @phpstan-type timings_alias = array{ - * downloadDuration?: int|null, encodingDuration?: int|null + * downloadDuration?: int, encodingDuration?: int * } */ final class Timings implements BaseModel From 049e837e2827e68c6cada81e7e35e3ddef23beb9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 13 Sep 2025 02:37:00 +0000 Subject: [PATCH 029/193] feat(client): add raw methods --- .../URLEndpoints/URLEndpointResponse.php | 2 +- src/Accounts/Usage/UsageGetResponse.php | 2 +- src/Beta/V2/Files/FileUploadResponse.php | 2 +- .../Invalidation/InvalidationGetResponse.php | 2 +- .../Invalidation/InvalidationNewResponse.php | 2 +- .../CustomMetadataField.php | 2 +- .../CustomMetadataFieldDeleteResponse.php | 2 +- src/Files/Bulk/BulkAddTagsResponse.php | 2 +- src/Files/Bulk/BulkDeleteResponse.php | 2 +- src/Files/Bulk/BulkRemoveAITagsResponse.php | 2 +- src/Files/Bulk/BulkRemoveTagsResponse.php | 2 +- src/Files/File.php | 2 +- src/Files/FileCopyResponse.php | 2 +- src/Files/FileMoveResponse.php | 2 +- src/Files/FileRenameResponse.php | 2 +- src/Files/FileUpdateResponse.php | 477 +++++++++++++++++- src/Files/FileUploadResponse.php | 2 +- src/Files/Versions/VersionDeleteResponse.php | 2 +- src/Folders/FolderCopyResponse.php | 2 +- src/Folders/FolderDeleteResponse.php | 2 +- src/Folders/FolderMoveResponse.php | 2 +- src/Folders/FolderNewResponse.php | 2 +- src/Folders/FolderRenameResponse.php | 2 +- src/Folders/Job/JobGetResponse.php | 2 +- src/ImageOverlay.php | 32 +- .../Accounts/OriginsContract.php | 70 +++ .../Accounts/URLEndpointsContract.php | 76 +++ .../Accounts/UsageContract.php | 17 + src/ServiceContracts/AssetsContract.php | 17 + .../Beta/V2/FilesContract.php | 17 + .../Cache/InvalidationContract.php | 32 ++ .../CustomMetadataFieldsContract.php | 65 +++ src/ServiceContracts/Files/BulkContract.php | 65 +++ .../Files/MetadataContract.php | 28 + .../Files/VersionsContract.php | 67 +++ src/ServiceContracts/FilesContract.php | 110 ++++ src/ServiceContracts/Folders/JobContract.php | 16 + src/ServiceContracts/FoldersContract.php | 81 +++ src/Services/Accounts/OriginsService.php | 186 +++++-- src/Services/Accounts/URLEndpointsService.php | 124 ++++- src/Services/Accounts/UsageService.php | 23 +- src/Services/AssetsService.php | 41 +- src/Services/Beta/V2/FilesService.php | 67 ++- src/Services/Cache/InvalidationService.php | 42 +- src/Services/CustomMetadataFieldsService.php | 87 +++- src/Services/Files/BulkService.php | 89 +++- src/Services/Files/MetadataService.php | 38 +- src/Services/Files/VersionsService.php | 89 +++- src/Services/FilesService.php | 245 +++++++-- src/Services/Folders/JobService.php | 20 + src/Services/FoldersService.php | 143 +++++- src/SolidColorOverlay.php | 34 +- src/SubtitleOverlay.php | 32 +- src/TextOverlay.php | 34 +- src/VideoOverlay.php | 32 +- .../UploadPostTransformErrorEvent.php | 55 +- .../UploadPostTransformSuccessEvent.php | 55 +- src/Webhooks/UploadPreTransformErrorEvent.php | 55 +- .../UploadPreTransformSuccessEvent.php | 55 +- .../VideoTransformationAcceptedEvent.php | 55 +- .../VideoTransformationErrorEvent.php | 55 +- .../VideoTransformationReadyEvent.php | 50 +- 62 files changed, 2658 insertions(+), 264 deletions(-) diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse.php b/src/Accounts/URLEndpoints/URLEndpointResponse.php index 7199516a..f5aa9bd0 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse.php @@ -22,7 +22,7 @@ * urlPrefix: string, * urlRewriter?: Cloudinary|Imgix|Akamai, * } - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/Accounts/Usage/UsageGetResponse.php b/src/Accounts/Usage/UsageGetResponse.php index 0ec69d79..820b3a13 100644 --- a/src/Accounts/Usage/UsageGetResponse.php +++ b/src/Accounts/Usage/UsageGetResponse.php @@ -16,7 +16,7 @@ * originalCacheStorageBytes?: int, * videoProcessingUnitsCount?: int, * } - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/Beta/V2/Files/FileUploadResponse.php b/src/Beta/V2/Files/FileUploadResponse.php index 74ab2e43..aa068676 100644 --- a/src/Beta/V2/Files/FileUploadResponse.php +++ b/src/Beta/V2/Files/FileUploadResponse.php @@ -41,7 +41,7 @@ * videoCodec?: string, * width?: float, * } - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/Cache/Invalidation/InvalidationGetResponse.php b/src/Cache/Invalidation/InvalidationGetResponse.php index 4a853e75..789db9ba 100644 --- a/src/Cache/Invalidation/InvalidationGetResponse.php +++ b/src/Cache/Invalidation/InvalidationGetResponse.php @@ -11,7 +11,7 @@ /** * @phpstan-type invalidation_get_response = array{status?: value-of} - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/Cache/Invalidation/InvalidationNewResponse.php b/src/Cache/Invalidation/InvalidationNewResponse.php index 4597a296..93a2eadb 100644 --- a/src/Cache/Invalidation/InvalidationNewResponse.php +++ b/src/Cache/Invalidation/InvalidationNewResponse.php @@ -10,7 +10,7 @@ /** * @phpstan-type invalidation_new_response = array{requestID?: string} - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/CustomMetadataFields/CustomMetadataField.php b/src/CustomMetadataFields/CustomMetadataField.php index c0a1045f..422a23e2 100644 --- a/src/CustomMetadataFields/CustomMetadataField.php +++ b/src/CustomMetadataFields/CustomMetadataField.php @@ -15,7 +15,7 @@ * @phpstan-type custom_metadata_field = array{ * id: string, label: string, name: string, schema: Schema * } - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php b/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php index 6bb1113d..0f11add0 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php +++ b/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php @@ -9,7 +9,7 @@ /** * @phpstan-type custom_metadata_field_delete_response = array{} - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/Files/Bulk/BulkAddTagsResponse.php b/src/Files/Bulk/BulkAddTagsResponse.php index 54a2b004..70887d2e 100644 --- a/src/Files/Bulk/BulkAddTagsResponse.php +++ b/src/Files/Bulk/BulkAddTagsResponse.php @@ -12,7 +12,7 @@ * @phpstan-type bulk_add_tags_response = array{ * successfullyUpdatedFileIDs?: list * } - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/Files/Bulk/BulkDeleteResponse.php b/src/Files/Bulk/BulkDeleteResponse.php index b0da1da0..895b2d29 100644 --- a/src/Files/Bulk/BulkDeleteResponse.php +++ b/src/Files/Bulk/BulkDeleteResponse.php @@ -12,7 +12,7 @@ * @phpstan-type bulk_delete_response = array{ * successfullyDeletedFileIDs?: list * } - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/Files/Bulk/BulkRemoveAITagsResponse.php b/src/Files/Bulk/BulkRemoveAITagsResponse.php index 2946c9de..5c0820e2 100644 --- a/src/Files/Bulk/BulkRemoveAITagsResponse.php +++ b/src/Files/Bulk/BulkRemoveAITagsResponse.php @@ -12,7 +12,7 @@ * @phpstan-type bulk_remove_ai_tags_response = array{ * successfullyUpdatedFileIDs?: list * } - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/Files/Bulk/BulkRemoveTagsResponse.php b/src/Files/Bulk/BulkRemoveTagsResponse.php index a82a0a8d..8a477675 100644 --- a/src/Files/Bulk/BulkRemoveTagsResponse.php +++ b/src/Files/Bulk/BulkRemoveTagsResponse.php @@ -12,7 +12,7 @@ * @phpstan-type bulk_remove_tags_response = array{ * successfullyUpdatedFileIDs?: list * } - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/Files/File.php b/src/Files/File.php index 662ed6bd..cabba9f0 100644 --- a/src/Files/File.php +++ b/src/Files/File.php @@ -38,7 +38,7 @@ * versionInfo?: VersionInfo, * width?: float, * } - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/Files/FileCopyResponse.php b/src/Files/FileCopyResponse.php index 418bd983..f6f2abd5 100644 --- a/src/Files/FileCopyResponse.php +++ b/src/Files/FileCopyResponse.php @@ -9,7 +9,7 @@ /** * @phpstan-type file_copy_response = array{} - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/Files/FileMoveResponse.php b/src/Files/FileMoveResponse.php index 78520bc8..f5c06a51 100644 --- a/src/Files/FileMoveResponse.php +++ b/src/Files/FileMoveResponse.php @@ -9,7 +9,7 @@ /** * @phpstan-type file_move_response = array{} - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/Files/FileRenameResponse.php b/src/Files/FileRenameResponse.php index 91c59847..e18ed3fc 100644 --- a/src/Files/FileRenameResponse.php +++ b/src/Files/FileRenameResponse.php @@ -10,7 +10,7 @@ /** * @phpstan-type file_rename_response = array{purgeRequestID?: string} - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/Files/FileUpdateResponse.php b/src/Files/FileUpdateResponse.php index 7857e300..42fdf499 100644 --- a/src/Files/FileUpdateResponse.php +++ b/src/Files/FileUpdateResponse.php @@ -7,24 +7,189 @@ use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Files\File\AITag; +use ImageKit\Files\File\Type; +use ImageKit\Files\File\VersionInfo; use ImageKit\Files\FileUpdateResponse\ExtensionStatus; /** * Object containing details of a file or file version. * - * @phpstan-type unnamed_type_with_intersection_parent12 = array{ - * extensionStatus?: ExtensionStatus + * @phpstan-type file_update_response = array{ + * aiTags?: list|null, + * createdAt?: \DateTimeInterface, + * customCoordinates?: string|null, + * customMetadata?: array, + * description?: string, + * fileID?: string, + * filePath?: string, + * fileType?: string, + * hasAlpha?: bool, + * height?: float, + * isPrivateFile?: bool, + * isPublished?: bool, + * mime?: string, + * name?: string, + * size?: float, + * tags?: list|null, + * thumbnail?: string, + * type?: value-of, + * updatedAt?: \DateTimeInterface, + * url?: string, + * versionInfo?: VersionInfo, + * width?: float, + * extensionStatus?: ExtensionStatus, * } - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse */ final class FileUpdateResponse implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; + /** + * An array of tags assigned to the file by auto tagging. + * + * @var list|null $aiTags + */ + #[Api('AITags', list: AITag::class, nullable: true, optional: true)] + public ?array $aiTags; + + /** + * Date and time when the file was uploaded. The date and time is in ISO8601 format. + */ + #[Api(optional: true)] + public ?\DateTimeInterface $createdAt; + + /** + * An string with custom coordinates of the file. + */ + #[Api(nullable: true, optional: true)] + public ?string $customCoordinates; + + /** + * An object with custom metadata for the file. + * + * @var array|null $customMetadata + */ + #[Api(map: 'mixed', optional: true)] + public ?array $customMetadata; + + /** + * Optional text to describe the contents of the file. Can be set by the user or the ai-auto-description extension. + */ + #[Api(optional: true)] + public ?string $description; + + /** + * Unique identifier of the asset. + */ + #[Api('fileId', optional: true)] + public ?string $fileID; + + /** + * Path of the file. This is the path you would use in the URL to access the file. For example, if the file is at the root of the media library, the path will be `/file.jpg`. If the file is inside a folder named `images`, the path will be `/images/file.jpg`. + */ + #[Api(optional: true)] + public ?string $filePath; + + /** + * Type of the file. Possible values are `image`, `non-image`. + */ + #[Api(optional: true)] + public ?string $fileType; + + /** + * Specifies if the image has an alpha channel. + */ + #[Api(optional: true)] + public ?bool $hasAlpha; + + /** + * Height of the file. + */ + #[Api(optional: true)] + public ?float $height; + + /** + * Specifies if the file is private or not. + */ + #[Api(optional: true)] + public ?bool $isPrivateFile; + + /** + * Specifies if the file is published or not. + */ + #[Api(optional: true)] + public ?bool $isPublished; + + /** + * MIME type of the file. + */ + #[Api(optional: true)] + public ?string $mime; + + /** + * Name of the asset. + */ + #[Api(optional: true)] + public ?string $name; + + /** + * Size of the file in bytes. + */ + #[Api(optional: true)] + public ?float $size; + + /** + * An array of tags assigned to the file. Tags are used to search files in the media library. + * + * @var list|null $tags + */ + #[Api(list: 'string', nullable: true, optional: true)] + public ?array $tags; + + /** + * URL of the thumbnail image. This URL is used to access the thumbnail image of the file in the media library. + */ + #[Api(optional: true)] + public ?string $thumbnail; + + /** + * Type of the asset. + * + * @var value-of|null $type + */ + #[Api(enum: Type::class, optional: true)] + public ?string $type; + + /** + * Date and time when the file was last updated. The date and time is in ISO8601 format. + */ + #[Api(optional: true)] + public ?\DateTimeInterface $updatedAt; + + /** + * URL of the file. + */ + #[Api(optional: true)] + public ?string $url; + + /** + * An object with details of the file version. + */ + #[Api(optional: true)] + public ?VersionInfo $versionInfo; + + /** + * Width of the file. + */ + #[Api(optional: true)] + public ?float $width; + #[Api(optional: true)] public ?ExtensionStatus $extensionStatus; @@ -37,16 +202,316 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param list|null $aiTags + * @param array $customMetadata + * @param list|null $tags + * @param Type|value-of $type */ - public static function with(?ExtensionStatus $extensionStatus = null): self - { + public static function with( + ?array $aiTags = null, + ?\DateTimeInterface $createdAt = null, + ?string $customCoordinates = null, + ?array $customMetadata = null, + ?string $description = null, + ?string $fileID = null, + ?string $filePath = null, + ?string $fileType = null, + ?bool $hasAlpha = null, + ?float $height = null, + ?bool $isPrivateFile = null, + ?bool $isPublished = null, + ?string $mime = null, + ?string $name = null, + ?float $size = null, + ?array $tags = null, + ?string $thumbnail = null, + Type|string|null $type = null, + ?\DateTimeInterface $updatedAt = null, + ?string $url = null, + ?VersionInfo $versionInfo = null, + ?float $width = null, + ?ExtensionStatus $extensionStatus = null, + ): self { $obj = new self; + null !== $aiTags && $obj->aiTags = $aiTags; + null !== $createdAt && $obj->createdAt = $createdAt; + null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; + null !== $customMetadata && $obj->customMetadata = $customMetadata; + null !== $description && $obj->description = $description; + null !== $fileID && $obj->fileID = $fileID; + null !== $filePath && $obj->filePath = $filePath; + null !== $fileType && $obj->fileType = $fileType; + null !== $hasAlpha && $obj->hasAlpha = $hasAlpha; + null !== $height && $obj->height = $height; + null !== $isPrivateFile && $obj->isPrivateFile = $isPrivateFile; + null !== $isPublished && $obj->isPublished = $isPublished; + null !== $mime && $obj->mime = $mime; + null !== $name && $obj->name = $name; + null !== $size && $obj->size = $size; + null !== $tags && $obj->tags = $tags; + null !== $thumbnail && $obj->thumbnail = $thumbnail; + null !== $type && $obj->type = $type instanceof Type ? $type->value : $type; + null !== $updatedAt && $obj->updatedAt = $updatedAt; + null !== $url && $obj->url = $url; + null !== $versionInfo && $obj->versionInfo = $versionInfo; + null !== $width && $obj->width = $width; null !== $extensionStatus && $obj->extensionStatus = $extensionStatus; return $obj; } + /** + * An array of tags assigned to the file by auto tagging. + * + * @param list|null $aiTags + */ + public function withAITags(?array $aiTags): self + { + $obj = clone $this; + $obj->aiTags = $aiTags; + + return $obj; + } + + /** + * Date and time when the file was uploaded. The date and time is in ISO8601 format. + */ + public function withCreatedAt(\DateTimeInterface $createdAt): self + { + $obj = clone $this; + $obj->createdAt = $createdAt; + + return $obj; + } + + /** + * An string with custom coordinates of the file. + */ + public function withCustomCoordinates(?string $customCoordinates): self + { + $obj = clone $this; + $obj->customCoordinates = $customCoordinates; + + return $obj; + } + + /** + * An object with custom metadata for the file. + * + * @param array $customMetadata + */ + public function withCustomMetadata(array $customMetadata): self + { + $obj = clone $this; + $obj->customMetadata = $customMetadata; + + return $obj; + } + + /** + * Optional text to describe the contents of the file. Can be set by the user or the ai-auto-description extension. + */ + public function withDescription(string $description): self + { + $obj = clone $this; + $obj->description = $description; + + return $obj; + } + + /** + * Unique identifier of the asset. + */ + public function withFileID(string $fileID): self + { + $obj = clone $this; + $obj->fileID = $fileID; + + return $obj; + } + + /** + * Path of the file. This is the path you would use in the URL to access the file. For example, if the file is at the root of the media library, the path will be `/file.jpg`. If the file is inside a folder named `images`, the path will be `/images/file.jpg`. + */ + public function withFilePath(string $filePath): self + { + $obj = clone $this; + $obj->filePath = $filePath; + + return $obj; + } + + /** + * Type of the file. Possible values are `image`, `non-image`. + */ + public function withFileType(string $fileType): self + { + $obj = clone $this; + $obj->fileType = $fileType; + + return $obj; + } + + /** + * Specifies if the image has an alpha channel. + */ + public function withHasAlpha(bool $hasAlpha): self + { + $obj = clone $this; + $obj->hasAlpha = $hasAlpha; + + return $obj; + } + + /** + * Height of the file. + */ + public function withHeight(float $height): self + { + $obj = clone $this; + $obj->height = $height; + + return $obj; + } + + /** + * Specifies if the file is private or not. + */ + public function withIsPrivateFile(bool $isPrivateFile): self + { + $obj = clone $this; + $obj->isPrivateFile = $isPrivateFile; + + return $obj; + } + + /** + * Specifies if the file is published or not. + */ + public function withIsPublished(bool $isPublished): self + { + $obj = clone $this; + $obj->isPublished = $isPublished; + + return $obj; + } + + /** + * MIME type of the file. + */ + public function withMime(string $mime): self + { + $obj = clone $this; + $obj->mime = $mime; + + return $obj; + } + + /** + * Name of the asset. + */ + public function withName(string $name): self + { + $obj = clone $this; + $obj->name = $name; + + return $obj; + } + + /** + * Size of the file in bytes. + */ + public function withSize(float $size): self + { + $obj = clone $this; + $obj->size = $size; + + return $obj; + } + + /** + * An array of tags assigned to the file. Tags are used to search files in the media library. + * + * @param list|null $tags + */ + public function withTags(?array $tags): self + { + $obj = clone $this; + $obj->tags = $tags; + + return $obj; + } + + /** + * URL of the thumbnail image. This URL is used to access the thumbnail image of the file in the media library. + */ + public function withThumbnail(string $thumbnail): self + { + $obj = clone $this; + $obj->thumbnail = $thumbnail; + + return $obj; + } + + /** + * Type of the asset. + * + * @param Type|value-of $type + */ + public function withType(Type|string $type): self + { + $obj = clone $this; + $obj->type = $type instanceof Type ? $type->value : $type; + + return $obj; + } + + /** + * Date and time when the file was last updated. The date and time is in ISO8601 format. + */ + public function withUpdatedAt(\DateTimeInterface $updatedAt): self + { + $obj = clone $this; + $obj->updatedAt = $updatedAt; + + return $obj; + } + + /** + * URL of the file. + */ + public function withURL(string $url): self + { + $obj = clone $this; + $obj->url = $url; + + return $obj; + } + + /** + * An object with details of the file version. + */ + public function withVersionInfo(VersionInfo $versionInfo): self + { + $obj = clone $this; + $obj->versionInfo = $versionInfo; + + return $obj; + } + + /** + * Width of the file. + */ + public function withWidth(float $width): self + { + $obj = clone $this; + $obj->width = $width; + + return $obj; + } + public function withExtensionStatus(ExtensionStatus $extensionStatus): self { $obj = clone $this; diff --git a/src/Files/FileUploadResponse.php b/src/Files/FileUploadResponse.php index d92d5898..af945619 100644 --- a/src/Files/FileUploadResponse.php +++ b/src/Files/FileUploadResponse.php @@ -40,7 +40,7 @@ * videoCodec?: string, * width?: float, * } - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/Files/Versions/VersionDeleteResponse.php b/src/Files/Versions/VersionDeleteResponse.php index 2ea1e5db..242e8ea6 100644 --- a/src/Files/Versions/VersionDeleteResponse.php +++ b/src/Files/Versions/VersionDeleteResponse.php @@ -9,7 +9,7 @@ /** * @phpstan-type version_delete_response = array{} - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/Folders/FolderCopyResponse.php b/src/Folders/FolderCopyResponse.php index d5a6e512..65246169 100644 --- a/src/Folders/FolderCopyResponse.php +++ b/src/Folders/FolderCopyResponse.php @@ -12,7 +12,7 @@ * Job submitted successfully. A `jobId` will be returned. * * @phpstan-type folder_copy_response = array{jobID: string} - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/Folders/FolderDeleteResponse.php b/src/Folders/FolderDeleteResponse.php index 76a91706..ccd5d372 100644 --- a/src/Folders/FolderDeleteResponse.php +++ b/src/Folders/FolderDeleteResponse.php @@ -9,7 +9,7 @@ /** * @phpstan-type folder_delete_response = array{} - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/Folders/FolderMoveResponse.php b/src/Folders/FolderMoveResponse.php index 4c02d487..842abe0c 100644 --- a/src/Folders/FolderMoveResponse.php +++ b/src/Folders/FolderMoveResponse.php @@ -12,7 +12,7 @@ * Job submitted successfully. A `jobId` will be returned. * * @phpstan-type folder_move_response = array{jobID: string} - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/Folders/FolderNewResponse.php b/src/Folders/FolderNewResponse.php index 40b0344b..2312ed56 100644 --- a/src/Folders/FolderNewResponse.php +++ b/src/Folders/FolderNewResponse.php @@ -9,7 +9,7 @@ /** * @phpstan-type folder_new_response = array{} - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/Folders/FolderRenameResponse.php b/src/Folders/FolderRenameResponse.php index e8913e95..13d18be4 100644 --- a/src/Folders/FolderRenameResponse.php +++ b/src/Folders/FolderRenameResponse.php @@ -12,7 +12,7 @@ * Job submitted successfully. A `jobId` will be returned. * * @phpstan-type folder_rename_response = array{jobID: string} - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/Folders/Job/JobGetResponse.php b/src/Folders/Job/JobGetResponse.php index b7c91030..18520710 100644 --- a/src/Folders/Job/JobGetResponse.php +++ b/src/Folders/Job/JobGetResponse.php @@ -17,7 +17,7 @@ * status?: value-of, * type?: value-of, * } - * When used in a response, this type parameter can be used to define a $rawResponse property. + * When used in a response, this type parameter can define a $rawResponse property. * @template TRawResponse of object = object{} * * @mixin TRawResponse diff --git a/src/ImageOverlay.php b/src/ImageOverlay.php index beae7150..e0e0cf3c 100644 --- a/src/ImageOverlay.php +++ b/src/ImageOverlay.php @@ -10,7 +10,9 @@ use ImageKit\ImageOverlay\Encoding; /** - * @phpstan-type unnamed_type_with_intersection_parent0 = array{ + * @phpstan-type image_overlay = array{ + * position?: OverlayPosition, + * timing?: OverlayTiming, * input: string, * type: string, * encoding?: value-of, @@ -19,12 +21,18 @@ */ final class ImageOverlay implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] public string $type = 'image'; + #[Api(optional: true)] + public ?OverlayPosition $position; + + #[Api(optional: true)] + public ?OverlayTiming $timing; + /** * Specifies the relative path to the image used as an overlay. */ @@ -80,6 +88,8 @@ public function __construct() */ public static function with( string $input, + ?OverlayPosition $position = null, + ?OverlayTiming $timing = null, Encoding|string|null $encoding = null, ?array $transformation = null, ): self { @@ -87,12 +97,30 @@ public static function with( $obj->input = $input; + null !== $position && $obj->position = $position; + null !== $timing && $obj->timing = $timing; null !== $encoding && $obj->encoding = $encoding instanceof Encoding ? $encoding->value : $encoding; null !== $transformation && $obj->transformation = $transformation; return $obj; } + public function withPosition(OverlayPosition $position): self + { + $obj = clone $this; + $obj->position = $position; + + return $obj; + } + + public function withTiming(OverlayTiming $timing): self + { + $obj = clone $this; + $obj->timing = $timing; + + return $obj; + } + /** * Specifies the relative path to the image used as an overlay. */ diff --git a/src/ServiceContracts/Accounts/OriginsContract.php b/src/ServiceContracts/Accounts/OriginsContract.php index 0662e5b0..f066c33a 100644 --- a/src/ServiceContracts/Accounts/OriginsContract.php +++ b/src/ServiceContracts/Accounts/OriginsContract.php @@ -12,6 +12,7 @@ use ImageKit\Accounts\Origins\OriginResponse\S3Compatible; use ImageKit\Accounts\Origins\OriginResponse\WebFolder; use ImageKit\Accounts\Origins\OriginResponse\WebProxy; +use ImageKit\Core\Exceptions\APIException; use ImageKit\RequestOptions; use const ImageKit\Core\OMIT as omit; @@ -42,6 +43,8 @@ interface OriginsContract * @param string $clientSecret akeneo API client secret * @param string $password akeneo API password * @param string $username akeneo API username + * + * @throws APIException */ public function create( $accessKey, @@ -68,6 +71,18 @@ public function create( ?RequestOptions $requestOptions = null, ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim; + /** + * @api + * + * @param array $params + * + * @throws APIException + */ + public function createRaw( + array $params, + ?RequestOptions $requestOptions = null + ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim; + /** * @api * @@ -92,6 +107,8 @@ public function create( * @param string $clientSecret akeneo API client secret * @param string $password akeneo API password * @param string $username akeneo API username + * + * @throws APIException */ public function update( string $id, @@ -119,10 +136,25 @@ public function update( ?RequestOptions $requestOptions = null, ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim; + /** + * @api + * + * @param array $params + * + * @throws APIException + */ + public function updateRaw( + string $id, + array $params, + ?RequestOptions $requestOptions = null + ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim; + /** * @api * * @return list + * + * @throws APIException */ public function list( ?RequestOptions $requestOptions = null @@ -130,6 +162,20 @@ public function list( /** * @api + * + * @return list + * + * @throws APIException + */ + public function listRaw( + mixed $params, + ?RequestOptions $requestOptions = null + ): array; + + /** + * @api + * + * @throws APIException */ public function delete( string $id, @@ -138,9 +184,33 @@ public function delete( /** * @api + * + * @throws APIException + */ + public function deleteRaw( + string $id, + mixed $params, + ?RequestOptions $requestOptions = null + ): mixed; + + /** + * @api + * + * @throws APIException */ public function get( string $id, ?RequestOptions $requestOptions = null ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim; + + /** + * @api + * + * @throws APIException + */ + public function getRaw( + string $id, + mixed $params, + ?RequestOptions $requestOptions = null + ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim; } diff --git a/src/ServiceContracts/Accounts/URLEndpointsContract.php b/src/ServiceContracts/Accounts/URLEndpointsContract.php index fa3c4c39..c3fa2a5d 100644 --- a/src/ServiceContracts/Accounts/URLEndpointsContract.php +++ b/src/ServiceContracts/Accounts/URLEndpointsContract.php @@ -11,6 +11,7 @@ use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Akamai as Akamai1; use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Cloudinary as Cloudinary1; use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Imgix as Imgix1; +use ImageKit\Core\Exceptions\APIException; use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\RequestOptions; @@ -27,6 +28,8 @@ interface URLEndpointsContract * @param Cloudinary|Imgix|Akamai $urlRewriter configuration for third-party URL rewriting * * @return URLEndpointResponse + * + * @throws APIException */ public function create( $description, @@ -36,6 +39,20 @@ public function create( ?RequestOptions $requestOptions = null, ): URLEndpointResponse; + /** + * @api + * + * @param array $params + * + * @return URLEndpointResponse + * + * @throws APIException + */ + public function createRaw( + array $params, + ?RequestOptions $requestOptions = null + ): URLEndpointResponse; + /** * @api * @@ -45,6 +62,8 @@ public function create( * @param Cloudinary1|Imgix1|Akamai1 $urlRewriter configuration for third-party URL rewriting * * @return URLEndpointResponse + * + * @throws APIException */ public function update( string $id, @@ -55,10 +74,27 @@ public function update( ?RequestOptions $requestOptions = null, ): URLEndpointResponse; + /** + * @api + * + * @param array $params + * + * @return URLEndpointResponse + * + * @throws APIException + */ + public function updateRaw( + string $id, + array $params, + ?RequestOptions $requestOptions = null + ): URLEndpointResponse; + /** * @api * * @return list + * + * @throws APIException */ public function list( ?RequestOptions $requestOptions = null @@ -66,19 +102,59 @@ public function list( /** * @api + * + * @return list + * + * @throws APIException + */ + public function listRaw( + mixed $params, + ?RequestOptions $requestOptions = null + ): array; + + /** + * @api + * + * @throws APIException */ public function delete( string $id, ?RequestOptions $requestOptions = null ): mixed; + /** + * @api + * + * @throws APIException + */ + public function deleteRaw( + string $id, + mixed $params, + ?RequestOptions $requestOptions = null + ): mixed; + /** * @api * * @return URLEndpointResponse + * + * @throws APIException */ public function get( string $id, ?RequestOptions $requestOptions = null ): URLEndpointResponse; + + /** + * @api + * + * @return URLEndpointResponse + * + * @throws APIException + */ + public function getRaw( + string $id, + mixed $params, + ?RequestOptions $requestOptions = null + ): URLEndpointResponse; } diff --git a/src/ServiceContracts/Accounts/UsageContract.php b/src/ServiceContracts/Accounts/UsageContract.php index e5394019..11aa8aaf 100644 --- a/src/ServiceContracts/Accounts/UsageContract.php +++ b/src/ServiceContracts/Accounts/UsageContract.php @@ -5,6 +5,7 @@ namespace ImageKit\ServiceContracts\Accounts; use ImageKit\Accounts\Usage\UsageGetResponse; +use ImageKit\Core\Exceptions\APIException; use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\RequestOptions; @@ -17,10 +18,26 @@ interface UsageContract * @param \DateTimeInterface $startDate Specify a `startDate` in `YYYY-MM-DD` format. It should be before the `endDate`. The difference between `startDate` and `endDate` should be less than 90 days. * * @return UsageGetResponse + * + * @throws APIException */ public function get( $endDate, $startDate, ?RequestOptions $requestOptions = null ): UsageGetResponse; + + /** + * @api + * + * @param array $params + * + * @return UsageGetResponse + * + * @throws APIException + */ + public function getRaw( + array $params, + ?RequestOptions $requestOptions = null + ): UsageGetResponse; } diff --git a/src/ServiceContracts/AssetsContract.php b/src/ServiceContracts/AssetsContract.php index 46d6c7d8..7d770c12 100644 --- a/src/ServiceContracts/AssetsContract.php +++ b/src/ServiceContracts/AssetsContract.php @@ -7,6 +7,7 @@ use ImageKit\Assets\AssetListParams\FileType; use ImageKit\Assets\AssetListParams\Sort; use ImageKit\Assets\AssetListParams\Type; +use ImageKit\Core\Exceptions\APIException; use ImageKit\Files\File; use ImageKit\Files\Folder; use ImageKit\RequestOptions; @@ -47,6 +48,8 @@ interface AssetsContract * - `all` — returns both files and folders (excludes `file-version`) * * @return list + * + * @throws APIException */ public function list( $fileType = omit, @@ -58,4 +61,18 @@ public function list( $type = omit, ?RequestOptions $requestOptions = null, ): array; + + /** + * @api + * + * @param array $params + * + * @return list + * + * @throws APIException + */ + public function listRaw( + array $params, + ?RequestOptions $requestOptions = null + ): array; } diff --git a/src/ServiceContracts/Beta/V2/FilesContract.php b/src/ServiceContracts/Beta/V2/FilesContract.php index 1c3d78cc..aa657f02 100644 --- a/src/ServiceContracts/Beta/V2/FilesContract.php +++ b/src/ServiceContracts/Beta/V2/FilesContract.php @@ -7,6 +7,7 @@ use ImageKit\Beta\V2\Files\FileUploadParams\ResponseField; use ImageKit\Beta\V2\Files\FileUploadParams\Transformation; use ImageKit\Beta\V2\Files\FileUploadResponse; +use ImageKit\Core\Exceptions\APIException; use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\ExtensionItem\AIAutoDescription; use ImageKit\ExtensionItem\AutoTaggingExtension; @@ -74,6 +75,8 @@ interface FilesContract * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. * * @return FileUploadResponse + * + * @throws APIException */ public function upload( $file, @@ -98,4 +101,18 @@ public function upload( $webhookURL = omit, ?RequestOptions $requestOptions = null, ): FileUploadResponse; + + /** + * @api + * + * @param array $params + * + * @return FileUploadResponse + * + * @throws APIException + */ + public function uploadRaw( + array $params, + ?RequestOptions $requestOptions = null + ): FileUploadResponse; } diff --git a/src/ServiceContracts/Cache/InvalidationContract.php b/src/ServiceContracts/Cache/InvalidationContract.php index 0af6ded2..647d9144 100644 --- a/src/ServiceContracts/Cache/InvalidationContract.php +++ b/src/ServiceContracts/Cache/InvalidationContract.php @@ -6,6 +6,7 @@ use ImageKit\Cache\Invalidation\InvalidationGetResponse; use ImageKit\Cache\Invalidation\InvalidationNewResponse; +use ImageKit\Core\Exceptions\APIException; use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\RequestOptions; @@ -17,19 +18,50 @@ interface InvalidationContract * @param string $url the full URL of the file to be purged * * @return InvalidationNewResponse + * + * @throws APIException */ public function create( $url, ?RequestOptions $requestOptions = null ): InvalidationNewResponse; + /** + * @api + * + * @param array $params + * + * @return InvalidationNewResponse + * + * @throws APIException + */ + public function createRaw( + array $params, + ?RequestOptions $requestOptions = null + ): InvalidationNewResponse; + /** * @api * * @return InvalidationGetResponse + * + * @throws APIException */ public function get( string $requestID, ?RequestOptions $requestOptions = null ): InvalidationGetResponse; + + /** + * @api + * + * @return InvalidationGetResponse + * + * @throws APIException + */ + public function getRaw( + string $requestID, + mixed $params, + ?RequestOptions $requestOptions = null + ): InvalidationGetResponse; } diff --git a/src/ServiceContracts/CustomMetadataFieldsContract.php b/src/ServiceContracts/CustomMetadataFieldsContract.php index a2df4699..edc8c5f6 100644 --- a/src/ServiceContracts/CustomMetadataFieldsContract.php +++ b/src/ServiceContracts/CustomMetadataFieldsContract.php @@ -4,6 +4,7 @@ namespace ImageKit\ServiceContracts; +use ImageKit\Core\Exceptions\APIException; use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\CustomMetadataFields\CustomMetadataField; use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; @@ -23,6 +24,8 @@ interface CustomMetadataFieldsContract * @param Schema $schema * * @return CustomMetadataField + * + * @throws APIException */ public function create( $label, @@ -31,6 +34,20 @@ public function create( ?RequestOptions $requestOptions = null ): CustomMetadataField; + /** + * @api + * + * @param array $params + * + * @return CustomMetadataField + * + * @throws APIException + */ + public function createRaw( + array $params, + ?RequestOptions $requestOptions = null + ): CustomMetadataField; + /** * @api * @@ -38,6 +55,8 @@ public function create( * @param Schema1 $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. * * @return CustomMetadataField + * + * @throws APIException */ public function update( string $id, @@ -46,25 +65,71 @@ public function update( ?RequestOptions $requestOptions = null, ): CustomMetadataField; + /** + * @api + * + * @param array $params + * + * @return CustomMetadataField + * + * @throws APIException + */ + public function updateRaw( + string $id, + array $params, + ?RequestOptions $requestOptions = null + ): CustomMetadataField; + /** * @api * * @param bool $includeDeleted set it to `true` to include deleted field objects in the API response * * @return list + * + * @throws APIException */ public function list( $includeDeleted = omit, ?RequestOptions $requestOptions = null ): array; + /** + * @api + * + * @param array $params + * + * @return list + * + * @throws APIException + */ + public function listRaw( + array $params, + ?RequestOptions $requestOptions = null + ): array; + /** * @api * * @return CustomMetadataFieldDeleteResponse + * + * @throws APIException */ public function delete( string $id, ?RequestOptions $requestOptions = null ): CustomMetadataFieldDeleteResponse; + + /** + * @api + * + * @return CustomMetadataFieldDeleteResponse + * + * @throws APIException + */ + public function deleteRaw( + string $id, + mixed $params, + ?RequestOptions $requestOptions = null + ): CustomMetadataFieldDeleteResponse; } diff --git a/src/ServiceContracts/Files/BulkContract.php b/src/ServiceContracts/Files/BulkContract.php index 67447c41..47ca015b 100644 --- a/src/ServiceContracts/Files/BulkContract.php +++ b/src/ServiceContracts/Files/BulkContract.php @@ -4,6 +4,7 @@ namespace ImageKit\ServiceContracts\Files; +use ImageKit\Core\Exceptions\APIException; use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\Files\Bulk\BulkAddTagsResponse; use ImageKit\Files\Bulk\BulkDeleteResponse; @@ -19,12 +20,28 @@ interface BulkContract * @param list $fileIDs an array of fileIds which you want to delete * * @return BulkDeleteResponse + * + * @throws APIException */ public function delete( $fileIDs, ?RequestOptions $requestOptions = null ): BulkDeleteResponse; + /** + * @api + * + * @param array $params + * + * @return BulkDeleteResponse + * + * @throws APIException + */ + public function deleteRaw( + array $params, + ?RequestOptions $requestOptions = null + ): BulkDeleteResponse; + /** * @api * @@ -32,6 +49,8 @@ public function delete( * @param list $tags an array of tags that you want to add to the files * * @return BulkAddTagsResponse + * + * @throws APIException */ public function addTags( $fileIDs, @@ -39,6 +58,20 @@ public function addTags( ?RequestOptions $requestOptions = null ): BulkAddTagsResponse; + /** + * @api + * + * @param array $params + * + * @return BulkAddTagsResponse + * + * @throws APIException + */ + public function addTagsRaw( + array $params, + ?RequestOptions $requestOptions = null + ): BulkAddTagsResponse; + /** * @api * @@ -46,6 +79,8 @@ public function addTags( * @param list $fileIDs an array of fileIds from which you want to remove AITags * * @return BulkRemoveAITagsResponse + * + * @throws APIException */ public function removeAITags( $aiTags, @@ -53,6 +88,20 @@ public function removeAITags( ?RequestOptions $requestOptions = null ): BulkRemoveAITagsResponse; + /** + * @api + * + * @param array $params + * + * @return BulkRemoveAITagsResponse + * + * @throws APIException + */ + public function removeAITagsRaw( + array $params, + ?RequestOptions $requestOptions = null + ): BulkRemoveAITagsResponse; + /** * @api * @@ -60,10 +109,26 @@ public function removeAITags( * @param list $tags an array of tags that you want to remove from the files * * @return BulkRemoveTagsResponse + * + * @throws APIException */ public function removeTags( $fileIDs, $tags, ?RequestOptions $requestOptions = null ): BulkRemoveTagsResponse; + + /** + * @api + * + * @param array $params + * + * @return BulkRemoveTagsResponse + * + * @throws APIException + */ + public function removeTagsRaw( + array $params, + ?RequestOptions $requestOptions = null + ): BulkRemoveTagsResponse; } diff --git a/src/ServiceContracts/Files/MetadataContract.php b/src/ServiceContracts/Files/MetadataContract.php index 615b5b4a..aef7fd6e 100644 --- a/src/ServiceContracts/Files/MetadataContract.php +++ b/src/ServiceContracts/Files/MetadataContract.php @@ -4,6 +4,7 @@ namespace ImageKit\ServiceContracts\Files; +use ImageKit\Core\Exceptions\APIException; use ImageKit\Files\Metadata; use ImageKit\RequestOptions; @@ -11,19 +12,46 @@ interface MetadataContract { /** * @api + * + * @throws APIException */ public function get( string $fileID, ?RequestOptions $requestOptions = null ): Metadata; + /** + * @api + * + * @throws APIException + */ + public function getRaw( + string $fileID, + mixed $params, + ?RequestOptions $requestOptions = null + ): Metadata; + /** * @api * * @param string $url Should be a valid file URL. It should be accessible using your ImageKit.io account. + * + * @throws APIException */ public function getFromURL( $url, ?RequestOptions $requestOptions = null ): Metadata; + + /** + * @api + * + * @param array $params + * + * @throws APIException + */ + public function getFromURLRaw( + array $params, + ?RequestOptions $requestOptions = null + ): Metadata; } diff --git a/src/ServiceContracts/Files/VersionsContract.php b/src/ServiceContracts/Files/VersionsContract.php index 2b95b688..58fd9d1c 100644 --- a/src/ServiceContracts/Files/VersionsContract.php +++ b/src/ServiceContracts/Files/VersionsContract.php @@ -4,6 +4,7 @@ namespace ImageKit\ServiceContracts\Files; +use ImageKit\Core\Exceptions\APIException; use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\Files\File; use ImageKit\Files\Versions\VersionDeleteResponse; @@ -15,18 +16,35 @@ interface VersionsContract * @api * * @return list + * + * @throws APIException */ public function list( string $fileID, ?RequestOptions $requestOptions = null ): array; + /** + * @api + * + * @return list + * + * @throws APIException + */ + public function listRaw( + string $fileID, + mixed $params, + ?RequestOptions $requestOptions = null + ): array; + /** * @api * * @param string $fileID * * @return VersionDeleteResponse + * + * @throws APIException */ public function delete( string $versionID, @@ -34,12 +52,29 @@ public function delete( ?RequestOptions $requestOptions = null ): VersionDeleteResponse; + /** + * @api + * + * @param array $params + * + * @return VersionDeleteResponse + * + * @throws APIException + */ + public function deleteRaw( + string $versionID, + array $params, + ?RequestOptions $requestOptions = null + ): VersionDeleteResponse; + /** * @api * * @param string $fileID * * @return File + * + * @throws APIException */ public function get( string $versionID, @@ -47,16 +82,48 @@ public function get( ?RequestOptions $requestOptions = null ): File; + /** + * @api + * + * @param array $params + * + * @return File + * + * @throws APIException + */ + public function getRaw( + string $versionID, + array $params, + ?RequestOptions $requestOptions = null + ): File; + /** * @api * * @param string $fileID * * @return File + * + * @throws APIException */ public function restore( string $versionID, $fileID, ?RequestOptions $requestOptions = null ): File; + + /** + * @api + * + * @param array $params + * + * @return File + * + * @throws APIException + */ + public function restoreRaw( + string $versionID, + array $params, + ?RequestOptions $requestOptions = null + ): File; } diff --git a/src/ServiceContracts/FilesContract.php b/src/ServiceContracts/FilesContract.php index 5f2c79ea..8d06b2f5 100644 --- a/src/ServiceContracts/FilesContract.php +++ b/src/ServiceContracts/FilesContract.php @@ -4,6 +4,7 @@ namespace ImageKit\ServiceContracts; +use ImageKit\Core\Exceptions\APIException; use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\ExtensionItem\AIAutoDescription; use ImageKit\ExtensionItem\AutoTaggingExtension; @@ -41,6 +42,8 @@ interface FilesContract * @param Publish $publish configure the publication status of a file and its versions * * @return FileUpdateResponse + * + * @throws APIException */ public function update( string $fileID, @@ -57,12 +60,40 @@ public function update( /** * @api + * + * @param array $params + * + * @return FileUpdateResponse + * + * @throws APIException + */ + public function updateRaw( + string $fileID, + array $params, + ?RequestOptions $requestOptions = null + ): FileUpdateResponse; + + /** + * @api + * + * @throws APIException */ public function delete( string $fileID, ?RequestOptions $requestOptions = null ): mixed; + /** + * @api + * + * @throws APIException + */ + public function deleteRaw( + string $fileID, + mixed $params, + ?RequestOptions $requestOptions = null + ): mixed; + /** * @api * @@ -71,6 +102,8 @@ public function delete( * @param bool $includeFileVersions Option to copy all versions of a file. By default, only the current version of the file is copied. When set to true, all versions of the file will be copied. Default value - `false`. * * @return FileCopyResponse + * + * @throws APIException */ public function copy( $destinationPath, @@ -79,16 +112,45 @@ public function copy( ?RequestOptions $requestOptions = null, ): FileCopyResponse; + /** + * @api + * + * @param array $params + * + * @return FileCopyResponse + * + * @throws APIException + */ + public function copyRaw( + array $params, + ?RequestOptions $requestOptions = null + ): FileCopyResponse; + /** * @api * * @return File + * + * @throws APIException */ public function get( string $fileID, ?RequestOptions $requestOptions = null ): File; + /** + * @api + * + * @return File + * + * @throws APIException + */ + public function getRaw( + string $fileID, + mixed $params, + ?RequestOptions $requestOptions = null + ): File; + /** * @api * @@ -96,6 +158,8 @@ public function get( * @param string $sourceFilePath the full path of the file you want to move * * @return FileMoveResponse + * + * @throws APIException */ public function move( $destinationPath, @@ -103,6 +167,20 @@ public function move( ?RequestOptions $requestOptions = null, ): FileMoveResponse; + /** + * @api + * + * @param array $params + * + * @return FileMoveResponse + * + * @throws APIException + */ + public function moveRaw( + array $params, + ?RequestOptions $requestOptions = null + ): FileMoveResponse; + /** * @api * @@ -120,6 +198,8 @@ public function move( * Note: If the old file were accessible at `https://ik.imagekit.io/demo/old-filename.jpg`, a purge cache request would be issued against `https://ik.imagekit.io/demo/old-filename.jpg*` (with a wildcard at the end). It will remove the file and its versions' URLs and any transformations made using query parameters on this file or its versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. * * @return FileRenameResponse + * + * @throws APIException */ public function rename( $filePath, @@ -128,6 +208,20 @@ public function rename( ?RequestOptions $requestOptions = null, ): FileRenameResponse; + /** + * @api + * + * @param array $params + * + * @return FileRenameResponse + * + * @throws APIException + */ + public function renameRaw( + array $params, + ?RequestOptions $requestOptions = null + ): FileRenameResponse; + /** * @api * @@ -205,6 +299,8 @@ public function rename( * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. * * @return FileUploadResponse + * + * @throws APIException */ public function upload( $file, @@ -232,4 +328,18 @@ public function upload( $webhookURL = omit, ?RequestOptions $requestOptions = null, ): FileUploadResponse; + + /** + * @api + * + * @param array $params + * + * @return FileUploadResponse + * + * @throws APIException + */ + public function uploadRaw( + array $params, + ?RequestOptions $requestOptions = null + ): FileUploadResponse; } diff --git a/src/ServiceContracts/Folders/JobContract.php b/src/ServiceContracts/Folders/JobContract.php index 8e59f85a..9f654bc3 100644 --- a/src/ServiceContracts/Folders/JobContract.php +++ b/src/ServiceContracts/Folders/JobContract.php @@ -4,6 +4,7 @@ namespace ImageKit\ServiceContracts\Folders; +use ImageKit\Core\Exceptions\APIException; use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\Folders\Job\JobGetResponse; use ImageKit\RequestOptions; @@ -14,9 +15,24 @@ interface JobContract * @api * * @return JobGetResponse + * + * @throws APIException */ public function get( string $jobID, ?RequestOptions $requestOptions = null ): JobGetResponse; + + /** + * @api + * + * @return JobGetResponse + * + * @throws APIException + */ + public function getRaw( + string $jobID, + mixed $params, + ?RequestOptions $requestOptions = null + ): JobGetResponse; } diff --git a/src/ServiceContracts/FoldersContract.php b/src/ServiceContracts/FoldersContract.php index e0cf7964..92279fa9 100644 --- a/src/ServiceContracts/FoldersContract.php +++ b/src/ServiceContracts/FoldersContract.php @@ -4,6 +4,7 @@ namespace ImageKit\ServiceContracts; +use ImageKit\Core\Exceptions\APIException; use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\Folders\FolderCopyResponse; use ImageKit\Folders\FolderDeleteResponse; @@ -27,6 +28,8 @@ interface FoldersContract * Note: If any folder(s) is not present in the parentFolderPath parameter, it will be automatically created. For example, if you pass `/product/images/summer`, then `product`, `images`, and `summer` folders will be created if they don't already exist. * * @return FolderNewResponse + * + * @throws APIException */ public function create( $folderName, @@ -34,18 +37,48 @@ public function create( ?RequestOptions $requestOptions = null ): FolderNewResponse; + /** + * @api + * + * @param array $params + * + * @return FolderNewResponse + * + * @throws APIException + */ + public function createRaw( + array $params, + ?RequestOptions $requestOptions = null + ): FolderNewResponse; + /** * @api * * @param string $folderPath Full path to the folder you want to delete. For example `/folder/to/delete/`. * * @return FolderDeleteResponse + * + * @throws APIException */ public function delete( $folderPath, ?RequestOptions $requestOptions = null ): FolderDeleteResponse; + /** + * @api + * + * @param array $params + * + * @return FolderDeleteResponse + * + * @throws APIException + */ + public function deleteRaw( + array $params, + ?RequestOptions $requestOptions = null + ): FolderDeleteResponse; + /** * @api * @@ -54,6 +87,8 @@ public function delete( * @param bool $includeVersions Option to copy all versions of files that are nested inside the selected folder. By default, only the current version of each file will be copied. When set to true, all versions of each file will be copied. Default value - `false`. * * @return FolderCopyResponse + * + * @throws APIException */ public function copy( $destinationPath, @@ -62,6 +97,20 @@ public function copy( ?RequestOptions $requestOptions = null, ): FolderCopyResponse; + /** + * @api + * + * @param array $params + * + * @return FolderCopyResponse + * + * @throws APIException + */ + public function copyRaw( + array $params, + ?RequestOptions $requestOptions = null + ): FolderCopyResponse; + /** * @api * @@ -69,6 +118,8 @@ public function copy( * @param string $sourceFolderPath the full path to the source folder you want to move * * @return FolderMoveResponse + * + * @throws APIException */ public function move( $destinationPath, @@ -76,6 +127,20 @@ public function move( ?RequestOptions $requestOptions = null, ): FolderMoveResponse; + /** + * @api + * + * @param array $params + * + * @return FolderMoveResponse + * + * @throws APIException + */ + public function moveRaw( + array $params, + ?RequestOptions $requestOptions = null + ): FolderMoveResponse; + /** * @api * @@ -92,6 +157,8 @@ public function move( * Default value - `false` * * @return FolderRenameResponse + * + * @throws APIException */ public function rename( $folderPath, @@ -99,4 +166,18 @@ public function rename( $purgeCache = omit, ?RequestOptions $requestOptions = null, ): FolderRenameResponse; + + /** + * @api + * + * @param array $params + * + * @return FolderRenameResponse + * + * @throws APIException + */ + public function renameRaw( + array $params, + ?RequestOptions $requestOptions = null + ): FolderRenameResponse; } diff --git a/src/Services/Accounts/OriginsService.php b/src/Services/Accounts/OriginsService.php index 17d341d7..da280a76 100644 --- a/src/Services/Accounts/OriginsService.php +++ b/src/Services/Accounts/OriginsService.php @@ -17,6 +17,7 @@ use ImageKit\Accounts\Origins\OriginUpdateParams; use ImageKit\Client; use ImageKit\Core\Conversion\ListOf; +use ImageKit\Core\Exceptions\APIException; use ImageKit\RequestOptions; use ImageKit\ServiceContracts\Accounts\OriginsContract; @@ -56,6 +57,8 @@ public function __construct(private Client $client) {} * @param string $clientSecret akeneo API client secret * @param string $password akeneo API password * @param string $username akeneo API username + * + * @throws APIException */ public function create( $accessKey, @@ -80,32 +83,48 @@ public function create( $password, $username, ?RequestOptions $requestOptions = null, + ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { + $params = [ + 'accessKey' => $accessKey, + 'bucket' => $bucket, + 'name' => $name, + 'secretKey' => $secretKey, + 'type' => $type, + 'baseURLForCanonicalHeader' => $baseURLForCanonicalHeader, + 'includeCanonicalHeader' => $includeCanonicalHeader, + 'prefix' => $prefix, + 'endpoint' => $endpoint, + 's3ForcePathStyle' => $s3ForcePathStyle, + 'baseURL' => $baseURL, + 'forwardHostHeaderToOrigin' => $forwardHostHeaderToOrigin, + 'clientEmail' => $clientEmail, + 'privateKey' => $privateKey, + 'accountName' => $accountName, + 'container' => $container, + 'sasToken' => $sasToken, + 'clientID' => $clientID, + 'clientSecret' => $clientSecret, + 'password' => $password, + 'username' => $username, + ]; + + return $this->createRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @throws APIException + */ + public function createRaw( + array $params, + ?RequestOptions $requestOptions = null ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { [$parsed, $options] = OriginCreateParams::parseRequest( - [ - 'accessKey' => $accessKey, - 'bucket' => $bucket, - 'name' => $name, - 'secretKey' => $secretKey, - 'type' => $type, - 'baseURLForCanonicalHeader' => $baseURLForCanonicalHeader, - 'includeCanonicalHeader' => $includeCanonicalHeader, - 'prefix' => $prefix, - 'endpoint' => $endpoint, - 's3ForcePathStyle' => $s3ForcePathStyle, - 'baseURL' => $baseURL, - 'forwardHostHeaderToOrigin' => $forwardHostHeaderToOrigin, - 'clientEmail' => $clientEmail, - 'privateKey' => $privateKey, - 'accountName' => $accountName, - 'container' => $container, - 'sasToken' => $sasToken, - 'clientID' => $clientID, - 'clientSecret' => $clientSecret, - 'password' => $password, - 'username' => $username, - ], - $requestOptions, + $params, + $requestOptions ); // @phpstan-ignore-next-line; @@ -145,6 +164,8 @@ public function create( * @param string $clientSecret akeneo API client secret * @param string $password akeneo API password * @param string $username akeneo API username + * + * @throws APIException */ public function update( string $id, @@ -170,32 +191,49 @@ public function update( $password, $username, ?RequestOptions $requestOptions = null, + ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { + $params = [ + 'accessKey' => $accessKey, + 'bucket' => $bucket, + 'name' => $name, + 'secretKey' => $secretKey, + 'type' => $type, + 'baseURLForCanonicalHeader' => $baseURLForCanonicalHeader, + 'includeCanonicalHeader' => $includeCanonicalHeader, + 'prefix' => $prefix, + 'endpoint' => $endpoint, + 's3ForcePathStyle' => $s3ForcePathStyle, + 'baseURL' => $baseURL, + 'forwardHostHeaderToOrigin' => $forwardHostHeaderToOrigin, + 'clientEmail' => $clientEmail, + 'privateKey' => $privateKey, + 'accountName' => $accountName, + 'container' => $container, + 'sasToken' => $sasToken, + 'clientID' => $clientID, + 'clientSecret' => $clientSecret, + 'password' => $password, + 'username' => $username, + ]; + + return $this->updateRaw($id, $params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @throws APIException + */ + public function updateRaw( + string $id, + array $params, + ?RequestOptions $requestOptions = null ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { [$parsed, $options] = OriginUpdateParams::parseRequest( - [ - 'accessKey' => $accessKey, - 'bucket' => $bucket, - 'name' => $name, - 'secretKey' => $secretKey, - 'type' => $type, - 'baseURLForCanonicalHeader' => $baseURLForCanonicalHeader, - 'includeCanonicalHeader' => $includeCanonicalHeader, - 'prefix' => $prefix, - 'endpoint' => $endpoint, - 's3ForcePathStyle' => $s3ForcePathStyle, - 'baseURL' => $baseURL, - 'forwardHostHeaderToOrigin' => $forwardHostHeaderToOrigin, - 'clientEmail' => $clientEmail, - 'privateKey' => $privateKey, - 'accountName' => $accountName, - 'container' => $container, - 'sasToken' => $sasToken, - 'clientID' => $clientID, - 'clientSecret' => $clientSecret, - 'password' => $password, - 'username' => $username, - ], - $requestOptions, + $params, + $requestOptions ); // @phpstan-ignore-next-line; @@ -215,9 +253,27 @@ public function update( * Returns an array of all configured origins for the current account. * * @return list + * + * @throws APIException */ public function list(?RequestOptions $requestOptions = null): array { + $params = []; + + return $this->listRaw($params, $requestOptions); + } + + /** + * @api + * + * @return list + * + * @throws APIException + */ + public function listRaw( + mixed $params, + ?RequestOptions $requestOptions = null + ): array { // @phpstan-ignore-next-line; return $this->client->request( method: 'get', @@ -232,10 +288,27 @@ public function list(?RequestOptions $requestOptions = null): array * * **Note:** This API is currently in beta. * Permanently removes the origin identified by `id`. If the origin is in use by any URL‑endpoints, the API will return an error. + * + * @throws APIException */ public function delete( string $id, ?RequestOptions $requestOptions = null + ): mixed { + $params = []; + + return $this->deleteRaw($id, $params, $requestOptions); + } + + /** + * @api + * + * @throws APIException + */ + public function deleteRaw( + string $id, + mixed $params, + ?RequestOptions $requestOptions = null ): mixed { // @phpstan-ignore-next-line; return $this->client->request( @@ -251,10 +324,27 @@ public function delete( * * **Note:** This API is currently in beta. * Retrieves the origin identified by `id`. + * + * @throws APIException */ public function get( string $id, ?RequestOptions $requestOptions = null + ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { + $params = []; + + return $this->getRaw($id, $params, $requestOptions); + } + + /** + * @api + * + * @throws APIException + */ + public function getRaw( + string $id, + mixed $params, + ?RequestOptions $requestOptions = null ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { // @phpstan-ignore-next-line; return $this->client->request( diff --git a/src/Services/Accounts/URLEndpointsService.php b/src/Services/Accounts/URLEndpointsService.php index dc598951..c024dfac 100644 --- a/src/Services/Accounts/URLEndpointsService.php +++ b/src/Services/Accounts/URLEndpointsService.php @@ -15,6 +15,7 @@ use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Imgix as Imgix1; use ImageKit\Client; use ImageKit\Core\Conversion\ListOf; +use ImageKit\Core\Exceptions\APIException; use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\RequestOptions; use ImageKit\ServiceContracts\Accounts\URLEndpointsContract; @@ -40,6 +41,8 @@ public function __construct(private Client $client) {} * @param Cloudinary|Imgix|Akamai $urlRewriter configuration for third-party URL rewriting * * @return URLEndpointResponse + * + * @throws APIException */ public function create( $description, @@ -47,15 +50,33 @@ public function create( $urlPrefix = omit, $urlRewriter = omit, ?RequestOptions $requestOptions = null, + ): URLEndpointResponse { + $params = [ + 'description' => $description, + 'origins' => $origins, + 'urlPrefix' => $urlPrefix, + 'urlRewriter' => $urlRewriter, + ]; + + return $this->createRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return URLEndpointResponse + * + * @throws APIException + */ + public function createRaw( + array $params, + ?RequestOptions $requestOptions = null ): URLEndpointResponse { [$parsed, $options] = URLEndpointCreateParams::parseRequest( - [ - 'description' => $description, - 'origins' => $origins, - 'urlPrefix' => $urlPrefix, - 'urlRewriter' => $urlRewriter, - ], - $requestOptions, + $params, + $requestOptions ); // @phpstan-ignore-next-line; @@ -80,6 +101,8 @@ public function create( * @param Cloudinary1|Imgix1|Akamai1 $urlRewriter configuration for third-party URL rewriting * * @return URLEndpointResponse + * + * @throws APIException */ public function update( string $id, @@ -88,15 +111,34 @@ public function update( $urlPrefix = omit, $urlRewriter = omit, ?RequestOptions $requestOptions = null, + ): URLEndpointResponse { + $params = [ + 'description' => $description, + 'origins' => $origins, + 'urlPrefix' => $urlPrefix, + 'urlRewriter' => $urlRewriter, + ]; + + return $this->updateRaw($id, $params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return URLEndpointResponse + * + * @throws APIException + */ + public function updateRaw( + string $id, + array $params, + ?RequestOptions $requestOptions = null ): URLEndpointResponse { [$parsed, $options] = URLEndpointUpdateParams::parseRequest( - [ - 'description' => $description, - 'origins' => $origins, - 'urlPrefix' => $urlPrefix, - 'urlRewriter' => $urlRewriter, - ], - $requestOptions, + $params, + $requestOptions ); // @phpstan-ignore-next-line; @@ -116,9 +158,27 @@ public function update( * Returns an array of all URL‑endpoints configured including the default URL-endpoint generated by ImageKit during account creation. * * @return list + * + * @throws APIException */ public function list(?RequestOptions $requestOptions = null): array { + $params = []; + + return $this->listRaw($params, $requestOptions); + } + + /** + * @api + * + * @return list + * + * @throws APIException + */ + public function listRaw( + mixed $params, + ?RequestOptions $requestOptions = null + ): array { // @phpstan-ignore-next-line; return $this->client->request( method: 'get', @@ -133,10 +193,27 @@ public function list(?RequestOptions $requestOptions = null): array * * **Note:** This API is currently in beta. * Deletes the URL‑endpoint identified by `id`. You cannot delete the default URL‑endpoint created by ImageKit during account creation. + * + * @throws APIException */ public function delete( string $id, ?RequestOptions $requestOptions = null + ): mixed { + $params = []; + + return $this->deleteRaw($id, $params, $requestOptions); + } + + /** + * @api + * + * @throws APIException + */ + public function deleteRaw( + string $id, + mixed $params, + ?RequestOptions $requestOptions = null ): mixed { // @phpstan-ignore-next-line; return $this->client->request( @@ -154,10 +231,29 @@ public function delete( * Retrieves the URL‑endpoint identified by `id`. * * @return URLEndpointResponse + * + * @throws APIException */ public function get( string $id, ?RequestOptions $requestOptions = null + ): URLEndpointResponse { + $params = []; + + return $this->getRaw($id, $params, $requestOptions); + } + + /** + * @api + * + * @return URLEndpointResponse + * + * @throws APIException + */ + public function getRaw( + string $id, + mixed $params, + ?RequestOptions $requestOptions = null ): URLEndpointResponse { // @phpstan-ignore-next-line; return $this->client->request( diff --git a/src/Services/Accounts/UsageService.php b/src/Services/Accounts/UsageService.php index 73f0843a..ffa44f7f 100644 --- a/src/Services/Accounts/UsageService.php +++ b/src/Services/Accounts/UsageService.php @@ -7,6 +7,7 @@ use ImageKit\Accounts\Usage\UsageGetParams; use ImageKit\Accounts\Usage\UsageGetResponse; use ImageKit\Client; +use ImageKit\Core\Exceptions\APIException; use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\RequestOptions; use ImageKit\ServiceContracts\Accounts\UsageContract; @@ -27,14 +28,34 @@ public function __construct(private Client $client) {} * @param \DateTimeInterface $startDate Specify a `startDate` in `YYYY-MM-DD` format. It should be before the `endDate`. The difference between `startDate` and `endDate` should be less than 90 days. * * @return UsageGetResponse + * + * @throws APIException */ public function get( $endDate, $startDate, ?RequestOptions $requestOptions = null + ): UsageGetResponse { + $params = ['endDate' => $endDate, 'startDate' => $startDate]; + + return $this->getRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return UsageGetResponse + * + * @throws APIException + */ + public function getRaw( + array $params, + ?RequestOptions $requestOptions = null ): UsageGetResponse { [$parsed, $options] = UsageGetParams::parseRequest( - ['endDate' => $endDate, 'startDate' => $startDate], + $params, $requestOptions ); diff --git a/src/Services/AssetsService.php b/src/Services/AssetsService.php index c065a8c9..a164b1ae 100644 --- a/src/Services/AssetsService.php +++ b/src/Services/AssetsService.php @@ -11,6 +11,7 @@ use ImageKit\Assets\AssetListResponseItem; use ImageKit\Client; use ImageKit\Core\Conversion\ListOf; +use ImageKit\Core\Exceptions\APIException; use ImageKit\Files\File; use ImageKit\Files\Folder; use ImageKit\RequestOptions; @@ -59,6 +60,8 @@ public function __construct(private Client $client) {} * - `all` — returns both files and folders (excludes `file-version`) * * @return list + * + * @throws APIException */ public function list( $fileType = omit, @@ -69,18 +72,36 @@ public function list( $sort = omit, $type = omit, ?RequestOptions $requestOptions = null, + ): array { + $params = [ + 'fileType' => $fileType, + 'limit' => $limit, + 'path' => $path, + 'searchQuery' => $searchQuery, + 'skip' => $skip, + 'sort' => $sort, + 'type' => $type, + ]; + + return $this->listRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return list + * + * @throws APIException + */ + public function listRaw( + array $params, + ?RequestOptions $requestOptions = null ): array { [$parsed, $options] = AssetListParams::parseRequest( - [ - 'fileType' => $fileType, - 'limit' => $limit, - 'path' => $path, - 'searchQuery' => $searchQuery, - 'skip' => $skip, - 'sort' => $sort, - 'type' => $type, - ], - $requestOptions, + $params, + $requestOptions ); // @phpstan-ignore-next-line; diff --git a/src/Services/Beta/V2/FilesService.php b/src/Services/Beta/V2/FilesService.php index e9c3732f..118d9abd 100644 --- a/src/Services/Beta/V2/FilesService.php +++ b/src/Services/Beta/V2/FilesService.php @@ -9,6 +9,7 @@ use ImageKit\Beta\V2\Files\FileUploadParams\Transformation; use ImageKit\Beta\V2\Files\FileUploadResponse; use ImageKit\Client; +use ImageKit\Core\Exceptions\APIException; use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\ExtensionItem\AIAutoDescription; use ImageKit\ExtensionItem\AutoTaggingExtension; @@ -97,6 +98,8 @@ public function __construct(private Client $client) {} * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. * * @return FileUploadResponse + * + * @throws APIException */ public function upload( $file, @@ -120,31 +123,49 @@ public function upload( $useUniqueFileName = omit, $webhookURL = omit, ?RequestOptions $requestOptions = null, + ): FileUploadResponse { + $params = [ + 'file' => $file, + 'fileName' => $fileName, + 'token' => $token, + 'checks' => $checks, + 'customCoordinates' => $customCoordinates, + 'customMetadata' => $customMetadata, + 'description' => $description, + 'extensions' => $extensions, + 'folder' => $folder, + 'isPrivateFile' => $isPrivateFile, + 'isPublished' => $isPublished, + 'overwriteAITags' => $overwriteAITags, + 'overwriteCustomMetadata' => $overwriteCustomMetadata, + 'overwriteFile' => $overwriteFile, + 'overwriteTags' => $overwriteTags, + 'responseFields' => $responseFields, + 'tags' => $tags, + 'transformation' => $transformation, + 'useUniqueFileName' => $useUniqueFileName, + 'webhookURL' => $webhookURL, + ]; + + return $this->uploadRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return FileUploadResponse + * + * @throws APIException + */ + public function uploadRaw( + array $params, + ?RequestOptions $requestOptions = null ): FileUploadResponse { [$parsed, $options] = FileUploadParams::parseRequest( - [ - 'file' => $file, - 'fileName' => $fileName, - 'token' => $token, - 'checks' => $checks, - 'customCoordinates' => $customCoordinates, - 'customMetadata' => $customMetadata, - 'description' => $description, - 'extensions' => $extensions, - 'folder' => $folder, - 'isPrivateFile' => $isPrivateFile, - 'isPublished' => $isPublished, - 'overwriteAITags' => $overwriteAITags, - 'overwriteCustomMetadata' => $overwriteCustomMetadata, - 'overwriteFile' => $overwriteFile, - 'overwriteTags' => $overwriteTags, - 'responseFields' => $responseFields, - 'tags' => $tags, - 'transformation' => $transformation, - 'useUniqueFileName' => $useUniqueFileName, - 'webhookURL' => $webhookURL, - ], - $requestOptions, + $params, + $requestOptions ); $path = $this ->client diff --git a/src/Services/Cache/InvalidationService.php b/src/Services/Cache/InvalidationService.php index e4038f16..201b1066 100644 --- a/src/Services/Cache/InvalidationService.php +++ b/src/Services/Cache/InvalidationService.php @@ -8,6 +8,7 @@ use ImageKit\Cache\Invalidation\InvalidationGetResponse; use ImageKit\Cache\Invalidation\InvalidationNewResponse; use ImageKit\Client; +use ImageKit\Core\Exceptions\APIException; use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\RequestOptions; use ImageKit\ServiceContracts\Cache\InvalidationContract; @@ -27,13 +28,33 @@ public function __construct(private Client $client) {} * @param string $url the full URL of the file to be purged * * @return InvalidationNewResponse + * + * @throws APIException */ public function create( $url, ?RequestOptions $requestOptions = null + ): InvalidationNewResponse { + $params = ['url' => $url]; + + return $this->createRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return InvalidationNewResponse + * + * @throws APIException + */ + public function createRaw( + array $params, + ?RequestOptions $requestOptions = null ): InvalidationNewResponse { [$parsed, $options] = InvalidationCreateParams::parseRequest( - ['url' => $url], + $params, $requestOptions ); @@ -53,10 +74,29 @@ public function create( * This API returns the status of a purge cache request. * * @return InvalidationGetResponse + * + * @throws APIException */ public function get( string $requestID, ?RequestOptions $requestOptions = null + ): InvalidationGetResponse { + $params = []; + + return $this->getRaw($requestID, $params, $requestOptions); + } + + /** + * @api + * + * @return InvalidationGetResponse + * + * @throws APIException + */ + public function getRaw( + string $requestID, + mixed $params, + ?RequestOptions $requestOptions = null ): InvalidationGetResponse { // @phpstan-ignore-next-line; return $this->client->request( diff --git a/src/Services/CustomMetadataFieldsService.php b/src/Services/CustomMetadataFieldsService.php index 1bc4a815..486ddc62 100644 --- a/src/Services/CustomMetadataFieldsService.php +++ b/src/Services/CustomMetadataFieldsService.php @@ -6,6 +6,7 @@ use ImageKit\Client; use ImageKit\Core\Conversion\ListOf; +use ImageKit\Core\Exceptions\APIException; use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\CustomMetadataFields\CustomMetadataField; use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams; @@ -36,15 +37,35 @@ public function __construct(private Client $client) {} * @param Schema $schema * * @return CustomMetadataField + * + * @throws APIException */ public function create( $label, $name, $schema, ?RequestOptions $requestOptions = null + ): CustomMetadataField { + $params = ['label' => $label, 'name' => $name, 'schema' => $schema]; + + return $this->createRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return CustomMetadataField + * + * @throws APIException + */ + public function createRaw( + array $params, + ?RequestOptions $requestOptions = null ): CustomMetadataField { [$parsed, $options] = CustomMetadataFieldCreateParams::parseRequest( - ['label' => $label, 'name' => $name, 'schema' => $schema], + $params, $requestOptions ); @@ -67,15 +88,36 @@ public function create( * @param Schema1 $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. * * @return CustomMetadataField + * + * @throws APIException */ public function update( string $id, $label = omit, $schema = omit, ?RequestOptions $requestOptions = null, + ): CustomMetadataField { + $params = ['label' => $label, 'schema' => $schema]; + + return $this->updateRaw($id, $params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return CustomMetadataField + * + * @throws APIException + */ + public function updateRaw( + string $id, + array $params, + ?RequestOptions $requestOptions = null ): CustomMetadataField { [$parsed, $options] = CustomMetadataFieldUpdateParams::parseRequest( - ['label' => $label, 'schema' => $schema], + $params, $requestOptions ); @@ -97,13 +139,33 @@ public function update( * @param bool $includeDeleted set it to `true` to include deleted field objects in the API response * * @return list + * + * @throws APIException */ public function list( $includeDeleted = omit, ?RequestOptions $requestOptions = null + ): array { + $params = ['includeDeleted' => $includeDeleted]; + + return $this->listRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return list + * + * @throws APIException + */ + public function listRaw( + array $params, + ?RequestOptions $requestOptions = null ): array { [$parsed, $options] = CustomMetadataFieldListParams::parseRequest( - ['includeDeleted' => $includeDeleted], + $params, $requestOptions ); @@ -123,10 +185,29 @@ public function list( * This API deletes a custom metadata field. Even after deleting a custom metadata field, you cannot create any new custom metadata field with the same name. * * @return CustomMetadataFieldDeleteResponse + * + * @throws APIException */ public function delete( string $id, ?RequestOptions $requestOptions = null + ): CustomMetadataFieldDeleteResponse { + $params = []; + + return $this->deleteRaw($id, $params, $requestOptions); + } + + /** + * @api + * + * @return CustomMetadataFieldDeleteResponse + * + * @throws APIException + */ + public function deleteRaw( + string $id, + mixed $params, + ?RequestOptions $requestOptions = null ): CustomMetadataFieldDeleteResponse { // @phpstan-ignore-next-line; return $this->client->request( diff --git a/src/Services/Files/BulkService.php b/src/Services/Files/BulkService.php index de2b2073..875acc36 100644 --- a/src/Services/Files/BulkService.php +++ b/src/Services/Files/BulkService.php @@ -5,6 +5,7 @@ namespace ImageKit\Services\Files; use ImageKit\Client; +use ImageKit\Core\Exceptions\APIException; use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\Files\Bulk\BulkAddTagsParams; use ImageKit\Files\Bulk\BulkAddTagsResponse; @@ -36,13 +37,33 @@ public function __construct(private Client $client) {} * @param list $fileIDs an array of fileIds which you want to delete * * @return BulkDeleteResponse + * + * @throws APIException */ public function delete( $fileIDs, ?RequestOptions $requestOptions = null + ): BulkDeleteResponse { + $params = ['fileIDs' => $fileIDs]; + + return $this->deleteRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return BulkDeleteResponse + * + * @throws APIException + */ + public function deleteRaw( + array $params, + ?RequestOptions $requestOptions = null ): BulkDeleteResponse { [$parsed, $options] = BulkDeleteParams::parseRequest( - ['fileIDs' => $fileIDs], + $params, $requestOptions ); @@ -65,14 +86,34 @@ public function delete( * @param list $tags an array of tags that you want to add to the files * * @return BulkAddTagsResponse + * + * @throws APIException */ public function addTags( $fileIDs, $tags, ?RequestOptions $requestOptions = null + ): BulkAddTagsResponse { + $params = ['fileIDs' => $fileIDs, 'tags' => $tags]; + + return $this->addTagsRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return BulkAddTagsResponse + * + * @throws APIException + */ + public function addTagsRaw( + array $params, + ?RequestOptions $requestOptions = null ): BulkAddTagsResponse { [$parsed, $options] = BulkAddTagsParams::parseRequest( - ['fileIDs' => $fileIDs, 'tags' => $tags], + $params, $requestOptions ); @@ -95,14 +136,34 @@ public function addTags( * @param list $fileIDs an array of fileIds from which you want to remove AITags * * @return BulkRemoveAITagsResponse + * + * @throws APIException */ public function removeAITags( $aiTags, $fileIDs, ?RequestOptions $requestOptions = null + ): BulkRemoveAITagsResponse { + $params = ['aiTags' => $aiTags, 'fileIDs' => $fileIDs]; + + return $this->removeAITagsRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return BulkRemoveAITagsResponse + * + * @throws APIException + */ + public function removeAITagsRaw( + array $params, + ?RequestOptions $requestOptions = null ): BulkRemoveAITagsResponse { [$parsed, $options] = BulkRemoveAITagsParams::parseRequest( - ['aiTags' => $aiTags, 'fileIDs' => $fileIDs], + $params, $requestOptions ); @@ -125,14 +186,34 @@ public function removeAITags( * @param list $tags an array of tags that you want to remove from the files * * @return BulkRemoveTagsResponse + * + * @throws APIException */ public function removeTags( $fileIDs, $tags, ?RequestOptions $requestOptions = null + ): BulkRemoveTagsResponse { + $params = ['fileIDs' => $fileIDs, 'tags' => $tags]; + + return $this->removeTagsRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return BulkRemoveTagsResponse + * + * @throws APIException + */ + public function removeTagsRaw( + array $params, + ?RequestOptions $requestOptions = null ): BulkRemoveTagsResponse { [$parsed, $options] = BulkRemoveTagsParams::parseRequest( - ['fileIDs' => $fileIDs, 'tags' => $tags], + $params, $requestOptions ); diff --git a/src/Services/Files/MetadataService.php b/src/Services/Files/MetadataService.php index 6d94f3f3..89fe3392 100644 --- a/src/Services/Files/MetadataService.php +++ b/src/Services/Files/MetadataService.php @@ -5,6 +5,7 @@ namespace ImageKit\Services\Files; use ImageKit\Client; +use ImageKit\Core\Exceptions\APIException; use ImageKit\Files\Metadata; use ImageKit\Files\Metadata\MetadataGetFromURLParams; use ImageKit\RequestOptions; @@ -23,10 +24,27 @@ public function __construct(private Client $client) {} * You can programmatically get image EXIF, pHash, and other metadata for uploaded files in the ImageKit.io media library using this API. * * You can also get the metadata in upload API response by passing `metadata` in `responseFields` parameter. + * + * @throws APIException */ public function get( string $fileID, ?RequestOptions $requestOptions = null + ): Metadata { + $params = []; + + return $this->getRaw($fileID, $params, $requestOptions); + } + + /** + * @api + * + * @throws APIException + */ + public function getRaw( + string $fileID, + mixed $params, + ?RequestOptions $requestOptions = null ): Metadata { // @phpstan-ignore-next-line; return $this->client->request( @@ -43,13 +61,31 @@ public function get( * Get image EXIF, pHash, and other metadata from ImageKit.io powered remote URL using this API. * * @param string $url Should be a valid file URL. It should be accessible using your ImageKit.io account. + * + * @throws APIException */ public function getFromURL( $url, ?RequestOptions $requestOptions = null + ): Metadata { + $params = ['url' => $url]; + + return $this->getFromURLRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @throws APIException + */ + public function getFromURLRaw( + array $params, + ?RequestOptions $requestOptions = null ): Metadata { [$parsed, $options] = MetadataGetFromURLParams::parseRequest( - ['url' => $url], + $params, $requestOptions ); diff --git a/src/Services/Files/VersionsService.php b/src/Services/Files/VersionsService.php index efaed2f4..93fe964f 100644 --- a/src/Services/Files/VersionsService.php +++ b/src/Services/Files/VersionsService.php @@ -6,6 +6,7 @@ use ImageKit\Client; use ImageKit\Core\Conversion\ListOf; +use ImageKit\Core\Exceptions\APIException; use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\Files\File; use ImageKit\Files\Versions\VersionDeleteParams; @@ -28,10 +29,29 @@ public function __construct(private Client $client) {} * This API returns details of all versions of a file. * * @return list + * + * @throws APIException */ public function list( string $fileID, ?RequestOptions $requestOptions = null + ): array { + $params = []; + + return $this->listRaw($fileID, $params, $requestOptions); + } + + /** + * @api + * + * @return list + * + * @throws APIException + */ + public function listRaw( + string $fileID, + mixed $params, + ?RequestOptions $requestOptions = null ): array { // @phpstan-ignore-next-line; return $this->client->request( @@ -52,14 +72,35 @@ public function list( * @param string $fileID * * @return VersionDeleteResponse + * + * @throws APIException */ public function delete( string $versionID, $fileID, ?RequestOptions $requestOptions = null + ): VersionDeleteResponse { + $params = ['fileID' => $fileID]; + + return $this->deleteRaw($versionID, $params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return VersionDeleteResponse + * + * @throws APIException + */ + public function deleteRaw( + string $versionID, + array $params, + ?RequestOptions $requestOptions = null ): VersionDeleteResponse { [$parsed, $options] = VersionDeleteParams::parseRequest( - ['fileID' => $fileID], + $params, $requestOptions ); $fileID = $parsed['fileID']; @@ -82,14 +123,35 @@ public function delete( * @param string $fileID * * @return File + * + * @throws APIException */ public function get( string $versionID, $fileID, ?RequestOptions $requestOptions = null + ): File { + $params = ['fileID' => $fileID]; + + return $this->getRaw($versionID, $params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return File + * + * @throws APIException + */ + public function getRaw( + string $versionID, + array $params, + ?RequestOptions $requestOptions = null ): File { [$parsed, $options] = VersionGetParams::parseRequest( - ['fileID' => $fileID], + $params, $requestOptions ); $fileID = $parsed['fileID']; @@ -112,14 +174,35 @@ public function get( * @param string $fileID * * @return File + * + * @throws APIException */ public function restore( string $versionID, $fileID, ?RequestOptions $requestOptions = null + ): File { + $params = ['fileID' => $fileID]; + + return $this->restoreRaw($versionID, $params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return File + * + * @throws APIException + */ + public function restoreRaw( + string $versionID, + array $params, + ?RequestOptions $requestOptions = null ): File { [$parsed, $options] = VersionRestoreParams::parseRequest( - ['fileID' => $fileID], + $params, $requestOptions ); $fileID = $parsed['fileID']; diff --git a/src/Services/FilesService.php b/src/Services/FilesService.php index 3e5f6af1..6d9a729e 100644 --- a/src/Services/FilesService.php +++ b/src/Services/FilesService.php @@ -5,6 +5,7 @@ namespace ImageKit\Services; use ImageKit\Client; +use ImageKit\Core\Exceptions\APIException; use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\ExtensionItem\AIAutoDescription; use ImageKit\ExtensionItem\AutoTaggingExtension; @@ -78,6 +79,8 @@ public function __construct(private Client $client) * @param Publish $publish configure the publication status of a file and its versions * * @return FileUpdateResponse + * + * @throws APIException */ public function update( string $fileID, @@ -90,19 +93,38 @@ public function update( $webhookURL = omit, $publish = omit, ?RequestOptions $requestOptions = null, + ): FileUpdateResponse { + $params = [ + 'customCoordinates' => $customCoordinates, + 'customMetadata' => $customMetadata, + 'description' => $description, + 'extensions' => $extensions, + 'removeAITags' => $removeAITags, + 'tags' => $tags, + 'webhookURL' => $webhookURL, + 'publish' => $publish, + ]; + + return $this->updateRaw($fileID, $params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return FileUpdateResponse + * + * @throws APIException + */ + public function updateRaw( + string $fileID, + array $params, + ?RequestOptions $requestOptions = null ): FileUpdateResponse { [$parsed, $options] = FileUpdateParams::parseRequest( - [ - 'customCoordinates' => $customCoordinates, - 'customMetadata' => $customMetadata, - 'description' => $description, - 'extensions' => $extensions, - 'removeAITags' => $removeAITags, - 'tags' => $tags, - 'webhookURL' => $webhookURL, - 'publish' => $publish, - ], - $requestOptions, + $params, + $requestOptions ); // @phpstan-ignore-next-line; @@ -121,10 +143,27 @@ public function update( * This API deletes the file and all its file versions permanently. * * Note: If a file or specific transformation has been requested in the past, then the response is cached. Deleting a file does not purge the cache. You can purge the cache using purge cache API. + * + * @throws APIException */ public function delete( string $fileID, ?RequestOptions $requestOptions = null + ): mixed { + $params = []; + + return $this->deleteRaw($fileID, $params, $requestOptions); + } + + /** + * @api + * + * @throws APIException + */ + public function deleteRaw( + string $fileID, + mixed $params, + ?RequestOptions $requestOptions = null ): mixed { // @phpstan-ignore-next-line; return $this->client->request( @@ -147,20 +186,40 @@ public function delete( * @param bool $includeFileVersions Option to copy all versions of a file. By default, only the current version of the file is copied. When set to true, all versions of the file will be copied. Default value - `false`. * * @return FileCopyResponse + * + * @throws APIException */ public function copy( $destinationPath, $sourceFilePath, $includeFileVersions = omit, ?RequestOptions $requestOptions = null, + ): FileCopyResponse { + $params = [ + 'destinationPath' => $destinationPath, + 'sourceFilePath' => $sourceFilePath, + 'includeFileVersions' => $includeFileVersions, + ]; + + return $this->copyRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return FileCopyResponse + * + * @throws APIException + */ + public function copyRaw( + array $params, + ?RequestOptions $requestOptions = null ): FileCopyResponse { [$parsed, $options] = FileCopyParams::parseRequest( - [ - 'destinationPath' => $destinationPath, - 'sourceFilePath' => $sourceFilePath, - 'includeFileVersions' => $includeFileVersions, - ], - $requestOptions, + $params, + $requestOptions ); // @phpstan-ignore-next-line; @@ -179,10 +238,29 @@ public function copy( * This API returns an object with details or attributes about the current version of the file. * * @return File + * + * @throws APIException */ public function get( string $fileID, ?RequestOptions $requestOptions = null + ): File { + $params = []; + + return $this->getRaw($fileID, $params, $requestOptions); + } + + /** + * @api + * + * @return File + * + * @throws APIException + */ + public function getRaw( + string $fileID, + mixed $params, + ?RequestOptions $requestOptions = null ): File { // @phpstan-ignore-next-line; return $this->client->request( @@ -204,18 +282,37 @@ public function get( * @param string $sourceFilePath the full path of the file you want to move * * @return FileMoveResponse + * + * @throws APIException */ public function move( $destinationPath, $sourceFilePath, ?RequestOptions $requestOptions = null + ): FileMoveResponse { + $params = [ + 'destinationPath' => $destinationPath, 'sourceFilePath' => $sourceFilePath, + ]; + + return $this->moveRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return FileMoveResponse + * + * @throws APIException + */ + public function moveRaw( + array $params, + ?RequestOptions $requestOptions = null ): FileMoveResponse { [$parsed, $options] = FileMoveParams::parseRequest( - [ - 'destinationPath' => $destinationPath, - 'sourceFilePath' => $sourceFilePath, - ], - $requestOptions, + $params, + $requestOptions ); // @phpstan-ignore-next-line; @@ -249,20 +346,40 @@ public function move( * Note: If the old file were accessible at `https://ik.imagekit.io/demo/old-filename.jpg`, a purge cache request would be issued against `https://ik.imagekit.io/demo/old-filename.jpg*` (with a wildcard at the end). It will remove the file and its versions' URLs and any transformations made using query parameters on this file or its versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. * * @return FileRenameResponse + * + * @throws APIException */ public function rename( $filePath, $newFileName, $purgeCache = omit, ?RequestOptions $requestOptions = null, + ): FileRenameResponse { + $params = [ + 'filePath' => $filePath, + 'newFileName' => $newFileName, + 'purgeCache' => $purgeCache, + ]; + + return $this->renameRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return FileRenameResponse + * + * @throws APIException + */ + public function renameRaw( + array $params, + ?RequestOptions $requestOptions = null ): FileRenameResponse { [$parsed, $options] = FileRenameParams::parseRequest( - [ - 'filePath' => $filePath, - 'newFileName' => $newFileName, - 'purgeCache' => $purgeCache, - ], - $requestOptions, + $params, + $requestOptions ); // @phpstan-ignore-next-line; @@ -367,6 +484,8 @@ public function rename( * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. * * @return FileUploadResponse + * + * @throws APIException */ public function upload( $file, @@ -393,34 +512,52 @@ public function upload( $useUniqueFileName = omit, $webhookURL = omit, ?RequestOptions $requestOptions = null, + ): FileUploadResponse { + $params = [ + 'file' => $file, + 'fileName' => $fileName, + 'token' => $token, + 'checks' => $checks, + 'customCoordinates' => $customCoordinates, + 'customMetadata' => $customMetadata, + 'description' => $description, + 'expire' => $expire, + 'extensions' => $extensions, + 'folder' => $folder, + 'isPrivateFile' => $isPrivateFile, + 'isPublished' => $isPublished, + 'overwriteAITags' => $overwriteAITags, + 'overwriteCustomMetadata' => $overwriteCustomMetadata, + 'overwriteFile' => $overwriteFile, + 'overwriteTags' => $overwriteTags, + 'publicKey' => $publicKey, + 'responseFields' => $responseFields, + 'signature' => $signature, + 'tags' => $tags, + 'transformation' => $transformation, + 'useUniqueFileName' => $useUniqueFileName, + 'webhookURL' => $webhookURL, + ]; + + return $this->uploadRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return FileUploadResponse + * + * @throws APIException + */ + public function uploadRaw( + array $params, + ?RequestOptions $requestOptions = null ): FileUploadResponse { [$parsed, $options] = FileUploadParams::parseRequest( - [ - 'file' => $file, - 'fileName' => $fileName, - 'token' => $token, - 'checks' => $checks, - 'customCoordinates' => $customCoordinates, - 'customMetadata' => $customMetadata, - 'description' => $description, - 'expire' => $expire, - 'extensions' => $extensions, - 'folder' => $folder, - 'isPrivateFile' => $isPrivateFile, - 'isPublished' => $isPublished, - 'overwriteAITags' => $overwriteAITags, - 'overwriteCustomMetadata' => $overwriteCustomMetadata, - 'overwriteFile' => $overwriteFile, - 'overwriteTags' => $overwriteTags, - 'publicKey' => $publicKey, - 'responseFields' => $responseFields, - 'signature' => $signature, - 'tags' => $tags, - 'transformation' => $transformation, - 'useUniqueFileName' => $useUniqueFileName, - 'webhookURL' => $webhookURL, - ], - $requestOptions, + $params, + $requestOptions ); $path = $this ->client diff --git a/src/Services/Folders/JobService.php b/src/Services/Folders/JobService.php index b525dda7..d62b1c6f 100644 --- a/src/Services/Folders/JobService.php +++ b/src/Services/Folders/JobService.php @@ -5,6 +5,7 @@ namespace ImageKit\Services\Folders; use ImageKit\Client; +use ImageKit\Core\Exceptions\APIException; use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\Folders\Job\JobGetResponse; use ImageKit\RequestOptions; @@ -23,10 +24,29 @@ public function __construct(private Client $client) {} * This API returns the status of a bulk job like copy and move folder operations. * * @return JobGetResponse + * + * @throws APIException */ public function get( string $jobID, ?RequestOptions $requestOptions = null + ): JobGetResponse { + $params = []; + + return $this->getRaw($jobID, $params, $requestOptions); + } + + /** + * @api + * + * @return JobGetResponse + * + * @throws APIException + */ + public function getRaw( + string $jobID, + mixed $params, + ?RequestOptions $requestOptions = null ): JobGetResponse { // @phpstan-ignore-next-line; return $this->client->request( diff --git a/src/Services/FoldersService.php b/src/Services/FoldersService.php index d4f5d8e9..cbb81c96 100644 --- a/src/Services/FoldersService.php +++ b/src/Services/FoldersService.php @@ -5,6 +5,7 @@ namespace ImageKit\Services; use ImageKit\Client; +use ImageKit\Core\Exceptions\APIException; use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\Folders\FolderCopyParams; use ImageKit\Folders\FolderCopyResponse; @@ -50,15 +51,37 @@ public function __construct(private Client $client) * Note: If any folder(s) is not present in the parentFolderPath parameter, it will be automatically created. For example, if you pass `/product/images/summer`, then `product`, `images`, and `summer` folders will be created if they don't already exist. * * @return FolderNewResponse + * + * @throws APIException */ public function create( $folderName, $parentFolderPath, ?RequestOptions $requestOptions = null + ): FolderNewResponse { + $params = [ + 'folderName' => $folderName, 'parentFolderPath' => $parentFolderPath, + ]; + + return $this->createRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return FolderNewResponse + * + * @throws APIException + */ + public function createRaw( + array $params, + ?RequestOptions $requestOptions = null ): FolderNewResponse { [$parsed, $options] = FolderCreateParams::parseRequest( - ['folderName' => $folderName, 'parentFolderPath' => $parentFolderPath], - $requestOptions, + $params, + $requestOptions ); // @phpstan-ignore-next-line; @@ -79,13 +102,33 @@ public function create( * @param string $folderPath Full path to the folder you want to delete. For example `/folder/to/delete/`. * * @return FolderDeleteResponse + * + * @throws APIException */ public function delete( $folderPath, ?RequestOptions $requestOptions = null + ): FolderDeleteResponse { + $params = ['folderPath' => $folderPath]; + + return $this->deleteRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return FolderDeleteResponse + * + * @throws APIException + */ + public function deleteRaw( + array $params, + ?RequestOptions $requestOptions = null ): FolderDeleteResponse { [$parsed, $options] = FolderDeleteParams::parseRequest( - ['folderPath' => $folderPath], + $params, $requestOptions ); @@ -109,20 +152,40 @@ public function delete( * @param bool $includeVersions Option to copy all versions of files that are nested inside the selected folder. By default, only the current version of each file will be copied. When set to true, all versions of each file will be copied. Default value - `false`. * * @return FolderCopyResponse + * + * @throws APIException */ public function copy( $destinationPath, $sourceFolderPath, $includeVersions = omit, ?RequestOptions $requestOptions = null, + ): FolderCopyResponse { + $params = [ + 'destinationPath' => $destinationPath, + 'sourceFolderPath' => $sourceFolderPath, + 'includeVersions' => $includeVersions, + ]; + + return $this->copyRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return FolderCopyResponse + * + * @throws APIException + */ + public function copyRaw( + array $params, + ?RequestOptions $requestOptions = null ): FolderCopyResponse { [$parsed, $options] = FolderCopyParams::parseRequest( - [ - 'destinationPath' => $destinationPath, - 'sourceFolderPath' => $sourceFolderPath, - 'includeVersions' => $includeVersions, - ], - $requestOptions, + $params, + $requestOptions ); // @phpstan-ignore-next-line; @@ -144,18 +207,38 @@ public function copy( * @param string $sourceFolderPath the full path to the source folder you want to move * * @return FolderMoveResponse + * + * @throws APIException */ public function move( $destinationPath, $sourceFolderPath, ?RequestOptions $requestOptions = null + ): FolderMoveResponse { + $params = [ + 'destinationPath' => $destinationPath, + 'sourceFolderPath' => $sourceFolderPath, + ]; + + return $this->moveRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return FolderMoveResponse + * + * @throws APIException + */ + public function moveRaw( + array $params, + ?RequestOptions $requestOptions = null ): FolderMoveResponse { [$parsed, $options] = FolderMoveParams::parseRequest( - [ - 'destinationPath' => $destinationPath, - 'sourceFolderPath' => $sourceFolderPath, - ], - $requestOptions, + $params, + $requestOptions ); // @phpstan-ignore-next-line; @@ -186,20 +269,40 @@ public function move( * Default value - `false` * * @return FolderRenameResponse + * + * @throws APIException */ public function rename( $folderPath, $newFolderName, $purgeCache = omit, ?RequestOptions $requestOptions = null, + ): FolderRenameResponse { + $params = [ + 'folderPath' => $folderPath, + 'newFolderName' => $newFolderName, + 'purgeCache' => $purgeCache, + ]; + + return $this->renameRaw($params, $requestOptions); + } + + /** + * @api + * + * @param array $params + * + * @return FolderRenameResponse + * + * @throws APIException + */ + public function renameRaw( + array $params, + ?RequestOptions $requestOptions = null ): FolderRenameResponse { [$parsed, $options] = FolderRenameParams::parseRequest( - [ - 'folderPath' => $folderPath, - 'newFolderName' => $newFolderName, - 'purgeCache' => $purgeCache, - ], - $requestOptions, + $params, + $requestOptions ); // @phpstan-ignore-next-line; diff --git a/src/SolidColorOverlay.php b/src/SolidColorOverlay.php index a979ac98..4d70d94b 100644 --- a/src/SolidColorOverlay.php +++ b/src/SolidColorOverlay.php @@ -9,7 +9,9 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type unnamed_type_with_intersection_parent1 = array{ + * @phpstan-type solid_color_overlay = array{ + * position?: OverlayPosition, + * timing?: OverlayTiming, * color: string, * type: string, * transformation?: list, @@ -17,12 +19,18 @@ */ final class SolidColorOverlay implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] public string $type = 'solidColor'; + #[Api(optional: true)] + public ?OverlayPosition $position; + + #[Api(optional: true)] + public ?OverlayTiming $timing; + /** * Specifies the color of the block using an RGB hex code (e.g., `FF0000`), an RGBA code (e.g., `FFAABB50`), or a color name (e.g., `red`). * If an 8-character value is provided, the last two characters represent the opacity level (from `00` for 0.00 to `99` for 0.99). @@ -67,17 +75,37 @@ public function __construct() */ public static function with( string $color, - ?array $transformation = null + ?OverlayPosition $position = null, + ?OverlayTiming $timing = null, + ?array $transformation = null, ): self { $obj = new self; $obj->color = $color; + null !== $position && $obj->position = $position; + null !== $timing && $obj->timing = $timing; null !== $transformation && $obj->transformation = $transformation; return $obj; } + public function withPosition(OverlayPosition $position): self + { + $obj = clone $this; + $obj->position = $position; + + return $obj; + } + + public function withTiming(OverlayTiming $timing): self + { + $obj = clone $this; + $obj->timing = $timing; + + return $obj; + } + /** * Specifies the color of the block using an RGB hex code (e.g., `FF0000`), an RGBA code (e.g., `FFAABB50`), or a color name (e.g., `red`). * If an 8-character value is provided, the last two characters represent the opacity level (from `00` for 0.00 to `99` for 0.99). diff --git a/src/SubtitleOverlay.php b/src/SubtitleOverlay.php index 79c765b4..95623fb8 100644 --- a/src/SubtitleOverlay.php +++ b/src/SubtitleOverlay.php @@ -10,7 +10,9 @@ use ImageKit\SubtitleOverlay\Encoding; /** - * @phpstan-type unnamed_type_with_intersection_parent2 = array{ + * @phpstan-type subtitle_overlay = array{ + * position?: OverlayPosition, + * timing?: OverlayTiming, * input: string, * type: string, * encoding?: value-of, @@ -19,12 +21,18 @@ */ final class SubtitleOverlay implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] public string $type = 'subtitle'; + #[Api(optional: true)] + public ?OverlayPosition $position; + + #[Api(optional: true)] + public ?OverlayTiming $timing; + /** * Specifies the relative path to the subtitle file used as an overlay. */ @@ -79,6 +87,8 @@ public function __construct() */ public static function with( string $input, + ?OverlayPosition $position = null, + ?OverlayTiming $timing = null, Encoding|string|null $encoding = null, ?array $transformation = null, ): self { @@ -86,12 +96,30 @@ public static function with( $obj->input = $input; + null !== $position && $obj->position = $position; + null !== $timing && $obj->timing = $timing; null !== $encoding && $obj->encoding = $encoding instanceof Encoding ? $encoding->value : $encoding; null !== $transformation && $obj->transformation = $transformation; return $obj; } + public function withPosition(OverlayPosition $position): self + { + $obj = clone $this; + $obj->position = $position; + + return $obj; + } + + public function withTiming(OverlayTiming $timing): self + { + $obj = clone $this; + $obj->timing = $timing; + + return $obj; + } + /** * Specifies the relative path to the subtitle file used as an overlay. */ diff --git a/src/TextOverlay.php b/src/TextOverlay.php index b5747018..85e12507 100644 --- a/src/TextOverlay.php +++ b/src/TextOverlay.php @@ -10,7 +10,9 @@ use ImageKit\TextOverlay\Encoding; /** - * @phpstan-type unnamed_type_with_intersection_parent3 = array{ + * @phpstan-type text_overlay = array{ + * position?: OverlayPosition, + * timing?: OverlayTiming, * text: string, * type: string, * encoding?: value-of, @@ -19,12 +21,18 @@ */ final class TextOverlay implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] public string $type = 'text'; + #[Api(optional: true)] + public ?OverlayPosition $position; + + #[Api(optional: true)] + public ?OverlayTiming $timing; + /** * Specifies the text to be displayed in the overlay. The SDK automatically handles special characters and encoding. */ @@ -79,19 +87,39 @@ public function __construct() */ public static function with( string $text, + ?OverlayPosition $position = null, + ?OverlayTiming $timing = null, Encoding|string|null $encoding = null, - ?array $transformation = null + ?array $transformation = null, ): self { $obj = new self; $obj->text = $text; + null !== $position && $obj->position = $position; + null !== $timing && $obj->timing = $timing; null !== $encoding && $obj->encoding = $encoding instanceof Encoding ? $encoding->value : $encoding; null !== $transformation && $obj->transformation = $transformation; return $obj; } + public function withPosition(OverlayPosition $position): self + { + $obj = clone $this; + $obj->position = $position; + + return $obj; + } + + public function withTiming(OverlayTiming $timing): self + { + $obj = clone $this; + $obj->timing = $timing; + + return $obj; + } + /** * Specifies the text to be displayed in the overlay. The SDK automatically handles special characters and encoding. */ diff --git a/src/VideoOverlay.php b/src/VideoOverlay.php index 3135b391..3967ff0b 100644 --- a/src/VideoOverlay.php +++ b/src/VideoOverlay.php @@ -10,7 +10,9 @@ use ImageKit\VideoOverlay\Encoding; /** - * @phpstan-type unnamed_type_with_intersection_parent4 = array{ + * @phpstan-type video_overlay = array{ + * position?: OverlayPosition, + * timing?: OverlayTiming, * input: string, * type: string, * encoding?: value-of, @@ -19,12 +21,18 @@ */ final class VideoOverlay implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] public string $type = 'video'; + #[Api(optional: true)] + public ?OverlayPosition $position; + + #[Api(optional: true)] + public ?OverlayTiming $timing; + /** * Specifies the relative path to the video used as an overlay. */ @@ -80,6 +88,8 @@ public function __construct() */ public static function with( string $input, + ?OverlayPosition $position = null, + ?OverlayTiming $timing = null, Encoding|string|null $encoding = null, ?array $transformation = null, ): self { @@ -87,12 +97,30 @@ public static function with( $obj->input = $input; + null !== $position && $obj->position = $position; + null !== $timing && $obj->timing = $timing; null !== $encoding && $obj->encoding = $encoding instanceof Encoding ? $encoding->value : $encoding; null !== $transformation && $obj->transformation = $transformation; return $obj; } + public function withPosition(OverlayPosition $position): self + { + $obj = clone $this; + $obj->position = $position; + + return $obj; + } + + public function withTiming(OverlayTiming $timing): self + { + $obj = clone $this; + $obj->timing = $timing; + + return $obj; + } + /** * Specifies the relative path to the video used as an overlay. */ diff --git a/src/Webhooks/UploadPostTransformErrorEvent.php b/src/Webhooks/UploadPostTransformErrorEvent.php index 97b13e0b..8dfee4f0 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent.php +++ b/src/Webhooks/UploadPostTransformErrorEvent.php @@ -13,17 +13,30 @@ /** * Triggered when a post-transformation fails. The original file remains available, but the requested transformation could not be generated. * - * @phpstan-type unnamed_type_with_intersection_parent5 = array{ - * createdAt: \DateTimeInterface, data: Data, request: Request, type: string + * @phpstan-type upload_post_transform_error_event = array{ + * id: string, + * type: string, + * createdAt: \DateTimeInterface, + * data: Data, + * request: Request, * } */ final class UploadPostTransformErrorEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; + /** + * Unique identifier for the event. + */ + #[Api] + public string $id; + + /** + * The type of webhook event. + */ #[Api] - public string $type = 'upload.post-transform.error'; + public string $type; /** * Timestamp of when the event occurred in ISO8601 format. @@ -42,13 +55,17 @@ final class UploadPostTransformErrorEvent implements BaseModel * * To enforce required parameters use * ``` - * UploadPostTransformErrorEvent::with(createdAt: ..., data: ..., request: ...) + * UploadPostTransformErrorEvent::with( + * id: ..., type: ..., createdAt: ..., data: ..., request: ... + * ) * ``` * * Otherwise ensure the following setters are called * * ``` * (new UploadPostTransformErrorEvent) + * ->withID(...) + * ->withType(...) * ->withCreatedAt(...) * ->withData(...) * ->withRequest(...) @@ -65,12 +82,16 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( + string $id, + string $type, \DateTimeInterface $createdAt, Data $data, - Request $request + Request $request, ): self { $obj = new self; + $obj->id = $id; + $obj->type = $type; $obj->createdAt = $createdAt; $obj->data = $data; $obj->request = $request; @@ -78,6 +99,28 @@ public static function with( return $obj; } + /** + * Unique identifier for the event. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * The type of webhook event. + */ + public function withType(string $type): self + { + $obj = clone $this; + $obj->type = $type; + + return $obj; + } + /** * Timestamp of when the event occurred in ISO8601 format. */ diff --git a/src/Webhooks/UploadPostTransformSuccessEvent.php b/src/Webhooks/UploadPostTransformSuccessEvent.php index d1cfd485..fdbcb0ae 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent.php @@ -13,17 +13,30 @@ /** * Triggered when a post-transformation completes successfully. The transformed version of the file is now ready and can be accessed via the provided URL. Note that each post-transformation generates a separate webhook event. * - * @phpstan-type unnamed_type_with_intersection_parent6 = array{ - * createdAt: \DateTimeInterface, data: Data, request: Request, type: string + * @phpstan-type upload_post_transform_success_event = array{ + * id: string, + * type: string, + * createdAt: \DateTimeInterface, + * data: Data, + * request: Request, * } */ final class UploadPostTransformSuccessEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; + /** + * Unique identifier for the event. + */ + #[Api] + public string $id; + + /** + * The type of webhook event. + */ #[Api] - public string $type = 'upload.post-transform.success'; + public string $type; /** * Timestamp of when the event occurred in ISO8601 format. @@ -42,13 +55,17 @@ final class UploadPostTransformSuccessEvent implements BaseModel * * To enforce required parameters use * ``` - * UploadPostTransformSuccessEvent::with(createdAt: ..., data: ..., request: ...) + * UploadPostTransformSuccessEvent::with( + * id: ..., type: ..., createdAt: ..., data: ..., request: ... + * ) * ``` * * Otherwise ensure the following setters are called * * ``` * (new UploadPostTransformSuccessEvent) + * ->withID(...) + * ->withType(...) * ->withCreatedAt(...) * ->withData(...) * ->withRequest(...) @@ -65,12 +82,16 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( + string $id, + string $type, \DateTimeInterface $createdAt, Data $data, - Request $request + Request $request, ): self { $obj = new self; + $obj->id = $id; + $obj->type = $type; $obj->createdAt = $createdAt; $obj->data = $data; $obj->request = $request; @@ -78,6 +99,28 @@ public static function with( return $obj; } + /** + * Unique identifier for the event. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * The type of webhook event. + */ + public function withType(string $type): self + { + $obj = clone $this; + $obj->type = $type; + + return $obj; + } + /** * Timestamp of when the event occurred in ISO8601 format. */ diff --git a/src/Webhooks/UploadPreTransformErrorEvent.php b/src/Webhooks/UploadPreTransformErrorEvent.php index 50f990ef..b509717b 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent.php +++ b/src/Webhooks/UploadPreTransformErrorEvent.php @@ -13,17 +13,30 @@ /** * Triggered when a pre-transformation fails. The file upload may have been accepted, but the requested transformation could not be applied. * - * @phpstan-type unnamed_type_with_intersection_parent7 = array{ - * createdAt: \DateTimeInterface, data: Data, request: Request, type: string + * @phpstan-type upload_pre_transform_error_event = array{ + * id: string, + * type: string, + * createdAt: \DateTimeInterface, + * data: Data, + * request: Request, * } */ final class UploadPreTransformErrorEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; + /** + * Unique identifier for the event. + */ + #[Api] + public string $id; + + /** + * The type of webhook event. + */ #[Api] - public string $type = 'upload.pre-transform.error'; + public string $type; /** * Timestamp of when the event occurred in ISO8601 format. @@ -42,13 +55,17 @@ final class UploadPreTransformErrorEvent implements BaseModel * * To enforce required parameters use * ``` - * UploadPreTransformErrorEvent::with(createdAt: ..., data: ..., request: ...) + * UploadPreTransformErrorEvent::with( + * id: ..., type: ..., createdAt: ..., data: ..., request: ... + * ) * ``` * * Otherwise ensure the following setters are called * * ``` * (new UploadPreTransformErrorEvent) + * ->withID(...) + * ->withType(...) * ->withCreatedAt(...) * ->withData(...) * ->withRequest(...) @@ -65,12 +82,16 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( + string $id, + string $type, \DateTimeInterface $createdAt, Data $data, - Request $request + Request $request, ): self { $obj = new self; + $obj->id = $id; + $obj->type = $type; $obj->createdAt = $createdAt; $obj->data = $data; $obj->request = $request; @@ -78,6 +99,28 @@ public static function with( return $obj; } + /** + * Unique identifier for the event. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * The type of webhook event. + */ + public function withType(string $type): self + { + $obj = clone $this; + $obj->type = $type; + + return $obj; + } + /** * Timestamp of when the event occurred in ISO8601 format. */ diff --git a/src/Webhooks/UploadPreTransformSuccessEvent.php b/src/Webhooks/UploadPreTransformSuccessEvent.php index adf2b8e8..3838957b 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent.php @@ -13,17 +13,30 @@ /** * Triggered when a pre-transformation completes successfully. The file has been processed with the requested transformation and is now available in the Media Library. * - * @phpstan-type unnamed_type_with_intersection_parent8 = array{ - * createdAt: \DateTimeInterface, data: Data, request: Request, type: string + * @phpstan-type upload_pre_transform_success_event = array{ + * id: string, + * type: string, + * createdAt: \DateTimeInterface, + * data: Data, + * request: Request, * } */ final class UploadPreTransformSuccessEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; + /** + * Unique identifier for the event. + */ + #[Api] + public string $id; + + /** + * The type of webhook event. + */ #[Api] - public string $type = 'upload.pre-transform.success'; + public string $type; /** * Timestamp of when the event occurred in ISO8601 format. @@ -45,13 +58,17 @@ final class UploadPreTransformSuccessEvent implements BaseModel * * To enforce required parameters use * ``` - * UploadPreTransformSuccessEvent::with(createdAt: ..., data: ..., request: ...) + * UploadPreTransformSuccessEvent::with( + * id: ..., type: ..., createdAt: ..., data: ..., request: ... + * ) * ``` * * Otherwise ensure the following setters are called * * ``` * (new UploadPreTransformSuccessEvent) + * ->withID(...) + * ->withType(...) * ->withCreatedAt(...) * ->withData(...) * ->withRequest(...) @@ -68,12 +85,16 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( + string $id, + string $type, \DateTimeInterface $createdAt, Data $data, - Request $request + Request $request, ): self { $obj = new self; + $obj->id = $id; + $obj->type = $type; $obj->createdAt = $createdAt; $obj->data = $data; $obj->request = $request; @@ -81,6 +102,28 @@ public static function with( return $obj; } + /** + * Unique identifier for the event. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * The type of webhook event. + */ + public function withType(string $type): self + { + $obj = clone $this; + $obj->type = $type; + + return $obj; + } + /** * Timestamp of when the event occurred in ISO8601 format. */ diff --git a/src/Webhooks/VideoTransformationAcceptedEvent.php b/src/Webhooks/VideoTransformationAcceptedEvent.php index 931d780d..c0c92749 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent.php @@ -13,17 +13,30 @@ /** * Triggered when a new video transformation request is accepted for processing. This event confirms that ImageKit has received and queued your transformation request. Use this for debugging and tracking transformation lifecycle. * - * @phpstan-type unnamed_type_with_intersection_parent9 = array{ - * createdAt: \DateTimeInterface, data: Data, request: Request, type: string + * @phpstan-type video_transformation_accepted_event = array{ + * id: string, + * type: string, + * createdAt: \DateTimeInterface, + * data: Data, + * request: Request, * } */ final class VideoTransformationAcceptedEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; + /** + * Unique identifier for the event. + */ + #[Api] + public string $id; + + /** + * The type of webhook event. + */ #[Api] - public string $type = 'video.transformation.accepted'; + public string $type; /** * Timestamp when the event was created in ISO8601 format. @@ -45,13 +58,17 @@ final class VideoTransformationAcceptedEvent implements BaseModel * * To enforce required parameters use * ``` - * VideoTransformationAcceptedEvent::with(createdAt: ..., data: ..., request: ...) + * VideoTransformationAcceptedEvent::with( + * id: ..., type: ..., createdAt: ..., data: ..., request: ... + * ) * ``` * * Otherwise ensure the following setters are called * * ``` * (new VideoTransformationAcceptedEvent) + * ->withID(...) + * ->withType(...) * ->withCreatedAt(...) * ->withData(...) * ->withRequest(...) @@ -68,12 +85,16 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( + string $id, + string $type, \DateTimeInterface $createdAt, Data $data, - Request $request + Request $request, ): self { $obj = new self; + $obj->id = $id; + $obj->type = $type; $obj->createdAt = $createdAt; $obj->data = $data; $obj->request = $request; @@ -81,6 +102,28 @@ public static function with( return $obj; } + /** + * Unique identifier for the event. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * The type of webhook event. + */ + public function withType(string $type): self + { + $obj = clone $this; + $obj->type = $type; + + return $obj; + } + /** * Timestamp when the event was created in ISO8601 format. */ diff --git a/src/Webhooks/VideoTransformationErrorEvent.php b/src/Webhooks/VideoTransformationErrorEvent.php index 6b264bb8..4bc6a3ae 100644 --- a/src/Webhooks/VideoTransformationErrorEvent.php +++ b/src/Webhooks/VideoTransformationErrorEvent.php @@ -13,17 +13,30 @@ /** * Triggered when an error occurs during video encoding. Listen to this webhook to log error reasons and debug issues. Check your origin and URL endpoint settings if the reason is related to download failure. For other errors, contact ImageKit support. * - * @phpstan-type unnamed_type_with_intersection_parent10 = array{ - * createdAt: \DateTimeInterface, data: Data, request: Request, type: string + * @phpstan-type video_transformation_error_event = array{ + * id: string, + * type: string, + * createdAt: \DateTimeInterface, + * data: Data, + * request: Request, * } */ final class VideoTransformationErrorEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; + /** + * Unique identifier for the event. + */ + #[Api] + public string $id; + + /** + * The type of webhook event. + */ #[Api] - public string $type = 'video.transformation.error'; + public string $type; /** * Timestamp when the event was created in ISO8601 format. @@ -45,13 +58,17 @@ final class VideoTransformationErrorEvent implements BaseModel * * To enforce required parameters use * ``` - * VideoTransformationErrorEvent::with(createdAt: ..., data: ..., request: ...) + * VideoTransformationErrorEvent::with( + * id: ..., type: ..., createdAt: ..., data: ..., request: ... + * ) * ``` * * Otherwise ensure the following setters are called * * ``` * (new VideoTransformationErrorEvent) + * ->withID(...) + * ->withType(...) * ->withCreatedAt(...) * ->withData(...) * ->withRequest(...) @@ -68,12 +85,16 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( + string $id, + string $type, \DateTimeInterface $createdAt, Data $data, - Request $request + Request $request, ): self { $obj = new self; + $obj->id = $id; + $obj->type = $type; $obj->createdAt = $createdAt; $obj->data = $data; $obj->request = $request; @@ -81,6 +102,28 @@ public static function with( return $obj; } + /** + * Unique identifier for the event. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * The type of webhook event. + */ + public function withType(string $type): self + { + $obj = clone $this; + $obj->type = $type; + + return $obj; + } + /** * Timestamp when the event was created in ISO8601 format. */ diff --git a/src/Webhooks/VideoTransformationReadyEvent.php b/src/Webhooks/VideoTransformationReadyEvent.php index ecbda8e3..25a0dc12 100644 --- a/src/Webhooks/VideoTransformationReadyEvent.php +++ b/src/Webhooks/VideoTransformationReadyEvent.php @@ -14,21 +14,31 @@ /** * Triggered when video encoding is finished and the transformed resource is ready to be served. This is the key event to listen for - update your database or CMS flags when you receive this so your application can start showing the transformed video to users. * - * @phpstan-type unnamed_type_with_intersection_parent11 = array{ + * @phpstan-type video_transformation_ready_event = array{ + * id: string, + * type: string, * createdAt: \DateTimeInterface, * data: Data, * request: Request, - * type: string, * timings?: Timings, * } */ final class VideoTransformationReadyEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; + /** + * Unique identifier for the event. + */ + #[Api] + public string $id; + + /** + * The type of webhook event. + */ #[Api] - public string $type = 'video.transformation.ready'; + public string $type; /** * Timestamp when the event was created in ISO8601 format. @@ -56,13 +66,17 @@ final class VideoTransformationReadyEvent implements BaseModel * * To enforce required parameters use * ``` - * VideoTransformationReadyEvent::with(createdAt: ..., data: ..., request: ...) + * VideoTransformationReadyEvent::with( + * id: ..., type: ..., createdAt: ..., data: ..., request: ... + * ) * ``` * * Otherwise ensure the following setters are called * * ``` * (new VideoTransformationReadyEvent) + * ->withID(...) + * ->withType(...) * ->withCreatedAt(...) * ->withData(...) * ->withRequest(...) @@ -79,6 +93,8 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( + string $id, + string $type, \DateTimeInterface $createdAt, Data $data, Request $request, @@ -86,6 +102,8 @@ public static function with( ): self { $obj = new self; + $obj->id = $id; + $obj->type = $type; $obj->createdAt = $createdAt; $obj->data = $data; $obj->request = $request; @@ -95,6 +113,28 @@ public static function with( return $obj; } + /** + * Unique identifier for the event. + */ + public function withID(string $id): self + { + $obj = clone $this; + $obj->id = $id; + + return $obj; + } + + /** + * The type of webhook event. + */ + public function withType(string $type): self + { + $obj = clone $this; + $obj->type = $type; + + return $obj; + } + /** * Timestamp when the event was created in ISO8601 format. */ From d3e94af126fa9bf00a0a704aa9fbc8e37125447a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 14 Sep 2025 02:04:17 +0000 Subject: [PATCH 030/193] fix(client): elide client methods in docs --- src/Transformation.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/src/Transformation.php b/src/Transformation.php index 6ac49613..fd3973d1 100644 --- a/src/Transformation.php +++ b/src/Transformation.php @@ -113,7 +113,7 @@ final class Transformation implements BaseModel * Supported inside overlay. * See [AI Background Removal](https://imagekit.io/docs/ai-transformations#imagekit-background-removal-e-bgremove). */ - #[Api(enum: STAINLESS_FIXME_AIRemoveBackground::class, optional: true)] + #[Api(optional: true)] public ?bool $aiRemoveBackground; /** @@ -122,24 +122,21 @@ final class Transformation implements BaseModel * Supported inside overlay. * See [External Background Removal](https://imagekit.io/docs/ai-transformations#background-removal-e-removedotbg). */ - #[Api( - enum: STAINLESS_FIXME_AIRemoveBackgroundExternal::class, - optional: true - )] + #[Api(optional: true)] public ?bool $aiRemoveBackgroundExternal; /** * Performs AI-based retouching to improve faces or product shots. Not supported inside overlay. * See [AI Retouch](https://imagekit.io/docs/ai-transformations#retouch-e-retouch). */ - #[Api(enum: STAINLESS_FIXME_AIRetouch::class, optional: true)] + #[Api(optional: true)] public ?bool $aiRetouch; /** * Upscales images beyond their original dimensions using AI. Not supported inside overlay. * See [AI Upscale](https://imagekit.io/docs/ai-transformations#upscale-e-upscale). */ - #[Api(enum: STAINLESS_FIXME_AIUpscale::class, optional: true)] + #[Api(optional: true)] public ?bool $aiUpscale; /** @@ -147,7 +144,7 @@ enum: STAINLESS_FIXME_AIRemoveBackgroundExternal::class, * such as changes in color, texture, and other visual elements, while preserving the structure and essence of the original image. Not supported inside overlay. * See [AI Generate Variations](https://imagekit.io/docs/ai-transformations#generate-variations-of-an-image-e-genvar). */ - #[Api(enum: STAINLESS_FIXME_AIVariation::class, optional: true)] + #[Api(optional: true)] public ?bool $aiVariation; /** @@ -202,7 +199,7 @@ enum: STAINLESS_FIXME_AIRemoveBackgroundExternal::class, * Automatically enhances the contrast of an image (contrast stretch). * See [Contrast Stretch](https://imagekit.io/docs/effects-and-enhancements#contrast-stretch---e-contrast). */ - #[Api(enum: STAINLESS_FIXME_ContrastStretch::class, optional: true)] + #[Api(optional: true)] public ?bool $contrastStretch; /** @@ -293,7 +290,7 @@ enum: STAINLESS_FIXME_AIRemoveBackgroundExternal::class, /** * Enables a grayscale effect for images. See [Grayscale](https://imagekit.io/docs/effects-and-enhancements#grayscale---e-grayscale). */ - #[Api(enum: STAINLESS_FIXME_Grayscale::class, optional: true)] + #[Api(optional: true)] public ?bool $grayscale; /** From bfc46add70562512b60928554638368443b6e38c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 19 Sep 2025 12:58:07 +0000 Subject: [PATCH 031/193] feat(api): manual updates --- .stats.yml | 6 +- src/Files/FileUpdateParams.php | 34 ++++--- src/Files/FileUpdateParams/Publish.php | 93 ------------------- .../ChangePublicationStatus.php | 55 ----------- .../ChangePublicationStatus/Publish.php | 93 ------------------- ...tailsRequest.php => UpdateFileRequest.php} | 10 +- .../UpdateFileDetails.php | 4 +- .../UpdateFileDetails/RemoveAITags.php | 2 +- src/ServiceContracts/FilesContract.php | 5 +- src/Services/FilesService.php | 7 +- tests/Services/FilesTest.php | 14 ++- 11 files changed, 51 insertions(+), 272 deletions(-) delete mode 100644 src/Files/FileUpdateParams/Publish.php delete mode 100644 src/Files/UpdateFileDetailsRequest/ChangePublicationStatus.php delete mode 100644 src/Files/UpdateFileDetailsRequest/ChangePublicationStatus/Publish.php rename src/Files/{UpdateFileDetailsRequest.php => UpdateFileRequest.php} (60%) rename src/Files/{UpdateFileDetailsRequest => UpdateFileRequest}/UpdateFileDetails.php (98%) rename src/Files/{UpdateFileDetailsRequest => UpdateFileRequest}/UpdateFileDetails/RemoveAITags.php (92%) diff --git a/.stats.yml b/.stats.yml index b0086e96..bb4a090c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-bc7c0d27962b30c19c778656988e154b54696819389289f34420a5e5fdfbd3b8.yml -openapi_spec_hash: 1bfde02a63416c036e9545927f727459 -config_hash: b415c06a3b29485af4601beb94ae1aeb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-dd864816d7f4316ae89f57394da2fd1926166d4704db5a0bb5d23461d2d75e49.yml +openapi_spec_hash: 7f7c416563a15bbaea98804ecdc1a8f9 +config_hash: 54c05a157f2cc730fac9e1df5dc3ca29 diff --git a/src/Files/FileUpdateParams.php b/src/Files/FileUpdateParams.php index 0fb8c92e..3b10e7ee 100644 --- a/src/Files/FileUpdateParams.php +++ b/src/Files/FileUpdateParams.php @@ -12,7 +12,6 @@ use ImageKit\ExtensionItem\AIAutoDescription; use ImageKit\ExtensionItem\AutoTaggingExtension; use ImageKit\ExtensionItem\RemoveBg; -use ImageKit\Files\FileUpdateParams\Publish; use ImageKit\Files\FileUpdateParams\RemoveAITags; /** @@ -39,7 +38,7 @@ * removeAITags?: string|list, * tags?: list|null, * webhookURL?: string, - * publish?: Publish, + * body: mixed, * } */ final class FileUpdateParams implements BaseModel @@ -102,12 +101,23 @@ final class FileUpdateParams implements BaseModel #[Api('webhookUrl', optional: true)] public ?string $webhookURL; + #[Api] + public mixed $body; + /** - * Configure the publication status of a file and its versions. + * `new FileUpdateParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * FileUpdateParams::with(body: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new FileUpdateParams)->withBody(...) + * ``` */ - #[Api(optional: true)] - public ?Publish $publish; - public function __construct() { $this->initialize(); @@ -124,6 +134,7 @@ public function __construct() * @param list|null $tags */ public static function with( + mixed $body, ?string $customCoordinates = null, ?array $customMetadata = null, ?string $description = null, @@ -131,10 +142,11 @@ public static function with( string|array|null $removeAITags = null, ?array $tags = null, ?string $webhookURL = null, - ?Publish $publish = null, ): self { $obj = new self; + $obj->body = $body; + null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; null !== $customMetadata && $obj->customMetadata = $customMetadata; null !== $description && $obj->description = $description; @@ -142,7 +154,6 @@ public static function with( null !== $removeAITags && $obj->removeAITags = $removeAITags; null !== $tags && $obj->tags = $tags; null !== $webhookURL && $obj->webhookURL = $webhookURL; - null !== $publish && $obj->publish = $publish; return $obj; } @@ -236,13 +247,10 @@ public function withWebhookURL(string $webhookURL): self return $obj; } - /** - * Configure the publication status of a file and its versions. - */ - public function withPublish(Publish $publish): self + public function withBody(mixed $body): self { $obj = clone $this; - $obj->publish = $publish; + $obj->body = $body; return $obj; } diff --git a/src/Files/FileUpdateParams/Publish.php b/src/Files/FileUpdateParams/Publish.php deleted file mode 100644 index b49cd390..00000000 --- a/src/Files/FileUpdateParams/Publish.php +++ /dev/null @@ -1,93 +0,0 @@ - */ - use SdkModel; - - /** - * Set to `true` to publish the file. Set to `false` to unpublish the file. - */ - #[Api] - public bool $isPublished; - - /** - * Set to `true` to publish/unpublish all versions of the file. Set to `false` to publish/unpublish only the current version of the file. - */ - #[Api(optional: true)] - public ?bool $includeFileVersions; - - /** - * `new Publish()` is missing required properties by the API. - * - * To enforce required parameters use - * ``` - * Publish::with(isPublished: ...) - * ``` - * - * Otherwise ensure the following setters are called - * - * ``` - * (new Publish)->withIsPublished(...) - * ``` - */ - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - */ - public static function with( - bool $isPublished, - ?bool $includeFileVersions = null - ): self { - $obj = new self; - - $obj->isPublished = $isPublished; - - null !== $includeFileVersions && $obj->includeFileVersions = $includeFileVersions; - - return $obj; - } - - /** - * Set to `true` to publish the file. Set to `false` to unpublish the file. - */ - public function withIsPublished(bool $isPublished): self - { - $obj = clone $this; - $obj->isPublished = $isPublished; - - return $obj; - } - - /** - * Set to `true` to publish/unpublish all versions of the file. Set to `false` to publish/unpublish only the current version of the file. - */ - public function withIncludeFileVersions(bool $includeFileVersions): self - { - $obj = clone $this; - $obj->includeFileVersions = $includeFileVersions; - - return $obj; - } -} diff --git a/src/Files/UpdateFileDetailsRequest/ChangePublicationStatus.php b/src/Files/UpdateFileDetailsRequest/ChangePublicationStatus.php deleted file mode 100644 index 4b005ce2..00000000 --- a/src/Files/UpdateFileDetailsRequest/ChangePublicationStatus.php +++ /dev/null @@ -1,55 +0,0 @@ - */ - use SdkModel; - - /** - * Configure the publication status of a file and its versions. - */ - #[Api(optional: true)] - public ?Publish $publish; - - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - */ - public static function with(?Publish $publish = null): self - { - $obj = new self; - - null !== $publish && $obj->publish = $publish; - - return $obj; - } - - /** - * Configure the publication status of a file and its versions. - */ - public function withPublish(Publish $publish): self - { - $obj = clone $this; - $obj->publish = $publish; - - return $obj; - } -} diff --git a/src/Files/UpdateFileDetailsRequest/ChangePublicationStatus/Publish.php b/src/Files/UpdateFileDetailsRequest/ChangePublicationStatus/Publish.php deleted file mode 100644 index 8fddee82..00000000 --- a/src/Files/UpdateFileDetailsRequest/ChangePublicationStatus/Publish.php +++ /dev/null @@ -1,93 +0,0 @@ - */ - use SdkModel; - - /** - * Set to `true` to publish the file. Set to `false` to unpublish the file. - */ - #[Api] - public bool $isPublished; - - /** - * Set to `true` to publish/unpublish all versions of the file. Set to `false` to publish/unpublish only the current version of the file. - */ - #[Api(optional: true)] - public ?bool $includeFileVersions; - - /** - * `new Publish()` is missing required properties by the API. - * - * To enforce required parameters use - * ``` - * Publish::with(isPublished: ...) - * ``` - * - * Otherwise ensure the following setters are called - * - * ``` - * (new Publish)->withIsPublished(...) - * ``` - */ - public function __construct() - { - $this->initialize(); - } - - /** - * Construct an instance from the required parameters. - * - * You must use named parameters to construct any parameters with a default value. - */ - public static function with( - bool $isPublished, - ?bool $includeFileVersions = null - ): self { - $obj = new self; - - $obj->isPublished = $isPublished; - - null !== $includeFileVersions && $obj->includeFileVersions = $includeFileVersions; - - return $obj; - } - - /** - * Set to `true` to publish the file. Set to `false` to unpublish the file. - */ - public function withIsPublished(bool $isPublished): self - { - $obj = clone $this; - $obj->isPublished = $isPublished; - - return $obj; - } - - /** - * Set to `true` to publish/unpublish all versions of the file. Set to `false` to publish/unpublish only the current version of the file. - */ - public function withIncludeFileVersions(bool $includeFileVersions): self - { - $obj = clone $this; - $obj->includeFileVersions = $includeFileVersions; - - return $obj; - } -} diff --git a/src/Files/UpdateFileDetailsRequest.php b/src/Files/UpdateFileRequest.php similarity index 60% rename from src/Files/UpdateFileDetailsRequest.php rename to src/Files/UpdateFileRequest.php index ee60beb4..01945641 100644 --- a/src/Files/UpdateFileDetailsRequest.php +++ b/src/Files/UpdateFileRequest.php @@ -7,10 +7,12 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Files\UpdateFileDetailsRequest\ChangePublicationStatus; -use ImageKit\Files\UpdateFileDetailsRequest\UpdateFileDetails; +use ImageKit\Files\UpdateFileRequest\UpdateFileDetails; -final class UpdateFileDetailsRequest implements ConverterSource +/** + * Schema for update file update request. + */ +final class UpdateFileRequest implements ConverterSource { use SdkUnion; @@ -20,6 +22,6 @@ final class UpdateFileDetailsRequest implements ConverterSource */ public static function variants(): array { - return [UpdateFileDetails::class, ChangePublicationStatus::class]; + return [UpdateFileDetails::class, 'mixed']; } } diff --git a/src/Files/UpdateFileDetailsRequest/UpdateFileDetails.php b/src/Files/UpdateFileRequest/UpdateFileDetails.php similarity index 98% rename from src/Files/UpdateFileDetailsRequest/UpdateFileDetails.php rename to src/Files/UpdateFileRequest/UpdateFileDetails.php index 5b6149f1..1e21fff2 100644 --- a/src/Files/UpdateFileDetailsRequest/UpdateFileDetails.php +++ b/src/Files/UpdateFileRequest/UpdateFileDetails.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\UpdateFileDetailsRequest; +namespace ImageKit\Files\UpdateFileRequest; use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; @@ -11,7 +11,7 @@ use ImageKit\ExtensionItem\AIAutoDescription; use ImageKit\ExtensionItem\AutoTaggingExtension; use ImageKit\ExtensionItem\RemoveBg; -use ImageKit\Files\UpdateFileDetailsRequest\UpdateFileDetails\RemoveAITags; +use ImageKit\Files\UpdateFileRequest\UpdateFileDetails\RemoveAITags; /** * @phpstan-type update_file_details = array{ diff --git a/src/Files/UpdateFileDetailsRequest/UpdateFileDetails/RemoveAITags.php b/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php similarity index 92% rename from src/Files/UpdateFileDetailsRequest/UpdateFileDetails/RemoveAITags.php rename to src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php index f07ba68b..bffc8ccb 100644 --- a/src/Files/UpdateFileDetailsRequest/UpdateFileDetails/RemoveAITags.php +++ b/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\UpdateFileDetailsRequest\UpdateFileDetails; +namespace ImageKit\Files\UpdateFileRequest\UpdateFileDetails; use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; diff --git a/src/ServiceContracts/FilesContract.php b/src/ServiceContracts/FilesContract.php index 8d06b2f5..cf3aea2b 100644 --- a/src/ServiceContracts/FilesContract.php +++ b/src/ServiceContracts/FilesContract.php @@ -13,7 +13,6 @@ use ImageKit\Files\FileCopyResponse; use ImageKit\Files\FileMoveResponse; use ImageKit\Files\FileRenameResponse; -use ImageKit\Files\FileUpdateParams\Publish; use ImageKit\Files\FileUpdateResponse; use ImageKit\Files\FileUploadParams\ResponseField; use ImageKit\Files\FileUploadParams\Transformation; @@ -39,7 +38,7 @@ interface FilesContract * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. * @param list|null $tags An array of tags associated with the file, such as `["tag1", "tag2"]`. Send `null` to unset all tags associated with the file. * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. - * @param Publish $publish configure the publication status of a file and its versions + * @param mixed $body * * @return FileUpdateResponse * @@ -54,7 +53,7 @@ public function update( $removeAITags = omit, $tags = omit, $webhookURL = omit, - $publish = omit, + $body, ?RequestOptions $requestOptions = null, ): FileUpdateResponse; diff --git a/src/Services/FilesService.php b/src/Services/FilesService.php index 6d9a729e..906cc358 100644 --- a/src/Services/FilesService.php +++ b/src/Services/FilesService.php @@ -18,7 +18,6 @@ use ImageKit\Files\FileRenameParams; use ImageKit\Files\FileRenameResponse; use ImageKit\Files\FileUpdateParams; -use ImageKit\Files\FileUpdateParams\Publish; use ImageKit\Files\FileUpdateResponse; use ImageKit\Files\FileUploadParams; use ImageKit\Files\FileUploadParams\ResponseField; @@ -76,7 +75,7 @@ public function __construct(private Client $client) * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. * @param list|null $tags An array of tags associated with the file, such as `["tag1", "tag2"]`. Send `null` to unset all tags associated with the file. * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. - * @param Publish $publish configure the publication status of a file and its versions + * @param mixed $body * * @return FileUpdateResponse * @@ -91,7 +90,7 @@ public function update( $removeAITags = omit, $tags = omit, $webhookURL = omit, - $publish = omit, + $body, ?RequestOptions $requestOptions = null, ): FileUpdateResponse { $params = [ @@ -102,7 +101,7 @@ public function update( 'removeAITags' => $removeAITags, 'tags' => $tags, 'webhookURL' => $webhookURL, - 'publish' => $publish, + 'body' => $body, ]; return $this->updateRaw($fileID, $params, $requestOptions); diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index 665d0714..8534cd1f 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -37,7 +37,19 @@ public function testUpdate(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->update('fileId'); + $result = $this->client->files->update('fileId', body: (object) []); + + $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + } + + #[Test] + public function testUpdateWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->files->update('fileId', body: (object) []); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } From 2d65a573684fed507cfb7397f73ef22b9d9e8f94 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 19 Sep 2025 13:02:40 +0000 Subject: [PATCH 032/193] feat(api): manual updates --- .stats.yml | 4 +- src/Files/FileUpdateParams.php | 34 +++---- src/Files/FileUpdateParams/Publish.php | 93 +++++++++++++++++++ src/Files/UpdateFileRequest.php | 3 +- .../ChangePublicationStatus.php | 55 +++++++++++ .../ChangePublicationStatus/Publish.php | 93 +++++++++++++++++++ src/ServiceContracts/FilesContract.php | 5 +- src/Services/FilesService.php | 7 +- tests/Services/FilesTest.php | 14 +-- 9 files changed, 266 insertions(+), 42 deletions(-) create mode 100644 src/Files/FileUpdateParams/Publish.php create mode 100644 src/Files/UpdateFileRequest/ChangePublicationStatus.php create mode 100644 src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php diff --git a/.stats.yml b/.stats.yml index bb4a090c..c9c84db9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-dd864816d7f4316ae89f57394da2fd1926166d4704db5a0bb5d23461d2d75e49.yml -openapi_spec_hash: 7f7c416563a15bbaea98804ecdc1a8f9 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-d1a3e6dfc45ae832b6b14a0aef25878985c679fa9f48c1470df188b1578ba648.yml +openapi_spec_hash: 1d382866fce3284f26d341f112988d9d config_hash: 54c05a157f2cc730fac9e1df5dc3ca29 diff --git a/src/Files/FileUpdateParams.php b/src/Files/FileUpdateParams.php index 3b10e7ee..0fb8c92e 100644 --- a/src/Files/FileUpdateParams.php +++ b/src/Files/FileUpdateParams.php @@ -12,6 +12,7 @@ use ImageKit\ExtensionItem\AIAutoDescription; use ImageKit\ExtensionItem\AutoTaggingExtension; use ImageKit\ExtensionItem\RemoveBg; +use ImageKit\Files\FileUpdateParams\Publish; use ImageKit\Files\FileUpdateParams\RemoveAITags; /** @@ -38,7 +39,7 @@ * removeAITags?: string|list, * tags?: list|null, * webhookURL?: string, - * body: mixed, + * publish?: Publish, * } */ final class FileUpdateParams implements BaseModel @@ -101,23 +102,12 @@ final class FileUpdateParams implements BaseModel #[Api('webhookUrl', optional: true)] public ?string $webhookURL; - #[Api] - public mixed $body; - /** - * `new FileUpdateParams()` is missing required properties by the API. - * - * To enforce required parameters use - * ``` - * FileUpdateParams::with(body: ...) - * ``` - * - * Otherwise ensure the following setters are called - * - * ``` - * (new FileUpdateParams)->withBody(...) - * ``` + * Configure the publication status of a file and its versions. */ + #[Api(optional: true)] + public ?Publish $publish; + public function __construct() { $this->initialize(); @@ -134,7 +124,6 @@ public function __construct() * @param list|null $tags */ public static function with( - mixed $body, ?string $customCoordinates = null, ?array $customMetadata = null, ?string $description = null, @@ -142,11 +131,10 @@ public static function with( string|array|null $removeAITags = null, ?array $tags = null, ?string $webhookURL = null, + ?Publish $publish = null, ): self { $obj = new self; - $obj->body = $body; - null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; null !== $customMetadata && $obj->customMetadata = $customMetadata; null !== $description && $obj->description = $description; @@ -154,6 +142,7 @@ public static function with( null !== $removeAITags && $obj->removeAITags = $removeAITags; null !== $tags && $obj->tags = $tags; null !== $webhookURL && $obj->webhookURL = $webhookURL; + null !== $publish && $obj->publish = $publish; return $obj; } @@ -247,10 +236,13 @@ public function withWebhookURL(string $webhookURL): self return $obj; } - public function withBody(mixed $body): self + /** + * Configure the publication status of a file and its versions. + */ + public function withPublish(Publish $publish): self { $obj = clone $this; - $obj->body = $body; + $obj->publish = $publish; return $obj; } diff --git a/src/Files/FileUpdateParams/Publish.php b/src/Files/FileUpdateParams/Publish.php new file mode 100644 index 00000000..b49cd390 --- /dev/null +++ b/src/Files/FileUpdateParams/Publish.php @@ -0,0 +1,93 @@ + */ + use SdkModel; + + /** + * Set to `true` to publish the file. Set to `false` to unpublish the file. + */ + #[Api] + public bool $isPublished; + + /** + * Set to `true` to publish/unpublish all versions of the file. Set to `false` to publish/unpublish only the current version of the file. + */ + #[Api(optional: true)] + public ?bool $includeFileVersions; + + /** + * `new Publish()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Publish::with(isPublished: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Publish)->withIsPublished(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $isPublished, + ?bool $includeFileVersions = null + ): self { + $obj = new self; + + $obj->isPublished = $isPublished; + + null !== $includeFileVersions && $obj->includeFileVersions = $includeFileVersions; + + return $obj; + } + + /** + * Set to `true` to publish the file. Set to `false` to unpublish the file. + */ + public function withIsPublished(bool $isPublished): self + { + $obj = clone $this; + $obj->isPublished = $isPublished; + + return $obj; + } + + /** + * Set to `true` to publish/unpublish all versions of the file. Set to `false` to publish/unpublish only the current version of the file. + */ + public function withIncludeFileVersions(bool $includeFileVersions): self + { + $obj = clone $this; + $obj->includeFileVersions = $includeFileVersions; + + return $obj; + } +} diff --git a/src/Files/UpdateFileRequest.php b/src/Files/UpdateFileRequest.php index 01945641..f6bde78a 100644 --- a/src/Files/UpdateFileRequest.php +++ b/src/Files/UpdateFileRequest.php @@ -7,6 +7,7 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Files\UpdateFileRequest\ChangePublicationStatus; use ImageKit\Files\UpdateFileRequest\UpdateFileDetails; /** @@ -22,6 +23,6 @@ final class UpdateFileRequest implements ConverterSource */ public static function variants(): array { - return [UpdateFileDetails::class, 'mixed']; + return [UpdateFileDetails::class, ChangePublicationStatus::class]; } } diff --git a/src/Files/UpdateFileRequest/ChangePublicationStatus.php b/src/Files/UpdateFileRequest/ChangePublicationStatus.php new file mode 100644 index 00000000..b111e254 --- /dev/null +++ b/src/Files/UpdateFileRequest/ChangePublicationStatus.php @@ -0,0 +1,55 @@ + */ + use SdkModel; + + /** + * Configure the publication status of a file and its versions. + */ + #[Api(optional: true)] + public ?Publish $publish; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(?Publish $publish = null): self + { + $obj = new self; + + null !== $publish && $obj->publish = $publish; + + return $obj; + } + + /** + * Configure the publication status of a file and its versions. + */ + public function withPublish(Publish $publish): self + { + $obj = clone $this; + $obj->publish = $publish; + + return $obj; + } +} diff --git a/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php b/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php new file mode 100644 index 00000000..d7800eab --- /dev/null +++ b/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php @@ -0,0 +1,93 @@ + */ + use SdkModel; + + /** + * Set to `true` to publish the file. Set to `false` to unpublish the file. + */ + #[Api] + public bool $isPublished; + + /** + * Set to `true` to publish/unpublish all versions of the file. Set to `false` to publish/unpublish only the current version of the file. + */ + #[Api(optional: true)] + public ?bool $includeFileVersions; + + /** + * `new Publish()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Publish::with(isPublished: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Publish)->withIsPublished(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + bool $isPublished, + ?bool $includeFileVersions = null + ): self { + $obj = new self; + + $obj->isPublished = $isPublished; + + null !== $includeFileVersions && $obj->includeFileVersions = $includeFileVersions; + + return $obj; + } + + /** + * Set to `true` to publish the file. Set to `false` to unpublish the file. + */ + public function withIsPublished(bool $isPublished): self + { + $obj = clone $this; + $obj->isPublished = $isPublished; + + return $obj; + } + + /** + * Set to `true` to publish/unpublish all versions of the file. Set to `false` to publish/unpublish only the current version of the file. + */ + public function withIncludeFileVersions(bool $includeFileVersions): self + { + $obj = clone $this; + $obj->includeFileVersions = $includeFileVersions; + + return $obj; + } +} diff --git a/src/ServiceContracts/FilesContract.php b/src/ServiceContracts/FilesContract.php index cf3aea2b..8d06b2f5 100644 --- a/src/ServiceContracts/FilesContract.php +++ b/src/ServiceContracts/FilesContract.php @@ -13,6 +13,7 @@ use ImageKit\Files\FileCopyResponse; use ImageKit\Files\FileMoveResponse; use ImageKit\Files\FileRenameResponse; +use ImageKit\Files\FileUpdateParams\Publish; use ImageKit\Files\FileUpdateResponse; use ImageKit\Files\FileUploadParams\ResponseField; use ImageKit\Files\FileUploadParams\Transformation; @@ -38,7 +39,7 @@ interface FilesContract * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. * @param list|null $tags An array of tags associated with the file, such as `["tag1", "tag2"]`. Send `null` to unset all tags associated with the file. * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. - * @param mixed $body + * @param Publish $publish configure the publication status of a file and its versions * * @return FileUpdateResponse * @@ -53,7 +54,7 @@ public function update( $removeAITags = omit, $tags = omit, $webhookURL = omit, - $body, + $publish = omit, ?RequestOptions $requestOptions = null, ): FileUpdateResponse; diff --git a/src/Services/FilesService.php b/src/Services/FilesService.php index 906cc358..6d9a729e 100644 --- a/src/Services/FilesService.php +++ b/src/Services/FilesService.php @@ -18,6 +18,7 @@ use ImageKit\Files\FileRenameParams; use ImageKit\Files\FileRenameResponse; use ImageKit\Files\FileUpdateParams; +use ImageKit\Files\FileUpdateParams\Publish; use ImageKit\Files\FileUpdateResponse; use ImageKit\Files\FileUploadParams; use ImageKit\Files\FileUploadParams\ResponseField; @@ -75,7 +76,7 @@ public function __construct(private Client $client) * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. * @param list|null $tags An array of tags associated with the file, such as `["tag1", "tag2"]`. Send `null` to unset all tags associated with the file. * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. - * @param mixed $body + * @param Publish $publish configure the publication status of a file and its versions * * @return FileUpdateResponse * @@ -90,7 +91,7 @@ public function update( $removeAITags = omit, $tags = omit, $webhookURL = omit, - $body, + $publish = omit, ?RequestOptions $requestOptions = null, ): FileUpdateResponse { $params = [ @@ -101,7 +102,7 @@ public function update( 'removeAITags' => $removeAITags, 'tags' => $tags, 'webhookURL' => $webhookURL, - 'body' => $body, + 'publish' => $publish, ]; return $this->updateRaw($fileID, $params, $requestOptions); diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index 8534cd1f..665d0714 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -37,19 +37,7 @@ public function testUpdate(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->update('fileId', body: (object) []); - - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType - } - - #[Test] - public function testUpdateWithOptionalParams(): void - { - if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); - } - - $result = $this->client->files->update('fileId', body: (object) []); + $result = $this->client->files->update('fileId'); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } From 333c06bedfbe8d5a91d1549ad5d67f05e794d159 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 19 Sep 2025 13:38:35 +0000 Subject: [PATCH 033/193] feat(api): manual updates --- .stats.yml | 2 +- README.md | 2 +- src/Client.php | 12 ++++++------ tests/Services/Accounts/OriginsTest.php | 4 ++-- tests/Services/Accounts/URLEndpointsTest.php | 4 ++-- tests/Services/Accounts/UsageTest.php | 4 ++-- tests/Services/AssetsTest.php | 4 ++-- tests/Services/Beta/V2/FilesTest.php | 4 ++-- tests/Services/Cache/InvalidationTest.php | 4 ++-- tests/Services/CustomMetadataFieldsTest.php | 4 ++-- tests/Services/Files/BulkTest.php | 4 ++-- tests/Services/Files/MetadataTest.php | 4 ++-- tests/Services/Files/VersionsTest.php | 4 ++-- tests/Services/FilesTest.php | 4 ++-- tests/Services/Folders/JobTest.php | 4 ++-- tests/Services/FoldersTest.php | 4 ++-- tests/Services/WebhooksTest.php | 4 ++-- 17 files changed, 36 insertions(+), 36 deletions(-) diff --git a/.stats.yml b/.stats.yml index c9c84db9..00fd95da 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-d1a3e6dfc45ae832b6b14a0aef25878985c679fa9f48c1470df188b1578ba648.yml openapi_spec_hash: 1d382866fce3284f26d341f112988d9d -config_hash: 54c05a157f2cc730fac9e1df5dc3ca29 +config_hash: 29a2351fe2be89392b15719be8bc964f diff --git a/README.md b/README.md index 0325e391..6d3f2c11 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Parameters with a default value must be set by name. use ImageKit\Client; $client = new Client( - privateAPIKey: getenv("IMAGEKIT_PRIVATE_API_KEY") ?: "My Private API Key", + privateKey: getenv("IMAGEKIT_PRIVATE_API_KEY") ?: "My Private Key", password: getenv("OPTIONAL_IMAGEKIT_IGNORES_THIS") ?: "do_not_set", ); diff --git a/src/Client.php b/src/Client.php index 9cdd9aa3..9d35b86e 100644 --- a/src/Client.php +++ b/src/Client.php @@ -18,7 +18,7 @@ class Client extends BaseClient { - public string $privateAPIKey; + public string $privateKey; public string $password; @@ -65,12 +65,12 @@ class Client extends BaseClient public WebhooksService $webhooks; public function __construct( - ?string $privateAPIKey = null, + ?string $privateKey = null, ?string $password = null, ?string $baseUrl = null, ) { - $this->privateAPIKey = (string) ( - $privateAPIKey ?? getenv('IMAGEKIT_PRIVATE_API_KEY') + $this->privateKey = (string) ( + $privateKey ?? getenv('IMAGEKIT_PRIVATE_API_KEY') ); $this->password = (string) ( $password ?? getenv('OPTIONAL_IMAGEKIT_IGNORES_THIS') ?: 'do_not_set' @@ -110,12 +110,12 @@ public function __construct( /** @return array */ protected function authHeaders(): array { - if (!$this->privateAPIKey && !$this->password) { + if (!$this->privateKey && !$this->password) { return []; } $base64_credentials = base64_encode( - "{$this->privateAPIKey}:{$this->password}" + "{$this->privateKey}:{$this->password}" ); return ['Authorization' => "Basic {$base64_credentials}"]; diff --git a/tests/Services/Accounts/OriginsTest.php b/tests/Services/Accounts/OriginsTest.php index eb26a0f1..c4730cc6 100644 --- a/tests/Services/Accounts/OriginsTest.php +++ b/tests/Services/Accounts/OriginsTest.php @@ -22,9 +22,9 @@ protected function setUp(): void $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( - privateAPIKey: 'My Private API Key', + privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl, + baseUrl: $testUrl ); $this->client = $client; diff --git a/tests/Services/Accounts/URLEndpointsTest.php b/tests/Services/Accounts/URLEndpointsTest.php index e8d90155..ceaa0d5a 100644 --- a/tests/Services/Accounts/URLEndpointsTest.php +++ b/tests/Services/Accounts/URLEndpointsTest.php @@ -22,9 +22,9 @@ protected function setUp(): void $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( - privateAPIKey: 'My Private API Key', + privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl, + baseUrl: $testUrl ); $this->client = $client; diff --git a/tests/Services/Accounts/UsageTest.php b/tests/Services/Accounts/UsageTest.php index 9bbfac6e..2c7e46fa 100644 --- a/tests/Services/Accounts/UsageTest.php +++ b/tests/Services/Accounts/UsageTest.php @@ -22,9 +22,9 @@ protected function setUp(): void $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( - privateAPIKey: 'My Private API Key', + privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl, + baseUrl: $testUrl ); $this->client = $client; diff --git a/tests/Services/AssetsTest.php b/tests/Services/AssetsTest.php index 3aae8c19..ade121a3 100644 --- a/tests/Services/AssetsTest.php +++ b/tests/Services/AssetsTest.php @@ -22,9 +22,9 @@ protected function setUp(): void $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( - privateAPIKey: 'My Private API Key', + privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl, + baseUrl: $testUrl ); $this->client = $client; diff --git a/tests/Services/Beta/V2/FilesTest.php b/tests/Services/Beta/V2/FilesTest.php index 345801e4..2107b0bb 100644 --- a/tests/Services/Beta/V2/FilesTest.php +++ b/tests/Services/Beta/V2/FilesTest.php @@ -22,9 +22,9 @@ protected function setUp(): void $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( - privateAPIKey: 'My Private API Key', + privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl, + baseUrl: $testUrl ); $this->client = $client; diff --git a/tests/Services/Cache/InvalidationTest.php b/tests/Services/Cache/InvalidationTest.php index 1575824f..3fd2c71d 100644 --- a/tests/Services/Cache/InvalidationTest.php +++ b/tests/Services/Cache/InvalidationTest.php @@ -22,9 +22,9 @@ protected function setUp(): void $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( - privateAPIKey: 'My Private API Key', + privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl, + baseUrl: $testUrl ); $this->client = $client; diff --git a/tests/Services/CustomMetadataFieldsTest.php b/tests/Services/CustomMetadataFieldsTest.php index bccfc446..ce448a18 100644 --- a/tests/Services/CustomMetadataFieldsTest.php +++ b/tests/Services/CustomMetadataFieldsTest.php @@ -23,9 +23,9 @@ protected function setUp(): void $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( - privateAPIKey: 'My Private API Key', + privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl, + baseUrl: $testUrl ); $this->client = $client; diff --git a/tests/Services/Files/BulkTest.php b/tests/Services/Files/BulkTest.php index 73a5d80a..f4a05468 100644 --- a/tests/Services/Files/BulkTest.php +++ b/tests/Services/Files/BulkTest.php @@ -22,9 +22,9 @@ protected function setUp(): void $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( - privateAPIKey: 'My Private API Key', + privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl, + baseUrl: $testUrl ); $this->client = $client; diff --git a/tests/Services/Files/MetadataTest.php b/tests/Services/Files/MetadataTest.php index 1e8517ff..e1db6e85 100644 --- a/tests/Services/Files/MetadataTest.php +++ b/tests/Services/Files/MetadataTest.php @@ -22,9 +22,9 @@ protected function setUp(): void $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( - privateAPIKey: 'My Private API Key', + privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl, + baseUrl: $testUrl ); $this->client = $client; diff --git a/tests/Services/Files/VersionsTest.php b/tests/Services/Files/VersionsTest.php index c92db397..78dc7741 100644 --- a/tests/Services/Files/VersionsTest.php +++ b/tests/Services/Files/VersionsTest.php @@ -22,9 +22,9 @@ protected function setUp(): void $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( - privateAPIKey: 'My Private API Key', + privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl, + baseUrl: $testUrl ); $this->client = $client; diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index 665d0714..187cc16f 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -22,9 +22,9 @@ protected function setUp(): void $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( - privateAPIKey: 'My Private API Key', + privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl, + baseUrl: $testUrl ); $this->client = $client; diff --git a/tests/Services/Folders/JobTest.php b/tests/Services/Folders/JobTest.php index ce51df1f..fb36aa5a 100644 --- a/tests/Services/Folders/JobTest.php +++ b/tests/Services/Folders/JobTest.php @@ -22,9 +22,9 @@ protected function setUp(): void $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( - privateAPIKey: 'My Private API Key', + privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl, + baseUrl: $testUrl ); $this->client = $client; diff --git a/tests/Services/FoldersTest.php b/tests/Services/FoldersTest.php index 5aacd840..6ea1479c 100644 --- a/tests/Services/FoldersTest.php +++ b/tests/Services/FoldersTest.php @@ -22,9 +22,9 @@ protected function setUp(): void $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( - privateAPIKey: 'My Private API Key', + privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl, + baseUrl: $testUrl ); $this->client = $client; diff --git a/tests/Services/WebhooksTest.php b/tests/Services/WebhooksTest.php index c94df4e3..b0aac71d 100644 --- a/tests/Services/WebhooksTest.php +++ b/tests/Services/WebhooksTest.php @@ -20,9 +20,9 @@ protected function setUp(): void $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( - privateAPIKey: 'My Private API Key', + privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl, + baseUrl: $testUrl ); $this->client = $client; From 279ba5f3490c93368b1f01461ab470e34b1e5e44 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 19 Sep 2025 13:45:59 +0000 Subject: [PATCH 034/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 00fd95da..d3fcabb4 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-d1a3e6dfc45ae832b6b14a0aef25878985c679fa9f48c1470df188b1578ba648.yml openapi_spec_hash: 1d382866fce3284f26d341f112988d9d -config_hash: 29a2351fe2be89392b15719be8bc964f +config_hash: c9c7bed2a4341f915a2dc85958ce7f0e From 3042a5062c2df21e230d90a17909af025650a958 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 19 Sep 2025 13:52:28 +0000 Subject: [PATCH 035/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index d3fcabb4..ee45f3d5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-d1a3e6dfc45ae832b6b14a0aef25878985c679fa9f48c1470df188b1578ba648.yml openapi_spec_hash: 1d382866fce3284f26d341f112988d9d -config_hash: c9c7bed2a4341f915a2dc85958ce7f0e +config_hash: 51a9632be24fc533ad69a5bd56934651 From a3edfdd78c4a8aa37d18c74d0adade953a63d834 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 20 Sep 2025 08:05:43 +0000 Subject: [PATCH 036/193] feat(api): Update env var name --- .stats.yml | 2 +- README.md | 2 +- src/Client.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index ee45f3d5..0f9a4aa3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-d1a3e6dfc45ae832b6b14a0aef25878985c679fa9f48c1470df188b1578ba648.yml openapi_spec_hash: 1d382866fce3284f26d341f112988d9d -config_hash: 51a9632be24fc533ad69a5bd56934651 +config_hash: f1fafe5e607e996b58b67fd1dd3e74fa diff --git a/README.md b/README.md index 6d3f2c11..a2f2ef72 100644 --- a/README.md +++ b/README.md @@ -48,7 +48,7 @@ Parameters with a default value must be set by name. use ImageKit\Client; $client = new Client( - privateKey: getenv("IMAGEKIT_PRIVATE_API_KEY") ?: "My Private Key", + privateKey: getenv("IMAGEKIT_PRIVATE_KEY") ?: "My Private Key", password: getenv("OPTIONAL_IMAGEKIT_IGNORES_THIS") ?: "do_not_set", ); diff --git a/src/Client.php b/src/Client.php index 9d35b86e..4c254b08 100644 --- a/src/Client.php +++ b/src/Client.php @@ -70,7 +70,7 @@ public function __construct( ?string $baseUrl = null, ) { $this->privateKey = (string) ( - $privateKey ?? getenv('IMAGEKIT_PRIVATE_API_KEY') + $privateKey ?? getenv('IMAGEKIT_PRIVATE_KEY') ); $this->password = (string) ( $password ?? getenv('OPTIONAL_IMAGEKIT_IGNORES_THIS') ?: 'do_not_set' From aff2c753975007fed90c0400fef40c50a42d5587 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 20 Sep 2025 09:24:19 +0000 Subject: [PATCH 037/193] feat(api): update api docs link --- .stats.yml | 2 +- README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 0f9a4aa3..7dfc3c2a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-d1a3e6dfc45ae832b6b14a0aef25878985c679fa9f48c1470df188b1578ba648.yml openapi_spec_hash: 1d382866fce3284f26d341f112988d9d -config_hash: f1fafe5e607e996b58b67fd1dd3e74fa +config_hash: 5f7498f5ea66e8a544c6c37b10f77467 diff --git a/README.md b/README.md index a2f2ef72..e4ad28a4 100644 --- a/README.md +++ b/README.md @@ -13,7 +13,7 @@ It is generated with [Stainless](https://www.stainless.com/). ## Documentation -The REST API documentation can be found on [imagekit.io](https://imagekit.io/docs). +The REST API documentation can be found on [imagekit.io](https://imagekit.io/docs/api-reference). ## Installation From a6f01f0756a28bb4deafc5f65480aad544c12947 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 20 Sep 2025 09:25:38 +0000 Subject: [PATCH 038/193] feat(api): remove Stainless attribution from readme --- .stats.yml | 2 +- README.md | 2 -- 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7dfc3c2a..e1604c7a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-d1a3e6dfc45ae832b6b14a0aef25878985c679fa9f48c1470df188b1578ba648.yml openapi_spec_hash: 1d382866fce3284f26d341f112988d9d -config_hash: 5f7498f5ea66e8a544c6c37b10f77467 +config_hash: ff23f46fe08ef3f43c57c8cf13eff3a1 diff --git a/README.md b/README.md index e4ad28a4..6415f9ea 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,6 @@ The Image Kit PHP library provides convenient access to the Image Kit REST API from any PHP 8.1.0+ application. -It is generated with [Stainless](https://www.stainless.com/). - ## Documentation The REST API documentation can be found on [imagekit.io](https://imagekit.io/docs/api-reference). From 250d0154d4ae83e9e81e2e9002b1180faf8642c2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 21 Sep 2025 03:10:35 +0000 Subject: [PATCH 039/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e1604c7a..031fed99 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-d1a3e6dfc45ae832b6b14a0aef25878985c679fa9f48c1470df188b1578ba648.yml openapi_spec_hash: 1d382866fce3284f26d341f112988d9d -config_hash: ff23f46fe08ef3f43c57c8cf13eff3a1 +config_hash: d57f3c7c581048428b41398f30da8b9b From 9c45ffaa1995b69c467d307238b2882944b3c7ad Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 22 Sep 2025 12:34:28 +0000 Subject: [PATCH 040/193] feat(api): manual updates --- .github/workflows/create-releases.yml | 30 +++++++++++++++++++++++++++ .github/workflows/release-doctor.yml | 6 ++++-- .stats.yml | 2 +- README.md | 10 +++------ bin/check-release-environment | 4 ++++ 5 files changed, 42 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/create-releases.yml diff --git a/.github/workflows/create-releases.yml b/.github/workflows/create-releases.yml new file mode 100644 index 00000000..8e723adf --- /dev/null +++ b/.github/workflows/create-releases.yml @@ -0,0 +1,30 @@ +name: Create releases +on: + schedule: + - cron: '0 5 * * *' # every day at 5am UTC + push: + branches: + - main + +jobs: + release: + name: release + if: github.ref == 'refs/heads/main' && github.repository == 'stainless-sdks/imagekit-php' + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v4 + + - uses: stainless-api/trigger-release-please@v1 + id: release + with: + repo: ${{ github.event.repository.full_name }} + stainless-api-key: ${{ secrets.STAINLESS_API_KEY }} + + - name: Publish to Packagist + if: ${{ steps.release.outputs.releases_created }} + run: |- + curl --fail-with-body -X POST -H 'Content-Type: application/json' "https://packagist.org/api/update-package?username=${PACKAGIST_USERNAME}&apiToken=${PACKAGIST_SAFE_KEY}" -d '{"repository":"https://www.github.com/stainless-sdks/imagekit-php"}' + env: + PACKAGIST_USERNAME: ${{ secrets.IMAGE_KIT_PACKAGIST_USERNAME || secrets.PACKAGIST_USERNAME }} + PACKAGIST_SAFE_KEY: ${{ secrets.IMAGE_KIT_PACKAGIST_SAFE_KEY || secrets.PACKAGIST_SAFE_KEY }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 6619e3f0..c789d348 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -2,14 +2,14 @@ name: Release Doctor on: pull_request: branches: - - master + - main workflow_dispatch: jobs: release_doctor: name: release doctor runs-on: ubuntu-latest - if: github.repository == 'imagekit-developer/imagekit-php' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + if: github.repository == 'stainless-sdks/imagekit-php' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - uses: actions/checkout@v4 @@ -17,3 +17,5 @@ jobs: - name: Check release environment run: | bash ./bin/check-release-environment + env: + STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }} diff --git a/.stats.yml b/.stats.yml index 031fed99..7c3aae1c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-d1a3e6dfc45ae832b6b14a0aef25878985c679fa9f48c1470df188b1578ba648.yml openapi_spec_hash: 1d382866fce3284f26d341f112988d9d -config_hash: d57f3c7c581048428b41398f30da8b9b +config_hash: e42d7fc3a8c92c35099cc283f9a4467a diff --git a/README.md b/README.md index 6415f9ea..15a4b864 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ > > This library has not yet been exhaustively tested in production environments and may be missing some features you'd expect in a stable release. As we continue development, there may be breaking changes that require updates to your code. > -> **We'd love your feedback!** Please share any suggestions, bug reports, feature requests, or general thoughts by [filing an issue](https://www.github.com/imagekit-developer/imagekit-php/issues/new). +> **We'd love your feedback!** Please share any suggestions, bug reports, feature requests, or general thoughts by [filing an issue](https://www.github.com/stainless-sdks/imagekit-php/issues/new). The Image Kit PHP library provides convenient access to the Image Kit REST API from any PHP 8.1.0+ application. @@ -17,14 +17,12 @@ The REST API documentation can be found on [imagekit.io](https://imagekit.io/doc To use this package, install via Composer by adding the following to your application's `composer.json`: - - ```json { "repositories": [ { "type": "vcs", - "url": "git@github.com:imagekit-developer/imagekit-php.git" + "url": "git@github.com:stainless-sdks/imagekit-php.git" } ], "require": { @@ -33,8 +31,6 @@ To use this package, install via Composer by adding the following to your applic } ``` - - ## Usage This library uses named parameters to specify optional arguments. @@ -186,4 +182,4 @@ PHP 8.1.0 or higher. ## Contributing -See [the contributing documentation](https://github.com/imagekit-developer/imagekit-php/tree/master/CONTRIBUTING.md). +See [the contributing documentation](https://github.com/stainless-sdks/imagekit-php/tree/main/CONTRIBUTING.md). diff --git a/bin/check-release-environment b/bin/check-release-environment index cf571b62..0d9c55da 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -2,6 +2,10 @@ errors=() +if [ -z "${STAINLESS_API_KEY}" ]; then + errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organization secrets on GitHub.") +fi + if [ -z "${PACKAGIST_USERNAME}" ]; then errors+=("The PACKAGIST_USERNAME secret has not been set. Please set it in either this repository's secrets or your organization secrets") fi From 283174604767a8fe614ca521462f691572a695a4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 23 Sep 2025 02:58:25 +0000 Subject: [PATCH 041/193] chore(docs): update readme formatting --- README.md | 1 - 1 file changed, 1 deletion(-) diff --git a/README.md b/README.md index 15a4b864..bc994029 100644 --- a/README.md +++ b/README.md @@ -114,7 +114,6 @@ use ImageKit\RequestOptions; $client = new Client(maxRetries: 0); // Or, configure per-request: - $result = $client->files->upload( file: 'file', fileName: "file-name.jpg", From b961183d52e6374915bb9d1d403c89f561ed53a2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Sep 2025 07:22:11 +0000 Subject: [PATCH 042/193] feat(api): add path policy related non-breaking changes --- .stats.yml | 4 +-- .../Files/FileUploadParams/ResponseField.php | 2 ++ .../CustomMetadataFieldListParams.php | 32 +++++++++++++++++-- src/Files/FileUploadParams/ResponseField.php | 2 ++ .../CustomMetadataFieldsContract.php | 5 ++- src/Services/CustomMetadataFieldsService.php | 11 +++++-- 6 files changed, 48 insertions(+), 8 deletions(-) diff --git a/.stats.yml b/.stats.yml index 7c3aae1c..da19a2b5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-d1a3e6dfc45ae832b6b14a0aef25878985c679fa9f48c1470df188b1578ba648.yml -openapi_spec_hash: 1d382866fce3284f26d341f112988d9d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-1499148ce5fc81b4d8c8b3eaadf7adfaf54df5fa0b3a0452c3f5ef0dfe884a95.yml +openapi_spec_hash: e91526b143d3e696bef2b4d0ea3aa2b4 config_hash: e42d7fc3a8c92c35099cc283f9a4467a diff --git a/src/Beta/V2/Files/FileUploadParams/ResponseField.php b/src/Beta/V2/Files/FileUploadParams/ResponseField.php index acc888ab..04a9aeb2 100644 --- a/src/Beta/V2/Files/FileUploadParams/ResponseField.php +++ b/src/Beta/V2/Files/FileUploadParams/ResponseField.php @@ -19,4 +19,6 @@ enum ResponseField: string case CUSTOM_METADATA = 'customMetadata'; case METADATA = 'metadata'; + + case SELECTED_FIELDS_SCHEMA = 'selectedFieldsSchema'; } diff --git a/src/CustomMetadataFields/CustomMetadataFieldListParams.php b/src/CustomMetadataFields/CustomMetadataFieldListParams.php index 852c124a..74acf159 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldListParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldListParams.php @@ -18,6 +18,8 @@ * ``` * This API returns the array of created custom metadata field objects. By default the API returns only non deleted field objects, but you can include deleted fields in the API response. * + * You can also filter results by a specific folder path to retrieve custom metadata fields applicable at that location. This path-specific filtering is useful when using the **Path policy** feature to determine which custom metadata fields are selected for a given path. + * * @method toArray() * Returns the parameters as an associative array suitable for passing to the client method. * @@ -25,7 +27,9 @@ * * @see ImageKit\CustomMetadataFields->list * - * @phpstan-type custom_metadata_field_list_params = array{includeDeleted?: bool} + * @phpstan-type custom_metadata_field_list_params = array{ + * folderPath?: string, includeDeleted?: bool + * } */ final class CustomMetadataFieldListParams implements BaseModel { @@ -33,6 +37,13 @@ final class CustomMetadataFieldListParams implements BaseModel use SdkModel; use SdkParams; + /** + * The folder path (e.g., `/path/to/folder`) for which to retrieve applicable custom metadata fields. + * Useful for determining path-specific field selections when the [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in use. + */ + #[Api(optional: true)] + public ?string $folderPath; + /** * Set it to `true` to include deleted field objects in the API response. */ @@ -49,15 +60,30 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. */ - public static function with(?bool $includeDeleted = null): self - { + public static function with( + ?string $folderPath = null, + ?bool $includeDeleted = null + ): self { $obj = new self; + null !== $folderPath && $obj->folderPath = $folderPath; null !== $includeDeleted && $obj->includeDeleted = $includeDeleted; return $obj; } + /** + * The folder path (e.g., `/path/to/folder`) for which to retrieve applicable custom metadata fields. + * Useful for determining path-specific field selections when the [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in use. + */ + public function withFolderPath(string $folderPath): self + { + $obj = clone $this; + $obj->folderPath = $folderPath; + + return $obj; + } + /** * Set it to `true` to include deleted field objects in the API response. */ diff --git a/src/Files/FileUploadParams/ResponseField.php b/src/Files/FileUploadParams/ResponseField.php index 60d5dda6..ad83a282 100644 --- a/src/Files/FileUploadParams/ResponseField.php +++ b/src/Files/FileUploadParams/ResponseField.php @@ -19,4 +19,6 @@ enum ResponseField: string case CUSTOM_METADATA = 'customMetadata'; case METADATA = 'metadata'; + + case SELECTED_FIELDS_SCHEMA = 'selectedFieldsSchema'; } diff --git a/src/ServiceContracts/CustomMetadataFieldsContract.php b/src/ServiceContracts/CustomMetadataFieldsContract.php index edc8c5f6..f818eb4f 100644 --- a/src/ServiceContracts/CustomMetadataFieldsContract.php +++ b/src/ServiceContracts/CustomMetadataFieldsContract.php @@ -83,6 +83,8 @@ public function updateRaw( /** * @api * + * @param string $folderPath The folder path (e.g., `/path/to/folder`) for which to retrieve applicable custom metadata fields. + * Useful for determining path-specific field selections when the [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in use. * @param bool $includeDeleted set it to `true` to include deleted field objects in the API response * * @return list @@ -90,8 +92,9 @@ public function updateRaw( * @throws APIException */ public function list( + $folderPath = omit, $includeDeleted = omit, - ?RequestOptions $requestOptions = null + ?RequestOptions $requestOptions = null, ): array; /** diff --git a/src/Services/CustomMetadataFieldsService.php b/src/Services/CustomMetadataFieldsService.php index 486ddc62..b85f0945 100644 --- a/src/Services/CustomMetadataFieldsService.php +++ b/src/Services/CustomMetadataFieldsService.php @@ -136,6 +136,10 @@ public function updateRaw( * * This API returns the array of created custom metadata field objects. By default the API returns only non deleted field objects, but you can include deleted fields in the API response. * + * You can also filter results by a specific folder path to retrieve custom metadata fields applicable at that location. This path-specific filtering is useful when using the **Path policy** feature to determine which custom metadata fields are selected for a given path. + * + * @param string $folderPath The folder path (e.g., `/path/to/folder`) for which to retrieve applicable custom metadata fields. + * Useful for determining path-specific field selections when the [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in use. * @param bool $includeDeleted set it to `true` to include deleted field objects in the API response * * @return list @@ -143,10 +147,13 @@ public function updateRaw( * @throws APIException */ public function list( + $folderPath = omit, $includeDeleted = omit, - ?RequestOptions $requestOptions = null + ?RequestOptions $requestOptions = null, ): array { - $params = ['includeDeleted' => $includeDeleted]; + $params = [ + 'folderPath' => $folderPath, 'includeDeleted' => $includeDeleted, + ]; return $this->listRaw($params, $requestOptions); } From 8970696de6da93147e3e9cacc7e80a59dadaa5f3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Sep 2025 07:25:17 +0000 Subject: [PATCH 043/193] feat(api): updated docs --- .stats.yml | 4 ++-- src/CustomMetadataFields/CustomMetadataFieldListParams.php | 6 ++---- src/ServiceContracts/CustomMetadataFieldsContract.php | 3 +-- src/Services/CustomMetadataFieldsService.php | 3 +-- 4 files changed, 6 insertions(+), 10 deletions(-) diff --git a/.stats.yml b/.stats.yml index da19a2b5..6b1c558b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-1499148ce5fc81b4d8c8b3eaadf7adfaf54df5fa0b3a0452c3f5ef0dfe884a95.yml -openapi_spec_hash: e91526b143d3e696bef2b4d0ea3aa2b4 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-8d944c932f09191791cc09e90ebf8142e523c0a6dd82ae9d1dbd7ff884acfc4b.yml +openapi_spec_hash: 179e38a7a472a5f98d17aed41099cbfd config_hash: e42d7fc3a8c92c35099cc283f9a4467a diff --git a/src/CustomMetadataFields/CustomMetadataFieldListParams.php b/src/CustomMetadataFields/CustomMetadataFieldListParams.php index 74acf159..d07b18f2 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldListParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldListParams.php @@ -38,8 +38,7 @@ final class CustomMetadataFieldListParams implements BaseModel use SdkParams; /** - * The folder path (e.g., `/path/to/folder`) for which to retrieve applicable custom metadata fields. - * Useful for determining path-specific field selections when the [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in use. + * The folder path (e.g., `/path/to/folder`) for which to retrieve applicable custom metadata fields. Useful for determining path-specific field selections when the [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in use. */ #[Api(optional: true)] public ?string $folderPath; @@ -73,8 +72,7 @@ public static function with( } /** - * The folder path (e.g., `/path/to/folder`) for which to retrieve applicable custom metadata fields. - * Useful for determining path-specific field selections when the [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in use. + * The folder path (e.g., `/path/to/folder`) for which to retrieve applicable custom metadata fields. Useful for determining path-specific field selections when the [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in use. */ public function withFolderPath(string $folderPath): self { diff --git a/src/ServiceContracts/CustomMetadataFieldsContract.php b/src/ServiceContracts/CustomMetadataFieldsContract.php index f818eb4f..24c6806b 100644 --- a/src/ServiceContracts/CustomMetadataFieldsContract.php +++ b/src/ServiceContracts/CustomMetadataFieldsContract.php @@ -83,8 +83,7 @@ public function updateRaw( /** * @api * - * @param string $folderPath The folder path (e.g., `/path/to/folder`) for which to retrieve applicable custom metadata fields. - * Useful for determining path-specific field selections when the [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in use. + * @param string $folderPath The folder path (e.g., `/path/to/folder`) for which to retrieve applicable custom metadata fields. Useful for determining path-specific field selections when the [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in use. * @param bool $includeDeleted set it to `true` to include deleted field objects in the API response * * @return list diff --git a/src/Services/CustomMetadataFieldsService.php b/src/Services/CustomMetadataFieldsService.php index b85f0945..6516f700 100644 --- a/src/Services/CustomMetadataFieldsService.php +++ b/src/Services/CustomMetadataFieldsService.php @@ -138,8 +138,7 @@ public function updateRaw( * * You can also filter results by a specific folder path to retrieve custom metadata fields applicable at that location. This path-specific filtering is useful when using the **Path policy** feature to determine which custom metadata fields are selected for a given path. * - * @param string $folderPath The folder path (e.g., `/path/to/folder`) for which to retrieve applicable custom metadata fields. - * Useful for determining path-specific field selections when the [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in use. + * @param string $folderPath The folder path (e.g., `/path/to/folder`) for which to retrieve applicable custom metadata fields. Useful for determining path-specific field selections when the [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in use. * @param bool $includeDeleted set it to `true` to include deleted field objects in the API response * * @return list From 24b3de13174ce310577db618727add52833b00ef Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Sep 2025 07:29:39 +0000 Subject: [PATCH 044/193] feat(api): add selectedFieldsSchema in upload and list API response --- .stats.yml | 4 +- src/Beta/V2/Files/FileUploadParams.php | 34 +++ .../FileUploadParams/SelectedFieldsSchema.php | 273 ++++++++++++++++++ .../SelectedFieldsSchema/DefaultValue.php | 28 ++ .../DefaultValue/Mixed.php | 23 ++ .../SelectedFieldsSchema/MaxValue.php | 26 ++ .../SelectedFieldsSchema/MinValue.php | 26 ++ .../SelectedFieldsSchema/SelectOption.php | 23 ++ .../SelectedFieldsSchema/Type.php | 25 ++ src/Files/File.php | 34 +++ src/Files/File/SelectedFieldsSchema.php | 273 ++++++++++++++++++ .../SelectedFieldsSchema/DefaultValue.php | 28 ++ .../DefaultValue/Mixed.php | 23 ++ .../File/SelectedFieldsSchema/MaxValue.php | 26 ++ .../File/SelectedFieldsSchema/MinValue.php | 26 ++ .../SelectedFieldsSchema/SelectOption.php | 23 ++ src/Files/File/SelectedFieldsSchema/Type.php | 25 ++ src/Files/FileUpdateResponse.php | 34 +++ src/Files/FileUploadParams.php | 34 +++ .../FileUploadParams/SelectedFieldsSchema.php | 273 ++++++++++++++++++ .../SelectedFieldsSchema/DefaultValue.php | 28 ++ .../DefaultValue/Mixed.php | 23 ++ .../SelectedFieldsSchema/MaxValue.php | 26 ++ .../SelectedFieldsSchema/MinValue.php | 26 ++ .../SelectedFieldsSchema/SelectOption.php | 23 ++ .../SelectedFieldsSchema/Type.php | 25 ++ .../Beta/V2/FilesContract.php | 8 + src/ServiceContracts/FilesContract.php | 8 + src/Services/Beta/V2/FilesService.php | 9 + src/Services/FilesService.php | 9 + 30 files changed, 1444 insertions(+), 2 deletions(-) create mode 100644 src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema.php create mode 100644 src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue.php create mode 100644 src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue/Mixed.php create mode 100644 src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/MaxValue.php create mode 100644 src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/MinValue.php create mode 100644 src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/SelectOption.php create mode 100644 src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/Type.php create mode 100644 src/Files/File/SelectedFieldsSchema.php create mode 100644 src/Files/File/SelectedFieldsSchema/DefaultValue.php create mode 100644 src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed.php create mode 100644 src/Files/File/SelectedFieldsSchema/MaxValue.php create mode 100644 src/Files/File/SelectedFieldsSchema/MinValue.php create mode 100644 src/Files/File/SelectedFieldsSchema/SelectOption.php create mode 100644 src/Files/File/SelectedFieldsSchema/Type.php create mode 100644 src/Files/FileUploadParams/SelectedFieldsSchema.php create mode 100644 src/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue.php create mode 100644 src/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue/Mixed.php create mode 100644 src/Files/FileUploadParams/SelectedFieldsSchema/MaxValue.php create mode 100644 src/Files/FileUploadParams/SelectedFieldsSchema/MinValue.php create mode 100644 src/Files/FileUploadParams/SelectedFieldsSchema/SelectOption.php create mode 100644 src/Files/FileUploadParams/SelectedFieldsSchema/Type.php diff --git a/.stats.yml b/.stats.yml index 6b1c558b..bceb847c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-8d944c932f09191791cc09e90ebf8142e523c0a6dd82ae9d1dbd7ff884acfc4b.yml -openapi_spec_hash: 179e38a7a472a5f98d17aed41099cbfd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-7a42233daaf82345cc6d92cc49d4885126176b014c05ea0618c035869319fe53.yml +openapi_spec_hash: c41b1b6062b7c2ea548b16e0462aa358 config_hash: e42d7fc3a8c92c35099cc283f9a4467a diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index b59205d6..2ca42598 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -5,6 +5,7 @@ namespace ImageKit\Beta\V2\Files; use ImageKit\Beta\V2\Files\FileUploadParams\ResponseField; +use ImageKit\Beta\V2\Files\FileUploadParams\SelectedFieldsSchema; use ImageKit\Beta\V2\Files\FileUploadParams\Transformation; use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; @@ -61,6 +62,7 @@ * overwriteFile?: bool, * overwriteTags?: bool, * responseFields?: list>, + * selectedFieldsSchema?: array, * tags?: list, * transformation?: Transformation, * useUniqueFileName?: bool, @@ -197,6 +199,18 @@ final class FileUploadParams implements BaseModel #[Api(list: ResponseField::class, optional: true)] public ?array $responseFields; + /** + * This field is included in the response only if the Path policy feature is available in the plan. + * It contains schema definitions for the custom metadata fields selected for the specified file path. + * Field selection can only be done when the Path policy feature is enabled. + * + * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. + * + * @var array|null $selectedFieldsSchema + */ + #[Api(map: SelectedFieldsSchema::class, optional: true)] + public ?array $selectedFieldsSchema; + /** * Set the tags while uploading the file. * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. @@ -264,6 +278,7 @@ public function __construct() * @param array $customMetadata * @param list $extensions * @param list> $responseFields + * @param array $selectedFieldsSchema * @param list $tags */ public static function with( @@ -283,6 +298,7 @@ public static function with( ?bool $overwriteFile = null, ?bool $overwriteTags = null, ?array $responseFields = null, + ?array $selectedFieldsSchema = null, ?array $tags = null, ?Transformation $transformation = null, ?bool $useUniqueFileName = null, @@ -307,6 +323,7 @@ public static function with( null !== $overwriteFile && $obj->overwriteFile = $overwriteFile; null !== $overwriteTags && $obj->overwriteTags = $overwriteTags; null !== $responseFields && $obj->responseFields = array_map(fn ($v) => $v instanceof ResponseField ? $v->value : $v, $responseFields); + null !== $selectedFieldsSchema && $obj->selectedFieldsSchema = $selectedFieldsSchema; null !== $tags && $obj->tags = $tags; null !== $transformation && $obj->transformation = $transformation; null !== $useUniqueFileName && $obj->useUniqueFileName = $useUniqueFileName; @@ -520,6 +537,23 @@ public function withResponseFields(array $responseFields): self return $obj; } + /** + * This field is included in the response only if the Path policy feature is available in the plan. + * It contains schema definitions for the custom metadata fields selected for the specified file path. + * Field selection can only be done when the Path policy feature is enabled. + * + * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. + * + * @param array $selectedFieldsSchema + */ + public function withSelectedFieldsSchema(array $selectedFieldsSchema): self + { + $obj = clone $this; + $obj->selectedFieldsSchema = $selectedFieldsSchema; + + return $obj; + } + /** * Set the tags while uploading the file. * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. diff --git a/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema.php b/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema.php new file mode 100644 index 00000000..dfa3202b --- /dev/null +++ b/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema.php @@ -0,0 +1,273 @@ +, + * defaultValue?: string|float|bool|list, + * isValueRequired?: bool, + * maxLength?: float, + * maxValue?: string|float, + * minLength?: float, + * minValue?: string|float, + * readOnly?: bool, + * selectOptions?: list, + * selectOptionsTruncated?: bool, + * } + */ +final class SelectedFieldsSchema implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Type of the custom metadata field. + * + * @var value-of $type + */ + #[Api(enum: Type::class)] + public string $type; + + /** + * The default value for this custom metadata field. The value should match the `type` of custom metadata field. + * + * @var string|float|bool|list|null $defaultValue + */ + #[Api(union: DefaultValue::class, optional: true)] + public string|float|bool|array|null $defaultValue; + + /** + * Specifies if the custom metadata field is required or not. + */ + #[Api(optional: true)] + public ?bool $isValueRequired; + + /** + * Maximum length of string. Only set if `type` is set to `Text` or `Textarea`. + */ + #[Api(optional: true)] + public ?float $maxLength; + + /** + * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + */ + #[Api(optional: true)] + public string|float|null $maxValue; + + /** + * Minimum length of string. Only set if `type` is set to `Text` or `Textarea`. + */ + #[Api(optional: true)] + public ?float $minLength; + + /** + * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + */ + #[Api(optional: true)] + public string|float|null $minValue; + + /** + * Indicates whether the custom metadata field is read only. A read only field cannot be modified after being set. This field is configurable only via the **Path policy** feature. + */ + #[Api(optional: true)] + public ?bool $readOnly; + + /** + * An array of allowed values when field type is `SingleSelect` or `MultiSelect`. + * + * @var list|null $selectOptions + */ + #[Api(list: SelectOption::class, optional: true)] + public ?array $selectOptions; + + /** + * Specifies if the selectOptions array is truncated. It is truncated when number of options are > 100. + */ + #[Api(optional: true)] + public ?bool $selectOptionsTruncated; + + /** + * `new SelectedFieldsSchema()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SelectedFieldsSchema::with(type: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SelectedFieldsSchema)->withType(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Type|value-of $type + * @param string|float|bool|list $defaultValue + * @param list $selectOptions + */ + public static function with( + Type|string $type, + string|float|bool|array|null $defaultValue = null, + ?bool $isValueRequired = null, + ?float $maxLength = null, + string|float|null $maxValue = null, + ?float $minLength = null, + string|float|null $minValue = null, + ?bool $readOnly = null, + ?array $selectOptions = null, + ?bool $selectOptionsTruncated = null, + ): self { + $obj = new self; + + $obj->type = $type instanceof Type ? $type->value : $type; + + null !== $defaultValue && $obj->defaultValue = $defaultValue; + null !== $isValueRequired && $obj->isValueRequired = $isValueRequired; + null !== $maxLength && $obj->maxLength = $maxLength; + null !== $maxValue && $obj->maxValue = $maxValue; + null !== $minLength && $obj->minLength = $minLength; + null !== $minValue && $obj->minValue = $minValue; + null !== $readOnly && $obj->readOnly = $readOnly; + null !== $selectOptions && $obj->selectOptions = $selectOptions; + null !== $selectOptionsTruncated && $obj->selectOptionsTruncated = $selectOptionsTruncated; + + return $obj; + } + + /** + * Type of the custom metadata field. + * + * @param Type|value-of $type + */ + public function withType(Type|string $type): self + { + $obj = clone $this; + $obj->type = $type instanceof Type ? $type->value : $type; + + return $obj; + } + + /** + * The default value for this custom metadata field. The value should match the `type` of custom metadata field. + * + * @param string|float|bool|list $defaultValue + */ + public function withDefaultValue( + string|float|bool|array $defaultValue + ): self { + $obj = clone $this; + $obj->defaultValue = $defaultValue; + + return $obj; + } + + /** + * Specifies if the custom metadata field is required or not. + */ + public function withIsValueRequired(bool $isValueRequired): self + { + $obj = clone $this; + $obj->isValueRequired = $isValueRequired; + + return $obj; + } + + /** + * Maximum length of string. Only set if `type` is set to `Text` or `Textarea`. + */ + public function withMaxLength(float $maxLength): self + { + $obj = clone $this; + $obj->maxLength = $maxLength; + + return $obj; + } + + /** + * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + */ + public function withMaxValue(string|float $maxValue): self + { + $obj = clone $this; + $obj->maxValue = $maxValue; + + return $obj; + } + + /** + * Minimum length of string. Only set if `type` is set to `Text` or `Textarea`. + */ + public function withMinLength(float $minLength): self + { + $obj = clone $this; + $obj->minLength = $minLength; + + return $obj; + } + + /** + * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + */ + public function withMinValue(string|float $minValue): self + { + $obj = clone $this; + $obj->minValue = $minValue; + + return $obj; + } + + /** + * Indicates whether the custom metadata field is read only. A read only field cannot be modified after being set. This field is configurable only via the **Path policy** feature. + */ + public function withReadOnly(bool $readOnly): self + { + $obj = clone $this; + $obj->readOnly = $readOnly; + + return $obj; + } + + /** + * An array of allowed values when field type is `SingleSelect` or `MultiSelect`. + * + * @param list $selectOptions + */ + public function withSelectOptions(array $selectOptions): self + { + $obj = clone $this; + $obj->selectOptions = $selectOptions; + + return $obj; + } + + /** + * Specifies if the selectOptions array is truncated. It is truncated when number of options are > 100. + */ + public function withSelectOptionsTruncated( + bool $selectOptionsTruncated + ): self { + $obj = clone $this; + $obj->selectOptionsTruncated = $selectOptionsTruncated; + + return $obj; + } +} diff --git a/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue.php b/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue.php new file mode 100644 index 00000000..9a1f9ec0 --- /dev/null +++ b/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue.php @@ -0,0 +1,28 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool', new ListOf(Mixed::class)]; + } +} diff --git a/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue/Mixed.php b/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue/Mixed.php new file mode 100644 index 00000000..18df8aef --- /dev/null +++ b/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue/Mixed.php @@ -0,0 +1,23 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool']; + } +} diff --git a/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/MaxValue.php b/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/MaxValue.php new file mode 100644 index 00000000..9e809701 --- /dev/null +++ b/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/MaxValue.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float']; + } +} diff --git a/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/MinValue.php b/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/MinValue.php new file mode 100644 index 00000000..81370775 --- /dev/null +++ b/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/MinValue.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float']; + } +} diff --git a/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/SelectOption.php b/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/SelectOption.php new file mode 100644 index 00000000..e3b95102 --- /dev/null +++ b/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/SelectOption.php @@ -0,0 +1,23 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool']; + } +} diff --git a/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/Type.php b/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/Type.php new file mode 100644 index 00000000..21bc6507 --- /dev/null +++ b/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/Type.php @@ -0,0 +1,25 @@ +, * size?: float, * tags?: list|null, * thumbnail?: string, @@ -136,6 +138,18 @@ final class File implements BaseModel #[Api(optional: true)] public ?string $name; + /** + * This field is included in the response only if the Path policy feature is available in the plan. + * It contains schema definitions for the custom metadata fields selected for the specified file path. + * Field selection can only be done when the Path policy feature is enabled. + * + * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. + * + * @var array|null $selectedFieldsSchema + */ + #[Api(map: SelectedFieldsSchema::class, optional: true)] + public ?array $selectedFieldsSchema; + /** * Size of the file in bytes. */ @@ -200,6 +214,7 @@ public function __construct() * * @param list|null $aiTags * @param array $customMetadata + * @param array $selectedFieldsSchema * @param list|null $tags * @param Type|value-of $type */ @@ -218,6 +233,7 @@ public static function with( ?bool $isPublished = null, ?string $mime = null, ?string $name = null, + ?array $selectedFieldsSchema = null, ?float $size = null, ?array $tags = null, ?string $thumbnail = null, @@ -243,6 +259,7 @@ public static function with( null !== $isPublished && $obj->isPublished = $isPublished; null !== $mime && $obj->mime = $mime; null !== $name && $obj->name = $name; + null !== $selectedFieldsSchema && $obj->selectedFieldsSchema = $selectedFieldsSchema; null !== $size && $obj->size = $size; null !== $tags && $obj->tags = $tags; null !== $thumbnail && $obj->thumbnail = $thumbnail; @@ -413,6 +430,23 @@ public function withName(string $name): self return $obj; } + /** + * This field is included in the response only if the Path policy feature is available in the plan. + * It contains schema definitions for the custom metadata fields selected for the specified file path. + * Field selection can only be done when the Path policy feature is enabled. + * + * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. + * + * @param array $selectedFieldsSchema + */ + public function withSelectedFieldsSchema(array $selectedFieldsSchema): self + { + $obj = clone $this; + $obj->selectedFieldsSchema = $selectedFieldsSchema; + + return $obj; + } + /** * Size of the file in bytes. */ diff --git a/src/Files/File/SelectedFieldsSchema.php b/src/Files/File/SelectedFieldsSchema.php new file mode 100644 index 00000000..e14c5aba --- /dev/null +++ b/src/Files/File/SelectedFieldsSchema.php @@ -0,0 +1,273 @@ +, + * defaultValue?: string|float|bool|list, + * isValueRequired?: bool, + * maxLength?: float, + * maxValue?: string|float, + * minLength?: float, + * minValue?: string|float, + * readOnly?: bool, + * selectOptions?: list, + * selectOptionsTruncated?: bool, + * } + */ +final class SelectedFieldsSchema implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Type of the custom metadata field. + * + * @var value-of $type + */ + #[Api(enum: Type::class)] + public string $type; + + /** + * The default value for this custom metadata field. The value should match the `type` of custom metadata field. + * + * @var string|float|bool|list|null $defaultValue + */ + #[Api(union: DefaultValue::class, optional: true)] + public string|float|bool|array|null $defaultValue; + + /** + * Specifies if the custom metadata field is required or not. + */ + #[Api(optional: true)] + public ?bool $isValueRequired; + + /** + * Maximum length of string. Only set if `type` is set to `Text` or `Textarea`. + */ + #[Api(optional: true)] + public ?float $maxLength; + + /** + * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + */ + #[Api(optional: true)] + public string|float|null $maxValue; + + /** + * Minimum length of string. Only set if `type` is set to `Text` or `Textarea`. + */ + #[Api(optional: true)] + public ?float $minLength; + + /** + * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + */ + #[Api(optional: true)] + public string|float|null $minValue; + + /** + * Indicates whether the custom metadata field is read only. A read only field cannot be modified after being set. This field is configurable only via the **Path policy** feature. + */ + #[Api(optional: true)] + public ?bool $readOnly; + + /** + * An array of allowed values when field type is `SingleSelect` or `MultiSelect`. + * + * @var list|null $selectOptions + */ + #[Api(list: SelectOption::class, optional: true)] + public ?array $selectOptions; + + /** + * Specifies if the selectOptions array is truncated. It is truncated when number of options are > 100. + */ + #[Api(optional: true)] + public ?bool $selectOptionsTruncated; + + /** + * `new SelectedFieldsSchema()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SelectedFieldsSchema::with(type: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SelectedFieldsSchema)->withType(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Type|value-of $type + * @param string|float|bool|list $defaultValue + * @param list $selectOptions + */ + public static function with( + Type|string $type, + string|float|bool|array|null $defaultValue = null, + ?bool $isValueRequired = null, + ?float $maxLength = null, + string|float|null $maxValue = null, + ?float $minLength = null, + string|float|null $minValue = null, + ?bool $readOnly = null, + ?array $selectOptions = null, + ?bool $selectOptionsTruncated = null, + ): self { + $obj = new self; + + $obj->type = $type instanceof Type ? $type->value : $type; + + null !== $defaultValue && $obj->defaultValue = $defaultValue; + null !== $isValueRequired && $obj->isValueRequired = $isValueRequired; + null !== $maxLength && $obj->maxLength = $maxLength; + null !== $maxValue && $obj->maxValue = $maxValue; + null !== $minLength && $obj->minLength = $minLength; + null !== $minValue && $obj->minValue = $minValue; + null !== $readOnly && $obj->readOnly = $readOnly; + null !== $selectOptions && $obj->selectOptions = $selectOptions; + null !== $selectOptionsTruncated && $obj->selectOptionsTruncated = $selectOptionsTruncated; + + return $obj; + } + + /** + * Type of the custom metadata field. + * + * @param Type|value-of $type + */ + public function withType(Type|string $type): self + { + $obj = clone $this; + $obj->type = $type instanceof Type ? $type->value : $type; + + return $obj; + } + + /** + * The default value for this custom metadata field. The value should match the `type` of custom metadata field. + * + * @param string|float|bool|list $defaultValue + */ + public function withDefaultValue( + string|float|bool|array $defaultValue + ): self { + $obj = clone $this; + $obj->defaultValue = $defaultValue; + + return $obj; + } + + /** + * Specifies if the custom metadata field is required or not. + */ + public function withIsValueRequired(bool $isValueRequired): self + { + $obj = clone $this; + $obj->isValueRequired = $isValueRequired; + + return $obj; + } + + /** + * Maximum length of string. Only set if `type` is set to `Text` or `Textarea`. + */ + public function withMaxLength(float $maxLength): self + { + $obj = clone $this; + $obj->maxLength = $maxLength; + + return $obj; + } + + /** + * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + */ + public function withMaxValue(string|float $maxValue): self + { + $obj = clone $this; + $obj->maxValue = $maxValue; + + return $obj; + } + + /** + * Minimum length of string. Only set if `type` is set to `Text` or `Textarea`. + */ + public function withMinLength(float $minLength): self + { + $obj = clone $this; + $obj->minLength = $minLength; + + return $obj; + } + + /** + * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + */ + public function withMinValue(string|float $minValue): self + { + $obj = clone $this; + $obj->minValue = $minValue; + + return $obj; + } + + /** + * Indicates whether the custom metadata field is read only. A read only field cannot be modified after being set. This field is configurable only via the **Path policy** feature. + */ + public function withReadOnly(bool $readOnly): self + { + $obj = clone $this; + $obj->readOnly = $readOnly; + + return $obj; + } + + /** + * An array of allowed values when field type is `SingleSelect` or `MultiSelect`. + * + * @param list $selectOptions + */ + public function withSelectOptions(array $selectOptions): self + { + $obj = clone $this; + $obj->selectOptions = $selectOptions; + + return $obj; + } + + /** + * Specifies if the selectOptions array is truncated. It is truncated when number of options are > 100. + */ + public function withSelectOptionsTruncated( + bool $selectOptionsTruncated + ): self { + $obj = clone $this; + $obj->selectOptionsTruncated = $selectOptionsTruncated; + + return $obj; + } +} diff --git a/src/Files/File/SelectedFieldsSchema/DefaultValue.php b/src/Files/File/SelectedFieldsSchema/DefaultValue.php new file mode 100644 index 00000000..27a8e38c --- /dev/null +++ b/src/Files/File/SelectedFieldsSchema/DefaultValue.php @@ -0,0 +1,28 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool', new ListOf(Mixed::class)]; + } +} diff --git a/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed.php b/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed.php new file mode 100644 index 00000000..4170bb61 --- /dev/null +++ b/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed.php @@ -0,0 +1,23 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool']; + } +} diff --git a/src/Files/File/SelectedFieldsSchema/MaxValue.php b/src/Files/File/SelectedFieldsSchema/MaxValue.php new file mode 100644 index 00000000..c0556987 --- /dev/null +++ b/src/Files/File/SelectedFieldsSchema/MaxValue.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float']; + } +} diff --git a/src/Files/File/SelectedFieldsSchema/MinValue.php b/src/Files/File/SelectedFieldsSchema/MinValue.php new file mode 100644 index 00000000..fa356a3e --- /dev/null +++ b/src/Files/File/SelectedFieldsSchema/MinValue.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float']; + } +} diff --git a/src/Files/File/SelectedFieldsSchema/SelectOption.php b/src/Files/File/SelectedFieldsSchema/SelectOption.php new file mode 100644 index 00000000..25bd9294 --- /dev/null +++ b/src/Files/File/SelectedFieldsSchema/SelectOption.php @@ -0,0 +1,23 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool']; + } +} diff --git a/src/Files/File/SelectedFieldsSchema/Type.php b/src/Files/File/SelectedFieldsSchema/Type.php new file mode 100644 index 00000000..6d24b064 --- /dev/null +++ b/src/Files/File/SelectedFieldsSchema/Type.php @@ -0,0 +1,25 @@ +, * size?: float, * tags?: list|null, * thumbnail?: string, @@ -138,6 +140,18 @@ final class FileUpdateResponse implements BaseModel #[Api(optional: true)] public ?string $name; + /** + * This field is included in the response only if the Path policy feature is available in the plan. + * It contains schema definitions for the custom metadata fields selected for the specified file path. + * Field selection can only be done when the Path policy feature is enabled. + * + * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. + * + * @var array|null $selectedFieldsSchema + */ + #[Api(map: SelectedFieldsSchema::class, optional: true)] + public ?array $selectedFieldsSchema; + /** * Size of the file in bytes. */ @@ -205,6 +219,7 @@ public function __construct() * * @param list|null $aiTags * @param array $customMetadata + * @param array $selectedFieldsSchema * @param list|null $tags * @param Type|value-of $type */ @@ -223,6 +238,7 @@ public static function with( ?bool $isPublished = null, ?string $mime = null, ?string $name = null, + ?array $selectedFieldsSchema = null, ?float $size = null, ?array $tags = null, ?string $thumbnail = null, @@ -249,6 +265,7 @@ public static function with( null !== $isPublished && $obj->isPublished = $isPublished; null !== $mime && $obj->mime = $mime; null !== $name && $obj->name = $name; + null !== $selectedFieldsSchema && $obj->selectedFieldsSchema = $selectedFieldsSchema; null !== $size && $obj->size = $size; null !== $tags && $obj->tags = $tags; null !== $thumbnail && $obj->thumbnail = $thumbnail; @@ -420,6 +437,23 @@ public function withName(string $name): self return $obj; } + /** + * This field is included in the response only if the Path policy feature is available in the plan. + * It contains schema definitions for the custom metadata fields selected for the specified file path. + * Field selection can only be done when the Path policy feature is enabled. + * + * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. + * + * @param array $selectedFieldsSchema + */ + public function withSelectedFieldsSchema(array $selectedFieldsSchema): self + { + $obj = clone $this; + $obj->selectedFieldsSchema = $selectedFieldsSchema; + + return $obj; + } + /** * Size of the file in bytes. */ diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index cc8b80b1..7548eb47 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -13,6 +13,7 @@ use ImageKit\ExtensionItem\AutoTaggingExtension; use ImageKit\ExtensionItem\RemoveBg; use ImageKit\Files\FileUploadParams\ResponseField; +use ImageKit\Files\FileUploadParams\SelectedFieldsSchema; use ImageKit\Files\FileUploadParams\Transformation; /** @@ -63,6 +64,7 @@ * overwriteTags?: bool, * publicKey?: string, * responseFields?: list>, + * selectedFieldsSchema?: array, * signature?: string, * tags?: list, * transformation?: Transformation, @@ -222,6 +224,18 @@ final class FileUploadParams implements BaseModel #[Api(list: ResponseField::class, optional: true)] public ?array $responseFields; + /** + * This field is included in the response only if the Path policy feature is available in the plan. + * It contains schema definitions for the custom metadata fields selected for the specified file path. + * Field selection can only be done when the Path policy feature is enabled. + * + * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. + * + * @var array|null $selectedFieldsSchema + */ + #[Api(map: SelectedFieldsSchema::class, optional: true)] + public ?array $selectedFieldsSchema; + /** * HMAC-SHA1 digest of the token+expire using your ImageKit.io private API key as a key. Learn how to create a signature on the page below. This should be in lowercase. * @@ -297,6 +311,7 @@ public function __construct() * @param array $customMetadata * @param list $extensions * @param list> $responseFields + * @param array $selectedFieldsSchema * @param list $tags */ public static function with( @@ -318,6 +333,7 @@ public static function with( ?bool $overwriteTags = null, ?string $publicKey = null, ?array $responseFields = null, + ?array $selectedFieldsSchema = null, ?string $signature = null, ?array $tags = null, ?Transformation $transformation = null, @@ -345,6 +361,7 @@ public static function with( null !== $overwriteTags && $obj->overwriteTags = $overwriteTags; null !== $publicKey && $obj->publicKey = $publicKey; null !== $responseFields && $obj->responseFields = array_map(fn ($v) => $v instanceof ResponseField ? $v->value : $v, $responseFields); + null !== $selectedFieldsSchema && $obj->selectedFieldsSchema = $selectedFieldsSchema; null !== $signature && $obj->signature = $signature; null !== $tags && $obj->tags = $tags; null !== $transformation && $obj->transformation = $transformation; @@ -591,6 +608,23 @@ public function withResponseFields(array $responseFields): self return $obj; } + /** + * This field is included in the response only if the Path policy feature is available in the plan. + * It contains schema definitions for the custom metadata fields selected for the specified file path. + * Field selection can only be done when the Path policy feature is enabled. + * + * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. + * + * @param array $selectedFieldsSchema + */ + public function withSelectedFieldsSchema(array $selectedFieldsSchema): self + { + $obj = clone $this; + $obj->selectedFieldsSchema = $selectedFieldsSchema; + + return $obj; + } + /** * HMAC-SHA1 digest of the token+expire using your ImageKit.io private API key as a key. Learn how to create a signature on the page below. This should be in lowercase. * diff --git a/src/Files/FileUploadParams/SelectedFieldsSchema.php b/src/Files/FileUploadParams/SelectedFieldsSchema.php new file mode 100644 index 00000000..f940b1f4 --- /dev/null +++ b/src/Files/FileUploadParams/SelectedFieldsSchema.php @@ -0,0 +1,273 @@ +, + * defaultValue?: string|float|bool|list, + * isValueRequired?: bool, + * maxLength?: float, + * maxValue?: string|float, + * minLength?: float, + * minValue?: string|float, + * readOnly?: bool, + * selectOptions?: list, + * selectOptionsTruncated?: bool, + * } + */ +final class SelectedFieldsSchema implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Type of the custom metadata field. + * + * @var value-of $type + */ + #[Api(enum: Type::class)] + public string $type; + + /** + * The default value for this custom metadata field. The value should match the `type` of custom metadata field. + * + * @var string|float|bool|list|null $defaultValue + */ + #[Api(union: DefaultValue::class, optional: true)] + public string|float|bool|array|null $defaultValue; + + /** + * Specifies if the custom metadata field is required or not. + */ + #[Api(optional: true)] + public ?bool $isValueRequired; + + /** + * Maximum length of string. Only set if `type` is set to `Text` or `Textarea`. + */ + #[Api(optional: true)] + public ?float $maxLength; + + /** + * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + */ + #[Api(optional: true)] + public string|float|null $maxValue; + + /** + * Minimum length of string. Only set if `type` is set to `Text` or `Textarea`. + */ + #[Api(optional: true)] + public ?float $minLength; + + /** + * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + */ + #[Api(optional: true)] + public string|float|null $minValue; + + /** + * Indicates whether the custom metadata field is read only. A read only field cannot be modified after being set. This field is configurable only via the **Path policy** feature. + */ + #[Api(optional: true)] + public ?bool $readOnly; + + /** + * An array of allowed values when field type is `SingleSelect` or `MultiSelect`. + * + * @var list|null $selectOptions + */ + #[Api(list: SelectOption::class, optional: true)] + public ?array $selectOptions; + + /** + * Specifies if the selectOptions array is truncated. It is truncated when number of options are > 100. + */ + #[Api(optional: true)] + public ?bool $selectOptionsTruncated; + + /** + * `new SelectedFieldsSchema()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SelectedFieldsSchema::with(type: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SelectedFieldsSchema)->withType(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Type|value-of $type + * @param string|float|bool|list $defaultValue + * @param list $selectOptions + */ + public static function with( + Type|string $type, + string|float|bool|array|null $defaultValue = null, + ?bool $isValueRequired = null, + ?float $maxLength = null, + string|float|null $maxValue = null, + ?float $minLength = null, + string|float|null $minValue = null, + ?bool $readOnly = null, + ?array $selectOptions = null, + ?bool $selectOptionsTruncated = null, + ): self { + $obj = new self; + + $obj->type = $type instanceof Type ? $type->value : $type; + + null !== $defaultValue && $obj->defaultValue = $defaultValue; + null !== $isValueRequired && $obj->isValueRequired = $isValueRequired; + null !== $maxLength && $obj->maxLength = $maxLength; + null !== $maxValue && $obj->maxValue = $maxValue; + null !== $minLength && $obj->minLength = $minLength; + null !== $minValue && $obj->minValue = $minValue; + null !== $readOnly && $obj->readOnly = $readOnly; + null !== $selectOptions && $obj->selectOptions = $selectOptions; + null !== $selectOptionsTruncated && $obj->selectOptionsTruncated = $selectOptionsTruncated; + + return $obj; + } + + /** + * Type of the custom metadata field. + * + * @param Type|value-of $type + */ + public function withType(Type|string $type): self + { + $obj = clone $this; + $obj->type = $type instanceof Type ? $type->value : $type; + + return $obj; + } + + /** + * The default value for this custom metadata field. The value should match the `type` of custom metadata field. + * + * @param string|float|bool|list $defaultValue + */ + public function withDefaultValue( + string|float|bool|array $defaultValue + ): self { + $obj = clone $this; + $obj->defaultValue = $defaultValue; + + return $obj; + } + + /** + * Specifies if the custom metadata field is required or not. + */ + public function withIsValueRequired(bool $isValueRequired): self + { + $obj = clone $this; + $obj->isValueRequired = $isValueRequired; + + return $obj; + } + + /** + * Maximum length of string. Only set if `type` is set to `Text` or `Textarea`. + */ + public function withMaxLength(float $maxLength): self + { + $obj = clone $this; + $obj->maxLength = $maxLength; + + return $obj; + } + + /** + * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + */ + public function withMaxValue(string|float $maxValue): self + { + $obj = clone $this; + $obj->maxValue = $maxValue; + + return $obj; + } + + /** + * Minimum length of string. Only set if `type` is set to `Text` or `Textarea`. + */ + public function withMinLength(float $minLength): self + { + $obj = clone $this; + $obj->minLength = $minLength; + + return $obj; + } + + /** + * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + */ + public function withMinValue(string|float $minValue): self + { + $obj = clone $this; + $obj->minValue = $minValue; + + return $obj; + } + + /** + * Indicates whether the custom metadata field is read only. A read only field cannot be modified after being set. This field is configurable only via the **Path policy** feature. + */ + public function withReadOnly(bool $readOnly): self + { + $obj = clone $this; + $obj->readOnly = $readOnly; + + return $obj; + } + + /** + * An array of allowed values when field type is `SingleSelect` or `MultiSelect`. + * + * @param list $selectOptions + */ + public function withSelectOptions(array $selectOptions): self + { + $obj = clone $this; + $obj->selectOptions = $selectOptions; + + return $obj; + } + + /** + * Specifies if the selectOptions array is truncated. It is truncated when number of options are > 100. + */ + public function withSelectOptionsTruncated( + bool $selectOptionsTruncated + ): self { + $obj = clone $this; + $obj->selectOptionsTruncated = $selectOptionsTruncated; + + return $obj; + } +} diff --git a/src/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue.php b/src/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue.php new file mode 100644 index 00000000..6dd5453a --- /dev/null +++ b/src/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue.php @@ -0,0 +1,28 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool', new ListOf(Mixed::class)]; + } +} diff --git a/src/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue/Mixed.php b/src/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue/Mixed.php new file mode 100644 index 00000000..8b607be5 --- /dev/null +++ b/src/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue/Mixed.php @@ -0,0 +1,23 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool']; + } +} diff --git a/src/Files/FileUploadParams/SelectedFieldsSchema/MaxValue.php b/src/Files/FileUploadParams/SelectedFieldsSchema/MaxValue.php new file mode 100644 index 00000000..2458527c --- /dev/null +++ b/src/Files/FileUploadParams/SelectedFieldsSchema/MaxValue.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float']; + } +} diff --git a/src/Files/FileUploadParams/SelectedFieldsSchema/MinValue.php b/src/Files/FileUploadParams/SelectedFieldsSchema/MinValue.php new file mode 100644 index 00000000..2445f532 --- /dev/null +++ b/src/Files/FileUploadParams/SelectedFieldsSchema/MinValue.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float']; + } +} diff --git a/src/Files/FileUploadParams/SelectedFieldsSchema/SelectOption.php b/src/Files/FileUploadParams/SelectedFieldsSchema/SelectOption.php new file mode 100644 index 00000000..56a8843f --- /dev/null +++ b/src/Files/FileUploadParams/SelectedFieldsSchema/SelectOption.php @@ -0,0 +1,23 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool']; + } +} diff --git a/src/Files/FileUploadParams/SelectedFieldsSchema/Type.php b/src/Files/FileUploadParams/SelectedFieldsSchema/Type.php new file mode 100644 index 00000000..39a17143 --- /dev/null +++ b/src/Files/FileUploadParams/SelectedFieldsSchema/Type.php @@ -0,0 +1,25 @@ +> $responseFields array of response field keys to include in the API response body + * @param array $selectedFieldsSchema This field is included in the response only if the Path policy feature is available in the plan. + * It contains schema definitions for the custom metadata fields selected for the specified file path. + * Field selection can only be done when the Path policy feature is enabled. + * + * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * @param list $tags Set the tags while uploading the file. * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. * If this field is not specified and the file is overwritten, the existing tags will be removed. @@ -95,6 +102,7 @@ public function upload( $overwriteFile = omit, $overwriteTags = omit, $responseFields = omit, + $selectedFieldsSchema = omit, $tags = omit, $transformation = omit, $useUniqueFileName = omit, diff --git a/src/ServiceContracts/FilesContract.php b/src/ServiceContracts/FilesContract.php index 8d06b2f5..39fd5311 100644 --- a/src/ServiceContracts/FilesContract.php +++ b/src/ServiceContracts/FilesContract.php @@ -16,6 +16,7 @@ use ImageKit\Files\FileUpdateParams\Publish; use ImageKit\Files\FileUpdateResponse; use ImageKit\Files\FileUploadParams\ResponseField; +use ImageKit\Files\FileUploadParams\SelectedFieldsSchema; use ImageKit\Files\FileUploadParams\Transformation; use ImageKit\Files\FileUploadResponse; use ImageKit\RequestOptions; @@ -276,6 +277,12 @@ public function renameRaw( * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed * @param string $publicKey Your ImageKit.io public key. This field is only required for authentication when uploading a file from the client side. * @param list> $responseFields array of response field keys to include in the API response body + * @param array $selectedFieldsSchema This field is included in the response only if the Path policy feature is available in the plan. + * It contains schema definitions for the custom metadata fields selected for the specified file path. + * Field selection can only be done when the Path policy feature is enabled. + * + * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * @param string $signature HMAC-SHA1 digest of the token+expire using your ImageKit.io private API key as a key. Learn how to create a signature on the page below. This should be in lowercase. * * Signature must be calculated on the server-side. This field is only required for authentication when uploading a file from the client side. @@ -321,6 +328,7 @@ public function upload( $overwriteTags = omit, $publicKey = omit, $responseFields = omit, + $selectedFieldsSchema = omit, $signature = omit, $tags = omit, $transformation = omit, diff --git a/src/Services/Beta/V2/FilesService.php b/src/Services/Beta/V2/FilesService.php index 118d9abd..c706c2e1 100644 --- a/src/Services/Beta/V2/FilesService.php +++ b/src/Services/Beta/V2/FilesService.php @@ -6,6 +6,7 @@ use ImageKit\Beta\V2\Files\FileUploadParams; use ImageKit\Beta\V2\Files\FileUploadParams\ResponseField; +use ImageKit\Beta\V2\Files\FileUploadParams\SelectedFieldsSchema; use ImageKit\Beta\V2\Files\FileUploadParams\Transformation; use ImageKit\Beta\V2\Files\FileUploadResponse; use ImageKit\Client; @@ -78,6 +79,12 @@ public function __construct(private Client $client) {} * @param bool $overwriteFile if `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed * @param list> $responseFields array of response field keys to include in the API response body + * @param array $selectedFieldsSchema This field is included in the response only if the Path policy feature is available in the plan. + * It contains schema definitions for the custom metadata fields selected for the specified file path. + * Field selection can only be done when the Path policy feature is enabled. + * + * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * @param list $tags Set the tags while uploading the file. * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. * If this field is not specified and the file is overwritten, the existing tags will be removed. @@ -118,6 +125,7 @@ public function upload( $overwriteFile = omit, $overwriteTags = omit, $responseFields = omit, + $selectedFieldsSchema = omit, $tags = omit, $transformation = omit, $useUniqueFileName = omit, @@ -141,6 +149,7 @@ public function upload( 'overwriteFile' => $overwriteFile, 'overwriteTags' => $overwriteTags, 'responseFields' => $responseFields, + 'selectedFieldsSchema' => $selectedFieldsSchema, 'tags' => $tags, 'transformation' => $transformation, 'useUniqueFileName' => $useUniqueFileName, diff --git a/src/Services/FilesService.php b/src/Services/FilesService.php index 6d9a729e..3467faba 100644 --- a/src/Services/FilesService.php +++ b/src/Services/FilesService.php @@ -22,6 +22,7 @@ use ImageKit\Files\FileUpdateResponse; use ImageKit\Files\FileUploadParams; use ImageKit\Files\FileUploadParams\ResponseField; +use ImageKit\Files\FileUploadParams\SelectedFieldsSchema; use ImageKit\Files\FileUploadParams\Transformation; use ImageKit\Files\FileUploadResponse; use ImageKit\RequestOptions; @@ -461,6 +462,12 @@ public function renameRaw( * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed * @param string $publicKey Your ImageKit.io public key. This field is only required for authentication when uploading a file from the client side. * @param list> $responseFields array of response field keys to include in the API response body + * @param array $selectedFieldsSchema This field is included in the response only if the Path policy feature is available in the plan. + * It contains schema definitions for the custom metadata fields selected for the specified file path. + * Field selection can only be done when the Path policy feature is enabled. + * + * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * @param string $signature HMAC-SHA1 digest of the token+expire using your ImageKit.io private API key as a key. Learn how to create a signature on the page below. This should be in lowercase. * * Signature must be calculated on the server-side. This field is only required for authentication when uploading a file from the client side. @@ -506,6 +513,7 @@ public function upload( $overwriteTags = omit, $publicKey = omit, $responseFields = omit, + $selectedFieldsSchema = omit, $signature = omit, $tags = omit, $transformation = omit, @@ -532,6 +540,7 @@ public function upload( 'overwriteTags' => $overwriteTags, 'publicKey' => $publicKey, 'responseFields' => $responseFields, + 'selectedFieldsSchema' => $selectedFieldsSchema, 'signature' => $signature, 'tags' => $tags, 'transformation' => $transformation, From d0d0590988600c967eb2d54f0bf3c06868dc6942 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Sep 2025 07:39:21 +0000 Subject: [PATCH 045/193] docs: correct typo in default value description for custom metadata field --- .stats.yml | 4 ++-- src/CustomMetadataFields/CustomMetadataField/Schema.php | 4 ++-- .../CustomMetadataField/Schema/DefaultValue.php | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.stats.yml b/.stats.yml index bceb847c..56e1384b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-7a42233daaf82345cc6d92cc49d4885126176b014c05ea0618c035869319fe53.yml -openapi_spec_hash: c41b1b6062b7c2ea548b16e0462aa358 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-aa4c8e857ae03b12dabf168c83c62f759e2706d69fa4eb77d11519d45a5dada2.yml +openapi_spec_hash: 6ea00242c4685fb6422328f0dd53f9b1 config_hash: e42d7fc3a8c92c35099cc283f9a4467a diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema.php b/src/CustomMetadataFields/CustomMetadataField/Schema.php index 7590361c..374f9092 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema.php @@ -39,7 +39,7 @@ final class Schema implements BaseModel public string $type; /** - * The default value for this custom metadata field. Date type of default value depends on the field type. + * The default value for this custom metadata field. Data type of default value depends on the field type. * * @var string|float|bool|list|null $defaultValue */ @@ -151,7 +151,7 @@ public function withType(Type|string $type): self } /** - * The default value for this custom metadata field. Date type of default value depends on the field type. + * The default value for this custom metadata field. Data type of default value depends on the field type. * * @param string|float|bool|list $defaultValue */ diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php index 6be6b638..3af28f2e 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php @@ -11,7 +11,7 @@ use ImageKit\CustomMetadataFields\CustomMetadataField\Schema\DefaultValue\Mixed; /** - * The default value for this custom metadata field. Date type of default value depends on the field type. + * The default value for this custom metadata field. Data type of default value depends on the field type. */ final class DefaultValue implements ConverterSource { From d79cd6841ecb59fd1360663036af57b27c00f8fa Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 30 Sep 2025 07:49:36 +0000 Subject: [PATCH 046/193] feat(api): fix upload API request params --- .stats.yml | 4 +- src/Beta/V2/Files/FileUploadParams.php | 34 --- src/Beta/V2/Files/FileUploadResponse.php | 34 +++ .../SelectedFieldsSchema.php | 8 +- .../SelectedFieldsSchema/DefaultValue.php | 4 +- .../DefaultValue/Mixed.php | 2 +- .../SelectedFieldsSchema/MaxValue.php | 2 +- .../SelectedFieldsSchema/MinValue.php | 2 +- .../SelectedFieldsSchema/SelectOption.php | 2 +- .../SelectedFieldsSchema/Type.php | 2 +- src/Files/FileUploadParams.php | 34 --- src/Files/FileUploadResponse.php | 34 +++ .../SelectedFieldsSchema.php | 8 +- .../SelectedFieldsSchema/DefaultValue.php | 4 +- .../DefaultValue/Mixed.php | 2 +- .../SelectedFieldsSchema/MaxValue.php | 2 +- .../SelectedFieldsSchema/MinValue.php | 2 +- .../SelectedFieldsSchema/SelectOption.php | 2 +- .../SelectedFieldsSchema/Type.php | 2 +- .../Beta/V2/FilesContract.php | 8 - src/ServiceContracts/FilesContract.php | 8 - src/Services/Beta/V2/FilesService.php | 9 - src/Services/FilesService.php | 9 - .../UploadPreTransformSuccessEvent/Data.php | 34 +++ .../Data/SelectedFieldsSchema.php | 273 ++++++++++++++++++ .../SelectedFieldsSchema/DefaultValue.php | 28 ++ .../DefaultValue/Mixed.php | 23 ++ .../Data/SelectedFieldsSchema/MaxValue.php | 26 ++ .../Data/SelectedFieldsSchema/MinValue.php | 26 ++ .../SelectedFieldsSchema/SelectOption.php | 23 ++ .../Data/SelectedFieldsSchema/Type.php | 25 ++ 31 files changed, 550 insertions(+), 126 deletions(-) rename src/Beta/V2/Files/{FileUploadParams => FileUploadResponse}/SelectedFieldsSchema.php (96%) rename src/Beta/V2/Files/{FileUploadParams => FileUploadResponse}/SelectedFieldsSchema/DefaultValue.php (80%) rename src/Beta/V2/Files/{FileUploadParams => FileUploadResponse}/SelectedFieldsSchema/DefaultValue/Mixed.php (84%) rename src/Beta/V2/Files/{FileUploadParams => FileUploadResponse}/SelectedFieldsSchema/MaxValue.php (90%) rename src/Beta/V2/Files/{FileUploadParams => FileUploadResponse}/SelectedFieldsSchema/MinValue.php (90%) rename src/Beta/V2/Files/{FileUploadParams => FileUploadResponse}/SelectedFieldsSchema/SelectOption.php (86%) rename src/Beta/V2/Files/{FileUploadParams => FileUploadResponse}/SelectedFieldsSchema/Type.php (81%) rename src/Files/{FileUploadParams => FileUploadResponse}/SelectedFieldsSchema.php (96%) rename src/Files/{FileUploadParams => FileUploadResponse}/SelectedFieldsSchema/DefaultValue.php (82%) rename src/Files/{FileUploadParams => FileUploadResponse}/SelectedFieldsSchema/DefaultValue/Mixed.php (85%) rename src/Files/{FileUploadParams => FileUploadResponse}/SelectedFieldsSchema/MaxValue.php (91%) rename src/Files/{FileUploadParams => FileUploadResponse}/SelectedFieldsSchema/MinValue.php (91%) rename src/Files/{FileUploadParams => FileUploadResponse}/SelectedFieldsSchema/SelectOption.php (87%) rename src/Files/{FileUploadParams => FileUploadResponse}/SelectedFieldsSchema/Type.php (83%) create mode 100644 src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php create mode 100644 src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php create mode 100644 src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed.php create mode 100644 src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MaxValue.php create mode 100644 src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MinValue.php create mode 100644 src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/SelectOption.php create mode 100644 src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/Type.php diff --git a/.stats.yml b/.stats.yml index 56e1384b..0c9c486c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-aa4c8e857ae03b12dabf168c83c62f759e2706d69fa4eb77d11519d45a5dada2.yml -openapi_spec_hash: 6ea00242c4685fb6422328f0dd53f9b1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-01aef94bd928f40b7209dc21df71e2312d4bee430119b30ee05d75cf5e1b4801.yml +openapi_spec_hash: 054c332db88b23d362f72583dd24b2aa config_hash: e42d7fc3a8c92c35099cc283f9a4467a diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index 2ca42598..b59205d6 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -5,7 +5,6 @@ namespace ImageKit\Beta\V2\Files; use ImageKit\Beta\V2\Files\FileUploadParams\ResponseField; -use ImageKit\Beta\V2\Files\FileUploadParams\SelectedFieldsSchema; use ImageKit\Beta\V2\Files\FileUploadParams\Transformation; use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; @@ -62,7 +61,6 @@ * overwriteFile?: bool, * overwriteTags?: bool, * responseFields?: list>, - * selectedFieldsSchema?: array, * tags?: list, * transformation?: Transformation, * useUniqueFileName?: bool, @@ -199,18 +197,6 @@ final class FileUploadParams implements BaseModel #[Api(list: ResponseField::class, optional: true)] public ?array $responseFields; - /** - * This field is included in the response only if the Path policy feature is available in the plan. - * It contains schema definitions for the custom metadata fields selected for the specified file path. - * Field selection can only be done when the Path policy feature is enabled. - * - * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. - * - * @var array|null $selectedFieldsSchema - */ - #[Api(map: SelectedFieldsSchema::class, optional: true)] - public ?array $selectedFieldsSchema; - /** * Set the tags while uploading the file. * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. @@ -278,7 +264,6 @@ public function __construct() * @param array $customMetadata * @param list $extensions * @param list> $responseFields - * @param array $selectedFieldsSchema * @param list $tags */ public static function with( @@ -298,7 +283,6 @@ public static function with( ?bool $overwriteFile = null, ?bool $overwriteTags = null, ?array $responseFields = null, - ?array $selectedFieldsSchema = null, ?array $tags = null, ?Transformation $transformation = null, ?bool $useUniqueFileName = null, @@ -323,7 +307,6 @@ public static function with( null !== $overwriteFile && $obj->overwriteFile = $overwriteFile; null !== $overwriteTags && $obj->overwriteTags = $overwriteTags; null !== $responseFields && $obj->responseFields = array_map(fn ($v) => $v instanceof ResponseField ? $v->value : $v, $responseFields); - null !== $selectedFieldsSchema && $obj->selectedFieldsSchema = $selectedFieldsSchema; null !== $tags && $obj->tags = $tags; null !== $transformation && $obj->transformation = $transformation; null !== $useUniqueFileName && $obj->useUniqueFileName = $useUniqueFileName; @@ -537,23 +520,6 @@ public function withResponseFields(array $responseFields): self return $obj; } - /** - * This field is included in the response only if the Path policy feature is available in the plan. - * It contains schema definitions for the custom metadata fields selected for the specified file path. - * Field selection can only be done when the Path policy feature is enabled. - * - * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. - * - * @param array $selectedFieldsSchema - */ - public function withSelectedFieldsSchema(array $selectedFieldsSchema): self - { - $obj = clone $this; - $obj->selectedFieldsSchema = $selectedFieldsSchema; - - return $obj; - } - /** * Set the tags while uploading the file. * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. diff --git a/src/Beta/V2/Files/FileUploadResponse.php b/src/Beta/V2/Files/FileUploadResponse.php index aa068676..207e19a8 100644 --- a/src/Beta/V2/Files/FileUploadResponse.php +++ b/src/Beta/V2/Files/FileUploadResponse.php @@ -6,6 +6,7 @@ use ImageKit\Beta\V2\Files\FileUploadResponse\AITag; use ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; +use ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; use ImageKit\Beta\V2\Files\FileUploadResponse\VersionInfo; use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; @@ -33,6 +34,7 @@ * isPublished?: bool, * metadata?: Metadata, * name?: string, + * selectedFieldsSchema?: array, * size?: float, * tags?: list|null, * thumbnailURL?: string, @@ -165,6 +167,18 @@ final class FileUploadResponse implements BaseModel #[Api(optional: true)] public ?string $name; + /** + * This field is included in the response only if the Path policy feature is available in the plan. + * It contains schema definitions for the custom metadata fields selected for the specified file path. + * Field selection can only be done when the Path policy feature is enabled. + * + * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. + * + * @var array|null $selectedFieldsSchema + */ + #[Api(map: SelectedFieldsSchema::class, optional: true)] + public ?array $selectedFieldsSchema; + /** * Size of the image file in Bytes. */ @@ -222,6 +236,7 @@ public function __construct() * @param list|null $aiTags * @param array $customMetadata * @param array $embeddedMetadata + * @param array $selectedFieldsSchema * @param list|null $tags */ public static function with( @@ -242,6 +257,7 @@ public static function with( ?bool $isPublished = null, ?Metadata $metadata = null, ?string $name = null, + ?array $selectedFieldsSchema = null, ?float $size = null, ?array $tags = null, ?string $thumbnailURL = null, @@ -269,6 +285,7 @@ public static function with( null !== $isPublished && $obj->isPublished = $isPublished; null !== $metadata && $obj->metadata = $metadata; null !== $name && $obj->name = $name; + null !== $selectedFieldsSchema && $obj->selectedFieldsSchema = $selectedFieldsSchema; null !== $size && $obj->size = $size; null !== $tags && $obj->tags = $tags; null !== $thumbnailURL && $obj->thumbnailURL = $thumbnailURL; @@ -479,6 +496,23 @@ public function withName(string $name): self return $obj; } + /** + * This field is included in the response only if the Path policy feature is available in the plan. + * It contains schema definitions for the custom metadata fields selected for the specified file path. + * Field selection can only be done when the Path policy feature is enabled. + * + * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. + * + * @param array $selectedFieldsSchema + */ + public function withSelectedFieldsSchema(array $selectedFieldsSchema): self + { + $obj = clone $this; + $obj->selectedFieldsSchema = $selectedFieldsSchema; + + return $obj; + } + /** * Size of the image file in Bytes. */ diff --git a/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php similarity index 96% rename from src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema.php rename to src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php index dfa3202b..759dcdd8 100644 --- a/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadParams; +namespace ImageKit\Beta\V2\Files\FileUploadResponse; -use ImageKit\Beta\V2\Files\FileUploadParams\SelectedFieldsSchema\DefaultValue; -use ImageKit\Beta\V2\Files\FileUploadParams\SelectedFieldsSchema\SelectOption; -use ImageKit\Beta\V2\Files\FileUploadParams\SelectedFieldsSchema\Type; +use ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue; +use ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\SelectOption; +use ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\Type; use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; diff --git a/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php similarity index 80% rename from src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue.php rename to src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php index 9a1f9ec0..38496da7 100644 --- a/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadParams\SelectedFieldsSchema; +namespace ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; -use ImageKit\Beta\V2\Files\FileUploadParams\SelectedFieldsSchema\DefaultValue\Mixed; +use ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed; use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; diff --git a/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue/Mixed.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed.php similarity index 84% rename from src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue/Mixed.php rename to src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed.php index 18df8aef..71e66d9a 100644 --- a/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue/Mixed.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadParams\SelectedFieldsSchema\DefaultValue; +namespace ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue; use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; diff --git a/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/MaxValue.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php similarity index 90% rename from src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/MaxValue.php rename to src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php index 9e809701..2487b667 100644 --- a/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/MaxValue.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadParams\SelectedFieldsSchema; +namespace ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; diff --git a/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/MinValue.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php similarity index 90% rename from src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/MinValue.php rename to src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php index 81370775..9b9e769e 100644 --- a/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/MinValue.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadParams\SelectedFieldsSchema; +namespace ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; diff --git a/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/SelectOption.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php similarity index 86% rename from src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/SelectOption.php rename to src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php index e3b95102..b1411ab0 100644 --- a/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/SelectOption.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadParams\SelectedFieldsSchema; +namespace ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; diff --git a/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/Type.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/Type.php similarity index 81% rename from src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/Type.php rename to src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/Type.php index 21bc6507..e41d977e 100644 --- a/src/Beta/V2/Files/FileUploadParams/SelectedFieldsSchema/Type.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadParams\SelectedFieldsSchema; +namespace ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; /** * Type of the custom metadata field. diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index 7548eb47..cc8b80b1 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -13,7 +13,6 @@ use ImageKit\ExtensionItem\AutoTaggingExtension; use ImageKit\ExtensionItem\RemoveBg; use ImageKit\Files\FileUploadParams\ResponseField; -use ImageKit\Files\FileUploadParams\SelectedFieldsSchema; use ImageKit\Files\FileUploadParams\Transformation; /** @@ -64,7 +63,6 @@ * overwriteTags?: bool, * publicKey?: string, * responseFields?: list>, - * selectedFieldsSchema?: array, * signature?: string, * tags?: list, * transformation?: Transformation, @@ -224,18 +222,6 @@ final class FileUploadParams implements BaseModel #[Api(list: ResponseField::class, optional: true)] public ?array $responseFields; - /** - * This field is included in the response only if the Path policy feature is available in the plan. - * It contains schema definitions for the custom metadata fields selected for the specified file path. - * Field selection can only be done when the Path policy feature is enabled. - * - * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. - * - * @var array|null $selectedFieldsSchema - */ - #[Api(map: SelectedFieldsSchema::class, optional: true)] - public ?array $selectedFieldsSchema; - /** * HMAC-SHA1 digest of the token+expire using your ImageKit.io private API key as a key. Learn how to create a signature on the page below. This should be in lowercase. * @@ -311,7 +297,6 @@ public function __construct() * @param array $customMetadata * @param list $extensions * @param list> $responseFields - * @param array $selectedFieldsSchema * @param list $tags */ public static function with( @@ -333,7 +318,6 @@ public static function with( ?bool $overwriteTags = null, ?string $publicKey = null, ?array $responseFields = null, - ?array $selectedFieldsSchema = null, ?string $signature = null, ?array $tags = null, ?Transformation $transformation = null, @@ -361,7 +345,6 @@ public static function with( null !== $overwriteTags && $obj->overwriteTags = $overwriteTags; null !== $publicKey && $obj->publicKey = $publicKey; null !== $responseFields && $obj->responseFields = array_map(fn ($v) => $v instanceof ResponseField ? $v->value : $v, $responseFields); - null !== $selectedFieldsSchema && $obj->selectedFieldsSchema = $selectedFieldsSchema; null !== $signature && $obj->signature = $signature; null !== $tags && $obj->tags = $tags; null !== $transformation && $obj->transformation = $transformation; @@ -608,23 +591,6 @@ public function withResponseFields(array $responseFields): self return $obj; } - /** - * This field is included in the response only if the Path policy feature is available in the plan. - * It contains schema definitions for the custom metadata fields selected for the specified file path. - * Field selection can only be done when the Path policy feature is enabled. - * - * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. - * - * @param array $selectedFieldsSchema - */ - public function withSelectedFieldsSchema(array $selectedFieldsSchema): self - { - $obj = clone $this; - $obj->selectedFieldsSchema = $selectedFieldsSchema; - - return $obj; - } - /** * HMAC-SHA1 digest of the token+expire using your ImageKit.io private API key as a key. Learn how to create a signature on the page below. This should be in lowercase. * diff --git a/src/Files/FileUploadResponse.php b/src/Files/FileUploadResponse.php index af945619..77e21283 100644 --- a/src/Files/FileUploadResponse.php +++ b/src/Files/FileUploadResponse.php @@ -9,6 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; use ImageKit\Files\FileUploadResponse\AITag; use ImageKit\Files\FileUploadResponse\ExtensionStatus; +use ImageKit\Files\FileUploadResponse\SelectedFieldsSchema; use ImageKit\Files\FileUploadResponse\VersionInfo; /** @@ -32,6 +33,7 @@ * isPublished?: bool, * metadata?: Metadata, * name?: string, + * selectedFieldsSchema?: array, * size?: float, * tags?: list|null, * thumbnailURL?: string, @@ -164,6 +166,18 @@ final class FileUploadResponse implements BaseModel #[Api(optional: true)] public ?string $name; + /** + * This field is included in the response only if the Path policy feature is available in the plan. + * It contains schema definitions for the custom metadata fields selected for the specified file path. + * Field selection can only be done when the Path policy feature is enabled. + * + * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. + * + * @var array|null $selectedFieldsSchema + */ + #[Api(map: SelectedFieldsSchema::class, optional: true)] + public ?array $selectedFieldsSchema; + /** * Size of the image file in Bytes. */ @@ -221,6 +235,7 @@ public function __construct() * @param list|null $aiTags * @param array $customMetadata * @param array $embeddedMetadata + * @param array $selectedFieldsSchema * @param list|null $tags */ public static function with( @@ -241,6 +256,7 @@ public static function with( ?bool $isPublished = null, ?Metadata $metadata = null, ?string $name = null, + ?array $selectedFieldsSchema = null, ?float $size = null, ?array $tags = null, ?string $thumbnailURL = null, @@ -268,6 +284,7 @@ public static function with( null !== $isPublished && $obj->isPublished = $isPublished; null !== $metadata && $obj->metadata = $metadata; null !== $name && $obj->name = $name; + null !== $selectedFieldsSchema && $obj->selectedFieldsSchema = $selectedFieldsSchema; null !== $size && $obj->size = $size; null !== $tags && $obj->tags = $tags; null !== $thumbnailURL && $obj->thumbnailURL = $thumbnailURL; @@ -478,6 +495,23 @@ public function withName(string $name): self return $obj; } + /** + * This field is included in the response only if the Path policy feature is available in the plan. + * It contains schema definitions for the custom metadata fields selected for the specified file path. + * Field selection can only be done when the Path policy feature is enabled. + * + * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. + * + * @param array $selectedFieldsSchema + */ + public function withSelectedFieldsSchema(array $selectedFieldsSchema): self + { + $obj = clone $this; + $obj->selectedFieldsSchema = $selectedFieldsSchema; + + return $obj; + } + /** * Size of the image file in Bytes. */ diff --git a/src/Files/FileUploadParams/SelectedFieldsSchema.php b/src/Files/FileUploadResponse/SelectedFieldsSchema.php similarity index 96% rename from src/Files/FileUploadParams/SelectedFieldsSchema.php rename to src/Files/FileUploadResponse/SelectedFieldsSchema.php index f940b1f4..8b66451e 100644 --- a/src/Files/FileUploadParams/SelectedFieldsSchema.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadParams; +namespace ImageKit\Files\FileUploadResponse; use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Files\FileUploadParams\SelectedFieldsSchema\DefaultValue; -use ImageKit\Files\FileUploadParams\SelectedFieldsSchema\SelectOption; -use ImageKit\Files\FileUploadParams\SelectedFieldsSchema\Type; +use ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue; +use ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\SelectOption; +use ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\Type; /** * @phpstan-type selected_fields_schema = array{ diff --git a/src/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php similarity index 82% rename from src/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue.php rename to src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php index 6dd5453a..301aaa56 100644 --- a/src/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadParams\SelectedFieldsSchema; +namespace ImageKit\Files\FileUploadResponse\SelectedFieldsSchema; use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; use ImageKit\Core\Conversion\ListOf; -use ImageKit\Files\FileUploadParams\SelectedFieldsSchema\DefaultValue\Mixed; +use ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed; /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. diff --git a/src/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue/Mixed.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed.php similarity index 85% rename from src/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue/Mixed.php rename to src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed.php index 8b607be5..7b4d3d9a 100644 --- a/src/Files/FileUploadParams/SelectedFieldsSchema/DefaultValue/Mixed.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadParams\SelectedFieldsSchema\DefaultValue; +namespace ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue; use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; diff --git a/src/Files/FileUploadParams/SelectedFieldsSchema/MaxValue.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php similarity index 91% rename from src/Files/FileUploadParams/SelectedFieldsSchema/MaxValue.php rename to src/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php index 2458527c..54598c36 100644 --- a/src/Files/FileUploadParams/SelectedFieldsSchema/MaxValue.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadParams\SelectedFieldsSchema; +namespace ImageKit\Files\FileUploadResponse\SelectedFieldsSchema; use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; diff --git a/src/Files/FileUploadParams/SelectedFieldsSchema/MinValue.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php similarity index 91% rename from src/Files/FileUploadParams/SelectedFieldsSchema/MinValue.php rename to src/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php index 2445f532..8cace824 100644 --- a/src/Files/FileUploadParams/SelectedFieldsSchema/MinValue.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadParams\SelectedFieldsSchema; +namespace ImageKit\Files\FileUploadResponse\SelectedFieldsSchema; use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; diff --git a/src/Files/FileUploadParams/SelectedFieldsSchema/SelectOption.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php similarity index 87% rename from src/Files/FileUploadParams/SelectedFieldsSchema/SelectOption.php rename to src/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php index 56a8843f..606c3837 100644 --- a/src/Files/FileUploadParams/SelectedFieldsSchema/SelectOption.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadParams\SelectedFieldsSchema; +namespace ImageKit\Files\FileUploadResponse\SelectedFieldsSchema; use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; diff --git a/src/Files/FileUploadParams/SelectedFieldsSchema/Type.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/Type.php similarity index 83% rename from src/Files/FileUploadParams/SelectedFieldsSchema/Type.php rename to src/Files/FileUploadResponse/SelectedFieldsSchema/Type.php index 39a17143..d987d623 100644 --- a/src/Files/FileUploadParams/SelectedFieldsSchema/Type.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadParams\SelectedFieldsSchema; +namespace ImageKit\Files\FileUploadResponse\SelectedFieldsSchema; /** * Type of the custom metadata field. diff --git a/src/ServiceContracts/Beta/V2/FilesContract.php b/src/ServiceContracts/Beta/V2/FilesContract.php index 4517152e..aa657f02 100644 --- a/src/ServiceContracts/Beta/V2/FilesContract.php +++ b/src/ServiceContracts/Beta/V2/FilesContract.php @@ -5,7 +5,6 @@ namespace ImageKit\ServiceContracts\Beta\V2; use ImageKit\Beta\V2\Files\FileUploadParams\ResponseField; -use ImageKit\Beta\V2\Files\FileUploadParams\SelectedFieldsSchema; use ImageKit\Beta\V2\Files\FileUploadParams\Transformation; use ImageKit\Beta\V2\Files\FileUploadResponse; use ImageKit\Core\Exceptions\APIException; @@ -56,12 +55,6 @@ interface FilesContract * @param bool $overwriteFile if `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed * @param list> $responseFields array of response field keys to include in the API response body - * @param array $selectedFieldsSchema This field is included in the response only if the Path policy feature is available in the plan. - * It contains schema definitions for the custom metadata fields selected for the specified file path. - * Field selection can only be done when the Path policy feature is enabled. - * - * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * @param list $tags Set the tags while uploading the file. * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. * If this field is not specified and the file is overwritten, the existing tags will be removed. @@ -102,7 +95,6 @@ public function upload( $overwriteFile = omit, $overwriteTags = omit, $responseFields = omit, - $selectedFieldsSchema = omit, $tags = omit, $transformation = omit, $useUniqueFileName = omit, diff --git a/src/ServiceContracts/FilesContract.php b/src/ServiceContracts/FilesContract.php index 39fd5311..8d06b2f5 100644 --- a/src/ServiceContracts/FilesContract.php +++ b/src/ServiceContracts/FilesContract.php @@ -16,7 +16,6 @@ use ImageKit\Files\FileUpdateParams\Publish; use ImageKit\Files\FileUpdateResponse; use ImageKit\Files\FileUploadParams\ResponseField; -use ImageKit\Files\FileUploadParams\SelectedFieldsSchema; use ImageKit\Files\FileUploadParams\Transformation; use ImageKit\Files\FileUploadResponse; use ImageKit\RequestOptions; @@ -277,12 +276,6 @@ public function renameRaw( * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed * @param string $publicKey Your ImageKit.io public key. This field is only required for authentication when uploading a file from the client side. * @param list> $responseFields array of response field keys to include in the API response body - * @param array $selectedFieldsSchema This field is included in the response only if the Path policy feature is available in the plan. - * It contains schema definitions for the custom metadata fields selected for the specified file path. - * Field selection can only be done when the Path policy feature is enabled. - * - * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * @param string $signature HMAC-SHA1 digest of the token+expire using your ImageKit.io private API key as a key. Learn how to create a signature on the page below. This should be in lowercase. * * Signature must be calculated on the server-side. This field is only required for authentication when uploading a file from the client side. @@ -328,7 +321,6 @@ public function upload( $overwriteTags = omit, $publicKey = omit, $responseFields = omit, - $selectedFieldsSchema = omit, $signature = omit, $tags = omit, $transformation = omit, diff --git a/src/Services/Beta/V2/FilesService.php b/src/Services/Beta/V2/FilesService.php index c706c2e1..118d9abd 100644 --- a/src/Services/Beta/V2/FilesService.php +++ b/src/Services/Beta/V2/FilesService.php @@ -6,7 +6,6 @@ use ImageKit\Beta\V2\Files\FileUploadParams; use ImageKit\Beta\V2\Files\FileUploadParams\ResponseField; -use ImageKit\Beta\V2\Files\FileUploadParams\SelectedFieldsSchema; use ImageKit\Beta\V2\Files\FileUploadParams\Transformation; use ImageKit\Beta\V2\Files\FileUploadResponse; use ImageKit\Client; @@ -79,12 +78,6 @@ public function __construct(private Client $client) {} * @param bool $overwriteFile if `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed * @param list> $responseFields array of response field keys to include in the API response body - * @param array $selectedFieldsSchema This field is included in the response only if the Path policy feature is available in the plan. - * It contains schema definitions for the custom metadata fields selected for the specified file path. - * Field selection can only be done when the Path policy feature is enabled. - * - * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * @param list $tags Set the tags while uploading the file. * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. * If this field is not specified and the file is overwritten, the existing tags will be removed. @@ -125,7 +118,6 @@ public function upload( $overwriteFile = omit, $overwriteTags = omit, $responseFields = omit, - $selectedFieldsSchema = omit, $tags = omit, $transformation = omit, $useUniqueFileName = omit, @@ -149,7 +141,6 @@ public function upload( 'overwriteFile' => $overwriteFile, 'overwriteTags' => $overwriteTags, 'responseFields' => $responseFields, - 'selectedFieldsSchema' => $selectedFieldsSchema, 'tags' => $tags, 'transformation' => $transformation, 'useUniqueFileName' => $useUniqueFileName, diff --git a/src/Services/FilesService.php b/src/Services/FilesService.php index 3467faba..6d9a729e 100644 --- a/src/Services/FilesService.php +++ b/src/Services/FilesService.php @@ -22,7 +22,6 @@ use ImageKit\Files\FileUpdateResponse; use ImageKit\Files\FileUploadParams; use ImageKit\Files\FileUploadParams\ResponseField; -use ImageKit\Files\FileUploadParams\SelectedFieldsSchema; use ImageKit\Files\FileUploadParams\Transformation; use ImageKit\Files\FileUploadResponse; use ImageKit\RequestOptions; @@ -462,12 +461,6 @@ public function renameRaw( * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed * @param string $publicKey Your ImageKit.io public key. This field is only required for authentication when uploading a file from the client side. * @param list> $responseFields array of response field keys to include in the API response body - * @param array $selectedFieldsSchema This field is included in the response only if the Path policy feature is available in the plan. - * It contains schema definitions for the custom metadata fields selected for the specified file path. - * Field selection can only be done when the Path policy feature is enabled. - * - * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * @param string $signature HMAC-SHA1 digest of the token+expire using your ImageKit.io private API key as a key. Learn how to create a signature on the page below. This should be in lowercase. * * Signature must be calculated on the server-side. This field is only required for authentication when uploading a file from the client side. @@ -513,7 +506,6 @@ public function upload( $overwriteTags = omit, $publicKey = omit, $responseFields = omit, - $selectedFieldsSchema = omit, $signature = omit, $tags = omit, $transformation = omit, @@ -540,7 +532,6 @@ public function upload( 'overwriteTags' => $overwriteTags, 'publicKey' => $publicKey, 'responseFields' => $responseFields, - 'selectedFieldsSchema' => $selectedFieldsSchema, 'signature' => $signature, 'tags' => $tags, 'transformation' => $transformation, diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php index 92f3dfa2..2c72d94d 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php @@ -10,6 +10,7 @@ use ImageKit\Files\Metadata; use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\AITag; use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\VersionInfo; /** @@ -33,6 +34,7 @@ * isPublished?: bool, * metadata?: Metadata, * name?: string, + * selectedFieldsSchema?: array, * size?: float, * tags?: list|null, * thumbnailURL?: string, @@ -161,6 +163,18 @@ final class Data implements BaseModel #[Api(optional: true)] public ?string $name; + /** + * This field is included in the response only if the Path policy feature is available in the plan. + * It contains schema definitions for the custom metadata fields selected for the specified file path. + * Field selection can only be done when the Path policy feature is enabled. + * + * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. + * + * @var array|null $selectedFieldsSchema + */ + #[Api(map: SelectedFieldsSchema::class, optional: true)] + public ?array $selectedFieldsSchema; + /** * Size of the image file in Bytes. */ @@ -218,6 +232,7 @@ public function __construct() * @param list|null $aiTags * @param array $customMetadata * @param array $embeddedMetadata + * @param array $selectedFieldsSchema * @param list|null $tags */ public static function with( @@ -238,6 +253,7 @@ public static function with( ?bool $isPublished = null, ?Metadata $metadata = null, ?string $name = null, + ?array $selectedFieldsSchema = null, ?float $size = null, ?array $tags = null, ?string $thumbnailURL = null, @@ -265,6 +281,7 @@ public static function with( null !== $isPublished && $obj->isPublished = $isPublished; null !== $metadata && $obj->metadata = $metadata; null !== $name && $obj->name = $name; + null !== $selectedFieldsSchema && $obj->selectedFieldsSchema = $selectedFieldsSchema; null !== $size && $obj->size = $size; null !== $tags && $obj->tags = $tags; null !== $thumbnailURL && $obj->thumbnailURL = $thumbnailURL; @@ -475,6 +492,23 @@ public function withName(string $name): self return $obj; } + /** + * This field is included in the response only if the Path policy feature is available in the plan. + * It contains schema definitions for the custom metadata fields selected for the specified file path. + * Field selection can only be done when the Path policy feature is enabled. + * + * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. + * + * @param array $selectedFieldsSchema + */ + public function withSelectedFieldsSchema(array $selectedFieldsSchema): self + { + $obj = clone $this; + $obj->selectedFieldsSchema = $selectedFieldsSchema; + + return $obj; + } + /** * Size of the image file in Bytes. */ diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php new file mode 100644 index 00000000..93e23bec --- /dev/null +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php @@ -0,0 +1,273 @@ +, + * defaultValue?: string|float|bool|list, + * isValueRequired?: bool, + * maxLength?: float, + * maxValue?: string|float, + * minLength?: float, + * minValue?: string|float, + * readOnly?: bool, + * selectOptions?: list, + * selectOptionsTruncated?: bool, + * } + */ +final class SelectedFieldsSchema implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Type of the custom metadata field. + * + * @var value-of $type + */ + #[Api(enum: Type::class)] + public string $type; + + /** + * The default value for this custom metadata field. The value should match the `type` of custom metadata field. + * + * @var string|float|bool|list|null $defaultValue + */ + #[Api(union: DefaultValue::class, optional: true)] + public string|float|bool|array|null $defaultValue; + + /** + * Specifies if the custom metadata field is required or not. + */ + #[Api(optional: true)] + public ?bool $isValueRequired; + + /** + * Maximum length of string. Only set if `type` is set to `Text` or `Textarea`. + */ + #[Api(optional: true)] + public ?float $maxLength; + + /** + * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + */ + #[Api(optional: true)] + public string|float|null $maxValue; + + /** + * Minimum length of string. Only set if `type` is set to `Text` or `Textarea`. + */ + #[Api(optional: true)] + public ?float $minLength; + + /** + * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + */ + #[Api(optional: true)] + public string|float|null $minValue; + + /** + * Indicates whether the custom metadata field is read only. A read only field cannot be modified after being set. This field is configurable only via the **Path policy** feature. + */ + #[Api(optional: true)] + public ?bool $readOnly; + + /** + * An array of allowed values when field type is `SingleSelect` or `MultiSelect`. + * + * @var list|null $selectOptions + */ + #[Api(list: SelectOption::class, optional: true)] + public ?array $selectOptions; + + /** + * Specifies if the selectOptions array is truncated. It is truncated when number of options are > 100. + */ + #[Api(optional: true)] + public ?bool $selectOptionsTruncated; + + /** + * `new SelectedFieldsSchema()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SelectedFieldsSchema::with(type: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SelectedFieldsSchema)->withType(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Type|value-of $type + * @param string|float|bool|list $defaultValue + * @param list $selectOptions + */ + public static function with( + Type|string $type, + string|float|bool|array|null $defaultValue = null, + ?bool $isValueRequired = null, + ?float $maxLength = null, + string|float|null $maxValue = null, + ?float $minLength = null, + string|float|null $minValue = null, + ?bool $readOnly = null, + ?array $selectOptions = null, + ?bool $selectOptionsTruncated = null, + ): self { + $obj = new self; + + $obj->type = $type instanceof Type ? $type->value : $type; + + null !== $defaultValue && $obj->defaultValue = $defaultValue; + null !== $isValueRequired && $obj->isValueRequired = $isValueRequired; + null !== $maxLength && $obj->maxLength = $maxLength; + null !== $maxValue && $obj->maxValue = $maxValue; + null !== $minLength && $obj->minLength = $minLength; + null !== $minValue && $obj->minValue = $minValue; + null !== $readOnly && $obj->readOnly = $readOnly; + null !== $selectOptions && $obj->selectOptions = $selectOptions; + null !== $selectOptionsTruncated && $obj->selectOptionsTruncated = $selectOptionsTruncated; + + return $obj; + } + + /** + * Type of the custom metadata field. + * + * @param Type|value-of $type + */ + public function withType(Type|string $type): self + { + $obj = clone $this; + $obj->type = $type instanceof Type ? $type->value : $type; + + return $obj; + } + + /** + * The default value for this custom metadata field. The value should match the `type` of custom metadata field. + * + * @param string|float|bool|list $defaultValue + */ + public function withDefaultValue( + string|float|bool|array $defaultValue + ): self { + $obj = clone $this; + $obj->defaultValue = $defaultValue; + + return $obj; + } + + /** + * Specifies if the custom metadata field is required or not. + */ + public function withIsValueRequired(bool $isValueRequired): self + { + $obj = clone $this; + $obj->isValueRequired = $isValueRequired; + + return $obj; + } + + /** + * Maximum length of string. Only set if `type` is set to `Text` or `Textarea`. + */ + public function withMaxLength(float $maxLength): self + { + $obj = clone $this; + $obj->maxLength = $maxLength; + + return $obj; + } + + /** + * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + */ + public function withMaxValue(string|float $maxValue): self + { + $obj = clone $this; + $obj->maxValue = $maxValue; + + return $obj; + } + + /** + * Minimum length of string. Only set if `type` is set to `Text` or `Textarea`. + */ + public function withMinLength(float $minLength): self + { + $obj = clone $this; + $obj->minLength = $minLength; + + return $obj; + } + + /** + * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + */ + public function withMinValue(string|float $minValue): self + { + $obj = clone $this; + $obj->minValue = $minValue; + + return $obj; + } + + /** + * Indicates whether the custom metadata field is read only. A read only field cannot be modified after being set. This field is configurable only via the **Path policy** feature. + */ + public function withReadOnly(bool $readOnly): self + { + $obj = clone $this; + $obj->readOnly = $readOnly; + + return $obj; + } + + /** + * An array of allowed values when field type is `SingleSelect` or `MultiSelect`. + * + * @param list $selectOptions + */ + public function withSelectOptions(array $selectOptions): self + { + $obj = clone $this; + $obj->selectOptions = $selectOptions; + + return $obj; + } + + /** + * Specifies if the selectOptions array is truncated. It is truncated when number of options are > 100. + */ + public function withSelectOptionsTruncated( + bool $selectOptionsTruncated + ): self { + $obj = clone $this; + $obj->selectOptionsTruncated = $selectOptionsTruncated; + + return $obj; + } +} diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php new file mode 100644 index 00000000..cf57b170 --- /dev/null +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php @@ -0,0 +1,28 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool', new ListOf(Mixed::class)]; + } +} diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed.php new file mode 100644 index 00000000..c44ff303 --- /dev/null +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed.php @@ -0,0 +1,23 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool']; + } +} diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MaxValue.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MaxValue.php new file mode 100644 index 00000000..0740dc6b --- /dev/null +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MaxValue.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float']; + } +} diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MinValue.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MinValue.php new file mode 100644 index 00000000..8e9787ed --- /dev/null +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MinValue.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float']; + } +} diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/SelectOption.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/SelectOption.php new file mode 100644 index 00000000..020147ca --- /dev/null +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/SelectOption.php @@ -0,0 +1,23 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool']; + } +} diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/Type.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/Type.php new file mode 100644 index 00000000..3f000dee --- /dev/null +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/Type.php @@ -0,0 +1,25 @@ + Date: Thu, 2 Oct 2025 04:42:05 +0000 Subject: [PATCH 047/193] chore(internal): restructure some imports --- src/Beta/V2/Files/FileUploadParams/Transformation.php | 10 +++++----- src/Files/FileUploadParams/Transformation.php | 10 +++++----- src/Files/Metadata/Exif.php | 9 ++++----- src/ServiceContracts/Accounts/URLEndpointsContract.php | 5 +---- src/ServiceContracts/CustomMetadataFieldsContract.php | 3 +-- src/Services/Accounts/URLEndpointsService.php | 5 +---- src/Services/CustomMetadataFieldsService.php | 3 +-- 7 files changed, 18 insertions(+), 27 deletions(-) diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation.php index 5a1da85d..a2322a27 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation.php @@ -8,7 +8,6 @@ use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs; use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\GifToVideo; use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Thumbnail; -use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Transformation as Transformation1; use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; @@ -25,7 +24,8 @@ * You can mix and match any combination of post-processing types. * * @phpstan-type transformation_alias = array{ - * post?: list, pre?: string + * post?: list, + * pre?: string, * } */ final class Transformation implements BaseModel @@ -38,7 +38,7 @@ final class Transformation implements BaseModel * Each item must match one of the following types: * `transformation`, `gif-to-video`, `thumbnail`, `abs`. * - * @var list|null $post + * @var list|null $post */ #[Api(list: Post::class, optional: true)] public ?array $post; @@ -59,7 +59,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $post + * @param list $post */ public static function with(?array $post = null, ?string $pre = null): self { @@ -76,7 +76,7 @@ public static function with(?array $post = null, ?string $pre = null): self * Each item must match one of the following types: * `transformation`, `gif-to-video`, `thumbnail`, `abs`. * - * @param list $post + * @param list $post */ public function withPost(array $post): self { diff --git a/src/Files/FileUploadParams/Transformation.php b/src/Files/FileUploadParams/Transformation.php index 015f2267..e4b9fb23 100644 --- a/src/Files/FileUploadParams/Transformation.php +++ b/src/Files/FileUploadParams/Transformation.php @@ -11,7 +11,6 @@ use ImageKit\Files\FileUploadParams\Transformation\Post\Abs; use ImageKit\Files\FileUploadParams\Transformation\Post\GifToVideo; use ImageKit\Files\FileUploadParams\Transformation\Post\Thumbnail; -use ImageKit\Files\FileUploadParams\Transformation\Post\Transformation as Transformation1; /** * Configure pre-processing (`pre`) and post-processing (`post`) transformations. @@ -25,7 +24,8 @@ * You can mix and match any combination of post-processing types. * * @phpstan-type transformation_alias = array{ - * post?: list, pre?: string + * post?: list, + * pre?: string, * } */ final class Transformation implements BaseModel @@ -38,7 +38,7 @@ final class Transformation implements BaseModel * Each item must match one of the following types: * `transformation`, `gif-to-video`, `thumbnail`, `abs`. * - * @var list|null $post + * @var list|null $post */ #[Api(list: Post::class, optional: true)] public ?array $post; @@ -59,7 +59,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $post + * @param list $post */ public static function with(?array $post = null, ?string $pre = null): self { @@ -76,7 +76,7 @@ public static function with(?array $post = null, ?string $pre = null): self * Each item must match one of the following types: * `transformation`, `gif-to-video`, `thumbnail`, `abs`. * - * @param list $post + * @param list $post */ public function withPost(array $post): self { diff --git a/src/Files/Metadata/Exif.php b/src/Files/Metadata/Exif.php index d30c8329..7a300c75 100644 --- a/src/Files/Metadata/Exif.php +++ b/src/Files/Metadata/Exif.php @@ -7,7 +7,6 @@ use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Files\Metadata\Exif\Exif as Exif1; use ImageKit\Files\Metadata\Exif\Gps; use ImageKit\Files\Metadata\Exif\Image; use ImageKit\Files\Metadata\Exif\Interoperability; @@ -15,7 +14,7 @@ /** * @phpstan-type exif_alias = array{ - * exif?: Exif1, + * exif?: ImageKit\Files\Metadata\Exif\Exif, * gps?: Gps, * image?: Image, * interoperability?: Interoperability, @@ -32,7 +31,7 @@ final class Exif implements BaseModel * Object containing Exif details. */ #[Api(optional: true)] - public ?Exif1 $exif; + public ?ImageKit\Files\Metadata\Exif\Exif $exif; /** * Object containing GPS information. @@ -75,7 +74,7 @@ public function __construct() * @param array $makernote */ public static function with( - ?Exif1 $exif = null, + ?ImageKit\Files\Metadata\Exif\Exif $exif = null, ?Gps $gps = null, ?Image $image = null, ?Interoperability $interoperability = null, @@ -97,7 +96,7 @@ public static function with( /** * Object containing Exif details. */ - public function withExif(Exif1 $exif): self + public function withExif(ImageKit\Files\Metadata\Exif\Exif $exif): self { $obj = clone $this; $obj->exif = $exif; diff --git a/src/ServiceContracts/Accounts/URLEndpointsContract.php b/src/ServiceContracts/Accounts/URLEndpointsContract.php index c3fa2a5d..58814d38 100644 --- a/src/ServiceContracts/Accounts/URLEndpointsContract.php +++ b/src/ServiceContracts/Accounts/URLEndpointsContract.php @@ -8,9 +8,6 @@ use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Cloudinary; use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Imgix; use ImageKit\Accounts\URLEndpoints\URLEndpointResponse; -use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Akamai as Akamai1; -use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Cloudinary as Cloudinary1; -use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Imgix as Imgix1; use ImageKit\Core\Exceptions\APIException; use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\RequestOptions; @@ -59,7 +56,7 @@ public function createRaw( * @param string $description description of the URL endpoint * @param list $origins Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) - * @param Cloudinary1|Imgix1|Akamai1 $urlRewriter configuration for third-party URL rewriting + * @param ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Cloudinary|ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Imgix|ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Akamai $urlRewriter configuration for third-party URL rewriting * * @return URLEndpointResponse * diff --git a/src/ServiceContracts/CustomMetadataFieldsContract.php b/src/ServiceContracts/CustomMetadataFieldsContract.php index 24c6806b..28494864 100644 --- a/src/ServiceContracts/CustomMetadataFieldsContract.php +++ b/src/ServiceContracts/CustomMetadataFieldsContract.php @@ -9,7 +9,6 @@ use ImageKit\CustomMetadataFields\CustomMetadataField; use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; use ImageKit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; -use ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema as Schema1; use ImageKit\RequestOptions; use const ImageKit\Core\OMIT as omit; @@ -52,7 +51,7 @@ public function createRaw( * @api * * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. This parameter is required if `schema` is not provided. - * @param Schema1 $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. + * @param ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. * * @return CustomMetadataField * diff --git a/src/Services/Accounts/URLEndpointsService.php b/src/Services/Accounts/URLEndpointsService.php index c024dfac..c2ab79e8 100644 --- a/src/Services/Accounts/URLEndpointsService.php +++ b/src/Services/Accounts/URLEndpointsService.php @@ -10,9 +10,6 @@ use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Imgix; use ImageKit\Accounts\URLEndpoints\URLEndpointResponse; use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams; -use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Akamai as Akamai1; -use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Cloudinary as Cloudinary1; -use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Imgix as Imgix1; use ImageKit\Client; use ImageKit\Core\Conversion\ListOf; use ImageKit\Core\Exceptions\APIException; @@ -98,7 +95,7 @@ public function createRaw( * @param string $description description of the URL endpoint * @param list $origins Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) - * @param Cloudinary1|Imgix1|Akamai1 $urlRewriter configuration for third-party URL rewriting + * @param ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Cloudinary|ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Imgix|ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Akamai $urlRewriter configuration for third-party URL rewriting * * @return URLEndpointResponse * diff --git a/src/Services/CustomMetadataFieldsService.php b/src/Services/CustomMetadataFieldsService.php index 6516f700..55fcfd7a 100644 --- a/src/Services/CustomMetadataFieldsService.php +++ b/src/Services/CustomMetadataFieldsService.php @@ -14,7 +14,6 @@ use ImageKit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; use ImageKit\CustomMetadataFields\CustomMetadataFieldListParams; use ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams; -use ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema as Schema1; use ImageKit\RequestOptions; use ImageKit\ServiceContracts\CustomMetadataFieldsContract; @@ -85,7 +84,7 @@ public function createRaw( * This API updates the label or schema of an existing custom metadata field. * * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. This parameter is required if `schema` is not provided. - * @param Schema1 $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. + * @param ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. * * @return CustomMetadataField * From caa793aa506d1b0123187d54eafb6770027ac5d3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 07:36:48 +0000 Subject: [PATCH 048/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 0c9c486c..90e53979 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-01aef94bd928f40b7209dc21df71e2312d4bee430119b30ee05d75cf5e1b4801.yml openapi_spec_hash: 054c332db88b23d362f72583dd24b2aa -config_hash: e42d7fc3a8c92c35099cc283f9a4467a +config_hash: 371b1694848e02828dd8db3265557ddf From eb5325ef207a17bdce87e374db744694fe08ad7e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 07:37:38 +0000 Subject: [PATCH 049/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 90e53979..bb92027a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-01aef94bd928f40b7209dc21df71e2312d4bee430119b30ee05d75cf5e1b4801.yml openapi_spec_hash: 054c332db88b23d362f72583dd24b2aa -config_hash: 371b1694848e02828dd8db3265557ddf +config_hash: 719e92ff078b4a030a1480b546be0b7a From dd06ee4755c98d089146c39d60d6a1005f10bd50 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 07:48:40 +0000 Subject: [PATCH 050/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index bb92027a..88337313 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-01aef94bd928f40b7209dc21df71e2312d4bee430119b30ee05d75cf5e1b4801.yml openapi_spec_hash: 054c332db88b23d362f72583dd24b2aa -config_hash: 719e92ff078b4a030a1480b546be0b7a +config_hash: cb0b86a64fed7f839bb0ef6568a8ba37 From 8698f23076cbeb4ae300411309a85957e3c0ed76 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 07:51:00 +0000 Subject: [PATCH 051/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 88337313..b346bb7b 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-01aef94bd928f40b7209dc21df71e2312d4bee430119b30ee05d75cf5e1b4801.yml openapi_spec_hash: 054c332db88b23d362f72583dd24b2aa -config_hash: cb0b86a64fed7f839bb0ef6568a8ba37 +config_hash: f351b784e512ad36eafbc0641ad61183 From f0cec1be3325471940816b34bc93619b7320bf09 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 09:21:31 +0000 Subject: [PATCH 052/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index b346bb7b..3d1832c1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-01aef94bd928f40b7209dc21df71e2312d4bee430119b30ee05d75cf5e1b4801.yml openapi_spec_hash: 054c332db88b23d362f72583dd24b2aa -config_hash: f351b784e512ad36eafbc0641ad61183 +config_hash: 8d97605bd07a42f98d8142059b56522c From 06a723341fe3e79465605b0ba57fffe9c1c539c3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 10:02:51 +0000 Subject: [PATCH 053/193] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3d1832c1..ad4cfbf9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-01aef94bd928f40b7209dc21df71e2312d4bee430119b30ee05d75cf5e1b4801.yml -openapi_spec_hash: 054c332db88b23d362f72583dd24b2aa -config_hash: 8d97605bd07a42f98d8142059b56522c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-c7ad6f552b38f2145781847f8b390fa1ec43068d64e45a33012a97a9299edc10.yml +openapi_spec_hash: 50f281e91210ad5018ac7e4eee216f56 +config_hash: 6d15773e29070b9c1d4820e4897f17a5 From 759837c405f3861d56b463b84e2344cf0a3a82f7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 3 Oct 2025 22:02:55 +0000 Subject: [PATCH 054/193] chore: refactor methods --- scripts/lint | 2 +- .../URLEndpoints/URLEndpointResponse.php | 10 +-- src/Accounts/Usage/UsageGetResponse.php | 10 +-- src/Assets/AssetListParams.php | 12 +-- src/Beta/V2/Files/FileUploadParams.php | 4 +- .../Transformation/Post/Abs.php | 4 +- src/Beta/V2/Files/FileUploadResponse.php | 10 +-- .../FileUploadResponse/ExtensionStatus.php | 16 ++-- .../SelectedFieldsSchema.php | 4 +- .../Invalidation/InvalidationGetResponse.php | 14 +-- .../Invalidation/InvalidationNewResponse.php | 10 +-- src/Client.php | 14 +-- src/Core/BaseClient.php | 18 ++-- src/Core/Concerns/SdkResponse.php | 29 +++++++ src/Core/Contracts/BasePage.php | 3 +- src/Core/Contracts/BaseStream.php | 4 - src/Core/Conversion.php | 14 +++ .../Contracts/ResponseConverter.php | 18 ++++ src/Core/Implementation/HasRawResponse.php | 10 --- .../CustomMetadataField.php | 10 +-- .../CustomMetadataField/Schema.php | 4 +- .../Schema.php | 4 +- .../CustomMetadataFieldDeleteResponse.php | 10 +-- src/ExtensionItem/AutoTaggingExtension.php | 4 +- src/Files/Bulk/BulkAddTagsResponse.php | 10 +-- src/Files/Bulk/BulkDeleteResponse.php | 10 +-- src/Files/Bulk/BulkRemoveAITagsResponse.php | 10 +-- src/Files/Bulk/BulkRemoveTagsResponse.php | 10 +-- src/Files/File.php | 14 +-- src/Files/File/SelectedFieldsSchema.php | 4 +- src/Files/FileCopyResponse.php | 10 +-- src/Files/FileMoveResponse.php | 10 +-- src/Files/FileRenameResponse.php | 10 +-- src/Files/FileUpdateParams/RemoveAITags.php | 3 +- src/Files/FileUpdateResponse.php | 14 +-- .../FileUpdateResponse/ExtensionStatus.php | 16 ++-- src/Files/FileUploadParams.php | 4 +- .../Transformation/Post/Abs.php | 4 +- src/Files/FileUploadResponse.php | 10 +-- .../FileUploadResponse/ExtensionStatus.php | 16 ++-- .../SelectedFieldsSchema.php | 4 +- src/Files/Folder.php | 4 +- .../UpdateFileDetails/RemoveAITags.php | 3 +- src/Files/Versions/VersionDeleteResponse.php | 10 +-- src/Folders/FolderCopyResponse.php | 10 +-- src/Folders/FolderDeleteResponse.php | 10 +-- src/Folders/FolderMoveResponse.php | 10 +-- src/Folders/FolderNewResponse.php | 10 +-- src/Folders/FolderRenameResponse.php | 10 +-- src/Folders/Job/JobGetResponse.php | 18 ++-- src/ImageOverlay.php | 4 +- src/OverlayPosition.php | 4 +- .../Accounts/OriginsContract.php | 74 +++++----------- .../Accounts/URLEndpointsContract.php | 47 ---------- .../Accounts/UsageContract.php | 5 -- .../Beta/V2/FilesContract.php | 5 -- .../Cache/InvalidationContract.php | 20 ----- .../CustomMetadataFieldsContract.php | 24 ------ src/ServiceContracts/Files/BulkContract.php | 17 ---- .../Files/MetadataContract.php | 11 --- .../Files/VersionsContract.php | 26 ------ src/ServiceContracts/FilesContract.php | 47 ---------- src/ServiceContracts/Folders/JobContract.php | 16 ---- src/ServiceContracts/FoldersContract.php | 21 ----- src/Services/Accounts/OriginsService.php | 86 +++++-------------- src/Services/Accounts/URLEndpointsService.php | 59 ------------- src/Services/Accounts/UsageService.php | 5 -- src/Services/Beta/V2/FilesService.php | 5 -- src/Services/Cache/InvalidationService.php | 24 ------ src/Services/CustomMetadataFieldsService.php | 28 ------ src/Services/Files/BulkService.php | 17 ---- src/Services/Files/MetadataService.php | 15 ---- src/Services/Files/VersionsService.php | 30 ------- src/Services/FilesService.php | 55 ------------ src/Services/Folders/JobService.php | 20 ----- src/Services/FoldersService.php | 21 ----- .../Gradient.php | 3 +- .../Radius.php | 3 +- src/SrcOptions.php | 4 +- src/StreamingResolution.php | 14 +-- src/SubtitleOverlay.php | 4 +- src/SubtitleOverlayTransformation.php | 4 +- src/TextOverlay.php | 4 +- src/TextOverlayTransformation.php | 8 +- src/TextOverlayTransformation/Radius.php | 3 +- src/Transformation.php | 37 ++++---- src/Transformation/AIDropShadow.php | 3 +- src/Transformation/Gradient.php | 3 +- src/Transformation/Radius.php | 3 +- src/Transformation/Shadow.php | 3 +- src/Transformation/Sharpen.php | 3 +- src/Transformation/Trim.php | 3 +- src/Transformation/UnsharpMask.php | 3 +- src/VideoOverlay.php | 4 +- .../Request/Transformation.php | 8 +- .../Request/Transformation.php | 8 +- .../Data/ExtensionStatus.php | 16 ++-- .../Data/SelectedFieldsSchema.php | 4 +- .../Data/Transformation.php | 4 +- .../Data/Transformation/Options.php | 16 ++-- .../Data/Transformation.php | 4 +- .../Data/Transformation/Error.php | 4 +- .../Data/Transformation/Options.php | 16 ++-- .../Data/Transformation.php | 4 +- .../Data/Transformation/Options.php | 16 ++-- 105 files changed, 401 insertions(+), 976 deletions(-) create mode 100644 src/Core/Concerns/SdkResponse.php create mode 100644 src/Core/Conversion/Contracts/ResponseConverter.php delete mode 100644 src/Core/Implementation/HasRawResponse.php diff --git a/scripts/lint b/scripts/lint index 6d629c28..13f2f013 100755 --- a/scripts/lint +++ b/scripts/lint @@ -5,4 +5,4 @@ set -e cd -- "$(dirname -- "$0")/.." echo "==> Running PHPStan" -exec -- ./vendor/bin/phpstan analyse --memory-limit=1G +exec -- ./vendor/bin/phpstan analyse --memory-limit=2G diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse.php b/src/Accounts/URLEndpoints/URLEndpointResponse.php index f5aa9bd0..64ebdd44 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse.php @@ -10,7 +10,9 @@ use ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\Imgix; use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkResponse; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** * URL‑endpoint object as returned by the API. @@ -22,16 +24,14 @@ * urlPrefix: string, * urlRewriter?: Cloudinary|Imgix|Akamai, * } - * When used in a response, this type parameter can define a $rawResponse property. - * @template TRawResponse of object = object{} - * - * @mixin TRawResponse */ -final class URLEndpointResponse implements BaseModel +final class URLEndpointResponse implements BaseModel, ResponseConverter { /** @use SdkModel */ use SdkModel; + use SdkResponse; + /** * Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. */ diff --git a/src/Accounts/Usage/UsageGetResponse.php b/src/Accounts/Usage/UsageGetResponse.php index 820b3a13..e61ed679 100644 --- a/src/Accounts/Usage/UsageGetResponse.php +++ b/src/Accounts/Usage/UsageGetResponse.php @@ -6,7 +6,9 @@ use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkResponse; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type usage_get_response = array{ @@ -16,16 +18,14 @@ * originalCacheStorageBytes?: int, * videoProcessingUnitsCount?: int, * } - * When used in a response, this type parameter can define a $rawResponse property. - * @template TRawResponse of object = object{} - * - * @mixin TRawResponse */ -final class UsageGetResponse implements BaseModel +final class UsageGetResponse implements BaseModel, ResponseConverter { /** @use SdkModel */ use SdkModel; + use SdkResponse; + /** * Amount of bandwidth used in bytes. */ diff --git a/src/Assets/AssetListParams.php b/src/Assets/AssetListParams.php index 1802e6a4..8345496b 100644 --- a/src/Assets/AssetListParams.php +++ b/src/Assets/AssetListParams.php @@ -137,13 +137,13 @@ public static function with( ): self { $obj = new self; - null !== $fileType && $obj->fileType = $fileType instanceof FileType ? $fileType->value : $fileType; + null !== $fileType && $obj['fileType'] = $fileType; null !== $limit && $obj->limit = $limit; null !== $path && $obj->path = $path; null !== $searchQuery && $obj->searchQuery = $searchQuery; null !== $skip && $obj->skip = $skip; - null !== $sort && $obj->sort = $sort instanceof Sort ? $sort->value : $sort; - null !== $type && $obj->type = $type instanceof Type ? $type->value : $type; + null !== $sort && $obj['sort'] = $sort; + null !== $type && $obj['type'] = $type; return $obj; } @@ -160,7 +160,7 @@ public static function with( public function withFileType(FileType|string $fileType): self { $obj = clone $this; - $obj->fileType = $fileType instanceof FileType ? $fileType->value : $fileType; + $obj['fileType'] = $fileType; return $obj; } @@ -228,7 +228,7 @@ public function withSkip(int $skip): self public function withSort(Sort|string $sort): self { $obj = clone $this; - $obj->sort = $sort instanceof Sort ? $sort->value : $sort; + $obj['sort'] = $sort; return $obj; } @@ -246,7 +246,7 @@ public function withSort(Sort|string $sort): self public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; return $obj; } diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index b59205d6..48f355e7 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -306,7 +306,7 @@ public static function with( null !== $overwriteCustomMetadata && $obj->overwriteCustomMetadata = $overwriteCustomMetadata; null !== $overwriteFile && $obj->overwriteFile = $overwriteFile; null !== $overwriteTags && $obj->overwriteTags = $overwriteTags; - null !== $responseFields && $obj->responseFields = array_map(fn ($v) => $v instanceof ResponseField ? $v->value : $v, $responseFields); + null !== $responseFields && $obj['responseFields'] = $responseFields; null !== $tags && $obj->tags = $tags; null !== $transformation && $obj->transformation = $transformation; null !== $useUniqueFileName && $obj->useUniqueFileName = $useUniqueFileName; @@ -515,7 +515,7 @@ public function withOverwriteTags(bool $overwriteTags): self public function withResponseFields(array $responseFields): self { $obj = clone $this; - $obj->responseFields = array_map(fn ($v) => $v instanceof ResponseField ? $v->value : $v, $responseFields); + $obj['responseFields'] = $responseFields; return $obj; } diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php index fe04123a..98373eb0 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php @@ -69,7 +69,7 @@ public static function with(Protocol|string $protocol, string $value): self { $obj = new self; - $obj->protocol = $protocol instanceof Protocol ? $protocol->value : $protocol; + $obj['protocol'] = $protocol; $obj->value = $value; return $obj; @@ -83,7 +83,7 @@ public static function with(Protocol|string $protocol, string $value): self public function withProtocol(Protocol|string $protocol): self { $obj = clone $this; - $obj->protocol = $protocol instanceof Protocol ? $protocol->value : $protocol; + $obj['protocol'] = $protocol; return $obj; } diff --git a/src/Beta/V2/Files/FileUploadResponse.php b/src/Beta/V2/Files/FileUploadResponse.php index 207e19a8..8f9a8179 100644 --- a/src/Beta/V2/Files/FileUploadResponse.php +++ b/src/Beta/V2/Files/FileUploadResponse.php @@ -10,7 +10,9 @@ use ImageKit\Beta\V2\Files\FileUploadResponse\VersionInfo; use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkResponse; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion\Contracts\ResponseConverter; use ImageKit\Files\Metadata; /** @@ -43,16 +45,14 @@ * videoCodec?: string, * width?: float, * } - * When used in a response, this type parameter can define a $rawResponse property. - * @template TRawResponse of object = object{} - * - * @mixin TRawResponse */ -final class FileUploadResponse implements BaseModel +final class FileUploadResponse implements BaseModel, ResponseConverter { /** @use SdkModel */ use SdkModel; + use SdkResponse; + /** * An array of tags assigned to the uploaded file by auto tagging. * diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php index ff9ad751..6b0393df 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php @@ -72,10 +72,10 @@ public static function with( ): self { $obj = new self; - null !== $aiAutoDescription && $obj->aiAutoDescription = $aiAutoDescription instanceof AIAutoDescription ? $aiAutoDescription->value : $aiAutoDescription; - null !== $awsAutoTagging && $obj->awsAutoTagging = $awsAutoTagging instanceof AwsAutoTagging ? $awsAutoTagging->value : $awsAutoTagging; - null !== $googleAutoTagging && $obj->googleAutoTagging = $googleAutoTagging instanceof GoogleAutoTagging ? $googleAutoTagging->value : $googleAutoTagging; - null !== $removeBg && $obj->removeBg = $removeBg instanceof RemoveBg ? $removeBg->value : $removeBg; + null !== $aiAutoDescription && $obj['aiAutoDescription'] = $aiAutoDescription; + null !== $awsAutoTagging && $obj['awsAutoTagging'] = $awsAutoTagging; + null !== $googleAutoTagging && $obj['googleAutoTagging'] = $googleAutoTagging; + null !== $removeBg && $obj['removeBg'] = $removeBg; return $obj; } @@ -87,7 +87,7 @@ public function withAIAutoDescription( AIAutoDescription|string $aiAutoDescription ): self { $obj = clone $this; - $obj->aiAutoDescription = $aiAutoDescription instanceof AIAutoDescription ? $aiAutoDescription->value : $aiAutoDescription; + $obj['aiAutoDescription'] = $aiAutoDescription; return $obj; } @@ -99,7 +99,7 @@ public function withAwsAutoTagging( AwsAutoTagging|string $awsAutoTagging ): self { $obj = clone $this; - $obj->awsAutoTagging = $awsAutoTagging instanceof AwsAutoTagging ? $awsAutoTagging->value : $awsAutoTagging; + $obj['awsAutoTagging'] = $awsAutoTagging; return $obj; } @@ -111,7 +111,7 @@ public function withGoogleAutoTagging( GoogleAutoTagging|string $googleAutoTagging ): self { $obj = clone $this; - $obj->googleAutoTagging = $googleAutoTagging instanceof GoogleAutoTagging ? $googleAutoTagging->value : $googleAutoTagging; + $obj['googleAutoTagging'] = $googleAutoTagging; return $obj; } @@ -122,7 +122,7 @@ public function withGoogleAutoTagging( public function withRemoveBg(RemoveBg|string $removeBg): self { $obj = clone $this; - $obj->removeBg = $removeBg instanceof RemoveBg ? $removeBg->value : $removeBg; + $obj['removeBg'] = $removeBg; return $obj; } diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php index 759dcdd8..68b8975b 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php @@ -138,7 +138,7 @@ public static function with( ): self { $obj = new self; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; null !== $defaultValue && $obj->defaultValue = $defaultValue; null !== $isValueRequired && $obj->isValueRequired = $isValueRequired; @@ -161,7 +161,7 @@ public static function with( public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; return $obj; } diff --git a/src/Cache/Invalidation/InvalidationGetResponse.php b/src/Cache/Invalidation/InvalidationGetResponse.php index 789db9ba..86165a2f 100644 --- a/src/Cache/Invalidation/InvalidationGetResponse.php +++ b/src/Cache/Invalidation/InvalidationGetResponse.php @@ -7,20 +7,20 @@ use ImageKit\Cache\Invalidation\InvalidationGetResponse\Status; use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkResponse; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type invalidation_get_response = array{status?: value-of} - * When used in a response, this type parameter can define a $rawResponse property. - * @template TRawResponse of object = object{} - * - * @mixin TRawResponse */ -final class InvalidationGetResponse implements BaseModel +final class InvalidationGetResponse implements BaseModel, ResponseConverter { /** @use SdkModel */ use SdkModel; + use SdkResponse; + /** * Status of the purge request. * @@ -45,7 +45,7 @@ public static function with(Status|string|null $status = null): self { $obj = new self; - null !== $status && $obj->status = $status instanceof Status ? $status->value : $status; + null !== $status && $obj['status'] = $status; return $obj; } @@ -58,7 +58,7 @@ public static function with(Status|string|null $status = null): self public function withStatus(Status|string $status): self { $obj = clone $this; - $obj->status = $status instanceof Status ? $status->value : $status; + $obj['status'] = $status; return $obj; } diff --git a/src/Cache/Invalidation/InvalidationNewResponse.php b/src/Cache/Invalidation/InvalidationNewResponse.php index 93a2eadb..ae2ff4ea 100644 --- a/src/Cache/Invalidation/InvalidationNewResponse.php +++ b/src/Cache/Invalidation/InvalidationNewResponse.php @@ -6,20 +6,20 @@ use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkResponse; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type invalidation_new_response = array{requestID?: string} - * When used in a response, this type parameter can define a $rawResponse property. - * @template TRawResponse of object = object{} - * - * @mixin TRawResponse */ -final class InvalidationNewResponse implements BaseModel +final class InvalidationNewResponse implements BaseModel, ResponseConverter { /** @use SdkModel */ use SdkModel; + use SdkResponse; + /** * Unique identifier of the purge request. This can be used to check the status of the purge request. */ diff --git a/src/Client.php b/src/Client.php index 4c254b08..b8224532 100644 --- a/src/Client.php +++ b/src/Client.php @@ -69,18 +69,12 @@ public function __construct( ?string $password = null, ?string $baseUrl = null, ) { - $this->privateKey = (string) ( - $privateKey ?? getenv('IMAGEKIT_PRIVATE_KEY') - ); - $this->password = (string) ( - $password ?? getenv('OPTIONAL_IMAGEKIT_IGNORES_THIS') ?: 'do_not_set' - ); + $this->privateKey = (string) ($privateKey ?? getenv('IMAGEKIT_PRIVATE_KEY')); + $this->password = (string) ($password ?? getenv('OPTIONAL_IMAGEKIT_IGNORES_THIS') ?: PHP.Literal(do_not_set)); $this->baseUrlOverridden = !is_null($baseUrl); - $base = $baseUrl ?? getenv( - 'IMAGE_KIT_BASE_URL' - ) ?: 'https://api.imagekit.io'; + $baseUrl ??= getenv('IMAGE_KIT_BASE_URL') ?: 'https://api.imagekit.io'; $options = RequestOptions::with( uriFactory: Psr17FactoryDiscovery::findUriFactory(), @@ -93,7 +87,7 @@ public function __construct( headers: [ 'Content-Type' => 'application/json', 'Accept' => 'application/json', ], - baseUrl: $base, + baseUrl: $baseUrl, options: $options, ); diff --git a/src/Core/BaseClient.php b/src/Core/BaseClient.php index f3229494..f6a542f5 100644 --- a/src/Core/BaseClient.php +++ b/src/Core/BaseClient.php @@ -29,7 +29,7 @@ * body: mixed, * } */ -class BaseClient +abstract class BaseClient { protected UriInterface $baseUrl; @@ -77,14 +77,11 @@ public function request( // @phpstan-ignore-next-line $rsp = $this->sendRequest($opts, req: $request, data: $body, redirectCount: 0, retryCount: 0); - $decoded = Util::decodeContent($rsp); - if (!is_null($stream)) { return new $stream( convert: $convert, request: $request, - response: $rsp, - stream: $decoded + response: $rsp ); } @@ -93,23 +90,20 @@ public function request( convert: $convert, client: $this, request: $req, + response: $rsp, options: $opts, - data: $decoded, ); } if (!is_null($convert)) { - return Conversion::coerce($convert, value: $decoded); + return Conversion::coerceResponse($convert, response: $rsp); } - return $decoded; + return Util::decodeContent($rsp); } /** @return array */ - protected function authHeaders(): array - { - return []; - } + abstract protected function authHeaders(): array; /** * @internal diff --git a/src/Core/Concerns/SdkResponse.php b/src/Core/Concerns/SdkResponse.php new file mode 100644 index 00000000..18074c65 --- /dev/null +++ b/src/Core/Concerns/SdkResponse.php @@ -0,0 +1,29 @@ +_rawResponse = $response; + $instance->__unserialize(Util::decodeContent($response)); // @phpstan-ignore-line + + return $instance; + } + + public function getRawResponse(): ?ResponseInterface + { + return $this->_rawResponse; + } +} diff --git a/src/Core/Contracts/BasePage.php b/src/Core/Contracts/BasePage.php index 143f5b66..4e3c68d3 100644 --- a/src/Core/Contracts/BasePage.php +++ b/src/Core/Contracts/BasePage.php @@ -8,6 +8,7 @@ use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; use ImageKit\RequestOptions; +use Psr\Http\Message\ResponseInterface; /** * @internal @@ -30,7 +31,7 @@ public function __construct( Client $client, array $request, RequestOptions $options, - mixed $data, + ResponseInterface $response, ); public function hasNextPage(): bool; diff --git a/src/Core/Contracts/BaseStream.php b/src/Core/Contracts/BaseStream.php index 77555bbe..f60672f3 100644 --- a/src/Core/Contracts/BaseStream.php +++ b/src/Core/Contracts/BaseStream.php @@ -18,14 +18,10 @@ */ interface BaseStream extends \IteratorAggregate { - /** - * @param \Generator $stream - */ public function __construct( Converter|ConverterSource|string $convert, RequestInterface $request, ResponseInterface $response, - \Generator $stream, ); /** diff --git a/src/Core/Conversion.php b/src/Core/Conversion.php index 6f27a71a..78365f4a 100644 --- a/src/Core/Conversion.php +++ b/src/Core/Conversion.php @@ -7,8 +7,13 @@ use ImageKit\Core\Conversion\CoerceState; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\Contracts\ResponseConverter; use ImageKit\Core\Conversion\DumpState; +use Psr\Http\Message\ResponseInterface; +/** + * @internal + */ final class Conversion { public static function dump_unknown(mixed $value, DumpState $state): mixed @@ -38,6 +43,15 @@ public static function dump_unknown(mixed $value, DumpState $state): mixed return $value; } + public static function coerceResponse(Converter|ConverterSource|string $target, ResponseInterface $response): mixed + { + if (is_a($target, ResponseConverter::class, allow_string: true)) { + return $target::fromResponse($response); + } + + return self::coerce($target, Util::decodeContent($response)); + } + public static function coerce(Converter|ConverterSource|string $target, mixed $value, CoerceState $state = new CoerceState): mixed { if ($value instanceof $target) { diff --git a/src/Core/Conversion/Contracts/ResponseConverter.php b/src/Core/Conversion/Contracts/ResponseConverter.php new file mode 100644 index 00000000..0033c9e4 --- /dev/null +++ b/src/Core/Conversion/Contracts/ResponseConverter.php @@ -0,0 +1,18 @@ + */ use SdkModel; + use SdkResponse; + /** * Unique identifier for the custom metadata field. Use this to update the field. */ diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema.php b/src/CustomMetadataFields/CustomMetadataField/Schema.php index 374f9092..80b12ddf 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema.php @@ -124,7 +124,7 @@ public static function with( ): self { $obj = new self; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; null !== $defaultValue && $obj->defaultValue = $defaultValue; null !== $isValueRequired && $obj->isValueRequired = $isValueRequired; @@ -145,7 +145,7 @@ public static function with( public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; return $obj; } diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php index bc027136..901918fd 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php @@ -122,7 +122,7 @@ public static function with( ): self { $obj = new self; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; null !== $defaultValue && $obj->defaultValue = $defaultValue; null !== $isValueRequired && $obj->isValueRequired = $isValueRequired; @@ -143,7 +143,7 @@ public static function with( public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; return $obj; } diff --git a/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php b/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php index 0f11add0..c989be14 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php +++ b/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php @@ -5,20 +5,20 @@ namespace ImageKit\CustomMetadataFields; use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkResponse; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type custom_metadata_field_delete_response = array{} - * When used in a response, this type parameter can define a $rawResponse property. - * @template TRawResponse of object = object{} - * - * @mixin TRawResponse */ -final class CustomMetadataFieldDeleteResponse implements BaseModel +final class CustomMetadataFieldDeleteResponse implements BaseModel, ResponseConverter { /** @use SdkModel */ use SdkModel; + use SdkResponse; + public function __construct() { $this->initialize(); diff --git a/src/ExtensionItem/AutoTaggingExtension.php b/src/ExtensionItem/AutoTaggingExtension.php index d8547ca0..cfe2cf93 100644 --- a/src/ExtensionItem/AutoTaggingExtension.php +++ b/src/ExtensionItem/AutoTaggingExtension.php @@ -77,7 +77,7 @@ public static function with( $obj->maxTags = $maxTags; $obj->minConfidence = $minConfidence; - $obj->name = $name instanceof Name ? $name->value : $name; + $obj['name'] = $name; return $obj; } @@ -112,7 +112,7 @@ public function withMinConfidence(int $minConfidence): self public function withName(Name|string $name): self { $obj = clone $this; - $obj->name = $name instanceof Name ? $name->value : $name; + $obj['name'] = $name; return $obj; } diff --git a/src/Files/Bulk/BulkAddTagsResponse.php b/src/Files/Bulk/BulkAddTagsResponse.php index 70887d2e..d85c44b7 100644 --- a/src/Files/Bulk/BulkAddTagsResponse.php +++ b/src/Files/Bulk/BulkAddTagsResponse.php @@ -6,22 +6,22 @@ use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkResponse; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type bulk_add_tags_response = array{ * successfullyUpdatedFileIDs?: list * } - * When used in a response, this type parameter can define a $rawResponse property. - * @template TRawResponse of object = object{} - * - * @mixin TRawResponse */ -final class BulkAddTagsResponse implements BaseModel +final class BulkAddTagsResponse implements BaseModel, ResponseConverter { /** @use SdkModel */ use SdkModel; + use SdkResponse; + /** * An array of fileIds that in which tags were successfully added. * diff --git a/src/Files/Bulk/BulkDeleteResponse.php b/src/Files/Bulk/BulkDeleteResponse.php index 895b2d29..731b3aa3 100644 --- a/src/Files/Bulk/BulkDeleteResponse.php +++ b/src/Files/Bulk/BulkDeleteResponse.php @@ -6,22 +6,22 @@ use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkResponse; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type bulk_delete_response = array{ * successfullyDeletedFileIDs?: list * } - * When used in a response, this type parameter can define a $rawResponse property. - * @template TRawResponse of object = object{} - * - * @mixin TRawResponse */ -final class BulkDeleteResponse implements BaseModel +final class BulkDeleteResponse implements BaseModel, ResponseConverter { /** @use SdkModel */ use SdkModel; + use SdkResponse; + /** * An array of fileIds that were successfully deleted. * diff --git a/src/Files/Bulk/BulkRemoveAITagsResponse.php b/src/Files/Bulk/BulkRemoveAITagsResponse.php index 5c0820e2..486ab340 100644 --- a/src/Files/Bulk/BulkRemoveAITagsResponse.php +++ b/src/Files/Bulk/BulkRemoveAITagsResponse.php @@ -6,22 +6,22 @@ use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkResponse; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type bulk_remove_ai_tags_response = array{ * successfullyUpdatedFileIDs?: list * } - * When used in a response, this type parameter can define a $rawResponse property. - * @template TRawResponse of object = object{} - * - * @mixin TRawResponse */ -final class BulkRemoveAITagsResponse implements BaseModel +final class BulkRemoveAITagsResponse implements BaseModel, ResponseConverter { /** @use SdkModel */ use SdkModel; + use SdkResponse; + /** * An array of fileIds that in which AITags were successfully removed. * diff --git a/src/Files/Bulk/BulkRemoveTagsResponse.php b/src/Files/Bulk/BulkRemoveTagsResponse.php index 8a477675..3aa6c216 100644 --- a/src/Files/Bulk/BulkRemoveTagsResponse.php +++ b/src/Files/Bulk/BulkRemoveTagsResponse.php @@ -6,22 +6,22 @@ use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkResponse; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type bulk_remove_tags_response = array{ * successfullyUpdatedFileIDs?: list * } - * When used in a response, this type parameter can define a $rawResponse property. - * @template TRawResponse of object = object{} - * - * @mixin TRawResponse */ -final class BulkRemoveTagsResponse implements BaseModel +final class BulkRemoveTagsResponse implements BaseModel, ResponseConverter { /** @use SdkModel */ use SdkModel; + use SdkResponse; + /** * An array of fileIds that in which tags were successfully removed. * diff --git a/src/Files/File.php b/src/Files/File.php index 4b6c0374..f7ba384d 100644 --- a/src/Files/File.php +++ b/src/Files/File.php @@ -6,7 +6,9 @@ use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkResponse; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion\Contracts\ResponseConverter; use ImageKit\Files\File\AITag; use ImageKit\Files\File\SelectedFieldsSchema; use ImageKit\Files\File\Type; @@ -40,16 +42,14 @@ * versionInfo?: VersionInfo, * width?: float, * } - * When used in a response, this type parameter can define a $rawResponse property. - * @template TRawResponse of object = object{} - * - * @mixin TRawResponse */ -final class File implements BaseModel +final class File implements BaseModel, ResponseConverter { /** @use SdkModel */ use SdkModel; + use SdkResponse; + /** * An array of tags assigned to the file by auto tagging. * @@ -263,7 +263,7 @@ public static function with( null !== $size && $obj->size = $size; null !== $tags && $obj->tags = $tags; null !== $thumbnail && $obj->thumbnail = $thumbnail; - null !== $type && $obj->type = $type instanceof Type ? $type->value : $type; + null !== $type && $obj['type'] = $type; null !== $updatedAt && $obj->updatedAt = $updatedAt; null !== $url && $obj->url = $url; null !== $versionInfo && $obj->versionInfo = $versionInfo; @@ -490,7 +490,7 @@ public function withThumbnail(string $thumbnail): self public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; return $obj; } diff --git a/src/Files/File/SelectedFieldsSchema.php b/src/Files/File/SelectedFieldsSchema.php index e14c5aba..136d032f 100644 --- a/src/Files/File/SelectedFieldsSchema.php +++ b/src/Files/File/SelectedFieldsSchema.php @@ -138,7 +138,7 @@ public static function with( ): self { $obj = new self; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; null !== $defaultValue && $obj->defaultValue = $defaultValue; null !== $isValueRequired && $obj->isValueRequired = $isValueRequired; @@ -161,7 +161,7 @@ public static function with( public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; return $obj; } diff --git a/src/Files/FileCopyResponse.php b/src/Files/FileCopyResponse.php index f6f2abd5..0153580e 100644 --- a/src/Files/FileCopyResponse.php +++ b/src/Files/FileCopyResponse.php @@ -5,20 +5,20 @@ namespace ImageKit\Files; use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkResponse; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type file_copy_response = array{} - * When used in a response, this type parameter can define a $rawResponse property. - * @template TRawResponse of object = object{} - * - * @mixin TRawResponse */ -final class FileCopyResponse implements BaseModel +final class FileCopyResponse implements BaseModel, ResponseConverter { /** @use SdkModel */ use SdkModel; + use SdkResponse; + public function __construct() { $this->initialize(); diff --git a/src/Files/FileMoveResponse.php b/src/Files/FileMoveResponse.php index f5c06a51..3fbb5342 100644 --- a/src/Files/FileMoveResponse.php +++ b/src/Files/FileMoveResponse.php @@ -5,20 +5,20 @@ namespace ImageKit\Files; use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkResponse; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type file_move_response = array{} - * When used in a response, this type parameter can define a $rawResponse property. - * @template TRawResponse of object = object{} - * - * @mixin TRawResponse */ -final class FileMoveResponse implements BaseModel +final class FileMoveResponse implements BaseModel, ResponseConverter { /** @use SdkModel */ use SdkModel; + use SdkResponse; + public function __construct() { $this->initialize(); diff --git a/src/Files/FileRenameResponse.php b/src/Files/FileRenameResponse.php index e18ed3fc..5fb64ea9 100644 --- a/src/Files/FileRenameResponse.php +++ b/src/Files/FileRenameResponse.php @@ -6,20 +6,20 @@ use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkResponse; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type file_rename_response = array{purgeRequestID?: string} - * When used in a response, this type parameter can define a $rawResponse property. - * @template TRawResponse of object = object{} - * - * @mixin TRawResponse */ -final class FileRenameResponse implements BaseModel +final class FileRenameResponse implements BaseModel, ResponseConverter { /** @use SdkModel */ use SdkModel; + use SdkResponse; + /** * Unique identifier of the purge request. This can be used to check the status of the purge request. */ diff --git a/src/Files/FileUpdateParams/RemoveAITags.php b/src/Files/FileUpdateParams/RemoveAITags.php index 6ded3696..14e111d8 100644 --- a/src/Files/FileUpdateParams/RemoveAITags.php +++ b/src/Files/FileUpdateParams/RemoveAITags.php @@ -7,7 +7,6 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Core\Conversion\EnumOf; use ImageKit\Core\Conversion\ListOf; /** @@ -27,6 +26,6 @@ final class RemoveAITags implements ConverterSource */ public static function variants(): array { - return [new ListOf('string'), new EnumOf(['all'])]; + return [new ListOf('string'), 'string']; } } diff --git a/src/Files/FileUpdateResponse.php b/src/Files/FileUpdateResponse.php index 0213368d..1bc21fcf 100644 --- a/src/Files/FileUpdateResponse.php +++ b/src/Files/FileUpdateResponse.php @@ -6,7 +6,9 @@ use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkResponse; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion\Contracts\ResponseConverter; use ImageKit\Files\File\AITag; use ImageKit\Files\File\SelectedFieldsSchema; use ImageKit\Files\File\Type; @@ -42,16 +44,14 @@ * width?: float, * extensionStatus?: ExtensionStatus, * } - * When used in a response, this type parameter can define a $rawResponse property. - * @template TRawResponse of object = object{} - * - * @mixin TRawResponse */ -final class FileUpdateResponse implements BaseModel +final class FileUpdateResponse implements BaseModel, ResponseConverter { /** @use SdkModel */ use SdkModel; + use SdkResponse; + /** * An array of tags assigned to the file by auto tagging. * @@ -269,7 +269,7 @@ public static function with( null !== $size && $obj->size = $size; null !== $tags && $obj->tags = $tags; null !== $thumbnail && $obj->thumbnail = $thumbnail; - null !== $type && $obj->type = $type instanceof Type ? $type->value : $type; + null !== $type && $obj['type'] = $type; null !== $updatedAt && $obj->updatedAt = $updatedAt; null !== $url && $obj->url = $url; null !== $versionInfo && $obj->versionInfo = $versionInfo; @@ -497,7 +497,7 @@ public function withThumbnail(string $thumbnail): self public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; return $obj; } diff --git a/src/Files/FileUpdateResponse/ExtensionStatus.php b/src/Files/FileUpdateResponse/ExtensionStatus.php index c99928f4..b882ad40 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus.php @@ -64,10 +64,10 @@ public static function with( ): self { $obj = new self; - null !== $aiAutoDescription && $obj->aiAutoDescription = $aiAutoDescription instanceof AIAutoDescription ? $aiAutoDescription->value : $aiAutoDescription; - null !== $awsAutoTagging && $obj->awsAutoTagging = $awsAutoTagging instanceof AwsAutoTagging ? $awsAutoTagging->value : $awsAutoTagging; - null !== $googleAutoTagging && $obj->googleAutoTagging = $googleAutoTagging instanceof GoogleAutoTagging ? $googleAutoTagging->value : $googleAutoTagging; - null !== $removeBg && $obj->removeBg = $removeBg instanceof RemoveBg ? $removeBg->value : $removeBg; + null !== $aiAutoDescription && $obj['aiAutoDescription'] = $aiAutoDescription; + null !== $awsAutoTagging && $obj['awsAutoTagging'] = $awsAutoTagging; + null !== $googleAutoTagging && $obj['googleAutoTagging'] = $googleAutoTagging; + null !== $removeBg && $obj['removeBg'] = $removeBg; return $obj; } @@ -79,7 +79,7 @@ public function withAIAutoDescription( AIAutoDescription|string $aiAutoDescription ): self { $obj = clone $this; - $obj->aiAutoDescription = $aiAutoDescription instanceof AIAutoDescription ? $aiAutoDescription->value : $aiAutoDescription; + $obj['aiAutoDescription'] = $aiAutoDescription; return $obj; } @@ -91,7 +91,7 @@ public function withAwsAutoTagging( AwsAutoTagging|string $awsAutoTagging ): self { $obj = clone $this; - $obj->awsAutoTagging = $awsAutoTagging instanceof AwsAutoTagging ? $awsAutoTagging->value : $awsAutoTagging; + $obj['awsAutoTagging'] = $awsAutoTagging; return $obj; } @@ -103,7 +103,7 @@ public function withGoogleAutoTagging( GoogleAutoTagging|string $googleAutoTagging ): self { $obj = clone $this; - $obj->googleAutoTagging = $googleAutoTagging instanceof GoogleAutoTagging ? $googleAutoTagging->value : $googleAutoTagging; + $obj['googleAutoTagging'] = $googleAutoTagging; return $obj; } @@ -114,7 +114,7 @@ public function withGoogleAutoTagging( public function withRemoveBg(RemoveBg|string $removeBg): self { $obj = clone $this; - $obj->removeBg = $removeBg instanceof RemoveBg ? $removeBg->value : $removeBg; + $obj['removeBg'] = $removeBg; return $obj; } diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index cc8b80b1..aa7ae914 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -344,7 +344,7 @@ public static function with( null !== $overwriteFile && $obj->overwriteFile = $overwriteFile; null !== $overwriteTags && $obj->overwriteTags = $overwriteTags; null !== $publicKey && $obj->publicKey = $publicKey; - null !== $responseFields && $obj->responseFields = array_map(fn ($v) => $v instanceof ResponseField ? $v->value : $v, $responseFields); + null !== $responseFields && $obj['responseFields'] = $responseFields; null !== $signature && $obj->signature = $signature; null !== $tags && $obj->tags = $tags; null !== $transformation && $obj->transformation = $transformation; @@ -586,7 +586,7 @@ public function withPublicKey(string $publicKey): self public function withResponseFields(array $responseFields): self { $obj = clone $this; - $obj->responseFields = array_map(fn ($v) => $v instanceof ResponseField ? $v->value : $v, $responseFields); + $obj['responseFields'] = $responseFields; return $obj; } diff --git a/src/Files/FileUploadParams/Transformation/Post/Abs.php b/src/Files/FileUploadParams/Transformation/Post/Abs.php index 21671f92..4278018a 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Abs.php +++ b/src/Files/FileUploadParams/Transformation/Post/Abs.php @@ -69,7 +69,7 @@ public static function with(Protocol|string $protocol, string $value): self { $obj = new self; - $obj->protocol = $protocol instanceof Protocol ? $protocol->value : $protocol; + $obj['protocol'] = $protocol; $obj->value = $value; return $obj; @@ -83,7 +83,7 @@ public static function with(Protocol|string $protocol, string $value): self public function withProtocol(Protocol|string $protocol): self { $obj = clone $this; - $obj->protocol = $protocol instanceof Protocol ? $protocol->value : $protocol; + $obj['protocol'] = $protocol; return $obj; } diff --git a/src/Files/FileUploadResponse.php b/src/Files/FileUploadResponse.php index 77e21283..3fd7524b 100644 --- a/src/Files/FileUploadResponse.php +++ b/src/Files/FileUploadResponse.php @@ -6,7 +6,9 @@ use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkResponse; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion\Contracts\ResponseConverter; use ImageKit\Files\FileUploadResponse\AITag; use ImageKit\Files\FileUploadResponse\ExtensionStatus; use ImageKit\Files\FileUploadResponse\SelectedFieldsSchema; @@ -42,16 +44,14 @@ * videoCodec?: string, * width?: float, * } - * When used in a response, this type parameter can define a $rawResponse property. - * @template TRawResponse of object = object{} - * - * @mixin TRawResponse */ -final class FileUploadResponse implements BaseModel +final class FileUploadResponse implements BaseModel, ResponseConverter { /** @use SdkModel */ use SdkModel; + use SdkResponse; + /** * An array of tags assigned to the uploaded file by auto tagging. * diff --git a/src/Files/FileUploadResponse/ExtensionStatus.php b/src/Files/FileUploadResponse/ExtensionStatus.php index 1223d021..48fedaaf 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Files/FileUploadResponse/ExtensionStatus.php @@ -72,10 +72,10 @@ public static function with( ): self { $obj = new self; - null !== $aiAutoDescription && $obj->aiAutoDescription = $aiAutoDescription instanceof AIAutoDescription ? $aiAutoDescription->value : $aiAutoDescription; - null !== $awsAutoTagging && $obj->awsAutoTagging = $awsAutoTagging instanceof AwsAutoTagging ? $awsAutoTagging->value : $awsAutoTagging; - null !== $googleAutoTagging && $obj->googleAutoTagging = $googleAutoTagging instanceof GoogleAutoTagging ? $googleAutoTagging->value : $googleAutoTagging; - null !== $removeBg && $obj->removeBg = $removeBg instanceof RemoveBg ? $removeBg->value : $removeBg; + null !== $aiAutoDescription && $obj['aiAutoDescription'] = $aiAutoDescription; + null !== $awsAutoTagging && $obj['awsAutoTagging'] = $awsAutoTagging; + null !== $googleAutoTagging && $obj['googleAutoTagging'] = $googleAutoTagging; + null !== $removeBg && $obj['removeBg'] = $removeBg; return $obj; } @@ -87,7 +87,7 @@ public function withAIAutoDescription( AIAutoDescription|string $aiAutoDescription ): self { $obj = clone $this; - $obj->aiAutoDescription = $aiAutoDescription instanceof AIAutoDescription ? $aiAutoDescription->value : $aiAutoDescription; + $obj['aiAutoDescription'] = $aiAutoDescription; return $obj; } @@ -99,7 +99,7 @@ public function withAwsAutoTagging( AwsAutoTagging|string $awsAutoTagging ): self { $obj = clone $this; - $obj->awsAutoTagging = $awsAutoTagging instanceof AwsAutoTagging ? $awsAutoTagging->value : $awsAutoTagging; + $obj['awsAutoTagging'] = $awsAutoTagging; return $obj; } @@ -111,7 +111,7 @@ public function withGoogleAutoTagging( GoogleAutoTagging|string $googleAutoTagging ): self { $obj = clone $this; - $obj->googleAutoTagging = $googleAutoTagging instanceof GoogleAutoTagging ? $googleAutoTagging->value : $googleAutoTagging; + $obj['googleAutoTagging'] = $googleAutoTagging; return $obj; } @@ -122,7 +122,7 @@ public function withGoogleAutoTagging( public function withRemoveBg(RemoveBg|string $removeBg): self { $obj = clone $this; - $obj->removeBg = $removeBg instanceof RemoveBg ? $removeBg->value : $removeBg; + $obj['removeBg'] = $removeBg; return $obj; } diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema.php b/src/Files/FileUploadResponse/SelectedFieldsSchema.php index 8b66451e..dbc8ea01 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema.php @@ -138,7 +138,7 @@ public static function with( ): self { $obj = new self; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; null !== $defaultValue && $obj->defaultValue = $defaultValue; null !== $isValueRequired && $obj->isValueRequired = $isValueRequired; @@ -161,7 +161,7 @@ public static function with( public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; return $obj; } diff --git a/src/Files/Folder.php b/src/Files/Folder.php index c3941041..1da766ce 100644 --- a/src/Files/Folder.php +++ b/src/Files/Folder.php @@ -88,7 +88,7 @@ public static function with( null !== $folderID && $obj->folderID = $folderID; null !== $folderPath && $obj->folderPath = $folderPath; null !== $name && $obj->name = $name; - null !== $type && $obj->type = $type instanceof Type ? $type->value : $type; + null !== $type && $obj['type'] = $type; null !== $updatedAt && $obj->updatedAt = $updatedAt; return $obj; @@ -146,7 +146,7 @@ public function withName(string $name): self public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; return $obj; } diff --git a/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php b/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php index bffc8ccb..ad2c61ce 100644 --- a/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php +++ b/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php @@ -7,7 +7,6 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Core\Conversion\EnumOf; use ImageKit\Core\Conversion\ListOf; /** @@ -27,6 +26,6 @@ final class RemoveAITags implements ConverterSource */ public static function variants(): array { - return [new ListOf('string'), new EnumOf(['all'])]; + return [new ListOf('string'), 'string']; } } diff --git a/src/Files/Versions/VersionDeleteResponse.php b/src/Files/Versions/VersionDeleteResponse.php index 242e8ea6..93a1ca29 100644 --- a/src/Files/Versions/VersionDeleteResponse.php +++ b/src/Files/Versions/VersionDeleteResponse.php @@ -5,20 +5,20 @@ namespace ImageKit\Files\Versions; use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkResponse; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type version_delete_response = array{} - * When used in a response, this type parameter can define a $rawResponse property. - * @template TRawResponse of object = object{} - * - * @mixin TRawResponse */ -final class VersionDeleteResponse implements BaseModel +final class VersionDeleteResponse implements BaseModel, ResponseConverter { /** @use SdkModel */ use SdkModel; + use SdkResponse; + public function __construct() { $this->initialize(); diff --git a/src/Folders/FolderCopyResponse.php b/src/Folders/FolderCopyResponse.php index 65246169..35b74345 100644 --- a/src/Folders/FolderCopyResponse.php +++ b/src/Folders/FolderCopyResponse.php @@ -6,22 +6,22 @@ use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkResponse; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** * Job submitted successfully. A `jobId` will be returned. * * @phpstan-type folder_copy_response = array{jobID: string} - * When used in a response, this type parameter can define a $rawResponse property. - * @template TRawResponse of object = object{} - * - * @mixin TRawResponse */ -final class FolderCopyResponse implements BaseModel +final class FolderCopyResponse implements BaseModel, ResponseConverter { /** @use SdkModel */ use SdkModel; + use SdkResponse; + /** * Unique identifier of the bulk job. This can be used to check the status of the bulk job. */ diff --git a/src/Folders/FolderDeleteResponse.php b/src/Folders/FolderDeleteResponse.php index ccd5d372..c90bd569 100644 --- a/src/Folders/FolderDeleteResponse.php +++ b/src/Folders/FolderDeleteResponse.php @@ -5,20 +5,20 @@ namespace ImageKit\Folders; use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkResponse; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type folder_delete_response = array{} - * When used in a response, this type parameter can define a $rawResponse property. - * @template TRawResponse of object = object{} - * - * @mixin TRawResponse */ -final class FolderDeleteResponse implements BaseModel +final class FolderDeleteResponse implements BaseModel, ResponseConverter { /** @use SdkModel */ use SdkModel; + use SdkResponse; + public function __construct() { $this->initialize(); diff --git a/src/Folders/FolderMoveResponse.php b/src/Folders/FolderMoveResponse.php index 842abe0c..c3901864 100644 --- a/src/Folders/FolderMoveResponse.php +++ b/src/Folders/FolderMoveResponse.php @@ -6,22 +6,22 @@ use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkResponse; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** * Job submitted successfully. A `jobId` will be returned. * * @phpstan-type folder_move_response = array{jobID: string} - * When used in a response, this type parameter can define a $rawResponse property. - * @template TRawResponse of object = object{} - * - * @mixin TRawResponse */ -final class FolderMoveResponse implements BaseModel +final class FolderMoveResponse implements BaseModel, ResponseConverter { /** @use SdkModel */ use SdkModel; + use SdkResponse; + /** * Unique identifier of the bulk job. This can be used to check the status of the bulk job. */ diff --git a/src/Folders/FolderNewResponse.php b/src/Folders/FolderNewResponse.php index 2312ed56..d077c702 100644 --- a/src/Folders/FolderNewResponse.php +++ b/src/Folders/FolderNewResponse.php @@ -5,20 +5,20 @@ namespace ImageKit\Folders; use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkResponse; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type folder_new_response = array{} - * When used in a response, this type parameter can define a $rawResponse property. - * @template TRawResponse of object = object{} - * - * @mixin TRawResponse */ -final class FolderNewResponse implements BaseModel +final class FolderNewResponse implements BaseModel, ResponseConverter { /** @use SdkModel */ use SdkModel; + use SdkResponse; + public function __construct() { $this->initialize(); diff --git a/src/Folders/FolderRenameResponse.php b/src/Folders/FolderRenameResponse.php index 13d18be4..e1b3b5b5 100644 --- a/src/Folders/FolderRenameResponse.php +++ b/src/Folders/FolderRenameResponse.php @@ -6,22 +6,22 @@ use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkResponse; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** * Job submitted successfully. A `jobId` will be returned. * * @phpstan-type folder_rename_response = array{jobID: string} - * When used in a response, this type parameter can define a $rawResponse property. - * @template TRawResponse of object = object{} - * - * @mixin TRawResponse */ -final class FolderRenameResponse implements BaseModel +final class FolderRenameResponse implements BaseModel, ResponseConverter { /** @use SdkModel */ use SdkModel; + use SdkResponse; + /** * Unique identifier of the bulk job. This can be used to check the status of the bulk job. */ diff --git a/src/Folders/Job/JobGetResponse.php b/src/Folders/Job/JobGetResponse.php index 18520710..d8734c35 100644 --- a/src/Folders/Job/JobGetResponse.php +++ b/src/Folders/Job/JobGetResponse.php @@ -6,7 +6,9 @@ use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkResponse; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion\Contracts\ResponseConverter; use ImageKit\Folders\Job\JobGetResponse\Status; use ImageKit\Folders\Job\JobGetResponse\Type; @@ -17,16 +19,14 @@ * status?: value-of, * type?: value-of, * } - * When used in a response, this type parameter can define a $rawResponse property. - * @template TRawResponse of object = object{} - * - * @mixin TRawResponse */ -final class JobGetResponse implements BaseModel +final class JobGetResponse implements BaseModel, ResponseConverter { /** @use SdkModel */ use SdkModel; + use SdkResponse; + /** * Unique identifier of the bulk job. */ @@ -78,8 +78,8 @@ public static function with( null !== $jobID && $obj->jobID = $jobID; null !== $purgeRequestID && $obj->purgeRequestID = $purgeRequestID; - null !== $status && $obj->status = $status instanceof Status ? $status->value : $status; - null !== $type && $obj->type = $type instanceof Type ? $type->value : $type; + null !== $status && $obj['status'] = $status; + null !== $type && $obj['type'] = $type; return $obj; } @@ -114,7 +114,7 @@ public function withPurgeRequestID(string $purgeRequestID): self public function withStatus(Status|string $status): self { $obj = clone $this; - $obj->status = $status instanceof Status ? $status->value : $status; + $obj['status'] = $status; return $obj; } @@ -127,7 +127,7 @@ public function withStatus(Status|string $status): self public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; return $obj; } diff --git a/src/ImageOverlay.php b/src/ImageOverlay.php index e0e0cf3c..fca71985 100644 --- a/src/ImageOverlay.php +++ b/src/ImageOverlay.php @@ -99,7 +99,7 @@ public static function with( null !== $position && $obj->position = $position; null !== $timing && $obj->timing = $timing; - null !== $encoding && $obj->encoding = $encoding instanceof Encoding ? $encoding->value : $encoding; + null !== $encoding && $obj['encoding'] = $encoding; null !== $transformation && $obj->transformation = $transformation; return $obj; @@ -143,7 +143,7 @@ public function withInput(string $input): self public function withEncoding(Encoding|string $encoding): self { $obj = clone $this; - $obj->encoding = $encoding instanceof Encoding ? $encoding->value : $encoding; + $obj['encoding'] = $encoding; return $obj; } diff --git a/src/OverlayPosition.php b/src/OverlayPosition.php index 8d2fab24..2ae7a57e 100644 --- a/src/OverlayPosition.php +++ b/src/OverlayPosition.php @@ -65,7 +65,7 @@ public static function with( ): self { $obj = new self; - null !== $focus && $obj->focus = $focus instanceof Focus ? $focus->value : $focus; + null !== $focus && $obj['focus'] = $focus; null !== $x && $obj->x = $x; null !== $y && $obj->y = $y; @@ -81,7 +81,7 @@ public static function with( public function withFocus(Focus|string $focus): self { $obj = clone $this; - $obj->focus = $focus instanceof Focus ? $focus->value : $focus; + $obj['focus'] = $focus; return $obj; } diff --git a/src/ServiceContracts/Accounts/OriginsContract.php b/src/ServiceContracts/Accounts/OriginsContract.php index f066c33a..d7b16812 100644 --- a/src/ServiceContracts/Accounts/OriginsContract.php +++ b/src/ServiceContracts/Accounts/OriginsContract.php @@ -27,13 +27,8 @@ interface OriginsContract * @param string $name display name of the origin * @param string $secretKey secret key for the bucket * @param string $type - * @param string $baseURLForCanonicalHeader URL used in the Canonical header (if enabled) - * @param bool $includeCanonicalHeader whether to send a Canonical header - * @param string $prefix * @param string $endpoint custom S3-compatible endpoint - * @param bool $s3ForcePathStyle Use path-style S3 URLs? * @param string $baseURL akeneo instance base URL - * @param bool $forwardHostHeaderToOrigin Forward the Host header to origin? * @param string $clientEmail * @param string $privateKey * @param string $accountName @@ -43,6 +38,11 @@ interface OriginsContract * @param string $clientSecret akeneo API client secret * @param string $password akeneo API password * @param string $username akeneo API username + * @param string $baseURLForCanonicalHeader URL used in the Canonical header (if enabled) + * @param bool $includeCanonicalHeader whether to send a Canonical header + * @param string $prefix + * @param bool $s3ForcePathStyle Use path-style S3 URLs? + * @param bool $forwardHostHeaderToOrigin Forward the Host header to origin? * * @throws APIException */ @@ -52,13 +52,8 @@ public function create( $name, $secretKey, $type, - $baseURLForCanonicalHeader = omit, - $includeCanonicalHeader = omit, - $prefix = omit, $endpoint, - $s3ForcePathStyle = omit, $baseURL, - $forwardHostHeaderToOrigin = omit, $clientEmail, $privateKey, $accountName, @@ -68,6 +63,11 @@ public function create( $clientSecret, $password, $username, + $baseURLForCanonicalHeader = omit, + $includeCanonicalHeader = omit, + $prefix = omit, + $s3ForcePathStyle = omit, + $forwardHostHeaderToOrigin = omit, ?RequestOptions $requestOptions = null, ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim; @@ -91,13 +91,8 @@ public function createRaw( * @param string $name display name of the origin * @param string $secretKey secret key for the bucket * @param string $type - * @param string $baseURLForCanonicalHeader URL used in the Canonical header (if enabled) - * @param bool $includeCanonicalHeader whether to send a Canonical header - * @param string $prefix * @param string $endpoint custom S3-compatible endpoint - * @param bool $s3ForcePathStyle Use path-style S3 URLs? * @param string $baseURL akeneo instance base URL - * @param bool $forwardHostHeaderToOrigin Forward the Host header to origin? * @param string $clientEmail * @param string $privateKey * @param string $accountName @@ -107,6 +102,11 @@ public function createRaw( * @param string $clientSecret akeneo API client secret * @param string $password akeneo API password * @param string $username akeneo API username + * @param string $baseURLForCanonicalHeader URL used in the Canonical header (if enabled) + * @param bool $includeCanonicalHeader whether to send a Canonical header + * @param string $prefix + * @param bool $s3ForcePathStyle Use path-style S3 URLs? + * @param bool $forwardHostHeaderToOrigin Forward the Host header to origin? * * @throws APIException */ @@ -117,13 +117,8 @@ public function update( $name, $secretKey, $type, - $baseURLForCanonicalHeader = omit, - $includeCanonicalHeader = omit, - $prefix = omit, $endpoint, - $s3ForcePathStyle = omit, $baseURL, - $forwardHostHeaderToOrigin = omit, $clientEmail, $privateKey, $accountName, @@ -133,6 +128,11 @@ public function update( $clientSecret, $password, $username, + $baseURLForCanonicalHeader = omit, + $includeCanonicalHeader = omit, + $prefix = omit, + $s3ForcePathStyle = omit, + $forwardHostHeaderToOrigin = omit, ?RequestOptions $requestOptions = null, ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim; @@ -160,18 +160,6 @@ public function list( ?RequestOptions $requestOptions = null ): array; - /** - * @api - * - * @return list - * - * @throws APIException - */ - public function listRaw( - mixed $params, - ?RequestOptions $requestOptions = null - ): array; - /** * @api * @@ -182,17 +170,6 @@ public function delete( ?RequestOptions $requestOptions = null ): mixed; - /** - * @api - * - * @throws APIException - */ - public function deleteRaw( - string $id, - mixed $params, - ?RequestOptions $requestOptions = null - ): mixed; - /** * @api * @@ -202,15 +179,4 @@ public function get( string $id, ?RequestOptions $requestOptions = null ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim; - - /** - * @api - * - * @throws APIException - */ - public function getRaw( - string $id, - mixed $params, - ?RequestOptions $requestOptions = null - ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim; } diff --git a/src/ServiceContracts/Accounts/URLEndpointsContract.php b/src/ServiceContracts/Accounts/URLEndpointsContract.php index 58814d38..9e61e201 100644 --- a/src/ServiceContracts/Accounts/URLEndpointsContract.php +++ b/src/ServiceContracts/Accounts/URLEndpointsContract.php @@ -9,7 +9,6 @@ use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Imgix; use ImageKit\Accounts\URLEndpoints\URLEndpointResponse; use ImageKit\Core\Exceptions\APIException; -use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\RequestOptions; use const ImageKit\Core\OMIT as omit; @@ -24,8 +23,6 @@ interface URLEndpointsContract * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) * @param Cloudinary|Imgix|Akamai $urlRewriter configuration for third-party URL rewriting * - * @return URLEndpointResponse - * * @throws APIException */ public function create( @@ -41,8 +38,6 @@ public function create( * * @param array $params * - * @return URLEndpointResponse - * * @throws APIException */ public function createRaw( @@ -58,8 +53,6 @@ public function createRaw( * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) * @param ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Cloudinary|ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Imgix|ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Akamai $urlRewriter configuration for third-party URL rewriting * - * @return URLEndpointResponse - * * @throws APIException */ public function update( @@ -76,8 +69,6 @@ public function update( * * @param array $params * - * @return URLEndpointResponse - * * @throws APIException */ public function updateRaw( @@ -97,18 +88,6 @@ public function list( ?RequestOptions $requestOptions = null ): array; - /** - * @api - * - * @return list - * - * @throws APIException - */ - public function listRaw( - mixed $params, - ?RequestOptions $requestOptions = null - ): array; - /** * @api * @@ -124,34 +103,8 @@ public function delete( * * @throws APIException */ - public function deleteRaw( - string $id, - mixed $params, - ?RequestOptions $requestOptions = null - ): mixed; - - /** - * @api - * - * @return URLEndpointResponse - * - * @throws APIException - */ public function get( string $id, ?RequestOptions $requestOptions = null ): URLEndpointResponse; - - /** - * @api - * - * @return URLEndpointResponse - * - * @throws APIException - */ - public function getRaw( - string $id, - mixed $params, - ?RequestOptions $requestOptions = null - ): URLEndpointResponse; } diff --git a/src/ServiceContracts/Accounts/UsageContract.php b/src/ServiceContracts/Accounts/UsageContract.php index 11aa8aaf..28a2a5cc 100644 --- a/src/ServiceContracts/Accounts/UsageContract.php +++ b/src/ServiceContracts/Accounts/UsageContract.php @@ -6,7 +6,6 @@ use ImageKit\Accounts\Usage\UsageGetResponse; use ImageKit\Core\Exceptions\APIException; -use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\RequestOptions; interface UsageContract @@ -17,8 +16,6 @@ interface UsageContract * @param \DateTimeInterface $endDate Specify a `endDate` in `YYYY-MM-DD` format. It should be after the `startDate`. The difference between `startDate` and `endDate` should be less than 90 days. * @param \DateTimeInterface $startDate Specify a `startDate` in `YYYY-MM-DD` format. It should be before the `endDate`. The difference between `startDate` and `endDate` should be less than 90 days. * - * @return UsageGetResponse - * * @throws APIException */ public function get( @@ -32,8 +29,6 @@ public function get( * * @param array $params * - * @return UsageGetResponse - * * @throws APIException */ public function getRaw( diff --git a/src/ServiceContracts/Beta/V2/FilesContract.php b/src/ServiceContracts/Beta/V2/FilesContract.php index aa657f02..432ccdea 100644 --- a/src/ServiceContracts/Beta/V2/FilesContract.php +++ b/src/ServiceContracts/Beta/V2/FilesContract.php @@ -8,7 +8,6 @@ use ImageKit\Beta\V2\Files\FileUploadParams\Transformation; use ImageKit\Beta\V2\Files\FileUploadResponse; use ImageKit\Core\Exceptions\APIException; -use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\ExtensionItem\AIAutoDescription; use ImageKit\ExtensionItem\AutoTaggingExtension; use ImageKit\ExtensionItem\RemoveBg; @@ -74,8 +73,6 @@ interface FilesContract * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. * - * @return FileUploadResponse - * * @throws APIException */ public function upload( @@ -107,8 +104,6 @@ public function upload( * * @param array $params * - * @return FileUploadResponse - * * @throws APIException */ public function uploadRaw( diff --git a/src/ServiceContracts/Cache/InvalidationContract.php b/src/ServiceContracts/Cache/InvalidationContract.php index 647d9144..da9c00ff 100644 --- a/src/ServiceContracts/Cache/InvalidationContract.php +++ b/src/ServiceContracts/Cache/InvalidationContract.php @@ -7,7 +7,6 @@ use ImageKit\Cache\Invalidation\InvalidationGetResponse; use ImageKit\Cache\Invalidation\InvalidationNewResponse; use ImageKit\Core\Exceptions\APIException; -use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\RequestOptions; interface InvalidationContract @@ -17,8 +16,6 @@ interface InvalidationContract * * @param string $url the full URL of the file to be purged * - * @return InvalidationNewResponse - * * @throws APIException */ public function create( @@ -31,8 +28,6 @@ public function create( * * @param array $params * - * @return InvalidationNewResponse - * * @throws APIException */ public function createRaw( @@ -43,25 +38,10 @@ public function createRaw( /** * @api * - * @return InvalidationGetResponse - * * @throws APIException */ public function get( string $requestID, ?RequestOptions $requestOptions = null ): InvalidationGetResponse; - - /** - * @api - * - * @return InvalidationGetResponse - * - * @throws APIException - */ - public function getRaw( - string $requestID, - mixed $params, - ?RequestOptions $requestOptions = null - ): InvalidationGetResponse; } diff --git a/src/ServiceContracts/CustomMetadataFieldsContract.php b/src/ServiceContracts/CustomMetadataFieldsContract.php index 28494864..94988076 100644 --- a/src/ServiceContracts/CustomMetadataFieldsContract.php +++ b/src/ServiceContracts/CustomMetadataFieldsContract.php @@ -5,7 +5,6 @@ namespace ImageKit\ServiceContracts; use ImageKit\Core\Exceptions\APIException; -use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\CustomMetadataFields\CustomMetadataField; use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; use ImageKit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; @@ -22,8 +21,6 @@ interface CustomMetadataFieldsContract * @param string $name API name of the custom metadata field. This should be unique across all (including deleted) custom metadata fields. * @param Schema $schema * - * @return CustomMetadataField - * * @throws APIException */ public function create( @@ -38,8 +35,6 @@ public function create( * * @param array $params * - * @return CustomMetadataField - * * @throws APIException */ public function createRaw( @@ -53,8 +48,6 @@ public function createRaw( * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. This parameter is required if `schema` is not provided. * @param ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. * - * @return CustomMetadataField - * * @throws APIException */ public function update( @@ -69,8 +62,6 @@ public function update( * * @param array $params * - * @return CustomMetadataField - * * @throws APIException */ public function updateRaw( @@ -112,25 +103,10 @@ public function listRaw( /** * @api * - * @return CustomMetadataFieldDeleteResponse - * * @throws APIException */ public function delete( string $id, ?RequestOptions $requestOptions = null ): CustomMetadataFieldDeleteResponse; - - /** - * @api - * - * @return CustomMetadataFieldDeleteResponse - * - * @throws APIException - */ - public function deleteRaw( - string $id, - mixed $params, - ?RequestOptions $requestOptions = null - ): CustomMetadataFieldDeleteResponse; } diff --git a/src/ServiceContracts/Files/BulkContract.php b/src/ServiceContracts/Files/BulkContract.php index 47ca015b..a2e6fad2 100644 --- a/src/ServiceContracts/Files/BulkContract.php +++ b/src/ServiceContracts/Files/BulkContract.php @@ -5,7 +5,6 @@ namespace ImageKit\ServiceContracts\Files; use ImageKit\Core\Exceptions\APIException; -use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\Files\Bulk\BulkAddTagsResponse; use ImageKit\Files\Bulk\BulkDeleteResponse; use ImageKit\Files\Bulk\BulkRemoveAITagsResponse; @@ -19,8 +18,6 @@ interface BulkContract * * @param list $fileIDs an array of fileIds which you want to delete * - * @return BulkDeleteResponse - * * @throws APIException */ public function delete( @@ -33,8 +30,6 @@ public function delete( * * @param array $params * - * @return BulkDeleteResponse - * * @throws APIException */ public function deleteRaw( @@ -48,8 +43,6 @@ public function deleteRaw( * @param list $fileIDs an array of fileIds to which you want to add tags * @param list $tags an array of tags that you want to add to the files * - * @return BulkAddTagsResponse - * * @throws APIException */ public function addTags( @@ -63,8 +56,6 @@ public function addTags( * * @param array $params * - * @return BulkAddTagsResponse - * * @throws APIException */ public function addTagsRaw( @@ -78,8 +69,6 @@ public function addTagsRaw( * @param list $aiTags an array of AITags that you want to remove from the files * @param list $fileIDs an array of fileIds from which you want to remove AITags * - * @return BulkRemoveAITagsResponse - * * @throws APIException */ public function removeAITags( @@ -93,8 +82,6 @@ public function removeAITags( * * @param array $params * - * @return BulkRemoveAITagsResponse - * * @throws APIException */ public function removeAITagsRaw( @@ -108,8 +95,6 @@ public function removeAITagsRaw( * @param list $fileIDs an array of fileIds from which you want to remove tags * @param list $tags an array of tags that you want to remove from the files * - * @return BulkRemoveTagsResponse - * * @throws APIException */ public function removeTags( @@ -123,8 +108,6 @@ public function removeTags( * * @param array $params * - * @return BulkRemoveTagsResponse - * * @throws APIException */ public function removeTagsRaw( diff --git a/src/ServiceContracts/Files/MetadataContract.php b/src/ServiceContracts/Files/MetadataContract.php index aef7fd6e..8641ce9e 100644 --- a/src/ServiceContracts/Files/MetadataContract.php +++ b/src/ServiceContracts/Files/MetadataContract.php @@ -20,17 +20,6 @@ public function get( ?RequestOptions $requestOptions = null ): Metadata; - /** - * @api - * - * @throws APIException - */ - public function getRaw( - string $fileID, - mixed $params, - ?RequestOptions $requestOptions = null - ): Metadata; - /** * @api * diff --git a/src/ServiceContracts/Files/VersionsContract.php b/src/ServiceContracts/Files/VersionsContract.php index 58fd9d1c..623c4572 100644 --- a/src/ServiceContracts/Files/VersionsContract.php +++ b/src/ServiceContracts/Files/VersionsContract.php @@ -5,7 +5,6 @@ namespace ImageKit\ServiceContracts\Files; use ImageKit\Core\Exceptions\APIException; -use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\Files\File; use ImageKit\Files\Versions\VersionDeleteResponse; use ImageKit\RequestOptions; @@ -24,26 +23,11 @@ public function list( ?RequestOptions $requestOptions = null ): array; - /** - * @api - * - * @return list - * - * @throws APIException - */ - public function listRaw( - string $fileID, - mixed $params, - ?RequestOptions $requestOptions = null - ): array; - /** * @api * * @param string $fileID * - * @return VersionDeleteResponse - * * @throws APIException */ public function delete( @@ -57,8 +41,6 @@ public function delete( * * @param array $params * - * @return VersionDeleteResponse - * * @throws APIException */ public function deleteRaw( @@ -72,8 +54,6 @@ public function deleteRaw( * * @param string $fileID * - * @return File - * * @throws APIException */ public function get( @@ -87,8 +67,6 @@ public function get( * * @param array $params * - * @return File - * * @throws APIException */ public function getRaw( @@ -102,8 +80,6 @@ public function getRaw( * * @param string $fileID * - * @return File - * * @throws APIException */ public function restore( @@ -117,8 +93,6 @@ public function restore( * * @param array $params * - * @return File - * * @throws APIException */ public function restoreRaw( diff --git a/src/ServiceContracts/FilesContract.php b/src/ServiceContracts/FilesContract.php index 8d06b2f5..00a64177 100644 --- a/src/ServiceContracts/FilesContract.php +++ b/src/ServiceContracts/FilesContract.php @@ -5,7 +5,6 @@ namespace ImageKit\ServiceContracts; use ImageKit\Core\Exceptions\APIException; -use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\ExtensionItem\AIAutoDescription; use ImageKit\ExtensionItem\AutoTaggingExtension; use ImageKit\ExtensionItem\RemoveBg; @@ -41,8 +40,6 @@ interface FilesContract * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. * @param Publish $publish configure the publication status of a file and its versions * - * @return FileUpdateResponse - * * @throws APIException */ public function update( @@ -63,8 +60,6 @@ public function update( * * @param array $params * - * @return FileUpdateResponse - * * @throws APIException */ public function updateRaw( @@ -83,17 +78,6 @@ public function delete( ?RequestOptions $requestOptions = null ): mixed; - /** - * @api - * - * @throws APIException - */ - public function deleteRaw( - string $fileID, - mixed $params, - ?RequestOptions $requestOptions = null - ): mixed; - /** * @api * @@ -101,8 +85,6 @@ public function deleteRaw( * @param string $sourceFilePath the full path of the file you want to copy * @param bool $includeFileVersions Option to copy all versions of a file. By default, only the current version of the file is copied. When set to true, all versions of the file will be copied. Default value - `false`. * - * @return FileCopyResponse - * * @throws APIException */ public function copy( @@ -117,8 +99,6 @@ public function copy( * * @param array $params * - * @return FileCopyResponse - * * @throws APIException */ public function copyRaw( @@ -129,8 +109,6 @@ public function copyRaw( /** * @api * - * @return File - * * @throws APIException */ public function get( @@ -138,27 +116,12 @@ public function get( ?RequestOptions $requestOptions = null ): File; - /** - * @api - * - * @return File - * - * @throws APIException - */ - public function getRaw( - string $fileID, - mixed $params, - ?RequestOptions $requestOptions = null - ): File; - /** * @api * * @param string $destinationPath full path to the folder you want to move the above file into * @param string $sourceFilePath the full path of the file you want to move * - * @return FileMoveResponse - * * @throws APIException */ public function move( @@ -172,8 +135,6 @@ public function move( * * @param array $params * - * @return FileMoveResponse - * * @throws APIException */ public function moveRaw( @@ -197,8 +158,6 @@ public function moveRaw( * * Note: If the old file were accessible at `https://ik.imagekit.io/demo/old-filename.jpg`, a purge cache request would be issued against `https://ik.imagekit.io/demo/old-filename.jpg*` (with a wildcard at the end). It will remove the file and its versions' URLs and any transformations made using query parameters on this file or its versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. * - * @return FileRenameResponse - * * @throws APIException */ public function rename( @@ -213,8 +172,6 @@ public function rename( * * @param array $params * - * @return FileRenameResponse - * * @throws APIException */ public function renameRaw( @@ -298,8 +255,6 @@ public function renameRaw( * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. * - * @return FileUploadResponse - * * @throws APIException */ public function upload( @@ -334,8 +289,6 @@ public function upload( * * @param array $params * - * @return FileUploadResponse - * * @throws APIException */ public function uploadRaw( diff --git a/src/ServiceContracts/Folders/JobContract.php b/src/ServiceContracts/Folders/JobContract.php index 9f654bc3..c97679c9 100644 --- a/src/ServiceContracts/Folders/JobContract.php +++ b/src/ServiceContracts/Folders/JobContract.php @@ -5,7 +5,6 @@ namespace ImageKit\ServiceContracts\Folders; use ImageKit\Core\Exceptions\APIException; -use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\Folders\Job\JobGetResponse; use ImageKit\RequestOptions; @@ -14,25 +13,10 @@ interface JobContract /** * @api * - * @return JobGetResponse - * * @throws APIException */ public function get( string $jobID, ?RequestOptions $requestOptions = null ): JobGetResponse; - - /** - * @api - * - * @return JobGetResponse - * - * @throws APIException - */ - public function getRaw( - string $jobID, - mixed $params, - ?RequestOptions $requestOptions = null - ): JobGetResponse; } diff --git a/src/ServiceContracts/FoldersContract.php b/src/ServiceContracts/FoldersContract.php index 92279fa9..b245f822 100644 --- a/src/ServiceContracts/FoldersContract.php +++ b/src/ServiceContracts/FoldersContract.php @@ -5,7 +5,6 @@ namespace ImageKit\ServiceContracts; use ImageKit\Core\Exceptions\APIException; -use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\Folders\FolderCopyResponse; use ImageKit\Folders\FolderDeleteResponse; use ImageKit\Folders\FolderMoveResponse; @@ -27,8 +26,6 @@ interface FoldersContract * * Note: If any folder(s) is not present in the parentFolderPath parameter, it will be automatically created. For example, if you pass `/product/images/summer`, then `product`, `images`, and `summer` folders will be created if they don't already exist. * - * @return FolderNewResponse - * * @throws APIException */ public function create( @@ -42,8 +39,6 @@ public function create( * * @param array $params * - * @return FolderNewResponse - * * @throws APIException */ public function createRaw( @@ -56,8 +51,6 @@ public function createRaw( * * @param string $folderPath Full path to the folder you want to delete. For example `/folder/to/delete/`. * - * @return FolderDeleteResponse - * * @throws APIException */ public function delete( @@ -70,8 +63,6 @@ public function delete( * * @param array $params * - * @return FolderDeleteResponse - * * @throws APIException */ public function deleteRaw( @@ -86,8 +77,6 @@ public function deleteRaw( * @param string $sourceFolderPath the full path to the source folder you want to copy * @param bool $includeVersions Option to copy all versions of files that are nested inside the selected folder. By default, only the current version of each file will be copied. When set to true, all versions of each file will be copied. Default value - `false`. * - * @return FolderCopyResponse - * * @throws APIException */ public function copy( @@ -102,8 +91,6 @@ public function copy( * * @param array $params * - * @return FolderCopyResponse - * * @throws APIException */ public function copyRaw( @@ -117,8 +104,6 @@ public function copyRaw( * @param string $destinationPath full path to the destination folder where you want to move the source folder into * @param string $sourceFolderPath the full path to the source folder you want to move * - * @return FolderMoveResponse - * * @throws APIException */ public function move( @@ -132,8 +117,6 @@ public function move( * * @param array $params * - * @return FolderMoveResponse - * * @throws APIException */ public function moveRaw( @@ -156,8 +139,6 @@ public function moveRaw( * * Default value - `false` * - * @return FolderRenameResponse - * * @throws APIException */ public function rename( @@ -172,8 +153,6 @@ public function rename( * * @param array $params * - * @return FolderRenameResponse - * * @throws APIException */ public function renameRaw( diff --git a/src/Services/Accounts/OriginsService.php b/src/Services/Accounts/OriginsService.php index da280a76..5c58ff3f 100644 --- a/src/Services/Accounts/OriginsService.php +++ b/src/Services/Accounts/OriginsService.php @@ -41,13 +41,8 @@ public function __construct(private Client $client) {} * @param string $name display name of the origin * @param string $secretKey secret key for the bucket * @param string $type - * @param string $baseURLForCanonicalHeader URL used in the Canonical header (if enabled) - * @param bool $includeCanonicalHeader whether to send a Canonical header - * @param string $prefix * @param string $endpoint custom S3-compatible endpoint - * @param bool $s3ForcePathStyle Use path-style S3 URLs? * @param string $baseURL akeneo instance base URL - * @param bool $forwardHostHeaderToOrigin Forward the Host header to origin? * @param string $clientEmail * @param string $privateKey * @param string $accountName @@ -57,6 +52,11 @@ public function __construct(private Client $client) {} * @param string $clientSecret akeneo API client secret * @param string $password akeneo API password * @param string $username akeneo API username + * @param string $baseURLForCanonicalHeader URL used in the Canonical header (if enabled) + * @param bool $includeCanonicalHeader whether to send a Canonical header + * @param string $prefix + * @param bool $s3ForcePathStyle Use path-style S3 URLs? + * @param bool $forwardHostHeaderToOrigin Forward the Host header to origin? * * @throws APIException */ @@ -66,13 +66,8 @@ public function create( $name, $secretKey, $type, - $baseURLForCanonicalHeader = omit, - $includeCanonicalHeader = omit, - $prefix = omit, $endpoint, - $s3ForcePathStyle = omit, $baseURL, - $forwardHostHeaderToOrigin = omit, $clientEmail, $privateKey, $accountName, @@ -82,6 +77,11 @@ public function create( $clientSecret, $password, $username, + $baseURLForCanonicalHeader = omit, + $includeCanonicalHeader = omit, + $prefix = omit, + $s3ForcePathStyle = omit, + $forwardHostHeaderToOrigin = omit, ?RequestOptions $requestOptions = null, ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { $params = [ @@ -148,13 +148,8 @@ public function createRaw( * @param string $name display name of the origin * @param string $secretKey secret key for the bucket * @param string $type - * @param string $baseURLForCanonicalHeader URL used in the Canonical header (if enabled) - * @param bool $includeCanonicalHeader whether to send a Canonical header - * @param string $prefix * @param string $endpoint custom S3-compatible endpoint - * @param bool $s3ForcePathStyle Use path-style S3 URLs? * @param string $baseURL akeneo instance base URL - * @param bool $forwardHostHeaderToOrigin Forward the Host header to origin? * @param string $clientEmail * @param string $privateKey * @param string $accountName @@ -164,6 +159,11 @@ public function createRaw( * @param string $clientSecret akeneo API client secret * @param string $password akeneo API password * @param string $username akeneo API username + * @param string $baseURLForCanonicalHeader URL used in the Canonical header (if enabled) + * @param bool $includeCanonicalHeader whether to send a Canonical header + * @param string $prefix + * @param bool $s3ForcePathStyle Use path-style S3 URLs? + * @param bool $forwardHostHeaderToOrigin Forward the Host header to origin? * * @throws APIException */ @@ -174,13 +174,8 @@ public function update( $name, $secretKey, $type, - $baseURLForCanonicalHeader = omit, - $includeCanonicalHeader = omit, - $prefix = omit, $endpoint, - $s3ForcePathStyle = omit, $baseURL, - $forwardHostHeaderToOrigin = omit, $clientEmail, $privateKey, $accountName, @@ -190,6 +185,11 @@ public function update( $clientSecret, $password, $username, + $baseURLForCanonicalHeader = omit, + $includeCanonicalHeader = omit, + $prefix = omit, + $s3ForcePathStyle = omit, + $forwardHostHeaderToOrigin = omit, ?RequestOptions $requestOptions = null, ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { $params = [ @@ -258,22 +258,6 @@ public function updateRaw( */ public function list(?RequestOptions $requestOptions = null): array { - $params = []; - - return $this->listRaw($params, $requestOptions); - } - - /** - * @api - * - * @return list - * - * @throws APIException - */ - public function listRaw( - mixed $params, - ?RequestOptions $requestOptions = null - ): array { // @phpstan-ignore-next-line; return $this->client->request( method: 'get', @@ -294,21 +278,6 @@ public function listRaw( public function delete( string $id, ?RequestOptions $requestOptions = null - ): mixed { - $params = []; - - return $this->deleteRaw($id, $params, $requestOptions); - } - - /** - * @api - * - * @throws APIException - */ - public function deleteRaw( - string $id, - mixed $params, - ?RequestOptions $requestOptions = null ): mixed { // @phpstan-ignore-next-line; return $this->client->request( @@ -330,21 +299,6 @@ public function deleteRaw( public function get( string $id, ?RequestOptions $requestOptions = null - ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { - $params = []; - - return $this->getRaw($id, $params, $requestOptions); - } - - /** - * @api - * - * @throws APIException - */ - public function getRaw( - string $id, - mixed $params, - ?RequestOptions $requestOptions = null ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { // @phpstan-ignore-next-line; return $this->client->request( diff --git a/src/Services/Accounts/URLEndpointsService.php b/src/Services/Accounts/URLEndpointsService.php index c2ab79e8..c6ca3436 100644 --- a/src/Services/Accounts/URLEndpointsService.php +++ b/src/Services/Accounts/URLEndpointsService.php @@ -13,7 +13,6 @@ use ImageKit\Client; use ImageKit\Core\Conversion\ListOf; use ImageKit\Core\Exceptions\APIException; -use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\RequestOptions; use ImageKit\ServiceContracts\Accounts\URLEndpointsContract; @@ -37,8 +36,6 @@ public function __construct(private Client $client) {} * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) * @param Cloudinary|Imgix|Akamai $urlRewriter configuration for third-party URL rewriting * - * @return URLEndpointResponse - * * @throws APIException */ public function create( @@ -63,8 +60,6 @@ public function create( * * @param array $params * - * @return URLEndpointResponse - * * @throws APIException */ public function createRaw( @@ -97,8 +92,6 @@ public function createRaw( * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) * @param ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Cloudinary|ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Imgix|ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Akamai $urlRewriter configuration for third-party URL rewriting * - * @return URLEndpointResponse - * * @throws APIException */ public function update( @@ -124,8 +117,6 @@ public function update( * * @param array $params * - * @return URLEndpointResponse - * * @throws APIException */ public function updateRaw( @@ -160,22 +151,6 @@ public function updateRaw( */ public function list(?RequestOptions $requestOptions = null): array { - $params = []; - - return $this->listRaw($params, $requestOptions); - } - - /** - * @api - * - * @return list - * - * @throws APIException - */ - public function listRaw( - mixed $params, - ?RequestOptions $requestOptions = null - ): array { // @phpstan-ignore-next-line; return $this->client->request( method: 'get', @@ -196,21 +171,6 @@ public function listRaw( public function delete( string $id, ?RequestOptions $requestOptions = null - ): mixed { - $params = []; - - return $this->deleteRaw($id, $params, $requestOptions); - } - - /** - * @api - * - * @throws APIException - */ - public function deleteRaw( - string $id, - mixed $params, - ?RequestOptions $requestOptions = null ): mixed { // @phpstan-ignore-next-line; return $this->client->request( @@ -227,30 +187,11 @@ public function deleteRaw( * **Note:** This API is currently in beta. * Retrieves the URL‑endpoint identified by `id`. * - * @return URLEndpointResponse - * * @throws APIException */ public function get( string $id, ?RequestOptions $requestOptions = null - ): URLEndpointResponse { - $params = []; - - return $this->getRaw($id, $params, $requestOptions); - } - - /** - * @api - * - * @return URLEndpointResponse - * - * @throws APIException - */ - public function getRaw( - string $id, - mixed $params, - ?RequestOptions $requestOptions = null ): URLEndpointResponse { // @phpstan-ignore-next-line; return $this->client->request( diff --git a/src/Services/Accounts/UsageService.php b/src/Services/Accounts/UsageService.php index ffa44f7f..370c5fe6 100644 --- a/src/Services/Accounts/UsageService.php +++ b/src/Services/Accounts/UsageService.php @@ -8,7 +8,6 @@ use ImageKit\Accounts\Usage\UsageGetResponse; use ImageKit\Client; use ImageKit\Core\Exceptions\APIException; -use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\RequestOptions; use ImageKit\ServiceContracts\Accounts\UsageContract; @@ -27,8 +26,6 @@ public function __construct(private Client $client) {} * @param \DateTimeInterface $endDate Specify a `endDate` in `YYYY-MM-DD` format. It should be after the `startDate`. The difference between `startDate` and `endDate` should be less than 90 days. * @param \DateTimeInterface $startDate Specify a `startDate` in `YYYY-MM-DD` format. It should be before the `endDate`. The difference between `startDate` and `endDate` should be less than 90 days. * - * @return UsageGetResponse - * * @throws APIException */ public function get( @@ -46,8 +43,6 @@ public function get( * * @param array $params * - * @return UsageGetResponse - * * @throws APIException */ public function getRaw( diff --git a/src/Services/Beta/V2/FilesService.php b/src/Services/Beta/V2/FilesService.php index 118d9abd..72f7d7cf 100644 --- a/src/Services/Beta/V2/FilesService.php +++ b/src/Services/Beta/V2/FilesService.php @@ -10,7 +10,6 @@ use ImageKit\Beta\V2\Files\FileUploadResponse; use ImageKit\Client; use ImageKit\Core\Exceptions\APIException; -use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\ExtensionItem\AIAutoDescription; use ImageKit\ExtensionItem\AutoTaggingExtension; use ImageKit\ExtensionItem\RemoveBg; @@ -97,8 +96,6 @@ public function __construct(private Client $client) {} * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. * - * @return FileUploadResponse - * * @throws APIException */ public function upload( @@ -155,8 +152,6 @@ public function upload( * * @param array $params * - * @return FileUploadResponse - * * @throws APIException */ public function uploadRaw( diff --git a/src/Services/Cache/InvalidationService.php b/src/Services/Cache/InvalidationService.php index 201b1066..edd0a658 100644 --- a/src/Services/Cache/InvalidationService.php +++ b/src/Services/Cache/InvalidationService.php @@ -9,7 +9,6 @@ use ImageKit\Cache\Invalidation\InvalidationNewResponse; use ImageKit\Client; use ImageKit\Core\Exceptions\APIException; -use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\RequestOptions; use ImageKit\ServiceContracts\Cache\InvalidationContract; @@ -27,8 +26,6 @@ public function __construct(private Client $client) {} * * @param string $url the full URL of the file to be purged * - * @return InvalidationNewResponse - * * @throws APIException */ public function create( @@ -45,8 +42,6 @@ public function create( * * @param array $params * - * @return InvalidationNewResponse - * * @throws APIException */ public function createRaw( @@ -73,30 +68,11 @@ public function createRaw( * * This API returns the status of a purge cache request. * - * @return InvalidationGetResponse - * * @throws APIException */ public function get( string $requestID, ?RequestOptions $requestOptions = null - ): InvalidationGetResponse { - $params = []; - - return $this->getRaw($requestID, $params, $requestOptions); - } - - /** - * @api - * - * @return InvalidationGetResponse - * - * @throws APIException - */ - public function getRaw( - string $requestID, - mixed $params, - ?RequestOptions $requestOptions = null ): InvalidationGetResponse { // @phpstan-ignore-next-line; return $this->client->request( diff --git a/src/Services/CustomMetadataFieldsService.php b/src/Services/CustomMetadataFieldsService.php index 55fcfd7a..1ec62e3e 100644 --- a/src/Services/CustomMetadataFieldsService.php +++ b/src/Services/CustomMetadataFieldsService.php @@ -7,7 +7,6 @@ use ImageKit\Client; use ImageKit\Core\Conversion\ListOf; use ImageKit\Core\Exceptions\APIException; -use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\CustomMetadataFields\CustomMetadataField; use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams; use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; @@ -35,8 +34,6 @@ public function __construct(private Client $client) {} * @param string $name API name of the custom metadata field. This should be unique across all (including deleted) custom metadata fields. * @param Schema $schema * - * @return CustomMetadataField - * * @throws APIException */ public function create( @@ -55,8 +52,6 @@ public function create( * * @param array $params * - * @return CustomMetadataField - * * @throws APIException */ public function createRaw( @@ -86,8 +81,6 @@ public function createRaw( * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. This parameter is required if `schema` is not provided. * @param ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. * - * @return CustomMetadataField - * * @throws APIException */ public function update( @@ -106,8 +99,6 @@ public function update( * * @param array $params * - * @return CustomMetadataField - * * @throws APIException */ public function updateRaw( @@ -189,30 +180,11 @@ public function listRaw( * * This API deletes a custom metadata field. Even after deleting a custom metadata field, you cannot create any new custom metadata field with the same name. * - * @return CustomMetadataFieldDeleteResponse - * * @throws APIException */ public function delete( string $id, ?RequestOptions $requestOptions = null - ): CustomMetadataFieldDeleteResponse { - $params = []; - - return $this->deleteRaw($id, $params, $requestOptions); - } - - /** - * @api - * - * @return CustomMetadataFieldDeleteResponse - * - * @throws APIException - */ - public function deleteRaw( - string $id, - mixed $params, - ?RequestOptions $requestOptions = null ): CustomMetadataFieldDeleteResponse { // @phpstan-ignore-next-line; return $this->client->request( diff --git a/src/Services/Files/BulkService.php b/src/Services/Files/BulkService.php index 875acc36..f51428a3 100644 --- a/src/Services/Files/BulkService.php +++ b/src/Services/Files/BulkService.php @@ -6,7 +6,6 @@ use ImageKit\Client; use ImageKit\Core\Exceptions\APIException; -use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\Files\Bulk\BulkAddTagsParams; use ImageKit\Files\Bulk\BulkAddTagsResponse; use ImageKit\Files\Bulk\BulkDeleteParams; @@ -36,8 +35,6 @@ public function __construct(private Client $client) {} * * @param list $fileIDs an array of fileIds which you want to delete * - * @return BulkDeleteResponse - * * @throws APIException */ public function delete( @@ -54,8 +51,6 @@ public function delete( * * @param array $params * - * @return BulkDeleteResponse - * * @throws APIException */ public function deleteRaw( @@ -85,8 +80,6 @@ public function deleteRaw( * @param list $fileIDs an array of fileIds to which you want to add tags * @param list $tags an array of tags that you want to add to the files * - * @return BulkAddTagsResponse - * * @throws APIException */ public function addTags( @@ -104,8 +97,6 @@ public function addTags( * * @param array $params * - * @return BulkAddTagsResponse - * * @throws APIException */ public function addTagsRaw( @@ -135,8 +126,6 @@ public function addTagsRaw( * @param list $aiTags an array of AITags that you want to remove from the files * @param list $fileIDs an array of fileIds from which you want to remove AITags * - * @return BulkRemoveAITagsResponse - * * @throws APIException */ public function removeAITags( @@ -154,8 +143,6 @@ public function removeAITags( * * @param array $params * - * @return BulkRemoveAITagsResponse - * * @throws APIException */ public function removeAITagsRaw( @@ -185,8 +172,6 @@ public function removeAITagsRaw( * @param list $fileIDs an array of fileIds from which you want to remove tags * @param list $tags an array of tags that you want to remove from the files * - * @return BulkRemoveTagsResponse - * * @throws APIException */ public function removeTags( @@ -204,8 +189,6 @@ public function removeTags( * * @param array $params * - * @return BulkRemoveTagsResponse - * * @throws APIException */ public function removeTagsRaw( diff --git a/src/Services/Files/MetadataService.php b/src/Services/Files/MetadataService.php index 89fe3392..77814432 100644 --- a/src/Services/Files/MetadataService.php +++ b/src/Services/Files/MetadataService.php @@ -30,21 +30,6 @@ public function __construct(private Client $client) {} public function get( string $fileID, ?RequestOptions $requestOptions = null - ): Metadata { - $params = []; - - return $this->getRaw($fileID, $params, $requestOptions); - } - - /** - * @api - * - * @throws APIException - */ - public function getRaw( - string $fileID, - mixed $params, - ?RequestOptions $requestOptions = null ): Metadata { // @phpstan-ignore-next-line; return $this->client->request( diff --git a/src/Services/Files/VersionsService.php b/src/Services/Files/VersionsService.php index 93fe964f..526203fa 100644 --- a/src/Services/Files/VersionsService.php +++ b/src/Services/Files/VersionsService.php @@ -7,7 +7,6 @@ use ImageKit\Client; use ImageKit\Core\Conversion\ListOf; use ImageKit\Core\Exceptions\APIException; -use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\Files\File; use ImageKit\Files\Versions\VersionDeleteParams; use ImageKit\Files\Versions\VersionDeleteResponse; @@ -35,23 +34,6 @@ public function __construct(private Client $client) {} public function list( string $fileID, ?RequestOptions $requestOptions = null - ): array { - $params = []; - - return $this->listRaw($fileID, $params, $requestOptions); - } - - /** - * @api - * - * @return list - * - * @throws APIException - */ - public function listRaw( - string $fileID, - mixed $params, - ?RequestOptions $requestOptions = null ): array { // @phpstan-ignore-next-line; return $this->client->request( @@ -71,8 +53,6 @@ public function listRaw( * * @param string $fileID * - * @return VersionDeleteResponse - * * @throws APIException */ public function delete( @@ -90,8 +70,6 @@ public function delete( * * @param array $params * - * @return VersionDeleteResponse - * * @throws APIException */ public function deleteRaw( @@ -122,8 +100,6 @@ public function deleteRaw( * * @param string $fileID * - * @return File - * * @throws APIException */ public function get( @@ -141,8 +117,6 @@ public function get( * * @param array $params * - * @return File - * * @throws APIException */ public function getRaw( @@ -173,8 +147,6 @@ public function getRaw( * * @param string $fileID * - * @return File - * * @throws APIException */ public function restore( @@ -192,8 +164,6 @@ public function restore( * * @param array $params * - * @return File - * * @throws APIException */ public function restoreRaw( diff --git a/src/Services/FilesService.php b/src/Services/FilesService.php index 6d9a729e..9286e32d 100644 --- a/src/Services/FilesService.php +++ b/src/Services/FilesService.php @@ -6,7 +6,6 @@ use ImageKit\Client; use ImageKit\Core\Exceptions\APIException; -use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\ExtensionItem\AIAutoDescription; use ImageKit\ExtensionItem\AutoTaggingExtension; use ImageKit\ExtensionItem\RemoveBg; @@ -78,8 +77,6 @@ public function __construct(private Client $client) * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. * @param Publish $publish configure the publication status of a file and its versions * - * @return FileUpdateResponse - * * @throws APIException */ public function update( @@ -113,8 +110,6 @@ public function update( * * @param array $params * - * @return FileUpdateResponse - * * @throws APIException */ public function updateRaw( @@ -149,21 +144,6 @@ public function updateRaw( public function delete( string $fileID, ?RequestOptions $requestOptions = null - ): mixed { - $params = []; - - return $this->deleteRaw($fileID, $params, $requestOptions); - } - - /** - * @api - * - * @throws APIException - */ - public function deleteRaw( - string $fileID, - mixed $params, - ?RequestOptions $requestOptions = null ): mixed { // @phpstan-ignore-next-line; return $this->client->request( @@ -185,8 +165,6 @@ public function deleteRaw( * @param string $sourceFilePath the full path of the file you want to copy * @param bool $includeFileVersions Option to copy all versions of a file. By default, only the current version of the file is copied. When set to true, all versions of the file will be copied. Default value - `false`. * - * @return FileCopyResponse - * * @throws APIException */ public function copy( @@ -209,8 +187,6 @@ public function copy( * * @param array $params * - * @return FileCopyResponse - * * @throws APIException */ public function copyRaw( @@ -237,30 +213,11 @@ public function copyRaw( * * This API returns an object with details or attributes about the current version of the file. * - * @return File - * * @throws APIException */ public function get( string $fileID, ?RequestOptions $requestOptions = null - ): File { - $params = []; - - return $this->getRaw($fileID, $params, $requestOptions); - } - - /** - * @api - * - * @return File - * - * @throws APIException - */ - public function getRaw( - string $fileID, - mixed $params, - ?RequestOptions $requestOptions = null ): File { // @phpstan-ignore-next-line; return $this->client->request( @@ -281,8 +238,6 @@ public function getRaw( * @param string $destinationPath full path to the folder you want to move the above file into * @param string $sourceFilePath the full path of the file you want to move * - * @return FileMoveResponse - * * @throws APIException */ public function move( @@ -302,8 +257,6 @@ public function move( * * @param array $params * - * @return FileMoveResponse - * * @throws APIException */ public function moveRaw( @@ -345,8 +298,6 @@ public function moveRaw( * * Note: If the old file were accessible at `https://ik.imagekit.io/demo/old-filename.jpg`, a purge cache request would be issued against `https://ik.imagekit.io/demo/old-filename.jpg*` (with a wildcard at the end). It will remove the file and its versions' URLs and any transformations made using query parameters on this file or its versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. * - * @return FileRenameResponse - * * @throws APIException */ public function rename( @@ -369,8 +320,6 @@ public function rename( * * @param array $params * - * @return FileRenameResponse - * * @throws APIException */ public function renameRaw( @@ -483,8 +432,6 @@ public function renameRaw( * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. * - * @return FileUploadResponse - * * @throws APIException */ public function upload( @@ -547,8 +494,6 @@ public function upload( * * @param array $params * - * @return FileUploadResponse - * * @throws APIException */ public function uploadRaw( diff --git a/src/Services/Folders/JobService.php b/src/Services/Folders/JobService.php index d62b1c6f..48f3d7bd 100644 --- a/src/Services/Folders/JobService.php +++ b/src/Services/Folders/JobService.php @@ -6,7 +6,6 @@ use ImageKit\Client; use ImageKit\Core\Exceptions\APIException; -use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\Folders\Job\JobGetResponse; use ImageKit\RequestOptions; use ImageKit\ServiceContracts\Folders\JobContract; @@ -23,30 +22,11 @@ public function __construct(private Client $client) {} * * This API returns the status of a bulk job like copy and move folder operations. * - * @return JobGetResponse - * * @throws APIException */ public function get( string $jobID, ?RequestOptions $requestOptions = null - ): JobGetResponse { - $params = []; - - return $this->getRaw($jobID, $params, $requestOptions); - } - - /** - * @api - * - * @return JobGetResponse - * - * @throws APIException - */ - public function getRaw( - string $jobID, - mixed $params, - ?RequestOptions $requestOptions = null ): JobGetResponse { // @phpstan-ignore-next-line; return $this->client->request( diff --git a/src/Services/FoldersService.php b/src/Services/FoldersService.php index cbb81c96..66b99f37 100644 --- a/src/Services/FoldersService.php +++ b/src/Services/FoldersService.php @@ -6,7 +6,6 @@ use ImageKit\Client; use ImageKit\Core\Exceptions\APIException; -use ImageKit\Core\Implementation\HasRawResponse; use ImageKit\Folders\FolderCopyParams; use ImageKit\Folders\FolderCopyResponse; use ImageKit\Folders\FolderCreateParams; @@ -50,8 +49,6 @@ public function __construct(private Client $client) * * Note: If any folder(s) is not present in the parentFolderPath parameter, it will be automatically created. For example, if you pass `/product/images/summer`, then `product`, `images`, and `summer` folders will be created if they don't already exist. * - * @return FolderNewResponse - * * @throws APIException */ public function create( @@ -71,8 +68,6 @@ public function create( * * @param array $params * - * @return FolderNewResponse - * * @throws APIException */ public function createRaw( @@ -101,8 +96,6 @@ public function createRaw( * * @param string $folderPath Full path to the folder you want to delete. For example `/folder/to/delete/`. * - * @return FolderDeleteResponse - * * @throws APIException */ public function delete( @@ -119,8 +112,6 @@ public function delete( * * @param array $params * - * @return FolderDeleteResponse - * * @throws APIException */ public function deleteRaw( @@ -151,8 +142,6 @@ public function deleteRaw( * @param string $sourceFolderPath the full path to the source folder you want to copy * @param bool $includeVersions Option to copy all versions of files that are nested inside the selected folder. By default, only the current version of each file will be copied. When set to true, all versions of each file will be copied. Default value - `false`. * - * @return FolderCopyResponse - * * @throws APIException */ public function copy( @@ -175,8 +164,6 @@ public function copy( * * @param array $params * - * @return FolderCopyResponse - * * @throws APIException */ public function copyRaw( @@ -206,8 +193,6 @@ public function copyRaw( * @param string $destinationPath full path to the destination folder where you want to move the source folder into * @param string $sourceFolderPath the full path to the source folder you want to move * - * @return FolderMoveResponse - * * @throws APIException */ public function move( @@ -228,8 +213,6 @@ public function move( * * @param array $params * - * @return FolderMoveResponse - * * @throws APIException */ public function moveRaw( @@ -268,8 +251,6 @@ public function moveRaw( * * Default value - `false` * - * @return FolderRenameResponse - * * @throws APIException */ public function rename( @@ -292,8 +273,6 @@ public function rename( * * @param array $params * - * @return FolderRenameResponse - * * @throws APIException */ public function renameRaw( diff --git a/src/SolidColorOverlayTransformation/Gradient.php b/src/SolidColorOverlayTransformation/Gradient.php index 04bc6598..fb769e5a 100644 --- a/src/SolidColorOverlayTransformation/Gradient.php +++ b/src/SolidColorOverlayTransformation/Gradient.php @@ -7,7 +7,6 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Core\Conversion\EnumOf; /** * Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. @@ -23,6 +22,6 @@ final class Gradient implements ConverterSource */ public static function variants(): array { - return [new EnumOf([true]), 'string']; + return ['bool', 'string']; } } diff --git a/src/SolidColorOverlayTransformation/Radius.php b/src/SolidColorOverlayTransformation/Radius.php index eeaf5961..1f1b4686 100644 --- a/src/SolidColorOverlayTransformation/Radius.php +++ b/src/SolidColorOverlayTransformation/Radius.php @@ -7,7 +7,6 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Core\Conversion\EnumOf; /** * Specifies the corner radius of the solid color overlay. Set to `max` for circular or oval shape. @@ -23,6 +22,6 @@ final class Radius implements ConverterSource */ public static function variants(): array { - return ['float', new EnumOf(['max'])]; + return ['float', 'string']; } } diff --git a/src/SrcOptions.php b/src/SrcOptions.php index 317d3e76..3f953c76 100644 --- a/src/SrcOptions.php +++ b/src/SrcOptions.php @@ -136,7 +136,7 @@ public static function with( null !== $queryParameters && $obj->queryParameters = $queryParameters; null !== $signed && $obj->signed = $signed; null !== $transformation && $obj->transformation = $transformation; - null !== $transformationPosition && $obj->transformationPosition = $transformationPosition instanceof TransformationPosition ? $transformationPosition->value : $transformationPosition; + null !== $transformationPosition && $obj['transformationPosition'] = $transformationPosition; return $obj; } @@ -236,7 +236,7 @@ public function withTransformationPosition( TransformationPosition|string $transformationPosition ): self { $obj = clone $this; - $obj->transformationPosition = $transformationPosition instanceof TransformationPosition ? $transformationPosition->value : $transformationPosition; + $obj['transformationPosition'] = $transformationPosition; return $obj; } diff --git a/src/StreamingResolution.php b/src/StreamingResolution.php index bf501235..350f8215 100644 --- a/src/StreamingResolution.php +++ b/src/StreamingResolution.php @@ -9,17 +9,17 @@ */ enum StreamingResolution: string { - case STREAMING_RESOLUTION_240 = '240'; + case _240 = '240'; - case STREAMING_RESOLUTION_360 = '360'; + case _360 = '360'; - case STREAMING_RESOLUTION_480 = '480'; + case _480 = '480'; - case STREAMING_RESOLUTION_720 = '720'; + case _720 = '720'; - case STREAMING_RESOLUTION_1080 = '1080'; + case _1080 = '1080'; - case STREAMING_RESOLUTION_1440 = '1440'; + case _1440 = '1440'; - case STREAMING_RESOLUTION_2160 = '2160'; + case _2160 = '2160'; } diff --git a/src/SubtitleOverlay.php b/src/SubtitleOverlay.php index 95623fb8..960feb58 100644 --- a/src/SubtitleOverlay.php +++ b/src/SubtitleOverlay.php @@ -98,7 +98,7 @@ public static function with( null !== $position && $obj->position = $position; null !== $timing && $obj->timing = $timing; - null !== $encoding && $obj->encoding = $encoding instanceof Encoding ? $encoding->value : $encoding; + null !== $encoding && $obj['encoding'] = $encoding; null !== $transformation && $obj->transformation = $transformation; return $obj; @@ -142,7 +142,7 @@ public function withInput(string $input): self public function withEncoding(Encoding|string $encoding): self { $obj = clone $this; - $obj->encoding = $encoding instanceof Encoding ? $encoding->value : $encoding; + $obj['encoding'] = $encoding; return $obj; } diff --git a/src/SubtitleOverlayTransformation.php b/src/SubtitleOverlayTransformation.php index 69ca7e07..2e7529d5 100644 --- a/src/SubtitleOverlayTransformation.php +++ b/src/SubtitleOverlayTransformation.php @@ -116,7 +116,7 @@ public static function with( null !== $fontOutline && $obj->fontOutline = $fontOutline; null !== $fontShadow && $obj->fontShadow = $fontShadow; null !== $fontSize && $obj->fontSize = $fontSize; - null !== $typography && $obj->typography = $typography instanceof Typography ? $typography->value : $typography; + null !== $typography && $obj['typography'] = $typography; return $obj; } @@ -211,7 +211,7 @@ public function withFontSize(float $fontSize): self public function withTypography(Typography|string $typography): self { $obj = clone $this; - $obj->typography = $typography instanceof Typography ? $typography->value : $typography; + $obj['typography'] = $typography; return $obj; } diff --git a/src/TextOverlay.php b/src/TextOverlay.php index 85e12507..c1f7ad54 100644 --- a/src/TextOverlay.php +++ b/src/TextOverlay.php @@ -98,7 +98,7 @@ public static function with( null !== $position && $obj->position = $position; null !== $timing && $obj->timing = $timing; - null !== $encoding && $obj->encoding = $encoding instanceof Encoding ? $encoding->value : $encoding; + null !== $encoding && $obj['encoding'] = $encoding; null !== $transformation && $obj->transformation = $transformation; return $obj; @@ -142,7 +142,7 @@ public function withText(string $text): self public function withEncoding(Encoding|string $encoding): self { $obj = clone $this; - $obj->encoding = $encoding instanceof Encoding ? $encoding->value : $encoding; + $obj['encoding'] = $encoding; return $obj; } diff --git a/src/TextOverlayTransformation.php b/src/TextOverlayTransformation.php index 6852822a..6c68ca89 100644 --- a/src/TextOverlayTransformation.php +++ b/src/TextOverlayTransformation.php @@ -157,11 +157,11 @@ public static function with( null !== $alpha && $obj->alpha = $alpha; null !== $background && $obj->background = $background; - null !== $flip && $obj->flip = $flip instanceof Flip ? $flip->value : $flip; + null !== $flip && $obj['flip'] = $flip; null !== $fontColor && $obj->fontColor = $fontColor; null !== $fontFamily && $obj->fontFamily = $fontFamily; null !== $fontSize && $obj->fontSize = $fontSize; - null !== $innerAlignment && $obj->innerAlignment = $innerAlignment instanceof InnerAlignment ? $innerAlignment->value : $innerAlignment; + null !== $innerAlignment && $obj['innerAlignment'] = $innerAlignment; null !== $lineHeight && $obj->lineHeight = $lineHeight; null !== $padding && $obj->padding = $padding; null !== $radius && $obj->radius = $radius; @@ -203,7 +203,7 @@ public function withBackground(string $background): self public function withFlip(Flip|string $flip): self { $obj = clone $this; - $obj->flip = $flip instanceof Flip ? $flip->value : $flip; + $obj['flip'] = $flip; return $obj; } @@ -251,7 +251,7 @@ public function withInnerAlignment( InnerAlignment|string $innerAlignment ): self { $obj = clone $this; - $obj->innerAlignment = $innerAlignment instanceof InnerAlignment ? $innerAlignment->value : $innerAlignment; + $obj['innerAlignment'] = $innerAlignment; return $obj; } diff --git a/src/TextOverlayTransformation/Radius.php b/src/TextOverlayTransformation/Radius.php index 798d59cd..2630b578 100644 --- a/src/TextOverlayTransformation/Radius.php +++ b/src/TextOverlayTransformation/Radius.php @@ -7,7 +7,6 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Core\Conversion\EnumOf; /** * Specifies the corner radius of the text overlay. @@ -23,6 +22,6 @@ final class Radius implements ConverterSource */ public static function variants(): array { - return ['float', new EnumOf(['max'])]; + return ['float', 'string']; } } diff --git a/src/Transformation.php b/src/Transformation.php index fd3973d1..68b3bceb 100644 --- a/src/Transformation.php +++ b/src/Transformation.php @@ -341,7 +341,7 @@ final class Transformation implements BaseModel * See [Overlay using layers](https://imagekit.io/docs/transformations#overlay-using-layers). */ #[Api(union: Overlay::class, optional: true)] - public TextOverlay|ImageOverlay|VideoOverlay|SubtitleOverlay|SolidColorOverlay|null $overlay; + public ?Overlay $overlay; /** * Extracts a specific page or frame from multi-page or layered files (PDF, PSD, AI). @@ -540,7 +540,7 @@ public static function with( ?string $named = null, ?float $opacity = null, ?bool $original = null, - TextOverlay|ImageOverlay|VideoOverlay|SubtitleOverlay|SolidColorOverlay|null $overlay = null, + ?Overlay $overlay = null, float|string|null $page = null, ?bool $progressive = null, ?float $quality = null, @@ -572,21 +572,21 @@ public static function with( null !== $aiUpscale && $obj->aiUpscale = $aiUpscale; null !== $aiVariation && $obj->aiVariation = $aiVariation; null !== $aspectRatio && $obj->aspectRatio = $aspectRatio; - null !== $audioCodec && $obj->audioCodec = $audioCodec instanceof AudioCodec ? $audioCodec->value : $audioCodec; + null !== $audioCodec && $obj['audioCodec'] = $audioCodec; null !== $background && $obj->background = $background; null !== $blur && $obj->blur = $blur; null !== $border && $obj->border = $border; null !== $colorProfile && $obj->colorProfile = $colorProfile; null !== $contrastStretch && $obj->contrastStretch = $contrastStretch; - null !== $crop && $obj->crop = $crop instanceof Crop ? $crop->value : $crop; - null !== $cropMode && $obj->cropMode = $cropMode instanceof CropMode ? $cropMode->value : $cropMode; + null !== $crop && $obj['crop'] = $crop; + null !== $cropMode && $obj['cropMode'] = $cropMode; null !== $defaultImage && $obj->defaultImage = $defaultImage; null !== $dpr && $obj->dpr = $dpr; null !== $duration && $obj->duration = $duration; null !== $endOffset && $obj->endOffset = $endOffset; - null !== $flip && $obj->flip = $flip instanceof Flip ? $flip->value : $flip; + null !== $flip && $obj['flip'] = $flip; null !== $focus && $obj->focus = $focus; - null !== $format && $obj->format = $format instanceof Format ? $format->value : $format; + null !== $format && $obj['format'] = $format; null !== $gradient && $obj->gradient = $gradient; null !== $grayscale && $obj->grayscale = $grayscale; null !== $height && $obj->height = $height; @@ -605,10 +605,10 @@ public static function with( null !== $shadow && $obj->shadow = $shadow; null !== $sharpen && $obj->sharpen = $sharpen; null !== $startOffset && $obj->startOffset = $startOffset; - null !== $streamingResolutions && $obj->streamingResolutions = array_map(fn ($v) => $v instanceof StreamingResolution ? $v->value : $v, $streamingResolutions); + null !== $streamingResolutions && $obj['streamingResolutions'] = $streamingResolutions; null !== $trim && $obj->trim = $trim; null !== $unsharpMask && $obj->unsharpMask = $unsharpMask; - null !== $videoCodec && $obj->videoCodec = $videoCodec instanceof VideoCodec ? $videoCodec->value : $videoCodec; + null !== $videoCodec && $obj['videoCodec'] = $videoCodec; null !== $width && $obj->width = $width; null !== $x && $obj->x = $x; null !== $xCenter && $obj->xCenter = $xCenter; @@ -748,7 +748,7 @@ public function withAspectRatio(float|string $aspectRatio): self public function withAudioCodec(AudioCodec|string $audioCodec): self { $obj = clone $this; - $obj->audioCodec = $audioCodec instanceof AudioCodec ? $audioCodec->value : $audioCodec; + $obj['audioCodec'] = $audioCodec; return $obj; } @@ -825,7 +825,7 @@ public function withContrastStretch(bool $contrastStretch): self public function withCrop(Crop|string $crop): self { $obj = clone $this; - $obj->crop = $crop instanceof Crop ? $crop->value : $crop; + $obj['crop'] = $crop; return $obj; } @@ -838,7 +838,7 @@ public function withCrop(Crop|string $crop): self public function withCropMode(CropMode|string $cropMode): self { $obj = clone $this; - $obj->cropMode = $cropMode instanceof CropMode ? $cropMode->value : $cropMode; + $obj['cropMode'] = $cropMode; return $obj; } @@ -903,7 +903,7 @@ public function withEndOffset(float|string $endOffset): self public function withFlip(Flip|string $flip): self { $obj = clone $this; - $obj->flip = $flip instanceof Flip ? $flip->value : $flip; + $obj['flip'] = $flip; return $obj; } @@ -935,7 +935,7 @@ public function withFocus(string $focus): self public function withFormat(Format|string $format): self { $obj = clone $this; - $obj->format = $format instanceof Format ? $format->value : $format; + $obj['format'] = $format; return $obj; } @@ -1040,9 +1040,8 @@ public function withOriginal(bool $original): self * ImageKit supports overlays including images, text, videos, subtitles, and solid colors. * See [Overlay using layers](https://imagekit.io/docs/transformations#overlay-using-layers). */ - public function withOverlay( - TextOverlay|ImageOverlay|VideoOverlay|SubtitleOverlay|SolidColorOverlay $overlay, - ): self { + public function withOverlay(Overlay $overlay): self + { $obj = clone $this; $obj->overlay = $overlay; @@ -1176,7 +1175,7 @@ public function withStartOffset(float|string $startOffset): self public function withStreamingResolutions(array $streamingResolutions): self { $obj = clone $this; - $obj->streamingResolutions = array_map(fn ($v) => $v instanceof StreamingResolution ? $v->value : $v, $streamingResolutions); + $obj['streamingResolutions'] = $streamingResolutions; return $obj; } @@ -1215,7 +1214,7 @@ public function withUnsharpMask(bool|string $unsharpMask): self public function withVideoCodec(VideoCodec|string $videoCodec): self { $obj = clone $this; - $obj->videoCodec = $videoCodec instanceof VideoCodec ? $videoCodec->value : $videoCodec; + $obj['videoCodec'] = $videoCodec; return $obj; } diff --git a/src/Transformation/AIDropShadow.php b/src/Transformation/AIDropShadow.php index cc58b5d5..f241d19a 100644 --- a/src/Transformation/AIDropShadow.php +++ b/src/Transformation/AIDropShadow.php @@ -7,7 +7,6 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Core\Conversion\EnumOf; /** * Adds an AI-based drop shadow around a foreground object on a transparent or removed background. @@ -26,6 +25,6 @@ final class AIDropShadow implements ConverterSource */ public static function variants(): array { - return [new EnumOf([true]), 'string']; + return ['bool', 'string']; } } diff --git a/src/Transformation/Gradient.php b/src/Transformation/Gradient.php index 62d7045a..32429f2a 100644 --- a/src/Transformation/Gradient.php +++ b/src/Transformation/Gradient.php @@ -7,7 +7,6 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Core\Conversion\EnumOf; /** * Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. @@ -23,6 +22,6 @@ final class Gradient implements ConverterSource */ public static function variants(): array { - return [new EnumOf([true]), 'string']; + return ['bool', 'string']; } } diff --git a/src/Transformation/Radius.php b/src/Transformation/Radius.php index 755730dc..d9aa35e9 100644 --- a/src/Transformation/Radius.php +++ b/src/Transformation/Radius.php @@ -7,7 +7,6 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Core\Conversion\EnumOf; /** * Specifies the corner radius for rounded corners (e.g., 20) or `max` for circular or oval shape. @@ -23,6 +22,6 @@ final class Radius implements ConverterSource */ public static function variants(): array { - return ['float', new EnumOf(['max'])]; + return ['float', 'string']; } } diff --git a/src/Transformation/Shadow.php b/src/Transformation/Shadow.php index b07eae0c..8961f7dc 100644 --- a/src/Transformation/Shadow.php +++ b/src/Transformation/Shadow.php @@ -7,7 +7,6 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Core\Conversion\EnumOf; /** * Adds a shadow beneath solid objects in an image with a transparent background. @@ -25,6 +24,6 @@ final class Shadow implements ConverterSource */ public static function variants(): array { - return [new EnumOf([true]), 'string']; + return ['bool', 'string']; } } diff --git a/src/Transformation/Sharpen.php b/src/Transformation/Sharpen.php index f1f9b359..fdb9adfc 100644 --- a/src/Transformation/Sharpen.php +++ b/src/Transformation/Sharpen.php @@ -7,7 +7,6 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Core\Conversion\EnumOf; /** * Sharpens the input image, highlighting edges and finer details. @@ -24,6 +23,6 @@ final class Sharpen implements ConverterSource */ public static function variants(): array { - return [new EnumOf([true]), 'float']; + return ['bool', 'float']; } } diff --git a/src/Transformation/Trim.php b/src/Transformation/Trim.php index c0ebce32..f145c2f7 100644 --- a/src/Transformation/Trim.php +++ b/src/Transformation/Trim.php @@ -7,7 +7,6 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Core\Conversion\EnumOf; /** * Useful for images with a solid or nearly solid background and a central object. This parameter trims the background, @@ -24,6 +23,6 @@ final class Trim implements ConverterSource */ public static function variants(): array { - return [new EnumOf([true]), 'float']; + return ['bool', 'float']; } } diff --git a/src/Transformation/UnsharpMask.php b/src/Transformation/UnsharpMask.php index 687edf59..73c91d23 100644 --- a/src/Transformation/UnsharpMask.php +++ b/src/Transformation/UnsharpMask.php @@ -7,7 +7,6 @@ use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Core\Conversion\EnumOf; /** * Applies Unsharp Masking (USM), an image sharpening technique. @@ -24,6 +23,6 @@ final class UnsharpMask implements ConverterSource */ public static function variants(): array { - return [new EnumOf([true]), 'string']; + return ['bool', 'string']; } } diff --git a/src/VideoOverlay.php b/src/VideoOverlay.php index 3967ff0b..c4be1cc2 100644 --- a/src/VideoOverlay.php +++ b/src/VideoOverlay.php @@ -99,7 +99,7 @@ public static function with( null !== $position && $obj->position = $position; null !== $timing && $obj->timing = $timing; - null !== $encoding && $obj->encoding = $encoding instanceof Encoding ? $encoding->value : $encoding; + null !== $encoding && $obj['encoding'] = $encoding; null !== $transformation && $obj->transformation = $transformation; return $obj; @@ -143,7 +143,7 @@ public function withInput(string $input): self public function withEncoding(Encoding|string $encoding): self { $obj = clone $this; - $obj->encoding = $encoding instanceof Encoding ? $encoding->value : $encoding; + $obj['encoding'] = $encoding; return $obj; } diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php index 19628e2c..669bcf85 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php @@ -76,9 +76,9 @@ public static function with( ): self { $obj = new self; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; - null !== $protocol && $obj->protocol = $protocol instanceof Protocol ? $protocol->value : $protocol; + null !== $protocol && $obj['protocol'] = $protocol; null !== $value && $obj->value = $value; return $obj; @@ -92,7 +92,7 @@ public static function with( public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; return $obj; } @@ -105,7 +105,7 @@ public function withType(Type|string $type): self public function withProtocol(Protocol|string $protocol): self { $obj = clone $this; - $obj->protocol = $protocol instanceof Protocol ? $protocol->value : $protocol; + $obj['protocol'] = $protocol; return $obj; } diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php index c0d9359f..63765b7a 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php @@ -76,9 +76,9 @@ public static function with( ): self { $obj = new self; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; - null !== $protocol && $obj->protocol = $protocol instanceof Protocol ? $protocol->value : $protocol; + null !== $protocol && $obj['protocol'] = $protocol; null !== $value && $obj->value = $value; return $obj; @@ -92,7 +92,7 @@ public static function with( public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; return $obj; } @@ -105,7 +105,7 @@ public function withType(Type|string $type): self public function withProtocol(Protocol|string $protocol): self { $obj = clone $this; - $obj->protocol = $protocol instanceof Protocol ? $protocol->value : $protocol; + $obj['protocol'] = $protocol; return $obj; } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php index e6e8f269..0473011b 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php @@ -72,10 +72,10 @@ public static function with( ): self { $obj = new self; - null !== $aiAutoDescription && $obj->aiAutoDescription = $aiAutoDescription instanceof AIAutoDescription ? $aiAutoDescription->value : $aiAutoDescription; - null !== $awsAutoTagging && $obj->awsAutoTagging = $awsAutoTagging instanceof AwsAutoTagging ? $awsAutoTagging->value : $awsAutoTagging; - null !== $googleAutoTagging && $obj->googleAutoTagging = $googleAutoTagging instanceof GoogleAutoTagging ? $googleAutoTagging->value : $googleAutoTagging; - null !== $removeBg && $obj->removeBg = $removeBg instanceof RemoveBg ? $removeBg->value : $removeBg; + null !== $aiAutoDescription && $obj['aiAutoDescription'] = $aiAutoDescription; + null !== $awsAutoTagging && $obj['awsAutoTagging'] = $awsAutoTagging; + null !== $googleAutoTagging && $obj['googleAutoTagging'] = $googleAutoTagging; + null !== $removeBg && $obj['removeBg'] = $removeBg; return $obj; } @@ -87,7 +87,7 @@ public function withAIAutoDescription( AIAutoDescription|string $aiAutoDescription ): self { $obj = clone $this; - $obj->aiAutoDescription = $aiAutoDescription instanceof AIAutoDescription ? $aiAutoDescription->value : $aiAutoDescription; + $obj['aiAutoDescription'] = $aiAutoDescription; return $obj; } @@ -99,7 +99,7 @@ public function withAwsAutoTagging( AwsAutoTagging|string $awsAutoTagging ): self { $obj = clone $this; - $obj->awsAutoTagging = $awsAutoTagging instanceof AwsAutoTagging ? $awsAutoTagging->value : $awsAutoTagging; + $obj['awsAutoTagging'] = $awsAutoTagging; return $obj; } @@ -111,7 +111,7 @@ public function withGoogleAutoTagging( GoogleAutoTagging|string $googleAutoTagging ): self { $obj = clone $this; - $obj->googleAutoTagging = $googleAutoTagging instanceof GoogleAutoTagging ? $googleAutoTagging->value : $googleAutoTagging; + $obj['googleAutoTagging'] = $googleAutoTagging; return $obj; } @@ -122,7 +122,7 @@ public function withGoogleAutoTagging( public function withRemoveBg(RemoveBg|string $removeBg): self { $obj = clone $this; - $obj->removeBg = $removeBg instanceof RemoveBg ? $removeBg->value : $removeBg; + $obj['removeBg'] = $removeBg; return $obj; } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php index 93e23bec..e8dfeced 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php @@ -138,7 +138,7 @@ public static function with( ): self { $obj = new self; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; null !== $defaultValue && $obj->defaultValue = $defaultValue; null !== $isValueRequired && $obj->isValueRequired = $isValueRequired; @@ -161,7 +161,7 @@ public static function with( public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; return $obj; } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php index 80b43edd..17a511f8 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php @@ -71,7 +71,7 @@ public static function with( ): self { $obj = new self; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; null !== $options && $obj->options = $options; @@ -89,7 +89,7 @@ public static function with( public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; return $obj; } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php index 34dfdffc..8603e92e 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php @@ -109,13 +109,13 @@ public static function with( ): self { $obj = new self; - null !== $audioCodec && $obj->audioCodec = $audioCodec instanceof AudioCodec ? $audioCodec->value : $audioCodec; + null !== $audioCodec && $obj['audioCodec'] = $audioCodec; null !== $autoRotate && $obj->autoRotate = $autoRotate; - null !== $format && $obj->format = $format instanceof Format ? $format->value : $format; + null !== $format && $obj['format'] = $format; null !== $quality && $obj->quality = $quality; - null !== $streamProtocol && $obj->streamProtocol = $streamProtocol instanceof StreamProtocol ? $streamProtocol->value : $streamProtocol; + null !== $streamProtocol && $obj['streamProtocol'] = $streamProtocol; null !== $variants && $obj->variants = $variants; - null !== $videoCodec && $obj->videoCodec = $videoCodec instanceof VideoCodec ? $videoCodec->value : $videoCodec; + null !== $videoCodec && $obj['videoCodec'] = $videoCodec; return $obj; } @@ -128,7 +128,7 @@ public static function with( public function withAudioCodec(AudioCodec|string $audioCodec): self { $obj = clone $this; - $obj->audioCodec = $audioCodec instanceof AudioCodec ? $audioCodec->value : $audioCodec; + $obj['audioCodec'] = $audioCodec; return $obj; } @@ -152,7 +152,7 @@ public function withAutoRotate(bool $autoRotate): self public function withFormat(Format|string $format): self { $obj = clone $this; - $obj->format = $format instanceof Format ? $format->value : $format; + $obj['format'] = $format; return $obj; } @@ -177,7 +177,7 @@ public function withStreamProtocol( StreamProtocol|string $streamProtocol ): self { $obj = clone $this; - $obj->streamProtocol = $streamProtocol instanceof StreamProtocol ? $streamProtocol->value : $streamProtocol; + $obj['streamProtocol'] = $streamProtocol; return $obj; } @@ -203,7 +203,7 @@ public function withVariants(array $variants): self public function withVideoCodec(VideoCodec|string $videoCodec): self { $obj = clone $this; - $obj->videoCodec = $videoCodec instanceof VideoCodec ? $videoCodec->value : $videoCodec; + $obj['videoCodec'] = $videoCodec; return $obj; } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php index df13aca2..694ba72c 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php @@ -77,7 +77,7 @@ public static function with( ): self { $obj = new self; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; null !== $error && $obj->error = $error; null !== $options && $obj->options = $options; @@ -96,7 +96,7 @@ public static function with( public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; return $obj; } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php index bbb07048..c405bd5f 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php @@ -60,7 +60,7 @@ public static function with(Reason|string $reason): self { $obj = new self; - $obj->reason = $reason instanceof Reason ? $reason->value : $reason; + $obj['reason'] = $reason; return $obj; } @@ -76,7 +76,7 @@ public static function with(Reason|string $reason): self public function withReason(Reason|string $reason): self { $obj = clone $this; - $obj->reason = $reason instanceof Reason ? $reason->value : $reason; + $obj['reason'] = $reason; return $obj; } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php index e8dacd9a..15a007b7 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php @@ -109,13 +109,13 @@ public static function with( ): self { $obj = new self; - null !== $audioCodec && $obj->audioCodec = $audioCodec instanceof AudioCodec ? $audioCodec->value : $audioCodec; + null !== $audioCodec && $obj['audioCodec'] = $audioCodec; null !== $autoRotate && $obj->autoRotate = $autoRotate; - null !== $format && $obj->format = $format instanceof Format ? $format->value : $format; + null !== $format && $obj['format'] = $format; null !== $quality && $obj->quality = $quality; - null !== $streamProtocol && $obj->streamProtocol = $streamProtocol instanceof StreamProtocol ? $streamProtocol->value : $streamProtocol; + null !== $streamProtocol && $obj['streamProtocol'] = $streamProtocol; null !== $variants && $obj->variants = $variants; - null !== $videoCodec && $obj->videoCodec = $videoCodec instanceof VideoCodec ? $videoCodec->value : $videoCodec; + null !== $videoCodec && $obj['videoCodec'] = $videoCodec; return $obj; } @@ -128,7 +128,7 @@ public static function with( public function withAudioCodec(AudioCodec|string $audioCodec): self { $obj = clone $this; - $obj->audioCodec = $audioCodec instanceof AudioCodec ? $audioCodec->value : $audioCodec; + $obj['audioCodec'] = $audioCodec; return $obj; } @@ -152,7 +152,7 @@ public function withAutoRotate(bool $autoRotate): self public function withFormat(Format|string $format): self { $obj = clone $this; - $obj->format = $format instanceof Format ? $format->value : $format; + $obj['format'] = $format; return $obj; } @@ -177,7 +177,7 @@ public function withStreamProtocol( StreamProtocol|string $streamProtocol ): self { $obj = clone $this; - $obj->streamProtocol = $streamProtocol instanceof StreamProtocol ? $streamProtocol->value : $streamProtocol; + $obj['streamProtocol'] = $streamProtocol; return $obj; } @@ -203,7 +203,7 @@ public function withVariants(array $variants): self public function withVideoCodec(VideoCodec|string $videoCodec): self { $obj = clone $this; - $obj->videoCodec = $videoCodec instanceof VideoCodec ? $videoCodec->value : $videoCodec; + $obj['videoCodec'] = $videoCodec; return $obj; } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php index 9685a24e..b98b15b4 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php @@ -77,7 +77,7 @@ public static function with( ): self { $obj = new self; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; null !== $options && $obj->options = $options; null !== $output && $obj->output = $output; @@ -96,7 +96,7 @@ public static function with( public function withType(Type|string $type): self { $obj = clone $this; - $obj->type = $type instanceof Type ? $type->value : $type; + $obj['type'] = $type; return $obj; } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php index e44973ea..146dc65b 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php @@ -109,13 +109,13 @@ public static function with( ): self { $obj = new self; - null !== $audioCodec && $obj->audioCodec = $audioCodec instanceof AudioCodec ? $audioCodec->value : $audioCodec; + null !== $audioCodec && $obj['audioCodec'] = $audioCodec; null !== $autoRotate && $obj->autoRotate = $autoRotate; - null !== $format && $obj->format = $format instanceof Format ? $format->value : $format; + null !== $format && $obj['format'] = $format; null !== $quality && $obj->quality = $quality; - null !== $streamProtocol && $obj->streamProtocol = $streamProtocol instanceof StreamProtocol ? $streamProtocol->value : $streamProtocol; + null !== $streamProtocol && $obj['streamProtocol'] = $streamProtocol; null !== $variants && $obj->variants = $variants; - null !== $videoCodec && $obj->videoCodec = $videoCodec instanceof VideoCodec ? $videoCodec->value : $videoCodec; + null !== $videoCodec && $obj['videoCodec'] = $videoCodec; return $obj; } @@ -128,7 +128,7 @@ public static function with( public function withAudioCodec(AudioCodec|string $audioCodec): self { $obj = clone $this; - $obj->audioCodec = $audioCodec instanceof AudioCodec ? $audioCodec->value : $audioCodec; + $obj['audioCodec'] = $audioCodec; return $obj; } @@ -152,7 +152,7 @@ public function withAutoRotate(bool $autoRotate): self public function withFormat(Format|string $format): self { $obj = clone $this; - $obj->format = $format instanceof Format ? $format->value : $format; + $obj['format'] = $format; return $obj; } @@ -177,7 +177,7 @@ public function withStreamProtocol( StreamProtocol|string $streamProtocol ): self { $obj = clone $this; - $obj->streamProtocol = $streamProtocol instanceof StreamProtocol ? $streamProtocol->value : $streamProtocol; + $obj['streamProtocol'] = $streamProtocol; return $obj; } @@ -203,7 +203,7 @@ public function withVariants(array $variants): self public function withVideoCodec(VideoCodec|string $videoCodec): self { $obj = clone $this; - $obj->videoCodec = $videoCodec instanceof VideoCodec ? $videoCodec->value : $videoCodec; + $obj['videoCodec'] = $videoCodec; return $obj; } From 4ef2d094a2803b21ef4a09f655156279d70e88e2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 5 Oct 2025 13:50:47 +0000 Subject: [PATCH 055/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index ad4cfbf9..f035d349 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-c7ad6f552b38f2145781847f8b390fa1ec43068d64e45a33012a97a9299edc10.yml openapi_spec_hash: 50f281e91210ad5018ac7e4eee216f56 -config_hash: 6d15773e29070b9c1d4820e4897f17a5 +config_hash: 74a8263b80c732a2b016177e7d56bb9c From 2da9342a698593e82e15db1b8966b888684a862e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Oct 2025 16:30:11 +0000 Subject: [PATCH 056/193] fix(client): properly import fully qualified names --- src/Beta/V2/Files/FileUploadParams/Transformation.php | 8 ++++---- src/Files/FileUploadParams/Transformation.php | 8 ++++---- src/Files/Metadata/Exif.php | 8 ++++---- src/ServiceContracts/Accounts/URLEndpointsContract.php | 2 +- src/ServiceContracts/CustomMetadataFieldsContract.php | 2 +- src/Services/Accounts/URLEndpointsService.php | 2 +- src/Services/CustomMetadataFieldsService.php | 2 +- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation.php index a2322a27..886f856b 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation.php @@ -24,7 +24,7 @@ * You can mix and match any combination of post-processing types. * * @phpstan-type transformation_alias = array{ - * post?: list, + * post?: list<\ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Transformation|GifToVideo|Thumbnail|Abs>, * pre?: string, * } */ @@ -38,7 +38,7 @@ final class Transformation implements BaseModel * Each item must match one of the following types: * `transformation`, `gif-to-video`, `thumbnail`, `abs`. * - * @var list|null $post + * @var list|null $post */ #[Api(list: Post::class, optional: true)] public ?array $post; @@ -59,7 +59,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $post + * @param list $post */ public static function with(?array $post = null, ?string $pre = null): self { @@ -76,7 +76,7 @@ public static function with(?array $post = null, ?string $pre = null): self * Each item must match one of the following types: * `transformation`, `gif-to-video`, `thumbnail`, `abs`. * - * @param list $post + * @param list $post */ public function withPost(array $post): self { diff --git a/src/Files/FileUploadParams/Transformation.php b/src/Files/FileUploadParams/Transformation.php index e4b9fb23..7ce7da51 100644 --- a/src/Files/FileUploadParams/Transformation.php +++ b/src/Files/FileUploadParams/Transformation.php @@ -24,7 +24,7 @@ * You can mix and match any combination of post-processing types. * * @phpstan-type transformation_alias = array{ - * post?: list, + * post?: list<\ImageKit\Files\FileUploadParams\Transformation\Post\Transformation|GifToVideo|Thumbnail|Abs>, * pre?: string, * } */ @@ -38,7 +38,7 @@ final class Transformation implements BaseModel * Each item must match one of the following types: * `transformation`, `gif-to-video`, `thumbnail`, `abs`. * - * @var list|null $post + * @var list|null $post */ #[Api(list: Post::class, optional: true)] public ?array $post; @@ -59,7 +59,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $post + * @param list $post */ public static function with(?array $post = null, ?string $pre = null): self { @@ -76,7 +76,7 @@ public static function with(?array $post = null, ?string $pre = null): self * Each item must match one of the following types: * `transformation`, `gif-to-video`, `thumbnail`, `abs`. * - * @param list $post + * @param list $post */ public function withPost(array $post): self { diff --git a/src/Files/Metadata/Exif.php b/src/Files/Metadata/Exif.php index 7a300c75..be246a81 100644 --- a/src/Files/Metadata/Exif.php +++ b/src/Files/Metadata/Exif.php @@ -14,7 +14,7 @@ /** * @phpstan-type exif_alias = array{ - * exif?: ImageKit\Files\Metadata\Exif\Exif, + * exif?: \ImageKit\Files\Metadata\Exif\Exif, * gps?: Gps, * image?: Image, * interoperability?: Interoperability, @@ -31,7 +31,7 @@ final class Exif implements BaseModel * Object containing Exif details. */ #[Api(optional: true)] - public ?ImageKit\Files\Metadata\Exif\Exif $exif; + public ?Exif\Exif $exif; /** * Object containing GPS information. @@ -74,7 +74,7 @@ public function __construct() * @param array $makernote */ public static function with( - ?ImageKit\Files\Metadata\Exif\Exif $exif = null, + ?Exif\Exif $exif = null, ?Gps $gps = null, ?Image $image = null, ?Interoperability $interoperability = null, @@ -96,7 +96,7 @@ public static function with( /** * Object containing Exif details. */ - public function withExif(ImageKit\Files\Metadata\Exif\Exif $exif): self + public function withExif(Exif\Exif $exif): self { $obj = clone $this; $obj->exif = $exif; diff --git a/src/ServiceContracts/Accounts/URLEndpointsContract.php b/src/ServiceContracts/Accounts/URLEndpointsContract.php index 9e61e201..4d4fbe92 100644 --- a/src/ServiceContracts/Accounts/URLEndpointsContract.php +++ b/src/ServiceContracts/Accounts/URLEndpointsContract.php @@ -51,7 +51,7 @@ public function createRaw( * @param string $description description of the URL endpoint * @param list $origins Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) - * @param ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Cloudinary|ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Imgix|ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Akamai $urlRewriter configuration for third-party URL rewriting + * @param \ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Cloudinary|\ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Imgix|\ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Akamai $urlRewriter configuration for third-party URL rewriting * * @throws APIException */ diff --git a/src/ServiceContracts/CustomMetadataFieldsContract.php b/src/ServiceContracts/CustomMetadataFieldsContract.php index 94988076..50c1e4e6 100644 --- a/src/ServiceContracts/CustomMetadataFieldsContract.php +++ b/src/ServiceContracts/CustomMetadataFieldsContract.php @@ -46,7 +46,7 @@ public function createRaw( * @api * * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. This parameter is required if `schema` is not provided. - * @param ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. + * @param \ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. * * @throws APIException */ diff --git a/src/Services/Accounts/URLEndpointsService.php b/src/Services/Accounts/URLEndpointsService.php index c6ca3436..1de751c6 100644 --- a/src/Services/Accounts/URLEndpointsService.php +++ b/src/Services/Accounts/URLEndpointsService.php @@ -90,7 +90,7 @@ public function createRaw( * @param string $description description of the URL endpoint * @param list $origins Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) - * @param ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Cloudinary|ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Imgix|ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Akamai $urlRewriter configuration for third-party URL rewriting + * @param URLEndpointUpdateParams\URLRewriter\Cloudinary|URLEndpointUpdateParams\URLRewriter\Imgix|URLEndpointUpdateParams\URLRewriter\Akamai $urlRewriter configuration for third-party URL rewriting * * @throws APIException */ diff --git a/src/Services/CustomMetadataFieldsService.php b/src/Services/CustomMetadataFieldsService.php index 1ec62e3e..c3468e82 100644 --- a/src/Services/CustomMetadataFieldsService.php +++ b/src/Services/CustomMetadataFieldsService.php @@ -79,7 +79,7 @@ public function createRaw( * This API updates the label or schema of an existing custom metadata field. * * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. This parameter is required if `schema` is not provided. - * @param ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. + * @param CustomMetadataFieldUpdateParams\Schema $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. * * @throws APIException */ From bde112f4d3a020051e13c581c3ff7bc89f7b27a9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 01:49:49 +0000 Subject: [PATCH 057/193] chore(internal): codegen related update --- .github/workflows/create-releases.yml | 30 --------------------------- .github/workflows/release-doctor.yml | 2 -- bin/check-release-environment | 4 ---- 3 files changed, 36 deletions(-) delete mode 100644 .github/workflows/create-releases.yml diff --git a/.github/workflows/create-releases.yml b/.github/workflows/create-releases.yml deleted file mode 100644 index 8e723adf..00000000 --- a/.github/workflows/create-releases.yml +++ /dev/null @@ -1,30 +0,0 @@ -name: Create releases -on: - schedule: - - cron: '0 5 * * *' # every day at 5am UTC - push: - branches: - - main - -jobs: - release: - name: release - if: github.ref == 'refs/heads/main' && github.repository == 'stainless-sdks/imagekit-php' - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - - uses: stainless-api/trigger-release-please@v1 - id: release - with: - repo: ${{ github.event.repository.full_name }} - stainless-api-key: ${{ secrets.STAINLESS_API_KEY }} - - - name: Publish to Packagist - if: ${{ steps.release.outputs.releases_created }} - run: |- - curl --fail-with-body -X POST -H 'Content-Type: application/json' "https://packagist.org/api/update-package?username=${PACKAGIST_USERNAME}&apiToken=${PACKAGIST_SAFE_KEY}" -d '{"repository":"https://www.github.com/stainless-sdks/imagekit-php"}' - env: - PACKAGIST_USERNAME: ${{ secrets.IMAGE_KIT_PACKAGIST_USERNAME || secrets.PACKAGIST_USERNAME }} - PACKAGIST_SAFE_KEY: ${{ secrets.IMAGE_KIT_PACKAGIST_SAFE_KEY || secrets.PACKAGIST_SAFE_KEY }} diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index c789d348..921b70fb 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -17,5 +17,3 @@ jobs: - name: Check release environment run: | bash ./bin/check-release-environment - env: - STAINLESS_API_KEY: ${{ secrets.STAINLESS_API_KEY }} diff --git a/bin/check-release-environment b/bin/check-release-environment index 0d9c55da..cf571b62 100644 --- a/bin/check-release-environment +++ b/bin/check-release-environment @@ -2,10 +2,6 @@ errors=() -if [ -z "${STAINLESS_API_KEY}" ]; then - errors+=("The STAINLESS_API_KEY secret has not been set. Please contact Stainless for an API key & set it in your organization secrets on GitHub.") -fi - if [ -z "${PACKAGIST_USERNAME}" ]; then errors+=("The PACKAGIST_USERNAME secret has not been set. Please set it in either this repository's secrets or your organization secrets") fi From 5a4ecfc9579954ed381c99fe5cba7d1cca3e8520 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 8 Oct 2025 22:52:19 +0000 Subject: [PATCH 058/193] fix(ci): release doctor workflow --- .github/workflows/release-doctor.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 921b70fb..a4dc8763 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -17,3 +17,6 @@ jobs: - name: Check release environment run: | bash ./bin/check-release-environment + env: + PACKAGIST_USERNAME: ${{ secrets.IMAGE_KIT_PACKAGIST_USERNAME || secrets.PACKAGIST_USERNAME }} + PACKAGIST_SAFE_KEY: ${{ secrets.IMAGE_KIT_PACKAGIST_SAFE_KEY || secrets.PACKAGIST_SAFE_KEY }} From c0f621686ed7fc92fd4618393bbdc4ad7bea8a91 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Oct 2025 20:06:31 +0000 Subject: [PATCH 059/193] chore: add license --- composer.json | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 7f793c41..1482d609 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,11 @@ { "$schema": "https://getcomposer.org/schema.json", + "license": "Apache-2.0", "autoload": { - "files": ["src/Core.php", "src/Client.php"], + "files": [ + "src/Core.php", + "src/Client.php" + ], "psr-4": { "ImageKit\\": "src/" } From 493710dc24182fc6c2162a9554e45402ab43a2f7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 16 Oct 2025 04:34:03 +0000 Subject: [PATCH 060/193] fix: inverted retry condition --- src/Core/BaseClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/BaseClient.php b/src/Core/BaseClient.php index f6a542f5..9be455a4 100644 --- a/src/Core/BaseClient.php +++ b/src/Core/BaseClient.php @@ -264,7 +264,7 @@ protected function sendRequest( } if ($code >= 400 || is_null($rsp)) { - if ($this->shouldRetry($opts, retryCount: $retryCount, rsp: $rsp)) { + if (!$this->shouldRetry($opts, retryCount: $retryCount, rsp: $rsp)) { $exn = is_null($rsp) ? new APIConnectionException($req, previous: $err) : APIStatusException::from(request: $req, response: $rsp); throw $exn; From f2b52643c14ced1fe4264ddc4517c3394b0cc507 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 09:46:40 +0000 Subject: [PATCH 061/193] feat(api): add GetImageAttributesOptions and ResponsiveImageAttributes schemas; update resource references in main.yaml; remove dummy endpoint --- .stats.yml | 6 +- src/GetImageAttributesOptions.php | 374 ++++++++++++++++++++++++++++++ src/ResponsiveImageAttributes.php | 136 +++++++++++ 3 files changed, 513 insertions(+), 3 deletions(-) create mode 100644 src/GetImageAttributesOptions.php create mode 100644 src/ResponsiveImageAttributes.php diff --git a/.stats.yml b/.stats.yml index f035d349..27ad9e7e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-c7ad6f552b38f2145781847f8b390fa1ec43068d64e45a33012a97a9299edc10.yml -openapi_spec_hash: 50f281e91210ad5018ac7e4eee216f56 -config_hash: 74a8263b80c732a2b016177e7d56bb9c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-0e4fa3c1f9d8cafecb9671fa76c0ff9156c643e05837804679e5e336bad8f4c1.yml +openapi_spec_hash: 4544b950730b721c252eb519358b8609 +config_hash: 3d7a0bc2844e9fb4797149b233e85770 diff --git a/src/GetImageAttributesOptions.php b/src/GetImageAttributesOptions.php new file mode 100644 index 00000000..c3c2f305 --- /dev/null +++ b/src/GetImageAttributesOptions.php @@ -0,0 +1,374 @@ +` elements. + * This schema extends `SrcOptions` to add support for responsive image generation with breakpoints. + * + * @phpstan-type get_image_attributes_options = array{ + * src: string, + * urlEndpoint: string, + * expiresIn?: float, + * queryParameters?: array, + * signed?: bool, + * transformation?: list, + * transformationPosition?: value-of, + * deviceBreakpoints?: list, + * imageBreakpoints?: list, + * sizes?: string, + * width?: float, + * } + */ +final class GetImageAttributesOptions implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Accepts a relative or absolute path of the resource. If a relative path is provided, it is appended to the `urlEndpoint`. + * If an absolute path is provided, `urlEndpoint` is ignored. + */ + #[Api] + public string $src; + + /** + * Get your urlEndpoint from the [ImageKit dashboard](https://imagekit.io/dashboard/url-endpoints). + */ + #[Api] + public string $urlEndpoint; + + /** + * When you want the signed URL to expire, specified in seconds. If `expiresIn` is anything above 0, + * the URL will always be signed even if `signed` is set to false. If not specified and `signed` is `true`, + * the signed URL will not expire (valid indefinitely). + * + * Example: Setting `expiresIn: 3600` will make the URL expire 1 hour from generation time. After the expiry time, the signed URL will no longer be valid and ImageKit will return + * a 401 Unauthorized status code. + * + * [Learn more](https://imagekit.io/docs/media-delivery-basic-security#how-to-generate-signed-urls). + */ + #[Api(optional: true)] + public ?float $expiresIn; + + /** + * These are additional query parameters that you want to add to the final URL. + * They can be any query parameters and not necessarily related to ImageKit. + * This is especially useful if you want to add a versioning parameter to your URLs. + * + * @var array|null $queryParameters + */ + #[Api(map: 'string', optional: true)] + public ?array $queryParameters; + + /** + * Whether to sign the URL or not. Set this to `true` if you want to generate a signed URL. + * If `signed` is `true` and `expiresIn` is not specified, the signed URL will not expire (valid indefinitely). + * Note: If `expiresIn` is set to any value above 0, the URL will always be signed regardless of this setting. + * [Learn more](https://imagekit.io/docs/media-delivery-basic-security#how-to-generate-signed-urls). + */ + #[Api(optional: true)] + public ?bool $signed; + + /** + * An array of objects specifying the transformations to be applied in the URL. If more than one transformation is specified, they are applied in the order they are specified as chained transformations. + * See [Chained transformations](https://imagekit.io/docs/transformations#chained-transformations). + * + * @var list|null $transformation + */ + #[Api(list: Transformation::class, optional: true)] + public ?array $transformation; + + /** + * By default, the transformation string is added as a query parameter in the URL, e.g., `?tr=w-100,h-100`. + * If you want to add the transformation string in the path of the URL, set this to `path`. + * Learn more in the [Transformations guide](https://imagekit.io/docs/transformations). + * + * @var value-of|null $transformationPosition + */ + #[Api(enum: TransformationPosition::class, optional: true)] + public ?string $transformationPosition; + + /** + * Custom list of **device-width breakpoints** in pixels. + * These define common screen widths for responsive image generation. + * + * Defaults to `[640, 750, 828, 1080, 1200, 1920, 2048, 3840]`. + * Sorted automatically. + * + * @var list|null $deviceBreakpoints + */ + #[Api(list: 'float', optional: true)] + public ?array $deviceBreakpoints; + + /** + * Custom list of **image-specific breakpoints** in pixels. + * Useful for generating small variants (e.g., placeholders or thumbnails). + * + * Merged with `deviceBreakpoints` before calculating `srcSet`. + * Defaults to `[16, 32, 48, 64, 96, 128, 256, 384]`. + * Sorted automatically. + * + * @var list|null $imageBreakpoints + */ + #[Api(list: 'float', optional: true)] + public ?array $imageBreakpoints; + + /** + * The value for the HTML `sizes` attribute + * (e.g., `"100vw"` or `"(min-width:768px) 50vw, 100vw"`). + * + * - If it includes one or more `vw` units, breakpoints smaller than the corresponding percentage of the smallest device width are excluded. + * - If it contains no `vw` units, the full breakpoint list is used. + * + * Enables a width-based strategy and generates `w` descriptors in `srcSet`. + */ + #[Api(optional: true)] + public ?string $sizes; + + /** + * The intended display width of the image in pixels, + * used **only when the `sizes` attribute is not provided**. + * + * Triggers a DPR-based strategy (1x and 2x variants) and generates `x` descriptors in `srcSet`. + * + * Ignored if `sizes` is present. + */ + #[Api(optional: true)] + public ?float $width; + + /** + * `new GetImageAttributesOptions()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * GetImageAttributesOptions::with(src: ..., urlEndpoint: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new GetImageAttributesOptions)->withSrc(...)->withURLEndpoint(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param array $queryParameters + * @param list $transformation + * @param TransformationPosition|value-of $transformationPosition + * @param list $deviceBreakpoints + * @param list $imageBreakpoints + */ + public static function with( + string $src, + string $urlEndpoint, + ?float $expiresIn = null, + ?array $queryParameters = null, + ?bool $signed = null, + ?array $transformation = null, + TransformationPosition|string|null $transformationPosition = null, + ?array $deviceBreakpoints = null, + ?array $imageBreakpoints = null, + ?string $sizes = null, + ?float $width = null, + ): self { + $obj = new self; + + $obj->src = $src; + $obj->urlEndpoint = $urlEndpoint; + + null !== $expiresIn && $obj->expiresIn = $expiresIn; + null !== $queryParameters && $obj->queryParameters = $queryParameters; + null !== $signed && $obj->signed = $signed; + null !== $transformation && $obj->transformation = $transformation; + null !== $transformationPosition && $obj['transformationPosition'] = $transformationPosition; + null !== $deviceBreakpoints && $obj->deviceBreakpoints = $deviceBreakpoints; + null !== $imageBreakpoints && $obj->imageBreakpoints = $imageBreakpoints; + null !== $sizes && $obj->sizes = $sizes; + null !== $width && $obj->width = $width; + + return $obj; + } + + /** + * Accepts a relative or absolute path of the resource. If a relative path is provided, it is appended to the `urlEndpoint`. + * If an absolute path is provided, `urlEndpoint` is ignored. + */ + public function withSrc(string $src): self + { + $obj = clone $this; + $obj->src = $src; + + return $obj; + } + + /** + * Get your urlEndpoint from the [ImageKit dashboard](https://imagekit.io/dashboard/url-endpoints). + */ + public function withURLEndpoint(string $urlEndpoint): self + { + $obj = clone $this; + $obj->urlEndpoint = $urlEndpoint; + + return $obj; + } + + /** + * When you want the signed URL to expire, specified in seconds. If `expiresIn` is anything above 0, + * the URL will always be signed even if `signed` is set to false. If not specified and `signed` is `true`, + * the signed URL will not expire (valid indefinitely). + * + * Example: Setting `expiresIn: 3600` will make the URL expire 1 hour from generation time. After the expiry time, the signed URL will no longer be valid and ImageKit will return + * a 401 Unauthorized status code. + * + * [Learn more](https://imagekit.io/docs/media-delivery-basic-security#how-to-generate-signed-urls). + */ + public function withExpiresIn(float $expiresIn): self + { + $obj = clone $this; + $obj->expiresIn = $expiresIn; + + return $obj; + } + + /** + * These are additional query parameters that you want to add to the final URL. + * They can be any query parameters and not necessarily related to ImageKit. + * This is especially useful if you want to add a versioning parameter to your URLs. + * + * @param array $queryParameters + */ + public function withQueryParameters(array $queryParameters): self + { + $obj = clone $this; + $obj->queryParameters = $queryParameters; + + return $obj; + } + + /** + * Whether to sign the URL or not. Set this to `true` if you want to generate a signed URL. + * If `signed` is `true` and `expiresIn` is not specified, the signed URL will not expire (valid indefinitely). + * Note: If `expiresIn` is set to any value above 0, the URL will always be signed regardless of this setting. + * [Learn more](https://imagekit.io/docs/media-delivery-basic-security#how-to-generate-signed-urls). + */ + public function withSigned(bool $signed): self + { + $obj = clone $this; + $obj->signed = $signed; + + return $obj; + } + + /** + * An array of objects specifying the transformations to be applied in the URL. If more than one transformation is specified, they are applied in the order they are specified as chained transformations. + * See [Chained transformations](https://imagekit.io/docs/transformations#chained-transformations). + * + * @param list $transformation + */ + public function withTransformation(array $transformation): self + { + $obj = clone $this; + $obj->transformation = $transformation; + + return $obj; + } + + /** + * By default, the transformation string is added as a query parameter in the URL, e.g., `?tr=w-100,h-100`. + * If you want to add the transformation string in the path of the URL, set this to `path`. + * Learn more in the [Transformations guide](https://imagekit.io/docs/transformations). + * + * @param TransformationPosition|value-of $transformationPosition + */ + public function withTransformationPosition( + TransformationPosition|string $transformationPosition + ): self { + $obj = clone $this; + $obj['transformationPosition'] = $transformationPosition; + + return $obj; + } + + /** + * Custom list of **device-width breakpoints** in pixels. + * These define common screen widths for responsive image generation. + * + * Defaults to `[640, 750, 828, 1080, 1200, 1920, 2048, 3840]`. + * Sorted automatically. + * + * @param list $deviceBreakpoints + */ + public function withDeviceBreakpoints(array $deviceBreakpoints): self + { + $obj = clone $this; + $obj->deviceBreakpoints = $deviceBreakpoints; + + return $obj; + } + + /** + * Custom list of **image-specific breakpoints** in pixels. + * Useful for generating small variants (e.g., placeholders or thumbnails). + * + * Merged with `deviceBreakpoints` before calculating `srcSet`. + * Defaults to `[16, 32, 48, 64, 96, 128, 256, 384]`. + * Sorted automatically. + * + * @param list $imageBreakpoints + */ + public function withImageBreakpoints(array $imageBreakpoints): self + { + $obj = clone $this; + $obj->imageBreakpoints = $imageBreakpoints; + + return $obj; + } + + /** + * The value for the HTML `sizes` attribute + * (e.g., `"100vw"` or `"(min-width:768px) 50vw, 100vw"`). + * + * - If it includes one or more `vw` units, breakpoints smaller than the corresponding percentage of the smallest device width are excluded. + * - If it contains no `vw` units, the full breakpoint list is used. + * + * Enables a width-based strategy and generates `w` descriptors in `srcSet`. + */ + public function withSizes(string $sizes): self + { + $obj = clone $this; + $obj->sizes = $sizes; + + return $obj; + } + + /** + * The intended display width of the image in pixels, + * used **only when the `sizes` attribute is not provided**. + * + * Triggers a DPR-based strategy (1x and 2x variants) and generates `x` descriptors in `srcSet`. + * + * Ignored if `sizes` is present. + */ + public function withWidth(float $width): self + { + $obj = clone $this; + $obj->width = $width; + + return $obj; + } +} diff --git a/src/ResponsiveImageAttributes.php b/src/ResponsiveImageAttributes.php new file mode 100644 index 00000000..f2aaa8ba --- /dev/null +++ b/src/ResponsiveImageAttributes.php @@ -0,0 +1,136 @@ +` element. + * Useful for enabling responsive image loading with `srcSet` and `sizes`. + * + * @phpstan-type responsive_image_attributes = array{ + * src: string, sizes?: string, srcSet?: string, width?: float + * } + */ +final class ResponsiveImageAttributes implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * URL for the *largest* candidate (assigned to plain `src`). + */ + #[Api] + public string $src; + + /** + * `sizes` returned (or synthesised as `100vw`). + * The value for the HTML `sizes` attribute. + */ + #[Api(optional: true)] + public ?string $sizes; + + /** + * Candidate set with `w` or `x` descriptors. + * Multiple image URLs separated by commas, each with a descriptor. + */ + #[Api(optional: true)] + public ?string $srcSet; + + /** + * Width as a number (if `width` was provided in the input options). + */ + #[Api(optional: true)] + public ?float $width; + + /** + * `new ResponsiveImageAttributes()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * ResponsiveImageAttributes::with(src: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new ResponsiveImageAttributes)->withSrc(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $src, + ?string $sizes = null, + ?string $srcSet = null, + ?float $width = null, + ): self { + $obj = new self; + + $obj->src = $src; + + null !== $sizes && $obj->sizes = $sizes; + null !== $srcSet && $obj->srcSet = $srcSet; + null !== $width && $obj->width = $width; + + return $obj; + } + + /** + * URL for the *largest* candidate (assigned to plain `src`). + */ + public function withSrc(string $src): self + { + $obj = clone $this; + $obj->src = $src; + + return $obj; + } + + /** + * `sizes` returned (or synthesised as `100vw`). + * The value for the HTML `sizes` attribute. + */ + public function withSizes(string $sizes): self + { + $obj = clone $this; + $obj->sizes = $sizes; + + return $obj; + } + + /** + * Candidate set with `w` or `x` descriptors. + * Multiple image URLs separated by commas, each with a descriptor. + */ + public function withSrcSet(string $srcSet): self + { + $obj = clone $this; + $obj->srcSet = $srcSet; + + return $obj; + } + + /** + * Width as a number (if `width` was provided in the input options). + */ + public function withWidth(float $width): self + { + $obj = clone $this; + $obj->width = $width; + + return $obj; + } +} From ea10ab096a599578163228949b387adef821a87f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 10:14:51 +0000 Subject: [PATCH 062/193] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 27ad9e7e..e27f9d4f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-0e4fa3c1f9d8cafecb9671fa76c0ff9156c643e05837804679e5e336bad8f4c1.yml -openapi_spec_hash: 4544b950730b721c252eb519358b8609 -config_hash: 3d7a0bc2844e9fb4797149b233e85770 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-9d184cb502ab32a85db2889c796cdfebe812f2a55a604df79c85dd4b5e7e2add.yml +openapi_spec_hash: a9aa620376fce66532c84f9364209b0b +config_hash: bb7229ef61cee50cd6c1ac02a5a74e81 From 6b0dfb31fc142c9c34f061ba48f469973ade55a3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 21 Oct 2025 19:30:03 +0000 Subject: [PATCH 063/193] feat!: remove confusing `toArray()` alias to `__serialize()` in favour of `toProperties()` --- src/Accounts/Origins/OriginCreateParams.php | 11 ----------- src/Accounts/Origins/OriginUpdateParams.php | 11 ----------- .../URLEndpoints/URLEndpointCreateParams.php | 11 ----------- .../URLEndpoints/URLEndpointUpdateParams.php | 11 ----------- src/Accounts/Usage/UsageGetParams.php | 11 ----------- src/Assets/AssetListParams.php | 11 ----------- src/Beta/V2/Files/FileUploadParams.php | 11 ----------- src/Cache/Invalidation/InvalidationCreateParams.php | 11 ----------- src/Core/Concerns/SdkModel.php | 12 +++++++----- src/Core/Contracts/BaseModel.php | 2 +- src/Core/Conversion/ModelOf.php | 2 +- .../CustomMetadataFieldCreateParams.php | 11 ----------- .../CustomMetadataFieldListParams.php | 11 ----------- .../CustomMetadataFieldUpdateParams.php | 11 ----------- src/Files/Bulk/BulkAddTagsParams.php | 11 ----------- src/Files/Bulk/BulkDeleteParams.php | 11 ----------- src/Files/Bulk/BulkRemoveAITagsParams.php | 11 ----------- src/Files/Bulk/BulkRemoveTagsParams.php | 11 ----------- src/Files/FileCopyParams.php | 11 ----------- src/Files/FileMoveParams.php | 11 ----------- src/Files/FileRenameParams.php | 11 ----------- src/Files/FileUpdateParams.php | 11 ----------- src/Files/FileUploadParams.php | 11 ----------- src/Files/Metadata/MetadataGetFromURLParams.php | 11 ----------- src/Files/Versions/VersionDeleteParams.php | 11 ----------- src/Files/Versions/VersionGetParams.php | 11 ----------- src/Files/Versions/VersionRestoreParams.php | 11 ----------- src/Folders/FolderCopyParams.php | 11 ----------- src/Folders/FolderCreateParams.php | 11 ----------- src/Folders/FolderDeleteParams.php | 11 ----------- src/Folders/FolderMoveParams.php | 11 ----------- src/Folders/FolderRenameParams.php | 11 ----------- src/RequestOptions.php | 2 +- 33 files changed, 10 insertions(+), 327 deletions(-) diff --git a/src/Accounts/Origins/OriginCreateParams.php b/src/Accounts/Origins/OriginCreateParams.php index ea0572c7..e00b8a27 100644 --- a/src/Accounts/Origins/OriginCreateParams.php +++ b/src/Accounts/Origins/OriginCreateParams.php @@ -10,20 +10,9 @@ use ImageKit\Core\Contracts\BaseModel; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new OriginCreateParams); // set properties as needed - * $client->accounts.origins->create(...$params->toArray()); - * ``` * **Note:** This API is currently in beta. * Creates a new origin and returns the origin object. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->accounts.origins->create(...$params->toArray());` - * * @see ImageKit\Accounts\Origins->create * * @phpstan-type origin_create_params = array{ diff --git a/src/Accounts/Origins/OriginUpdateParams.php b/src/Accounts/Origins/OriginUpdateParams.php index 2ce8e6c0..b92ed5b2 100644 --- a/src/Accounts/Origins/OriginUpdateParams.php +++ b/src/Accounts/Origins/OriginUpdateParams.php @@ -10,20 +10,9 @@ use ImageKit\Core\Contracts\BaseModel; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new OriginUpdateParams); // set properties as needed - * $client->accounts.origins->update(...$params->toArray()); - * ``` * **Note:** This API is currently in beta. * Updates the origin identified by `id` and returns the updated origin object. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->accounts.origins->update(...$params->toArray());` - * * @see ImageKit\Accounts\Origins->update * * @phpstan-type origin_update_params = array{ diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php index 050e4196..9afd5302 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php @@ -14,20 +14,9 @@ use ImageKit\Core\Contracts\BaseModel; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new URLEndpointCreateParams); // set properties as needed - * $client->accounts.urlEndpoints->create(...$params->toArray()); - * ``` * **Note:** This API is currently in beta. * Creates a new URL‑endpoint and returns the resulting object. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->accounts.urlEndpoints->create(...$params->toArray());` - * * @see ImageKit\Accounts\URLEndpoints->create * * @phpstan-type url_endpoint_create_params = array{ diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php index 7bcaea5c..ff6de86b 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php @@ -14,20 +14,9 @@ use ImageKit\Core\Contracts\BaseModel; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new URLEndpointUpdateParams); // set properties as needed - * $client->accounts.urlEndpoints->update(...$params->toArray()); - * ``` * **Note:** This API is currently in beta. * Updates the URL‑endpoint identified by `id` and returns the updated object. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->accounts.urlEndpoints->update(...$params->toArray());` - * * @see ImageKit\Accounts\URLEndpoints->update * * @phpstan-type url_endpoint_update_params = array{ diff --git a/src/Accounts/Usage/UsageGetParams.php b/src/Accounts/Usage/UsageGetParams.php index ebd52bda..b2a3c202 100644 --- a/src/Accounts/Usage/UsageGetParams.php +++ b/src/Accounts/Usage/UsageGetParams.php @@ -10,19 +10,8 @@ use ImageKit\Core\Contracts\BaseModel; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new UsageGetParams); // set properties as needed - * $client->accounts.usage->get(...$params->toArray()); - * ``` * Get the account usage information between two dates. Note that the API response includes data from the start date while excluding data from the end date. In other words, the data covers the period starting from the specified start date up to, but not including, the end date. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->accounts.usage->get(...$params->toArray());` - * * @see ImageKit\Accounts\Usage->get * * @phpstan-type usage_get_params = array{ diff --git a/src/Assets/AssetListParams.php b/src/Assets/AssetListParams.php index 8345496b..520db6a0 100644 --- a/src/Assets/AssetListParams.php +++ b/src/Assets/AssetListParams.php @@ -13,19 +13,8 @@ use ImageKit\Core\Contracts\BaseModel; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new AssetListParams); // set properties as needed - * $client->assets->list(...$params->toArray()); - * ``` * This API can list all the uploaded files and folders in your ImageKit.io media library. In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and provide this generated string as the value of the `searchQuery`. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->assets->list(...$params->toArray());` - * * @see ImageKit\Assets->list * * @phpstan-type asset_list_params = array{ diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index 48f355e7..d1f768a4 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -16,12 +16,6 @@ use ImageKit\ExtensionItem\RemoveBg; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new FileUploadParams); // set properties as needed - * $client->beta.v2.files->upload(...$params->toArray()); - * ``` * The V2 API enhances security by verifying the entire payload using JWT. This API is in beta. * * ImageKit.io allows you to upload files directly from both the server and client sides. For server-side uploads, private API key authentication is used. For client-side uploads, generate a one-time `token` from your secure backend using private API. [Learn more](/docs/api-reference/upload-file/upload-file-v2#how-to-implement-secure-client-side-file-upload) about how to implement secure client-side file upload. @@ -37,11 +31,6 @@ * - A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more. * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->beta.v2.files->upload(...$params->toArray());` - * * @see ImageKit\Beta\V2\Files->upload * * @phpstan-type file_upload_params = array{ diff --git a/src/Cache/Invalidation/InvalidationCreateParams.php b/src/Cache/Invalidation/InvalidationCreateParams.php index 881250e3..ca1f5eeb 100644 --- a/src/Cache/Invalidation/InvalidationCreateParams.php +++ b/src/Cache/Invalidation/InvalidationCreateParams.php @@ -10,19 +10,8 @@ use ImageKit\Core\Contracts\BaseModel; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new InvalidationCreateParams); // set properties as needed - * $client->cache.invalidation->create(...$params->toArray()); - * ``` * This API will purge CDN cache and ImageKit.io's internal cache for a file. Note: Purge cache is an asynchronous process and it may take some time to reflect the changes. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->cache.invalidation->create(...$params->toArray());` - * * @see ImageKit\Cache\Invalidation->create * * @phpstan-type invalidation_create_params = array{url: string} diff --git a/src/Core/Concerns/SdkModel.php b/src/Core/Concerns/SdkModel.php index 35f52cf4..1b538e3e 100644 --- a/src/Core/Concerns/SdkModel.php +++ b/src/Core/Concerns/SdkModel.php @@ -32,9 +32,9 @@ trait SdkModel */ public function __serialize(): array { - $rows = [...Util::get_object_vars($this), ...$this->_data]; // @phpstan-ignore-line + $properties = $this->toProperties(); // @phpstan-ignore-line - return array_map(static fn ($v) => self::serialize($v), array: $rows); + return array_map(static fn ($v) => self::serialize($v), array: $properties); } /** @@ -98,11 +98,13 @@ public function __get(string $key): mixed } /** + * @internal + * * @return Shape */ - public function toArray(): array + public function toProperties(): array { - return $this->__serialize(); // @phpstan-ignore-line + return [...Util::get_object_vars($this), ...$this->_data]; // @phpstan-ignore-line } /** @@ -257,7 +259,7 @@ private function initialize(): void private static function serialize(mixed $value): mixed { if ($value instanceof BaseModel) { - return $value->toArray(); + return $value->toProperties(); } if (is_array($value)) { diff --git a/src/Core/Contracts/BaseModel.php b/src/Core/Contracts/BaseModel.php index 68d47446..ec1fbe74 100644 --- a/src/Core/Contracts/BaseModel.php +++ b/src/Core/Contracts/BaseModel.php @@ -14,5 +14,5 @@ interface BaseModel extends \ArrayAccess, \JsonSerializable, \Stringable, ConverterSource { /** @return array */ - public function toArray(): array; + public function toProperties(): array; } diff --git a/src/Core/Conversion/ModelOf.php b/src/Core/Conversion/ModelOf.php index 13444c6a..163ea51f 100644 --- a/src/Core/Conversion/ModelOf.php +++ b/src/Core/Conversion/ModelOf.php @@ -105,7 +105,7 @@ public function from(array $data): BaseModel public function dump(mixed $value, DumpState $state): mixed { if ($value instanceof BaseModel) { - $value = $value->toArray(); + $value = $value->toProperties(); } if (is_array($value)) { diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php index 055c3d90..5b8bc5a3 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php @@ -11,19 +11,8 @@ use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new CustomMetadataFieldCreateParams); // set properties as needed - * $client->customMetadataFields->create(...$params->toArray()); - * ``` * This API creates a new custom metadata field. Once a custom metadata field is created either through this API or using the dashboard UI, its value can be set on the assets. The value of a field for an asset can be set using the media library UI or programmatically through upload or update assets API. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->customMetadataFields->create(...$params->toArray());` - * * @see ImageKit\CustomMetadataFields->create * * @phpstan-type custom_metadata_field_create_params = array{ diff --git a/src/CustomMetadataFields/CustomMetadataFieldListParams.php b/src/CustomMetadataFields/CustomMetadataFieldListParams.php index d07b18f2..16d9ace1 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldListParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldListParams.php @@ -10,21 +10,10 @@ use ImageKit\Core\Contracts\BaseModel; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new CustomMetadataFieldListParams); // set properties as needed - * $client->customMetadataFields->list(...$params->toArray()); - * ``` * This API returns the array of created custom metadata field objects. By default the API returns only non deleted field objects, but you can include deleted fields in the API response. * * You can also filter results by a specific folder path to retrieve custom metadata fields applicable at that location. This path-specific filtering is useful when using the **Path policy** feature to determine which custom metadata fields are selected for a given path. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->customMetadataFields->list(...$params->toArray());` - * * @see ImageKit\CustomMetadataFields->list * * @phpstan-type custom_metadata_field_list_params = array{ diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php index 0d72504d..54fb7c37 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php @@ -11,19 +11,8 @@ use ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new CustomMetadataFieldUpdateParams); // set properties as needed - * $client->customMetadataFields->update(...$params->toArray()); - * ``` * This API updates the label or schema of an existing custom metadata field. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->customMetadataFields->update(...$params->toArray());` - * * @see ImageKit\CustomMetadataFields->update * * @phpstan-type custom_metadata_field_update_params = array{ diff --git a/src/Files/Bulk/BulkAddTagsParams.php b/src/Files/Bulk/BulkAddTagsParams.php index 6ce38baa..53ffd749 100644 --- a/src/Files/Bulk/BulkAddTagsParams.php +++ b/src/Files/Bulk/BulkAddTagsParams.php @@ -10,19 +10,8 @@ use ImageKit\Core\Contracts\BaseModel; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new BulkAddTagsParams); // set properties as needed - * $client->files.bulk->addTags(...$params->toArray()); - * ``` * This API adds tags to multiple files in bulk. A maximum of 50 files can be specified at a time. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->files.bulk->addTags(...$params->toArray());` - * * @see ImageKit\Files\Bulk->addTags * * @phpstan-type bulk_add_tags_params = array{ diff --git a/src/Files/Bulk/BulkDeleteParams.php b/src/Files/Bulk/BulkDeleteParams.php index 7898f84d..c7b6e882 100644 --- a/src/Files/Bulk/BulkDeleteParams.php +++ b/src/Files/Bulk/BulkDeleteParams.php @@ -10,23 +10,12 @@ use ImageKit\Core\Contracts\BaseModel; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new BulkDeleteParams); // set properties as needed - * $client->files.bulk->delete(...$params->toArray()); - * ``` * This API deletes multiple files and all their file versions permanently. * * Note: If a file or specific transformation has been requested in the past, then the response is cached. Deleting a file does not purge the cache. You can purge the cache using purge cache API. * * A maximum of 100 files can be deleted at a time. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->files.bulk->delete(...$params->toArray());` - * * @see ImageKit\Files\Bulk->delete * * @phpstan-type bulk_delete_params = array{fileIDs: list} diff --git a/src/Files/Bulk/BulkRemoveAITagsParams.php b/src/Files/Bulk/BulkRemoveAITagsParams.php index a5d9c1cb..2fe76ca5 100644 --- a/src/Files/Bulk/BulkRemoveAITagsParams.php +++ b/src/Files/Bulk/BulkRemoveAITagsParams.php @@ -10,19 +10,8 @@ use ImageKit\Core\Contracts\BaseModel; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new BulkRemoveAITagsParams); // set properties as needed - * $client->files.bulk->removeAITags(...$params->toArray()); - * ``` * This API removes AITags from multiple files in bulk. A maximum of 50 files can be specified at a time. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->files.bulk->removeAITags(...$params->toArray());` - * * @see ImageKit\Files\Bulk->removeAITags * * @phpstan-type bulk_remove_ai_tags_params = array{ diff --git a/src/Files/Bulk/BulkRemoveTagsParams.php b/src/Files/Bulk/BulkRemoveTagsParams.php index 0f442e97..678dc4ed 100644 --- a/src/Files/Bulk/BulkRemoveTagsParams.php +++ b/src/Files/Bulk/BulkRemoveTagsParams.php @@ -10,19 +10,8 @@ use ImageKit\Core\Contracts\BaseModel; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new BulkRemoveTagsParams); // set properties as needed - * $client->files.bulk->removeTags(...$params->toArray()); - * ``` * This API removes tags from multiple files in bulk. A maximum of 50 files can be specified at a time. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->files.bulk->removeTags(...$params->toArray());` - * * @see ImageKit\Files\Bulk->removeTags * * @phpstan-type bulk_remove_tags_params = array{ diff --git a/src/Files/FileCopyParams.php b/src/Files/FileCopyParams.php index 2d2ae572..fce0e5d8 100644 --- a/src/Files/FileCopyParams.php +++ b/src/Files/FileCopyParams.php @@ -10,21 +10,10 @@ use ImageKit\Core\Contracts\BaseModel; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new FileCopyParams); // set properties as needed - * $client->files->copy(...$params->toArray()); - * ``` * This will copy a file from one folder to another. * * Note: If any file at the destination has the same name as the source file, then the source file and its versions (if `includeFileVersions` is set to true) will be appended to the destination file version history. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->files->copy(...$params->toArray());` - * * @see ImageKit\Files->copy * * @phpstan-type file_copy_params = array{ diff --git a/src/Files/FileMoveParams.php b/src/Files/FileMoveParams.php index d9061fe0..68c5a7a4 100644 --- a/src/Files/FileMoveParams.php +++ b/src/Files/FileMoveParams.php @@ -10,21 +10,10 @@ use ImageKit\Core\Contracts\BaseModel; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new FileMoveParams); // set properties as needed - * $client->files->move(...$params->toArray()); - * ``` * This will move a file and all its versions from one folder to another. * * Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->files->move(...$params->toArray());` - * * @see ImageKit\Files->move * * @phpstan-type file_move_params = array{ diff --git a/src/Files/FileRenameParams.php b/src/Files/FileRenameParams.php index 7ec02dea..b41454d5 100644 --- a/src/Files/FileRenameParams.php +++ b/src/Files/FileRenameParams.php @@ -10,21 +10,10 @@ use ImageKit\Core\Contracts\BaseModel; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new FileRenameParams); // set properties as needed - * $client->files->rename(...$params->toArray()); - * ``` * You can rename an already existing file in the media library using rename file API. This operation would rename all file versions of the file. * * Note: The old URLs will stop working. The file/file version URLs cached on CDN will continue to work unless a purge is requested. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->files->rename(...$params->toArray());` - * * @see ImageKit\Files->rename * * @phpstan-type file_rename_params = array{ diff --git a/src/Files/FileUpdateParams.php b/src/Files/FileUpdateParams.php index 0fb8c92e..bd01707d 100644 --- a/src/Files/FileUpdateParams.php +++ b/src/Files/FileUpdateParams.php @@ -16,19 +16,8 @@ use ImageKit\Files\FileUpdateParams\RemoveAITags; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new FileUpdateParams); // set properties as needed - * $client->files->update(...$params->toArray()); - * ``` * This API updates the details or attributes of the current version of the file. You can update `tags`, `customCoordinates`, `customMetadata`, publication status, remove existing `AITags` and apply extensions using this API. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->files->update(...$params->toArray());` - * * @see ImageKit\Files->update * * @phpstan-type file_update_params = array{ diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index aa7ae914..192ce2bf 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -16,12 +16,6 @@ use ImageKit\Files\FileUploadParams\Transformation; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new FileUploadParams); // set properties as needed - * $client->files->upload(...$params->toArray()); - * ``` * ImageKit.io allows you to upload files directly from both the server and client sides. For server-side uploads, private API key authentication is used. For client-side uploads, generate a one-time `token`, `signature`, and `expire` from your secure backend using private API. [Learn more](/docs/api-reference/upload-file/upload-file#how-to-implement-client-side-file-upload) about how to implement client-side file upload. * * The [V2 API](/docs/api-reference/upload-file/upload-file-v2) enhances security by verifying the entire payload using JWT. @@ -37,11 +31,6 @@ * - A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more. * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->files->upload(...$params->toArray());` - * * @see ImageKit\Files->upload * * @phpstan-type file_upload_params = array{ diff --git a/src/Files/Metadata/MetadataGetFromURLParams.php b/src/Files/Metadata/MetadataGetFromURLParams.php index cc871ebf..d56164d9 100644 --- a/src/Files/Metadata/MetadataGetFromURLParams.php +++ b/src/Files/Metadata/MetadataGetFromURLParams.php @@ -10,19 +10,8 @@ use ImageKit\Core\Contracts\BaseModel; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new MetadataGetFromURLParams); // set properties as needed - * $client->files.metadata->getFromURL(...$params->toArray()); - * ``` * Get image EXIF, pHash, and other metadata from ImageKit.io powered remote URL using this API. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->files.metadata->getFromURL(...$params->toArray());` - * * @see ImageKit\Files\Metadata->getFromURL * * @phpstan-type metadata_get_from_url_params = array{url: string} diff --git a/src/Files/Versions/VersionDeleteParams.php b/src/Files/Versions/VersionDeleteParams.php index cb70f500..a5c99a18 100644 --- a/src/Files/Versions/VersionDeleteParams.php +++ b/src/Files/Versions/VersionDeleteParams.php @@ -10,21 +10,10 @@ use ImageKit\Core\Contracts\BaseModel; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new VersionDeleteParams); // set properties as needed - * $client->files.versions->delete(...$params->toArray()); - * ``` * This API deletes a non-current file version permanently. The API returns an empty response. * * Note: If you want to delete all versions of a file, use the delete file API. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->files.versions->delete(...$params->toArray());` - * * @see ImageKit\Files\Versions->delete * * @phpstan-type version_delete_params = array{fileID: string} diff --git a/src/Files/Versions/VersionGetParams.php b/src/Files/Versions/VersionGetParams.php index d1cc4eb0..e6d9ac37 100644 --- a/src/Files/Versions/VersionGetParams.php +++ b/src/Files/Versions/VersionGetParams.php @@ -10,19 +10,8 @@ use ImageKit\Core\Contracts\BaseModel; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new VersionGetParams); // set properties as needed - * $client->files.versions->get(...$params->toArray()); - * ``` * This API returns an object with details or attributes of a file version. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->files.versions->get(...$params->toArray());` - * * @see ImageKit\Files\Versions->get * * @phpstan-type version_get_params = array{fileID: string} diff --git a/src/Files/Versions/VersionRestoreParams.php b/src/Files/Versions/VersionRestoreParams.php index 30e9d03f..e1deb729 100644 --- a/src/Files/Versions/VersionRestoreParams.php +++ b/src/Files/Versions/VersionRestoreParams.php @@ -10,19 +10,8 @@ use ImageKit\Core\Contracts\BaseModel; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new VersionRestoreParams); // set properties as needed - * $client->files.versions->restore(...$params->toArray()); - * ``` * This API restores a file version as the current file version. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->files.versions->restore(...$params->toArray());` - * * @see ImageKit\Files\Versions->restore * * @phpstan-type version_restore_params = array{fileID: string} diff --git a/src/Folders/FolderCopyParams.php b/src/Folders/FolderCopyParams.php index d1b48d1d..c70ebbac 100644 --- a/src/Folders/FolderCopyParams.php +++ b/src/Folders/FolderCopyParams.php @@ -10,19 +10,8 @@ use ImageKit\Core\Contracts\BaseModel; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new FolderCopyParams); // set properties as needed - * $client->folders->copy(...$params->toArray()); - * ``` * This will copy one folder into another. The selected folder, its nested folders, files, and their versions (in `includeVersions` is set to true) are copied in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->folders->copy(...$params->toArray());` - * * @see ImageKit\Folders->copy * * @phpstan-type folder_copy_params = array{ diff --git a/src/Folders/FolderCreateParams.php b/src/Folders/FolderCreateParams.php index 26230c90..7698adae 100644 --- a/src/Folders/FolderCreateParams.php +++ b/src/Folders/FolderCreateParams.php @@ -10,19 +10,8 @@ use ImageKit\Core\Contracts\BaseModel; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new FolderCreateParams); // set properties as needed - * $client->folders->create(...$params->toArray()); - * ``` * This will create a new folder. You can specify the folder name and location of the parent folder where this new folder should be created. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->folders->create(...$params->toArray());` - * * @see ImageKit\Folders->create * * @phpstan-type folder_create_params = array{ diff --git a/src/Folders/FolderDeleteParams.php b/src/Folders/FolderDeleteParams.php index b22108f9..0af429b0 100644 --- a/src/Folders/FolderDeleteParams.php +++ b/src/Folders/FolderDeleteParams.php @@ -10,19 +10,8 @@ use ImageKit\Core\Contracts\BaseModel; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new FolderDeleteParams); // set properties as needed - * $client->folders->delete(...$params->toArray()); - * ``` * This will delete a folder and all its contents permanently. The API returns an empty response. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->folders->delete(...$params->toArray());` - * * @see ImageKit\Folders->delete * * @phpstan-type folder_delete_params = array{folderPath: string} diff --git a/src/Folders/FolderMoveParams.php b/src/Folders/FolderMoveParams.php index d2819441..f04be7df 100644 --- a/src/Folders/FolderMoveParams.php +++ b/src/Folders/FolderMoveParams.php @@ -10,19 +10,8 @@ use ImageKit\Core\Contracts\BaseModel; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new FolderMoveParams); // set properties as needed - * $client->folders->move(...$params->toArray()); - * ``` * This will move one folder into another. The selected folder, its nested folders, files, and their versions are moved in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->folders->move(...$params->toArray());` - * * @see ImageKit\Folders->move * * @phpstan-type folder_move_params = array{ diff --git a/src/Folders/FolderRenameParams.php b/src/Folders/FolderRenameParams.php index a6356be1..e7260993 100644 --- a/src/Folders/FolderRenameParams.php +++ b/src/Folders/FolderRenameParams.php @@ -10,19 +10,8 @@ use ImageKit\Core\Contracts\BaseModel; /** - * An object containing the method's parameters. - * Example usage: - * ``` - * $params = (new FolderRenameParams); // set properties as needed - * $client->folders->rename(...$params->toArray()); - * ``` * This API allows you to rename an existing folder. The folder and all its nested assets and sub-folders will remain unchanged, but their paths will be updated to reflect the new folder name. * - * @method toArray() - * Returns the parameters as an associative array suitable for passing to the client method. - * - * `$client->folders->rename(...$params->toArray());` - * * @see ImageKit\Folders->rename * * @phpstan-type folder_rename_params = array{ diff --git a/src/RequestOptions.php b/src/RequestOptions.php index 0881a16a..eec3ead6 100644 --- a/src/RequestOptions.php +++ b/src/RequestOptions.php @@ -81,7 +81,7 @@ public function __construct() */ public static function parse(RequestOptions|array|null ...$options): self { - $parsed = array_map(static fn ($o) => $o instanceof self ? $o->toArray() : $o ?? [], array: $options); + $parsed = array_map(static fn ($o) => $o instanceof self ? $o->toProperties() : $o ?? [], array: $options); return self::with(...array_merge(...$parsed)); // @phpstan-ignore-line } From 834101926d2a3ad566a8c3880e1a5a0dffde9f63 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Oct 2025 04:01:26 +0000 Subject: [PATCH 064/193] chore: client instantiation refactor --- tests/Services/Accounts/OriginsTest.php | 2 +- tests/Services/Accounts/URLEndpointsTest.php | 2 +- tests/Services/Accounts/UsageTest.php | 2 +- tests/Services/AssetsTest.php | 2 +- tests/Services/Beta/V2/FilesTest.php | 2 +- tests/Services/Cache/InvalidationTest.php | 2 +- tests/Services/CustomMetadataFieldsTest.php | 2 +- tests/Services/Files/BulkTest.php | 2 +- tests/Services/Files/MetadataTest.php | 2 +- tests/Services/Files/VersionsTest.php | 2 +- tests/Services/FilesTest.php | 2 +- tests/Services/Folders/JobTest.php | 2 +- tests/Services/FoldersTest.php | 2 +- tests/Services/WebhooksTest.php | 2 +- 14 files changed, 14 insertions(+), 14 deletions(-) diff --git a/tests/Services/Accounts/OriginsTest.php b/tests/Services/Accounts/OriginsTest.php index c4730cc6..e0110113 100644 --- a/tests/Services/Accounts/OriginsTest.php +++ b/tests/Services/Accounts/OriginsTest.php @@ -24,7 +24,7 @@ protected function setUp(): void $client = new Client( privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl + baseUrl: $testUrl, ); $this->client = $client; diff --git a/tests/Services/Accounts/URLEndpointsTest.php b/tests/Services/Accounts/URLEndpointsTest.php index ceaa0d5a..f60887c7 100644 --- a/tests/Services/Accounts/URLEndpointsTest.php +++ b/tests/Services/Accounts/URLEndpointsTest.php @@ -24,7 +24,7 @@ protected function setUp(): void $client = new Client( privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl + baseUrl: $testUrl, ); $this->client = $client; diff --git a/tests/Services/Accounts/UsageTest.php b/tests/Services/Accounts/UsageTest.php index 2c7e46fa..34023240 100644 --- a/tests/Services/Accounts/UsageTest.php +++ b/tests/Services/Accounts/UsageTest.php @@ -24,7 +24,7 @@ protected function setUp(): void $client = new Client( privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl + baseUrl: $testUrl, ); $this->client = $client; diff --git a/tests/Services/AssetsTest.php b/tests/Services/AssetsTest.php index ade121a3..38ea7df8 100644 --- a/tests/Services/AssetsTest.php +++ b/tests/Services/AssetsTest.php @@ -24,7 +24,7 @@ protected function setUp(): void $client = new Client( privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl + baseUrl: $testUrl, ); $this->client = $client; diff --git a/tests/Services/Beta/V2/FilesTest.php b/tests/Services/Beta/V2/FilesTest.php index 2107b0bb..cecc8625 100644 --- a/tests/Services/Beta/V2/FilesTest.php +++ b/tests/Services/Beta/V2/FilesTest.php @@ -24,7 +24,7 @@ protected function setUp(): void $client = new Client( privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl + baseUrl: $testUrl, ); $this->client = $client; diff --git a/tests/Services/Cache/InvalidationTest.php b/tests/Services/Cache/InvalidationTest.php index 3fd2c71d..03bf6771 100644 --- a/tests/Services/Cache/InvalidationTest.php +++ b/tests/Services/Cache/InvalidationTest.php @@ -24,7 +24,7 @@ protected function setUp(): void $client = new Client( privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl + baseUrl: $testUrl, ); $this->client = $client; diff --git a/tests/Services/CustomMetadataFieldsTest.php b/tests/Services/CustomMetadataFieldsTest.php index ce448a18..4386806b 100644 --- a/tests/Services/CustomMetadataFieldsTest.php +++ b/tests/Services/CustomMetadataFieldsTest.php @@ -25,7 +25,7 @@ protected function setUp(): void $client = new Client( privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl + baseUrl: $testUrl, ); $this->client = $client; diff --git a/tests/Services/Files/BulkTest.php b/tests/Services/Files/BulkTest.php index f4a05468..0a04bab7 100644 --- a/tests/Services/Files/BulkTest.php +++ b/tests/Services/Files/BulkTest.php @@ -24,7 +24,7 @@ protected function setUp(): void $client = new Client( privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl + baseUrl: $testUrl, ); $this->client = $client; diff --git a/tests/Services/Files/MetadataTest.php b/tests/Services/Files/MetadataTest.php index e1db6e85..ff3adb12 100644 --- a/tests/Services/Files/MetadataTest.php +++ b/tests/Services/Files/MetadataTest.php @@ -24,7 +24,7 @@ protected function setUp(): void $client = new Client( privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl + baseUrl: $testUrl, ); $this->client = $client; diff --git a/tests/Services/Files/VersionsTest.php b/tests/Services/Files/VersionsTest.php index 78dc7741..7b686340 100644 --- a/tests/Services/Files/VersionsTest.php +++ b/tests/Services/Files/VersionsTest.php @@ -24,7 +24,7 @@ protected function setUp(): void $client = new Client( privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl + baseUrl: $testUrl, ); $this->client = $client; diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index 187cc16f..c2a9ad6f 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -24,7 +24,7 @@ protected function setUp(): void $client = new Client( privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl + baseUrl: $testUrl, ); $this->client = $client; diff --git a/tests/Services/Folders/JobTest.php b/tests/Services/Folders/JobTest.php index fb36aa5a..d2e92346 100644 --- a/tests/Services/Folders/JobTest.php +++ b/tests/Services/Folders/JobTest.php @@ -24,7 +24,7 @@ protected function setUp(): void $client = new Client( privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl + baseUrl: $testUrl, ); $this->client = $client; diff --git a/tests/Services/FoldersTest.php b/tests/Services/FoldersTest.php index 6ea1479c..017baa06 100644 --- a/tests/Services/FoldersTest.php +++ b/tests/Services/FoldersTest.php @@ -24,7 +24,7 @@ protected function setUp(): void $client = new Client( privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl + baseUrl: $testUrl, ); $this->client = $client; diff --git a/tests/Services/WebhooksTest.php b/tests/Services/WebhooksTest.php index b0aac71d..737a8602 100644 --- a/tests/Services/WebhooksTest.php +++ b/tests/Services/WebhooksTest.php @@ -22,7 +22,7 @@ protected function setUp(): void $client = new Client( privateKey: 'My Private Key', password: 'My Password', - baseUrl: $testUrl + baseUrl: $testUrl, ); $this->client = $client; From 8d8f4fcc8d20dd6ccdb4825f438e14ec71bb4600 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Oct 2025 13:33:57 +0000 Subject: [PATCH 065/193] chore: use pascal case for phpstan typedefs --- src/Accounts/Origins/OriginCreateParams.php | 4 ++-- src/Accounts/Origins/OriginRequest/AkeneoPim.php | 4 ++-- src/Accounts/Origins/OriginRequest/AzureBlob.php | 4 ++-- src/Accounts/Origins/OriginRequest/CloudinaryBackup.php | 4 ++-- src/Accounts/Origins/OriginRequest/Gcs.php | 4 ++-- src/Accounts/Origins/OriginRequest/S3.php | 4 ++-- src/Accounts/Origins/OriginRequest/S3Compatible.php | 4 ++-- src/Accounts/Origins/OriginRequest/WebFolder.php | 4 ++-- src/Accounts/Origins/OriginRequest/WebProxy.php | 4 ++-- src/Accounts/Origins/OriginResponse/AkeneoPim.php | 4 ++-- src/Accounts/Origins/OriginResponse/AzureBlob.php | 4 ++-- src/Accounts/Origins/OriginResponse/CloudinaryBackup.php | 4 ++-- src/Accounts/Origins/OriginResponse/Gcs.php | 4 ++-- src/Accounts/Origins/OriginResponse/S3.php | 4 ++-- src/Accounts/Origins/OriginResponse/S3Compatible.php | 4 ++-- src/Accounts/Origins/OriginResponse/WebFolder.php | 4 ++-- src/Accounts/Origins/OriginResponse/WebProxy.php | 4 ++-- src/Accounts/Origins/OriginUpdateParams.php | 4 ++-- src/Accounts/URLEndpoints/URLEndpointCreateParams.php | 4 ++-- .../URLEndpointCreateParams/URLRewriter/Akamai.php | 4 ++-- .../URLEndpointCreateParams/URLRewriter/Cloudinary.php | 4 ++-- .../URLEndpointCreateParams/URLRewriter/Imgix.php | 4 ++-- src/Accounts/URLEndpoints/URLEndpointRequest.php | 4 ++-- .../URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php | 4 ++-- .../URLEndpointRequest/URLRewriter/Cloudinary.php | 4 ++-- .../URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php | 4 ++-- src/Accounts/URLEndpoints/URLEndpointResponse.php | 4 ++-- .../URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php | 4 ++-- .../URLEndpointResponse/URLRewriter/Cloudinary.php | 4 ++-- .../URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php | 4 ++-- src/Accounts/URLEndpoints/URLEndpointUpdateParams.php | 4 ++-- .../URLEndpointUpdateParams/URLRewriter/Akamai.php | 4 ++-- .../URLEndpointUpdateParams/URLRewriter/Cloudinary.php | 4 ++-- .../URLEndpointUpdateParams/URLRewriter/Imgix.php | 4 ++-- src/Accounts/Usage/UsageGetParams.php | 4 ++-- src/Accounts/Usage/UsageGetResponse.php | 4 ++-- src/Assets/AssetListParams.php | 4 ++-- src/BaseOverlay.php | 4 ++-- src/Beta/V2/Files/FileUploadParams.php | 4 ++-- src/Beta/V2/Files/FileUploadParams/Transformation.php | 4 ++-- .../V2/Files/FileUploadParams/Transformation/Post/Abs.php | 4 ++-- .../FileUploadParams/Transformation/Post/GifToVideo.php | 4 ++-- .../FileUploadParams/Transformation/Post/Thumbnail.php | 4 ++-- .../FileUploadParams/Transformation/Post/Transformation.php | 4 ++-- src/Beta/V2/Files/FileUploadResponse.php | 4 ++-- src/Beta/V2/Files/FileUploadResponse/AITag.php | 6 ++++-- src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php | 4 ++-- .../V2/Files/FileUploadResponse/SelectedFieldsSchema.php | 4 ++-- src/Beta/V2/Files/FileUploadResponse/VersionInfo.php | 4 ++-- src/Cache/Invalidation/InvalidationCreateParams.php | 4 ++-- src/Cache/Invalidation/InvalidationGetResponse.php | 4 ++-- src/Cache/Invalidation/InvalidationNewResponse.php | 4 ++-- src/CustomMetadataFields/CustomMetadataField.php | 4 ++-- src/CustomMetadataFields/CustomMetadataField/Schema.php | 4 ++-- .../CustomMetadataFieldCreateParams.php | 4 ++-- .../CustomMetadataFieldCreateParams/Schema.php | 4 ++-- .../CustomMetadataFieldDeleteResponse.php | 4 ++-- src/CustomMetadataFields/CustomMetadataFieldListParams.php | 4 ++-- .../CustomMetadataFieldUpdateParams.php | 4 ++-- .../CustomMetadataFieldUpdateParams/Schema.php | 4 ++-- src/ExtensionItem/AIAutoDescription.php | 4 ++-- src/ExtensionItem/AutoTaggingExtension.php | 4 ++-- src/ExtensionItem/RemoveBg.php | 4 ++-- src/ExtensionItem/RemoveBg/Options.php | 4 ++-- src/Files/Bulk/BulkAddTagsParams.php | 4 ++-- src/Files/Bulk/BulkAddTagsResponse.php | 4 ++-- src/Files/Bulk/BulkDeleteParams.php | 4 ++-- src/Files/Bulk/BulkDeleteResponse.php | 4 ++-- src/Files/Bulk/BulkRemoveAITagsParams.php | 4 ++-- src/Files/Bulk/BulkRemoveAITagsResponse.php | 4 ++-- src/Files/Bulk/BulkRemoveTagsParams.php | 4 ++-- src/Files/Bulk/BulkRemoveTagsResponse.php | 4 ++-- src/Files/File.php | 4 ++-- src/Files/File/AITag.php | 6 ++++-- src/Files/File/SelectedFieldsSchema.php | 4 ++-- src/Files/File/VersionInfo.php | 4 ++-- src/Files/FileCopyParams.php | 4 ++-- src/Files/FileCopyResponse.php | 4 ++-- src/Files/FileMoveParams.php | 4 ++-- src/Files/FileMoveResponse.php | 4 ++-- src/Files/FileRenameParams.php | 4 ++-- src/Files/FileRenameResponse.php | 4 ++-- src/Files/FileUpdateParams.php | 4 ++-- src/Files/FileUpdateParams/Publish.php | 4 ++-- src/Files/FileUpdateResponse.php | 4 ++-- src/Files/FileUpdateResponse/ExtensionStatus.php | 4 ++-- src/Files/FileUploadParams.php | 4 ++-- src/Files/FileUploadParams/Transformation.php | 4 ++-- src/Files/FileUploadParams/Transformation/Post/Abs.php | 4 ++-- .../FileUploadParams/Transformation/Post/GifToVideo.php | 4 ++-- .../FileUploadParams/Transformation/Post/Thumbnail.php | 4 ++-- .../FileUploadParams/Transformation/Post/Transformation.php | 4 ++-- src/Files/FileUploadResponse.php | 4 ++-- src/Files/FileUploadResponse/AITag.php | 6 ++++-- src/Files/FileUploadResponse/ExtensionStatus.php | 4 ++-- src/Files/FileUploadResponse/SelectedFieldsSchema.php | 4 ++-- src/Files/FileUploadResponse/VersionInfo.php | 4 ++-- src/Files/Folder.php | 4 ++-- src/Files/Metadata.php | 4 ++-- src/Files/Metadata/Exif.php | 4 ++-- src/Files/Metadata/Exif/Exif.php | 4 ++-- src/Files/Metadata/Exif/Gps.php | 4 ++-- src/Files/Metadata/Exif/Image.php | 4 ++-- src/Files/Metadata/Exif/Interoperability.php | 4 ++-- src/Files/Metadata/Exif/Thumbnail.php | 4 ++-- src/Files/Metadata/MetadataGetFromURLParams.php | 4 ++-- src/Files/UpdateFileRequest/ChangePublicationStatus.php | 4 ++-- .../UpdateFileRequest/ChangePublicationStatus/Publish.php | 4 ++-- src/Files/UpdateFileRequest/UpdateFileDetails.php | 4 ++-- src/Files/Versions/VersionDeleteParams.php | 4 ++-- src/Files/Versions/VersionDeleteResponse.php | 4 ++-- src/Files/Versions/VersionGetParams.php | 4 ++-- src/Files/Versions/VersionRestoreParams.php | 4 ++-- src/Folders/FolderCopyParams.php | 4 ++-- src/Folders/FolderCopyResponse.php | 4 ++-- src/Folders/FolderCreateParams.php | 4 ++-- src/Folders/FolderDeleteParams.php | 4 ++-- src/Folders/FolderDeleteResponse.php | 4 ++-- src/Folders/FolderMoveParams.php | 4 ++-- src/Folders/FolderMoveResponse.php | 4 ++-- src/Folders/FolderNewResponse.php | 4 ++-- src/Folders/FolderRenameParams.php | 4 ++-- src/Folders/FolderRenameResponse.php | 4 ++-- src/Folders/Job/JobGetResponse.php | 4 ++-- src/GetImageAttributesOptions.php | 4 ++-- src/ImageOverlay.php | 4 ++-- src/OverlayPosition.php | 4 ++-- src/OverlayTiming.php | 4 ++-- src/ResponsiveImageAttributes.php | 4 ++-- src/SolidColorOverlay.php | 4 ++-- src/SolidColorOverlayTransformation.php | 4 ++-- src/SrcOptions.php | 4 ++-- src/SubtitleOverlay.php | 4 ++-- src/SubtitleOverlayTransformation.php | 4 ++-- src/TextOverlay.php | 4 ++-- src/TextOverlayTransformation.php | 4 ++-- src/Transformation.php | 4 ++-- src/VideoOverlay.php | 4 ++-- src/Webhooks/BaseWebhookEvent.php | 4 ++-- src/Webhooks/UploadPostTransformErrorEvent.php | 4 ++-- src/Webhooks/UploadPostTransformErrorEvent/Data.php | 4 ++-- .../UploadPostTransformErrorEvent/Data/Transformation.php | 4 ++-- .../Data/Transformation/Error.php | 4 ++-- src/Webhooks/UploadPostTransformErrorEvent/Request.php | 4 ++-- .../Request/Transformation.php | 4 ++-- src/Webhooks/UploadPostTransformSuccessEvent.php | 4 ++-- src/Webhooks/UploadPostTransformSuccessEvent/Data.php | 4 ++-- src/Webhooks/UploadPostTransformSuccessEvent/Request.php | 4 ++-- .../Request/Transformation.php | 4 ++-- src/Webhooks/UploadPreTransformErrorEvent.php | 4 ++-- src/Webhooks/UploadPreTransformErrorEvent/Data.php | 4 ++-- .../UploadPreTransformErrorEvent/Data/Transformation.php | 4 ++-- .../Data/Transformation/Error.php | 4 ++-- src/Webhooks/UploadPreTransformErrorEvent/Request.php | 4 ++-- src/Webhooks/UploadPreTransformSuccessEvent.php | 4 ++-- src/Webhooks/UploadPreTransformSuccessEvent/Data.php | 4 ++-- src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php | 6 ++++-- .../UploadPreTransformSuccessEvent/Data/ExtensionStatus.php | 4 ++-- .../Data/SelectedFieldsSchema.php | 4 ++-- .../UploadPreTransformSuccessEvent/Data/VersionInfo.php | 4 ++-- src/Webhooks/UploadPreTransformSuccessEvent/Request.php | 4 ++-- src/Webhooks/VideoTransformationAcceptedEvent.php | 4 ++-- src/Webhooks/VideoTransformationAcceptedEvent/Data.php | 4 ++-- .../VideoTransformationAcceptedEvent/Data/Asset.php | 4 ++-- .../Data/Transformation.php | 4 ++-- .../Data/Transformation/Options.php | 4 ++-- src/Webhooks/VideoTransformationAcceptedEvent/Request.php | 4 ++-- src/Webhooks/VideoTransformationErrorEvent.php | 4 ++-- src/Webhooks/VideoTransformationErrorEvent/Data.php | 4 ++-- src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php | 4 ++-- .../VideoTransformationErrorEvent/Data/Transformation.php | 4 ++-- .../Data/Transformation/Error.php | 4 ++-- .../Data/Transformation/Options.php | 4 ++-- src/Webhooks/VideoTransformationErrorEvent/Request.php | 4 ++-- src/Webhooks/VideoTransformationReadyEvent.php | 4 ++-- src/Webhooks/VideoTransformationReadyEvent/Data.php | 4 ++-- src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php | 4 ++-- .../VideoTransformationReadyEvent/Data/Transformation.php | 4 ++-- .../Data/Transformation/Options.php | 4 ++-- .../Data/Transformation/Output.php | 4 ++-- .../Data/Transformation/Output/VideoMetadata.php | 4 ++-- src/Webhooks/VideoTransformationReadyEvent/Request.php | 4 ++-- src/Webhooks/VideoTransformationReadyEvent/Timings.php | 4 ++-- 183 files changed, 374 insertions(+), 366 deletions(-) diff --git a/src/Accounts/Origins/OriginCreateParams.php b/src/Accounts/Origins/OriginCreateParams.php index e00b8a27..42a2686c 100644 --- a/src/Accounts/Origins/OriginCreateParams.php +++ b/src/Accounts/Origins/OriginCreateParams.php @@ -15,7 +15,7 @@ * * @see ImageKit\Accounts\Origins->create * - * @phpstan-type origin_create_params = array{ + * @phpstan-type OriginCreateParamsShape = array{ * accessKey: string, * bucket: string, * name: string, @@ -41,7 +41,7 @@ */ final class OriginCreateParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Accounts/Origins/OriginRequest/AkeneoPim.php b/src/Accounts/Origins/OriginRequest/AkeneoPim.php index 600e8225..382d83f2 100644 --- a/src/Accounts/Origins/OriginRequest/AkeneoPim.php +++ b/src/Accounts/Origins/OriginRequest/AkeneoPim.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type akeneo_pim = array{ + * @phpstan-type AkeneoPimShape = array{ * baseURL: string, * clientID: string, * clientSecret: string, @@ -23,7 +23,7 @@ */ final class AkeneoPim implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/Origins/OriginRequest/AzureBlob.php b/src/Accounts/Origins/OriginRequest/AzureBlob.php index 7151a017..f2116731 100644 --- a/src/Accounts/Origins/OriginRequest/AzureBlob.php +++ b/src/Accounts/Origins/OriginRequest/AzureBlob.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type azure_blob = array{ + * @phpstan-type AzureBlobShape = array{ * accountName: string, * container: string, * name: string, @@ -22,7 +22,7 @@ */ final class AzureBlob implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php index 21405d2b..0223211d 100644 --- a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type cloudinary_backup = array{ + * @phpstan-type CloudinaryBackupShape = array{ * accessKey: string, * bucket: string, * name: string, @@ -22,7 +22,7 @@ */ final class CloudinaryBackup implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/Origins/OriginRequest/Gcs.php b/src/Accounts/Origins/OriginRequest/Gcs.php index 10a9646e..1f72c89d 100644 --- a/src/Accounts/Origins/OriginRequest/Gcs.php +++ b/src/Accounts/Origins/OriginRequest/Gcs.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type gcs_alias = array{ + * @phpstan-type GcsShape = array{ * bucket: string, * clientEmail: string, * name: string, @@ -22,7 +22,7 @@ */ final class Gcs implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/Origins/OriginRequest/S3.php b/src/Accounts/Origins/OriginRequest/S3.php index 7e54eff2..436da6e4 100644 --- a/src/Accounts/Origins/OriginRequest/S3.php +++ b/src/Accounts/Origins/OriginRequest/S3.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type s3_alias = array{ + * @phpstan-type S3Shape = array{ * accessKey: string, * bucket: string, * name: string, @@ -22,7 +22,7 @@ */ final class S3 implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/Origins/OriginRequest/S3Compatible.php b/src/Accounts/Origins/OriginRequest/S3Compatible.php index 157c882d..00db9db6 100644 --- a/src/Accounts/Origins/OriginRequest/S3Compatible.php +++ b/src/Accounts/Origins/OriginRequest/S3Compatible.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type s3_compatible = array{ + * @phpstan-type S3CompatibleShape = array{ * accessKey: string, * bucket: string, * endpoint: string, @@ -24,7 +24,7 @@ */ final class S3Compatible implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/Origins/OriginRequest/WebFolder.php b/src/Accounts/Origins/OriginRequest/WebFolder.php index f5e03aed..3f0f4196 100644 --- a/src/Accounts/Origins/OriginRequest/WebFolder.php +++ b/src/Accounts/Origins/OriginRequest/WebFolder.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type web_folder = array{ + * @phpstan-type WebFolderShape = array{ * baseURL: string, * name: string, * type: string, @@ -20,7 +20,7 @@ */ final class WebFolder implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/Origins/OriginRequest/WebProxy.php b/src/Accounts/Origins/OriginRequest/WebProxy.php index e6bde50b..fe0ebfe6 100644 --- a/src/Accounts/Origins/OriginRequest/WebProxy.php +++ b/src/Accounts/Origins/OriginRequest/WebProxy.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type web_proxy = array{ + * @phpstan-type WebProxyShape = array{ * name: string, * type: string, * baseURLForCanonicalHeader?: string, @@ -18,7 +18,7 @@ */ final class WebProxy implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/Origins/OriginResponse/AkeneoPim.php b/src/Accounts/Origins/OriginResponse/AkeneoPim.php index d42bf0e8..247702d2 100644 --- a/src/Accounts/Origins/OriginResponse/AkeneoPim.php +++ b/src/Accounts/Origins/OriginResponse/AkeneoPim.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type akeneo_pim = array{ + * @phpstan-type AkeneoPimShape = array{ * id: string, * baseURL: string, * includeCanonicalHeader: bool, @@ -20,7 +20,7 @@ */ final class AkeneoPim implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/Origins/OriginResponse/AzureBlob.php b/src/Accounts/Origins/OriginResponse/AzureBlob.php index 83d2dc7c..3bc78f7b 100644 --- a/src/Accounts/Origins/OriginResponse/AzureBlob.php +++ b/src/Accounts/Origins/OriginResponse/AzureBlob.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type azure_blob = array{ + * @phpstan-type AzureBlobShape = array{ * id: string, * accountName: string, * container: string, @@ -22,7 +22,7 @@ */ final class AzureBlob implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php index c58af4db..4c6c7009 100644 --- a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type cloudinary_backup = array{ + * @phpstan-type CloudinaryBackupShape = array{ * id: string, * bucket: string, * includeCanonicalHeader: bool, @@ -21,7 +21,7 @@ */ final class CloudinaryBackup implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/Origins/OriginResponse/Gcs.php b/src/Accounts/Origins/OriginResponse/Gcs.php index fba85c13..2febdbdf 100644 --- a/src/Accounts/Origins/OriginResponse/Gcs.php +++ b/src/Accounts/Origins/OriginResponse/Gcs.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type gcs_alias = array{ + * @phpstan-type GcsShape = array{ * id: string, * bucket: string, * clientEmail: string, @@ -22,7 +22,7 @@ */ final class Gcs implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/Origins/OriginResponse/S3.php b/src/Accounts/Origins/OriginResponse/S3.php index abeac628..81a8e43d 100644 --- a/src/Accounts/Origins/OriginResponse/S3.php +++ b/src/Accounts/Origins/OriginResponse/S3.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type s3_alias = array{ + * @phpstan-type S3Shape = array{ * id: string, * bucket: string, * includeCanonicalHeader: bool, @@ -21,7 +21,7 @@ */ final class S3 implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/Origins/OriginResponse/S3Compatible.php b/src/Accounts/Origins/OriginResponse/S3Compatible.php index 3016348f..33d3b8c6 100644 --- a/src/Accounts/Origins/OriginResponse/S3Compatible.php +++ b/src/Accounts/Origins/OriginResponse/S3Compatible.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type s3_compatible = array{ + * @phpstan-type S3CompatibleShape = array{ * id: string, * bucket: string, * endpoint: string, @@ -23,7 +23,7 @@ */ final class S3Compatible implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/Origins/OriginResponse/WebFolder.php b/src/Accounts/Origins/OriginResponse/WebFolder.php index 9f56573a..81be030e 100644 --- a/src/Accounts/Origins/OriginResponse/WebFolder.php +++ b/src/Accounts/Origins/OriginResponse/WebFolder.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type web_folder = array{ + * @phpstan-type WebFolderShape = array{ * id: string, * baseURL: string, * forwardHostHeaderToOrigin: bool, @@ -21,7 +21,7 @@ */ final class WebFolder implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/Origins/OriginResponse/WebProxy.php b/src/Accounts/Origins/OriginResponse/WebProxy.php index b1c61e6c..23dcff97 100644 --- a/src/Accounts/Origins/OriginResponse/WebProxy.php +++ b/src/Accounts/Origins/OriginResponse/WebProxy.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type web_proxy = array{ + * @phpstan-type WebProxyShape = array{ * id: string, * includeCanonicalHeader: bool, * name: string, @@ -19,7 +19,7 @@ */ final class WebProxy implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/Origins/OriginUpdateParams.php b/src/Accounts/Origins/OriginUpdateParams.php index b92ed5b2..8fffea5f 100644 --- a/src/Accounts/Origins/OriginUpdateParams.php +++ b/src/Accounts/Origins/OriginUpdateParams.php @@ -15,7 +15,7 @@ * * @see ImageKit\Accounts\Origins->update * - * @phpstan-type origin_update_params = array{ + * @phpstan-type OriginUpdateParamsShape = array{ * accessKey: string, * bucket: string, * name: string, @@ -41,7 +41,7 @@ */ final class OriginUpdateParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php index 9afd5302..ad49a4b7 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php @@ -19,7 +19,7 @@ * * @see ImageKit\Accounts\URLEndpoints->create * - * @phpstan-type url_endpoint_create_params = array{ + * @phpstan-type URLEndpointCreateParamsShape = array{ * description: string, * origins?: list, * urlPrefix?: string, @@ -28,7 +28,7 @@ */ final class URLEndpointCreateParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php index ea43417a..769a5e4d 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php @@ -9,11 +9,11 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type akamai_alias = array{type: string} + * @phpstan-type AkamaiShape = array{type: string} */ final class Akamai implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php index b35d6c2f..41b2a75e 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php @@ -9,13 +9,13 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type cloudinary_alias = array{ + * @phpstan-type CloudinaryShape = array{ * type: string, preserveAssetDeliveryTypes?: bool * } */ final class Cloudinary implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php index 8ad00879..7a80e3d3 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php @@ -9,11 +9,11 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type imgix_alias = array{type: string} + * @phpstan-type ImgixShape = array{type: string} */ final class Imgix implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest.php b/src/Accounts/URLEndpoints/URLEndpointRequest.php index f74ca34a..7ac95d42 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest.php @@ -15,7 +15,7 @@ /** * Schema for URL endpoint resource. * - * @phpstan-type url_endpoint_request = array{ + * @phpstan-type URLEndpointRequestShape = array{ * description: string, * origins?: list, * urlPrefix?: string, @@ -24,7 +24,7 @@ */ final class URLEndpointRequest implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php index dbf4c8d9..0c2bd81d 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php @@ -9,11 +9,11 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type akamai_alias = array{type: string} + * @phpstan-type AkamaiShape = array{type: string} */ final class Akamai implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php index 25a15b2f..ac59eeac 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php @@ -9,13 +9,13 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type cloudinary_alias = array{ + * @phpstan-type CloudinaryShape = array{ * type: string, preserveAssetDeliveryTypes?: bool * } */ final class Cloudinary implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php index cf77cd8f..4d46ee5f 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php @@ -9,11 +9,11 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type imgix_alias = array{type: string} + * @phpstan-type ImgixShape = array{type: string} */ final class Imgix implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse.php b/src/Accounts/URLEndpoints/URLEndpointResponse.php index 64ebdd44..306bbf6e 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse.php @@ -17,7 +17,7 @@ /** * URL‑endpoint object as returned by the API. * - * @phpstan-type url_endpoint_response = array{ + * @phpstan-type URLEndpointResponseShape = array{ * id: string, * description: string, * origins: list, @@ -27,7 +27,7 @@ */ final class URLEndpointResponse implements BaseModel, ResponseConverter { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkResponse; diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php index 0c4052c4..54d01443 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php @@ -9,11 +9,11 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type akamai_alias = array{type: string} + * @phpstan-type AkamaiShape = array{type: string} */ final class Akamai implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php index 137c04c0..be3ed42e 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php @@ -9,13 +9,13 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type cloudinary_alias = array{ + * @phpstan-type CloudinaryShape = array{ * preserveAssetDeliveryTypes: bool, type: string * } */ final class Cloudinary implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php index f873ae66..c2065e22 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php @@ -9,11 +9,11 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type imgix_alias = array{type: string} + * @phpstan-type ImgixShape = array{type: string} */ final class Imgix implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php index ff6de86b..b5d525df 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php @@ -19,7 +19,7 @@ * * @see ImageKit\Accounts\URLEndpoints->update * - * @phpstan-type url_endpoint_update_params = array{ + * @phpstan-type URLEndpointUpdateParamsShape = array{ * description: string, * origins?: list, * urlPrefix?: string, @@ -28,7 +28,7 @@ */ final class URLEndpointUpdateParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php index ade81c92..bab24813 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php @@ -9,11 +9,11 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type akamai_alias = array{type: string} + * @phpstan-type AkamaiShape = array{type: string} */ final class Akamai implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php index 29ae7c45..0c86e95b 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php @@ -9,13 +9,13 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type cloudinary_alias = array{ + * @phpstan-type CloudinaryShape = array{ * type: string, preserveAssetDeliveryTypes?: bool * } */ final class Cloudinary implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php index 13c3e71f..bb7d1876 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php @@ -9,11 +9,11 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type imgix_alias = array{type: string} + * @phpstan-type ImgixShape = array{type: string} */ final class Imgix implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Accounts/Usage/UsageGetParams.php b/src/Accounts/Usage/UsageGetParams.php index b2a3c202..e5e7e19e 100644 --- a/src/Accounts/Usage/UsageGetParams.php +++ b/src/Accounts/Usage/UsageGetParams.php @@ -14,13 +14,13 @@ * * @see ImageKit\Accounts\Usage->get * - * @phpstan-type usage_get_params = array{ + * @phpstan-type UsageGetParamsShape = array{ * endDate: \DateTimeInterface, startDate: \DateTimeInterface * } */ final class UsageGetParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Accounts/Usage/UsageGetResponse.php b/src/Accounts/Usage/UsageGetResponse.php index e61ed679..8c6e3b6c 100644 --- a/src/Accounts/Usage/UsageGetResponse.php +++ b/src/Accounts/Usage/UsageGetResponse.php @@ -11,7 +11,7 @@ use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** - * @phpstan-type usage_get_response = array{ + * @phpstan-type UsageGetResponseShape = array{ * bandwidthBytes?: int, * extensionUnitsCount?: int, * mediaLibraryStorageBytes?: int, @@ -21,7 +21,7 @@ */ final class UsageGetResponse implements BaseModel, ResponseConverter { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkResponse; diff --git a/src/Assets/AssetListParams.php b/src/Assets/AssetListParams.php index 520db6a0..aeec3988 100644 --- a/src/Assets/AssetListParams.php +++ b/src/Assets/AssetListParams.php @@ -17,7 +17,7 @@ * * @see ImageKit\Assets->list * - * @phpstan-type asset_list_params = array{ + * @phpstan-type AssetListParamsShape = array{ * fileType?: FileType|value-of, * limit?: int, * path?: string, @@ -29,7 +29,7 @@ */ final class AssetListParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/BaseOverlay.php b/src/BaseOverlay.php index 66c1fb87..5edf2f7a 100644 --- a/src/BaseOverlay.php +++ b/src/BaseOverlay.php @@ -9,13 +9,13 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type base_overlay = array{ + * @phpstan-type BaseOverlayShape = array{ * position?: OverlayPosition, timing?: OverlayTiming * } */ final class BaseOverlay implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api(optional: true)] diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index d1f768a4..958aee91 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -33,7 +33,7 @@ * * @see ImageKit\Beta\V2\Files->upload * - * @phpstan-type file_upload_params = array{ + * @phpstan-type FileUploadParamsShape = array{ * file: string, * fileName: string, * token?: string, @@ -58,7 +58,7 @@ */ final class FileUploadParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation.php index 886f856b..340ad782 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation.php @@ -23,14 +23,14 @@ * * You can mix and match any combination of post-processing types. * - * @phpstan-type transformation_alias = array{ + * @phpstan-type TransformationShape = array{ * post?: list<\ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Transformation|GifToVideo|Thumbnail|Abs>, * pre?: string, * } */ final class Transformation implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php index 98373eb0..b23f2906 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php @@ -10,13 +10,13 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type abs_alias = array{ + * @phpstan-type AbsShape = array{ * protocol: value-of, type: string, value: string * } */ final class Abs implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php index 483f357e..dd541698 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php @@ -9,11 +9,11 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type gif_to_video = array{type: string, value?: string} + * @phpstan-type GifToVideoShape = array{type: string, value?: string} */ final class GifToVideo implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php index e3e032c1..fa8b8673 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php @@ -9,11 +9,11 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type thumbnail_alias = array{type: string, value?: string} + * @phpstan-type ThumbnailShape = array{type: string, value?: string} */ final class Thumbnail implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php index 498c6597..9d588c1c 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php @@ -9,11 +9,11 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type transformation_alias = array{type: string, value: string} + * @phpstan-type TransformationShape = array{type: string, value: string} */ final class Transformation implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Beta/V2/Files/FileUploadResponse.php b/src/Beta/V2/Files/FileUploadResponse.php index 8f9a8179..d7c3b53c 100644 --- a/src/Beta/V2/Files/FileUploadResponse.php +++ b/src/Beta/V2/Files/FileUploadResponse.php @@ -18,7 +18,7 @@ /** * Object containing details of a successful upload. * - * @phpstan-type file_upload_response = array{ + * @phpstan-type FileUploadResponseShape = array{ * aiTags?: list|null, * audioCodec?: string, * bitRate?: int, @@ -48,7 +48,7 @@ */ final class FileUploadResponse implements BaseModel, ResponseConverter { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkResponse; diff --git a/src/Beta/V2/Files/FileUploadResponse/AITag.php b/src/Beta/V2/Files/FileUploadResponse/AITag.php index d54b479f..4ba0ec05 100644 --- a/src/Beta/V2/Files/FileUploadResponse/AITag.php +++ b/src/Beta/V2/Files/FileUploadResponse/AITag.php @@ -9,11 +9,13 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type ai_tag = array{confidence?: float, name?: string, source?: string} + * @phpstan-type AITagShape = array{ + * confidence?: float, name?: string, source?: string + * } */ final class AITag implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php index 6b0393df..be70b88b 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php @@ -21,7 +21,7 @@ * * If no extension was requested, then this parameter is not returned. * - * @phpstan-type extension_status = array{ + * @phpstan-type ExtensionStatusShape = array{ * aiAutoDescription?: value-of, * awsAutoTagging?: value-of, * googleAutoTagging?: value-of, @@ -30,7 +30,7 @@ */ final class ExtensionStatus implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @var value-of|null $aiAutoDescription */ diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php index 68b8975b..aeedf6bc 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php @@ -12,7 +12,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type selected_fields_schema = array{ + * @phpstan-type SelectedFieldsSchemaShape = array{ * type: value-of, * defaultValue?: string|float|bool|list, * isValueRequired?: bool, @@ -27,7 +27,7 @@ */ final class SelectedFieldsSchema implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php b/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php index 7c4c0048..e8d0e5fb 100644 --- a/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php +++ b/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php @@ -11,11 +11,11 @@ /** * An object containing the file or file version's `id` (versionId) and `name`. * - * @phpstan-type version_info = array{id?: string, name?: string} + * @phpstan-type VersionInfoShape = array{id?: string, name?: string} */ final class VersionInfo implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Cache/Invalidation/InvalidationCreateParams.php b/src/Cache/Invalidation/InvalidationCreateParams.php index ca1f5eeb..42876312 100644 --- a/src/Cache/Invalidation/InvalidationCreateParams.php +++ b/src/Cache/Invalidation/InvalidationCreateParams.php @@ -14,11 +14,11 @@ * * @see ImageKit\Cache\Invalidation->create * - * @phpstan-type invalidation_create_params = array{url: string} + * @phpstan-type InvalidationCreateParamsShape = array{url: string} */ final class InvalidationCreateParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Cache/Invalidation/InvalidationGetResponse.php b/src/Cache/Invalidation/InvalidationGetResponse.php index 86165a2f..53c0aea8 100644 --- a/src/Cache/Invalidation/InvalidationGetResponse.php +++ b/src/Cache/Invalidation/InvalidationGetResponse.php @@ -12,11 +12,11 @@ use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** - * @phpstan-type invalidation_get_response = array{status?: value-of} + * @phpstan-type InvalidationGetResponseShape = array{status?: value-of} */ final class InvalidationGetResponse implements BaseModel, ResponseConverter { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkResponse; diff --git a/src/Cache/Invalidation/InvalidationNewResponse.php b/src/Cache/Invalidation/InvalidationNewResponse.php index ae2ff4ea..1b38885c 100644 --- a/src/Cache/Invalidation/InvalidationNewResponse.php +++ b/src/Cache/Invalidation/InvalidationNewResponse.php @@ -11,11 +11,11 @@ use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** - * @phpstan-type invalidation_new_response = array{requestID?: string} + * @phpstan-type InvalidationNewResponseShape = array{requestID?: string} */ final class InvalidationNewResponse implements BaseModel, ResponseConverter { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkResponse; diff --git a/src/CustomMetadataFields/CustomMetadataField.php b/src/CustomMetadataFields/CustomMetadataField.php index 36684019..c8dde28e 100644 --- a/src/CustomMetadataFields/CustomMetadataField.php +++ b/src/CustomMetadataFields/CustomMetadataField.php @@ -14,13 +14,13 @@ /** * Object containing details of a custom metadata field. * - * @phpstan-type custom_metadata_field = array{ + * @phpstan-type CustomMetadataFieldShape = array{ * id: string, label: string, name: string, schema: Schema * } */ final class CustomMetadataField implements BaseModel, ResponseConverter { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkResponse; diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema.php b/src/CustomMetadataFields/CustomMetadataField/Schema.php index 80b12ddf..3a205270 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema.php @@ -14,7 +14,7 @@ /** * An object that describes the rules for the custom metadata field value. * - * @phpstan-type schema_alias = array{ + * @phpstan-type SchemaShape = array{ * type: value-of, * defaultValue?: string|float|bool|list, * isValueRequired?: bool, @@ -27,7 +27,7 @@ */ final class Schema implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php index 5b8bc5a3..6b663ad8 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php @@ -15,13 +15,13 @@ * * @see ImageKit\CustomMetadataFields->create * - * @phpstan-type custom_metadata_field_create_params = array{ + * @phpstan-type CustomMetadataFieldCreateParamsShape = array{ * label: string, name: string, schema: Schema * } */ final class CustomMetadataFieldCreateParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php index 901918fd..55999dfa 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php @@ -12,7 +12,7 @@ use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\Type; /** - * @phpstan-type schema_alias = array{ + * @phpstan-type SchemaShape = array{ * type: value-of, * defaultValue?: string|float|bool|list, * isValueRequired?: bool, @@ -25,7 +25,7 @@ */ final class Schema implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php b/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php index c989be14..439cbbbd 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php +++ b/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php @@ -10,11 +10,11 @@ use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** - * @phpstan-type custom_metadata_field_delete_response = array{} + * @phpstan-type CustomMetadataFieldDeleteResponseShape = array{} */ final class CustomMetadataFieldDeleteResponse implements BaseModel, ResponseConverter { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkResponse; diff --git a/src/CustomMetadataFields/CustomMetadataFieldListParams.php b/src/CustomMetadataFields/CustomMetadataFieldListParams.php index 16d9ace1..1c258f8c 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldListParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldListParams.php @@ -16,13 +16,13 @@ * * @see ImageKit\CustomMetadataFields->list * - * @phpstan-type custom_metadata_field_list_params = array{ + * @phpstan-type CustomMetadataFieldListParamsShape = array{ * folderPath?: string, includeDeleted?: bool * } */ final class CustomMetadataFieldListParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php index 54fb7c37..b6e11c19 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php @@ -15,13 +15,13 @@ * * @see ImageKit\CustomMetadataFields->update * - * @phpstan-type custom_metadata_field_update_params = array{ + * @phpstan-type CustomMetadataFieldUpdateParamsShape = array{ * label?: string, schema?: Schema * } */ final class CustomMetadataFieldUpdateParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php index d08fc33d..3a25ede3 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php @@ -13,7 +13,7 @@ /** * An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. * - * @phpstan-type schema_alias = array{ + * @phpstan-type SchemaShape = array{ * defaultValue?: string|float|bool|list, * isValueRequired?: bool, * maxLength?: float, @@ -25,7 +25,7 @@ */ final class Schema implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/ExtensionItem/AIAutoDescription.php b/src/ExtensionItem/AIAutoDescription.php index 3cd6fa98..f8160d59 100644 --- a/src/ExtensionItem/AIAutoDescription.php +++ b/src/ExtensionItem/AIAutoDescription.php @@ -9,11 +9,11 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type ai_auto_description = array{name: string} + * @phpstan-type AIAutoDescriptionShape = array{name: string} */ final class AIAutoDescription implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/ExtensionItem/AutoTaggingExtension.php b/src/ExtensionItem/AutoTaggingExtension.php index cfe2cf93..1de2f0e8 100644 --- a/src/ExtensionItem/AutoTaggingExtension.php +++ b/src/ExtensionItem/AutoTaggingExtension.php @@ -10,13 +10,13 @@ use ImageKit\ExtensionItem\AutoTaggingExtension\Name; /** - * @phpstan-type auto_tagging_extension = array{ + * @phpstan-type AutoTaggingExtensionShape = array{ * maxTags: int, minConfidence: int, name: value-of * } */ final class AutoTaggingExtension implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/ExtensionItem/RemoveBg.php b/src/ExtensionItem/RemoveBg.php index 1fedf875..ea371aea 100644 --- a/src/ExtensionItem/RemoveBg.php +++ b/src/ExtensionItem/RemoveBg.php @@ -10,11 +10,11 @@ use ImageKit\ExtensionItem\RemoveBg\Options; /** - * @phpstan-type remove_bg = array{name: string, options?: Options} + * @phpstan-type RemoveBgShape = array{name: string, options?: Options} */ final class RemoveBg implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/ExtensionItem/RemoveBg/Options.php b/src/ExtensionItem/RemoveBg/Options.php index f55764da..b2c691aa 100644 --- a/src/ExtensionItem/RemoveBg/Options.php +++ b/src/ExtensionItem/RemoveBg/Options.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type options_alias = array{ + * @phpstan-type OptionsShape = array{ * addShadow?: bool, * bgColor?: string, * bgImageURL?: string, @@ -18,7 +18,7 @@ */ final class Options implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Files/Bulk/BulkAddTagsParams.php b/src/Files/Bulk/BulkAddTagsParams.php index 53ffd749..f00d2724 100644 --- a/src/Files/Bulk/BulkAddTagsParams.php +++ b/src/Files/Bulk/BulkAddTagsParams.php @@ -14,13 +14,13 @@ * * @see ImageKit\Files\Bulk->addTags * - * @phpstan-type bulk_add_tags_params = array{ + * @phpstan-type BulkAddTagsParamsShape = array{ * fileIDs: list, tags: list * } */ final class BulkAddTagsParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Files/Bulk/BulkAddTagsResponse.php b/src/Files/Bulk/BulkAddTagsResponse.php index d85c44b7..fc1fda16 100644 --- a/src/Files/Bulk/BulkAddTagsResponse.php +++ b/src/Files/Bulk/BulkAddTagsResponse.php @@ -11,13 +11,13 @@ use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** - * @phpstan-type bulk_add_tags_response = array{ + * @phpstan-type BulkAddTagsResponseShape = array{ * successfullyUpdatedFileIDs?: list * } */ final class BulkAddTagsResponse implements BaseModel, ResponseConverter { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkResponse; diff --git a/src/Files/Bulk/BulkDeleteParams.php b/src/Files/Bulk/BulkDeleteParams.php index c7b6e882..b8c607b8 100644 --- a/src/Files/Bulk/BulkDeleteParams.php +++ b/src/Files/Bulk/BulkDeleteParams.php @@ -18,11 +18,11 @@ * * @see ImageKit\Files\Bulk->delete * - * @phpstan-type bulk_delete_params = array{fileIDs: list} + * @phpstan-type BulkDeleteParamsShape = array{fileIDs: list} */ final class BulkDeleteParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Files/Bulk/BulkDeleteResponse.php b/src/Files/Bulk/BulkDeleteResponse.php index 731b3aa3..b10af059 100644 --- a/src/Files/Bulk/BulkDeleteResponse.php +++ b/src/Files/Bulk/BulkDeleteResponse.php @@ -11,13 +11,13 @@ use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** - * @phpstan-type bulk_delete_response = array{ + * @phpstan-type BulkDeleteResponseShape = array{ * successfullyDeletedFileIDs?: list * } */ final class BulkDeleteResponse implements BaseModel, ResponseConverter { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkResponse; diff --git a/src/Files/Bulk/BulkRemoveAITagsParams.php b/src/Files/Bulk/BulkRemoveAITagsParams.php index 2fe76ca5..44280e48 100644 --- a/src/Files/Bulk/BulkRemoveAITagsParams.php +++ b/src/Files/Bulk/BulkRemoveAITagsParams.php @@ -14,13 +14,13 @@ * * @see ImageKit\Files\Bulk->removeAITags * - * @phpstan-type bulk_remove_ai_tags_params = array{ + * @phpstan-type BulkRemoveAITagsParamsShape = array{ * aiTags: list, fileIDs: list * } */ final class BulkRemoveAITagsParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Files/Bulk/BulkRemoveAITagsResponse.php b/src/Files/Bulk/BulkRemoveAITagsResponse.php index 486ab340..a1805ef0 100644 --- a/src/Files/Bulk/BulkRemoveAITagsResponse.php +++ b/src/Files/Bulk/BulkRemoveAITagsResponse.php @@ -11,13 +11,13 @@ use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** - * @phpstan-type bulk_remove_ai_tags_response = array{ + * @phpstan-type BulkRemoveAITagsResponseShape = array{ * successfullyUpdatedFileIDs?: list * } */ final class BulkRemoveAITagsResponse implements BaseModel, ResponseConverter { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkResponse; diff --git a/src/Files/Bulk/BulkRemoveTagsParams.php b/src/Files/Bulk/BulkRemoveTagsParams.php index 678dc4ed..bba46d2f 100644 --- a/src/Files/Bulk/BulkRemoveTagsParams.php +++ b/src/Files/Bulk/BulkRemoveTagsParams.php @@ -14,13 +14,13 @@ * * @see ImageKit\Files\Bulk->removeTags * - * @phpstan-type bulk_remove_tags_params = array{ + * @phpstan-type BulkRemoveTagsParamsShape = array{ * fileIDs: list, tags: list * } */ final class BulkRemoveTagsParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Files/Bulk/BulkRemoveTagsResponse.php b/src/Files/Bulk/BulkRemoveTagsResponse.php index 3aa6c216..bae6c446 100644 --- a/src/Files/Bulk/BulkRemoveTagsResponse.php +++ b/src/Files/Bulk/BulkRemoveTagsResponse.php @@ -11,13 +11,13 @@ use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** - * @phpstan-type bulk_remove_tags_response = array{ + * @phpstan-type BulkRemoveTagsResponseShape = array{ * successfullyUpdatedFileIDs?: list * } */ final class BulkRemoveTagsResponse implements BaseModel, ResponseConverter { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkResponse; diff --git a/src/Files/File.php b/src/Files/File.php index f7ba384d..8d0df942 100644 --- a/src/Files/File.php +++ b/src/Files/File.php @@ -17,7 +17,7 @@ /** * Object containing details of a file or file version. * - * @phpstan-type file_alias = array{ + * @phpstan-type FileShape = array{ * aiTags?: list|null, * createdAt?: \DateTimeInterface, * customCoordinates?: string|null, @@ -45,7 +45,7 @@ */ final class File implements BaseModel, ResponseConverter { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkResponse; diff --git a/src/Files/File/AITag.php b/src/Files/File/AITag.php index cdb68bd6..8b51d0c8 100644 --- a/src/Files/File/AITag.php +++ b/src/Files/File/AITag.php @@ -9,11 +9,13 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type ai_tag = array{confidence?: float, name?: string, source?: string} + * @phpstan-type AITagShape = array{ + * confidence?: float, name?: string, source?: string + * } */ final class AITag implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Files/File/SelectedFieldsSchema.php b/src/Files/File/SelectedFieldsSchema.php index 136d032f..ac121787 100644 --- a/src/Files/File/SelectedFieldsSchema.php +++ b/src/Files/File/SelectedFieldsSchema.php @@ -12,7 +12,7 @@ use ImageKit\Files\File\SelectedFieldsSchema\Type; /** - * @phpstan-type selected_fields_schema = array{ + * @phpstan-type SelectedFieldsSchemaShape = array{ * type: value-of, * defaultValue?: string|float|bool|list, * isValueRequired?: bool, @@ -27,7 +27,7 @@ */ final class SelectedFieldsSchema implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Files/File/VersionInfo.php b/src/Files/File/VersionInfo.php index 4026a2df..246315cb 100644 --- a/src/Files/File/VersionInfo.php +++ b/src/Files/File/VersionInfo.php @@ -11,11 +11,11 @@ /** * An object with details of the file version. * - * @phpstan-type version_info = array{id?: string, name?: string} + * @phpstan-type VersionInfoShape = array{id?: string, name?: string} */ final class VersionInfo implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Files/FileCopyParams.php b/src/Files/FileCopyParams.php index fce0e5d8..92ff9b52 100644 --- a/src/Files/FileCopyParams.php +++ b/src/Files/FileCopyParams.php @@ -16,13 +16,13 @@ * * @see ImageKit\Files->copy * - * @phpstan-type file_copy_params = array{ + * @phpstan-type FileCopyParamsShape = array{ * destinationPath: string, sourceFilePath: string, includeFileVersions?: bool * } */ final class FileCopyParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Files/FileCopyResponse.php b/src/Files/FileCopyResponse.php index 0153580e..6b7d6af4 100644 --- a/src/Files/FileCopyResponse.php +++ b/src/Files/FileCopyResponse.php @@ -10,11 +10,11 @@ use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** - * @phpstan-type file_copy_response = array{} + * @phpstan-type FileCopyResponseShape = array{} */ final class FileCopyResponse implements BaseModel, ResponseConverter { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkResponse; diff --git a/src/Files/FileMoveParams.php b/src/Files/FileMoveParams.php index 68c5a7a4..23f919f4 100644 --- a/src/Files/FileMoveParams.php +++ b/src/Files/FileMoveParams.php @@ -16,13 +16,13 @@ * * @see ImageKit\Files->move * - * @phpstan-type file_move_params = array{ + * @phpstan-type FileMoveParamsShape = array{ * destinationPath: string, sourceFilePath: string * } */ final class FileMoveParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Files/FileMoveResponse.php b/src/Files/FileMoveResponse.php index 3fbb5342..57d350dc 100644 --- a/src/Files/FileMoveResponse.php +++ b/src/Files/FileMoveResponse.php @@ -10,11 +10,11 @@ use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** - * @phpstan-type file_move_response = array{} + * @phpstan-type FileMoveResponseShape = array{} */ final class FileMoveResponse implements BaseModel, ResponseConverter { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkResponse; diff --git a/src/Files/FileRenameParams.php b/src/Files/FileRenameParams.php index b41454d5..49bcb049 100644 --- a/src/Files/FileRenameParams.php +++ b/src/Files/FileRenameParams.php @@ -16,13 +16,13 @@ * * @see ImageKit\Files->rename * - * @phpstan-type file_rename_params = array{ + * @phpstan-type FileRenameParamsShape = array{ * filePath: string, newFileName: string, purgeCache?: bool * } */ final class FileRenameParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Files/FileRenameResponse.php b/src/Files/FileRenameResponse.php index 5fb64ea9..d7cb83c8 100644 --- a/src/Files/FileRenameResponse.php +++ b/src/Files/FileRenameResponse.php @@ -11,11 +11,11 @@ use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** - * @phpstan-type file_rename_response = array{purgeRequestID?: string} + * @phpstan-type FileRenameResponseShape = array{purgeRequestID?: string} */ final class FileRenameResponse implements BaseModel, ResponseConverter { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkResponse; diff --git a/src/Files/FileUpdateParams.php b/src/Files/FileUpdateParams.php index bd01707d..3788fec7 100644 --- a/src/Files/FileUpdateParams.php +++ b/src/Files/FileUpdateParams.php @@ -20,7 +20,7 @@ * * @see ImageKit\Files->update * - * @phpstan-type file_update_params = array{ + * @phpstan-type FileUpdateParamsShape = array{ * customCoordinates?: string|null, * customMetadata?: array, * description?: string, @@ -33,7 +33,7 @@ */ final class FileUpdateParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Files/FileUpdateParams/Publish.php b/src/Files/FileUpdateParams/Publish.php index b49cd390..17b6d5b8 100644 --- a/src/Files/FileUpdateParams/Publish.php +++ b/src/Files/FileUpdateParams/Publish.php @@ -11,13 +11,13 @@ /** * Configure the publication status of a file and its versions. * - * @phpstan-type publish_alias = array{ + * @phpstan-type PublishShape = array{ * isPublished: bool, includeFileVersions?: bool * } */ final class Publish implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Files/FileUpdateResponse.php b/src/Files/FileUpdateResponse.php index 1bc21fcf..7496568a 100644 --- a/src/Files/FileUpdateResponse.php +++ b/src/Files/FileUpdateResponse.php @@ -18,7 +18,7 @@ /** * Object containing details of a file or file version. * - * @phpstan-type file_update_response = array{ + * @phpstan-type FileUpdateResponseShape = array{ * aiTags?: list|null, * createdAt?: \DateTimeInterface, * customCoordinates?: string|null, @@ -47,7 +47,7 @@ */ final class FileUpdateResponse implements BaseModel, ResponseConverter { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkResponse; diff --git a/src/Files/FileUpdateResponse/ExtensionStatus.php b/src/Files/FileUpdateResponse/ExtensionStatus.php index b882ad40..0f2702b7 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus.php @@ -13,7 +13,7 @@ use ImageKit\Files\FileUpdateResponse\ExtensionStatus\RemoveBg; /** - * @phpstan-type extension_status = array{ + * @phpstan-type ExtensionStatusShape = array{ * aiAutoDescription?: value-of, * awsAutoTagging?: value-of, * googleAutoTagging?: value-of, @@ -22,7 +22,7 @@ */ final class ExtensionStatus implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @var value-of|null $aiAutoDescription */ diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index 192ce2bf..0413b5ed 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -33,7 +33,7 @@ * * @see ImageKit\Files->upload * - * @phpstan-type file_upload_params = array{ + * @phpstan-type FileUploadParamsShape = array{ * file: string, * fileName: string, * token?: string, @@ -61,7 +61,7 @@ */ final class FileUploadParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Files/FileUploadParams/Transformation.php b/src/Files/FileUploadParams/Transformation.php index 7ce7da51..9ebb295f 100644 --- a/src/Files/FileUploadParams/Transformation.php +++ b/src/Files/FileUploadParams/Transformation.php @@ -23,14 +23,14 @@ * * You can mix and match any combination of post-processing types. * - * @phpstan-type transformation_alias = array{ + * @phpstan-type TransformationShape = array{ * post?: list<\ImageKit\Files\FileUploadParams\Transformation\Post\Transformation|GifToVideo|Thumbnail|Abs>, * pre?: string, * } */ final class Transformation implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Files/FileUploadParams/Transformation/Post/Abs.php b/src/Files/FileUploadParams/Transformation/Post/Abs.php index 4278018a..2fbdcfaf 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Abs.php +++ b/src/Files/FileUploadParams/Transformation/Post/Abs.php @@ -10,13 +10,13 @@ use ImageKit\Files\FileUploadParams\Transformation\Post\Abs\Protocol; /** - * @phpstan-type abs_alias = array{ + * @phpstan-type AbsShape = array{ * protocol: value-of, type: string, value: string * } */ final class Abs implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php b/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php index aec3eafc..41580ed1 100644 --- a/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php +++ b/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php @@ -9,11 +9,11 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type gif_to_video = array{type: string, value?: string} + * @phpstan-type GifToVideoShape = array{type: string, value?: string} */ final class GifToVideo implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php b/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php index 7d10b9e6..3423b839 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php +++ b/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php @@ -9,11 +9,11 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type thumbnail_alias = array{type: string, value?: string} + * @phpstan-type ThumbnailShape = array{type: string, value?: string} */ final class Thumbnail implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Files/FileUploadParams/Transformation/Post/Transformation.php b/src/Files/FileUploadParams/Transformation/Post/Transformation.php index 3f514695..0238aa5b 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Transformation.php +++ b/src/Files/FileUploadParams/Transformation/Post/Transformation.php @@ -9,11 +9,11 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type transformation_alias = array{type: string, value: string} + * @phpstan-type TransformationShape = array{type: string, value: string} */ final class Transformation implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Files/FileUploadResponse.php b/src/Files/FileUploadResponse.php index 3fd7524b..8a17bf71 100644 --- a/src/Files/FileUploadResponse.php +++ b/src/Files/FileUploadResponse.php @@ -17,7 +17,7 @@ /** * Object containing details of a successful upload. * - * @phpstan-type file_upload_response = array{ + * @phpstan-type FileUploadResponseShape = array{ * aiTags?: list|null, * audioCodec?: string, * bitRate?: int, @@ -47,7 +47,7 @@ */ final class FileUploadResponse implements BaseModel, ResponseConverter { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkResponse; diff --git a/src/Files/FileUploadResponse/AITag.php b/src/Files/FileUploadResponse/AITag.php index 1b0ed295..bc0031ca 100644 --- a/src/Files/FileUploadResponse/AITag.php +++ b/src/Files/FileUploadResponse/AITag.php @@ -9,11 +9,13 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type ai_tag = array{confidence?: float, name?: string, source?: string} + * @phpstan-type AITagShape = array{ + * confidence?: float, name?: string, source?: string + * } */ final class AITag implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Files/FileUploadResponse/ExtensionStatus.php b/src/Files/FileUploadResponse/ExtensionStatus.php index 48fedaaf..a1921bed 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Files/FileUploadResponse/ExtensionStatus.php @@ -21,7 +21,7 @@ * * If no extension was requested, then this parameter is not returned. * - * @phpstan-type extension_status = array{ + * @phpstan-type ExtensionStatusShape = array{ * aiAutoDescription?: value-of, * awsAutoTagging?: value-of, * googleAutoTagging?: value-of, @@ -30,7 +30,7 @@ */ final class ExtensionStatus implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @var value-of|null $aiAutoDescription */ diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema.php b/src/Files/FileUploadResponse/SelectedFieldsSchema.php index dbc8ea01..cdca21f7 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema.php @@ -12,7 +12,7 @@ use ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\Type; /** - * @phpstan-type selected_fields_schema = array{ + * @phpstan-type SelectedFieldsSchemaShape = array{ * type: value-of, * defaultValue?: string|float|bool|list, * isValueRequired?: bool, @@ -27,7 +27,7 @@ */ final class SelectedFieldsSchema implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Files/FileUploadResponse/VersionInfo.php b/src/Files/FileUploadResponse/VersionInfo.php index 2cac6409..80b94f01 100644 --- a/src/Files/FileUploadResponse/VersionInfo.php +++ b/src/Files/FileUploadResponse/VersionInfo.php @@ -11,11 +11,11 @@ /** * An object containing the file or file version's `id` (versionId) and `name`. * - * @phpstan-type version_info = array{id?: string, name?: string} + * @phpstan-type VersionInfoShape = array{id?: string, name?: string} */ final class VersionInfo implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Files/Folder.php b/src/Files/Folder.php index 1da766ce..888e85ef 100644 --- a/src/Files/Folder.php +++ b/src/Files/Folder.php @@ -10,7 +10,7 @@ use ImageKit\Files\Folder\Type; /** - * @phpstan-type folder_alias = array{ + * @phpstan-type FolderShape = array{ * createdAt?: \DateTimeInterface, * folderID?: string, * folderPath?: string, @@ -21,7 +21,7 @@ */ final class Folder implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Files/Metadata.php b/src/Files/Metadata.php index b8e41f1b..543ecf53 100644 --- a/src/Files/Metadata.php +++ b/src/Files/Metadata.php @@ -12,7 +12,7 @@ /** * JSON object containing metadata. * - * @phpstan-type metadata_alias = array{ + * @phpstan-type MetadataShape = array{ * audioCodec?: string, * bitRate?: int, * density?: int, @@ -31,7 +31,7 @@ */ final class Metadata implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Files/Metadata/Exif.php b/src/Files/Metadata/Exif.php index be246a81..7cf1d11a 100644 --- a/src/Files/Metadata/Exif.php +++ b/src/Files/Metadata/Exif.php @@ -13,7 +13,7 @@ use ImageKit\Files\Metadata\Exif\Thumbnail; /** - * @phpstan-type exif_alias = array{ + * @phpstan-type ExifShape = array{ * exif?: \ImageKit\Files\Metadata\Exif\Exif, * gps?: Gps, * image?: Image, @@ -24,7 +24,7 @@ */ final class Exif implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Files/Metadata/Exif/Exif.php b/src/Files/Metadata/Exif/Exif.php index a722094e..4faaad12 100644 --- a/src/Files/Metadata/Exif/Exif.php +++ b/src/Files/Metadata/Exif/Exif.php @@ -11,7 +11,7 @@ /** * Object containing Exif details. * - * @phpstan-type exif_alias = array{ + * @phpstan-type ExifShape = array{ * apertureValue?: float, * colorSpace?: int, * createDate?: string, @@ -42,7 +42,7 @@ */ final class Exif implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api('ApertureValue', optional: true)] diff --git a/src/Files/Metadata/Exif/Gps.php b/src/Files/Metadata/Exif/Gps.php index b7504be0..3334ba17 100644 --- a/src/Files/Metadata/Exif/Gps.php +++ b/src/Files/Metadata/Exif/Gps.php @@ -11,11 +11,11 @@ /** * Object containing GPS information. * - * @phpstan-type gps_alias = array{gpsVersionID?: list} + * @phpstan-type GpsShape = array{gpsVersionID?: list} */ final class Gps implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @var list|null $gpsVersionID */ diff --git a/src/Files/Metadata/Exif/Image.php b/src/Files/Metadata/Exif/Image.php index 08c520ff..0d24a8eb 100644 --- a/src/Files/Metadata/Exif/Image.php +++ b/src/Files/Metadata/Exif/Image.php @@ -11,7 +11,7 @@ /** * Object containing EXIF image information. * - * @phpstan-type image_alias = array{ + * @phpstan-type ImageShape = array{ * exifOffset?: int, * gpsInfo?: int, * make?: string, @@ -27,7 +27,7 @@ */ final class Image implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api('ExifOffset', optional: true)] diff --git a/src/Files/Metadata/Exif/Interoperability.php b/src/Files/Metadata/Exif/Interoperability.php index bc7b65f2..42cfe84f 100644 --- a/src/Files/Metadata/Exif/Interoperability.php +++ b/src/Files/Metadata/Exif/Interoperability.php @@ -11,13 +11,13 @@ /** * JSON object. * - * @phpstan-type interoperability_alias = array{ + * @phpstan-type InteroperabilityShape = array{ * interopIndex?: string, interopVersion?: string * } */ final class Interoperability implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api('InteropIndex', optional: true)] diff --git a/src/Files/Metadata/Exif/Thumbnail.php b/src/Files/Metadata/Exif/Thumbnail.php index 886948fd..1184f03e 100644 --- a/src/Files/Metadata/Exif/Thumbnail.php +++ b/src/Files/Metadata/Exif/Thumbnail.php @@ -11,7 +11,7 @@ /** * Object containing Thumbnail information. * - * @phpstan-type thumbnail_alias = array{ + * @phpstan-type ThumbnailShape = array{ * compression?: int, * resolutionUnit?: int, * thumbnailLength?: int, @@ -22,7 +22,7 @@ */ final class Thumbnail implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api('Compression', optional: true)] diff --git a/src/Files/Metadata/MetadataGetFromURLParams.php b/src/Files/Metadata/MetadataGetFromURLParams.php index d56164d9..db5defa0 100644 --- a/src/Files/Metadata/MetadataGetFromURLParams.php +++ b/src/Files/Metadata/MetadataGetFromURLParams.php @@ -14,11 +14,11 @@ * * @see ImageKit\Files\Metadata->getFromURL * - * @phpstan-type metadata_get_from_url_params = array{url: string} + * @phpstan-type MetadataGetFromURLParamsShape = array{url: string} */ final class MetadataGetFromURLParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Files/UpdateFileRequest/ChangePublicationStatus.php b/src/Files/UpdateFileRequest/ChangePublicationStatus.php index b111e254..aaabfb8f 100644 --- a/src/Files/UpdateFileRequest/ChangePublicationStatus.php +++ b/src/Files/UpdateFileRequest/ChangePublicationStatus.php @@ -10,11 +10,11 @@ use ImageKit\Files\UpdateFileRequest\ChangePublicationStatus\Publish; /** - * @phpstan-type change_publication_status = array{publish?: Publish} + * @phpstan-type ChangePublicationStatusShape = array{publish?: Publish} */ final class ChangePublicationStatus implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php b/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php index d7800eab..061c9989 100644 --- a/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php +++ b/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php @@ -11,13 +11,13 @@ /** * Configure the publication status of a file and its versions. * - * @phpstan-type publish_alias = array{ + * @phpstan-type PublishShape = array{ * isPublished: bool, includeFileVersions?: bool * } */ final class Publish implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Files/UpdateFileRequest/UpdateFileDetails.php b/src/Files/UpdateFileRequest/UpdateFileDetails.php index 1e21fff2..22bc2ee1 100644 --- a/src/Files/UpdateFileRequest/UpdateFileDetails.php +++ b/src/Files/UpdateFileRequest/UpdateFileDetails.php @@ -14,7 +14,7 @@ use ImageKit\Files\UpdateFileRequest\UpdateFileDetails\RemoveAITags; /** - * @phpstan-type update_file_details = array{ + * @phpstan-type UpdateFileDetailsShape = array{ * customCoordinates?: string|null, * customMetadata?: array, * description?: string, @@ -26,7 +26,7 @@ */ final class UpdateFileDetails implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Files/Versions/VersionDeleteParams.php b/src/Files/Versions/VersionDeleteParams.php index a5c99a18..102b2fae 100644 --- a/src/Files/Versions/VersionDeleteParams.php +++ b/src/Files/Versions/VersionDeleteParams.php @@ -16,11 +16,11 @@ * * @see ImageKit\Files\Versions->delete * - * @phpstan-type version_delete_params = array{fileID: string} + * @phpstan-type VersionDeleteParamsShape = array{fileID: string} */ final class VersionDeleteParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Files/Versions/VersionDeleteResponse.php b/src/Files/Versions/VersionDeleteResponse.php index 93a1ca29..d17bd8e6 100644 --- a/src/Files/Versions/VersionDeleteResponse.php +++ b/src/Files/Versions/VersionDeleteResponse.php @@ -10,11 +10,11 @@ use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** - * @phpstan-type version_delete_response = array{} + * @phpstan-type VersionDeleteResponseShape = array{} */ final class VersionDeleteResponse implements BaseModel, ResponseConverter { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkResponse; diff --git a/src/Files/Versions/VersionGetParams.php b/src/Files/Versions/VersionGetParams.php index e6d9ac37..06548974 100644 --- a/src/Files/Versions/VersionGetParams.php +++ b/src/Files/Versions/VersionGetParams.php @@ -14,11 +14,11 @@ * * @see ImageKit\Files\Versions->get * - * @phpstan-type version_get_params = array{fileID: string} + * @phpstan-type VersionGetParamsShape = array{fileID: string} */ final class VersionGetParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Files/Versions/VersionRestoreParams.php b/src/Files/Versions/VersionRestoreParams.php index e1deb729..b5e0b415 100644 --- a/src/Files/Versions/VersionRestoreParams.php +++ b/src/Files/Versions/VersionRestoreParams.php @@ -14,11 +14,11 @@ * * @see ImageKit\Files\Versions->restore * - * @phpstan-type version_restore_params = array{fileID: string} + * @phpstan-type VersionRestoreParamsShape = array{fileID: string} */ final class VersionRestoreParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Folders/FolderCopyParams.php b/src/Folders/FolderCopyParams.php index c70ebbac..fa5e5196 100644 --- a/src/Folders/FolderCopyParams.php +++ b/src/Folders/FolderCopyParams.php @@ -14,13 +14,13 @@ * * @see ImageKit\Folders->copy * - * @phpstan-type folder_copy_params = array{ + * @phpstan-type FolderCopyParamsShape = array{ * destinationPath: string, sourceFolderPath: string, includeVersions?: bool * } */ final class FolderCopyParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Folders/FolderCopyResponse.php b/src/Folders/FolderCopyResponse.php index 35b74345..5b512cb1 100644 --- a/src/Folders/FolderCopyResponse.php +++ b/src/Folders/FolderCopyResponse.php @@ -13,11 +13,11 @@ /** * Job submitted successfully. A `jobId` will be returned. * - * @phpstan-type folder_copy_response = array{jobID: string} + * @phpstan-type FolderCopyResponseShape = array{jobID: string} */ final class FolderCopyResponse implements BaseModel, ResponseConverter { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkResponse; diff --git a/src/Folders/FolderCreateParams.php b/src/Folders/FolderCreateParams.php index 7698adae..93d8c6b5 100644 --- a/src/Folders/FolderCreateParams.php +++ b/src/Folders/FolderCreateParams.php @@ -14,13 +14,13 @@ * * @see ImageKit\Folders->create * - * @phpstan-type folder_create_params = array{ + * @phpstan-type FolderCreateParamsShape = array{ * folderName: string, parentFolderPath: string * } */ final class FolderCreateParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Folders/FolderDeleteParams.php b/src/Folders/FolderDeleteParams.php index 0af429b0..f1eaa2c1 100644 --- a/src/Folders/FolderDeleteParams.php +++ b/src/Folders/FolderDeleteParams.php @@ -14,11 +14,11 @@ * * @see ImageKit\Folders->delete * - * @phpstan-type folder_delete_params = array{folderPath: string} + * @phpstan-type FolderDeleteParamsShape = array{folderPath: string} */ final class FolderDeleteParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Folders/FolderDeleteResponse.php b/src/Folders/FolderDeleteResponse.php index c90bd569..537b0dd1 100644 --- a/src/Folders/FolderDeleteResponse.php +++ b/src/Folders/FolderDeleteResponse.php @@ -10,11 +10,11 @@ use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** - * @phpstan-type folder_delete_response = array{} + * @phpstan-type FolderDeleteResponseShape = array{} */ final class FolderDeleteResponse implements BaseModel, ResponseConverter { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkResponse; diff --git a/src/Folders/FolderMoveParams.php b/src/Folders/FolderMoveParams.php index f04be7df..761b433e 100644 --- a/src/Folders/FolderMoveParams.php +++ b/src/Folders/FolderMoveParams.php @@ -14,13 +14,13 @@ * * @see ImageKit\Folders->move * - * @phpstan-type folder_move_params = array{ + * @phpstan-type FolderMoveParamsShape = array{ * destinationPath: string, sourceFolderPath: string * } */ final class FolderMoveParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Folders/FolderMoveResponse.php b/src/Folders/FolderMoveResponse.php index c3901864..103ae1a6 100644 --- a/src/Folders/FolderMoveResponse.php +++ b/src/Folders/FolderMoveResponse.php @@ -13,11 +13,11 @@ /** * Job submitted successfully. A `jobId` will be returned. * - * @phpstan-type folder_move_response = array{jobID: string} + * @phpstan-type FolderMoveResponseShape = array{jobID: string} */ final class FolderMoveResponse implements BaseModel, ResponseConverter { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkResponse; diff --git a/src/Folders/FolderNewResponse.php b/src/Folders/FolderNewResponse.php index d077c702..02f8940a 100644 --- a/src/Folders/FolderNewResponse.php +++ b/src/Folders/FolderNewResponse.php @@ -10,11 +10,11 @@ use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** - * @phpstan-type folder_new_response = array{} + * @phpstan-type FolderNewResponseShape = array{} */ final class FolderNewResponse implements BaseModel, ResponseConverter { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkResponse; diff --git a/src/Folders/FolderRenameParams.php b/src/Folders/FolderRenameParams.php index e7260993..795485b5 100644 --- a/src/Folders/FolderRenameParams.php +++ b/src/Folders/FolderRenameParams.php @@ -14,13 +14,13 @@ * * @see ImageKit\Folders->rename * - * @phpstan-type folder_rename_params = array{ + * @phpstan-type FolderRenameParamsShape = array{ * folderPath: string, newFolderName: string, purgeCache?: bool * } */ final class FolderRenameParams implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkParams; diff --git a/src/Folders/FolderRenameResponse.php b/src/Folders/FolderRenameResponse.php index e1b3b5b5..c1de8b8f 100644 --- a/src/Folders/FolderRenameResponse.php +++ b/src/Folders/FolderRenameResponse.php @@ -13,11 +13,11 @@ /** * Job submitted successfully. A `jobId` will be returned. * - * @phpstan-type folder_rename_response = array{jobID: string} + * @phpstan-type FolderRenameResponseShape = array{jobID: string} */ final class FolderRenameResponse implements BaseModel, ResponseConverter { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkResponse; diff --git a/src/Folders/Job/JobGetResponse.php b/src/Folders/Job/JobGetResponse.php index d8734c35..54c94dd9 100644 --- a/src/Folders/Job/JobGetResponse.php +++ b/src/Folders/Job/JobGetResponse.php @@ -13,7 +13,7 @@ use ImageKit\Folders\Job\JobGetResponse\Type; /** - * @phpstan-type job_get_response = array{ + * @phpstan-type JobGetResponseShape = array{ * jobID?: string, * purgeRequestID?: string, * status?: value-of, @@ -22,7 +22,7 @@ */ final class JobGetResponse implements BaseModel, ResponseConverter { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; use SdkResponse; diff --git a/src/GetImageAttributesOptions.php b/src/GetImageAttributesOptions.php index c3c2f305..0c4b68fa 100644 --- a/src/GetImageAttributesOptions.php +++ b/src/GetImageAttributesOptions.php @@ -12,7 +12,7 @@ * Options for generating responsive image attributes including `src`, `srcSet`, and `sizes` for HTML `` elements. * This schema extends `SrcOptions` to add support for responsive image generation with breakpoints. * - * @phpstan-type get_image_attributes_options = array{ + * @phpstan-type GetImageAttributesOptionsShape = array{ * src: string, * urlEndpoint: string, * expiresIn?: float, @@ -28,7 +28,7 @@ */ final class GetImageAttributesOptions implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/ImageOverlay.php b/src/ImageOverlay.php index fca71985..607c6be1 100644 --- a/src/ImageOverlay.php +++ b/src/ImageOverlay.php @@ -10,7 +10,7 @@ use ImageKit\ImageOverlay\Encoding; /** - * @phpstan-type image_overlay = array{ + * @phpstan-type ImageOverlayShape = array{ * position?: OverlayPosition, * timing?: OverlayTiming, * input: string, @@ -21,7 +21,7 @@ */ final class ImageOverlay implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/OverlayPosition.php b/src/OverlayPosition.php index 2ae7a57e..a3baf874 100644 --- a/src/OverlayPosition.php +++ b/src/OverlayPosition.php @@ -10,13 +10,13 @@ use ImageKit\OverlayPosition\Focus; /** - * @phpstan-type overlay_position = array{ + * @phpstan-type OverlayPositionShape = array{ * focus?: value-of, x?: float|string, y?: float|string * } */ final class OverlayPosition implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/OverlayTiming.php b/src/OverlayTiming.php index 3a0bc5d4..57d3c408 100644 --- a/src/OverlayTiming.php +++ b/src/OverlayTiming.php @@ -9,13 +9,13 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type overlay_timing = array{ + * @phpstan-type OverlayTimingShape = array{ * duration?: float|string, end?: float|string, start?: float|string * } */ final class OverlayTiming implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/ResponsiveImageAttributes.php b/src/ResponsiveImageAttributes.php index f2aaa8ba..caabfc6c 100644 --- a/src/ResponsiveImageAttributes.php +++ b/src/ResponsiveImageAttributes.php @@ -12,13 +12,13 @@ * Resulting set of attributes suitable for an HTML `` element. * Useful for enabling responsive image loading with `srcSet` and `sizes`. * - * @phpstan-type responsive_image_attributes = array{ + * @phpstan-type ResponsiveImageAttributesShape = array{ * src: string, sizes?: string, srcSet?: string, width?: float * } */ final class ResponsiveImageAttributes implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/SolidColorOverlay.php b/src/SolidColorOverlay.php index 4d70d94b..ac11dae9 100644 --- a/src/SolidColorOverlay.php +++ b/src/SolidColorOverlay.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type solid_color_overlay = array{ + * @phpstan-type SolidColorOverlayShape = array{ * position?: OverlayPosition, * timing?: OverlayTiming, * color: string, @@ -19,7 +19,7 @@ */ final class SolidColorOverlay implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/SolidColorOverlayTransformation.php b/src/SolidColorOverlayTransformation.php index 98bd2814..4ca7703f 100644 --- a/src/SolidColorOverlayTransformation.php +++ b/src/SolidColorOverlayTransformation.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type solid_color_overlay_transformation = array{ + * @phpstan-type SolidColorOverlayTransformationShape = array{ * alpha?: float, * background?: string, * gradient?: bool|string, @@ -20,7 +20,7 @@ */ final class SolidColorOverlayTransformation implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/SrcOptions.php b/src/SrcOptions.php index 3f953c76..9e935024 100644 --- a/src/SrcOptions.php +++ b/src/SrcOptions.php @@ -11,7 +11,7 @@ /** * Options for generating ImageKit URLs with transformations. See the [Transformations guide](https://imagekit.io/docs/transformations). * - * @phpstan-type src_options = array{ + * @phpstan-type SrcOptionsShape = array{ * src: string, * urlEndpoint: string, * expiresIn?: float, @@ -23,7 +23,7 @@ */ final class SrcOptions implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/SubtitleOverlay.php b/src/SubtitleOverlay.php index 960feb58..f35111af 100644 --- a/src/SubtitleOverlay.php +++ b/src/SubtitleOverlay.php @@ -10,7 +10,7 @@ use ImageKit\SubtitleOverlay\Encoding; /** - * @phpstan-type subtitle_overlay = array{ + * @phpstan-type SubtitleOverlayShape = array{ * position?: OverlayPosition, * timing?: OverlayTiming, * input: string, @@ -21,7 +21,7 @@ */ final class SubtitleOverlay implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/SubtitleOverlayTransformation.php b/src/SubtitleOverlayTransformation.php index 2e7529d5..96ed629f 100644 --- a/src/SubtitleOverlayTransformation.php +++ b/src/SubtitleOverlayTransformation.php @@ -12,7 +12,7 @@ /** * Subtitle styling options. [Learn more](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) from the docs. * - * @phpstan-type subtitle_overlay_transformation = array{ + * @phpstan-type SubtitleOverlayTransformationShape = array{ * background?: string, * color?: string, * fontFamily?: string, @@ -24,7 +24,7 @@ */ final class SubtitleOverlayTransformation implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/TextOverlay.php b/src/TextOverlay.php index c1f7ad54..b9bb4f7d 100644 --- a/src/TextOverlay.php +++ b/src/TextOverlay.php @@ -10,7 +10,7 @@ use ImageKit\TextOverlay\Encoding; /** - * @phpstan-type text_overlay = array{ + * @phpstan-type TextOverlayShape = array{ * position?: OverlayPosition, * timing?: OverlayTiming, * text: string, @@ -21,7 +21,7 @@ */ final class TextOverlay implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/TextOverlayTransformation.php b/src/TextOverlayTransformation.php index 6c68ca89..9b983150 100644 --- a/src/TextOverlayTransformation.php +++ b/src/TextOverlayTransformation.php @@ -11,7 +11,7 @@ use ImageKit\TextOverlayTransformation\InnerAlignment; /** - * @phpstan-type text_overlay_transformation = array{ + * @phpstan-type TextOverlayTransformationShape = array{ * alpha?: float, * background?: string, * flip?: value-of, @@ -29,7 +29,7 @@ */ final class TextOverlayTransformation implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Transformation.php b/src/Transformation.php index 68b3bceb..f315da99 100644 --- a/src/Transformation.php +++ b/src/Transformation.php @@ -20,7 +20,7 @@ * You can use the `raw` parameter to pass the transformation string directly. * See the [Transformations documentation](https://imagekit.io/docs/transformations). * - * @phpstan-type transformation_alias = array{ + * @phpstan-type TransformationShape = array{ * aiChangeBackground?: string, * aiDropShadow?: bool|string, * aiEdit?: string, @@ -77,7 +77,7 @@ */ final class Transformation implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/VideoOverlay.php b/src/VideoOverlay.php index c4be1cc2..5e9ceebf 100644 --- a/src/VideoOverlay.php +++ b/src/VideoOverlay.php @@ -10,7 +10,7 @@ use ImageKit\VideoOverlay\Encoding; /** - * @phpstan-type video_overlay = array{ + * @phpstan-type VideoOverlayShape = array{ * position?: OverlayPosition, * timing?: OverlayTiming, * input: string, @@ -21,7 +21,7 @@ */ final class VideoOverlay implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Webhooks/BaseWebhookEvent.php b/src/Webhooks/BaseWebhookEvent.php index b5b8aa22..42cc512c 100644 --- a/src/Webhooks/BaseWebhookEvent.php +++ b/src/Webhooks/BaseWebhookEvent.php @@ -9,11 +9,11 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type base_webhook_event = array{id: string, type: string} + * @phpstan-type BaseWebhookEventShape = array{id: string, type: string} */ final class BaseWebhookEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/UploadPostTransformErrorEvent.php b/src/Webhooks/UploadPostTransformErrorEvent.php index 8dfee4f0..cff5dbd2 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent.php +++ b/src/Webhooks/UploadPostTransformErrorEvent.php @@ -13,7 +13,7 @@ /** * Triggered when a post-transformation fails. The original file remains available, but the requested transformation could not be generated. * - * @phpstan-type upload_post_transform_error_event = array{ + * @phpstan-type UploadPostTransformErrorEventShape = array{ * id: string, * type: string, * createdAt: \DateTimeInterface, @@ -23,7 +23,7 @@ */ final class UploadPostTransformErrorEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data.php b/src/Webhooks/UploadPostTransformErrorEvent/Data.php index 8c1dc160..aeee7af3 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Data.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data.php @@ -10,7 +10,7 @@ use ImageKit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation; /** - * @phpstan-type data_alias = array{ + * @phpstan-type DataShape = array{ * fileID: string, * name: string, * path: string, @@ -20,7 +20,7 @@ */ final class Data implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php index 7c789a94..236638dd 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php @@ -10,11 +10,11 @@ use ImageKit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation\Error; /** - * @phpstan-type transformation_alias = array{error: Error} + * @phpstan-type TransformationShape = array{error: Error} */ final class Transformation implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php index 513fbcb2..acd1bd95 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php @@ -9,11 +9,11 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type error_alias = array{reason: string} + * @phpstan-type ErrorShape = array{reason: string} */ final class Error implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request.php b/src/Webhooks/UploadPostTransformErrorEvent/Request.php index 77b43cf4..14fefb80 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request.php @@ -10,13 +10,13 @@ use ImageKit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation; /** - * @phpstan-type request_alias = array{ + * @phpstan-type RequestShape = array{ * transformation: Transformation, xRequestID: string * } */ final class Request implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php index 669bcf85..af4ce75b 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php @@ -11,13 +11,13 @@ use ImageKit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation\Type; /** - * @phpstan-type transformation_alias = array{ + * @phpstan-type TransformationShape = array{ * type: value-of, protocol?: value-of, value?: string * } */ final class Transformation implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/UploadPostTransformSuccessEvent.php b/src/Webhooks/UploadPostTransformSuccessEvent.php index fdbcb0ae..49c55f8c 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent.php @@ -13,7 +13,7 @@ /** * Triggered when a post-transformation completes successfully. The transformed version of the file is now ready and can be accessed via the provided URL. Note that each post-transformation generates a separate webhook event. * - * @phpstan-type upload_post_transform_success_event = array{ + * @phpstan-type UploadPostTransformSuccessEventShape = array{ * id: string, * type: string, * createdAt: \DateTimeInterface, @@ -23,7 +23,7 @@ */ final class UploadPostTransformSuccessEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Data.php b/src/Webhooks/UploadPostTransformSuccessEvent/Data.php index 6b68558c..511fbb1a 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Data.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Data.php @@ -9,11 +9,11 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type data_alias = array{fileID: string, name: string, url: string} + * @phpstan-type DataShape = array{fileID: string, name: string, url: string} */ final class Data implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request.php index be526a86..d06e8ea1 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request.php @@ -10,13 +10,13 @@ use ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation; /** - * @phpstan-type request_alias = array{ + * @phpstan-type RequestShape = array{ * transformation: Transformation, xRequestID: string * } */ final class Request implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php index 63765b7a..6cd1d5d2 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php @@ -11,13 +11,13 @@ use ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation\Type; /** - * @phpstan-type transformation_alias = array{ + * @phpstan-type TransformationShape = array{ * type: value-of, protocol?: value-of, value?: string * } */ final class Transformation implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/UploadPreTransformErrorEvent.php b/src/Webhooks/UploadPreTransformErrorEvent.php index b509717b..29e81023 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent.php +++ b/src/Webhooks/UploadPreTransformErrorEvent.php @@ -13,7 +13,7 @@ /** * Triggered when a pre-transformation fails. The file upload may have been accepted, but the requested transformation could not be applied. * - * @phpstan-type upload_pre_transform_error_event = array{ + * @phpstan-type UploadPreTransformErrorEventShape = array{ * id: string, * type: string, * createdAt: \DateTimeInterface, @@ -23,7 +23,7 @@ */ final class UploadPreTransformErrorEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data.php b/src/Webhooks/UploadPreTransformErrorEvent/Data.php index b502228e..4916c375 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Data.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data.php @@ -10,13 +10,13 @@ use ImageKit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation; /** - * @phpstan-type data_alias = array{ + * @phpstan-type DataShape = array{ * name: string, path: string, transformation: Transformation * } */ final class Data implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php index 58bcc84a..222a7f92 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php @@ -10,11 +10,11 @@ use ImageKit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation\Error; /** - * @phpstan-type transformation_alias = array{error: Error} + * @phpstan-type TransformationShape = array{error: Error} */ final class Transformation implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Api] diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php index cd34d2a7..546a3ec9 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php @@ -9,11 +9,11 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type error_alias = array{reason: string} + * @phpstan-type ErrorShape = array{reason: string} */ final class Error implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Request.php b/src/Webhooks/UploadPreTransformErrorEvent/Request.php index 30288322..f5025066 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Request.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Request.php @@ -9,11 +9,11 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type request_alias = array{transformation: string, xRequestID: string} + * @phpstan-type RequestShape = array{transformation: string, xRequestID: string} */ final class Request implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/UploadPreTransformSuccessEvent.php b/src/Webhooks/UploadPreTransformSuccessEvent.php index 3838957b..9cc13467 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent.php @@ -13,7 +13,7 @@ /** * Triggered when a pre-transformation completes successfully. The file has been processed with the requested transformation and is now available in the Media Library. * - * @phpstan-type upload_pre_transform_success_event = array{ + * @phpstan-type UploadPreTransformSuccessEventShape = array{ * id: string, * type: string, * createdAt: \DateTimeInterface, @@ -23,7 +23,7 @@ */ final class UploadPreTransformSuccessEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php index 2c72d94d..3e81ebda 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php @@ -16,7 +16,7 @@ /** * Object containing details of a successful upload. * - * @phpstan-type data_alias = array{ + * @phpstan-type DataShape = array{ * aiTags?: list|null, * audioCodec?: string, * bitRate?: int, @@ -46,7 +46,7 @@ */ final class Data implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php index 502fbddc..428704a5 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php @@ -9,11 +9,13 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type ai_tag = array{confidence?: float, name?: string, source?: string} + * @phpstan-type AITagShape = array{ + * confidence?: float, name?: string, source?: string + * } */ final class AITag implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php index 0473011b..25cb2506 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php @@ -21,7 +21,7 @@ * * If no extension was requested, then this parameter is not returned. * - * @phpstan-type extension_status = array{ + * @phpstan-type ExtensionStatusShape = array{ * aiAutoDescription?: value-of, * awsAutoTagging?: value-of, * googleAutoTagging?: value-of, @@ -30,7 +30,7 @@ */ final class ExtensionStatus implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @var value-of|null $aiAutoDescription */ diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php index e8dfeced..4d970ad3 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php @@ -12,7 +12,7 @@ use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\Type; /** - * @phpstan-type selected_fields_schema = array{ + * @phpstan-type SelectedFieldsSchemaShape = array{ * type: value-of, * defaultValue?: string|float|bool|list, * isValueRequired?: bool, @@ -27,7 +27,7 @@ */ final class SelectedFieldsSchema implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php index eef154fc..4fc58454 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php @@ -11,11 +11,11 @@ /** * An object containing the file or file version's `id` (versionId) and `name`. * - * @phpstan-type version_info = array{id?: string, name?: string} + * @phpstan-type VersionInfoShape = array{id?: string, name?: string} */ final class VersionInfo implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Request.php b/src/Webhooks/UploadPreTransformSuccessEvent/Request.php index 8071e5bd..0f3404b2 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Request.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Request.php @@ -9,11 +9,11 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type request_alias = array{transformation: string, xRequestID: string} + * @phpstan-type RequestShape = array{transformation: string, xRequestID: string} */ final class Request implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/VideoTransformationAcceptedEvent.php b/src/Webhooks/VideoTransformationAcceptedEvent.php index c0c92749..725574f9 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent.php @@ -13,7 +13,7 @@ /** * Triggered when a new video transformation request is accepted for processing. This event confirms that ImageKit has received and queued your transformation request. Use this for debugging and tracking transformation lifecycle. * - * @phpstan-type video_transformation_accepted_event = array{ + * @phpstan-type VideoTransformationAcceptedEventShape = array{ * id: string, * type: string, * createdAt: \DateTimeInterface, @@ -23,7 +23,7 @@ */ final class VideoTransformationAcceptedEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data.php index bc3d56ce..199e8599 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data.php @@ -11,11 +11,11 @@ use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation; /** - * @phpstan-type data_alias = array{asset: Asset, transformation: Transformation} + * @phpstan-type DataShape = array{asset: Asset, transformation: Transformation} */ final class Data implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php index 8f471cdb..c1994f58 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php @@ -11,11 +11,11 @@ /** * Information about the source video asset being transformed. * - * @phpstan-type asset_alias = array{url: string} + * @phpstan-type AssetShape = array{url: string} */ final class Asset implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php index 17a511f8..8b4a2d1e 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php @@ -13,13 +13,13 @@ /** * Base information about a video transformation request. * - * @phpstan-type transformation_alias = array{ + * @phpstan-type TransformationShape = array{ * type: value-of, options?: Options * } */ final class Transformation implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php index 8603e92e..4a982e93 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php @@ -15,7 +15,7 @@ /** * Configuration options for video transformations. * - * @phpstan-type options_alias = array{ + * @phpstan-type OptionsShape = array{ * audioCodec?: value-of, * autoRotate?: bool, * format?: value-of, @@ -27,7 +27,7 @@ */ final class Options implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Request.php b/src/Webhooks/VideoTransformationAcceptedEvent/Request.php index 122bc3fe..f8e2a238 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Request.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Request.php @@ -11,13 +11,13 @@ /** * Information about the original request that triggered the video transformation. * - * @phpstan-type request_alias = array{ + * @phpstan-type RequestShape = array{ * url: string, xRequestID: string, userAgent?: string * } */ final class Request implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/VideoTransformationErrorEvent.php b/src/Webhooks/VideoTransformationErrorEvent.php index 4bc6a3ae..b1a4934f 100644 --- a/src/Webhooks/VideoTransformationErrorEvent.php +++ b/src/Webhooks/VideoTransformationErrorEvent.php @@ -13,7 +13,7 @@ /** * Triggered when an error occurs during video encoding. Listen to this webhook to log error reasons and debug issues. Check your origin and URL endpoint settings if the reason is related to download failure. For other errors, contact ImageKit support. * - * @phpstan-type video_transformation_error_event = array{ + * @phpstan-type VideoTransformationErrorEventShape = array{ * id: string, * type: string, * createdAt: \DateTimeInterface, @@ -23,7 +23,7 @@ */ final class VideoTransformationErrorEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data.php b/src/Webhooks/VideoTransformationErrorEvent/Data.php index 20fabdc8..351b0c01 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data.php @@ -11,11 +11,11 @@ use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; /** - * @phpstan-type data_alias = array{asset: Asset, transformation: Transformation} + * @phpstan-type DataShape = array{asset: Asset, transformation: Transformation} */ final class Data implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php index 7a282f1d..cca52134 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php @@ -11,11 +11,11 @@ /** * Information about the source video asset being transformed. * - * @phpstan-type asset_alias = array{url: string} + * @phpstan-type AssetShape = array{url: string} */ final class Asset implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php index 694ba72c..97e70b5f 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php @@ -12,13 +12,13 @@ use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Type; /** - * @phpstan-type transformation_alias = array{ + * @phpstan-type TransformationShape = array{ * type: value-of, error?: Error, options?: Options * } */ final class Transformation implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php index c405bd5f..74fd89a3 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php @@ -12,11 +12,11 @@ /** * Details about the transformation error. * - * @phpstan-type error_alias = array{reason: value-of} + * @phpstan-type ErrorShape = array{reason: value-of} */ final class Error implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php index 15a007b7..f2621301 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php @@ -15,7 +15,7 @@ /** * Configuration options for video transformations. * - * @phpstan-type options_alias = array{ + * @phpstan-type OptionsShape = array{ * audioCodec?: value-of, * autoRotate?: bool, * format?: value-of, @@ -27,7 +27,7 @@ */ final class Options implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/VideoTransformationErrorEvent/Request.php b/src/Webhooks/VideoTransformationErrorEvent/Request.php index 39fa8314..9a4d9fdd 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Request.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Request.php @@ -11,13 +11,13 @@ /** * Information about the original request that triggered the video transformation. * - * @phpstan-type request_alias = array{ + * @phpstan-type RequestShape = array{ * url: string, xRequestID: string, userAgent?: string * } */ final class Request implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/VideoTransformationReadyEvent.php b/src/Webhooks/VideoTransformationReadyEvent.php index 25a0dc12..4a1cf3c0 100644 --- a/src/Webhooks/VideoTransformationReadyEvent.php +++ b/src/Webhooks/VideoTransformationReadyEvent.php @@ -14,7 +14,7 @@ /** * Triggered when video encoding is finished and the transformed resource is ready to be served. This is the key event to listen for - update your database or CMS flags when you receive this so your application can start showing the transformed video to users. * - * @phpstan-type video_transformation_ready_event = array{ + * @phpstan-type VideoTransformationReadyEventShape = array{ * id: string, * type: string, * createdAt: \DateTimeInterface, @@ -25,7 +25,7 @@ */ final class VideoTransformationReadyEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data.php b/src/Webhooks/VideoTransformationReadyEvent/Data.php index 3950a1ab..e2d65b11 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data.php @@ -11,11 +11,11 @@ use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; /** - * @phpstan-type data_alias = array{asset: Asset, transformation: Transformation} + * @phpstan-type DataShape = array{asset: Asset, transformation: Transformation} */ final class Data implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php index ae5d9570..5e4c59b3 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php @@ -11,11 +11,11 @@ /** * Information about the source video asset being transformed. * - * @phpstan-type asset_alias = array{url: string} + * @phpstan-type AssetShape = array{url: string} */ final class Asset implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php index b98b15b4..63e007a7 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php @@ -12,13 +12,13 @@ use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Type; /** - * @phpstan-type transformation_alias = array{ + * @phpstan-type TransformationShape = array{ * type: value-of, options?: Options, output?: Output * } */ final class Transformation implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php index 146dc65b..70116837 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php @@ -15,7 +15,7 @@ /** * Configuration options for video transformations. * - * @phpstan-type options_alias = array{ + * @phpstan-type OptionsShape = array{ * audioCodec?: value-of, * autoRotate?: bool, * format?: value-of, @@ -27,7 +27,7 @@ */ final class Options implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php index 83a5d424..4c58dcd2 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php @@ -12,11 +12,11 @@ /** * Information about the transformed output video. * - * @phpstan-type output_alias = array{url: string, videoMetadata?: VideoMetadata} + * @phpstan-type OutputShape = array{url: string, videoMetadata?: VideoMetadata} */ final class Output implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php index 7b8233e6..663b6aaa 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php @@ -11,13 +11,13 @@ /** * Metadata of the output video file. * - * @phpstan-type video_metadata = array{ + * @phpstan-type VideoMetadataShape = array{ * bitrate: int, duration: float, height: int, width: int * } */ final class VideoMetadata implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/VideoTransformationReadyEvent/Request.php b/src/Webhooks/VideoTransformationReadyEvent/Request.php index e457dbc0..1e9e0298 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Request.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Request.php @@ -11,13 +11,13 @@ /** * Information about the original request that triggered the video transformation. * - * @phpstan-type request_alias = array{ + * @phpstan-type RequestShape = array{ * url: string, xRequestID: string, userAgent?: string * } */ final class Request implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Webhooks/VideoTransformationReadyEvent/Timings.php b/src/Webhooks/VideoTransformationReadyEvent/Timings.php index 09655f08..5bde3218 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Timings.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Timings.php @@ -11,13 +11,13 @@ /** * Performance metrics for the transformation process. * - * @phpstan-type timings_alias = array{ + * @phpstan-type TimingsShape = array{ * downloadDuration?: int, encodingDuration?: int * } */ final class Timings implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** From b53c717d856851135ebca1ef4aeb13ecaf088eac Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Oct 2025 05:33:13 +0000 Subject: [PATCH 066/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index e27f9d4f..df4337df 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-9d184cb502ab32a85db2889c796cdfebe812f2a55a604df79c85dd4b5e7e2add.yml openapi_spec_hash: a9aa620376fce66532c84f9364209b0b -config_hash: bb7229ef61cee50cd6c1ac02a5a74e81 +config_hash: d7961ccc7e3cafdf8f56d6c89c3c7d62 From 4814fd683af8461b5b7f7981d7d8d108c9d135b3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Oct 2025 05:34:51 +0000 Subject: [PATCH 067/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index df4337df..43d92ddb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-9d184cb502ab32a85db2889c796cdfebe812f2a55a604df79c85dd4b5e7e2add.yml openapi_spec_hash: a9aa620376fce66532c84f9364209b0b -config_hash: d7961ccc7e3cafdf8f56d6c89c3c7d62 +config_hash: c2c1c0a5c85d678e5aa8996f3637b616 From cfffa9f198c7e92eee6b5a8406a8634493bc39fd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Oct 2025 05:46:07 +0000 Subject: [PATCH 068/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 43d92ddb..ae3aead6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-9d184cb502ab32a85db2889c796cdfebe812f2a55a604df79c85dd4b5e7e2add.yml openapi_spec_hash: a9aa620376fce66532c84f9364209b0b -config_hash: c2c1c0a5c85d678e5aa8996f3637b616 +config_hash: eb4cf65a4c6b26a2901076eff5810d5d From 130ede91a7873981a7696eb90b70c1e1780c8215 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 3 Nov 2025 11:51:55 +0000 Subject: [PATCH 069/193] chore(client): send metadata headers --- release-please-config.json | 3 ++- src/Client.php | 12 ++++++++- src/Core/BaseClient.php | 52 ++++++++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 2 deletions(-) diff --git a/release-please-config.json b/release-please-config.json index 1891660d..5c15181d 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -61,6 +61,7 @@ ], "release-type": "php", "extra-files": [ - "README.md" + "README.md", + "src/Client.php" ] } \ No newline at end of file diff --git a/src/Client.php b/src/Client.php index b8224532..d4695500 100644 --- a/src/Client.php +++ b/src/Client.php @@ -84,9 +84,19 @@ public function __construct( ); parent::__construct( + // x-release-please-start-version headers: [ - 'Content-Type' => 'application/json', 'Accept' => 'application/json', + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'User-Agent' => sprintf('ImageKit/PHP %s', '0.0.1'), + 'X-Stainless-Lang' => 'php', + 'X-Stainless-Package-Version' => '0.0.1', + 'X-Stainless-OS' => $this->getNormalizedOS(), + 'X-Stainless-Arch' => $this->getNormalizedArchitecture(), + 'X-Stainless-Runtime' => 'php', + 'X-Stainless-Runtime-Version' => phpversion(), ], + // x-release-please-end baseUrl: $baseUrl, options: $options, ); diff --git a/src/Core/BaseClient.php b/src/Core/BaseClient.php index 9be455a4..907acc5b 100644 --- a/src/Core/BaseClient.php +++ b/src/Core/BaseClient.php @@ -105,6 +105,56 @@ public function request( /** @return array */ abstract protected function authHeaders(): array; + protected function getNormalizedOS(): string + { + $os = strtolower(PHP_OS_FAMILY); + + switch ($os) { + case 'windows': + return 'Windows'; + + case 'darwin': + return 'MacOS'; + + case 'linux': + return 'Linux'; + + case 'bsd': + case 'freebsd': + case 'openbsd': + return 'BSD'; + + case 'solaris': + return 'Solaris'; + + case 'unix': + case 'unknown': + return 'Unknown'; + + default: + return 'Other:'.$os; + } + } + + protected function getNormalizedArchitecture(): string + { + $arch = php_uname('m'); + if (false !== strpos($arch, 'x86_64') || false !== strpos($arch, 'amd64')) { + return 'x64'; + } + if (false !== strpos($arch, 'i386') || false !== strpos($arch, 'i686')) { + return 'x32'; + } + if (false !== strpos($arch, 'aarch64') || false !== strpos($arch, 'arm64')) { + return 'arm64'; + } + if (false !== strpos($arch, 'arm')) { + return 'arm'; + } + + return 'unknown'; + } + /** * @internal * @@ -238,6 +288,8 @@ protected function sendRequest( ): ResponseInterface { assert(null !== $opts->streamFactory && null !== $opts->transporter); + $req = $req->withHeader('X-Stainless-Retry-Count', strval($retryCount)); + $req = Util::withSetBody($opts->streamFactory, req: $req, body: $data); $rsp = null; From bf6c4d658f92eb53b032dafe0c3569cb4e8a0c2a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 11 Nov 2025 16:20:41 +0000 Subject: [PATCH 070/193] feat(client)!: redesign methods --- README.md | 28 +- src/Accounts/Origins/OriginCreateParams.php | 43 +-- src/Accounts/Origins/OriginRequest.php | 3 +- .../Origins/OriginRequest/AkeneoPim.php | 45 +-- .../Origins/OriginRequest/AzureBlob.php | 19 +- .../OriginRequest/CloudinaryBackup.php | 19 +- src/Accounts/Origins/OriginRequest/Gcs.php | 19 +- src/Accounts/Origins/OriginRequest/S3.php | 19 +- .../Origins/OriginRequest/S3Compatible.php | 21 +- .../Origins/OriginRequest/WebFolder.php | 33 +- .../Origins/OriginRequest/WebProxy.php | 17 +- src/Accounts/Origins/OriginResponse.php | 3 +- .../Origins/OriginResponse/AkeneoPim.php | 29 +- .../Origins/OriginResponse/AzureBlob.php | 15 +- .../OriginResponse/CloudinaryBackup.php | 15 +- src/Accounts/Origins/OriginResponse/Gcs.php | 15 +- src/Accounts/Origins/OriginResponse/S3.php | 15 +- .../Origins/OriginResponse/S3Compatible.php | 15 +- .../Origins/OriginResponse/WebFolder.php | 29 +- .../Origins/OriginResponse/WebProxy.php | 15 +- src/Accounts/Origins/OriginUpdateParams.php | 43 +-- .../URLEndpointCreateParams/URLRewriter.php | 3 +- .../URLRewriter/Akamai.php | 3 +- .../URLRewriter/Cloudinary.php | 3 +- .../URLRewriter/Imgix.php | 3 +- .../URLEndpoints/URLEndpointRequest.php | 6 +- .../URLEndpointRequest/URLRewriter.php | 3 +- .../URLEndpointRequest/URLRewriter/Akamai.php | 3 +- .../URLRewriter/Cloudinary.php | 3 +- .../URLEndpointRequest/URLRewriter/Imgix.php | 3 +- .../URLEndpoints/URLEndpointResponse.php | 2 +- .../URLEndpointResponse/URLRewriter.php | 3 +- .../URLRewriter/Akamai.php | 3 +- .../URLRewriter/Cloudinary.php | 3 +- .../URLEndpointResponse/URLRewriter/Imgix.php | 3 +- .../URLEndpointUpdateParams/URLRewriter.php | 3 +- .../URLRewriter/Akamai.php | 3 +- .../URLRewriter/Cloudinary.php | 3 +- .../URLRewriter/Imgix.php | 3 +- src/Accounts/Usage/UsageGetResponse.php | 10 +- src/Assets/AssetListResponseItem.php | 3 +- src/BaseOverlay.php | 2 +- src/Beta/V2/Files/FileUploadParams.php | 20 +- .../Files/FileUploadParams/Transformation.php | 4 +- .../FileUploadParams/Transformation/Post.php | 3 +- .../Transformation/Post/Abs.php | 4 +- .../Transformation/Post/GifToVideo.php | 4 +- .../Transformation/Post/Thumbnail.php | 4 +- .../Transformation/Post/Transformation.php | 4 +- src/Beta/V2/Files/FileUploadResponse.php | 98 +++--- .../V2/Files/FileUploadResponse/AITag.php | 2 +- .../FileUploadResponse/ExtensionStatus.php | 56 +-- .../SelectedFieldsSchema.php | 18 +- .../SelectedFieldsSchema/DefaultValue.php | 3 +- .../DefaultValue/Mixed.php | 3 +- .../SelectedFieldsSchema/MaxValue.php | 3 +- .../SelectedFieldsSchema/MinValue.php | 3 +- .../SelectedFieldsSchema/SelectOption.php | 3 +- .../Files/FileUploadResponse/VersionInfo.php | 2 +- .../Invalidation/InvalidationGetResponse.php | 4 +- .../Invalidation/InvalidationNewResponse.php | 12 +- src/Client.php | 2 +- src/Core/BaseClient.php | 29 +- src/Core/Util.php | 22 +- .../CustomMetadataField/Schema.php | 14 +- .../Schema/DefaultValue.php | 3 +- .../Schema/DefaultValue/Mixed.php | 3 +- .../CustomMetadataField/Schema/MaxValue.php | 3 +- .../CustomMetadataField/Schema/MinValue.php | 3 +- .../Schema/SelectOption.php | 3 +- .../Schema.php | 14 +- .../Schema/DefaultValue.php | 3 +- .../Schema/DefaultValue/Mixed.php | 3 +- .../Schema/MaxValue.php | 3 +- .../Schema/MinValue.php | 3 +- .../Schema/SelectOption.php | 3 +- .../Schema.php | 14 +- .../Schema/DefaultValue.php | 3 +- .../Schema/DefaultValue/Mixed.php | 3 +- .../Schema/MaxValue.php | 3 +- .../Schema/MinValue.php | 3 +- .../Schema/SelectOption.php | 3 +- src/ExtensionItem.php | 3 +- src/ExtensionItem/AIAutoDescription.php | 4 +- src/ExtensionItem/RemoveBg.php | 4 +- src/ExtensionItem/RemoveBg/Options.php | 38 +- src/Files/Bulk/BulkAddTagsParams.php | 18 +- src/Files/Bulk/BulkAddTagsResponse.php | 16 +- src/Files/Bulk/BulkDeleteParams.php | 18 +- src/Files/Bulk/BulkDeleteResponse.php | 16 +- src/Files/Bulk/BulkRemoveAITagsParams.php | 30 +- src/Files/Bulk/BulkRemoveAITagsResponse.php | 16 +- src/Files/Bulk/BulkRemoveTagsParams.php | 18 +- src/Files/Bulk/BulkRemoveTagsResponse.php | 16 +- src/Files/File.php | 78 ++--- src/Files/File/AITag.php | 2 +- src/Files/File/SelectedFieldsSchema.php | 18 +- .../SelectedFieldsSchema/DefaultValue.php | 3 +- .../DefaultValue/Mixed.php | 3 +- .../File/SelectedFieldsSchema/MaxValue.php | 3 +- .../File/SelectedFieldsSchema/MinValue.php | 3 +- .../SelectedFieldsSchema/SelectOption.php | 3 +- src/Files/File/VersionInfo.php | 2 +- src/Files/FileRenameResponse.php | 12 +- src/Files/FileUpdateParams.php | 28 +- src/Files/FileUpdateParams/Publish.php | 2 +- src/Files/FileUpdateParams/RemoveAITags.php | 3 +- src/Files/FileUpdateResponse.php | 80 ++--- .../FileUpdateResponse/ExtensionStatus.php | 56 +-- src/Files/FileUploadParams.php | 20 +- src/Files/FileUploadParams/Transformation.php | 4 +- .../FileUploadParams/Transformation/Post.php | 3 +- .../Transformation/Post/Abs.php | 4 +- .../Transformation/Post/GifToVideo.php | 4 +- .../Transformation/Post/Thumbnail.php | 4 +- .../Transformation/Post/Transformation.php | 4 +- src/Files/FileUploadResponse.php | 98 +++--- src/Files/FileUploadResponse/AITag.php | 2 +- .../FileUploadResponse/ExtensionStatus.php | 56 +-- .../SelectedFieldsSchema.php | 18 +- .../SelectedFieldsSchema/DefaultValue.php | 3 +- .../DefaultValue/Mixed.php | 3 +- .../SelectedFieldsSchema/MaxValue.php | 3 +- .../SelectedFieldsSchema/MinValue.php | 3 +- .../SelectedFieldsSchema/SelectOption.php | 3 +- src/Files/FileUploadResponse/VersionInfo.php | 2 +- src/Files/Folder.php | 22 +- src/Files/Metadata.php | 28 +- src/Files/Metadata/Exif.php | 18 +- src/Files/Metadata/Exif/Exif.php | 312 ++++++++--------- src/Files/Metadata/Exif/Gps.php | 16 +- src/Files/Metadata/Exif/Image.php | 132 +++---- src/Files/Metadata/Exif/Interoperability.php | 22 +- src/Files/Metadata/Exif/Thumbnail.php | 72 ++-- src/Files/UpdateFileRequest.php | 3 +- .../ChangePublicationStatus.php | 2 +- .../ChangePublicationStatus/Publish.php | 2 +- .../UpdateFileRequest/UpdateFileDetails.php | 32 +- .../UpdateFileDetails/RemoveAITags.php | 3 +- src/Files/Versions/VersionDeleteParams.php | 12 +- src/Files/Versions/VersionGetParams.php | 12 +- src/Files/Versions/VersionRestoreParams.php | 12 +- src/Folders/FolderCopyResponse.php | 14 +- src/Folders/FolderMoveResponse.php | 14 +- src/Folders/FolderRenameResponse.php | 14 +- src/Folders/Job/JobGetResponse.php | 28 +- src/GetImageAttributesOptions.php | 24 +- src/ImageOverlay.php | 11 +- src/Overlay.php | 3 +- src/OverlayPosition.php | 2 +- src/OverlayPosition/X.php | 3 +- src/OverlayPosition/Y.php | 3 +- src/OverlayTiming.php | 4 +- src/OverlayTiming/Duration.php | 3 +- src/OverlayTiming/End.php | 3 +- src/OverlayTiming/Start.php | 3 +- src/RequestOptions.php | 16 +- src/ResponsiveImageAttributes.php | 2 +- .../Accounts/OriginsContract.php | 115 +----- .../Accounts/URLEndpointsContract.php | 52 +-- .../Accounts/UsageContract.php | 19 +- src/ServiceContracts/AssetsContract.php | 56 +-- .../Beta/V2/FilesContract.php | 94 +---- .../Cache/InvalidationContract.php | 19 +- .../CustomMetadataFieldsContract.php | 67 +--- src/ServiceContracts/Files/BulkContract.php | 78 +---- .../Files/MetadataContract.php | 19 +- .../Files/VersionsContract.php | 60 +--- src/ServiceContracts/FilesContract.php | 224 +----------- src/ServiceContracts/FoldersContract.php | 111 +----- src/Services/Accounts/OriginsService.php | 171 +-------- src/Services/Accounts/URLEndpointsService.php | 82 +---- src/Services/Accounts/UsageService.php | 26 +- src/Services/AccountsService.php | 6 +- src/Services/AssetsService.php | 76 +--- src/Services/Beta/V2/FilesService.php | 141 ++------ src/Services/Beta/V2Service.php | 2 +- src/Services/BetaService.php | 2 +- src/Services/Cache/InvalidationService.php | 24 +- src/Services/CacheService.php | 2 +- src/Services/CustomMetadataFieldsService.php | 110 ++---- src/Services/Files/BulkService.php | 100 +----- src/Services/Files/MetadataService.php | 24 +- src/Services/Files/VersionsService.php | 87 +---- src/Services/FilesService.php | 329 +++--------------- src/Services/FoldersService.php | 159 ++------- src/SolidColorOverlay.php | 9 +- src/SolidColorOverlayTransformation.php | 24 +- .../Gradient.php | 3 +- .../Height.php | 3 +- .../Radius.php | 3 +- src/SolidColorOverlayTransformation/Width.php | 3 +- src/SrcOptions.php | 16 +- src/SubtitleOverlay.php | 11 +- src/SubtitleOverlayTransformation.php | 14 +- src/TextOverlay.php | 11 +- src/TextOverlayTransformation.php | 31 +- src/TextOverlayTransformation/FontSize.php | 3 +- src/TextOverlayTransformation/LineHeight.php | 3 +- src/TextOverlayTransformation/Padding.php | 3 +- src/TextOverlayTransformation/Radius.php | 3 +- src/TextOverlayTransformation/Rotation.php | 3 +- src/TextOverlayTransformation/Width.php | 3 +- src/Transformation.php | 145 ++++---- src/Transformation/AIDropShadow.php | 3 +- src/Transformation/AspectRatio.php | 3 +- src/Transformation/Duration.php | 3 +- src/Transformation/EndOffset.php | 3 +- src/Transformation/Gradient.php | 3 +- src/Transformation/Height.php | 3 +- src/Transformation/Page.php | 3 +- src/Transformation/Radius.php | 3 +- src/Transformation/Rotation.php | 3 +- src/Transformation/Shadow.php | 3 +- src/Transformation/Sharpen.php | 3 +- src/Transformation/StartOffset.php | 3 +- src/Transformation/Trim.php | 3 +- src/Transformation/UnsharpMask.php | 3 +- src/Transformation/Width.php | 3 +- src/Transformation/X.php | 3 +- src/Transformation/XCenter.php | 3 +- src/Transformation/Y.php | 3 +- src/Transformation/YCenter.php | 3 +- src/VideoOverlay.php | 11 +- src/Webhooks/UnsafeUnwrapWebhookEvent.php | 3 +- src/Webhooks/UnwrapWebhookEvent.php | 3 +- .../UploadPostTransformErrorEvent.php | 14 +- .../UploadPostTransformErrorEvent/Data.php | 14 +- .../UploadPostTransformErrorEvent/Request.php | 14 +- .../Request/Transformation.php | 2 +- .../UploadPostTransformSuccessEvent.php | 14 +- .../UploadPostTransformSuccessEvent/Data.php | 14 +- .../Request.php | 14 +- .../Request/Transformation.php | 2 +- src/Webhooks/UploadPreTransformErrorEvent.php | 14 +- .../UploadPreTransformErrorEvent/Request.php | 14 +- .../UploadPreTransformSuccessEvent.php | 14 +- .../UploadPreTransformSuccessEvent/Data.php | 98 +++--- .../Data/AITag.php | 2 +- .../Data/ExtensionStatus.php | 56 +-- .../Data/SelectedFieldsSchema.php | 18 +- .../SelectedFieldsSchema/DefaultValue.php | 3 +- .../DefaultValue/Mixed.php | 3 +- .../Data/SelectedFieldsSchema/MaxValue.php | 3 +- .../Data/SelectedFieldsSchema/MinValue.php | 3 +- .../SelectedFieldsSchema/SelectOption.php | 3 +- .../Data/VersionInfo.php | 2 +- .../Request.php | 14 +- .../VideoTransformationAcceptedEvent.php | 14 +- .../Data/Transformation.php | 2 +- .../Data/Transformation/Options.php | 66 ++-- .../Request.php | 24 +- .../VideoTransformationErrorEvent.php | 14 +- .../Data/Transformation.php | 2 +- .../Data/Transformation/Options.php | 66 ++-- .../VideoTransformationErrorEvent/Request.php | 24 +- .../VideoTransformationReadyEvent.php | 16 +- .../Data/Transformation.php | 2 +- .../Data/Transformation/Options.php | 66 ++-- .../Data/Transformation/Output.php | 14 +- .../VideoTransformationReadyEvent/Request.php | 24 +- .../VideoTransformationReadyEvent/Timings.php | 22 +- tests/Services/Accounts/OriginsTest.php | 140 ++++---- tests/Services/Accounts/URLEndpointsTest.php | 16 +- tests/Services/Accounts/UsageTest.php | 14 +- tests/Services/AssetsTest.php | 2 +- tests/Services/Beta/V2/FilesTest.php | 14 +- tests/Services/Cache/InvalidationTest.php | 12 +- tests/Services/CustomMetadataFieldsTest.php | 39 +-- tests/Services/Files/BulkTest.php | 60 ++-- tests/Services/Files/MetadataTest.php | 8 +- tests/Services/Files/VersionsTest.php | 30 +- tests/Services/FilesTest.php | 56 +-- tests/Services/FoldersTest.php | 68 ++-- 274 files changed, 2321 insertions(+), 3944 deletions(-) diff --git a/README.md b/README.md index bc994029..ab04349a 100644 --- a/README.md +++ b/README.md @@ -46,7 +46,10 @@ $client = new Client( password: getenv("OPTIONAL_IMAGEKIT_IGNORES_THIS") ?: "do_not_set", ); -$response = $client->files->upload(file: 'file', fileName: "file-name.jpg"); +$response = $client->files->upload([ + "file" => "https://www.example.com/public-url.jpg", + "fileName" => "file-name.jpg", +]); var_dump($response->videoCodec); ``` @@ -68,7 +71,10 @@ When the library is unable to connect to the API, or if the API returns a non-su use ImageKit\Core\Exceptions\APIConnectionException; try { - $response = $client->files->upload(file: 'file', fileName: "file-name.jpg"); + $response = $client->files->upload([ + "file" => "https://www.example.com/public-url.jpg", + "fileName" => "file-name.jpg", + ]); } catch (APIConnectionException $e) { echo "The server could not be reached", PHP_EOL; var_dump($e->getPrevious()); @@ -115,9 +121,11 @@ $client = new Client(maxRetries: 0); // Or, configure per-request: $result = $client->files->upload( - file: 'file', - fileName: "file-name.jpg", - requestOptions: RequestOptions::with(maxRetries: 5), + [ + "file" => "https://www.example.com/public-url.jpg", + "fileName" => "file-name.jpg", + ], + RequestOptions::with(maxRetries: 5), ); ``` @@ -137,16 +145,16 @@ Note: the `extra*` parameters of the same name overrides the documented paramete use ImageKit\RequestOptions; $response = $client->files->upload( - file: 'file', - fileName: "file-name.jpg", - requestOptions: RequestOptions::with( + [ + "file" => "https://www.example.com/public-url.jpg", + "fileName" => "file-name.jpg", + ], + RequestOptions::with( extraQueryParams: ["my_query_parameter" => "value"], extraBodyParams: ["my_body_parameter" => "value"], extraHeaders: ["my-header" => "value"], ), ); - -var_dump($response["my_undocumented_property"]); ``` #### Undocumented request params diff --git a/src/Accounts/Origins/OriginCreateParams.php b/src/Accounts/Origins/OriginCreateParams.php index 42a2686c..ce0c57af 100644 --- a/src/Accounts/Origins/OriginCreateParams.php +++ b/src/Accounts/Origins/OriginCreateParams.php @@ -20,20 +20,20 @@ * bucket: string, * name: string, * secretKey: string, - * type: string, - * baseURLForCanonicalHeader?: string, + * type: "AKENEO_PIM", + * baseUrlForCanonicalHeader?: string, * includeCanonicalHeader?: bool, * prefix?: string, * endpoint: string, * s3ForcePathStyle?: bool, - * baseURL: string, + * baseUrl: string, * forwardHostHeaderToOrigin?: bool, * clientEmail: string, * privateKey: string, * accountName: string, * container: string, * sasToken: string, - * clientID: string, + * clientId: string, * clientSecret: string, * password: string, * username: string, @@ -45,6 +45,7 @@ final class OriginCreateParams implements BaseModel use SdkModel; use SdkParams; + /** @var "AKENEO_PIM" $type */ #[Api] public string $type = 'AKENEO_PIM'; @@ -72,8 +73,8 @@ final class OriginCreateParams implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Api('baseUrlForCanonicalHeader', optional: true)] - public ?string $baseURLForCanonicalHeader; + #[Api(optional: true)] + public ?string $baseUrlForCanonicalHeader; /** * Whether to send a Canonical header. @@ -99,8 +100,8 @@ final class OriginCreateParams implements BaseModel /** * Akeneo instance base URL. */ - #[Api('baseUrl')] - public string $baseURL; + #[Api] + public string $baseUrl; /** * Forward the Host header to origin? @@ -126,8 +127,8 @@ final class OriginCreateParams implements BaseModel /** * Akeneo API client ID. */ - #[Api('clientId')] - public string $clientID; + #[Api] + public string $clientId; /** * Akeneo API client secret. @@ -158,13 +159,13 @@ final class OriginCreateParams implements BaseModel * name: ..., * secretKey: ..., * endpoint: ..., - * baseURL: ..., + * baseUrl: ..., * clientEmail: ..., * privateKey: ..., * accountName: ..., * container: ..., * sasToken: ..., - * clientID: ..., + * clientId: ..., * clientSecret: ..., * password: ..., * username: ..., @@ -208,17 +209,17 @@ public static function with( string $name, string $secretKey, string $endpoint, - string $baseURL, + string $baseUrl, string $clientEmail, string $privateKey, string $accountName, string $container, string $sasToken, - string $clientID, + string $clientId, string $clientSecret, string $password, string $username, - ?string $baseURLForCanonicalHeader = null, + ?string $baseUrlForCanonicalHeader = null, ?bool $includeCanonicalHeader = null, ?string $prefix = null, ?bool $s3ForcePathStyle = null, @@ -231,18 +232,18 @@ public static function with( $obj->name = $name; $obj->secretKey = $secretKey; $obj->endpoint = $endpoint; - $obj->baseURL = $baseURL; + $obj->baseUrl = $baseUrl; $obj->clientEmail = $clientEmail; $obj->privateKey = $privateKey; $obj->accountName = $accountName; $obj->container = $container; $obj->sasToken = $sasToken; - $obj->clientID = $clientID; + $obj->clientId = $clientId; $obj->clientSecret = $clientSecret; $obj->password = $password; $obj->username = $username; - null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; null !== $prefix && $obj->prefix = $prefix; null !== $s3ForcePathStyle && $obj->s3ForcePathStyle = $s3ForcePathStyle; @@ -299,7 +300,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; return $obj; } @@ -352,7 +353,7 @@ public function withS3ForcePathStyle(bool $s3ForcePathStyle): self public function withBaseURL(string $baseURL): self { $obj = clone $this; - $obj->baseURL = $baseURL; + $obj->baseUrl = $baseURL; return $obj; } @@ -415,7 +416,7 @@ public function withSasToken(string $sasToken): self public function withClientID(string $clientID): self { $obj = clone $this; - $obj->clientID = $clientID; + $obj->clientId = $clientID; return $obj; } diff --git a/src/Accounts/Origins/OriginRequest.php b/src/Accounts/Origins/OriginRequest.php index 93fcf986..1f30f86c 100644 --- a/src/Accounts/Origins/OriginRequest.php +++ b/src/Accounts/Origins/OriginRequest.php @@ -29,8 +29,7 @@ public static function discriminator(): string } /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Accounts/Origins/OriginRequest/AkeneoPim.php b/src/Accounts/Origins/OriginRequest/AkeneoPim.php index 382d83f2..03b252e2 100644 --- a/src/Accounts/Origins/OriginRequest/AkeneoPim.php +++ b/src/Accounts/Origins/OriginRequest/AkeneoPim.php @@ -10,15 +10,15 @@ /** * @phpstan-type AkeneoPimShape = array{ - * baseURL: string, - * clientID: string, + * baseUrl: string, + * clientId: string, * clientSecret: string, * name: string, * password: string, - * type: string, + * type: "AKENEO_PIM", * username: string, - * baseURLForCanonicalHeader?: string, - * includeCanonicalHeader?: bool, + * baseUrlForCanonicalHeader?: string|null, + * includeCanonicalHeader?: bool|null, * } */ final class AkeneoPim implements BaseModel @@ -26,20 +26,21 @@ final class AkeneoPim implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "AKENEO_PIM" $type */ #[Api] public string $type = 'AKENEO_PIM'; /** * Akeneo instance base URL. */ - #[Api('baseUrl')] - public string $baseURL; + #[Api] + public string $baseUrl; /** * Akeneo API client ID. */ - #[Api('clientId')] - public string $clientID; + #[Api] + public string $clientId; /** * Akeneo API client secret. @@ -68,8 +69,8 @@ final class AkeneoPim implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Api('baseUrlForCanonicalHeader', optional: true)] - public ?string $baseURLForCanonicalHeader; + #[Api(optional: true)] + public ?string $baseUrlForCanonicalHeader; /** * Whether to send a Canonical header. @@ -83,8 +84,8 @@ final class AkeneoPim implements BaseModel * To enforce required parameters use * ``` * AkeneoPim::with( - * baseURL: ..., - * clientID: ..., + * baseUrl: ..., + * clientId: ..., * clientSecret: ..., * name: ..., * password: ..., @@ -115,25 +116,25 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - string $baseURL, - string $clientID, + string $baseUrl, + string $clientId, string $clientSecret, string $name, string $password, string $username, - ?string $baseURLForCanonicalHeader = null, + ?string $baseUrlForCanonicalHeader = null, ?bool $includeCanonicalHeader = null, ): self { $obj = new self; - $obj->baseURL = $baseURL; - $obj->clientID = $clientID; + $obj->baseUrl = $baseUrl; + $obj->clientId = $clientId; $obj->clientSecret = $clientSecret; $obj->name = $name; $obj->password = $password; $obj->username = $username; - null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; return $obj; @@ -145,7 +146,7 @@ public static function with( public function withBaseURL(string $baseURL): self { $obj = clone $this; - $obj->baseURL = $baseURL; + $obj->baseUrl = $baseURL; return $obj; } @@ -156,7 +157,7 @@ public function withBaseURL(string $baseURL): self public function withClientID(string $clientID): self { $obj = clone $this; - $obj->clientID = $clientID; + $obj->clientId = $clientID; return $obj; } @@ -212,7 +213,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginRequest/AzureBlob.php b/src/Accounts/Origins/OriginRequest/AzureBlob.php index f2116731..69b1ae89 100644 --- a/src/Accounts/Origins/OriginRequest/AzureBlob.php +++ b/src/Accounts/Origins/OriginRequest/AzureBlob.php @@ -14,10 +14,10 @@ * container: string, * name: string, * sasToken: string, - * type: string, - * baseURLForCanonicalHeader?: string, - * includeCanonicalHeader?: bool, - * prefix?: string, + * type: "AZURE_BLOB", + * baseUrlForCanonicalHeader?: string|null, + * includeCanonicalHeader?: bool|null, + * prefix?: string|null, * } */ final class AzureBlob implements BaseModel @@ -25,6 +25,7 @@ final class AzureBlob implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "AZURE_BLOB" $type */ #[Api] public string $type = 'AZURE_BLOB'; @@ -46,8 +47,8 @@ final class AzureBlob implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Api('baseUrlForCanonicalHeader', optional: true)] - public ?string $baseURLForCanonicalHeader; + #[Api(optional: true)] + public ?string $baseUrlForCanonicalHeader; /** * Whether to send a Canonical header. @@ -91,7 +92,7 @@ public static function with( string $container, string $name, string $sasToken, - ?string $baseURLForCanonicalHeader = null, + ?string $baseUrlForCanonicalHeader = null, ?bool $includeCanonicalHeader = null, ?string $prefix = null, ): self { @@ -102,7 +103,7 @@ public static function with( $obj->name = $name; $obj->sasToken = $sasToken; - null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; null !== $prefix && $obj->prefix = $prefix; @@ -151,7 +152,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php index 0223211d..4a1a4fba 100644 --- a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php @@ -14,10 +14,10 @@ * bucket: string, * name: string, * secretKey: string, - * type: string, - * baseURLForCanonicalHeader?: string, - * includeCanonicalHeader?: bool, - * prefix?: string, + * type: "CLOUDINARY_BACKUP", + * baseUrlForCanonicalHeader?: string|null, + * includeCanonicalHeader?: bool|null, + * prefix?: string|null, * } */ final class CloudinaryBackup implements BaseModel @@ -25,6 +25,7 @@ final class CloudinaryBackup implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "CLOUDINARY_BACKUP" $type */ #[Api] public string $type = 'CLOUDINARY_BACKUP'; @@ -55,8 +56,8 @@ final class CloudinaryBackup implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Api('baseUrlForCanonicalHeader', optional: true)] - public ?string $baseURLForCanonicalHeader; + #[Api(optional: true)] + public ?string $baseUrlForCanonicalHeader; /** * Whether to send a Canonical header. @@ -103,7 +104,7 @@ public static function with( string $bucket, string $name, string $secretKey, - ?string $baseURLForCanonicalHeader = null, + ?string $baseUrlForCanonicalHeader = null, ?bool $includeCanonicalHeader = null, ?string $prefix = null, ): self { @@ -114,7 +115,7 @@ public static function with( $obj->name = $name; $obj->secretKey = $secretKey; - null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; null !== $prefix && $obj->prefix = $prefix; @@ -172,7 +173,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginRequest/Gcs.php b/src/Accounts/Origins/OriginRequest/Gcs.php index 1f72c89d..9ccf0ae7 100644 --- a/src/Accounts/Origins/OriginRequest/Gcs.php +++ b/src/Accounts/Origins/OriginRequest/Gcs.php @@ -14,10 +14,10 @@ * clientEmail: string, * name: string, * privateKey: string, - * type: string, - * baseURLForCanonicalHeader?: string, - * includeCanonicalHeader?: bool, - * prefix?: string, + * type: "GCS", + * baseUrlForCanonicalHeader?: string|null, + * includeCanonicalHeader?: bool|null, + * prefix?: string|null, * } */ final class Gcs implements BaseModel @@ -25,6 +25,7 @@ final class Gcs implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "GCS" $type */ #[Api] public string $type = 'GCS'; @@ -46,8 +47,8 @@ final class Gcs implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Api('baseUrlForCanonicalHeader', optional: true)] - public ?string $baseURLForCanonicalHeader; + #[Api(optional: true)] + public ?string $baseUrlForCanonicalHeader; /** * Whether to send a Canonical header. @@ -91,7 +92,7 @@ public static function with( string $clientEmail, string $name, string $privateKey, - ?string $baseURLForCanonicalHeader = null, + ?string $baseUrlForCanonicalHeader = null, ?bool $includeCanonicalHeader = null, ?string $prefix = null, ): self { @@ -102,7 +103,7 @@ public static function with( $obj->name = $name; $obj->privateKey = $privateKey; - null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; null !== $prefix && $obj->prefix = $prefix; @@ -151,7 +152,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginRequest/S3.php b/src/Accounts/Origins/OriginRequest/S3.php index 436da6e4..ad1297e4 100644 --- a/src/Accounts/Origins/OriginRequest/S3.php +++ b/src/Accounts/Origins/OriginRequest/S3.php @@ -14,10 +14,10 @@ * bucket: string, * name: string, * secretKey: string, - * type: string, - * baseURLForCanonicalHeader?: string, - * includeCanonicalHeader?: bool, - * prefix?: string, + * type: "S3", + * baseUrlForCanonicalHeader?: string|null, + * includeCanonicalHeader?: bool|null, + * prefix?: string|null, * } */ final class S3 implements BaseModel @@ -25,6 +25,7 @@ final class S3 implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "S3" $type */ #[Api] public string $type = 'S3'; @@ -55,8 +56,8 @@ final class S3 implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Api('baseUrlForCanonicalHeader', optional: true)] - public ?string $baseURLForCanonicalHeader; + #[Api(optional: true)] + public ?string $baseUrlForCanonicalHeader; /** * Whether to send a Canonical header. @@ -99,7 +100,7 @@ public static function with( string $bucket, string $name, string $secretKey, - ?string $baseURLForCanonicalHeader = null, + ?string $baseUrlForCanonicalHeader = null, ?bool $includeCanonicalHeader = null, ?string $prefix = null, ): self { @@ -110,7 +111,7 @@ public static function with( $obj->name = $name; $obj->secretKey = $secretKey; - null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; null !== $prefix && $obj->prefix = $prefix; @@ -168,7 +169,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginRequest/S3Compatible.php b/src/Accounts/Origins/OriginRequest/S3Compatible.php index 00db9db6..77602543 100644 --- a/src/Accounts/Origins/OriginRequest/S3Compatible.php +++ b/src/Accounts/Origins/OriginRequest/S3Compatible.php @@ -15,11 +15,11 @@ * endpoint: string, * name: string, * secretKey: string, - * type: string, - * baseURLForCanonicalHeader?: string, - * includeCanonicalHeader?: bool, - * prefix?: string, - * s3ForcePathStyle?: bool, + * type: "S3_COMPATIBLE", + * baseUrlForCanonicalHeader?: string|null, + * includeCanonicalHeader?: bool|null, + * prefix?: string|null, + * s3ForcePathStyle?: bool|null, * } */ final class S3Compatible implements BaseModel @@ -27,6 +27,7 @@ final class S3Compatible implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "S3_COMPATIBLE" $type */ #[Api] public string $type = 'S3_COMPATIBLE'; @@ -63,8 +64,8 @@ final class S3Compatible implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Api('baseUrlForCanonicalHeader', optional: true)] - public ?string $baseURLForCanonicalHeader; + #[Api(optional: true)] + public ?string $baseUrlForCanonicalHeader; /** * Whether to send a Canonical header. @@ -121,7 +122,7 @@ public static function with( string $endpoint, string $name, string $secretKey, - ?string $baseURLForCanonicalHeader = null, + ?string $baseUrlForCanonicalHeader = null, ?bool $includeCanonicalHeader = null, ?string $prefix = null, ?bool $s3ForcePathStyle = null, @@ -134,7 +135,7 @@ public static function with( $obj->name = $name; $obj->secretKey = $secretKey; - null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; null !== $prefix && $obj->prefix = $prefix; null !== $s3ForcePathStyle && $obj->s3ForcePathStyle = $s3ForcePathStyle; @@ -204,7 +205,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginRequest/WebFolder.php b/src/Accounts/Origins/OriginRequest/WebFolder.php index 3f0f4196..c482cc16 100644 --- a/src/Accounts/Origins/OriginRequest/WebFolder.php +++ b/src/Accounts/Origins/OriginRequest/WebFolder.php @@ -10,12 +10,12 @@ /** * @phpstan-type WebFolderShape = array{ - * baseURL: string, + * baseUrl: string, * name: string, - * type: string, - * baseURLForCanonicalHeader?: string, - * forwardHostHeaderToOrigin?: bool, - * includeCanonicalHeader?: bool, + * type: "WEB_FOLDER", + * baseUrlForCanonicalHeader?: string|null, + * forwardHostHeaderToOrigin?: bool|null, + * includeCanonicalHeader?: bool|null, * } */ final class WebFolder implements BaseModel @@ -23,14 +23,15 @@ final class WebFolder implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "WEB_FOLDER" $type */ #[Api] public string $type = 'WEB_FOLDER'; /** * Root URL for the web folder origin. */ - #[Api('baseUrl')] - public string $baseURL; + #[Api] + public string $baseUrl; /** * Display name of the origin. @@ -41,8 +42,8 @@ final class WebFolder implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Api('baseUrlForCanonicalHeader', optional: true)] - public ?string $baseURLForCanonicalHeader; + #[Api(optional: true)] + public ?string $baseUrlForCanonicalHeader; /** * Forward the Host header to origin? @@ -61,7 +62,7 @@ final class WebFolder implements BaseModel * * To enforce required parameters use * ``` - * WebFolder::with(baseURL: ..., name: ...) + * WebFolder::with(baseUrl: ..., name: ...) * ``` * * Otherwise ensure the following setters are called @@ -81,18 +82,18 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - string $baseURL, + string $baseUrl, string $name, - ?string $baseURLForCanonicalHeader = null, + ?string $baseUrlForCanonicalHeader = null, ?bool $forwardHostHeaderToOrigin = null, ?bool $includeCanonicalHeader = null, ): self { $obj = new self; - $obj->baseURL = $baseURL; + $obj->baseUrl = $baseUrl; $obj->name = $name; - null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; null !== $forwardHostHeaderToOrigin && $obj->forwardHostHeaderToOrigin = $forwardHostHeaderToOrigin; null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; @@ -105,7 +106,7 @@ public static function with( public function withBaseURL(string $baseURL): self { $obj = clone $this; - $obj->baseURL = $baseURL; + $obj->baseUrl = $baseURL; return $obj; } @@ -128,7 +129,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginRequest/WebProxy.php b/src/Accounts/Origins/OriginRequest/WebProxy.php index fe0ebfe6..54ee74fd 100644 --- a/src/Accounts/Origins/OriginRequest/WebProxy.php +++ b/src/Accounts/Origins/OriginRequest/WebProxy.php @@ -11,9 +11,9 @@ /** * @phpstan-type WebProxyShape = array{ * name: string, - * type: string, - * baseURLForCanonicalHeader?: string, - * includeCanonicalHeader?: bool, + * type: "WEB_PROXY", + * baseUrlForCanonicalHeader?: string|null, + * includeCanonicalHeader?: bool|null, * } */ final class WebProxy implements BaseModel @@ -21,6 +21,7 @@ final class WebProxy implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "WEB_PROXY" $type */ #[Api] public string $type = 'WEB_PROXY'; @@ -33,8 +34,8 @@ final class WebProxy implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Api('baseUrlForCanonicalHeader', optional: true)] - public ?string $baseURLForCanonicalHeader; + #[Api(optional: true)] + public ?string $baseUrlForCanonicalHeader; /** * Whether to send a Canonical header. @@ -68,14 +69,14 @@ public function __construct() */ public static function with( string $name, - ?string $baseURLForCanonicalHeader = null, + ?string $baseUrlForCanonicalHeader = null, ?bool $includeCanonicalHeader = null, ): self { $obj = new self; $obj->name = $name; - null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; return $obj; @@ -99,7 +100,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginResponse.php b/src/Accounts/Origins/OriginResponse.php index 7c9f0050..6ecf0ba4 100644 --- a/src/Accounts/Origins/OriginResponse.php +++ b/src/Accounts/Origins/OriginResponse.php @@ -29,8 +29,7 @@ public static function discriminator(): string } /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Accounts/Origins/OriginResponse/AkeneoPim.php b/src/Accounts/Origins/OriginResponse/AkeneoPim.php index 247702d2..56c76b55 100644 --- a/src/Accounts/Origins/OriginResponse/AkeneoPim.php +++ b/src/Accounts/Origins/OriginResponse/AkeneoPim.php @@ -11,11 +11,11 @@ /** * @phpstan-type AkeneoPimShape = array{ * id: string, - * baseURL: string, + * baseUrl: string, * includeCanonicalHeader: bool, * name: string, - * type: string, - * baseURLForCanonicalHeader?: string, + * type: "AKENEO_PIM", + * baseUrlForCanonicalHeader?: string|null, * } */ final class AkeneoPim implements BaseModel @@ -23,6 +23,7 @@ final class AkeneoPim implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "AKENEO_PIM" $type */ #[Api] public string $type = 'AKENEO_PIM'; @@ -35,8 +36,8 @@ final class AkeneoPim implements BaseModel /** * Akeneo instance base URL. */ - #[Api('baseUrl')] - public string $baseURL; + #[Api] + public string $baseUrl; /** * Whether to send a Canonical header. @@ -53,15 +54,15 @@ final class AkeneoPim implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Api('baseUrlForCanonicalHeader', optional: true)] - public ?string $baseURLForCanonicalHeader; + #[Api(optional: true)] + public ?string $baseUrlForCanonicalHeader; /** * `new AkeneoPim()` is missing required properties by the API. * * To enforce required parameters use * ``` - * AkeneoPim::with(id: ..., baseURL: ..., includeCanonicalHeader: ..., name: ...) + * AkeneoPim::with(id: ..., baseUrl: ..., includeCanonicalHeader: ..., name: ...) * ``` * * Otherwise ensure the following setters are called @@ -86,19 +87,19 @@ public function __construct() */ public static function with( string $id, - string $baseURL, + string $baseUrl, string $name, bool $includeCanonicalHeader = false, - ?string $baseURLForCanonicalHeader = null, + ?string $baseUrlForCanonicalHeader = null, ): self { $obj = new self; $obj->id = $id; - $obj->baseURL = $baseURL; + $obj->baseUrl = $baseUrl; $obj->includeCanonicalHeader = $includeCanonicalHeader; $obj->name = $name; - null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; return $obj; } @@ -120,7 +121,7 @@ public function withID(string $id): self public function withBaseURL(string $baseURL): self { $obj = clone $this; - $obj->baseURL = $baseURL; + $obj->baseUrl = $baseURL; return $obj; } @@ -155,7 +156,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginResponse/AzureBlob.php b/src/Accounts/Origins/OriginResponse/AzureBlob.php index 3bc78f7b..e44b3d00 100644 --- a/src/Accounts/Origins/OriginResponse/AzureBlob.php +++ b/src/Accounts/Origins/OriginResponse/AzureBlob.php @@ -16,8 +16,8 @@ * includeCanonicalHeader: bool, * name: string, * prefix: string, - * type: string, - * baseURLForCanonicalHeader?: string, + * type: "AZURE_BLOB", + * baseUrlForCanonicalHeader?: string|null, * } */ final class AzureBlob implements BaseModel @@ -25,6 +25,7 @@ final class AzureBlob implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "AZURE_BLOB" $type */ #[Api] public string $type = 'AZURE_BLOB'; @@ -58,8 +59,8 @@ final class AzureBlob implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Api('baseUrlForCanonicalHeader', optional: true)] - public ?string $baseURLForCanonicalHeader; + #[Api(optional: true)] + public ?string $baseUrlForCanonicalHeader; /** * `new AzureBlob()` is missing required properties by the API. @@ -105,7 +106,7 @@ public static function with( string $name, string $prefix, bool $includeCanonicalHeader = false, - ?string $baseURLForCanonicalHeader = null, + ?string $baseUrlForCanonicalHeader = null, ): self { $obj = new self; @@ -116,7 +117,7 @@ public static function with( $obj->name = $name; $obj->prefix = $prefix; - null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; return $obj; } @@ -186,7 +187,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php index 4c6c7009..a7db701d 100644 --- a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php @@ -15,8 +15,8 @@ * includeCanonicalHeader: bool, * name: string, * prefix: string, - * type: string, - * baseURLForCanonicalHeader?: string, + * type: "CLOUDINARY_BACKUP", + * baseUrlForCanonicalHeader?: string|null, * } */ final class CloudinaryBackup implements BaseModel @@ -24,6 +24,7 @@ final class CloudinaryBackup implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "CLOUDINARY_BACKUP" $type */ #[Api] public string $type = 'CLOUDINARY_BACKUP'; @@ -60,8 +61,8 @@ final class CloudinaryBackup implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Api('baseUrlForCanonicalHeader', optional: true)] - public ?string $baseURLForCanonicalHeader; + #[Api(optional: true)] + public ?string $baseUrlForCanonicalHeader; /** * `new CloudinaryBackup()` is missing required properties by the API. @@ -100,7 +101,7 @@ public static function with( string $name, string $prefix, bool $includeCanonicalHeader = false, - ?string $baseURLForCanonicalHeader = null, + ?string $baseUrlForCanonicalHeader = null, ): self { $obj = new self; @@ -110,7 +111,7 @@ public static function with( $obj->name = $name; $obj->prefix = $prefix; - null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; return $obj; } @@ -178,7 +179,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginResponse/Gcs.php b/src/Accounts/Origins/OriginResponse/Gcs.php index 2febdbdf..508d56c4 100644 --- a/src/Accounts/Origins/OriginResponse/Gcs.php +++ b/src/Accounts/Origins/OriginResponse/Gcs.php @@ -16,8 +16,8 @@ * includeCanonicalHeader: bool, * name: string, * prefix: string, - * type: string, - * baseURLForCanonicalHeader?: string, + * type: "GCS", + * baseUrlForCanonicalHeader?: string|null, * } */ final class Gcs implements BaseModel @@ -25,6 +25,7 @@ final class Gcs implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "GCS" $type */ #[Api] public string $type = 'GCS'; @@ -58,8 +59,8 @@ final class Gcs implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Api('baseUrlForCanonicalHeader', optional: true)] - public ?string $baseURLForCanonicalHeader; + #[Api(optional: true)] + public ?string $baseUrlForCanonicalHeader; /** * `new Gcs()` is missing required properties by the API. @@ -105,7 +106,7 @@ public static function with( string $name, string $prefix, bool $includeCanonicalHeader = false, - ?string $baseURLForCanonicalHeader = null, + ?string $baseUrlForCanonicalHeader = null, ): self { $obj = new self; @@ -116,7 +117,7 @@ public static function with( $obj->name = $name; $obj->prefix = $prefix; - null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; return $obj; } @@ -186,7 +187,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginResponse/S3.php b/src/Accounts/Origins/OriginResponse/S3.php index 81a8e43d..dd790e55 100644 --- a/src/Accounts/Origins/OriginResponse/S3.php +++ b/src/Accounts/Origins/OriginResponse/S3.php @@ -15,8 +15,8 @@ * includeCanonicalHeader: bool, * name: string, * prefix: string, - * type: string, - * baseURLForCanonicalHeader?: string, + * type: "S3", + * baseUrlForCanonicalHeader?: string|null, * } */ final class S3 implements BaseModel @@ -24,6 +24,7 @@ final class S3 implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "S3" $type */ #[Api] public string $type = 'S3'; @@ -60,8 +61,8 @@ final class S3 implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Api('baseUrlForCanonicalHeader', optional: true)] - public ?string $baseURLForCanonicalHeader; + #[Api(optional: true)] + public ?string $baseUrlForCanonicalHeader; /** * `new S3()` is missing required properties by the API. @@ -100,7 +101,7 @@ public static function with( string $name, string $prefix, bool $includeCanonicalHeader = false, - ?string $baseURLForCanonicalHeader = null, + ?string $baseUrlForCanonicalHeader = null, ): self { $obj = new self; @@ -110,7 +111,7 @@ public static function with( $obj->name = $name; $obj->prefix = $prefix; - null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; return $obj; } @@ -178,7 +179,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginResponse/S3Compatible.php b/src/Accounts/Origins/OriginResponse/S3Compatible.php index 33d3b8c6..2fee9615 100644 --- a/src/Accounts/Origins/OriginResponse/S3Compatible.php +++ b/src/Accounts/Origins/OriginResponse/S3Compatible.php @@ -17,8 +17,8 @@ * name: string, * prefix: string, * s3ForcePathStyle: bool, - * type: string, - * baseURLForCanonicalHeader?: string, + * type: "S3_COMPATIBLE", + * baseUrlForCanonicalHeader?: string|null, * } */ final class S3Compatible implements BaseModel @@ -26,6 +26,7 @@ final class S3Compatible implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "S3_COMPATIBLE" $type */ #[Api] public string $type = 'S3_COMPATIBLE'; @@ -74,8 +75,8 @@ final class S3Compatible implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Api('baseUrlForCanonicalHeader', optional: true)] - public ?string $baseURLForCanonicalHeader; + #[Api(optional: true)] + public ?string $baseUrlForCanonicalHeader; /** * `new S3Compatible()` is missing required properties by the API. @@ -124,7 +125,7 @@ public static function with( string $prefix, bool $includeCanonicalHeader = false, bool $s3ForcePathStyle = false, - ?string $baseURLForCanonicalHeader = null, + ?string $baseUrlForCanonicalHeader = null, ): self { $obj = new self; @@ -136,7 +137,7 @@ public static function with( $obj->prefix = $prefix; $obj->s3ForcePathStyle = $s3ForcePathStyle; - null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; return $obj; } @@ -226,7 +227,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginResponse/WebFolder.php b/src/Accounts/Origins/OriginResponse/WebFolder.php index 81be030e..d2202768 100644 --- a/src/Accounts/Origins/OriginResponse/WebFolder.php +++ b/src/Accounts/Origins/OriginResponse/WebFolder.php @@ -11,12 +11,12 @@ /** * @phpstan-type WebFolderShape = array{ * id: string, - * baseURL: string, + * baseUrl: string, * forwardHostHeaderToOrigin: bool, * includeCanonicalHeader: bool, * name: string, - * type: string, - * baseURLForCanonicalHeader?: string, + * type: "WEB_FOLDER", + * baseUrlForCanonicalHeader?: string|null, * } */ final class WebFolder implements BaseModel @@ -24,6 +24,7 @@ final class WebFolder implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "WEB_FOLDER" $type */ #[Api] public string $type = 'WEB_FOLDER'; @@ -36,8 +37,8 @@ final class WebFolder implements BaseModel /** * Root URL for the web folder origin. */ - #[Api('baseUrl')] - public string $baseURL; + #[Api] + public string $baseUrl; /** * Forward the Host header to origin? @@ -60,8 +61,8 @@ final class WebFolder implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Api('baseUrlForCanonicalHeader', optional: true)] - public ?string $baseURLForCanonicalHeader; + #[Api(optional: true)] + public ?string $baseUrlForCanonicalHeader; /** * `new WebFolder()` is missing required properties by the API. @@ -70,7 +71,7 @@ final class WebFolder implements BaseModel * ``` * WebFolder::with( * id: ..., - * baseURL: ..., + * baseUrl: ..., * forwardHostHeaderToOrigin: ..., * includeCanonicalHeader: ..., * name: ..., @@ -100,21 +101,21 @@ public function __construct() */ public static function with( string $id, - string $baseURL, + string $baseUrl, string $name, bool $forwardHostHeaderToOrigin = false, bool $includeCanonicalHeader = false, - ?string $baseURLForCanonicalHeader = null, + ?string $baseUrlForCanonicalHeader = null, ): self { $obj = new self; $obj->id = $id; - $obj->baseURL = $baseURL; + $obj->baseUrl = $baseUrl; $obj->forwardHostHeaderToOrigin = $forwardHostHeaderToOrigin; $obj->includeCanonicalHeader = $includeCanonicalHeader; $obj->name = $name; - null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; return $obj; } @@ -136,7 +137,7 @@ public function withID(string $id): self public function withBaseURL(string $baseURL): self { $obj = clone $this; - $obj->baseURL = $baseURL; + $obj->baseUrl = $baseURL; return $obj; } @@ -183,7 +184,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginResponse/WebProxy.php b/src/Accounts/Origins/OriginResponse/WebProxy.php index 23dcff97..6e2801b4 100644 --- a/src/Accounts/Origins/OriginResponse/WebProxy.php +++ b/src/Accounts/Origins/OriginResponse/WebProxy.php @@ -13,8 +13,8 @@ * id: string, * includeCanonicalHeader: bool, * name: string, - * type: string, - * baseURLForCanonicalHeader?: string, + * type: "WEB_PROXY", + * baseUrlForCanonicalHeader?: string|null, * } */ final class WebProxy implements BaseModel @@ -22,6 +22,7 @@ final class WebProxy implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "WEB_PROXY" $type */ #[Api] public string $type = 'WEB_PROXY'; @@ -46,8 +47,8 @@ final class WebProxy implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Api('baseUrlForCanonicalHeader', optional: true)] - public ?string $baseURLForCanonicalHeader; + #[Api(optional: true)] + public ?string $baseUrlForCanonicalHeader; /** * `new WebProxy()` is missing required properties by the API. @@ -77,7 +78,7 @@ public static function with( string $id, string $name, bool $includeCanonicalHeader = false, - ?string $baseURLForCanonicalHeader = null, + ?string $baseUrlForCanonicalHeader = null, ): self { $obj = new self; @@ -85,7 +86,7 @@ public static function with( $obj->includeCanonicalHeader = $includeCanonicalHeader; $obj->name = $name; - null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; return $obj; } @@ -131,7 +132,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginUpdateParams.php b/src/Accounts/Origins/OriginUpdateParams.php index 8fffea5f..a28ead9c 100644 --- a/src/Accounts/Origins/OriginUpdateParams.php +++ b/src/Accounts/Origins/OriginUpdateParams.php @@ -20,20 +20,20 @@ * bucket: string, * name: string, * secretKey: string, - * type: string, - * baseURLForCanonicalHeader?: string, + * type: "AKENEO_PIM", + * baseUrlForCanonicalHeader?: string, * includeCanonicalHeader?: bool, * prefix?: string, * endpoint: string, * s3ForcePathStyle?: bool, - * baseURL: string, + * baseUrl: string, * forwardHostHeaderToOrigin?: bool, * clientEmail: string, * privateKey: string, * accountName: string, * container: string, * sasToken: string, - * clientID: string, + * clientId: string, * clientSecret: string, * password: string, * username: string, @@ -45,6 +45,7 @@ final class OriginUpdateParams implements BaseModel use SdkModel; use SdkParams; + /** @var "AKENEO_PIM" $type */ #[Api] public string $type = 'AKENEO_PIM'; @@ -72,8 +73,8 @@ final class OriginUpdateParams implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Api('baseUrlForCanonicalHeader', optional: true)] - public ?string $baseURLForCanonicalHeader; + #[Api(optional: true)] + public ?string $baseUrlForCanonicalHeader; /** * Whether to send a Canonical header. @@ -99,8 +100,8 @@ final class OriginUpdateParams implements BaseModel /** * Akeneo instance base URL. */ - #[Api('baseUrl')] - public string $baseURL; + #[Api] + public string $baseUrl; /** * Forward the Host header to origin? @@ -126,8 +127,8 @@ final class OriginUpdateParams implements BaseModel /** * Akeneo API client ID. */ - #[Api('clientId')] - public string $clientID; + #[Api] + public string $clientId; /** * Akeneo API client secret. @@ -158,13 +159,13 @@ final class OriginUpdateParams implements BaseModel * name: ..., * secretKey: ..., * endpoint: ..., - * baseURL: ..., + * baseUrl: ..., * clientEmail: ..., * privateKey: ..., * accountName: ..., * container: ..., * sasToken: ..., - * clientID: ..., + * clientId: ..., * clientSecret: ..., * password: ..., * username: ..., @@ -208,17 +209,17 @@ public static function with( string $name, string $secretKey, string $endpoint, - string $baseURL, + string $baseUrl, string $clientEmail, string $privateKey, string $accountName, string $container, string $sasToken, - string $clientID, + string $clientId, string $clientSecret, string $password, string $username, - ?string $baseURLForCanonicalHeader = null, + ?string $baseUrlForCanonicalHeader = null, ?bool $includeCanonicalHeader = null, ?string $prefix = null, ?bool $s3ForcePathStyle = null, @@ -231,18 +232,18 @@ public static function with( $obj->name = $name; $obj->secretKey = $secretKey; $obj->endpoint = $endpoint; - $obj->baseURL = $baseURL; + $obj->baseUrl = $baseUrl; $obj->clientEmail = $clientEmail; $obj->privateKey = $privateKey; $obj->accountName = $accountName; $obj->container = $container; $obj->sasToken = $sasToken; - $obj->clientID = $clientID; + $obj->clientId = $clientId; $obj->clientSecret = $clientSecret; $obj->password = $password; $obj->username = $username; - null !== $baseURLForCanonicalHeader && $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; null !== $prefix && $obj->prefix = $prefix; null !== $s3ForcePathStyle && $obj->s3ForcePathStyle = $s3ForcePathStyle; @@ -299,7 +300,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseURLForCanonicalHeader = $baseURLForCanonicalHeader; + $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; return $obj; } @@ -352,7 +353,7 @@ public function withS3ForcePathStyle(bool $s3ForcePathStyle): self public function withBaseURL(string $baseURL): self { $obj = clone $this; - $obj->baseURL = $baseURL; + $obj->baseUrl = $baseURL; return $obj; } @@ -415,7 +416,7 @@ public function withSasToken(string $sasToken): self public function withClientID(string $clientID): self { $obj = clone $this; - $obj->clientID = $clientID; + $obj->clientId = $clientID; return $obj; } diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php index 22264f1e..e12e7dfb 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php @@ -24,8 +24,7 @@ public static function discriminator(): string } /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php index 769a5e4d..63a33094 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php @@ -9,13 +9,14 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type AkamaiShape = array{type: string} + * @phpstan-type AkamaiShape = array{type: "AKAMAI"} */ final class Akamai implements BaseModel { /** @use SdkModel */ use SdkModel; + /** @var "AKAMAI" $type */ #[Api] public string $type = 'AKAMAI'; diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php index 41b2a75e..4fca97d5 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php @@ -10,7 +10,7 @@ /** * @phpstan-type CloudinaryShape = array{ - * type: string, preserveAssetDeliveryTypes?: bool + * type: "CLOUDINARY", preserveAssetDeliveryTypes?: bool|null * } */ final class Cloudinary implements BaseModel @@ -18,6 +18,7 @@ final class Cloudinary implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "CLOUDINARY" $type */ #[Api] public string $type = 'CLOUDINARY'; diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php index 7a80e3d3..444a6702 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php @@ -9,13 +9,14 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type ImgixShape = array{type: string} + * @phpstan-type ImgixShape = array{type: "IMGIX"} */ final class Imgix implements BaseModel { /** @use SdkModel */ use SdkModel; + /** @var "IMGIX" $type */ #[Api] public string $type = 'IMGIX'; diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest.php b/src/Accounts/URLEndpoints/URLEndpointRequest.php index 7ac95d42..0cf5f5bf 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest.php @@ -17,9 +17,9 @@ * * @phpstan-type URLEndpointRequestShape = array{ * description: string, - * origins?: list, - * urlPrefix?: string, - * urlRewriter?: Cloudinary|Imgix|Akamai, + * origins?: list|null, + * urlPrefix?: string|null, + * urlRewriter?: null|Cloudinary|Imgix|Akamai, * } */ final class URLEndpointRequest implements BaseModel diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php index 61bbc068..9e38453c 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php @@ -24,8 +24,7 @@ public static function discriminator(): string } /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php index 0c2bd81d..69c71709 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php @@ -9,13 +9,14 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type AkamaiShape = array{type: string} + * @phpstan-type AkamaiShape = array{type: "AKAMAI"} */ final class Akamai implements BaseModel { /** @use SdkModel */ use SdkModel; + /** @var "AKAMAI" $type */ #[Api] public string $type = 'AKAMAI'; diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php index ac59eeac..5b093623 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php @@ -10,7 +10,7 @@ /** * @phpstan-type CloudinaryShape = array{ - * type: string, preserveAssetDeliveryTypes?: bool + * type: "CLOUDINARY", preserveAssetDeliveryTypes?: bool|null * } */ final class Cloudinary implements BaseModel @@ -18,6 +18,7 @@ final class Cloudinary implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "CLOUDINARY" $type */ #[Api] public string $type = 'CLOUDINARY'; diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php index 4d46ee5f..40532eab 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php @@ -9,13 +9,14 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type ImgixShape = array{type: string} + * @phpstan-type ImgixShape = array{type: "IMGIX"} */ final class Imgix implements BaseModel { /** @use SdkModel */ use SdkModel; + /** @var "IMGIX" $type */ #[Api] public string $type = 'IMGIX'; diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse.php b/src/Accounts/URLEndpoints/URLEndpointResponse.php index 306bbf6e..f73efefb 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse.php @@ -22,7 +22,7 @@ * description: string, * origins: list, * urlPrefix: string, - * urlRewriter?: Cloudinary|Imgix|Akamai, + * urlRewriter?: null|Cloudinary|Imgix|Akamai, * } */ final class URLEndpointResponse implements BaseModel, ResponseConverter diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php index d91d8404..765d78eb 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php @@ -24,8 +24,7 @@ public static function discriminator(): string } /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php index 54d01443..25404af0 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php @@ -9,13 +9,14 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type AkamaiShape = array{type: string} + * @phpstan-type AkamaiShape = array{type: "AKAMAI"} */ final class Akamai implements BaseModel { /** @use SdkModel */ use SdkModel; + /** @var "AKAMAI" $type */ #[Api] public string $type = 'AKAMAI'; diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php index be3ed42e..34e3e009 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php @@ -10,7 +10,7 @@ /** * @phpstan-type CloudinaryShape = array{ - * preserveAssetDeliveryTypes: bool, type: string + * preserveAssetDeliveryTypes: bool, type: "CLOUDINARY" * } */ final class Cloudinary implements BaseModel @@ -18,6 +18,7 @@ final class Cloudinary implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "CLOUDINARY" $type */ #[Api] public string $type = 'CLOUDINARY'; diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php index c2065e22..1728d849 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php @@ -9,13 +9,14 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type ImgixShape = array{type: string} + * @phpstan-type ImgixShape = array{type: "IMGIX"} */ final class Imgix implements BaseModel { /** @use SdkModel */ use SdkModel; + /** @var "IMGIX" $type */ #[Api] public string $type = 'IMGIX'; diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php index 869e9ad8..9b451859 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php @@ -24,8 +24,7 @@ public static function discriminator(): string } /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php index bab24813..379b3a3a 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php @@ -9,13 +9,14 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type AkamaiShape = array{type: string} + * @phpstan-type AkamaiShape = array{type: "AKAMAI"} */ final class Akamai implements BaseModel { /** @use SdkModel */ use SdkModel; + /** @var "AKAMAI" $type */ #[Api] public string $type = 'AKAMAI'; diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php index 0c86e95b..e7c6f229 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php @@ -10,7 +10,7 @@ /** * @phpstan-type CloudinaryShape = array{ - * type: string, preserveAssetDeliveryTypes?: bool + * type: "CLOUDINARY", preserveAssetDeliveryTypes?: bool|null * } */ final class Cloudinary implements BaseModel @@ -18,6 +18,7 @@ final class Cloudinary implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "CLOUDINARY" $type */ #[Api] public string $type = 'CLOUDINARY'; diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php index bb7d1876..64b71ce7 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php @@ -9,13 +9,14 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type ImgixShape = array{type: string} + * @phpstan-type ImgixShape = array{type: "IMGIX"} */ final class Imgix implements BaseModel { /** @use SdkModel */ use SdkModel; + /** @var "IMGIX" $type */ #[Api] public string $type = 'IMGIX'; diff --git a/src/Accounts/Usage/UsageGetResponse.php b/src/Accounts/Usage/UsageGetResponse.php index 8c6e3b6c..628abccb 100644 --- a/src/Accounts/Usage/UsageGetResponse.php +++ b/src/Accounts/Usage/UsageGetResponse.php @@ -12,11 +12,11 @@ /** * @phpstan-type UsageGetResponseShape = array{ - * bandwidthBytes?: int, - * extensionUnitsCount?: int, - * mediaLibraryStorageBytes?: int, - * originalCacheStorageBytes?: int, - * videoProcessingUnitsCount?: int, + * bandwidthBytes?: int|null, + * extensionUnitsCount?: int|null, + * mediaLibraryStorageBytes?: int|null, + * originalCacheStorageBytes?: int|null, + * videoProcessingUnitsCount?: int|null, * } */ final class UsageGetResponse implements BaseModel, ResponseConverter diff --git a/src/Assets/AssetListResponseItem.php b/src/Assets/AssetListResponseItem.php index 9bd5301b..0d49d2e0 100644 --- a/src/Assets/AssetListResponseItem.php +++ b/src/Assets/AssetListResponseItem.php @@ -23,8 +23,7 @@ public static function discriminator(): string } /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/BaseOverlay.php b/src/BaseOverlay.php index 5edf2f7a..44dcfa05 100644 --- a/src/BaseOverlay.php +++ b/src/BaseOverlay.php @@ -10,7 +10,7 @@ /** * @phpstan-type BaseOverlayShape = array{ - * position?: OverlayPosition, timing?: OverlayTiming + * position?: OverlayPosition|null, timing?: OverlayTiming|null * } */ final class BaseOverlay implements BaseModel diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index 958aee91..f2f91a80 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -39,7 +39,7 @@ * token?: string, * checks?: string, * customCoordinates?: string, - * customMetadata?: array, + * customMetadata?: array, * description?: string, * extensions?: list, * folder?: string, @@ -53,7 +53,7 @@ * tags?: list, * transformation?: Transformation, * useUniqueFileName?: bool, - * webhookURL?: string, + * webhookUrl?: string, * } */ final class FileUploadParams implements BaseModel @@ -111,7 +111,7 @@ final class FileUploadParams implements BaseModel /** * JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. * - * @var array|null $customMetadata + * @var array|null $customMetadata */ #[Api(map: 'mixed', optional: true)] public ?array $customMetadata; @@ -223,8 +223,8 @@ final class FileUploadParams implements BaseModel /** * The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. */ - #[Api('webhookUrl', optional: true)] - public ?string $webhookURL; + #[Api(optional: true)] + public ?string $webhookUrl; /** * `new FileUploadParams()` is missing required properties by the API. @@ -250,7 +250,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param array $customMetadata + * @param array $customMetadata * @param list $extensions * @param list> $responseFields * @param list $tags @@ -275,7 +275,7 @@ public static function with( ?array $tags = null, ?Transformation $transformation = null, ?bool $useUniqueFileName = null, - ?string $webhookURL = null, + ?string $webhookUrl = null, ): self { $obj = new self; @@ -299,7 +299,7 @@ public static function with( null !== $tags && $obj->tags = $tags; null !== $transformation && $obj->transformation = $transformation; null !== $useUniqueFileName && $obj->useUniqueFileName = $useUniqueFileName; - null !== $webhookURL && $obj->webhookURL = $webhookURL; + null !== $webhookUrl && $obj->webhookUrl = $webhookUrl; return $obj; } @@ -378,7 +378,7 @@ public function withCustomCoordinates(string $customCoordinates): self /** * JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. * - * @param array $customMetadata + * @param array $customMetadata */ public function withCustomMetadata(array $customMetadata): self { @@ -564,7 +564,7 @@ public function withUseUniqueFileName(bool $useUniqueFileName): self public function withWebhookURL(string $webhookURL): self { $obj = clone $this; - $obj->webhookURL = $webhookURL; + $obj->webhookUrl = $webhookURL; return $obj; } diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation.php index 340ad782..5075d5ec 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation.php @@ -24,8 +24,8 @@ * You can mix and match any combination of post-processing types. * * @phpstan-type TransformationShape = array{ - * post?: list<\ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Transformation|GifToVideo|Thumbnail|Abs>, - * pre?: string, + * post?: list<\ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Transformation|GifToVideo|Thumbnail|Abs>|null, + * pre?: string|null, * } */ final class Transformation implements BaseModel diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php index 41763187..8c8f16d7 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php @@ -22,8 +22,7 @@ public static function discriminator(): string } /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php index b23f2906..bff5a2ee 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php @@ -11,7 +11,7 @@ /** * @phpstan-type AbsShape = array{ - * protocol: value-of, type: string, value: string + * protocol: value-of, type: "abs", value: string * } */ final class Abs implements BaseModel @@ -21,6 +21,8 @@ final class Abs implements BaseModel /** * Adaptive Bitrate Streaming (ABS) setup. + * + * @var "abs" $type */ #[Api] public string $type = 'abs'; diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php index dd541698..84002589 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type GifToVideoShape = array{type: string, value?: string} + * @phpstan-type GifToVideoShape = array{type: "gif-to-video", value?: string|null} */ final class GifToVideo implements BaseModel { @@ -18,6 +18,8 @@ final class GifToVideo implements BaseModel /** * Converts an animated GIF into an MP4. + * + * @var "gif-to-video" $type */ #[Api] public string $type = 'gif-to-video'; diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php index fa8b8673..c184880f 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type ThumbnailShape = array{type: string, value?: string} + * @phpstan-type ThumbnailShape = array{type: "thumbnail", value?: string|null} */ final class Thumbnail implements BaseModel { @@ -18,6 +18,8 @@ final class Thumbnail implements BaseModel /** * Generates a thumbnail image. + * + * @var "thumbnail" $type */ #[Api] public string $type = 'thumbnail'; diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php index 9d588c1c..436f9f92 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type TransformationShape = array{type: string, value: string} + * @phpstan-type TransformationShape = array{type: "transformation", value: string} */ final class Transformation implements BaseModel { @@ -18,6 +18,8 @@ final class Transformation implements BaseModel /** * Transformation type. + * + * @var "transformation" $type */ #[Api] public string $type = 'transformation'; diff --git a/src/Beta/V2/Files/FileUploadResponse.php b/src/Beta/V2/Files/FileUploadResponse.php index d7c3b53c..34f13599 100644 --- a/src/Beta/V2/Files/FileUploadResponse.php +++ b/src/Beta/V2/Files/FileUploadResponse.php @@ -19,31 +19,31 @@ * Object containing details of a successful upload. * * @phpstan-type FileUploadResponseShape = array{ - * aiTags?: list|null, - * audioCodec?: string, - * bitRate?: int, + * AITags?: list|null, + * audioCodec?: string|null, + * bitRate?: int|null, * customCoordinates?: string|null, - * customMetadata?: array, - * description?: string, - * duration?: int, - * embeddedMetadata?: array, - * extensionStatus?: ExtensionStatus, - * fileID?: string, - * filePath?: string, - * fileType?: string, - * height?: float, - * isPrivateFile?: bool, - * isPublished?: bool, - * metadata?: Metadata, - * name?: string, - * selectedFieldsSchema?: array, - * size?: float, + * customMetadata?: array|null, + * description?: string|null, + * duration?: int|null, + * embeddedMetadata?: array|null, + * extensionStatus?: ExtensionStatus|null, + * fileId?: string|null, + * filePath?: string|null, + * fileType?: string|null, + * height?: float|null, + * isPrivateFile?: bool|null, + * isPublished?: bool|null, + * metadata?: Metadata|null, + * name?: string|null, + * selectedFieldsSchema?: array|null, + * size?: float|null, * tags?: list|null, - * thumbnailURL?: string, - * url?: string, - * versionInfo?: VersionInfo, - * videoCodec?: string, - * width?: float, + * thumbnailUrl?: string|null, + * url?: string|null, + * versionInfo?: VersionInfo|null, + * videoCodec?: string|null, + * width?: float|null, * } */ final class FileUploadResponse implements BaseModel, ResponseConverter @@ -56,10 +56,10 @@ final class FileUploadResponse implements BaseModel, ResponseConverter /** * An array of tags assigned to the uploaded file by auto tagging. * - * @var list|null $aiTags + * @var list|null $AITags */ - #[Api('AITags', list: AITag::class, nullable: true, optional: true)] - public ?array $aiTags; + #[Api(list: AITag::class, nullable: true, optional: true)] + public ?array $AITags; /** * The audio codec used in the video (only for video). @@ -82,7 +82,7 @@ final class FileUploadResponse implements BaseModel, ResponseConverter /** * A key-value data associated with the asset. Use `responseField` in API request to get `customMetadata` in the upload API response. Before setting any custom metadata on an asset, you have to create the field using custom metadata fields API. Send `customMetadata` in `responseFields` in API request to get the value of this field. * - * @var array|null $customMetadata + * @var array|null $customMetadata */ #[Api(map: 'mixed', optional: true)] public ?array $customMetadata; @@ -102,7 +102,7 @@ final class FileUploadResponse implements BaseModel, ResponseConverter /** * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. Send `embeddedMetadata` in `responseFields` in API request to get embeddedMetadata in the upload API response. * - * @var array|null $embeddedMetadata + * @var array|null $embeddedMetadata */ #[Api(map: 'mixed', optional: true)] public ?array $embeddedMetadata; @@ -122,8 +122,8 @@ final class FileUploadResponse implements BaseModel, ResponseConverter /** * Unique fileId. Store this fileld in your database, as this will be used to perform update action on this file. */ - #[Api('fileId', optional: true)] - public ?string $fileID; + #[Api(optional: true)] + public ?string $fileId; /** * The relative path of the file in the media library e.g. `/marketing-assets/new-banner.jpg`. @@ -174,7 +174,7 @@ final class FileUploadResponse implements BaseModel, ResponseConverter * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @var array|null $selectedFieldsSchema + * @var array|null $selectedFieldsSchema */ #[Api(map: SelectedFieldsSchema::class, optional: true)] public ?array $selectedFieldsSchema; @@ -196,8 +196,8 @@ final class FileUploadResponse implements BaseModel, ResponseConverter /** * In the case of an image, a small thumbnail URL. */ - #[Api('thumbnailUrl', optional: true)] - public ?string $thumbnailURL; + #[Api(optional: true)] + public ?string $thumbnailUrl; /** * A publicly accessible URL of the file. @@ -233,14 +233,14 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list|null $aiTags - * @param array $customMetadata - * @param array $embeddedMetadata - * @param array $selectedFieldsSchema + * @param list|null $AITags + * @param array $customMetadata + * @param array $embeddedMetadata + * @param array $selectedFieldsSchema * @param list|null $tags */ public static function with( - ?array $aiTags = null, + ?array $AITags = null, ?string $audioCodec = null, ?int $bitRate = null, ?string $customCoordinates = null, @@ -249,7 +249,7 @@ public static function with( ?int $duration = null, ?array $embeddedMetadata = null, ?ExtensionStatus $extensionStatus = null, - ?string $fileID = null, + ?string $fileId = null, ?string $filePath = null, ?string $fileType = null, ?float $height = null, @@ -260,7 +260,7 @@ public static function with( ?array $selectedFieldsSchema = null, ?float $size = null, ?array $tags = null, - ?string $thumbnailURL = null, + ?string $thumbnailUrl = null, ?string $url = null, ?VersionInfo $versionInfo = null, ?string $videoCodec = null, @@ -268,7 +268,7 @@ public static function with( ): self { $obj = new self; - null !== $aiTags && $obj->aiTags = $aiTags; + null !== $AITags && $obj->AITags = $AITags; null !== $audioCodec && $obj->audioCodec = $audioCodec; null !== $bitRate && $obj->bitRate = $bitRate; null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; @@ -277,7 +277,7 @@ public static function with( null !== $duration && $obj->duration = $duration; null !== $embeddedMetadata && $obj->embeddedMetadata = $embeddedMetadata; null !== $extensionStatus && $obj->extensionStatus = $extensionStatus; - null !== $fileID && $obj->fileID = $fileID; + null !== $fileId && $obj->fileId = $fileId; null !== $filePath && $obj->filePath = $filePath; null !== $fileType && $obj->fileType = $fileType; null !== $height && $obj->height = $height; @@ -288,7 +288,7 @@ public static function with( null !== $selectedFieldsSchema && $obj->selectedFieldsSchema = $selectedFieldsSchema; null !== $size && $obj->size = $size; null !== $tags && $obj->tags = $tags; - null !== $thumbnailURL && $obj->thumbnailURL = $thumbnailURL; + null !== $thumbnailUrl && $obj->thumbnailUrl = $thumbnailUrl; null !== $url && $obj->url = $url; null !== $versionInfo && $obj->versionInfo = $versionInfo; null !== $videoCodec && $obj->videoCodec = $videoCodec; @@ -305,7 +305,7 @@ public static function with( public function withAITags(?array $aiTags): self { $obj = clone $this; - $obj->aiTags = $aiTags; + $obj->AITags = $aiTags; return $obj; } @@ -346,7 +346,7 @@ public function withCustomCoordinates(?string $customCoordinates): self /** * A key-value data associated with the asset. Use `responseField` in API request to get `customMetadata` in the upload API response. Before setting any custom metadata on an asset, you have to create the field using custom metadata fields API. Send `customMetadata` in `responseFields` in API request to get the value of this field. * - * @param array $customMetadata + * @param array $customMetadata */ public function withCustomMetadata(array $customMetadata): self { @@ -381,7 +381,7 @@ public function withDuration(int $duration): self /** * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. Send `embeddedMetadata` in `responseFields` in API request to get embeddedMetadata in the upload API response. * - * @param array $embeddedMetadata + * @param array $embeddedMetadata */ public function withEmbeddedMetadata(array $embeddedMetadata): self { @@ -414,7 +414,7 @@ public function withExtensionStatus(ExtensionStatus $extensionStatus): self public function withFileID(string $fileID): self { $obj = clone $this; - $obj->fileID = $fileID; + $obj->fileId = $fileID; return $obj; } @@ -503,7 +503,7 @@ public function withName(string $name): self * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @param array $selectedFieldsSchema + * @param array $selectedFieldsSchema */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { @@ -543,7 +543,7 @@ public function withTags(?array $tags): self public function withThumbnailURL(string $thumbnailURL): self { $obj = clone $this; - $obj->thumbnailURL = $thumbnailURL; + $obj->thumbnailUrl = $thumbnailURL; return $obj; } diff --git a/src/Beta/V2/Files/FileUploadResponse/AITag.php b/src/Beta/V2/Files/FileUploadResponse/AITag.php index 4ba0ec05..3a5eb82c 100644 --- a/src/Beta/V2/Files/FileUploadResponse/AITag.php +++ b/src/Beta/V2/Files/FileUploadResponse/AITag.php @@ -10,7 +10,7 @@ /** * @phpstan-type AITagShape = array{ - * confidence?: float, name?: string, source?: string + * confidence?: float|null, name?: string|null, source?: string|null * } */ final class AITag implements BaseModel diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php index be70b88b..f23bdb19 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php @@ -22,10 +22,10 @@ * If no extension was requested, then this parameter is not returned. * * @phpstan-type ExtensionStatusShape = array{ - * aiAutoDescription?: value-of, - * awsAutoTagging?: value-of, - * googleAutoTagging?: value-of, - * removeBg?: value-of, + * ai_auto_description?: value-of|null, + * aws_auto_tagging?: value-of|null, + * google_auto_tagging?: value-of|null, + * remove_bg?: value-of|null, * } */ final class ExtensionStatus implements BaseModel @@ -33,21 +33,21 @@ final class ExtensionStatus implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var value-of|null $aiAutoDescription */ + /** @var value-of|null $ai_auto_description */ #[Api('ai-auto-description', enum: AIAutoDescription::class, optional: true)] - public ?string $aiAutoDescription; + public ?string $ai_auto_description; - /** @var value-of|null $awsAutoTagging */ + /** @var value-of|null $aws_auto_tagging */ #[Api('aws-auto-tagging', enum: AwsAutoTagging::class, optional: true)] - public ?string $awsAutoTagging; + public ?string $aws_auto_tagging; - /** @var value-of|null $googleAutoTagging */ + /** @var value-of|null $google_auto_tagging */ #[Api('google-auto-tagging', enum: GoogleAutoTagging::class, optional: true)] - public ?string $googleAutoTagging; + public ?string $google_auto_tagging; - /** @var value-of|null $removeBg */ + /** @var value-of|null $remove_bg */ #[Api('remove-bg', enum: RemoveBg::class, optional: true)] - public ?string $removeBg; + public ?string $remove_bg; public function __construct() { @@ -59,23 +59,23 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AIAutoDescription|value-of $aiAutoDescription - * @param AwsAutoTagging|value-of $awsAutoTagging - * @param GoogleAutoTagging|value-of $googleAutoTagging - * @param RemoveBg|value-of $removeBg + * @param AIAutoDescription|value-of $ai_auto_description + * @param AwsAutoTagging|value-of $aws_auto_tagging + * @param GoogleAutoTagging|value-of $google_auto_tagging + * @param RemoveBg|value-of $remove_bg */ public static function with( - AIAutoDescription|string|null $aiAutoDescription = null, - AwsAutoTagging|string|null $awsAutoTagging = null, - GoogleAutoTagging|string|null $googleAutoTagging = null, - RemoveBg|string|null $removeBg = null, + AIAutoDescription|string|null $ai_auto_description = null, + AwsAutoTagging|string|null $aws_auto_tagging = null, + GoogleAutoTagging|string|null $google_auto_tagging = null, + RemoveBg|string|null $remove_bg = null, ): self { $obj = new self; - null !== $aiAutoDescription && $obj['aiAutoDescription'] = $aiAutoDescription; - null !== $awsAutoTagging && $obj['awsAutoTagging'] = $awsAutoTagging; - null !== $googleAutoTagging && $obj['googleAutoTagging'] = $googleAutoTagging; - null !== $removeBg && $obj['removeBg'] = $removeBg; + null !== $ai_auto_description && $obj['ai_auto_description'] = $ai_auto_description; + null !== $aws_auto_tagging && $obj['aws_auto_tagging'] = $aws_auto_tagging; + null !== $google_auto_tagging && $obj['google_auto_tagging'] = $google_auto_tagging; + null !== $remove_bg && $obj['remove_bg'] = $remove_bg; return $obj; } @@ -87,7 +87,7 @@ public function withAIAutoDescription( AIAutoDescription|string $aiAutoDescription ): self { $obj = clone $this; - $obj['aiAutoDescription'] = $aiAutoDescription; + $obj['ai_auto_description'] = $aiAutoDescription; return $obj; } @@ -99,7 +99,7 @@ public function withAwsAutoTagging( AwsAutoTagging|string $awsAutoTagging ): self { $obj = clone $this; - $obj['awsAutoTagging'] = $awsAutoTagging; + $obj['aws_auto_tagging'] = $awsAutoTagging; return $obj; } @@ -111,7 +111,7 @@ public function withGoogleAutoTagging( GoogleAutoTagging|string $googleAutoTagging ): self { $obj = clone $this; - $obj['googleAutoTagging'] = $googleAutoTagging; + $obj['google_auto_tagging'] = $googleAutoTagging; return $obj; } @@ -122,7 +122,7 @@ public function withGoogleAutoTagging( public function withRemoveBg(RemoveBg|string $removeBg): self { $obj = clone $this; - $obj['removeBg'] = $removeBg; + $obj['remove_bg'] = $removeBg; return $obj; } diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php index aeedf6bc..ab7b564f 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php @@ -14,15 +14,15 @@ /** * @phpstan-type SelectedFieldsSchemaShape = array{ * type: value-of, - * defaultValue?: string|float|bool|list, - * isValueRequired?: bool, - * maxLength?: float, - * maxValue?: string|float, - * minLength?: float, - * minValue?: string|float, - * readOnly?: bool, - * selectOptions?: list, - * selectOptionsTruncated?: bool, + * defaultValue?: string|float|bool|null|list, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * readOnly?: bool|null, + * selectOptions?: list|null, + * selectOptionsTruncated?: bool|null, * } */ final class SelectedFieldsSchema implements BaseModel diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php index 38496da7..95b65241 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php @@ -18,8 +18,7 @@ final class DefaultValue implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed.php index 71e66d9a..75472dea 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed.php @@ -13,8 +13,7 @@ final class Mixed implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php index 2487b667..63fe6ec3 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php @@ -16,8 +16,7 @@ final class MaxValue implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php index 9b9e769e..2f6f7441 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php @@ -16,8 +16,7 @@ final class MinValue implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php index b1411ab0..327b7c0a 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php @@ -13,8 +13,7 @@ final class SelectOption implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php b/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php index e8d0e5fb..168e2587 100644 --- a/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php +++ b/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php @@ -11,7 +11,7 @@ /** * An object containing the file or file version's `id` (versionId) and `name`. * - * @phpstan-type VersionInfoShape = array{id?: string, name?: string} + * @phpstan-type VersionInfoShape = array{id?: string|null, name?: string|null} */ final class VersionInfo implements BaseModel { diff --git a/src/Cache/Invalidation/InvalidationGetResponse.php b/src/Cache/Invalidation/InvalidationGetResponse.php index 53c0aea8..4affd876 100644 --- a/src/Cache/Invalidation/InvalidationGetResponse.php +++ b/src/Cache/Invalidation/InvalidationGetResponse.php @@ -12,7 +12,9 @@ use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** - * @phpstan-type InvalidationGetResponseShape = array{status?: value-of} + * @phpstan-type InvalidationGetResponseShape = array{ + * status?: value-of|null + * } */ final class InvalidationGetResponse implements BaseModel, ResponseConverter { diff --git a/src/Cache/Invalidation/InvalidationNewResponse.php b/src/Cache/Invalidation/InvalidationNewResponse.php index 1b38885c..909d870b 100644 --- a/src/Cache/Invalidation/InvalidationNewResponse.php +++ b/src/Cache/Invalidation/InvalidationNewResponse.php @@ -11,7 +11,7 @@ use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** - * @phpstan-type InvalidationNewResponseShape = array{requestID?: string} + * @phpstan-type InvalidationNewResponseShape = array{requestId?: string|null} */ final class InvalidationNewResponse implements BaseModel, ResponseConverter { @@ -23,8 +23,8 @@ final class InvalidationNewResponse implements BaseModel, ResponseConverter /** * Unique identifier of the purge request. This can be used to check the status of the purge request. */ - #[Api('requestId', optional: true)] - public ?string $requestID; + #[Api(optional: true)] + public ?string $requestId; public function __construct() { @@ -36,11 +36,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. */ - public static function with(?string $requestID = null): self + public static function with(?string $requestId = null): self { $obj = new self; - null !== $requestID && $obj->requestID = $requestID; + null !== $requestId && $obj->requestId = $requestId; return $obj; } @@ -51,7 +51,7 @@ public static function with(?string $requestID = null): self public function withRequestID(string $requestID): self { $obj = clone $this; - $obj->requestID = $requestID; + $obj->requestId = $requestID; return $obj; } diff --git a/src/Client.php b/src/Client.php index d4695500..e76ee04d 100644 --- a/src/Client.php +++ b/src/Client.php @@ -111,7 +111,7 @@ public function __construct( $this->webhooks = new WebhooksService($this); } - /** @return array */ + /** @return array */ protected function authHeaders(): array { if (!$this->privateKey && !$this->password) { diff --git a/src/Core/BaseClient.php b/src/Core/BaseClient.php index 907acc5b..be05bc19 100644 --- a/src/Core/BaseClient.php +++ b/src/Core/BaseClient.php @@ -24,8 +24,8 @@ * @phpstan-type normalized_request = array{ * method: string, * path: string, - * query: array, - * headers: array>, + * query: array, + * headers: array>, * body: mixed, * } */ @@ -36,7 +36,7 @@ abstract class BaseClient /** * @internal * - * @param array|null> $headers + * @param array|null> $headers */ public function __construct( protected array $headers, @@ -49,11 +49,11 @@ public function __construct( /** * @param string|list $path - * @param array $query - * @param array $headers + * @param array $query + * @param array $headers * @param class-string> $page * @param class-string> $stream - * @param RequestOptions|array|null $options + * @param RequestOptions|array|null $options */ public function request( string $method, @@ -102,7 +102,7 @@ public function request( return Util::decodeContent($rsp); } - /** @return array */ + /** @return array */ abstract protected function authHeaders(): array; protected function getNormalizedOS(): string @@ -159,15 +159,15 @@ protected function getNormalizedArchitecture(): string * @internal * * @param string|list $path - * @param array $query - * @param array|null> $headers + * @param array $query + * @param array|null> $headers * @param array{ * timeout?: float|null, * maxRetries?: int|null, * initialRetryDelay?: float|null, * maxRetryDelay?: float|null, - * extraHeaders?: array|null>|null, - * extraQueryParams?: array|null, + * extraHeaders?: array|null>|null, + * extraQueryParams?: array|null, * extraBodyParams?: mixed, * transporter?: ClientInterface|null, * uriFactory?: UriFactoryInterface|null, @@ -189,14 +189,14 @@ protected function buildRequest( $parsedPath = Util::parsePath($path); - /** @var array $mergedQuery */ + /** @var array $mergedQuery */ $mergedQuery = array_merge_recursive( $query, $options->extraQueryParams ?? [], ); $uri = Util::joinUri($this->baseUrl, path: $parsedPath, query: $mergedQuery)->__toString(); - /** @var array|null> $mergedHeaders */ + /** @var array|null> $mergedHeaders */ $mergedHeaders = [...$this->headers, ...$this->authHeaders(), ...$headers, @@ -276,8 +276,7 @@ protected function retryDelay( /** * @internal * - * @param bool|int|float|string|resource|\Traversable|array|null $data + * @param bool|int|float|string|resource|\Traversable|array|null $data */ protected function sendRequest( RequestOptions $opts, diff --git a/src/Core/Util.php b/src/Core/Util.php index 84dc703e..ba3232a3 100644 --- a/src/Core/Util.php +++ b/src/Core/Util.php @@ -26,7 +26,7 @@ final class Util public const JSONL_CONTENT_TYPE = '/^application\/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)/'; /** - * @return array + * @return array */ public static function get_object_vars(object $object1): array { @@ -36,10 +36,10 @@ public static function get_object_vars(object $object1): array /** * @template T * - * @param array $array - * @param array $map + * @param array $array + * @param array $map * - * @return array + * @return array */ public static function array_transform_keys(array $array, array $map): array { @@ -52,9 +52,9 @@ public static function array_transform_keys(array $array, array $map): array } /** - * @param array $arr + * @param array $arr * - * @return array + * @return array */ public static function array_filter_omit(array $arr): array { @@ -106,7 +106,7 @@ public static function parsePath(string|array $path): string } /** - * @param array $query + * @param array $query */ public static function joinUri( UriInterface $base, @@ -141,7 +141,7 @@ public static function joinUri( } /** - * @param array|null> $headers + * @param array|null> $headers */ public static function withSetHeaders( RequestInterface $req, @@ -182,8 +182,7 @@ public static function streamIterator(StreamInterface $stream): \Iterator } /** - * @param bool|int|float|string|resource|\Traversable|array|null $body + * @param bool|int|float|string|resource|\Traversable|array|null $body */ public static function withSetBody( StreamFactoryInterface $factory, @@ -409,8 +408,7 @@ private static function writeMultipartChunk( } /** - * @param bool|int|float|string|resource|\Traversable|array|null $body + * @param bool|int|float|string|resource|\Traversable|array|null $body * * @return array{string, \Generator} */ diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema.php b/src/CustomMetadataFields/CustomMetadataField/Schema.php index 3a205270..81bf0df3 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema.php @@ -16,13 +16,13 @@ * * @phpstan-type SchemaShape = array{ * type: value-of, - * defaultValue?: string|float|bool|list, - * isValueRequired?: bool, - * maxLength?: float, - * maxValue?: string|float, - * minLength?: float, - * minValue?: string|float, - * selectOptions?: list, + * defaultValue?: string|float|bool|null|list, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * selectOptions?: list|null, * } */ final class Schema implements BaseModel diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php index 3af28f2e..4d38f231 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php @@ -18,8 +18,7 @@ final class DefaultValue implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed.php b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed.php index eb17c055..61699711 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed.php @@ -13,8 +13,7 @@ final class Mixed implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/MaxValue.php b/src/CustomMetadataFields/CustomMetadataField/Schema/MaxValue.php index 98596244..16336da5 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/MaxValue.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/MaxValue.php @@ -16,8 +16,7 @@ final class MaxValue implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/MinValue.php b/src/CustomMetadataFields/CustomMetadataField/Schema/MinValue.php index 0f866656..2794ccd9 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/MinValue.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/MinValue.php @@ -16,8 +16,7 @@ final class MinValue implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/SelectOption.php b/src/CustomMetadataFields/CustomMetadataField/Schema/SelectOption.php index ab5d2a23..3f80ef4e 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/SelectOption.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/SelectOption.php @@ -13,8 +13,7 @@ final class SelectOption implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php index 55999dfa..8ac0e6ee 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php @@ -14,13 +14,13 @@ /** * @phpstan-type SchemaShape = array{ * type: value-of, - * defaultValue?: string|float|bool|list, - * isValueRequired?: bool, - * maxLength?: float, - * maxValue?: string|float, - * minLength?: float, - * minValue?: string|float, - * selectOptions?: list, + * defaultValue?: string|float|bool|null|list, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * selectOptions?: list|null, * } */ final class Schema implements BaseModel diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php index 1743cefa..ab34df3f 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php @@ -18,8 +18,7 @@ final class DefaultValue implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed.php index be50455d..6d1ff028 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed.php @@ -13,8 +13,7 @@ final class Mixed implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MaxValue.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MaxValue.php index 997c7234..b291b4e6 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MaxValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MaxValue.php @@ -16,8 +16,7 @@ final class MaxValue implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MinValue.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MinValue.php index 14041062..5eba5de8 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MinValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MinValue.php @@ -16,8 +16,7 @@ final class MinValue implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/SelectOption.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/SelectOption.php index 57718552..dff485c9 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/SelectOption.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/SelectOption.php @@ -13,8 +13,7 @@ final class SelectOption implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php index 3a25ede3..b63c9541 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php @@ -14,13 +14,13 @@ * An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. * * @phpstan-type SchemaShape = array{ - * defaultValue?: string|float|bool|list, - * isValueRequired?: bool, - * maxLength?: float, - * maxValue?: string|float, - * minLength?: float, - * minValue?: string|float, - * selectOptions?: list, + * defaultValue?: string|float|bool|null|list, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * selectOptions?: list|null, * } */ final class Schema implements BaseModel diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php index 6d79746b..78cc80d6 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php @@ -18,8 +18,7 @@ final class DefaultValue implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed.php index c8257310..2da1ea78 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed.php @@ -13,8 +13,7 @@ final class Mixed implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MaxValue.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MaxValue.php index 7c7f7ff8..66a3bdd5 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MaxValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MaxValue.php @@ -16,8 +16,7 @@ final class MaxValue implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MinValue.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MinValue.php index fadf1963..91500a80 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MinValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MinValue.php @@ -16,8 +16,7 @@ final class MinValue implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/SelectOption.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/SelectOption.php index 292832b0..689378ae 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/SelectOption.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/SelectOption.php @@ -13,8 +13,7 @@ final class SelectOption implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/ExtensionItem.php b/src/ExtensionItem.php index 3583b8d4..db1b2eba 100644 --- a/src/ExtensionItem.php +++ b/src/ExtensionItem.php @@ -21,8 +21,7 @@ public static function discriminator(): string } /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/ExtensionItem/AIAutoDescription.php b/src/ExtensionItem/AIAutoDescription.php index f8160d59..1a704e45 100644 --- a/src/ExtensionItem/AIAutoDescription.php +++ b/src/ExtensionItem/AIAutoDescription.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type AIAutoDescriptionShape = array{name: string} + * @phpstan-type AIAutoDescriptionShape = array{name: "ai-auto-description"} */ final class AIAutoDescription implements BaseModel { @@ -18,6 +18,8 @@ final class AIAutoDescription implements BaseModel /** * Specifies the auto description extension. + * + * @var "ai-auto-description" $name */ #[Api] public string $name = 'ai-auto-description'; diff --git a/src/ExtensionItem/RemoveBg.php b/src/ExtensionItem/RemoveBg.php index ea371aea..d22a7011 100644 --- a/src/ExtensionItem/RemoveBg.php +++ b/src/ExtensionItem/RemoveBg.php @@ -10,7 +10,7 @@ use ImageKit\ExtensionItem\RemoveBg\Options; /** - * @phpstan-type RemoveBgShape = array{name: string, options?: Options} + * @phpstan-type RemoveBgShape = array{name: "remove-bg", options?: Options|null} */ final class RemoveBg implements BaseModel { @@ -19,6 +19,8 @@ final class RemoveBg implements BaseModel /** * Specifies the background removal extension. + * + * @var "remove-bg" $name */ #[Api] public string $name = 'remove-bg'; diff --git a/src/ExtensionItem/RemoveBg/Options.php b/src/ExtensionItem/RemoveBg/Options.php index b2c691aa..84504f34 100644 --- a/src/ExtensionItem/RemoveBg/Options.php +++ b/src/ExtensionItem/RemoveBg/Options.php @@ -10,10 +10,10 @@ /** * @phpstan-type OptionsShape = array{ - * addShadow?: bool, - * bgColor?: string, - * bgImageURL?: string, - * semitransparency?: bool, + * add_shadow?: bool|null, + * bg_color?: string|null, + * bg_image_url?: string|null, + * semitransparency?: bool|null, * } */ final class Options implements BaseModel @@ -24,20 +24,20 @@ final class Options implements BaseModel /** * Whether to add an artificial shadow to the result. Default is false. Note: Adding shadows is currently only supported for car photos. */ - #[Api('add_shadow', optional: true)] - public ?bool $addShadow; + #[Api(optional: true)] + public ?bool $add_shadow; /** * Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or color name (e.g., "green"). If this parameter is set, `bg_image_url` must be empty. */ - #[Api('bg_color', optional: true)] - public ?string $bgColor; + #[Api(optional: true)] + public ?string $bg_color; /** * Sets a background image from a URL. If this parameter is set, `bg_color` must be empty. */ - #[Api('bg_image_url', optional: true)] - public ?string $bgImageURL; + #[Api(optional: true)] + public ?string $bg_image_url; /** * Allows semi-transparent regions in the result. Default is true. Note: Semitransparency is currently only supported for car windows. @@ -56,16 +56,16 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - ?bool $addShadow = null, - ?string $bgColor = null, - ?string $bgImageURL = null, + ?bool $add_shadow = null, + ?string $bg_color = null, + ?string $bg_image_url = null, ?bool $semitransparency = null, ): self { $obj = new self; - null !== $addShadow && $obj->addShadow = $addShadow; - null !== $bgColor && $obj->bgColor = $bgColor; - null !== $bgImageURL && $obj->bgImageURL = $bgImageURL; + null !== $add_shadow && $obj->add_shadow = $add_shadow; + null !== $bg_color && $obj->bg_color = $bg_color; + null !== $bg_image_url && $obj->bg_image_url = $bg_image_url; null !== $semitransparency && $obj->semitransparency = $semitransparency; return $obj; @@ -77,7 +77,7 @@ public static function with( public function withAddShadow(bool $addShadow): self { $obj = clone $this; - $obj->addShadow = $addShadow; + $obj->add_shadow = $addShadow; return $obj; } @@ -88,7 +88,7 @@ public function withAddShadow(bool $addShadow): self public function withBgColor(string $bgColor): self { $obj = clone $this; - $obj->bgColor = $bgColor; + $obj->bg_color = $bgColor; return $obj; } @@ -99,7 +99,7 @@ public function withBgColor(string $bgColor): self public function withBgImageURL(string $bgImageURL): self { $obj = clone $this; - $obj->bgImageURL = $bgImageURL; + $obj->bg_image_url = $bgImageURL; return $obj; } diff --git a/src/Files/Bulk/BulkAddTagsParams.php b/src/Files/Bulk/BulkAddTagsParams.php index f00d2724..1e0f944d 100644 --- a/src/Files/Bulk/BulkAddTagsParams.php +++ b/src/Files/Bulk/BulkAddTagsParams.php @@ -15,7 +15,7 @@ * @see ImageKit\Files\Bulk->addTags * * @phpstan-type BulkAddTagsParamsShape = array{ - * fileIDs: list, tags: list + * fileIds: list, tags: list * } */ final class BulkAddTagsParams implements BaseModel @@ -27,10 +27,10 @@ final class BulkAddTagsParams implements BaseModel /** * An array of fileIds to which you want to add tags. * - * @var list $fileIDs + * @var list $fileIds */ - #[Api('fileIds', list: 'string')] - public array $fileIDs; + #[Api(list: 'string')] + public array $fileIds; /** * An array of tags that you want to add to the files. @@ -45,7 +45,7 @@ final class BulkAddTagsParams implements BaseModel * * To enforce required parameters use * ``` - * BulkAddTagsParams::with(fileIDs: ..., tags: ...) + * BulkAddTagsParams::with(fileIds: ..., tags: ...) * ``` * * Otherwise ensure the following setters are called @@ -64,14 +64,14 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $fileIDs + * @param list $fileIds * @param list $tags */ - public static function with(array $fileIDs, array $tags): self + public static function with(array $fileIds, array $tags): self { $obj = new self; - $obj->fileIDs = $fileIDs; + $obj->fileIds = $fileIds; $obj->tags = $tags; return $obj; @@ -85,7 +85,7 @@ public static function with(array $fileIDs, array $tags): self public function withFileIDs(array $fileIDs): self { $obj = clone $this; - $obj->fileIDs = $fileIDs; + $obj->fileIds = $fileIDs; return $obj; } diff --git a/src/Files/Bulk/BulkAddTagsResponse.php b/src/Files/Bulk/BulkAddTagsResponse.php index fc1fda16..f53ab9ae 100644 --- a/src/Files/Bulk/BulkAddTagsResponse.php +++ b/src/Files/Bulk/BulkAddTagsResponse.php @@ -12,7 +12,7 @@ /** * @phpstan-type BulkAddTagsResponseShape = array{ - * successfullyUpdatedFileIDs?: list + * successfullyUpdatedFileIds?: list|null * } */ final class BulkAddTagsResponse implements BaseModel, ResponseConverter @@ -25,10 +25,10 @@ final class BulkAddTagsResponse implements BaseModel, ResponseConverter /** * An array of fileIds that in which tags were successfully added. * - * @var list|null $successfullyUpdatedFileIDs + * @var list|null $successfullyUpdatedFileIds */ - #[Api('successfullyUpdatedFileIds', list: 'string', optional: true)] - public ?array $successfullyUpdatedFileIDs; + #[Api(list: 'string', optional: true)] + public ?array $successfullyUpdatedFileIds; public function __construct() { @@ -40,13 +40,13 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $successfullyUpdatedFileIDs + * @param list $successfullyUpdatedFileIds */ - public static function with(?array $successfullyUpdatedFileIDs = null): self + public static function with(?array $successfullyUpdatedFileIds = null): self { $obj = new self; - null !== $successfullyUpdatedFileIDs && $obj->successfullyUpdatedFileIDs = $successfullyUpdatedFileIDs; + null !== $successfullyUpdatedFileIds && $obj->successfullyUpdatedFileIds = $successfullyUpdatedFileIds; return $obj; } @@ -60,7 +60,7 @@ public function withSuccessfullyUpdatedFileIDs( array $successfullyUpdatedFileIDs ): self { $obj = clone $this; - $obj->successfullyUpdatedFileIDs = $successfullyUpdatedFileIDs; + $obj->successfullyUpdatedFileIds = $successfullyUpdatedFileIDs; return $obj; } diff --git a/src/Files/Bulk/BulkDeleteParams.php b/src/Files/Bulk/BulkDeleteParams.php index b8c607b8..dd3306d8 100644 --- a/src/Files/Bulk/BulkDeleteParams.php +++ b/src/Files/Bulk/BulkDeleteParams.php @@ -18,7 +18,7 @@ * * @see ImageKit\Files\Bulk->delete * - * @phpstan-type BulkDeleteParamsShape = array{fileIDs: list} + * @phpstan-type BulkDeleteParamsShape = array{fileIds: list} */ final class BulkDeleteParams implements BaseModel { @@ -29,17 +29,17 @@ final class BulkDeleteParams implements BaseModel /** * An array of fileIds which you want to delete. * - * @var list $fileIDs + * @var list $fileIds */ - #[Api('fileIds', list: 'string')] - public array $fileIDs; + #[Api(list: 'string')] + public array $fileIds; /** * `new BulkDeleteParams()` is missing required properties by the API. * * To enforce required parameters use * ``` - * BulkDeleteParams::with(fileIDs: ...) + * BulkDeleteParams::with(fileIds: ...) * ``` * * Otherwise ensure the following setters are called @@ -58,13 +58,13 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $fileIDs + * @param list $fileIds */ - public static function with(array $fileIDs): self + public static function with(array $fileIds): self { $obj = new self; - $obj->fileIDs = $fileIDs; + $obj->fileIds = $fileIds; return $obj; } @@ -77,7 +77,7 @@ public static function with(array $fileIDs): self public function withFileIDs(array $fileIDs): self { $obj = clone $this; - $obj->fileIDs = $fileIDs; + $obj->fileIds = $fileIDs; return $obj; } diff --git a/src/Files/Bulk/BulkDeleteResponse.php b/src/Files/Bulk/BulkDeleteResponse.php index b10af059..80b6f678 100644 --- a/src/Files/Bulk/BulkDeleteResponse.php +++ b/src/Files/Bulk/BulkDeleteResponse.php @@ -12,7 +12,7 @@ /** * @phpstan-type BulkDeleteResponseShape = array{ - * successfullyDeletedFileIDs?: list + * successfullyDeletedFileIds?: list|null * } */ final class BulkDeleteResponse implements BaseModel, ResponseConverter @@ -25,10 +25,10 @@ final class BulkDeleteResponse implements BaseModel, ResponseConverter /** * An array of fileIds that were successfully deleted. * - * @var list|null $successfullyDeletedFileIDs + * @var list|null $successfullyDeletedFileIds */ - #[Api('successfullyDeletedFileIds', list: 'string', optional: true)] - public ?array $successfullyDeletedFileIDs; + #[Api(list: 'string', optional: true)] + public ?array $successfullyDeletedFileIds; public function __construct() { @@ -40,13 +40,13 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $successfullyDeletedFileIDs + * @param list $successfullyDeletedFileIds */ - public static function with(?array $successfullyDeletedFileIDs = null): self + public static function with(?array $successfullyDeletedFileIds = null): self { $obj = new self; - null !== $successfullyDeletedFileIDs && $obj->successfullyDeletedFileIDs = $successfullyDeletedFileIDs; + null !== $successfullyDeletedFileIds && $obj->successfullyDeletedFileIds = $successfullyDeletedFileIds; return $obj; } @@ -60,7 +60,7 @@ public function withSuccessfullyDeletedFileIDs( array $successfullyDeletedFileIDs ): self { $obj = clone $this; - $obj->successfullyDeletedFileIDs = $successfullyDeletedFileIDs; + $obj->successfullyDeletedFileIds = $successfullyDeletedFileIDs; return $obj; } diff --git a/src/Files/Bulk/BulkRemoveAITagsParams.php b/src/Files/Bulk/BulkRemoveAITagsParams.php index 44280e48..61459768 100644 --- a/src/Files/Bulk/BulkRemoveAITagsParams.php +++ b/src/Files/Bulk/BulkRemoveAITagsParams.php @@ -15,7 +15,7 @@ * @see ImageKit\Files\Bulk->removeAITags * * @phpstan-type BulkRemoveAITagsParamsShape = array{ - * aiTags: list, fileIDs: list + * AITags: list, fileIds: list * } */ final class BulkRemoveAITagsParams implements BaseModel @@ -27,25 +27,25 @@ final class BulkRemoveAITagsParams implements BaseModel /** * An array of AITags that you want to remove from the files. * - * @var list $aiTags + * @var list $AITags */ - #[Api('AITags', list: 'string')] - public array $aiTags; + #[Api(list: 'string')] + public array $AITags; /** * An array of fileIds from which you want to remove AITags. * - * @var list $fileIDs + * @var list $fileIds */ - #[Api('fileIds', list: 'string')] - public array $fileIDs; + #[Api(list: 'string')] + public array $fileIds; /** * `new BulkRemoveAITagsParams()` is missing required properties by the API. * * To enforce required parameters use * ``` - * BulkRemoveAITagsParams::with(aiTags: ..., fileIDs: ...) + * BulkRemoveAITagsParams::with(AITags: ..., fileIds: ...) * ``` * * Otherwise ensure the following setters are called @@ -64,15 +64,15 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $aiTags - * @param list $fileIDs + * @param list $AITags + * @param list $fileIds */ - public static function with(array $aiTags, array $fileIDs): self + public static function with(array $AITags, array $fileIds): self { $obj = new self; - $obj->aiTags = $aiTags; - $obj->fileIDs = $fileIDs; + $obj->AITags = $AITags; + $obj->fileIds = $fileIds; return $obj; } @@ -85,7 +85,7 @@ public static function with(array $aiTags, array $fileIDs): self public function withAITags(array $aiTags): self { $obj = clone $this; - $obj->aiTags = $aiTags; + $obj->AITags = $aiTags; return $obj; } @@ -98,7 +98,7 @@ public function withAITags(array $aiTags): self public function withFileIDs(array $fileIDs): self { $obj = clone $this; - $obj->fileIDs = $fileIDs; + $obj->fileIds = $fileIDs; return $obj; } diff --git a/src/Files/Bulk/BulkRemoveAITagsResponse.php b/src/Files/Bulk/BulkRemoveAITagsResponse.php index a1805ef0..f8dccd49 100644 --- a/src/Files/Bulk/BulkRemoveAITagsResponse.php +++ b/src/Files/Bulk/BulkRemoveAITagsResponse.php @@ -12,7 +12,7 @@ /** * @phpstan-type BulkRemoveAITagsResponseShape = array{ - * successfullyUpdatedFileIDs?: list + * successfullyUpdatedFileIds?: list|null * } */ final class BulkRemoveAITagsResponse implements BaseModel, ResponseConverter @@ -25,10 +25,10 @@ final class BulkRemoveAITagsResponse implements BaseModel, ResponseConverter /** * An array of fileIds that in which AITags were successfully removed. * - * @var list|null $successfullyUpdatedFileIDs + * @var list|null $successfullyUpdatedFileIds */ - #[Api('successfullyUpdatedFileIds', list: 'string', optional: true)] - public ?array $successfullyUpdatedFileIDs; + #[Api(list: 'string', optional: true)] + public ?array $successfullyUpdatedFileIds; public function __construct() { @@ -40,13 +40,13 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $successfullyUpdatedFileIDs + * @param list $successfullyUpdatedFileIds */ - public static function with(?array $successfullyUpdatedFileIDs = null): self + public static function with(?array $successfullyUpdatedFileIds = null): self { $obj = new self; - null !== $successfullyUpdatedFileIDs && $obj->successfullyUpdatedFileIDs = $successfullyUpdatedFileIDs; + null !== $successfullyUpdatedFileIds && $obj->successfullyUpdatedFileIds = $successfullyUpdatedFileIds; return $obj; } @@ -60,7 +60,7 @@ public function withSuccessfullyUpdatedFileIDs( array $successfullyUpdatedFileIDs ): self { $obj = clone $this; - $obj->successfullyUpdatedFileIDs = $successfullyUpdatedFileIDs; + $obj->successfullyUpdatedFileIds = $successfullyUpdatedFileIDs; return $obj; } diff --git a/src/Files/Bulk/BulkRemoveTagsParams.php b/src/Files/Bulk/BulkRemoveTagsParams.php index bba46d2f..bea1085b 100644 --- a/src/Files/Bulk/BulkRemoveTagsParams.php +++ b/src/Files/Bulk/BulkRemoveTagsParams.php @@ -15,7 +15,7 @@ * @see ImageKit\Files\Bulk->removeTags * * @phpstan-type BulkRemoveTagsParamsShape = array{ - * fileIDs: list, tags: list + * fileIds: list, tags: list * } */ final class BulkRemoveTagsParams implements BaseModel @@ -27,10 +27,10 @@ final class BulkRemoveTagsParams implements BaseModel /** * An array of fileIds from which you want to remove tags. * - * @var list $fileIDs + * @var list $fileIds */ - #[Api('fileIds', list: 'string')] - public array $fileIDs; + #[Api(list: 'string')] + public array $fileIds; /** * An array of tags that you want to remove from the files. @@ -45,7 +45,7 @@ final class BulkRemoveTagsParams implements BaseModel * * To enforce required parameters use * ``` - * BulkRemoveTagsParams::with(fileIDs: ..., tags: ...) + * BulkRemoveTagsParams::with(fileIds: ..., tags: ...) * ``` * * Otherwise ensure the following setters are called @@ -64,14 +64,14 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $fileIDs + * @param list $fileIds * @param list $tags */ - public static function with(array $fileIDs, array $tags): self + public static function with(array $fileIds, array $tags): self { $obj = new self; - $obj->fileIDs = $fileIDs; + $obj->fileIds = $fileIds; $obj->tags = $tags; return $obj; @@ -85,7 +85,7 @@ public static function with(array $fileIDs, array $tags): self public function withFileIDs(array $fileIDs): self { $obj = clone $this; - $obj->fileIDs = $fileIDs; + $obj->fileIds = $fileIDs; return $obj; } diff --git a/src/Files/Bulk/BulkRemoveTagsResponse.php b/src/Files/Bulk/BulkRemoveTagsResponse.php index bae6c446..4323db6a 100644 --- a/src/Files/Bulk/BulkRemoveTagsResponse.php +++ b/src/Files/Bulk/BulkRemoveTagsResponse.php @@ -12,7 +12,7 @@ /** * @phpstan-type BulkRemoveTagsResponseShape = array{ - * successfullyUpdatedFileIDs?: list + * successfullyUpdatedFileIds?: list|null * } */ final class BulkRemoveTagsResponse implements BaseModel, ResponseConverter @@ -25,10 +25,10 @@ final class BulkRemoveTagsResponse implements BaseModel, ResponseConverter /** * An array of fileIds that in which tags were successfully removed. * - * @var list|null $successfullyUpdatedFileIDs + * @var list|null $successfullyUpdatedFileIds */ - #[Api('successfullyUpdatedFileIds', list: 'string', optional: true)] - public ?array $successfullyUpdatedFileIDs; + #[Api(list: 'string', optional: true)] + public ?array $successfullyUpdatedFileIds; public function __construct() { @@ -40,13 +40,13 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $successfullyUpdatedFileIDs + * @param list $successfullyUpdatedFileIds */ - public static function with(?array $successfullyUpdatedFileIDs = null): self + public static function with(?array $successfullyUpdatedFileIds = null): self { $obj = new self; - null !== $successfullyUpdatedFileIDs && $obj->successfullyUpdatedFileIDs = $successfullyUpdatedFileIDs; + null !== $successfullyUpdatedFileIds && $obj->successfullyUpdatedFileIds = $successfullyUpdatedFileIds; return $obj; } @@ -60,7 +60,7 @@ public function withSuccessfullyUpdatedFileIDs( array $successfullyUpdatedFileIDs ): self { $obj = clone $this; - $obj->successfullyUpdatedFileIDs = $successfullyUpdatedFileIDs; + $obj->successfullyUpdatedFileIds = $successfullyUpdatedFileIDs; return $obj; } diff --git a/src/Files/File.php b/src/Files/File.php index 8d0df942..6ddfa189 100644 --- a/src/Files/File.php +++ b/src/Files/File.php @@ -18,29 +18,29 @@ * Object containing details of a file or file version. * * @phpstan-type FileShape = array{ - * aiTags?: list|null, - * createdAt?: \DateTimeInterface, + * AITags?: list|null, + * createdAt?: \DateTimeInterface|null, * customCoordinates?: string|null, - * customMetadata?: array, - * description?: string, - * fileID?: string, - * filePath?: string, - * fileType?: string, - * hasAlpha?: bool, - * height?: float, - * isPrivateFile?: bool, - * isPublished?: bool, - * mime?: string, - * name?: string, - * selectedFieldsSchema?: array, - * size?: float, + * customMetadata?: array|null, + * description?: string|null, + * fileId?: string|null, + * filePath?: string|null, + * fileType?: string|null, + * hasAlpha?: bool|null, + * height?: float|null, + * isPrivateFile?: bool|null, + * isPublished?: bool|null, + * mime?: string|null, + * name?: string|null, + * selectedFieldsSchema?: array|null, + * size?: float|null, * tags?: list|null, - * thumbnail?: string, - * type?: value-of, - * updatedAt?: \DateTimeInterface, - * url?: string, - * versionInfo?: VersionInfo, - * width?: float, + * thumbnail?: string|null, + * type?: value-of|null, + * updatedAt?: \DateTimeInterface|null, + * url?: string|null, + * versionInfo?: VersionInfo|null, + * width?: float|null, * } */ final class File implements BaseModel, ResponseConverter @@ -53,10 +53,10 @@ final class File implements BaseModel, ResponseConverter /** * An array of tags assigned to the file by auto tagging. * - * @var list|null $aiTags + * @var list|null $AITags */ - #[Api('AITags', list: AITag::class, nullable: true, optional: true)] - public ?array $aiTags; + #[Api(list: AITag::class, nullable: true, optional: true)] + public ?array $AITags; /** * Date and time when the file was uploaded. The date and time is in ISO8601 format. @@ -73,7 +73,7 @@ final class File implements BaseModel, ResponseConverter /** * An object with custom metadata for the file. * - * @var array|null $customMetadata + * @var array|null $customMetadata */ #[Api(map: 'mixed', optional: true)] public ?array $customMetadata; @@ -87,8 +87,8 @@ final class File implements BaseModel, ResponseConverter /** * Unique identifier of the asset. */ - #[Api('fileId', optional: true)] - public ?string $fileID; + #[Api(optional: true)] + public ?string $fileId; /** * Path of the file. This is the path you would use in the URL to access the file. For example, if the file is at the root of the media library, the path will be `/file.jpg`. If the file is inside a folder named `images`, the path will be `/images/file.jpg`. @@ -145,7 +145,7 @@ final class File implements BaseModel, ResponseConverter * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @var array|null $selectedFieldsSchema + * @var array|null $selectedFieldsSchema */ #[Api(map: SelectedFieldsSchema::class, optional: true)] public ?array $selectedFieldsSchema; @@ -212,19 +212,19 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list|null $aiTags - * @param array $customMetadata - * @param array $selectedFieldsSchema + * @param list|null $AITags + * @param array $customMetadata + * @param array $selectedFieldsSchema * @param list|null $tags * @param Type|value-of $type */ public static function with( - ?array $aiTags = null, + ?array $AITags = null, ?\DateTimeInterface $createdAt = null, ?string $customCoordinates = null, ?array $customMetadata = null, ?string $description = null, - ?string $fileID = null, + ?string $fileId = null, ?string $filePath = null, ?string $fileType = null, ?bool $hasAlpha = null, @@ -245,12 +245,12 @@ public static function with( ): self { $obj = new self; - null !== $aiTags && $obj->aiTags = $aiTags; + null !== $AITags && $obj->AITags = $AITags; null !== $createdAt && $obj->createdAt = $createdAt; null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; null !== $customMetadata && $obj->customMetadata = $customMetadata; null !== $description && $obj->description = $description; - null !== $fileID && $obj->fileID = $fileID; + null !== $fileId && $obj->fileId = $fileId; null !== $filePath && $obj->filePath = $filePath; null !== $fileType && $obj->fileType = $fileType; null !== $hasAlpha && $obj->hasAlpha = $hasAlpha; @@ -280,7 +280,7 @@ public static function with( public function withAITags(?array $aiTags): self { $obj = clone $this; - $obj->aiTags = $aiTags; + $obj->AITags = $aiTags; return $obj; } @@ -310,7 +310,7 @@ public function withCustomCoordinates(?string $customCoordinates): self /** * An object with custom metadata for the file. * - * @param array $customMetadata + * @param array $customMetadata */ public function withCustomMetadata(array $customMetadata): self { @@ -337,7 +337,7 @@ public function withDescription(string $description): self public function withFileID(string $fileID): self { $obj = clone $this; - $obj->fileID = $fileID; + $obj->fileId = $fileID; return $obj; } @@ -437,7 +437,7 @@ public function withName(string $name): self * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @param array $selectedFieldsSchema + * @param array $selectedFieldsSchema */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { diff --git a/src/Files/File/AITag.php b/src/Files/File/AITag.php index 8b51d0c8..7adaa23d 100644 --- a/src/Files/File/AITag.php +++ b/src/Files/File/AITag.php @@ -10,7 +10,7 @@ /** * @phpstan-type AITagShape = array{ - * confidence?: float, name?: string, source?: string + * confidence?: float|null, name?: string|null, source?: string|null * } */ final class AITag implements BaseModel diff --git a/src/Files/File/SelectedFieldsSchema.php b/src/Files/File/SelectedFieldsSchema.php index ac121787..b4ba9d82 100644 --- a/src/Files/File/SelectedFieldsSchema.php +++ b/src/Files/File/SelectedFieldsSchema.php @@ -14,15 +14,15 @@ /** * @phpstan-type SelectedFieldsSchemaShape = array{ * type: value-of, - * defaultValue?: string|float|bool|list, - * isValueRequired?: bool, - * maxLength?: float, - * maxValue?: string|float, - * minLength?: float, - * minValue?: string|float, - * readOnly?: bool, - * selectOptions?: list, - * selectOptionsTruncated?: bool, + * defaultValue?: string|float|bool|null|list, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * readOnly?: bool|null, + * selectOptions?: list|null, + * selectOptionsTruncated?: bool|null, * } */ final class SelectedFieldsSchema implements BaseModel diff --git a/src/Files/File/SelectedFieldsSchema/DefaultValue.php b/src/Files/File/SelectedFieldsSchema/DefaultValue.php index 27a8e38c..0a59980c 100644 --- a/src/Files/File/SelectedFieldsSchema/DefaultValue.php +++ b/src/Files/File/SelectedFieldsSchema/DefaultValue.php @@ -18,8 +18,7 @@ final class DefaultValue implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed.php b/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed.php index 4170bb61..5986006e 100644 --- a/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed.php +++ b/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed.php @@ -13,8 +13,7 @@ final class Mixed implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Files/File/SelectedFieldsSchema/MaxValue.php b/src/Files/File/SelectedFieldsSchema/MaxValue.php index c0556987..abf7b59b 100644 --- a/src/Files/File/SelectedFieldsSchema/MaxValue.php +++ b/src/Files/File/SelectedFieldsSchema/MaxValue.php @@ -16,8 +16,7 @@ final class MaxValue implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Files/File/SelectedFieldsSchema/MinValue.php b/src/Files/File/SelectedFieldsSchema/MinValue.php index fa356a3e..e9601410 100644 --- a/src/Files/File/SelectedFieldsSchema/MinValue.php +++ b/src/Files/File/SelectedFieldsSchema/MinValue.php @@ -16,8 +16,7 @@ final class MinValue implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Files/File/SelectedFieldsSchema/SelectOption.php b/src/Files/File/SelectedFieldsSchema/SelectOption.php index 25bd9294..0ea2f82e 100644 --- a/src/Files/File/SelectedFieldsSchema/SelectOption.php +++ b/src/Files/File/SelectedFieldsSchema/SelectOption.php @@ -13,8 +13,7 @@ final class SelectOption implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Files/File/VersionInfo.php b/src/Files/File/VersionInfo.php index 246315cb..ab1b59c1 100644 --- a/src/Files/File/VersionInfo.php +++ b/src/Files/File/VersionInfo.php @@ -11,7 +11,7 @@ /** * An object with details of the file version. * - * @phpstan-type VersionInfoShape = array{id?: string, name?: string} + * @phpstan-type VersionInfoShape = array{id?: string|null, name?: string|null} */ final class VersionInfo implements BaseModel { diff --git a/src/Files/FileRenameResponse.php b/src/Files/FileRenameResponse.php index d7cb83c8..c331d934 100644 --- a/src/Files/FileRenameResponse.php +++ b/src/Files/FileRenameResponse.php @@ -11,7 +11,7 @@ use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** - * @phpstan-type FileRenameResponseShape = array{purgeRequestID?: string} + * @phpstan-type FileRenameResponseShape = array{purgeRequestId?: string|null} */ final class FileRenameResponse implements BaseModel, ResponseConverter { @@ -23,8 +23,8 @@ final class FileRenameResponse implements BaseModel, ResponseConverter /** * Unique identifier of the purge request. This can be used to check the status of the purge request. */ - #[Api('purgeRequestId', optional: true)] - public ?string $purgeRequestID; + #[Api(optional: true)] + public ?string $purgeRequestId; public function __construct() { @@ -36,11 +36,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. */ - public static function with(?string $purgeRequestID = null): self + public static function with(?string $purgeRequestId = null): self { $obj = new self; - null !== $purgeRequestID && $obj->purgeRequestID = $purgeRequestID; + null !== $purgeRequestId && $obj->purgeRequestId = $purgeRequestId; return $obj; } @@ -51,7 +51,7 @@ public static function with(?string $purgeRequestID = null): self public function withPurgeRequestID(string $purgeRequestID): self { $obj = clone $this; - $obj->purgeRequestID = $purgeRequestID; + $obj->purgeRequestId = $purgeRequestID; return $obj; } diff --git a/src/Files/FileUpdateParams.php b/src/Files/FileUpdateParams.php index 3788fec7..274e6839 100644 --- a/src/Files/FileUpdateParams.php +++ b/src/Files/FileUpdateParams.php @@ -22,12 +22,12 @@ * * @phpstan-type FileUpdateParamsShape = array{ * customCoordinates?: string|null, - * customMetadata?: array, + * customMetadata?: array, * description?: string, * extensions?: list, - * removeAITags?: string|list, + * removeAITags?: "all"|list, * tags?: list|null, - * webhookURL?: string, + * webhookUrl?: string, * publish?: Publish, * } */ @@ -46,7 +46,7 @@ final class FileUpdateParams implements BaseModel /** * A key-value data to be associated with the asset. To unset a key, send `null` value for that key. Before setting any custom metadata on an asset you have to create the field using custom metadata fields API. * - * @var array|null $customMetadata + * @var array|null $customMetadata */ #[Api(map: 'mixed', optional: true)] public ?array $customMetadata; @@ -72,7 +72,7 @@ final class FileUpdateParams implements BaseModel * * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. * - * @var string|list|null $removeAITags + * @var "all"|list|null $removeAITags */ #[Api(union: RemoveAITags::class, optional: true)] public string|array|null $removeAITags; @@ -88,8 +88,8 @@ final class FileUpdateParams implements BaseModel /** * The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. */ - #[Api('webhookUrl', optional: true)] - public ?string $webhookURL; + #[Api(optional: true)] + public ?string $webhookUrl; /** * Configure the publication status of a file and its versions. @@ -107,9 +107,9 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param array $customMetadata + * @param array $customMetadata * @param list $extensions - * @param string|list $removeAITags + * @param "all"|list $removeAITags * @param list|null $tags */ public static function with( @@ -119,7 +119,7 @@ public static function with( ?array $extensions = null, string|array|null $removeAITags = null, ?array $tags = null, - ?string $webhookURL = null, + ?string $webhookUrl = null, ?Publish $publish = null, ): self { $obj = new self; @@ -130,7 +130,7 @@ public static function with( null !== $extensions && $obj->extensions = $extensions; null !== $removeAITags && $obj->removeAITags = $removeAITags; null !== $tags && $obj->tags = $tags; - null !== $webhookURL && $obj->webhookURL = $webhookURL; + null !== $webhookUrl && $obj->webhookUrl = $webhookUrl; null !== $publish && $obj->publish = $publish; return $obj; @@ -150,7 +150,7 @@ public function withCustomCoordinates(?string $customCoordinates): self /** * A key-value data to be associated with the asset. To unset a key, send `null` value for that key. Before setting any custom metadata on an asset you have to create the field using custom metadata fields API. * - * @param array $customMetadata + * @param array $customMetadata */ public function withCustomMetadata(array $customMetadata): self { @@ -191,7 +191,7 @@ public function withExtensions(array $extensions): self * * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. * - * @param string|list $removeAITags + * @param "all"|list $removeAITags */ public function withRemoveAITags(string|array $removeAITags): self { @@ -220,7 +220,7 @@ public function withTags(?array $tags): self public function withWebhookURL(string $webhookURL): self { $obj = clone $this; - $obj->webhookURL = $webhookURL; + $obj->webhookUrl = $webhookURL; return $obj; } diff --git a/src/Files/FileUpdateParams/Publish.php b/src/Files/FileUpdateParams/Publish.php index 17b6d5b8..322c55fa 100644 --- a/src/Files/FileUpdateParams/Publish.php +++ b/src/Files/FileUpdateParams/Publish.php @@ -12,7 +12,7 @@ * Configure the publication status of a file and its versions. * * @phpstan-type PublishShape = array{ - * isPublished: bool, includeFileVersions?: bool + * isPublished: bool, includeFileVersions?: bool|null * } */ final class Publish implements BaseModel diff --git a/src/Files/FileUpdateParams/RemoveAITags.php b/src/Files/FileUpdateParams/RemoveAITags.php index 14e111d8..c02f53a7 100644 --- a/src/Files/FileUpdateParams/RemoveAITags.php +++ b/src/Files/FileUpdateParams/RemoveAITags.php @@ -21,8 +21,7 @@ final class RemoveAITags implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Files/FileUpdateResponse.php b/src/Files/FileUpdateResponse.php index 7496568a..9e9147fa 100644 --- a/src/Files/FileUpdateResponse.php +++ b/src/Files/FileUpdateResponse.php @@ -19,30 +19,30 @@ * Object containing details of a file or file version. * * @phpstan-type FileUpdateResponseShape = array{ - * aiTags?: list|null, - * createdAt?: \DateTimeInterface, + * AITags?: list|null, + * createdAt?: \DateTimeInterface|null, * customCoordinates?: string|null, - * customMetadata?: array, - * description?: string, - * fileID?: string, - * filePath?: string, - * fileType?: string, - * hasAlpha?: bool, - * height?: float, - * isPrivateFile?: bool, - * isPublished?: bool, - * mime?: string, - * name?: string, - * selectedFieldsSchema?: array, - * size?: float, + * customMetadata?: array|null, + * description?: string|null, + * fileId?: string|null, + * filePath?: string|null, + * fileType?: string|null, + * hasAlpha?: bool|null, + * height?: float|null, + * isPrivateFile?: bool|null, + * isPublished?: bool|null, + * mime?: string|null, + * name?: string|null, + * selectedFieldsSchema?: array|null, + * size?: float|null, * tags?: list|null, - * thumbnail?: string, - * type?: value-of, - * updatedAt?: \DateTimeInterface, - * url?: string, - * versionInfo?: VersionInfo, - * width?: float, - * extensionStatus?: ExtensionStatus, + * thumbnail?: string|null, + * type?: value-of|null, + * updatedAt?: \DateTimeInterface|null, + * url?: string|null, + * versionInfo?: VersionInfo|null, + * width?: float|null, + * extensionStatus?: ExtensionStatus|null, * } */ final class FileUpdateResponse implements BaseModel, ResponseConverter @@ -55,10 +55,10 @@ final class FileUpdateResponse implements BaseModel, ResponseConverter /** * An array of tags assigned to the file by auto tagging. * - * @var list|null $aiTags + * @var list|null $AITags */ - #[Api('AITags', list: AITag::class, nullable: true, optional: true)] - public ?array $aiTags; + #[Api(list: AITag::class, nullable: true, optional: true)] + public ?array $AITags; /** * Date and time when the file was uploaded. The date and time is in ISO8601 format. @@ -75,7 +75,7 @@ final class FileUpdateResponse implements BaseModel, ResponseConverter /** * An object with custom metadata for the file. * - * @var array|null $customMetadata + * @var array|null $customMetadata */ #[Api(map: 'mixed', optional: true)] public ?array $customMetadata; @@ -89,8 +89,8 @@ final class FileUpdateResponse implements BaseModel, ResponseConverter /** * Unique identifier of the asset. */ - #[Api('fileId', optional: true)] - public ?string $fileID; + #[Api(optional: true)] + public ?string $fileId; /** * Path of the file. This is the path you would use in the URL to access the file. For example, if the file is at the root of the media library, the path will be `/file.jpg`. If the file is inside a folder named `images`, the path will be `/images/file.jpg`. @@ -147,7 +147,7 @@ final class FileUpdateResponse implements BaseModel, ResponseConverter * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @var array|null $selectedFieldsSchema + * @var array|null $selectedFieldsSchema */ #[Api(map: SelectedFieldsSchema::class, optional: true)] public ?array $selectedFieldsSchema; @@ -217,19 +217,19 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list|null $aiTags - * @param array $customMetadata - * @param array $selectedFieldsSchema + * @param list|null $AITags + * @param array $customMetadata + * @param array $selectedFieldsSchema * @param list|null $tags * @param Type|value-of $type */ public static function with( - ?array $aiTags = null, + ?array $AITags = null, ?\DateTimeInterface $createdAt = null, ?string $customCoordinates = null, ?array $customMetadata = null, ?string $description = null, - ?string $fileID = null, + ?string $fileId = null, ?string $filePath = null, ?string $fileType = null, ?bool $hasAlpha = null, @@ -251,12 +251,12 @@ public static function with( ): self { $obj = new self; - null !== $aiTags && $obj->aiTags = $aiTags; + null !== $AITags && $obj->AITags = $AITags; null !== $createdAt && $obj->createdAt = $createdAt; null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; null !== $customMetadata && $obj->customMetadata = $customMetadata; null !== $description && $obj->description = $description; - null !== $fileID && $obj->fileID = $fileID; + null !== $fileId && $obj->fileId = $fileId; null !== $filePath && $obj->filePath = $filePath; null !== $fileType && $obj->fileType = $fileType; null !== $hasAlpha && $obj->hasAlpha = $hasAlpha; @@ -287,7 +287,7 @@ public static function with( public function withAITags(?array $aiTags): self { $obj = clone $this; - $obj->aiTags = $aiTags; + $obj->AITags = $aiTags; return $obj; } @@ -317,7 +317,7 @@ public function withCustomCoordinates(?string $customCoordinates): self /** * An object with custom metadata for the file. * - * @param array $customMetadata + * @param array $customMetadata */ public function withCustomMetadata(array $customMetadata): self { @@ -344,7 +344,7 @@ public function withDescription(string $description): self public function withFileID(string $fileID): self { $obj = clone $this; - $obj->fileID = $fileID; + $obj->fileId = $fileID; return $obj; } @@ -444,7 +444,7 @@ public function withName(string $name): self * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @param array $selectedFieldsSchema + * @param array $selectedFieldsSchema */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { diff --git a/src/Files/FileUpdateResponse/ExtensionStatus.php b/src/Files/FileUpdateResponse/ExtensionStatus.php index 0f2702b7..6333cd69 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus.php @@ -14,10 +14,10 @@ /** * @phpstan-type ExtensionStatusShape = array{ - * aiAutoDescription?: value-of, - * awsAutoTagging?: value-of, - * googleAutoTagging?: value-of, - * removeBg?: value-of, + * ai_auto_description?: value-of|null, + * aws_auto_tagging?: value-of|null, + * google_auto_tagging?: value-of|null, + * remove_bg?: value-of|null, * } */ final class ExtensionStatus implements BaseModel @@ -25,21 +25,21 @@ final class ExtensionStatus implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var value-of|null $aiAutoDescription */ + /** @var value-of|null $ai_auto_description */ #[Api('ai-auto-description', enum: AIAutoDescription::class, optional: true)] - public ?string $aiAutoDescription; + public ?string $ai_auto_description; - /** @var value-of|null $awsAutoTagging */ + /** @var value-of|null $aws_auto_tagging */ #[Api('aws-auto-tagging', enum: AwsAutoTagging::class, optional: true)] - public ?string $awsAutoTagging; + public ?string $aws_auto_tagging; - /** @var value-of|null $googleAutoTagging */ + /** @var value-of|null $google_auto_tagging */ #[Api('google-auto-tagging', enum: GoogleAutoTagging::class, optional: true)] - public ?string $googleAutoTagging; + public ?string $google_auto_tagging; - /** @var value-of|null $removeBg */ + /** @var value-of|null $remove_bg */ #[Api('remove-bg', enum: RemoveBg::class, optional: true)] - public ?string $removeBg; + public ?string $remove_bg; public function __construct() { @@ -51,23 +51,23 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AIAutoDescription|value-of $aiAutoDescription - * @param AwsAutoTagging|value-of $awsAutoTagging - * @param GoogleAutoTagging|value-of $googleAutoTagging - * @param RemoveBg|value-of $removeBg + * @param AIAutoDescription|value-of $ai_auto_description + * @param AwsAutoTagging|value-of $aws_auto_tagging + * @param GoogleAutoTagging|value-of $google_auto_tagging + * @param RemoveBg|value-of $remove_bg */ public static function with( - AIAutoDescription|string|null $aiAutoDescription = null, - AwsAutoTagging|string|null $awsAutoTagging = null, - GoogleAutoTagging|string|null $googleAutoTagging = null, - RemoveBg|string|null $removeBg = null, + AIAutoDescription|string|null $ai_auto_description = null, + AwsAutoTagging|string|null $aws_auto_tagging = null, + GoogleAutoTagging|string|null $google_auto_tagging = null, + RemoveBg|string|null $remove_bg = null, ): self { $obj = new self; - null !== $aiAutoDescription && $obj['aiAutoDescription'] = $aiAutoDescription; - null !== $awsAutoTagging && $obj['awsAutoTagging'] = $awsAutoTagging; - null !== $googleAutoTagging && $obj['googleAutoTagging'] = $googleAutoTagging; - null !== $removeBg && $obj['removeBg'] = $removeBg; + null !== $ai_auto_description && $obj['ai_auto_description'] = $ai_auto_description; + null !== $aws_auto_tagging && $obj['aws_auto_tagging'] = $aws_auto_tagging; + null !== $google_auto_tagging && $obj['google_auto_tagging'] = $google_auto_tagging; + null !== $remove_bg && $obj['remove_bg'] = $remove_bg; return $obj; } @@ -79,7 +79,7 @@ public function withAIAutoDescription( AIAutoDescription|string $aiAutoDescription ): self { $obj = clone $this; - $obj['aiAutoDescription'] = $aiAutoDescription; + $obj['ai_auto_description'] = $aiAutoDescription; return $obj; } @@ -91,7 +91,7 @@ public function withAwsAutoTagging( AwsAutoTagging|string $awsAutoTagging ): self { $obj = clone $this; - $obj['awsAutoTagging'] = $awsAutoTagging; + $obj['aws_auto_tagging'] = $awsAutoTagging; return $obj; } @@ -103,7 +103,7 @@ public function withGoogleAutoTagging( GoogleAutoTagging|string $googleAutoTagging ): self { $obj = clone $this; - $obj['googleAutoTagging'] = $googleAutoTagging; + $obj['google_auto_tagging'] = $googleAutoTagging; return $obj; } @@ -114,7 +114,7 @@ public function withGoogleAutoTagging( public function withRemoveBg(RemoveBg|string $removeBg): self { $obj = clone $this; - $obj['removeBg'] = $removeBg; + $obj['remove_bg'] = $removeBg; return $obj; } diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index 0413b5ed..e1308dba 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -39,7 +39,7 @@ * token?: string, * checks?: string, * customCoordinates?: string, - * customMetadata?: array, + * customMetadata?: array, * description?: string, * expire?: int, * extensions?: list, @@ -56,7 +56,7 @@ * tags?: list, * transformation?: Transformation, * useUniqueFileName?: bool, - * webhookURL?: string, + * webhookUrl?: string, * } */ final class FileUploadParams implements BaseModel @@ -117,7 +117,7 @@ final class FileUploadParams implements BaseModel /** * JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. * - * @var array|null $customMetadata + * @var array|null $customMetadata */ #[Api(map: 'mixed', optional: true)] public ?array $customMetadata; @@ -256,8 +256,8 @@ final class FileUploadParams implements BaseModel /** * The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. */ - #[Api('webhookUrl', optional: true)] - public ?string $webhookURL; + #[Api(optional: true)] + public ?string $webhookUrl; /** * `new FileUploadParams()` is missing required properties by the API. @@ -283,7 +283,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param array $customMetadata + * @param array $customMetadata * @param list $extensions * @param list> $responseFields * @param list $tags @@ -311,7 +311,7 @@ public static function with( ?array $tags = null, ?Transformation $transformation = null, ?bool $useUniqueFileName = null, - ?string $webhookURL = null, + ?string $webhookUrl = null, ): self { $obj = new self; @@ -338,7 +338,7 @@ public static function with( null !== $tags && $obj->tags = $tags; null !== $transformation && $obj->transformation = $transformation; null !== $useUniqueFileName && $obj->useUniqueFileName = $useUniqueFileName; - null !== $webhookURL && $obj->webhookURL = $webhookURL; + null !== $webhookUrl && $obj->webhookUrl = $webhookUrl; return $obj; } @@ -420,7 +420,7 @@ public function withCustomCoordinates(string $customCoordinates): self /** * JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. * - * @param array $customMetadata + * @param array $customMetadata */ public function withCustomMetadata(array $customMetadata): self { @@ -648,7 +648,7 @@ public function withUseUniqueFileName(bool $useUniqueFileName): self public function withWebhookURL(string $webhookURL): self { $obj = clone $this; - $obj->webhookURL = $webhookURL; + $obj->webhookUrl = $webhookURL; return $obj; } diff --git a/src/Files/FileUploadParams/Transformation.php b/src/Files/FileUploadParams/Transformation.php index 9ebb295f..97b6cdc5 100644 --- a/src/Files/FileUploadParams/Transformation.php +++ b/src/Files/FileUploadParams/Transformation.php @@ -24,8 +24,8 @@ * You can mix and match any combination of post-processing types. * * @phpstan-type TransformationShape = array{ - * post?: list<\ImageKit\Files\FileUploadParams\Transformation\Post\Transformation|GifToVideo|Thumbnail|Abs>, - * pre?: string, + * post?: list<\ImageKit\Files\FileUploadParams\Transformation\Post\Transformation|GifToVideo|Thumbnail|Abs>|null, + * pre?: string|null, * } */ final class Transformation implements BaseModel diff --git a/src/Files/FileUploadParams/Transformation/Post.php b/src/Files/FileUploadParams/Transformation/Post.php index 25adf16b..7b7646e6 100644 --- a/src/Files/FileUploadParams/Transformation/Post.php +++ b/src/Files/FileUploadParams/Transformation/Post.php @@ -22,8 +22,7 @@ public static function discriminator(): string } /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Files/FileUploadParams/Transformation/Post/Abs.php b/src/Files/FileUploadParams/Transformation/Post/Abs.php index 2fbdcfaf..69d350e5 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Abs.php +++ b/src/Files/FileUploadParams/Transformation/Post/Abs.php @@ -11,7 +11,7 @@ /** * @phpstan-type AbsShape = array{ - * protocol: value-of, type: string, value: string + * protocol: value-of, type: "abs", value: string * } */ final class Abs implements BaseModel @@ -21,6 +21,8 @@ final class Abs implements BaseModel /** * Adaptive Bitrate Streaming (ABS) setup. + * + * @var "abs" $type */ #[Api] public string $type = 'abs'; diff --git a/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php b/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php index 41580ed1..a68c9793 100644 --- a/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php +++ b/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type GifToVideoShape = array{type: string, value?: string} + * @phpstan-type GifToVideoShape = array{type: "gif-to-video", value?: string|null} */ final class GifToVideo implements BaseModel { @@ -18,6 +18,8 @@ final class GifToVideo implements BaseModel /** * Converts an animated GIF into an MP4. + * + * @var "gif-to-video" $type */ #[Api] public string $type = 'gif-to-video'; diff --git a/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php b/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php index 3423b839..8153291c 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php +++ b/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type ThumbnailShape = array{type: string, value?: string} + * @phpstan-type ThumbnailShape = array{type: "thumbnail", value?: string|null} */ final class Thumbnail implements BaseModel { @@ -18,6 +18,8 @@ final class Thumbnail implements BaseModel /** * Generates a thumbnail image. + * + * @var "thumbnail" $type */ #[Api] public string $type = 'thumbnail'; diff --git a/src/Files/FileUploadParams/Transformation/Post/Transformation.php b/src/Files/FileUploadParams/Transformation/Post/Transformation.php index 0238aa5b..afa7d09a 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Transformation.php +++ b/src/Files/FileUploadParams/Transformation/Post/Transformation.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type TransformationShape = array{type: string, value: string} + * @phpstan-type TransformationShape = array{type: "transformation", value: string} */ final class Transformation implements BaseModel { @@ -18,6 +18,8 @@ final class Transformation implements BaseModel /** * Transformation type. + * + * @var "transformation" $type */ #[Api] public string $type = 'transformation'; diff --git a/src/Files/FileUploadResponse.php b/src/Files/FileUploadResponse.php index 8a17bf71..f76727b1 100644 --- a/src/Files/FileUploadResponse.php +++ b/src/Files/FileUploadResponse.php @@ -18,31 +18,31 @@ * Object containing details of a successful upload. * * @phpstan-type FileUploadResponseShape = array{ - * aiTags?: list|null, - * audioCodec?: string, - * bitRate?: int, + * AITags?: list|null, + * audioCodec?: string|null, + * bitRate?: int|null, * customCoordinates?: string|null, - * customMetadata?: array, - * description?: string, - * duration?: int, - * embeddedMetadata?: array, - * extensionStatus?: ExtensionStatus, - * fileID?: string, - * filePath?: string, - * fileType?: string, - * height?: float, - * isPrivateFile?: bool, - * isPublished?: bool, - * metadata?: Metadata, - * name?: string, - * selectedFieldsSchema?: array, - * size?: float, + * customMetadata?: array|null, + * description?: string|null, + * duration?: int|null, + * embeddedMetadata?: array|null, + * extensionStatus?: ExtensionStatus|null, + * fileId?: string|null, + * filePath?: string|null, + * fileType?: string|null, + * height?: float|null, + * isPrivateFile?: bool|null, + * isPublished?: bool|null, + * metadata?: Metadata|null, + * name?: string|null, + * selectedFieldsSchema?: array|null, + * size?: float|null, * tags?: list|null, - * thumbnailURL?: string, - * url?: string, - * versionInfo?: VersionInfo, - * videoCodec?: string, - * width?: float, + * thumbnailUrl?: string|null, + * url?: string|null, + * versionInfo?: VersionInfo|null, + * videoCodec?: string|null, + * width?: float|null, * } */ final class FileUploadResponse implements BaseModel, ResponseConverter @@ -55,10 +55,10 @@ final class FileUploadResponse implements BaseModel, ResponseConverter /** * An array of tags assigned to the uploaded file by auto tagging. * - * @var list|null $aiTags + * @var list|null $AITags */ - #[Api('AITags', list: AITag::class, nullable: true, optional: true)] - public ?array $aiTags; + #[Api(list: AITag::class, nullable: true, optional: true)] + public ?array $AITags; /** * The audio codec used in the video (only for video). @@ -81,7 +81,7 @@ final class FileUploadResponse implements BaseModel, ResponseConverter /** * A key-value data associated with the asset. Use `responseField` in API request to get `customMetadata` in the upload API response. Before setting any custom metadata on an asset, you have to create the field using custom metadata fields API. Send `customMetadata` in `responseFields` in API request to get the value of this field. * - * @var array|null $customMetadata + * @var array|null $customMetadata */ #[Api(map: 'mixed', optional: true)] public ?array $customMetadata; @@ -101,7 +101,7 @@ final class FileUploadResponse implements BaseModel, ResponseConverter /** * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. Send `embeddedMetadata` in `responseFields` in API request to get embeddedMetadata in the upload API response. * - * @var array|null $embeddedMetadata + * @var array|null $embeddedMetadata */ #[Api(map: 'mixed', optional: true)] public ?array $embeddedMetadata; @@ -121,8 +121,8 @@ final class FileUploadResponse implements BaseModel, ResponseConverter /** * Unique fileId. Store this fileld in your database, as this will be used to perform update action on this file. */ - #[Api('fileId', optional: true)] - public ?string $fileID; + #[Api(optional: true)] + public ?string $fileId; /** * The relative path of the file in the media library e.g. `/marketing-assets/new-banner.jpg`. @@ -173,7 +173,7 @@ final class FileUploadResponse implements BaseModel, ResponseConverter * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @var array|null $selectedFieldsSchema + * @var array|null $selectedFieldsSchema */ #[Api(map: SelectedFieldsSchema::class, optional: true)] public ?array $selectedFieldsSchema; @@ -195,8 +195,8 @@ final class FileUploadResponse implements BaseModel, ResponseConverter /** * In the case of an image, a small thumbnail URL. */ - #[Api('thumbnailUrl', optional: true)] - public ?string $thumbnailURL; + #[Api(optional: true)] + public ?string $thumbnailUrl; /** * A publicly accessible URL of the file. @@ -232,14 +232,14 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list|null $aiTags - * @param array $customMetadata - * @param array $embeddedMetadata - * @param array $selectedFieldsSchema + * @param list|null $AITags + * @param array $customMetadata + * @param array $embeddedMetadata + * @param array $selectedFieldsSchema * @param list|null $tags */ public static function with( - ?array $aiTags = null, + ?array $AITags = null, ?string $audioCodec = null, ?int $bitRate = null, ?string $customCoordinates = null, @@ -248,7 +248,7 @@ public static function with( ?int $duration = null, ?array $embeddedMetadata = null, ?ExtensionStatus $extensionStatus = null, - ?string $fileID = null, + ?string $fileId = null, ?string $filePath = null, ?string $fileType = null, ?float $height = null, @@ -259,7 +259,7 @@ public static function with( ?array $selectedFieldsSchema = null, ?float $size = null, ?array $tags = null, - ?string $thumbnailURL = null, + ?string $thumbnailUrl = null, ?string $url = null, ?VersionInfo $versionInfo = null, ?string $videoCodec = null, @@ -267,7 +267,7 @@ public static function with( ): self { $obj = new self; - null !== $aiTags && $obj->aiTags = $aiTags; + null !== $AITags && $obj->AITags = $AITags; null !== $audioCodec && $obj->audioCodec = $audioCodec; null !== $bitRate && $obj->bitRate = $bitRate; null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; @@ -276,7 +276,7 @@ public static function with( null !== $duration && $obj->duration = $duration; null !== $embeddedMetadata && $obj->embeddedMetadata = $embeddedMetadata; null !== $extensionStatus && $obj->extensionStatus = $extensionStatus; - null !== $fileID && $obj->fileID = $fileID; + null !== $fileId && $obj->fileId = $fileId; null !== $filePath && $obj->filePath = $filePath; null !== $fileType && $obj->fileType = $fileType; null !== $height && $obj->height = $height; @@ -287,7 +287,7 @@ public static function with( null !== $selectedFieldsSchema && $obj->selectedFieldsSchema = $selectedFieldsSchema; null !== $size && $obj->size = $size; null !== $tags && $obj->tags = $tags; - null !== $thumbnailURL && $obj->thumbnailURL = $thumbnailURL; + null !== $thumbnailUrl && $obj->thumbnailUrl = $thumbnailUrl; null !== $url && $obj->url = $url; null !== $versionInfo && $obj->versionInfo = $versionInfo; null !== $videoCodec && $obj->videoCodec = $videoCodec; @@ -304,7 +304,7 @@ public static function with( public function withAITags(?array $aiTags): self { $obj = clone $this; - $obj->aiTags = $aiTags; + $obj->AITags = $aiTags; return $obj; } @@ -345,7 +345,7 @@ public function withCustomCoordinates(?string $customCoordinates): self /** * A key-value data associated with the asset. Use `responseField` in API request to get `customMetadata` in the upload API response. Before setting any custom metadata on an asset, you have to create the field using custom metadata fields API. Send `customMetadata` in `responseFields` in API request to get the value of this field. * - * @param array $customMetadata + * @param array $customMetadata */ public function withCustomMetadata(array $customMetadata): self { @@ -380,7 +380,7 @@ public function withDuration(int $duration): self /** * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. Send `embeddedMetadata` in `responseFields` in API request to get embeddedMetadata in the upload API response. * - * @param array $embeddedMetadata + * @param array $embeddedMetadata */ public function withEmbeddedMetadata(array $embeddedMetadata): self { @@ -413,7 +413,7 @@ public function withExtensionStatus(ExtensionStatus $extensionStatus): self public function withFileID(string $fileID): self { $obj = clone $this; - $obj->fileID = $fileID; + $obj->fileId = $fileID; return $obj; } @@ -502,7 +502,7 @@ public function withName(string $name): self * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @param array $selectedFieldsSchema + * @param array $selectedFieldsSchema */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { @@ -542,7 +542,7 @@ public function withTags(?array $tags): self public function withThumbnailURL(string $thumbnailURL): self { $obj = clone $this; - $obj->thumbnailURL = $thumbnailURL; + $obj->thumbnailUrl = $thumbnailURL; return $obj; } diff --git a/src/Files/FileUploadResponse/AITag.php b/src/Files/FileUploadResponse/AITag.php index bc0031ca..9afb2657 100644 --- a/src/Files/FileUploadResponse/AITag.php +++ b/src/Files/FileUploadResponse/AITag.php @@ -10,7 +10,7 @@ /** * @phpstan-type AITagShape = array{ - * confidence?: float, name?: string, source?: string + * confidence?: float|null, name?: string|null, source?: string|null * } */ final class AITag implements BaseModel diff --git a/src/Files/FileUploadResponse/ExtensionStatus.php b/src/Files/FileUploadResponse/ExtensionStatus.php index a1921bed..c3611995 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Files/FileUploadResponse/ExtensionStatus.php @@ -22,10 +22,10 @@ * If no extension was requested, then this parameter is not returned. * * @phpstan-type ExtensionStatusShape = array{ - * aiAutoDescription?: value-of, - * awsAutoTagging?: value-of, - * googleAutoTagging?: value-of, - * removeBg?: value-of, + * ai_auto_description?: value-of|null, + * aws_auto_tagging?: value-of|null, + * google_auto_tagging?: value-of|null, + * remove_bg?: value-of|null, * } */ final class ExtensionStatus implements BaseModel @@ -33,21 +33,21 @@ final class ExtensionStatus implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var value-of|null $aiAutoDescription */ + /** @var value-of|null $ai_auto_description */ #[Api('ai-auto-description', enum: AIAutoDescription::class, optional: true)] - public ?string $aiAutoDescription; + public ?string $ai_auto_description; - /** @var value-of|null $awsAutoTagging */ + /** @var value-of|null $aws_auto_tagging */ #[Api('aws-auto-tagging', enum: AwsAutoTagging::class, optional: true)] - public ?string $awsAutoTagging; + public ?string $aws_auto_tagging; - /** @var value-of|null $googleAutoTagging */ + /** @var value-of|null $google_auto_tagging */ #[Api('google-auto-tagging', enum: GoogleAutoTagging::class, optional: true)] - public ?string $googleAutoTagging; + public ?string $google_auto_tagging; - /** @var value-of|null $removeBg */ + /** @var value-of|null $remove_bg */ #[Api('remove-bg', enum: RemoveBg::class, optional: true)] - public ?string $removeBg; + public ?string $remove_bg; public function __construct() { @@ -59,23 +59,23 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AIAutoDescription|value-of $aiAutoDescription - * @param AwsAutoTagging|value-of $awsAutoTagging - * @param GoogleAutoTagging|value-of $googleAutoTagging - * @param RemoveBg|value-of $removeBg + * @param AIAutoDescription|value-of $ai_auto_description + * @param AwsAutoTagging|value-of $aws_auto_tagging + * @param GoogleAutoTagging|value-of $google_auto_tagging + * @param RemoveBg|value-of $remove_bg */ public static function with( - AIAutoDescription|string|null $aiAutoDescription = null, - AwsAutoTagging|string|null $awsAutoTagging = null, - GoogleAutoTagging|string|null $googleAutoTagging = null, - RemoveBg|string|null $removeBg = null, + AIAutoDescription|string|null $ai_auto_description = null, + AwsAutoTagging|string|null $aws_auto_tagging = null, + GoogleAutoTagging|string|null $google_auto_tagging = null, + RemoveBg|string|null $remove_bg = null, ): self { $obj = new self; - null !== $aiAutoDescription && $obj['aiAutoDescription'] = $aiAutoDescription; - null !== $awsAutoTagging && $obj['awsAutoTagging'] = $awsAutoTagging; - null !== $googleAutoTagging && $obj['googleAutoTagging'] = $googleAutoTagging; - null !== $removeBg && $obj['removeBg'] = $removeBg; + null !== $ai_auto_description && $obj['ai_auto_description'] = $ai_auto_description; + null !== $aws_auto_tagging && $obj['aws_auto_tagging'] = $aws_auto_tagging; + null !== $google_auto_tagging && $obj['google_auto_tagging'] = $google_auto_tagging; + null !== $remove_bg && $obj['remove_bg'] = $remove_bg; return $obj; } @@ -87,7 +87,7 @@ public function withAIAutoDescription( AIAutoDescription|string $aiAutoDescription ): self { $obj = clone $this; - $obj['aiAutoDescription'] = $aiAutoDescription; + $obj['ai_auto_description'] = $aiAutoDescription; return $obj; } @@ -99,7 +99,7 @@ public function withAwsAutoTagging( AwsAutoTagging|string $awsAutoTagging ): self { $obj = clone $this; - $obj['awsAutoTagging'] = $awsAutoTagging; + $obj['aws_auto_tagging'] = $awsAutoTagging; return $obj; } @@ -111,7 +111,7 @@ public function withGoogleAutoTagging( GoogleAutoTagging|string $googleAutoTagging ): self { $obj = clone $this; - $obj['googleAutoTagging'] = $googleAutoTagging; + $obj['google_auto_tagging'] = $googleAutoTagging; return $obj; } @@ -122,7 +122,7 @@ public function withGoogleAutoTagging( public function withRemoveBg(RemoveBg|string $removeBg): self { $obj = clone $this; - $obj['removeBg'] = $removeBg; + $obj['remove_bg'] = $removeBg; return $obj; } diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema.php b/src/Files/FileUploadResponse/SelectedFieldsSchema.php index cdca21f7..be83d169 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema.php @@ -14,15 +14,15 @@ /** * @phpstan-type SelectedFieldsSchemaShape = array{ * type: value-of, - * defaultValue?: string|float|bool|list, - * isValueRequired?: bool, - * maxLength?: float, - * maxValue?: string|float, - * minLength?: float, - * minValue?: string|float, - * readOnly?: bool, - * selectOptions?: list, - * selectOptionsTruncated?: bool, + * defaultValue?: string|float|bool|null|list, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * readOnly?: bool|null, + * selectOptions?: list|null, + * selectOptionsTruncated?: bool|null, * } */ final class SelectedFieldsSchema implements BaseModel diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php index 301aaa56..774c0c9b 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php @@ -18,8 +18,7 @@ final class DefaultValue implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed.php index 7b4d3d9a..4779d9fc 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed.php @@ -13,8 +13,7 @@ final class Mixed implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php index 54598c36..27861e07 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php @@ -16,8 +16,7 @@ final class MaxValue implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php index 8cace824..736d9b5c 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php @@ -16,8 +16,7 @@ final class MinValue implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php index 606c3837..4604eb34 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php @@ -13,8 +13,7 @@ final class SelectOption implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Files/FileUploadResponse/VersionInfo.php b/src/Files/FileUploadResponse/VersionInfo.php index 80b94f01..0a2540db 100644 --- a/src/Files/FileUploadResponse/VersionInfo.php +++ b/src/Files/FileUploadResponse/VersionInfo.php @@ -11,7 +11,7 @@ /** * An object containing the file or file version's `id` (versionId) and `name`. * - * @phpstan-type VersionInfoShape = array{id?: string, name?: string} + * @phpstan-type VersionInfoShape = array{id?: string|null, name?: string|null} */ final class VersionInfo implements BaseModel { diff --git a/src/Files/Folder.php b/src/Files/Folder.php index 888e85ef..cd32a254 100644 --- a/src/Files/Folder.php +++ b/src/Files/Folder.php @@ -11,12 +11,12 @@ /** * @phpstan-type FolderShape = array{ - * createdAt?: \DateTimeInterface, - * folderID?: string, - * folderPath?: string, - * name?: string, - * type?: value-of, - * updatedAt?: \DateTimeInterface, + * createdAt?: \DateTimeInterface|null, + * folderId?: string|null, + * folderPath?: string|null, + * name?: string|null, + * type?: value-of|null, + * updatedAt?: \DateTimeInterface|null, * } */ final class Folder implements BaseModel @@ -33,8 +33,8 @@ final class Folder implements BaseModel /** * Unique identifier of the asset. */ - #[Api('folderId', optional: true)] - public ?string $folderID; + #[Api(optional: true)] + public ?string $folderId; /** * Path of the folder. This is the path you would use in the URL to access the folder. For example, if the folder is at the root of the media library, the path will be /folder. If the folder is inside another folder named images, the path will be /images/folder. @@ -76,7 +76,7 @@ public function __construct() */ public static function with( ?\DateTimeInterface $createdAt = null, - ?string $folderID = null, + ?string $folderId = null, ?string $folderPath = null, ?string $name = null, Type|string|null $type = null, @@ -85,7 +85,7 @@ public static function with( $obj = new self; null !== $createdAt && $obj->createdAt = $createdAt; - null !== $folderID && $obj->folderID = $folderID; + null !== $folderId && $obj->folderId = $folderId; null !== $folderPath && $obj->folderPath = $folderPath; null !== $name && $obj->name = $name; null !== $type && $obj['type'] = $type; @@ -111,7 +111,7 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self public function withFolderID(string $folderID): self { $obj = clone $this; - $obj->folderID = $folderID; + $obj->folderId = $folderID; return $obj; } diff --git a/src/Files/Metadata.php b/src/Files/Metadata.php index 543ecf53..462c13ea 100644 --- a/src/Files/Metadata.php +++ b/src/Files/Metadata.php @@ -13,20 +13,20 @@ * JSON object containing metadata. * * @phpstan-type MetadataShape = array{ - * audioCodec?: string, - * bitRate?: int, - * density?: int, - * duration?: int, - * exif?: Exif, - * format?: string, - * hasColorProfile?: bool, - * hasTransparency?: bool, - * height?: int, - * pHash?: string, - * quality?: int, - * size?: int, - * videoCodec?: string, - * width?: int, + * audioCodec?: string|null, + * bitRate?: int|null, + * density?: int|null, + * duration?: int|null, + * exif?: Exif|null, + * format?: string|null, + * hasColorProfile?: bool|null, + * hasTransparency?: bool|null, + * height?: int|null, + * pHash?: string|null, + * quality?: int|null, + * size?: int|null, + * videoCodec?: string|null, + * width?: int|null, * } */ final class Metadata implements BaseModel diff --git a/src/Files/Metadata/Exif.php b/src/Files/Metadata/Exif.php index 7cf1d11a..f55dc126 100644 --- a/src/Files/Metadata/Exif.php +++ b/src/Files/Metadata/Exif.php @@ -14,12 +14,12 @@ /** * @phpstan-type ExifShape = array{ - * exif?: \ImageKit\Files\Metadata\Exif\Exif, - * gps?: Gps, - * image?: Image, - * interoperability?: Interoperability, - * makernote?: array, - * thumbnail?: Thumbnail, + * exif?: \ImageKit\Files\Metadata\Exif\Exif|null, + * gps?: Gps|null, + * image?: Image|null, + * interoperability?: Interoperability|null, + * makernote?: array|null, + * thumbnail?: Thumbnail|null, * } */ final class Exif implements BaseModel @@ -51,7 +51,7 @@ final class Exif implements BaseModel #[Api(optional: true)] public ?Interoperability $interoperability; - /** @var array|null $makernote */ + /** @var array|null $makernote */ #[Api(map: 'mixed', optional: true)] public ?array $makernote; @@ -71,7 +71,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param array $makernote + * @param array $makernote */ public static function with( ?Exif\Exif $exif = null, @@ -139,7 +139,7 @@ public function withInteroperability( } /** - * @param array $makernote + * @param array $makernote */ public function withMakernote(array $makernote): self { diff --git a/src/Files/Metadata/Exif/Exif.php b/src/Files/Metadata/Exif/Exif.php index 4faaad12..bd5ba41c 100644 --- a/src/Files/Metadata/Exif/Exif.php +++ b/src/Files/Metadata/Exif/Exif.php @@ -12,32 +12,32 @@ * Object containing Exif details. * * @phpstan-type ExifShape = array{ - * apertureValue?: float, - * colorSpace?: int, - * createDate?: string, - * customRendered?: int, - * dateTimeOriginal?: string, - * exifImageHeight?: int, - * exifImageWidth?: int, - * exifVersion?: string, - * exposureCompensation?: float, - * exposureMode?: int, - * exposureProgram?: int, - * exposureTime?: float, - * flash?: int, - * flashpixVersion?: string, - * fNumber?: float, - * focalLength?: int, - * focalPlaneResolutionUnit?: int, - * focalPlaneXResolution?: float, - * focalPlaneYResolution?: float, - * interopOffset?: int, - * iso?: int, - * meteringMode?: int, - * sceneCaptureType?: int, - * shutterSpeedValue?: float, - * subSecTime?: string, - * whiteBalance?: int, + * ApertureValue?: float|null, + * ColorSpace?: int|null, + * CreateDate?: string|null, + * CustomRendered?: int|null, + * DateTimeOriginal?: string|null, + * ExifImageHeight?: int|null, + * ExifImageWidth?: int|null, + * ExifVersion?: string|null, + * ExposureCompensation?: float|null, + * ExposureMode?: int|null, + * ExposureProgram?: int|null, + * ExposureTime?: float|null, + * Flash?: int|null, + * FlashpixVersion?: string|null, + * FNumber?: float|null, + * FocalLength?: int|null, + * FocalPlaneResolutionUnit?: int|null, + * FocalPlaneXResolution?: float|null, + * FocalPlaneYResolution?: float|null, + * InteropOffset?: int|null, + * ISO?: int|null, + * MeteringMode?: int|null, + * SceneCaptureType?: int|null, + * ShutterSpeedValue?: float|null, + * SubSecTime?: string|null, + * WhiteBalance?: int|null, * } */ final class Exif implements BaseModel @@ -45,83 +45,83 @@ final class Exif implements BaseModel /** @use SdkModel */ use SdkModel; - #[Api('ApertureValue', optional: true)] - public ?float $apertureValue; + #[Api(optional: true)] + public ?float $ApertureValue; - #[Api('ColorSpace', optional: true)] - public ?int $colorSpace; + #[Api(optional: true)] + public ?int $ColorSpace; - #[Api('CreateDate', optional: true)] - public ?string $createDate; + #[Api(optional: true)] + public ?string $CreateDate; - #[Api('CustomRendered', optional: true)] - public ?int $customRendered; + #[Api(optional: true)] + public ?int $CustomRendered; - #[Api('DateTimeOriginal', optional: true)] - public ?string $dateTimeOriginal; + #[Api(optional: true)] + public ?string $DateTimeOriginal; - #[Api('ExifImageHeight', optional: true)] - public ?int $exifImageHeight; + #[Api(optional: true)] + public ?int $ExifImageHeight; - #[Api('ExifImageWidth', optional: true)] - public ?int $exifImageWidth; + #[Api(optional: true)] + public ?int $ExifImageWidth; - #[Api('ExifVersion', optional: true)] - public ?string $exifVersion; + #[Api(optional: true)] + public ?string $ExifVersion; - #[Api('ExposureCompensation', optional: true)] - public ?float $exposureCompensation; + #[Api(optional: true)] + public ?float $ExposureCompensation; - #[Api('ExposureMode', optional: true)] - public ?int $exposureMode; + #[Api(optional: true)] + public ?int $ExposureMode; - #[Api('ExposureProgram', optional: true)] - public ?int $exposureProgram; + #[Api(optional: true)] + public ?int $ExposureProgram; - #[Api('ExposureTime', optional: true)] - public ?float $exposureTime; + #[Api(optional: true)] + public ?float $ExposureTime; - #[Api('Flash', optional: true)] - public ?int $flash; + #[Api(optional: true)] + public ?int $Flash; - #[Api('FlashpixVersion', optional: true)] - public ?string $flashpixVersion; + #[Api(optional: true)] + public ?string $FlashpixVersion; - #[Api('FNumber', optional: true)] - public ?float $fNumber; + #[Api(optional: true)] + public ?float $FNumber; - #[Api('FocalLength', optional: true)] - public ?int $focalLength; + #[Api(optional: true)] + public ?int $FocalLength; - #[Api('FocalPlaneResolutionUnit', optional: true)] - public ?int $focalPlaneResolutionUnit; + #[Api(optional: true)] + public ?int $FocalPlaneResolutionUnit; - #[Api('FocalPlaneXResolution', optional: true)] - public ?float $focalPlaneXResolution; + #[Api(optional: true)] + public ?float $FocalPlaneXResolution; - #[Api('FocalPlaneYResolution', optional: true)] - public ?float $focalPlaneYResolution; + #[Api(optional: true)] + public ?float $FocalPlaneYResolution; - #[Api('InteropOffset', optional: true)] - public ?int $interopOffset; + #[Api(optional: true)] + public ?int $InteropOffset; - #[Api('ISO', optional: true)] - public ?int $iso; + #[Api(optional: true)] + public ?int $ISO; - #[Api('MeteringMode', optional: true)] - public ?int $meteringMode; + #[Api(optional: true)] + public ?int $MeteringMode; - #[Api('SceneCaptureType', optional: true)] - public ?int $sceneCaptureType; + #[Api(optional: true)] + public ?int $SceneCaptureType; - #[Api('ShutterSpeedValue', optional: true)] - public ?float $shutterSpeedValue; + #[Api(optional: true)] + public ?float $ShutterSpeedValue; - #[Api('SubSecTime', optional: true)] - public ?string $subSecTime; + #[Api(optional: true)] + public ?string $SubSecTime; - #[Api('WhiteBalance', optional: true)] - public ?int $whiteBalance; + #[Api(optional: true)] + public ?int $WhiteBalance; public function __construct() { @@ -134,61 +134,61 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - ?float $apertureValue = null, - ?int $colorSpace = null, - ?string $createDate = null, - ?int $customRendered = null, - ?string $dateTimeOriginal = null, - ?int $exifImageHeight = null, - ?int $exifImageWidth = null, - ?string $exifVersion = null, - ?float $exposureCompensation = null, - ?int $exposureMode = null, - ?int $exposureProgram = null, - ?float $exposureTime = null, - ?int $flash = null, - ?string $flashpixVersion = null, - ?float $fNumber = null, - ?int $focalLength = null, - ?int $focalPlaneResolutionUnit = null, - ?float $focalPlaneXResolution = null, - ?float $focalPlaneYResolution = null, - ?int $interopOffset = null, - ?int $iso = null, - ?int $meteringMode = null, - ?int $sceneCaptureType = null, - ?float $shutterSpeedValue = null, - ?string $subSecTime = null, - ?int $whiteBalance = null, + ?float $ApertureValue = null, + ?int $ColorSpace = null, + ?string $CreateDate = null, + ?int $CustomRendered = null, + ?string $DateTimeOriginal = null, + ?int $ExifImageHeight = null, + ?int $ExifImageWidth = null, + ?string $ExifVersion = null, + ?float $ExposureCompensation = null, + ?int $ExposureMode = null, + ?int $ExposureProgram = null, + ?float $ExposureTime = null, + ?int $Flash = null, + ?string $FlashpixVersion = null, + ?float $FNumber = null, + ?int $FocalLength = null, + ?int $FocalPlaneResolutionUnit = null, + ?float $FocalPlaneXResolution = null, + ?float $FocalPlaneYResolution = null, + ?int $InteropOffset = null, + ?int $ISO = null, + ?int $MeteringMode = null, + ?int $SceneCaptureType = null, + ?float $ShutterSpeedValue = null, + ?string $SubSecTime = null, + ?int $WhiteBalance = null, ): self { $obj = new self; - null !== $apertureValue && $obj->apertureValue = $apertureValue; - null !== $colorSpace && $obj->colorSpace = $colorSpace; - null !== $createDate && $obj->createDate = $createDate; - null !== $customRendered && $obj->customRendered = $customRendered; - null !== $dateTimeOriginal && $obj->dateTimeOriginal = $dateTimeOriginal; - null !== $exifImageHeight && $obj->exifImageHeight = $exifImageHeight; - null !== $exifImageWidth && $obj->exifImageWidth = $exifImageWidth; - null !== $exifVersion && $obj->exifVersion = $exifVersion; - null !== $exposureCompensation && $obj->exposureCompensation = $exposureCompensation; - null !== $exposureMode && $obj->exposureMode = $exposureMode; - null !== $exposureProgram && $obj->exposureProgram = $exposureProgram; - null !== $exposureTime && $obj->exposureTime = $exposureTime; - null !== $flash && $obj->flash = $flash; - null !== $flashpixVersion && $obj->flashpixVersion = $flashpixVersion; - null !== $fNumber && $obj->fNumber = $fNumber; - null !== $focalLength && $obj->focalLength = $focalLength; - null !== $focalPlaneResolutionUnit && $obj->focalPlaneResolutionUnit = $focalPlaneResolutionUnit; - null !== $focalPlaneXResolution && $obj->focalPlaneXResolution = $focalPlaneXResolution; - null !== $focalPlaneYResolution && $obj->focalPlaneYResolution = $focalPlaneYResolution; - null !== $interopOffset && $obj->interopOffset = $interopOffset; - null !== $iso && $obj->iso = $iso; - null !== $meteringMode && $obj->meteringMode = $meteringMode; - null !== $sceneCaptureType && $obj->sceneCaptureType = $sceneCaptureType; - null !== $shutterSpeedValue && $obj->shutterSpeedValue = $shutterSpeedValue; - null !== $subSecTime && $obj->subSecTime = $subSecTime; - null !== $whiteBalance && $obj->whiteBalance = $whiteBalance; + null !== $ApertureValue && $obj->ApertureValue = $ApertureValue; + null !== $ColorSpace && $obj->ColorSpace = $ColorSpace; + null !== $CreateDate && $obj->CreateDate = $CreateDate; + null !== $CustomRendered && $obj->CustomRendered = $CustomRendered; + null !== $DateTimeOriginal && $obj->DateTimeOriginal = $DateTimeOriginal; + null !== $ExifImageHeight && $obj->ExifImageHeight = $ExifImageHeight; + null !== $ExifImageWidth && $obj->ExifImageWidth = $ExifImageWidth; + null !== $ExifVersion && $obj->ExifVersion = $ExifVersion; + null !== $ExposureCompensation && $obj->ExposureCompensation = $ExposureCompensation; + null !== $ExposureMode && $obj->ExposureMode = $ExposureMode; + null !== $ExposureProgram && $obj->ExposureProgram = $ExposureProgram; + null !== $ExposureTime && $obj->ExposureTime = $ExposureTime; + null !== $Flash && $obj->Flash = $Flash; + null !== $FlashpixVersion && $obj->FlashpixVersion = $FlashpixVersion; + null !== $FNumber && $obj->FNumber = $FNumber; + null !== $FocalLength && $obj->FocalLength = $FocalLength; + null !== $FocalPlaneResolutionUnit && $obj->FocalPlaneResolutionUnit = $FocalPlaneResolutionUnit; + null !== $FocalPlaneXResolution && $obj->FocalPlaneXResolution = $FocalPlaneXResolution; + null !== $FocalPlaneYResolution && $obj->FocalPlaneYResolution = $FocalPlaneYResolution; + null !== $InteropOffset && $obj->InteropOffset = $InteropOffset; + null !== $ISO && $obj->ISO = $ISO; + null !== $MeteringMode && $obj->MeteringMode = $MeteringMode; + null !== $SceneCaptureType && $obj->SceneCaptureType = $SceneCaptureType; + null !== $ShutterSpeedValue && $obj->ShutterSpeedValue = $ShutterSpeedValue; + null !== $SubSecTime && $obj->SubSecTime = $SubSecTime; + null !== $WhiteBalance && $obj->WhiteBalance = $WhiteBalance; return $obj; } @@ -196,7 +196,7 @@ public static function with( public function withApertureValue(float $apertureValue): self { $obj = clone $this; - $obj->apertureValue = $apertureValue; + $obj->ApertureValue = $apertureValue; return $obj; } @@ -204,7 +204,7 @@ public function withApertureValue(float $apertureValue): self public function withColorSpace(int $colorSpace): self { $obj = clone $this; - $obj->colorSpace = $colorSpace; + $obj->ColorSpace = $colorSpace; return $obj; } @@ -212,7 +212,7 @@ public function withColorSpace(int $colorSpace): self public function withCreateDate(string $createDate): self { $obj = clone $this; - $obj->createDate = $createDate; + $obj->CreateDate = $createDate; return $obj; } @@ -220,7 +220,7 @@ public function withCreateDate(string $createDate): self public function withCustomRendered(int $customRendered): self { $obj = clone $this; - $obj->customRendered = $customRendered; + $obj->CustomRendered = $customRendered; return $obj; } @@ -228,7 +228,7 @@ public function withCustomRendered(int $customRendered): self public function withDateTimeOriginal(string $dateTimeOriginal): self { $obj = clone $this; - $obj->dateTimeOriginal = $dateTimeOriginal; + $obj->DateTimeOriginal = $dateTimeOriginal; return $obj; } @@ -236,7 +236,7 @@ public function withDateTimeOriginal(string $dateTimeOriginal): self public function withExifImageHeight(int $exifImageHeight): self { $obj = clone $this; - $obj->exifImageHeight = $exifImageHeight; + $obj->ExifImageHeight = $exifImageHeight; return $obj; } @@ -244,7 +244,7 @@ public function withExifImageHeight(int $exifImageHeight): self public function withExifImageWidth(int $exifImageWidth): self { $obj = clone $this; - $obj->exifImageWidth = $exifImageWidth; + $obj->ExifImageWidth = $exifImageWidth; return $obj; } @@ -252,7 +252,7 @@ public function withExifImageWidth(int $exifImageWidth): self public function withExifVersion(string $exifVersion): self { $obj = clone $this; - $obj->exifVersion = $exifVersion; + $obj->ExifVersion = $exifVersion; return $obj; } @@ -260,7 +260,7 @@ public function withExifVersion(string $exifVersion): self public function withExposureCompensation(float $exposureCompensation): self { $obj = clone $this; - $obj->exposureCompensation = $exposureCompensation; + $obj->ExposureCompensation = $exposureCompensation; return $obj; } @@ -268,7 +268,7 @@ public function withExposureCompensation(float $exposureCompensation): self public function withExposureMode(int $exposureMode): self { $obj = clone $this; - $obj->exposureMode = $exposureMode; + $obj->ExposureMode = $exposureMode; return $obj; } @@ -276,7 +276,7 @@ public function withExposureMode(int $exposureMode): self public function withExposureProgram(int $exposureProgram): self { $obj = clone $this; - $obj->exposureProgram = $exposureProgram; + $obj->ExposureProgram = $exposureProgram; return $obj; } @@ -284,7 +284,7 @@ public function withExposureProgram(int $exposureProgram): self public function withExposureTime(float $exposureTime): self { $obj = clone $this; - $obj->exposureTime = $exposureTime; + $obj->ExposureTime = $exposureTime; return $obj; } @@ -292,7 +292,7 @@ public function withExposureTime(float $exposureTime): self public function withFlash(int $flash): self { $obj = clone $this; - $obj->flash = $flash; + $obj->Flash = $flash; return $obj; } @@ -300,7 +300,7 @@ public function withFlash(int $flash): self public function withFlashpixVersion(string $flashpixVersion): self { $obj = clone $this; - $obj->flashpixVersion = $flashpixVersion; + $obj->FlashpixVersion = $flashpixVersion; return $obj; } @@ -308,7 +308,7 @@ public function withFlashpixVersion(string $flashpixVersion): self public function withFNumber(float $fNumber): self { $obj = clone $this; - $obj->fNumber = $fNumber; + $obj->FNumber = $fNumber; return $obj; } @@ -316,7 +316,7 @@ public function withFNumber(float $fNumber): self public function withFocalLength(int $focalLength): self { $obj = clone $this; - $obj->focalLength = $focalLength; + $obj->FocalLength = $focalLength; return $obj; } @@ -325,7 +325,7 @@ public function withFocalPlaneResolutionUnit( int $focalPlaneResolutionUnit ): self { $obj = clone $this; - $obj->focalPlaneResolutionUnit = $focalPlaneResolutionUnit; + $obj->FocalPlaneResolutionUnit = $focalPlaneResolutionUnit; return $obj; } @@ -334,7 +334,7 @@ public function withFocalPlaneXResolution( float $focalPlaneXResolution ): self { $obj = clone $this; - $obj->focalPlaneXResolution = $focalPlaneXResolution; + $obj->FocalPlaneXResolution = $focalPlaneXResolution; return $obj; } @@ -343,7 +343,7 @@ public function withFocalPlaneYResolution( float $focalPlaneYResolution ): self { $obj = clone $this; - $obj->focalPlaneYResolution = $focalPlaneYResolution; + $obj->FocalPlaneYResolution = $focalPlaneYResolution; return $obj; } @@ -351,7 +351,7 @@ public function withFocalPlaneYResolution( public function withInteropOffset(int $interopOffset): self { $obj = clone $this; - $obj->interopOffset = $interopOffset; + $obj->InteropOffset = $interopOffset; return $obj; } @@ -359,7 +359,7 @@ public function withInteropOffset(int $interopOffset): self public function withISO(int $iso): self { $obj = clone $this; - $obj->iso = $iso; + $obj->ISO = $iso; return $obj; } @@ -367,7 +367,7 @@ public function withISO(int $iso): self public function withMeteringMode(int $meteringMode): self { $obj = clone $this; - $obj->meteringMode = $meteringMode; + $obj->MeteringMode = $meteringMode; return $obj; } @@ -375,7 +375,7 @@ public function withMeteringMode(int $meteringMode): self public function withSceneCaptureType(int $sceneCaptureType): self { $obj = clone $this; - $obj->sceneCaptureType = $sceneCaptureType; + $obj->SceneCaptureType = $sceneCaptureType; return $obj; } @@ -383,7 +383,7 @@ public function withSceneCaptureType(int $sceneCaptureType): self public function withShutterSpeedValue(float $shutterSpeedValue): self { $obj = clone $this; - $obj->shutterSpeedValue = $shutterSpeedValue; + $obj->ShutterSpeedValue = $shutterSpeedValue; return $obj; } @@ -391,7 +391,7 @@ public function withShutterSpeedValue(float $shutterSpeedValue): self public function withSubSecTime(string $subSecTime): self { $obj = clone $this; - $obj->subSecTime = $subSecTime; + $obj->SubSecTime = $subSecTime; return $obj; } @@ -399,7 +399,7 @@ public function withSubSecTime(string $subSecTime): self public function withWhiteBalance(int $whiteBalance): self { $obj = clone $this; - $obj->whiteBalance = $whiteBalance; + $obj->WhiteBalance = $whiteBalance; return $obj; } diff --git a/src/Files/Metadata/Exif/Gps.php b/src/Files/Metadata/Exif/Gps.php index 3334ba17..708f83d7 100644 --- a/src/Files/Metadata/Exif/Gps.php +++ b/src/Files/Metadata/Exif/Gps.php @@ -11,16 +11,16 @@ /** * Object containing GPS information. * - * @phpstan-type GpsShape = array{gpsVersionID?: list} + * @phpstan-type GpsShape = array{GPSVersionID?: list|null} */ final class Gps implements BaseModel { /** @use SdkModel */ use SdkModel; - /** @var list|null $gpsVersionID */ - #[Api('GPSVersionID', list: 'int', optional: true)] - public ?array $gpsVersionID; + /** @var list|null $GPSVersionID */ + #[Api(list: 'int', optional: true)] + public ?array $GPSVersionID; public function __construct() { @@ -32,13 +32,13 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $gpsVersionID + * @param list $GPSVersionID */ - public static function with(?array $gpsVersionID = null): self + public static function with(?array $GPSVersionID = null): self { $obj = new self; - null !== $gpsVersionID && $obj->gpsVersionID = $gpsVersionID; + null !== $GPSVersionID && $obj->GPSVersionID = $GPSVersionID; return $obj; } @@ -49,7 +49,7 @@ public static function with(?array $gpsVersionID = null): self public function withGpsVersionID(array $gpsVersionID): self { $obj = clone $this; - $obj->gpsVersionID = $gpsVersionID; + $obj->GPSVersionID = $gpsVersionID; return $obj; } diff --git a/src/Files/Metadata/Exif/Image.php b/src/Files/Metadata/Exif/Image.php index 0d24a8eb..45c9a51c 100644 --- a/src/Files/Metadata/Exif/Image.php +++ b/src/Files/Metadata/Exif/Image.php @@ -12,17 +12,17 @@ * Object containing EXIF image information. * * @phpstan-type ImageShape = array{ - * exifOffset?: int, - * gpsInfo?: int, - * make?: string, - * model?: string, - * modifyDate?: string, - * orientation?: int, - * resolutionUnit?: int, - * software?: string, - * xResolution?: int, - * yCbCrPositioning?: int, - * yResolution?: int, + * ExifOffset?: int|null, + * GPSInfo?: int|null, + * Make?: string|null, + * Model?: string|null, + * ModifyDate?: string|null, + * Orientation?: int|null, + * ResolutionUnit?: int|null, + * Software?: string|null, + * XResolution?: int|null, + * YCbCrPositioning?: int|null, + * YResolution?: int|null, * } */ final class Image implements BaseModel @@ -30,38 +30,38 @@ final class Image implements BaseModel /** @use SdkModel */ use SdkModel; - #[Api('ExifOffset', optional: true)] - public ?int $exifOffset; + #[Api(optional: true)] + public ?int $ExifOffset; - #[Api('GPSInfo', optional: true)] - public ?int $gpsInfo; + #[Api(optional: true)] + public ?int $GPSInfo; - #[Api('Make', optional: true)] - public ?string $make; + #[Api(optional: true)] + public ?string $Make; - #[Api('Model', optional: true)] - public ?string $model; + #[Api(optional: true)] + public ?string $Model; - #[Api('ModifyDate', optional: true)] - public ?string $modifyDate; + #[Api(optional: true)] + public ?string $ModifyDate; - #[Api('Orientation', optional: true)] - public ?int $orientation; + #[Api(optional: true)] + public ?int $Orientation; - #[Api('ResolutionUnit', optional: true)] - public ?int $resolutionUnit; + #[Api(optional: true)] + public ?int $ResolutionUnit; - #[Api('Software', optional: true)] - public ?string $software; + #[Api(optional: true)] + public ?string $Software; - #[Api('XResolution', optional: true)] - public ?int $xResolution; + #[Api(optional: true)] + public ?int $XResolution; - #[Api('YCbCrPositioning', optional: true)] - public ?int $yCbCrPositioning; + #[Api(optional: true)] + public ?int $YCbCrPositioning; - #[Api('YResolution', optional: true)] - public ?int $yResolution; + #[Api(optional: true)] + public ?int $YResolution; public function __construct() { @@ -74,31 +74,31 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - ?int $exifOffset = null, - ?int $gpsInfo = null, - ?string $make = null, - ?string $model = null, - ?string $modifyDate = null, - ?int $orientation = null, - ?int $resolutionUnit = null, - ?string $software = null, - ?int $xResolution = null, - ?int $yCbCrPositioning = null, - ?int $yResolution = null, + ?int $ExifOffset = null, + ?int $GPSInfo = null, + ?string $Make = null, + ?string $Model = null, + ?string $ModifyDate = null, + ?int $Orientation = null, + ?int $ResolutionUnit = null, + ?string $Software = null, + ?int $XResolution = null, + ?int $YCbCrPositioning = null, + ?int $YResolution = null, ): self { $obj = new self; - null !== $exifOffset && $obj->exifOffset = $exifOffset; - null !== $gpsInfo && $obj->gpsInfo = $gpsInfo; - null !== $make && $obj->make = $make; - null !== $model && $obj->model = $model; - null !== $modifyDate && $obj->modifyDate = $modifyDate; - null !== $orientation && $obj->orientation = $orientation; - null !== $resolutionUnit && $obj->resolutionUnit = $resolutionUnit; - null !== $software && $obj->software = $software; - null !== $xResolution && $obj->xResolution = $xResolution; - null !== $yCbCrPositioning && $obj->yCbCrPositioning = $yCbCrPositioning; - null !== $yResolution && $obj->yResolution = $yResolution; + null !== $ExifOffset && $obj->ExifOffset = $ExifOffset; + null !== $GPSInfo && $obj->GPSInfo = $GPSInfo; + null !== $Make && $obj->Make = $Make; + null !== $Model && $obj->Model = $Model; + null !== $ModifyDate && $obj->ModifyDate = $ModifyDate; + null !== $Orientation && $obj->Orientation = $Orientation; + null !== $ResolutionUnit && $obj->ResolutionUnit = $ResolutionUnit; + null !== $Software && $obj->Software = $Software; + null !== $XResolution && $obj->XResolution = $XResolution; + null !== $YCbCrPositioning && $obj->YCbCrPositioning = $YCbCrPositioning; + null !== $YResolution && $obj->YResolution = $YResolution; return $obj; } @@ -106,7 +106,7 @@ public static function with( public function withExifOffset(int $exifOffset): self { $obj = clone $this; - $obj->exifOffset = $exifOffset; + $obj->ExifOffset = $exifOffset; return $obj; } @@ -114,7 +114,7 @@ public function withExifOffset(int $exifOffset): self public function withGpsInfo(int $gpsInfo): self { $obj = clone $this; - $obj->gpsInfo = $gpsInfo; + $obj->GPSInfo = $gpsInfo; return $obj; } @@ -122,7 +122,7 @@ public function withGpsInfo(int $gpsInfo): self public function withMake(string $make): self { $obj = clone $this; - $obj->make = $make; + $obj->Make = $make; return $obj; } @@ -130,7 +130,7 @@ public function withMake(string $make): self public function withModel(string $model): self { $obj = clone $this; - $obj->model = $model; + $obj->Model = $model; return $obj; } @@ -138,7 +138,7 @@ public function withModel(string $model): self public function withModifyDate(string $modifyDate): self { $obj = clone $this; - $obj->modifyDate = $modifyDate; + $obj->ModifyDate = $modifyDate; return $obj; } @@ -146,7 +146,7 @@ public function withModifyDate(string $modifyDate): self public function withOrientation(int $orientation): self { $obj = clone $this; - $obj->orientation = $orientation; + $obj->Orientation = $orientation; return $obj; } @@ -154,7 +154,7 @@ public function withOrientation(int $orientation): self public function withResolutionUnit(int $resolutionUnit): self { $obj = clone $this; - $obj->resolutionUnit = $resolutionUnit; + $obj->ResolutionUnit = $resolutionUnit; return $obj; } @@ -162,7 +162,7 @@ public function withResolutionUnit(int $resolutionUnit): self public function withSoftware(string $software): self { $obj = clone $this; - $obj->software = $software; + $obj->Software = $software; return $obj; } @@ -170,7 +170,7 @@ public function withSoftware(string $software): self public function withXResolution(int $xResolution): self { $obj = clone $this; - $obj->xResolution = $xResolution; + $obj->XResolution = $xResolution; return $obj; } @@ -178,7 +178,7 @@ public function withXResolution(int $xResolution): self public function withYCbCrPositioning(int $yCbCrPositioning): self { $obj = clone $this; - $obj->yCbCrPositioning = $yCbCrPositioning; + $obj->YCbCrPositioning = $yCbCrPositioning; return $obj; } @@ -186,7 +186,7 @@ public function withYCbCrPositioning(int $yCbCrPositioning): self public function withYResolution(int $yResolution): self { $obj = clone $this; - $obj->yResolution = $yResolution; + $obj->YResolution = $yResolution; return $obj; } diff --git a/src/Files/Metadata/Exif/Interoperability.php b/src/Files/Metadata/Exif/Interoperability.php index 42cfe84f..04698375 100644 --- a/src/Files/Metadata/Exif/Interoperability.php +++ b/src/Files/Metadata/Exif/Interoperability.php @@ -12,7 +12,7 @@ * JSON object. * * @phpstan-type InteroperabilityShape = array{ - * interopIndex?: string, interopVersion?: string + * InteropIndex?: string|null, InteropVersion?: string|null * } */ final class Interoperability implements BaseModel @@ -20,11 +20,11 @@ final class Interoperability implements BaseModel /** @use SdkModel */ use SdkModel; - #[Api('InteropIndex', optional: true)] - public ?string $interopIndex; + #[Api(optional: true)] + public ?string $InteropIndex; - #[Api('InteropVersion', optional: true)] - public ?string $interopVersion; + #[Api(optional: true)] + public ?string $InteropVersion; public function __construct() { @@ -37,13 +37,13 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - ?string $interopIndex = null, - ?string $interopVersion = null + ?string $InteropIndex = null, + ?string $InteropVersion = null ): self { $obj = new self; - null !== $interopIndex && $obj->interopIndex = $interopIndex; - null !== $interopVersion && $obj->interopVersion = $interopVersion; + null !== $InteropIndex && $obj->InteropIndex = $InteropIndex; + null !== $InteropVersion && $obj->InteropVersion = $InteropVersion; return $obj; } @@ -51,7 +51,7 @@ public static function with( public function withInteropIndex(string $interopIndex): self { $obj = clone $this; - $obj->interopIndex = $interopIndex; + $obj->InteropIndex = $interopIndex; return $obj; } @@ -59,7 +59,7 @@ public function withInteropIndex(string $interopIndex): self public function withInteropVersion(string $interopVersion): self { $obj = clone $this; - $obj->interopVersion = $interopVersion; + $obj->InteropVersion = $interopVersion; return $obj; } diff --git a/src/Files/Metadata/Exif/Thumbnail.php b/src/Files/Metadata/Exif/Thumbnail.php index 1184f03e..d1e9bf63 100644 --- a/src/Files/Metadata/Exif/Thumbnail.php +++ b/src/Files/Metadata/Exif/Thumbnail.php @@ -12,12 +12,12 @@ * Object containing Thumbnail information. * * @phpstan-type ThumbnailShape = array{ - * compression?: int, - * resolutionUnit?: int, - * thumbnailLength?: int, - * thumbnailOffset?: int, - * xResolution?: int, - * yResolution?: int, + * Compression?: int|null, + * ResolutionUnit?: int|null, + * ThumbnailLength?: int|null, + * ThumbnailOffset?: int|null, + * XResolution?: int|null, + * YResolution?: int|null, * } */ final class Thumbnail implements BaseModel @@ -25,23 +25,23 @@ final class Thumbnail implements BaseModel /** @use SdkModel */ use SdkModel; - #[Api('Compression', optional: true)] - public ?int $compression; + #[Api(optional: true)] + public ?int $Compression; - #[Api('ResolutionUnit', optional: true)] - public ?int $resolutionUnit; + #[Api(optional: true)] + public ?int $ResolutionUnit; - #[Api('ThumbnailLength', optional: true)] - public ?int $thumbnailLength; + #[Api(optional: true)] + public ?int $ThumbnailLength; - #[Api('ThumbnailOffset', optional: true)] - public ?int $thumbnailOffset; + #[Api(optional: true)] + public ?int $ThumbnailOffset; - #[Api('XResolution', optional: true)] - public ?int $xResolution; + #[Api(optional: true)] + public ?int $XResolution; - #[Api('YResolution', optional: true)] - public ?int $yResolution; + #[Api(optional: true)] + public ?int $YResolution; public function __construct() { @@ -54,21 +54,21 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - ?int $compression = null, - ?int $resolutionUnit = null, - ?int $thumbnailLength = null, - ?int $thumbnailOffset = null, - ?int $xResolution = null, - ?int $yResolution = null, + ?int $Compression = null, + ?int $ResolutionUnit = null, + ?int $ThumbnailLength = null, + ?int $ThumbnailOffset = null, + ?int $XResolution = null, + ?int $YResolution = null, ): self { $obj = new self; - null !== $compression && $obj->compression = $compression; - null !== $resolutionUnit && $obj->resolutionUnit = $resolutionUnit; - null !== $thumbnailLength && $obj->thumbnailLength = $thumbnailLength; - null !== $thumbnailOffset && $obj->thumbnailOffset = $thumbnailOffset; - null !== $xResolution && $obj->xResolution = $xResolution; - null !== $yResolution && $obj->yResolution = $yResolution; + null !== $Compression && $obj->Compression = $Compression; + null !== $ResolutionUnit && $obj->ResolutionUnit = $ResolutionUnit; + null !== $ThumbnailLength && $obj->ThumbnailLength = $ThumbnailLength; + null !== $ThumbnailOffset && $obj->ThumbnailOffset = $ThumbnailOffset; + null !== $XResolution && $obj->XResolution = $XResolution; + null !== $YResolution && $obj->YResolution = $YResolution; return $obj; } @@ -76,7 +76,7 @@ public static function with( public function withCompression(int $compression): self { $obj = clone $this; - $obj->compression = $compression; + $obj->Compression = $compression; return $obj; } @@ -84,7 +84,7 @@ public function withCompression(int $compression): self public function withResolutionUnit(int $resolutionUnit): self { $obj = clone $this; - $obj->resolutionUnit = $resolutionUnit; + $obj->ResolutionUnit = $resolutionUnit; return $obj; } @@ -92,7 +92,7 @@ public function withResolutionUnit(int $resolutionUnit): self public function withThumbnailLength(int $thumbnailLength): self { $obj = clone $this; - $obj->thumbnailLength = $thumbnailLength; + $obj->ThumbnailLength = $thumbnailLength; return $obj; } @@ -100,7 +100,7 @@ public function withThumbnailLength(int $thumbnailLength): self public function withThumbnailOffset(int $thumbnailOffset): self { $obj = clone $this; - $obj->thumbnailOffset = $thumbnailOffset; + $obj->ThumbnailOffset = $thumbnailOffset; return $obj; } @@ -108,7 +108,7 @@ public function withThumbnailOffset(int $thumbnailOffset): self public function withXResolution(int $xResolution): self { $obj = clone $this; - $obj->xResolution = $xResolution; + $obj->XResolution = $xResolution; return $obj; } @@ -116,7 +116,7 @@ public function withXResolution(int $xResolution): self public function withYResolution(int $yResolution): self { $obj = clone $this; - $obj->yResolution = $yResolution; + $obj->YResolution = $yResolution; return $obj; } diff --git a/src/Files/UpdateFileRequest.php b/src/Files/UpdateFileRequest.php index f6bde78a..276303a7 100644 --- a/src/Files/UpdateFileRequest.php +++ b/src/Files/UpdateFileRequest.php @@ -18,8 +18,7 @@ final class UpdateFileRequest implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Files/UpdateFileRequest/ChangePublicationStatus.php b/src/Files/UpdateFileRequest/ChangePublicationStatus.php index aaabfb8f..32a4606d 100644 --- a/src/Files/UpdateFileRequest/ChangePublicationStatus.php +++ b/src/Files/UpdateFileRequest/ChangePublicationStatus.php @@ -10,7 +10,7 @@ use ImageKit\Files\UpdateFileRequest\ChangePublicationStatus\Publish; /** - * @phpstan-type ChangePublicationStatusShape = array{publish?: Publish} + * @phpstan-type ChangePublicationStatusShape = array{publish?: Publish|null} */ final class ChangePublicationStatus implements BaseModel { diff --git a/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php b/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php index 061c9989..95a3d19b 100644 --- a/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php +++ b/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php @@ -12,7 +12,7 @@ * Configure the publication status of a file and its versions. * * @phpstan-type PublishShape = array{ - * isPublished: bool, includeFileVersions?: bool + * isPublished: bool, includeFileVersions?: bool|null * } */ final class Publish implements BaseModel diff --git a/src/Files/UpdateFileRequest/UpdateFileDetails.php b/src/Files/UpdateFileRequest/UpdateFileDetails.php index 22bc2ee1..0e02e728 100644 --- a/src/Files/UpdateFileRequest/UpdateFileDetails.php +++ b/src/Files/UpdateFileRequest/UpdateFileDetails.php @@ -16,12 +16,12 @@ /** * @phpstan-type UpdateFileDetailsShape = array{ * customCoordinates?: string|null, - * customMetadata?: array, - * description?: string, - * extensions?: list, - * removeAITags?: string|list, + * customMetadata?: array|null, + * description?: string|null, + * extensions?: list|null, + * removeAITags?: null|"all"|list, * tags?: list|null, - * webhookURL?: string, + * webhookUrl?: string|null, * } */ final class UpdateFileDetails implements BaseModel @@ -38,7 +38,7 @@ final class UpdateFileDetails implements BaseModel /** * A key-value data to be associated with the asset. To unset a key, send `null` value for that key. Before setting any custom metadata on an asset you have to create the field using custom metadata fields API. * - * @var array|null $customMetadata + * @var array|null $customMetadata */ #[Api(map: 'mixed', optional: true)] public ?array $customMetadata; @@ -64,7 +64,7 @@ final class UpdateFileDetails implements BaseModel * * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. * - * @var string|list|null $removeAITags + * @var "all"|list|null $removeAITags */ #[Api(union: RemoveAITags::class, optional: true)] public string|array|null $removeAITags; @@ -80,8 +80,8 @@ final class UpdateFileDetails implements BaseModel /** * The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. */ - #[Api('webhookUrl', optional: true)] - public ?string $webhookURL; + #[Api(optional: true)] + public ?string $webhookUrl; public function __construct() { @@ -93,9 +93,9 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param array $customMetadata + * @param array $customMetadata * @param list $extensions - * @param string|list $removeAITags + * @param "all"|list $removeAITags * @param list|null $tags */ public static function with( @@ -105,7 +105,7 @@ public static function with( ?array $extensions = null, string|array|null $removeAITags = null, ?array $tags = null, - ?string $webhookURL = null, + ?string $webhookUrl = null, ): self { $obj = new self; @@ -115,7 +115,7 @@ public static function with( null !== $extensions && $obj->extensions = $extensions; null !== $removeAITags && $obj->removeAITags = $removeAITags; null !== $tags && $obj->tags = $tags; - null !== $webhookURL && $obj->webhookURL = $webhookURL; + null !== $webhookUrl && $obj->webhookUrl = $webhookUrl; return $obj; } @@ -134,7 +134,7 @@ public function withCustomCoordinates(?string $customCoordinates): self /** * A key-value data to be associated with the asset. To unset a key, send `null` value for that key. Before setting any custom metadata on an asset you have to create the field using custom metadata fields API. * - * @param array $customMetadata + * @param array $customMetadata */ public function withCustomMetadata(array $customMetadata): self { @@ -175,7 +175,7 @@ public function withExtensions(array $extensions): self * * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. * - * @param string|list $removeAITags + * @param "all"|list $removeAITags */ public function withRemoveAITags(string|array $removeAITags): self { @@ -204,7 +204,7 @@ public function withTags(?array $tags): self public function withWebhookURL(string $webhookURL): self { $obj = clone $this; - $obj->webhookURL = $webhookURL; + $obj->webhookUrl = $webhookURL; return $obj; } diff --git a/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php b/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php index ad2c61ce..a049e04b 100644 --- a/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php +++ b/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php @@ -21,8 +21,7 @@ final class RemoveAITags implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Files/Versions/VersionDeleteParams.php b/src/Files/Versions/VersionDeleteParams.php index 102b2fae..71a33a10 100644 --- a/src/Files/Versions/VersionDeleteParams.php +++ b/src/Files/Versions/VersionDeleteParams.php @@ -16,7 +16,7 @@ * * @see ImageKit\Files\Versions->delete * - * @phpstan-type VersionDeleteParamsShape = array{fileID: string} + * @phpstan-type VersionDeleteParamsShape = array{fileId: string} */ final class VersionDeleteParams implements BaseModel { @@ -25,14 +25,14 @@ final class VersionDeleteParams implements BaseModel use SdkParams; #[Api] - public string $fileID; + public string $fileId; /** * `new VersionDeleteParams()` is missing required properties by the API. * * To enforce required parameters use * ``` - * VersionDeleteParams::with(fileID: ...) + * VersionDeleteParams::with(fileId: ...) * ``` * * Otherwise ensure the following setters are called @@ -51,11 +51,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. */ - public static function with(string $fileID): self + public static function with(string $fileId): self { $obj = new self; - $obj->fileID = $fileID; + $obj->fileId = $fileId; return $obj; } @@ -63,7 +63,7 @@ public static function with(string $fileID): self public function withFileID(string $fileID): self { $obj = clone $this; - $obj->fileID = $fileID; + $obj->fileId = $fileID; return $obj; } diff --git a/src/Files/Versions/VersionGetParams.php b/src/Files/Versions/VersionGetParams.php index 06548974..82bfe8c0 100644 --- a/src/Files/Versions/VersionGetParams.php +++ b/src/Files/Versions/VersionGetParams.php @@ -14,7 +14,7 @@ * * @see ImageKit\Files\Versions->get * - * @phpstan-type VersionGetParamsShape = array{fileID: string} + * @phpstan-type VersionGetParamsShape = array{fileId: string} */ final class VersionGetParams implements BaseModel { @@ -23,14 +23,14 @@ final class VersionGetParams implements BaseModel use SdkParams; #[Api] - public string $fileID; + public string $fileId; /** * `new VersionGetParams()` is missing required properties by the API. * * To enforce required parameters use * ``` - * VersionGetParams::with(fileID: ...) + * VersionGetParams::with(fileId: ...) * ``` * * Otherwise ensure the following setters are called @@ -49,11 +49,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. */ - public static function with(string $fileID): self + public static function with(string $fileId): self { $obj = new self; - $obj->fileID = $fileID; + $obj->fileId = $fileId; return $obj; } @@ -61,7 +61,7 @@ public static function with(string $fileID): self public function withFileID(string $fileID): self { $obj = clone $this; - $obj->fileID = $fileID; + $obj->fileId = $fileID; return $obj; } diff --git a/src/Files/Versions/VersionRestoreParams.php b/src/Files/Versions/VersionRestoreParams.php index b5e0b415..1eee6e39 100644 --- a/src/Files/Versions/VersionRestoreParams.php +++ b/src/Files/Versions/VersionRestoreParams.php @@ -14,7 +14,7 @@ * * @see ImageKit\Files\Versions->restore * - * @phpstan-type VersionRestoreParamsShape = array{fileID: string} + * @phpstan-type VersionRestoreParamsShape = array{fileId: string} */ final class VersionRestoreParams implements BaseModel { @@ -23,14 +23,14 @@ final class VersionRestoreParams implements BaseModel use SdkParams; #[Api] - public string $fileID; + public string $fileId; /** * `new VersionRestoreParams()` is missing required properties by the API. * * To enforce required parameters use * ``` - * VersionRestoreParams::with(fileID: ...) + * VersionRestoreParams::with(fileId: ...) * ``` * * Otherwise ensure the following setters are called @@ -49,11 +49,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. */ - public static function with(string $fileID): self + public static function with(string $fileId): self { $obj = new self; - $obj->fileID = $fileID; + $obj->fileId = $fileId; return $obj; } @@ -61,7 +61,7 @@ public static function with(string $fileID): self public function withFileID(string $fileID): self { $obj = clone $this; - $obj->fileID = $fileID; + $obj->fileId = $fileID; return $obj; } diff --git a/src/Folders/FolderCopyResponse.php b/src/Folders/FolderCopyResponse.php index 5b512cb1..abe370bf 100644 --- a/src/Folders/FolderCopyResponse.php +++ b/src/Folders/FolderCopyResponse.php @@ -13,7 +13,7 @@ /** * Job submitted successfully. A `jobId` will be returned. * - * @phpstan-type FolderCopyResponseShape = array{jobID: string} + * @phpstan-type FolderCopyResponseShape = array{jobId: string} */ final class FolderCopyResponse implements BaseModel, ResponseConverter { @@ -25,15 +25,15 @@ final class FolderCopyResponse implements BaseModel, ResponseConverter /** * Unique identifier of the bulk job. This can be used to check the status of the bulk job. */ - #[Api('jobId')] - public string $jobID; + #[Api] + public string $jobId; /** * `new FolderCopyResponse()` is missing required properties by the API. * * To enforce required parameters use * ``` - * FolderCopyResponse::with(jobID: ...) + * FolderCopyResponse::with(jobId: ...) * ``` * * Otherwise ensure the following setters are called @@ -52,11 +52,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. */ - public static function with(string $jobID): self + public static function with(string $jobId): self { $obj = new self; - $obj->jobID = $jobID; + $obj->jobId = $jobId; return $obj; } @@ -67,7 +67,7 @@ public static function with(string $jobID): self public function withJobID(string $jobID): self { $obj = clone $this; - $obj->jobID = $jobID; + $obj->jobId = $jobID; return $obj; } diff --git a/src/Folders/FolderMoveResponse.php b/src/Folders/FolderMoveResponse.php index 103ae1a6..ba1a9f56 100644 --- a/src/Folders/FolderMoveResponse.php +++ b/src/Folders/FolderMoveResponse.php @@ -13,7 +13,7 @@ /** * Job submitted successfully. A `jobId` will be returned. * - * @phpstan-type FolderMoveResponseShape = array{jobID: string} + * @phpstan-type FolderMoveResponseShape = array{jobId: string} */ final class FolderMoveResponse implements BaseModel, ResponseConverter { @@ -25,15 +25,15 @@ final class FolderMoveResponse implements BaseModel, ResponseConverter /** * Unique identifier of the bulk job. This can be used to check the status of the bulk job. */ - #[Api('jobId')] - public string $jobID; + #[Api] + public string $jobId; /** * `new FolderMoveResponse()` is missing required properties by the API. * * To enforce required parameters use * ``` - * FolderMoveResponse::with(jobID: ...) + * FolderMoveResponse::with(jobId: ...) * ``` * * Otherwise ensure the following setters are called @@ -52,11 +52,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. */ - public static function with(string $jobID): self + public static function with(string $jobId): self { $obj = new self; - $obj->jobID = $jobID; + $obj->jobId = $jobId; return $obj; } @@ -67,7 +67,7 @@ public static function with(string $jobID): self public function withJobID(string $jobID): self { $obj = clone $this; - $obj->jobID = $jobID; + $obj->jobId = $jobID; return $obj; } diff --git a/src/Folders/FolderRenameResponse.php b/src/Folders/FolderRenameResponse.php index c1de8b8f..392ed037 100644 --- a/src/Folders/FolderRenameResponse.php +++ b/src/Folders/FolderRenameResponse.php @@ -13,7 +13,7 @@ /** * Job submitted successfully. A `jobId` will be returned. * - * @phpstan-type FolderRenameResponseShape = array{jobID: string} + * @phpstan-type FolderRenameResponseShape = array{jobId: string} */ final class FolderRenameResponse implements BaseModel, ResponseConverter { @@ -25,15 +25,15 @@ final class FolderRenameResponse implements BaseModel, ResponseConverter /** * Unique identifier of the bulk job. This can be used to check the status of the bulk job. */ - #[Api('jobId')] - public string $jobID; + #[Api] + public string $jobId; /** * `new FolderRenameResponse()` is missing required properties by the API. * * To enforce required parameters use * ``` - * FolderRenameResponse::with(jobID: ...) + * FolderRenameResponse::with(jobId: ...) * ``` * * Otherwise ensure the following setters are called @@ -52,11 +52,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. */ - public static function with(string $jobID): self + public static function with(string $jobId): self { $obj = new self; - $obj->jobID = $jobID; + $obj->jobId = $jobId; return $obj; } @@ -67,7 +67,7 @@ public static function with(string $jobID): self public function withJobID(string $jobID): self { $obj = clone $this; - $obj->jobID = $jobID; + $obj->jobId = $jobID; return $obj; } diff --git a/src/Folders/Job/JobGetResponse.php b/src/Folders/Job/JobGetResponse.php index 54c94dd9..7842a59b 100644 --- a/src/Folders/Job/JobGetResponse.php +++ b/src/Folders/Job/JobGetResponse.php @@ -14,10 +14,10 @@ /** * @phpstan-type JobGetResponseShape = array{ - * jobID?: string, - * purgeRequestID?: string, - * status?: value-of, - * type?: value-of, + * jobId?: string|null, + * purgeRequestId?: string|null, + * status?: value-of|null, + * type?: value-of|null, * } */ final class JobGetResponse implements BaseModel, ResponseConverter @@ -30,14 +30,14 @@ final class JobGetResponse implements BaseModel, ResponseConverter /** * Unique identifier of the bulk job. */ - #[Api('jobId', optional: true)] - public ?string $jobID; + #[Api(optional: true)] + public ?string $jobId; /** * Unique identifier of the purge request. This will be present only if `purgeCache` is set to `true` in the rename folder API request. */ - #[Api('purgeRequestId', optional: true)] - public ?string $purgeRequestID; + #[Api(optional: true)] + public ?string $purgeRequestId; /** * Status of the bulk job. @@ -69,15 +69,15 @@ public function __construct() * @param Type|value-of $type */ public static function with( - ?string $jobID = null, - ?string $purgeRequestID = null, + ?string $jobId = null, + ?string $purgeRequestId = null, Status|string|null $status = null, Type|string|null $type = null, ): self { $obj = new self; - null !== $jobID && $obj->jobID = $jobID; - null !== $purgeRequestID && $obj->purgeRequestID = $purgeRequestID; + null !== $jobId && $obj->jobId = $jobId; + null !== $purgeRequestId && $obj->purgeRequestId = $purgeRequestId; null !== $status && $obj['status'] = $status; null !== $type && $obj['type'] = $type; @@ -90,7 +90,7 @@ public static function with( public function withJobID(string $jobID): self { $obj = clone $this; - $obj->jobID = $jobID; + $obj->jobId = $jobID; return $obj; } @@ -101,7 +101,7 @@ public function withJobID(string $jobID): self public function withPurgeRequestID(string $purgeRequestID): self { $obj = clone $this; - $obj->purgeRequestID = $purgeRequestID; + $obj->purgeRequestId = $purgeRequestID; return $obj; } diff --git a/src/GetImageAttributesOptions.php b/src/GetImageAttributesOptions.php index 0c4b68fa..5c4e55d1 100644 --- a/src/GetImageAttributesOptions.php +++ b/src/GetImageAttributesOptions.php @@ -15,15 +15,15 @@ * @phpstan-type GetImageAttributesOptionsShape = array{ * src: string, * urlEndpoint: string, - * expiresIn?: float, - * queryParameters?: array, - * signed?: bool, - * transformation?: list, - * transformationPosition?: value-of, - * deviceBreakpoints?: list, - * imageBreakpoints?: list, - * sizes?: string, - * width?: float, + * expiresIn?: float|null, + * queryParameters?: array|null, + * signed?: bool|null, + * transformation?: list|null, + * transformationPosition?: value-of|null, + * deviceBreakpoints?: list|null, + * imageBreakpoints?: list|null, + * sizes?: string|null, + * width?: float|null, * } */ final class GetImageAttributesOptions implements BaseModel @@ -62,7 +62,7 @@ final class GetImageAttributesOptions implements BaseModel * They can be any query parameters and not necessarily related to ImageKit. * This is especially useful if you want to add a versioning parameter to your URLs. * - * @var array|null $queryParameters + * @var array|null $queryParameters */ #[Api(map: 'string', optional: true)] public ?array $queryParameters; @@ -167,7 +167,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param array $queryParameters + * @param array $queryParameters * @param list $transformation * @param TransformationPosition|value-of $transformationPosition * @param list $deviceBreakpoints @@ -250,7 +250,7 @@ public function withExpiresIn(float $expiresIn): self * They can be any query parameters and not necessarily related to ImageKit. * This is especially useful if you want to add a versioning parameter to your URLs. * - * @param array $queryParameters + * @param array $queryParameters */ public function withQueryParameters(array $queryParameters): self { diff --git a/src/ImageOverlay.php b/src/ImageOverlay.php index 607c6be1..50d423bd 100644 --- a/src/ImageOverlay.php +++ b/src/ImageOverlay.php @@ -11,12 +11,12 @@ /** * @phpstan-type ImageOverlayShape = array{ - * position?: OverlayPosition, - * timing?: OverlayTiming, + * position?: OverlayPosition|null, + * timing?: OverlayTiming|null, * input: string, - * type: string, - * encoding?: value-of, - * transformation?: list, + * type: "image", + * encoding?: value-of|null, + * transformation?: list|null, * } */ final class ImageOverlay implements BaseModel @@ -24,6 +24,7 @@ final class ImageOverlay implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "image" $type */ #[Api] public string $type = 'image'; diff --git a/src/Overlay.php b/src/Overlay.php index 8ddcd733..5402883b 100644 --- a/src/Overlay.php +++ b/src/Overlay.php @@ -23,8 +23,7 @@ public static function discriminator(): string } /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/OverlayPosition.php b/src/OverlayPosition.php index a3baf874..dd816305 100644 --- a/src/OverlayPosition.php +++ b/src/OverlayPosition.php @@ -11,7 +11,7 @@ /** * @phpstan-type OverlayPositionShape = array{ - * focus?: value-of, x?: float|string, y?: float|string + * focus?: value-of|null, x?: float|string|null, y?: float|string|null * } */ final class OverlayPosition implements BaseModel diff --git a/src/OverlayPosition/X.php b/src/OverlayPosition/X.php index 720101a6..1dd4d388 100644 --- a/src/OverlayPosition/X.php +++ b/src/OverlayPosition/X.php @@ -19,8 +19,7 @@ final class X implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/OverlayPosition/Y.php b/src/OverlayPosition/Y.php index b5af671a..018dd689 100644 --- a/src/OverlayPosition/Y.php +++ b/src/OverlayPosition/Y.php @@ -19,8 +19,7 @@ final class Y implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/OverlayTiming.php b/src/OverlayTiming.php index 57d3c408..1a67e254 100644 --- a/src/OverlayTiming.php +++ b/src/OverlayTiming.php @@ -10,7 +10,9 @@ /** * @phpstan-type OverlayTimingShape = array{ - * duration?: float|string, end?: float|string, start?: float|string + * duration?: float|string|null, + * end?: float|string|null, + * start?: float|string|null, * } */ final class OverlayTiming implements BaseModel diff --git a/src/OverlayTiming/Duration.php b/src/OverlayTiming/Duration.php index 64ae7c3e..1482c2fd 100644 --- a/src/OverlayTiming/Duration.php +++ b/src/OverlayTiming/Duration.php @@ -19,8 +19,7 @@ final class Duration implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/OverlayTiming/End.php b/src/OverlayTiming/End.php index afc953c5..2b30a3cf 100644 --- a/src/OverlayTiming/End.php +++ b/src/OverlayTiming/End.php @@ -20,8 +20,7 @@ final class End implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/OverlayTiming/Start.php b/src/OverlayTiming/Start.php index 28b73db9..f683510c 100644 --- a/src/OverlayTiming/Start.php +++ b/src/OverlayTiming/Start.php @@ -19,8 +19,7 @@ final class Start implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/RequestOptions.php b/src/RequestOptions.php index eec3ead6..f3283ff0 100644 --- a/src/RequestOptions.php +++ b/src/RequestOptions.php @@ -21,8 +21,8 @@ * maxRetries?: int|null, * initialRetryDelay?: float|null, * maxRetryDelay?: float|null, - * extraHeaders?: array>|null, - * extraQueryParams?: array|null, + * extraHeaders?: array>|null, + * extraQueryParams?: array|null, * extraBodyParams?: mixed, * transporter?: ClientInterface|null, * uriFactory?: UriFactoryInterface|null, @@ -48,11 +48,11 @@ final class RequestOptions implements BaseModel #[Property] public float $maxRetryDelay = 8.0; - /** @var array|null>|null $extraHeaders */ + /** @var array|null>|null $extraHeaders */ #[Property(optional: true)] public ?array $extraHeaders; - /** @var array|null $extraQueryParams */ + /** @var array|null $extraQueryParams */ #[Property(optional: true)] public ?array $extraQueryParams; @@ -87,8 +87,8 @@ public static function parse(RequestOptions|array|null ...$options): self } /** - * @param array|null>|null $extraHeaders - * @param array|null $extraQueryParams + * @param array|null>|null $extraHeaders + * @param array|null $extraQueryParams * @param mixed|Omit $extraBodyParams */ public static function with( @@ -154,7 +154,7 @@ public function withMaxRetryDelay(float $maxRetryDelay): self } /** - * @param array|null> $extraHeaders + * @param array|null> $extraHeaders */ public function withExtraHeaders(array $extraHeaders): self { @@ -165,7 +165,7 @@ public function withExtraHeaders(array $extraHeaders): self } /** - * @param array $extraQueryParams + * @param array $extraQueryParams */ public function withExtraQueryParams(array $extraQueryParams): self { diff --git a/src/ResponsiveImageAttributes.php b/src/ResponsiveImageAttributes.php index caabfc6c..2e7015f9 100644 --- a/src/ResponsiveImageAttributes.php +++ b/src/ResponsiveImageAttributes.php @@ -13,7 +13,7 @@ * Useful for enabling responsive image loading with `srcSet` and `sizes`. * * @phpstan-type ResponsiveImageAttributesShape = array{ - * src: string, sizes?: string, srcSet?: string, width?: float + * src: string, sizes?: string|null, srcSet?: string|null, width?: float|null * } */ final class ResponsiveImageAttributes implements BaseModel diff --git a/src/ServiceContracts/Accounts/OriginsContract.php b/src/ServiceContracts/Accounts/OriginsContract.php index d7b16812..0b0cbadf 100644 --- a/src/ServiceContracts/Accounts/OriginsContract.php +++ b/src/ServiceContracts/Accounts/OriginsContract.php @@ -15,137 +15,26 @@ use ImageKit\Core\Exceptions\APIException; use ImageKit\RequestOptions; -use const ImageKit\Core\OMIT as omit; - interface OriginsContract { /** * @api * - * @param string $accessKey access key for the bucket - * @param string $bucket - * @param string $name display name of the origin - * @param string $secretKey secret key for the bucket - * @param string $type - * @param string $endpoint custom S3-compatible endpoint - * @param string $baseURL akeneo instance base URL - * @param string $clientEmail - * @param string $privateKey - * @param string $accountName - * @param string $container - * @param string $sasToken - * @param string $clientID akeneo API client ID - * @param string $clientSecret akeneo API client secret - * @param string $password akeneo API password - * @param string $username akeneo API username - * @param string $baseURLForCanonicalHeader URL used in the Canonical header (if enabled) - * @param bool $includeCanonicalHeader whether to send a Canonical header - * @param string $prefix - * @param bool $s3ForcePathStyle Use path-style S3 URLs? - * @param bool $forwardHostHeaderToOrigin Forward the Host header to origin? - * * @throws APIException */ public function create( - $accessKey, - $bucket, - $name, - $secretKey, - $type, - $endpoint, - $baseURL, - $clientEmail, - $privateKey, - $accountName, - $container, - $sasToken, - $clientID, - $clientSecret, - $password, - $username, - $baseURLForCanonicalHeader = omit, - $includeCanonicalHeader = omit, - $prefix = omit, - $s3ForcePathStyle = omit, - $forwardHostHeaderToOrigin = omit, - ?RequestOptions $requestOptions = null, - ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim; - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function createRaw( - array $params, + mixed $params, ?RequestOptions $requestOptions = null ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim; /** * @api * - * @param string $accessKey access key for the bucket - * @param string $bucket - * @param string $name display name of the origin - * @param string $secretKey secret key for the bucket - * @param string $type - * @param string $endpoint custom S3-compatible endpoint - * @param string $baseURL akeneo instance base URL - * @param string $clientEmail - * @param string $privateKey - * @param string $accountName - * @param string $container - * @param string $sasToken - * @param string $clientID akeneo API client ID - * @param string $clientSecret akeneo API client secret - * @param string $password akeneo API password - * @param string $username akeneo API username - * @param string $baseURLForCanonicalHeader URL used in the Canonical header (if enabled) - * @param bool $includeCanonicalHeader whether to send a Canonical header - * @param string $prefix - * @param bool $s3ForcePathStyle Use path-style S3 URLs? - * @param bool $forwardHostHeaderToOrigin Forward the Host header to origin? - * * @throws APIException */ public function update( string $id, - $accessKey, - $bucket, - $name, - $secretKey, - $type, - $endpoint, - $baseURL, - $clientEmail, - $privateKey, - $accountName, - $container, - $sasToken, - $clientID, - $clientSecret, - $password, - $username, - $baseURLForCanonicalHeader = omit, - $includeCanonicalHeader = omit, - $prefix = omit, - $s3ForcePathStyle = omit, - $forwardHostHeaderToOrigin = omit, - ?RequestOptions $requestOptions = null, - ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim; - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function updateRaw( - string $id, - array $params, + mixed $params, ?RequestOptions $requestOptions = null ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim; diff --git a/src/ServiceContracts/Accounts/URLEndpointsContract.php b/src/ServiceContracts/Accounts/URLEndpointsContract.php index 4d4fbe92..f4142c72 100644 --- a/src/ServiceContracts/Accounts/URLEndpointsContract.php +++ b/src/ServiceContracts/Accounts/URLEndpointsContract.php @@ -4,79 +4,39 @@ namespace ImageKit\ServiceContracts\Accounts; -use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Akamai; -use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Cloudinary; -use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Imgix; +use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams; use ImageKit\Accounts\URLEndpoints\URLEndpointResponse; +use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams; use ImageKit\Core\Exceptions\APIException; use ImageKit\RequestOptions; -use const ImageKit\Core\OMIT as omit; - interface URLEndpointsContract { /** * @api * - * @param string $description description of the URL endpoint - * @param list $origins Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. - * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) - * @param Cloudinary|Imgix|Akamai $urlRewriter configuration for third-party URL rewriting + * @param array|URLEndpointCreateParams $params * * @throws APIException */ public function create( - $description, - $origins = omit, - $urlPrefix = omit, - $urlRewriter = omit, + array|URLEndpointCreateParams $params, ?RequestOptions $requestOptions = null, ): URLEndpointResponse; /** * @api * - * @param array $params - * - * @throws APIException - */ - public function createRaw( - array $params, - ?RequestOptions $requestOptions = null - ): URLEndpointResponse; - - /** - * @api - * - * @param string $description description of the URL endpoint - * @param list $origins Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. - * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) - * @param \ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Cloudinary|\ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Imgix|\ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Akamai $urlRewriter configuration for third-party URL rewriting + * @param array|URLEndpointUpdateParams $params * * @throws APIException */ public function update( string $id, - $description, - $origins = omit, - $urlPrefix = omit, - $urlRewriter = omit, + array|URLEndpointUpdateParams $params, ?RequestOptions $requestOptions = null, ): URLEndpointResponse; - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function updateRaw( - string $id, - array $params, - ?RequestOptions $requestOptions = null - ): URLEndpointResponse; - /** * @api * diff --git a/src/ServiceContracts/Accounts/UsageContract.php b/src/ServiceContracts/Accounts/UsageContract.php index 28a2a5cc..82a1e244 100644 --- a/src/ServiceContracts/Accounts/UsageContract.php +++ b/src/ServiceContracts/Accounts/UsageContract.php @@ -4,6 +4,7 @@ namespace ImageKit\ServiceContracts\Accounts; +use ImageKit\Accounts\Usage\UsageGetParams; use ImageKit\Accounts\Usage\UsageGetResponse; use ImageKit\Core\Exceptions\APIException; use ImageKit\RequestOptions; @@ -13,26 +14,12 @@ interface UsageContract /** * @api * - * @param \DateTimeInterface $endDate Specify a `endDate` in `YYYY-MM-DD` format. It should be after the `startDate`. The difference between `startDate` and `endDate` should be less than 90 days. - * @param \DateTimeInterface $startDate Specify a `startDate` in `YYYY-MM-DD` format. It should be before the `endDate`. The difference between `startDate` and `endDate` should be less than 90 days. + * @param array|UsageGetParams $params * * @throws APIException */ public function get( - $endDate, - $startDate, - ?RequestOptions $requestOptions = null - ): UsageGetResponse; - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function getRaw( - array $params, + array|UsageGetParams $params, ?RequestOptions $requestOptions = null ): UsageGetResponse; } diff --git a/src/ServiceContracts/AssetsContract.php b/src/ServiceContracts/AssetsContract.php index 7d770c12..b1be74fb 100644 --- a/src/ServiceContracts/AssetsContract.php +++ b/src/ServiceContracts/AssetsContract.php @@ -4,75 +4,25 @@ namespace ImageKit\ServiceContracts; -use ImageKit\Assets\AssetListParams\FileType; -use ImageKit\Assets\AssetListParams\Sort; -use ImageKit\Assets\AssetListParams\Type; +use ImageKit\Assets\AssetListParams; use ImageKit\Core\Exceptions\APIException; use ImageKit\Files\File; use ImageKit\Files\Folder; use ImageKit\RequestOptions; -use const ImageKit\Core\OMIT as omit; - interface AssetsContract { /** * @api * - * @param FileType|value-of $fileType Filter results by file type. - * - * - `all` — include all file types - * - `image` — include only image files - * - `non-image` — include only non-image files (e.g., JS, CSS, video) - * @param int $limit the maximum number of results to return in response - * @param string $path Folder path if you want to limit the search within a specific folder. For example, `/sales-banner/` will only search in folder sales-banner. - * - * Note : If your use case involves searching within a folder as well as its subfolders, you can use `path` parameter in `searchQuery` with appropriate operator. - * Checkout [Supported parameters](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#supported-parameters) for more information. - * @param string $searchQuery Query string in a Lucene-like query language e.g. `createdAt > "7d"`. - * - * Note : When the searchQuery parameter is present, the following query parameters will have no effect on the result: - * - * 1. `tags` - * 2. `type` - * 3. `name` - * - * [Learn more](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#advanced-search-queries) from examples. - * @param int $skip the number of results to skip before returning results - * @param Sort|value-of $sort sort the results by one of the supported fields in ascending or descending order - * @param Type|value-of $type Filter results by asset type. - * - * - `file` — returns only files - * - `file-version` — returns specific file versions - * - `folder` — returns only folders - * - `all` — returns both files and folders (excludes `file-version`) + * @param array|AssetListParams $params * * @return list * * @throws APIException */ public function list( - $fileType = omit, - $limit = omit, - $path = omit, - $searchQuery = omit, - $skip = omit, - $sort = omit, - $type = omit, - ?RequestOptions $requestOptions = null, - ): array; - - /** - * @api - * - * @param array $params - * - * @return list - * - * @throws APIException - */ - public function listRaw( - array $params, + array|AssetListParams $params, ?RequestOptions $requestOptions = null ): array; } diff --git a/src/ServiceContracts/Beta/V2/FilesContract.php b/src/ServiceContracts/Beta/V2/FilesContract.php index 432ccdea..bdeb0cb6 100644 --- a/src/ServiceContracts/Beta/V2/FilesContract.php +++ b/src/ServiceContracts/Beta/V2/FilesContract.php @@ -4,110 +4,22 @@ namespace ImageKit\ServiceContracts\Beta\V2; -use ImageKit\Beta\V2\Files\FileUploadParams\ResponseField; -use ImageKit\Beta\V2\Files\FileUploadParams\Transformation; +use ImageKit\Beta\V2\Files\FileUploadParams; use ImageKit\Beta\V2\Files\FileUploadResponse; use ImageKit\Core\Exceptions\APIException; -use ImageKit\ExtensionItem\AIAutoDescription; -use ImageKit\ExtensionItem\AutoTaggingExtension; -use ImageKit\ExtensionItem\RemoveBg; use ImageKit\RequestOptions; -use const ImageKit\Core\OMIT as omit; - interface FilesContract { /** * @api * - * @param string $file The API accepts any of the following: - * - * - **Binary data** – send the raw bytes as `multipart/form-data`. - * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. - * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. - * - * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. - * @param string $fileName the name with which the file has to be uploaded - * @param string $token This is the client-generated JSON Web Token (JWT). The ImageKit.io server uses it to authenticate and check that the upload request parameters have not been tampered with after the token has been generated. Learn how to create the token on the page below. This field is only required for authentication when uploading a file from the client side. - * @param string $checks Server-side checks to run on the asset. - * Read more about [Upload API checks](/docs/api-reference/upload-file/upload-file-v2#upload-api-checks). - * @param string $customCoordinates Define an important area in the image. This is only relevant for image type files. - * - * - To be passed as a string with the x and y coordinates of the top-left corner, and width and height of the area of interest in the format `x,y,width,height`. For example - `10,10,100,100` - * - Can be used with fo-customtransformation. - * - If this field is not specified and the file is overwritten, then customCoordinates will be removed. - * @param array $customMetadata JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. - * @param string $description optional text to describe the contents of the file - * @param list $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. - * @param string $folder The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. Using multiple `/` creates a nested folder. - * @param bool $isPrivateFile Whether to mark the file as private or not. - * - * If `true`, the file is marked as private and is accessible only using named transformation or signed URL. - * @param bool $isPublished Whether to upload file as published or not. - * - * If `false`, the file is marked as unpublished, which restricts access to the file only via the media library. Files in draft or unpublished state can only be publicly accessed after being published. - * - * The option to upload in draft state is only available in custom enterprise pricing plans. - * @param bool $overwriteAITags If set to `true` and a file already exists at the exact location, its AITags will be removed. Set `overwriteAITags` to `false` to preserve AITags. - * @param bool $overwriteCustomMetadata if the request does not have `customMetadata`, and a file already exists at the exact location, existing customMetadata will be removed - * @param bool $overwriteFile if `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately - * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed - * @param list> $responseFields array of response field keys to include in the API response body - * @param list $tags Set the tags while uploading the file. - * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. - * If this field is not specified and the file is overwritten, the existing tags will be removed. - * @param Transformation $transformation Configure pre-processing (`pre`) and post-processing (`post`) transformations. - * - * - `pre` — applied before the file is uploaded to the Media Library. - * Useful for reducing file size or applying basic optimizations upfront (e.g., resize, compress). - * - * - `post` — applied immediately after upload. - * Ideal for generating transformed versions (like video encodes or thumbnails) in advance, so they're ready for delivery without delay. - * - * You can mix and match any combination of post-processing types. - * @param bool $useUniqueFileName Whether to use a unique filename for this file or not. - * - * If `true`, ImageKit.io will add a unique suffix to the filename parameter to get a unique filename. - * - * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. - * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + * @param array|FileUploadParams $params * * @throws APIException */ public function upload( - $file, - $fileName, - $token = omit, - $checks = omit, - $customCoordinates = omit, - $customMetadata = omit, - $description = omit, - $extensions = omit, - $folder = omit, - $isPrivateFile = omit, - $isPublished = omit, - $overwriteAITags = omit, - $overwriteCustomMetadata = omit, - $overwriteFile = omit, - $overwriteTags = omit, - $responseFields = omit, - $tags = omit, - $transformation = omit, - $useUniqueFileName = omit, - $webhookURL = omit, - ?RequestOptions $requestOptions = null, - ): FileUploadResponse; - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function uploadRaw( - array $params, + array|FileUploadParams $params, ?RequestOptions $requestOptions = null ): FileUploadResponse; } diff --git a/src/ServiceContracts/Cache/InvalidationContract.php b/src/ServiceContracts/Cache/InvalidationContract.php index da9c00ff..38da2f61 100644 --- a/src/ServiceContracts/Cache/InvalidationContract.php +++ b/src/ServiceContracts/Cache/InvalidationContract.php @@ -4,6 +4,7 @@ namespace ImageKit\ServiceContracts\Cache; +use ImageKit\Cache\Invalidation\InvalidationCreateParams; use ImageKit\Cache\Invalidation\InvalidationGetResponse; use ImageKit\Cache\Invalidation\InvalidationNewResponse; use ImageKit\Core\Exceptions\APIException; @@ -14,25 +15,13 @@ interface InvalidationContract /** * @api * - * @param string $url the full URL of the file to be purged + * @param array|InvalidationCreateParams $params * * @throws APIException */ public function create( - $url, - ?RequestOptions $requestOptions = null - ): InvalidationNewResponse; - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function createRaw( - array $params, - ?RequestOptions $requestOptions = null + array|InvalidationCreateParams $params, + ?RequestOptions $requestOptions = null, ): InvalidationNewResponse; /** diff --git a/src/ServiceContracts/CustomMetadataFieldsContract.php b/src/ServiceContracts/CustomMetadataFieldsContract.php index 50c1e4e6..aeef92fb 100644 --- a/src/ServiceContracts/CustomMetadataFieldsContract.php +++ b/src/ServiceContracts/CustomMetadataFieldsContract.php @@ -6,100 +6,53 @@ use ImageKit\Core\Exceptions\APIException; use ImageKit\CustomMetadataFields\CustomMetadataField; -use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; +use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams; use ImageKit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; +use ImageKit\CustomMetadataFields\CustomMetadataFieldListParams; +use ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams; use ImageKit\RequestOptions; -use const ImageKit\Core\OMIT as omit; - interface CustomMetadataFieldsContract { /** * @api * - * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. - * @param string $name API name of the custom metadata field. This should be unique across all (including deleted) custom metadata fields. - * @param Schema $schema + * @param array|CustomMetadataFieldCreateParams $params * * @throws APIException */ public function create( - $label, - $name, - $schema, - ?RequestOptions $requestOptions = null - ): CustomMetadataField; - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function createRaw( - array $params, - ?RequestOptions $requestOptions = null + array|CustomMetadataFieldCreateParams $params, + ?RequestOptions $requestOptions = null, ): CustomMetadataField; /** * @api * - * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. This parameter is required if `schema` is not provided. - * @param \ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. + * @param array|CustomMetadataFieldUpdateParams $params * * @throws APIException */ public function update( string $id, - $label = omit, - $schema = omit, + array|CustomMetadataFieldUpdateParams $params, ?RequestOptions $requestOptions = null, ): CustomMetadataField; /** * @api * - * @param array $params - * - * @throws APIException - */ - public function updateRaw( - string $id, - array $params, - ?RequestOptions $requestOptions = null - ): CustomMetadataField; - - /** - * @api - * - * @param string $folderPath The folder path (e.g., `/path/to/folder`) for which to retrieve applicable custom metadata fields. Useful for determining path-specific field selections when the [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in use. - * @param bool $includeDeleted set it to `true` to include deleted field objects in the API response + * @param array|CustomMetadataFieldListParams $params * * @return list * * @throws APIException */ public function list( - $folderPath = omit, - $includeDeleted = omit, + array|CustomMetadataFieldListParams $params, ?RequestOptions $requestOptions = null, ): array; - /** - * @api - * - * @param array $params - * - * @return list - * - * @throws APIException - */ - public function listRaw( - array $params, - ?RequestOptions $requestOptions = null - ): array; - /** * @api * diff --git a/src/ServiceContracts/Files/BulkContract.php b/src/ServiceContracts/Files/BulkContract.php index a2e6fad2..eaecf6d1 100644 --- a/src/ServiceContracts/Files/BulkContract.php +++ b/src/ServiceContracts/Files/BulkContract.php @@ -5,9 +5,13 @@ namespace ImageKit\ServiceContracts\Files; use ImageKit\Core\Exceptions\APIException; +use ImageKit\Files\Bulk\BulkAddTagsParams; use ImageKit\Files\Bulk\BulkAddTagsResponse; +use ImageKit\Files\Bulk\BulkDeleteParams; use ImageKit\Files\Bulk\BulkDeleteResponse; +use ImageKit\Files\Bulk\BulkRemoveAITagsParams; use ImageKit\Files\Bulk\BulkRemoveAITagsResponse; +use ImageKit\Files\Bulk\BulkRemoveTagsParams; use ImageKit\Files\Bulk\BulkRemoveTagsResponse; use ImageKit\RequestOptions; @@ -16,102 +20,48 @@ interface BulkContract /** * @api * - * @param list $fileIDs an array of fileIds which you want to delete + * @param array|BulkDeleteParams $params * * @throws APIException */ public function delete( - $fileIDs, + array|BulkDeleteParams $params, ?RequestOptions $requestOptions = null ): BulkDeleteResponse; /** * @api * - * @param array $params - * - * @throws APIException - */ - public function deleteRaw( - array $params, - ?RequestOptions $requestOptions = null - ): BulkDeleteResponse; - - /** - * @api - * - * @param list $fileIDs an array of fileIds to which you want to add tags - * @param list $tags an array of tags that you want to add to the files + * @param array|BulkAddTagsParams $params * * @throws APIException */ public function addTags( - $fileIDs, - $tags, + array|BulkAddTagsParams $params, ?RequestOptions $requestOptions = null ): BulkAddTagsResponse; /** * @api * - * @param array $params - * - * @throws APIException - */ - public function addTagsRaw( - array $params, - ?RequestOptions $requestOptions = null - ): BulkAddTagsResponse; - - /** - * @api - * - * @param list $aiTags an array of AITags that you want to remove from the files - * @param list $fileIDs an array of fileIds from which you want to remove AITags + * @param array|BulkRemoveAITagsParams $params * * @throws APIException */ public function removeAITags( - $aiTags, - $fileIDs, - ?RequestOptions $requestOptions = null + array|BulkRemoveAITagsParams $params, + ?RequestOptions $requestOptions = null, ): BulkRemoveAITagsResponse; /** * @api * - * @param array $params - * - * @throws APIException - */ - public function removeAITagsRaw( - array $params, - ?RequestOptions $requestOptions = null - ): BulkRemoveAITagsResponse; - - /** - * @api - * - * @param list $fileIDs an array of fileIds from which you want to remove tags - * @param list $tags an array of tags that you want to remove from the files + * @param array|BulkRemoveTagsParams $params * * @throws APIException */ public function removeTags( - $fileIDs, - $tags, - ?RequestOptions $requestOptions = null - ): BulkRemoveTagsResponse; - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function removeTagsRaw( - array $params, - ?RequestOptions $requestOptions = null + array|BulkRemoveTagsParams $params, + ?RequestOptions $requestOptions = null, ): BulkRemoveTagsResponse; } diff --git a/src/ServiceContracts/Files/MetadataContract.php b/src/ServiceContracts/Files/MetadataContract.php index 8641ce9e..71e5a168 100644 --- a/src/ServiceContracts/Files/MetadataContract.php +++ b/src/ServiceContracts/Files/MetadataContract.php @@ -6,6 +6,7 @@ use ImageKit\Core\Exceptions\APIException; use ImageKit\Files\Metadata; +use ImageKit\Files\Metadata\MetadataGetFromURLParams; use ImageKit\RequestOptions; interface MetadataContract @@ -23,24 +24,12 @@ public function get( /** * @api * - * @param string $url Should be a valid file URL. It should be accessible using your ImageKit.io account. + * @param array|MetadataGetFromURLParams $params * * @throws APIException */ public function getFromURL( - $url, - ?RequestOptions $requestOptions = null - ): Metadata; - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function getFromURLRaw( - array $params, - ?RequestOptions $requestOptions = null + array|MetadataGetFromURLParams $params, + ?RequestOptions $requestOptions = null, ): Metadata; } diff --git a/src/ServiceContracts/Files/VersionsContract.php b/src/ServiceContracts/Files/VersionsContract.php index 623c4572..c8069413 100644 --- a/src/ServiceContracts/Files/VersionsContract.php +++ b/src/ServiceContracts/Files/VersionsContract.php @@ -6,7 +6,10 @@ use ImageKit\Core\Exceptions\APIException; use ImageKit\Files\File; +use ImageKit\Files\Versions\VersionDeleteParams; use ImageKit\Files\Versions\VersionDeleteResponse; +use ImageKit\Files\Versions\VersionGetParams; +use ImageKit\Files\Versions\VersionRestoreParams; use ImageKit\RequestOptions; interface VersionsContract @@ -26,78 +29,39 @@ public function list( /** * @api * - * @param string $fileID + * @param array|VersionDeleteParams $params * * @throws APIException */ public function delete( string $versionID, - $fileID, - ?RequestOptions $requestOptions = null + array|VersionDeleteParams $params, + ?RequestOptions $requestOptions = null, ): VersionDeleteResponse; /** * @api * - * @param array $params - * - * @throws APIException - */ - public function deleteRaw( - string $versionID, - array $params, - ?RequestOptions $requestOptions = null - ): VersionDeleteResponse; - - /** - * @api - * - * @param string $fileID + * @param array|VersionGetParams $params * * @throws APIException */ public function get( string $versionID, - $fileID, - ?RequestOptions $requestOptions = null + array|VersionGetParams $params, + ?RequestOptions $requestOptions = null, ): File; /** * @api * - * @param array $params - * - * @throws APIException - */ - public function getRaw( - string $versionID, - array $params, - ?RequestOptions $requestOptions = null - ): File; - - /** - * @api - * - * @param string $fileID + * @param array|VersionRestoreParams $params * * @throws APIException */ public function restore( string $versionID, - $fileID, - ?RequestOptions $requestOptions = null - ): File; - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function restoreRaw( - string $versionID, - array $params, - ?RequestOptions $requestOptions = null + array|VersionRestoreParams $params, + ?RequestOptions $requestOptions = null, ): File; } diff --git a/src/ServiceContracts/FilesContract.php b/src/ServiceContracts/FilesContract.php index 00a64177..867e7101 100644 --- a/src/ServiceContracts/FilesContract.php +++ b/src/ServiceContracts/FilesContract.php @@ -5,66 +5,28 @@ namespace ImageKit\ServiceContracts; use ImageKit\Core\Exceptions\APIException; -use ImageKit\ExtensionItem\AIAutoDescription; -use ImageKit\ExtensionItem\AutoTaggingExtension; -use ImageKit\ExtensionItem\RemoveBg; use ImageKit\Files\File; +use ImageKit\Files\FileCopyParams; use ImageKit\Files\FileCopyResponse; +use ImageKit\Files\FileMoveParams; use ImageKit\Files\FileMoveResponse; +use ImageKit\Files\FileRenameParams; use ImageKit\Files\FileRenameResponse; -use ImageKit\Files\FileUpdateParams\Publish; use ImageKit\Files\FileUpdateResponse; -use ImageKit\Files\FileUploadParams\ResponseField; -use ImageKit\Files\FileUploadParams\Transformation; +use ImageKit\Files\FileUploadParams; use ImageKit\Files\FileUploadResponse; use ImageKit\RequestOptions; -use const ImageKit\Core\OMIT as omit; - interface FilesContract { /** * @api * - * @param string|null $customCoordinates Define an important area in the image in the format `x,y,width,height` e.g. `10,10,100,100`. Send `null` to unset this value. - * @param array $customMetadata A key-value data to be associated with the asset. To unset a key, send `null` value for that key. Before setting any custom metadata on an asset you have to create the field using custom metadata fields API. - * @param string $description optional text to describe the contents of the file - * @param list $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. - * @param string|list $removeAITags An array of AITags associated with the file that you want to remove, e.g. `["car", "vehicle", "motorsports"]`. - * - * If you want to remove all AITags associated with the file, send a string - "all". - * - * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. - * @param list|null $tags An array of tags associated with the file, such as `["tag1", "tag2"]`. Send `null` to unset all tags associated with the file. - * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. - * @param Publish $publish configure the publication status of a file and its versions - * * @throws APIException */ public function update( string $fileID, - $customCoordinates = omit, - $customMetadata = omit, - $description = omit, - $extensions = omit, - $removeAITags = omit, - $tags = omit, - $webhookURL = omit, - $publish = omit, - ?RequestOptions $requestOptions = null, - ): FileUpdateResponse; - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function updateRaw( - string $fileID, - array $params, + mixed $params, ?RequestOptions $requestOptions = null ): FileUpdateResponse; @@ -81,28 +43,12 @@ public function delete( /** * @api * - * @param string $destinationPath full path to the folder you want to copy the above file into - * @param string $sourceFilePath the full path of the file you want to copy - * @param bool $includeFileVersions Option to copy all versions of a file. By default, only the current version of the file is copied. When set to true, all versions of the file will be copied. Default value - `false`. + * @param array|FileCopyParams $params * * @throws APIException */ public function copy( - $destinationPath, - $sourceFilePath, - $includeFileVersions = omit, - ?RequestOptions $requestOptions = null, - ): FileCopyResponse; - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function copyRaw( - array $params, + array|FileCopyParams $params, ?RequestOptions $requestOptions = null ): FileCopyResponse; @@ -119,180 +65,36 @@ public function get( /** * @api * - * @param string $destinationPath full path to the folder you want to move the above file into - * @param string $sourceFilePath the full path of the file you want to move + * @param array|FileMoveParams $params * * @throws APIException */ public function move( - $destinationPath, - $sourceFilePath, - ?RequestOptions $requestOptions = null, - ): FileMoveResponse; - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function moveRaw( - array $params, + array|FileMoveParams $params, ?RequestOptions $requestOptions = null ): FileMoveResponse; /** * @api * - * @param string $filePath the full path of the file you want to rename - * @param string $newFileName The new name of the file. A filename can contain: - * - * Alphanumeric Characters: `a-z`, `A-Z`, `0-9` (including Unicode letters, marks, and numerals in other languages). - * Special Characters: `.`, `_`, and `-`. - * - * Any other character, including space, will be replaced by `_`. - * @param bool $purgeCache Option to purge cache for the old file and its versions' URLs. - * - * When set to true, it will internally issue a purge cache request on CDN to remove cached content of old file and its versions. This purge request is counted against your monthly purge quota. - * - * Note: If the old file were accessible at `https://ik.imagekit.io/demo/old-filename.jpg`, a purge cache request would be issued against `https://ik.imagekit.io/demo/old-filename.jpg*` (with a wildcard at the end). It will remove the file and its versions' URLs and any transformations made using query parameters on this file or its versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. + * @param array|FileRenameParams $params * * @throws APIException */ public function rename( - $filePath, - $newFileName, - $purgeCache = omit, - ?RequestOptions $requestOptions = null, - ): FileRenameResponse; - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function renameRaw( - array $params, + array|FileRenameParams $params, ?RequestOptions $requestOptions = null ): FileRenameResponse; /** * @api * - * @param string $file The API accepts any of the following: - * - * - **Binary data** – send the raw bytes as `multipart/form-data`. - * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. - * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. - * - * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. - * @param string $fileName The name with which the file has to be uploaded. - * The file name can contain: - * - * - Alphanumeric Characters: `a-z`, `A-Z`, `0-9`. - * - Special Characters: `.`, `-` - * - * Any other character including space will be replaced by `_` - * @param string $token A unique value that the ImageKit.io server will use to recognize and prevent subsequent retries for the same request. We suggest using V4 UUIDs, or another random string with enough entropy to avoid collisions. This field is only required for authentication when uploading a file from the client side. - * - * **Note**: Sending a value that has been used in the past will result in a validation error. Even if your previous request resulted in an error, you should always send a new value for this field. - * @param string $checks Server-side checks to run on the asset. - * Read more about [Upload API checks](/docs/api-reference/upload-file/upload-file#upload-api-checks). - * @param string $customCoordinates Define an important area in the image. This is only relevant for image type files. - * - * - To be passed as a string with the x and y coordinates of the top-left corner, and width and height of the area of interest in the format `x,y,width,height`. For example - `10,10,100,100` - * - Can be used with fo-customtransformation. - * - If this field is not specified and the file is overwritten, then customCoordinates will be removed. - * @param array $customMetadata JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. - * @param string $description optional text to describe the contents of the file - * @param int $expire The time until your signature is valid. It must be a [Unix time](https://en.wikipedia.org/wiki/Unix_time) in less than 1 hour into the future. It should be in seconds. This field is only required for authentication when uploading a file from the client side. - * @param list $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. - * @param string $folder The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. - * - * The folder name can contain: - * - * - Alphanumeric Characters: `a-z` , `A-Z` , `0-9` - * - Special Characters: `/` , `_` , `-` - * - * Using multiple `/` creates a nested folder. - * @param bool $isPrivateFile Whether to mark the file as private or not. - * - * If `true`, the file is marked as private and is accessible only using named transformation or signed URL. - * @param bool $isPublished Whether to upload file as published or not. - * - * If `false`, the file is marked as unpublished, which restricts access to the file only via the media library. Files in draft or unpublished state can only be publicly accessed after being published. - * - * The option to upload in draft state is only available in custom enterprise pricing plans. - * @param bool $overwriteAITags If set to `true` and a file already exists at the exact location, its AITags will be removed. Set `overwriteAITags` to `false` to preserve AITags. - * @param bool $overwriteCustomMetadata if the request does not have `customMetadata`, and a file already exists at the exact location, existing customMetadata will be removed - * @param bool $overwriteFile if `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately - * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed - * @param string $publicKey Your ImageKit.io public key. This field is only required for authentication when uploading a file from the client side. - * @param list> $responseFields array of response field keys to include in the API response body - * @param string $signature HMAC-SHA1 digest of the token+expire using your ImageKit.io private API key as a key. Learn how to create a signature on the page below. This should be in lowercase. - * - * Signature must be calculated on the server-side. This field is only required for authentication when uploading a file from the client side. - * @param list $tags Set the tags while uploading the file. - * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. - * If this field is not specified and the file is overwritten, the existing tags will be removed. - * @param Transformation $transformation Configure pre-processing (`pre`) and post-processing (`post`) transformations. - * - * - `pre` — applied before the file is uploaded to the Media Library. - * Useful for reducing file size or applying basic optimizations upfront (e.g., resize, compress). - * - * - `post` — applied immediately after upload. - * Ideal for generating transformed versions (like video encodes or thumbnails) in advance, so they're ready for delivery without delay. - * - * You can mix and match any combination of post-processing types. - * @param bool $useUniqueFileName Whether to use a unique filename for this file or not. - * - * If `true`, ImageKit.io will add a unique suffix to the filename parameter to get a unique filename. - * - * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. - * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + * @param array|FileUploadParams $params * * @throws APIException */ public function upload( - $file, - $fileName, - $token = omit, - $checks = omit, - $customCoordinates = omit, - $customMetadata = omit, - $description = omit, - $expire = omit, - $extensions = omit, - $folder = omit, - $isPrivateFile = omit, - $isPublished = omit, - $overwriteAITags = omit, - $overwriteCustomMetadata = omit, - $overwriteFile = omit, - $overwriteTags = omit, - $publicKey = omit, - $responseFields = omit, - $signature = omit, - $tags = omit, - $transformation = omit, - $useUniqueFileName = omit, - $webhookURL = omit, - ?RequestOptions $requestOptions = null, - ): FileUploadResponse; - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function uploadRaw( - array $params, + array|FileUploadParams $params, ?RequestOptions $requestOptions = null ): FileUploadResponse; } diff --git a/src/ServiceContracts/FoldersContract.php b/src/ServiceContracts/FoldersContract.php index b245f822..7499ac24 100644 --- a/src/ServiceContracts/FoldersContract.php +++ b/src/ServiceContracts/FoldersContract.php @@ -5,158 +5,77 @@ namespace ImageKit\ServiceContracts; use ImageKit\Core\Exceptions\APIException; +use ImageKit\Folders\FolderCopyParams; use ImageKit\Folders\FolderCopyResponse; +use ImageKit\Folders\FolderCreateParams; +use ImageKit\Folders\FolderDeleteParams; use ImageKit\Folders\FolderDeleteResponse; +use ImageKit\Folders\FolderMoveParams; use ImageKit\Folders\FolderMoveResponse; use ImageKit\Folders\FolderNewResponse; +use ImageKit\Folders\FolderRenameParams; use ImageKit\Folders\FolderRenameResponse; use ImageKit\RequestOptions; -use const ImageKit\Core\OMIT as omit; - interface FoldersContract { /** * @api * - * @param string $folderName The folder will be created with this name. - * - * All characters except alphabets and numbers (inclusive of unicode letters, marks, and numerals in other languages) will be replaced by an underscore i.e. `_`. - * @param string $parentFolderPath The folder where the new folder should be created, for root use `/` else the path e.g. `containing/folder/`. - * - * Note: If any folder(s) is not present in the parentFolderPath parameter, it will be automatically created. For example, if you pass `/product/images/summer`, then `product`, `images`, and `summer` folders will be created if they don't already exist. + * @param array|FolderCreateParams $params * * @throws APIException */ public function create( - $folderName, - $parentFolderPath, + array|FolderCreateParams $params, ?RequestOptions $requestOptions = null ): FolderNewResponse; /** * @api * - * @param array $params - * - * @throws APIException - */ - public function createRaw( - array $params, - ?RequestOptions $requestOptions = null - ): FolderNewResponse; - - /** - * @api - * - * @param string $folderPath Full path to the folder you want to delete. For example `/folder/to/delete/`. + * @param array|FolderDeleteParams $params * * @throws APIException */ public function delete( - $folderPath, + array|FolderDeleteParams $params, ?RequestOptions $requestOptions = null ): FolderDeleteResponse; /** * @api * - * @param array $params - * - * @throws APIException - */ - public function deleteRaw( - array $params, - ?RequestOptions $requestOptions = null - ): FolderDeleteResponse; - - /** - * @api - * - * @param string $destinationPath full path to the destination folder where you want to copy the source folder into - * @param string $sourceFolderPath the full path to the source folder you want to copy - * @param bool $includeVersions Option to copy all versions of files that are nested inside the selected folder. By default, only the current version of each file will be copied. When set to true, all versions of each file will be copied. Default value - `false`. + * @param array|FolderCopyParams $params * * @throws APIException */ public function copy( - $destinationPath, - $sourceFolderPath, - $includeVersions = omit, - ?RequestOptions $requestOptions = null, - ): FolderCopyResponse; - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function copyRaw( - array $params, + array|FolderCopyParams $params, ?RequestOptions $requestOptions = null ): FolderCopyResponse; /** * @api * - * @param string $destinationPath full path to the destination folder where you want to move the source folder into - * @param string $sourceFolderPath the full path to the source folder you want to move + * @param array|FolderMoveParams $params * * @throws APIException */ public function move( - $destinationPath, - $sourceFolderPath, - ?RequestOptions $requestOptions = null, - ): FolderMoveResponse; - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function moveRaw( - array $params, + array|FolderMoveParams $params, ?RequestOptions $requestOptions = null ): FolderMoveResponse; /** * @api * - * @param string $folderPath the full path to the folder you want to rename - * @param string $newFolderName The new name for the folder. - * - * All characters except alphabets and numbers (inclusive of unicode letters, marks, and numerals in other languages) and `-` will be replaced by an underscore i.e. `_`. - * @param bool $purgeCache Option to purge cache for the old nested files and their versions' URLs. - * - * When set to true, it will internally issue a purge cache request on CDN to remove the cached content of the old nested files and their versions. There will only be one purge request for all the nested files, which will be counted against your monthly purge quota. - * - * Note: A purge cache request will be issued against `https://ik.imagekit.io/old/folder/path*` (with a wildcard at the end). This will remove all nested files, their versions' URLs, and any transformations made using query parameters on these files or their versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. - * - * Default value - `false` + * @param array|FolderRenameParams $params * * @throws APIException */ public function rename( - $folderPath, - $newFolderName, - $purgeCache = omit, - ?RequestOptions $requestOptions = null, - ): FolderRenameResponse; - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function renameRaw( - array $params, + array|FolderRenameParams $params, ?RequestOptions $requestOptions = null ): FolderRenameResponse; } diff --git a/src/Services/Accounts/OriginsService.php b/src/Services/Accounts/OriginsService.php index 5c58ff3f..c5e836df 100644 --- a/src/Services/Accounts/OriginsService.php +++ b/src/Services/Accounts/OriginsService.php @@ -21,8 +21,6 @@ use ImageKit\RequestOptions; use ImageKit\ServiceContracts\Accounts\OriginsContract; -use const ImageKit\Core\OMIT as omit; - final class OriginsService implements OriginsContract { /** @@ -36,95 +34,15 @@ public function __construct(private Client $client) {} * **Note:** This API is currently in beta. * Creates a new origin and returns the origin object. * - * @param string $accessKey access key for the bucket - * @param string $bucket - * @param string $name display name of the origin - * @param string $secretKey secret key for the bucket - * @param string $type - * @param string $endpoint custom S3-compatible endpoint - * @param string $baseURL akeneo instance base URL - * @param string $clientEmail - * @param string $privateKey - * @param string $accountName - * @param string $container - * @param string $sasToken - * @param string $clientID akeneo API client ID - * @param string $clientSecret akeneo API client secret - * @param string $password akeneo API password - * @param string $username akeneo API username - * @param string $baseURLForCanonicalHeader URL used in the Canonical header (if enabled) - * @param bool $includeCanonicalHeader whether to send a Canonical header - * @param string $prefix - * @param bool $s3ForcePathStyle Use path-style S3 URLs? - * @param bool $forwardHostHeaderToOrigin Forward the Host header to origin? - * * @throws APIException */ public function create( - $accessKey, - $bucket, - $name, - $secretKey, - $type, - $endpoint, - $baseURL, - $clientEmail, - $privateKey, - $accountName, - $container, - $sasToken, - $clientID, - $clientSecret, - $password, - $username, - $baseURLForCanonicalHeader = omit, - $includeCanonicalHeader = omit, - $prefix = omit, - $s3ForcePathStyle = omit, - $forwardHostHeaderToOrigin = omit, - ?RequestOptions $requestOptions = null, - ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { - $params = [ - 'accessKey' => $accessKey, - 'bucket' => $bucket, - 'name' => $name, - 'secretKey' => $secretKey, - 'type' => $type, - 'baseURLForCanonicalHeader' => $baseURLForCanonicalHeader, - 'includeCanonicalHeader' => $includeCanonicalHeader, - 'prefix' => $prefix, - 'endpoint' => $endpoint, - 's3ForcePathStyle' => $s3ForcePathStyle, - 'baseURL' => $baseURL, - 'forwardHostHeaderToOrigin' => $forwardHostHeaderToOrigin, - 'clientEmail' => $clientEmail, - 'privateKey' => $privateKey, - 'accountName' => $accountName, - 'container' => $container, - 'sasToken' => $sasToken, - 'clientID' => $clientID, - 'clientSecret' => $clientSecret, - 'password' => $password, - 'username' => $username, - ]; - - return $this->createRaw($params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function createRaw( - array $params, + mixed $params, ?RequestOptions $requestOptions = null ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { [$parsed, $options] = OriginCreateParams::parseRequest( $params, - $requestOptions + $requestOptions, ); // @phpstan-ignore-next-line; @@ -143,97 +61,16 @@ public function createRaw( * **Note:** This API is currently in beta. * Updates the origin identified by `id` and returns the updated origin object. * - * @param string $accessKey access key for the bucket - * @param string $bucket - * @param string $name display name of the origin - * @param string $secretKey secret key for the bucket - * @param string $type - * @param string $endpoint custom S3-compatible endpoint - * @param string $baseURL akeneo instance base URL - * @param string $clientEmail - * @param string $privateKey - * @param string $accountName - * @param string $container - * @param string $sasToken - * @param string $clientID akeneo API client ID - * @param string $clientSecret akeneo API client secret - * @param string $password akeneo API password - * @param string $username akeneo API username - * @param string $baseURLForCanonicalHeader URL used in the Canonical header (if enabled) - * @param bool $includeCanonicalHeader whether to send a Canonical header - * @param string $prefix - * @param bool $s3ForcePathStyle Use path-style S3 URLs? - * @param bool $forwardHostHeaderToOrigin Forward the Host header to origin? - * * @throws APIException */ public function update( string $id, - $accessKey, - $bucket, - $name, - $secretKey, - $type, - $endpoint, - $baseURL, - $clientEmail, - $privateKey, - $accountName, - $container, - $sasToken, - $clientID, - $clientSecret, - $password, - $username, - $baseURLForCanonicalHeader = omit, - $includeCanonicalHeader = omit, - $prefix = omit, - $s3ForcePathStyle = omit, - $forwardHostHeaderToOrigin = omit, - ?RequestOptions $requestOptions = null, - ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { - $params = [ - 'accessKey' => $accessKey, - 'bucket' => $bucket, - 'name' => $name, - 'secretKey' => $secretKey, - 'type' => $type, - 'baseURLForCanonicalHeader' => $baseURLForCanonicalHeader, - 'includeCanonicalHeader' => $includeCanonicalHeader, - 'prefix' => $prefix, - 'endpoint' => $endpoint, - 's3ForcePathStyle' => $s3ForcePathStyle, - 'baseURL' => $baseURL, - 'forwardHostHeaderToOrigin' => $forwardHostHeaderToOrigin, - 'clientEmail' => $clientEmail, - 'privateKey' => $privateKey, - 'accountName' => $accountName, - 'container' => $container, - 'sasToken' => $sasToken, - 'clientID' => $clientID, - 'clientSecret' => $clientSecret, - 'password' => $password, - 'username' => $username, - ]; - - return $this->updateRaw($id, $params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function updateRaw( - string $id, - array $params, + mixed $params, ?RequestOptions $requestOptions = null ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { [$parsed, $options] = OriginUpdateParams::parseRequest( $params, - $requestOptions + $requestOptions, ); // @phpstan-ignore-next-line; diff --git a/src/Services/Accounts/URLEndpointsService.php b/src/Services/Accounts/URLEndpointsService.php index 1de751c6..2d3a5349 100644 --- a/src/Services/Accounts/URLEndpointsService.php +++ b/src/Services/Accounts/URLEndpointsService.php @@ -5,9 +5,6 @@ namespace ImageKit\Services\Accounts; use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams; -use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Akamai; -use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Cloudinary; -use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Imgix; use ImageKit\Accounts\URLEndpoints\URLEndpointResponse; use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams; use ImageKit\Client; @@ -16,8 +13,6 @@ use ImageKit\RequestOptions; use ImageKit\ServiceContracts\Accounts\URLEndpointsContract; -use const ImageKit\Core\OMIT as omit; - final class URLEndpointsService implements URLEndpointsContract { /** @@ -31,44 +26,22 @@ public function __construct(private Client $client) {} * **Note:** This API is currently in beta. * Creates a new URL‑endpoint and returns the resulting object. * - * @param string $description description of the URL endpoint - * @param list $origins Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. - * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) - * @param Cloudinary|Imgix|Akamai $urlRewriter configuration for third-party URL rewriting + * @param array{ + * description: string, + * origins?: list, + * urlPrefix?: string, + * urlRewriter?: array, + * }|URLEndpointCreateParams $params * * @throws APIException */ public function create( - $description, - $origins = omit, - $urlPrefix = omit, - $urlRewriter = omit, + array|URLEndpointCreateParams $params, ?RequestOptions $requestOptions = null, - ): URLEndpointResponse { - $params = [ - 'description' => $description, - 'origins' => $origins, - 'urlPrefix' => $urlPrefix, - 'urlRewriter' => $urlRewriter, - ]; - - return $this->createRaw($params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function createRaw( - array $params, - ?RequestOptions $requestOptions = null ): URLEndpointResponse { [$parsed, $options] = URLEndpointCreateParams::parseRequest( $params, - $requestOptions + $requestOptions, ); // @phpstan-ignore-next-line; @@ -87,46 +60,23 @@ public function createRaw( * **Note:** This API is currently in beta. * Updates the URL‑endpoint identified by `id` and returns the updated object. * - * @param string $description description of the URL endpoint - * @param list $origins Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. - * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) - * @param URLEndpointUpdateParams\URLRewriter\Cloudinary|URLEndpointUpdateParams\URLRewriter\Imgix|URLEndpointUpdateParams\URLRewriter\Akamai $urlRewriter configuration for third-party URL rewriting + * @param array{ + * description: string, + * origins?: list, + * urlPrefix?: string, + * urlRewriter?: array, + * }|URLEndpointUpdateParams $params * * @throws APIException */ public function update( string $id, - $description, - $origins = omit, - $urlPrefix = omit, - $urlRewriter = omit, + array|URLEndpointUpdateParams $params, ?RequestOptions $requestOptions = null, - ): URLEndpointResponse { - $params = [ - 'description' => $description, - 'origins' => $origins, - 'urlPrefix' => $urlPrefix, - 'urlRewriter' => $urlRewriter, - ]; - - return $this->updateRaw($id, $params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function updateRaw( - string $id, - array $params, - ?RequestOptions $requestOptions = null ): URLEndpointResponse { [$parsed, $options] = URLEndpointUpdateParams::parseRequest( $params, - $requestOptions + $requestOptions, ); // @phpstan-ignore-next-line; diff --git a/src/Services/Accounts/UsageService.php b/src/Services/Accounts/UsageService.php index 370c5fe6..fadeb0bb 100644 --- a/src/Services/Accounts/UsageService.php +++ b/src/Services/Accounts/UsageService.php @@ -23,35 +23,19 @@ public function __construct(private Client $client) {} * * Get the account usage information between two dates. Note that the API response includes data from the start date while excluding data from the end date. In other words, the data covers the period starting from the specified start date up to, but not including, the end date. * - * @param \DateTimeInterface $endDate Specify a `endDate` in `YYYY-MM-DD` format. It should be after the `startDate`. The difference between `startDate` and `endDate` should be less than 90 days. - * @param \DateTimeInterface $startDate Specify a `startDate` in `YYYY-MM-DD` format. It should be before the `endDate`. The difference between `startDate` and `endDate` should be less than 90 days. + * @param array{ + * endDate: string|\DateTimeInterface, startDate: string|\DateTimeInterface + * }|UsageGetParams $params * * @throws APIException */ public function get( - $endDate, - $startDate, - ?RequestOptions $requestOptions = null - ): UsageGetResponse { - $params = ['endDate' => $endDate, 'startDate' => $startDate]; - - return $this->getRaw($params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function getRaw( - array $params, + array|UsageGetParams $params, ?RequestOptions $requestOptions = null ): UsageGetResponse { [$parsed, $options] = UsageGetParams::parseRequest( $params, - $requestOptions + $requestOptions, ); // @phpstan-ignore-next-line; diff --git a/src/Services/AccountsService.php b/src/Services/AccountsService.php index 7c650ecd..28953278 100644 --- a/src/Services/AccountsService.php +++ b/src/Services/AccountsService.php @@ -13,17 +13,17 @@ final class AccountsService implements AccountsContract { /** - * @@api + * @api */ public UsageService $usage; /** - * @@api + * @api */ public OriginsService $origins; /** - * @@api + * @api */ public URLEndpointsService $urlEndpoints; diff --git a/src/Services/AssetsService.php b/src/Services/AssetsService.php index a164b1ae..22e91eef 100644 --- a/src/Services/AssetsService.php +++ b/src/Services/AssetsService.php @@ -5,9 +5,7 @@ namespace ImageKit\Services; use ImageKit\Assets\AssetListParams; -use ImageKit\Assets\AssetListParams\FileType; use ImageKit\Assets\AssetListParams\Sort; -use ImageKit\Assets\AssetListParams\Type; use ImageKit\Assets\AssetListResponseItem; use ImageKit\Client; use ImageKit\Core\Conversion\ListOf; @@ -17,8 +15,6 @@ use ImageKit\RequestOptions; use ImageKit\ServiceContracts\AssetsContract; -use const ImageKit\Core\OMIT as omit; - final class AssetsService implements AssetsContract { /** @@ -31,77 +27,27 @@ public function __construct(private Client $client) {} * * This API can list all the uploaded files and folders in your ImageKit.io media library. In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and provide this generated string as the value of the `searchQuery`. * - * @param FileType|value-of $fileType Filter results by file type. - * - * - `all` — include all file types - * - `image` — include only image files - * - `non-image` — include only non-image files (e.g., JS, CSS, video) - * @param int $limit the maximum number of results to return in response - * @param string $path Folder path if you want to limit the search within a specific folder. For example, `/sales-banner/` will only search in folder sales-banner. - * - * Note : If your use case involves searching within a folder as well as its subfolders, you can use `path` parameter in `searchQuery` with appropriate operator. - * Checkout [Supported parameters](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#supported-parameters) for more information. - * @param string $searchQuery Query string in a Lucene-like query language e.g. `createdAt > "7d"`. - * - * Note : When the searchQuery parameter is present, the following query parameters will have no effect on the result: - * - * 1. `tags` - * 2. `type` - * 3. `name` - * - * [Learn more](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#advanced-search-queries) from examples. - * @param int $skip the number of results to skip before returning results - * @param Sort|value-of $sort sort the results by one of the supported fields in ascending or descending order - * @param Type|value-of $type Filter results by asset type. - * - * - `file` — returns only files - * - `file-version` — returns specific file versions - * - `folder` — returns only folders - * - `all` — returns both files and folders (excludes `file-version`) + * @param array{ + * fileType?: "all"|"image"|"non-image", + * limit?: int, + * path?: string, + * searchQuery?: string, + * skip?: int, + * sort?: value-of, + * type?: "file"|"file-version"|"folder"|"all", + * }|AssetListParams $params * * @return list * * @throws APIException */ public function list( - $fileType = omit, - $limit = omit, - $path = omit, - $searchQuery = omit, - $skip = omit, - $sort = omit, - $type = omit, - ?RequestOptions $requestOptions = null, - ): array { - $params = [ - 'fileType' => $fileType, - 'limit' => $limit, - 'path' => $path, - 'searchQuery' => $searchQuery, - 'skip' => $skip, - 'sort' => $sort, - 'type' => $type, - ]; - - return $this->listRaw($params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @return list - * - * @throws APIException - */ - public function listRaw( - array $params, + array|AssetListParams $params, ?RequestOptions $requestOptions = null ): array { [$parsed, $options] = AssetListParams::parseRequest( $params, - $requestOptions + $requestOptions, ); // @phpstan-ignore-next-line; diff --git a/src/Services/Beta/V2/FilesService.php b/src/Services/Beta/V2/FilesService.php index 72f7d7cf..444e93bd 100644 --- a/src/Services/Beta/V2/FilesService.php +++ b/src/Services/Beta/V2/FilesService.php @@ -5,19 +5,12 @@ namespace ImageKit\Services\Beta\V2; use ImageKit\Beta\V2\Files\FileUploadParams; -use ImageKit\Beta\V2\Files\FileUploadParams\ResponseField; -use ImageKit\Beta\V2\Files\FileUploadParams\Transformation; use ImageKit\Beta\V2\Files\FileUploadResponse; use ImageKit\Client; use ImageKit\Core\Exceptions\APIException; -use ImageKit\ExtensionItem\AIAutoDescription; -use ImageKit\ExtensionItem\AutoTaggingExtension; -use ImageKit\ExtensionItem\RemoveBg; use ImageKit\RequestOptions; use ImageKit\ServiceContracts\Beta\V2\FilesContract; -use const ImageKit\Core\OMIT as omit; - final class FilesService implements FilesContract { /** @@ -43,124 +36,38 @@ public function __construct(private Client $client) {} * - A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more. * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. * - * @param string $file The API accepts any of the following: - * - * - **Binary data** – send the raw bytes as `multipart/form-data`. - * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. - * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. - * - * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. - * @param string $fileName the name with which the file has to be uploaded - * @param string $token This is the client-generated JSON Web Token (JWT). The ImageKit.io server uses it to authenticate and check that the upload request parameters have not been tampered with after the token has been generated. Learn how to create the token on the page below. This field is only required for authentication when uploading a file from the client side. - * @param string $checks Server-side checks to run on the asset. - * Read more about [Upload API checks](/docs/api-reference/upload-file/upload-file-v2#upload-api-checks). - * @param string $customCoordinates Define an important area in the image. This is only relevant for image type files. - * - * - To be passed as a string with the x and y coordinates of the top-left corner, and width and height of the area of interest in the format `x,y,width,height`. For example - `10,10,100,100` - * - Can be used with fo-customtransformation. - * - If this field is not specified and the file is overwritten, then customCoordinates will be removed. - * @param array $customMetadata JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. - * @param string $description optional text to describe the contents of the file - * @param list $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. - * @param string $folder The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. Using multiple `/` creates a nested folder. - * @param bool $isPrivateFile Whether to mark the file as private or not. - * - * If `true`, the file is marked as private and is accessible only using named transformation or signed URL. - * @param bool $isPublished Whether to upload file as published or not. - * - * If `false`, the file is marked as unpublished, which restricts access to the file only via the media library. Files in draft or unpublished state can only be publicly accessed after being published. - * - * The option to upload in draft state is only available in custom enterprise pricing plans. - * @param bool $overwriteAITags If set to `true` and a file already exists at the exact location, its AITags will be removed. Set `overwriteAITags` to `false` to preserve AITags. - * @param bool $overwriteCustomMetadata if the request does not have `customMetadata`, and a file already exists at the exact location, existing customMetadata will be removed - * @param bool $overwriteFile if `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately - * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed - * @param list> $responseFields array of response field keys to include in the API response body - * @param list $tags Set the tags while uploading the file. - * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. - * If this field is not specified and the file is overwritten, the existing tags will be removed. - * @param Transformation $transformation Configure pre-processing (`pre`) and post-processing (`post`) transformations. - * - * - `pre` — applied before the file is uploaded to the Media Library. - * Useful for reducing file size or applying basic optimizations upfront (e.g., resize, compress). - * - * - `post` — applied immediately after upload. - * Ideal for generating transformed versions (like video encodes or thumbnails) in advance, so they're ready for delivery without delay. - * - * You can mix and match any combination of post-processing types. - * @param bool $useUniqueFileName Whether to use a unique filename for this file or not. - * - * If `true`, ImageKit.io will add a unique suffix to the filename parameter to get a unique filename. - * - * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. - * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + * @param array{ + * file: string, + * fileName: string, + * token?: string, + * checks?: string, + * customCoordinates?: string, + * customMetadata?: array, + * description?: string, + * extensions?: list>, + * folder?: string, + * isPrivateFile?: bool, + * isPublished?: bool, + * overwriteAITags?: bool, + * overwriteCustomMetadata?: bool, + * overwriteFile?: bool, + * overwriteTags?: bool, + * responseFields?: list<"tags"|"customCoordinates"|"isPrivateFile"|"embeddedMetadata"|"isPublished"|"customMetadata"|"metadata"|"selectedFieldsSchema">, + * tags?: list, + * transformation?: array{post?: list>, pre?: string}, + * useUniqueFileName?: bool, + * webhookUrl?: string, + * }|FileUploadParams $params * * @throws APIException */ public function upload( - $file, - $fileName, - $token = omit, - $checks = omit, - $customCoordinates = omit, - $customMetadata = omit, - $description = omit, - $extensions = omit, - $folder = omit, - $isPrivateFile = omit, - $isPublished = omit, - $overwriteAITags = omit, - $overwriteCustomMetadata = omit, - $overwriteFile = omit, - $overwriteTags = omit, - $responseFields = omit, - $tags = omit, - $transformation = omit, - $useUniqueFileName = omit, - $webhookURL = omit, - ?RequestOptions $requestOptions = null, - ): FileUploadResponse { - $params = [ - 'file' => $file, - 'fileName' => $fileName, - 'token' => $token, - 'checks' => $checks, - 'customCoordinates' => $customCoordinates, - 'customMetadata' => $customMetadata, - 'description' => $description, - 'extensions' => $extensions, - 'folder' => $folder, - 'isPrivateFile' => $isPrivateFile, - 'isPublished' => $isPublished, - 'overwriteAITags' => $overwriteAITags, - 'overwriteCustomMetadata' => $overwriteCustomMetadata, - 'overwriteFile' => $overwriteFile, - 'overwriteTags' => $overwriteTags, - 'responseFields' => $responseFields, - 'tags' => $tags, - 'transformation' => $transformation, - 'useUniqueFileName' => $useUniqueFileName, - 'webhookURL' => $webhookURL, - ]; - - return $this->uploadRaw($params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function uploadRaw( - array $params, + array|FileUploadParams $params, ?RequestOptions $requestOptions = null ): FileUploadResponse { [$parsed, $options] = FileUploadParams::parseRequest( $params, - $requestOptions + $requestOptions, ); $path = $this ->client diff --git a/src/Services/Beta/V2Service.php b/src/Services/Beta/V2Service.php index 0208080d..0e058a9b 100644 --- a/src/Services/Beta/V2Service.php +++ b/src/Services/Beta/V2Service.php @@ -11,7 +11,7 @@ final class V2Service implements V2Contract { /** - * @@api + * @api */ public FilesService $files; diff --git a/src/Services/BetaService.php b/src/Services/BetaService.php index b7d9ee63..e81a3f0e 100644 --- a/src/Services/BetaService.php +++ b/src/Services/BetaService.php @@ -11,7 +11,7 @@ final class BetaService implements BetaContract { /** - * @@api + * @api */ public V2Service $v2; diff --git a/src/Services/Cache/InvalidationService.php b/src/Services/Cache/InvalidationService.php index edd0a658..047ea21e 100644 --- a/src/Services/Cache/InvalidationService.php +++ b/src/Services/Cache/InvalidationService.php @@ -24,33 +24,17 @@ public function __construct(private Client $client) {} * * This API will purge CDN cache and ImageKit.io's internal cache for a file. Note: Purge cache is an asynchronous process and it may take some time to reflect the changes. * - * @param string $url the full URL of the file to be purged + * @param array{url: string}|InvalidationCreateParams $params * * @throws APIException */ public function create( - $url, - ?RequestOptions $requestOptions = null - ): InvalidationNewResponse { - $params = ['url' => $url]; - - return $this->createRaw($params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function createRaw( - array $params, - ?RequestOptions $requestOptions = null + array|InvalidationCreateParams $params, + ?RequestOptions $requestOptions = null, ): InvalidationNewResponse { [$parsed, $options] = InvalidationCreateParams::parseRequest( $params, - $requestOptions + $requestOptions, ); // @phpstan-ignore-next-line; diff --git a/src/Services/CacheService.php b/src/Services/CacheService.php index ec45da51..b9315cf6 100644 --- a/src/Services/CacheService.php +++ b/src/Services/CacheService.php @@ -11,7 +11,7 @@ final class CacheService implements CacheContract { /** - * @@api + * @api */ public InvalidationService $invalidation; diff --git a/src/Services/CustomMetadataFieldsService.php b/src/Services/CustomMetadataFieldsService.php index c3468e82..46348727 100644 --- a/src/Services/CustomMetadataFieldsService.php +++ b/src/Services/CustomMetadataFieldsService.php @@ -9,15 +9,12 @@ use ImageKit\Core\Exceptions\APIException; use ImageKit\CustomMetadataFields\CustomMetadataField; use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams; -use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; use ImageKit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; use ImageKit\CustomMetadataFields\CustomMetadataFieldListParams; use ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams; use ImageKit\RequestOptions; use ImageKit\ServiceContracts\CustomMetadataFieldsContract; -use const ImageKit\Core\OMIT as omit; - final class CustomMetadataFieldsService implements CustomMetadataFieldsContract { /** @@ -30,37 +27,30 @@ public function __construct(private Client $client) {} * * This API creates a new custom metadata field. Once a custom metadata field is created either through this API or using the dashboard UI, its value can be set on the assets. The value of a field for an asset can be set using the media library UI or programmatically through upload or update assets API. * - * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. - * @param string $name API name of the custom metadata field. This should be unique across all (including deleted) custom metadata fields. - * @param Schema $schema + * @param array{ + * label: string, + * name: string, + * schema: array{ + * type: "Text"|"Textarea"|"Number"|"Date"|"Boolean"|"SingleSelect"|"MultiSelect", + * defaultValue?: mixed, + * isValueRequired?: bool, + * maxLength?: float, + * maxValue?: string|float, + * minLength?: float, + * minValue?: string|float, + * selectOptions?: list, + * }, + * }|CustomMetadataFieldCreateParams $params * * @throws APIException */ public function create( - $label, - $name, - $schema, - ?RequestOptions $requestOptions = null - ): CustomMetadataField { - $params = ['label' => $label, 'name' => $name, 'schema' => $schema]; - - return $this->createRaw($params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function createRaw( - array $params, - ?RequestOptions $requestOptions = null + array|CustomMetadataFieldCreateParams $params, + ?RequestOptions $requestOptions = null, ): CustomMetadataField { [$parsed, $options] = CustomMetadataFieldCreateParams::parseRequest( $params, - $requestOptions + $requestOptions, ); // @phpstan-ignore-next-line; @@ -78,37 +68,29 @@ public function createRaw( * * This API updates the label or schema of an existing custom metadata field. * - * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. This parameter is required if `schema` is not provided. - * @param CustomMetadataFieldUpdateParams\Schema $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. + * @param array{ + * label?: string, + * schema?: array{ + * defaultValue?: mixed, + * isValueRequired?: bool, + * maxLength?: float, + * maxValue?: string|float, + * minLength?: float, + * minValue?: string|float, + * selectOptions?: list, + * }, + * }|CustomMetadataFieldUpdateParams $params * * @throws APIException */ public function update( string $id, - $label = omit, - $schema = omit, + array|CustomMetadataFieldUpdateParams $params, ?RequestOptions $requestOptions = null, - ): CustomMetadataField { - $params = ['label' => $label, 'schema' => $schema]; - - return $this->updateRaw($id, $params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function updateRaw( - string $id, - array $params, - ?RequestOptions $requestOptions = null ): CustomMetadataField { [$parsed, $options] = CustomMetadataFieldUpdateParams::parseRequest( $params, - $requestOptions + $requestOptions, ); // @phpstan-ignore-next-line; @@ -128,41 +110,21 @@ public function updateRaw( * * You can also filter results by a specific folder path to retrieve custom metadata fields applicable at that location. This path-specific filtering is useful when using the **Path policy** feature to determine which custom metadata fields are selected for a given path. * - * @param string $folderPath The folder path (e.g., `/path/to/folder`) for which to retrieve applicable custom metadata fields. Useful for determining path-specific field selections when the [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in use. - * @param bool $includeDeleted set it to `true` to include deleted field objects in the API response + * @param array{ + * folderPath?: string, includeDeleted?: bool + * }|CustomMetadataFieldListParams $params * * @return list * * @throws APIException */ public function list( - $folderPath = omit, - $includeDeleted = omit, + array|CustomMetadataFieldListParams $params, ?RequestOptions $requestOptions = null, - ): array { - $params = [ - 'folderPath' => $folderPath, 'includeDeleted' => $includeDeleted, - ]; - - return $this->listRaw($params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @return list - * - * @throws APIException - */ - public function listRaw( - array $params, - ?RequestOptions $requestOptions = null ): array { [$parsed, $options] = CustomMetadataFieldListParams::parseRequest( $params, - $requestOptions + $requestOptions, ); // @phpstan-ignore-next-line; diff --git a/src/Services/Files/BulkService.php b/src/Services/Files/BulkService.php index f51428a3..db8236ed 100644 --- a/src/Services/Files/BulkService.php +++ b/src/Services/Files/BulkService.php @@ -33,33 +33,17 @@ public function __construct(private Client $client) {} * * A maximum of 100 files can be deleted at a time. * - * @param list $fileIDs an array of fileIds which you want to delete + * @param array{fileIds: list}|BulkDeleteParams $params * * @throws APIException */ public function delete( - $fileIDs, - ?RequestOptions $requestOptions = null - ): BulkDeleteResponse { - $params = ['fileIDs' => $fileIDs]; - - return $this->deleteRaw($params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function deleteRaw( - array $params, + array|BulkDeleteParams $params, ?RequestOptions $requestOptions = null ): BulkDeleteResponse { [$parsed, $options] = BulkDeleteParams::parseRequest( $params, - $requestOptions + $requestOptions, ); // @phpstan-ignore-next-line; @@ -77,35 +61,19 @@ public function deleteRaw( * * This API adds tags to multiple files in bulk. A maximum of 50 files can be specified at a time. * - * @param list $fileIDs an array of fileIds to which you want to add tags - * @param list $tags an array of tags that you want to add to the files + * @param array{ + * fileIds: list, tags: list + * }|BulkAddTagsParams $params * * @throws APIException */ public function addTags( - $fileIDs, - $tags, - ?RequestOptions $requestOptions = null - ): BulkAddTagsResponse { - $params = ['fileIDs' => $fileIDs, 'tags' => $tags]; - - return $this->addTagsRaw($params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function addTagsRaw( - array $params, + array|BulkAddTagsParams $params, ?RequestOptions $requestOptions = null ): BulkAddTagsResponse { [$parsed, $options] = BulkAddTagsParams::parseRequest( $params, - $requestOptions + $requestOptions, ); // @phpstan-ignore-next-line; @@ -123,35 +91,19 @@ public function addTagsRaw( * * This API removes AITags from multiple files in bulk. A maximum of 50 files can be specified at a time. * - * @param list $aiTags an array of AITags that you want to remove from the files - * @param list $fileIDs an array of fileIds from which you want to remove AITags + * @param array{ + * AITags: list, fileIds: list + * }|BulkRemoveAITagsParams $params * * @throws APIException */ public function removeAITags( - $aiTags, - $fileIDs, - ?RequestOptions $requestOptions = null - ): BulkRemoveAITagsResponse { - $params = ['aiTags' => $aiTags, 'fileIDs' => $fileIDs]; - - return $this->removeAITagsRaw($params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function removeAITagsRaw( - array $params, + array|BulkRemoveAITagsParams $params, ?RequestOptions $requestOptions = null ): BulkRemoveAITagsResponse { [$parsed, $options] = BulkRemoveAITagsParams::parseRequest( $params, - $requestOptions + $requestOptions, ); // @phpstan-ignore-next-line; @@ -169,35 +121,19 @@ public function removeAITagsRaw( * * This API removes tags from multiple files in bulk. A maximum of 50 files can be specified at a time. * - * @param list $fileIDs an array of fileIds from which you want to remove tags - * @param list $tags an array of tags that you want to remove from the files + * @param array{ + * fileIds: list, tags: list + * }|BulkRemoveTagsParams $params * * @throws APIException */ public function removeTags( - $fileIDs, - $tags, - ?RequestOptions $requestOptions = null - ): BulkRemoveTagsResponse { - $params = ['fileIDs' => $fileIDs, 'tags' => $tags]; - - return $this->removeTagsRaw($params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function removeTagsRaw( - array $params, + array|BulkRemoveTagsParams $params, ?RequestOptions $requestOptions = null ): BulkRemoveTagsResponse { [$parsed, $options] = BulkRemoveTagsParams::parseRequest( $params, - $requestOptions + $requestOptions, ); // @phpstan-ignore-next-line; diff --git a/src/Services/Files/MetadataService.php b/src/Services/Files/MetadataService.php index 77814432..d7aabb64 100644 --- a/src/Services/Files/MetadataService.php +++ b/src/Services/Files/MetadataService.php @@ -45,33 +45,17 @@ public function get( * * Get image EXIF, pHash, and other metadata from ImageKit.io powered remote URL using this API. * - * @param string $url Should be a valid file URL. It should be accessible using your ImageKit.io account. + * @param array{url: string}|MetadataGetFromURLParams $params * * @throws APIException */ public function getFromURL( - $url, - ?RequestOptions $requestOptions = null - ): Metadata { - $params = ['url' => $url]; - - return $this->getFromURLRaw($params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function getFromURLRaw( - array $params, - ?RequestOptions $requestOptions = null + array|MetadataGetFromURLParams $params, + ?RequestOptions $requestOptions = null, ): Metadata { [$parsed, $options] = MetadataGetFromURLParams::parseRequest( $params, - $requestOptions + $requestOptions, ); // @phpstan-ignore-next-line; diff --git a/src/Services/Files/VersionsService.php b/src/Services/Files/VersionsService.php index 526203fa..dc213148 100644 --- a/src/Services/Files/VersionsService.php +++ b/src/Services/Files/VersionsService.php @@ -51,38 +51,21 @@ public function list( * * Note: If you want to delete all versions of a file, use the delete file API. * - * @param string $fileID + * @param array{fileId: string}|VersionDeleteParams $params * * @throws APIException */ public function delete( string $versionID, - $fileID, - ?RequestOptions $requestOptions = null - ): VersionDeleteResponse { - $params = ['fileID' => $fileID]; - - return $this->deleteRaw($versionID, $params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function deleteRaw( - string $versionID, - array $params, - ?RequestOptions $requestOptions = null + array|VersionDeleteParams $params, + ?RequestOptions $requestOptions = null, ): VersionDeleteResponse { [$parsed, $options] = VersionDeleteParams::parseRequest( $params, - $requestOptions + $requestOptions, ); - $fileID = $parsed['fileID']; - unset($parsed['fileID']); + $fileID = $parsed['fileId']; + unset($parsed['fileId']); // @phpstan-ignore-next-line; return $this->client->request( @@ -98,38 +81,21 @@ public function deleteRaw( * * This API returns an object with details or attributes of a file version. * - * @param string $fileID + * @param array{fileId: string}|VersionGetParams $params * * @throws APIException */ public function get( string $versionID, - $fileID, - ?RequestOptions $requestOptions = null - ): File { - $params = ['fileID' => $fileID]; - - return $this->getRaw($versionID, $params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function getRaw( - string $versionID, - array $params, - ?RequestOptions $requestOptions = null + array|VersionGetParams $params, + ?RequestOptions $requestOptions = null, ): File { [$parsed, $options] = VersionGetParams::parseRequest( $params, - $requestOptions + $requestOptions, ); - $fileID = $parsed['fileID']; - unset($parsed['fileID']); + $fileID = $parsed['fileId']; + unset($parsed['fileId']); // @phpstan-ignore-next-line; return $this->client->request( @@ -145,38 +111,21 @@ public function getRaw( * * This API restores a file version as the current file version. * - * @param string $fileID + * @param array{fileId: string}|VersionRestoreParams $params * * @throws APIException */ public function restore( string $versionID, - $fileID, - ?RequestOptions $requestOptions = null - ): File { - $params = ['fileID' => $fileID]; - - return $this->restoreRaw($versionID, $params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function restoreRaw( - string $versionID, - array $params, - ?RequestOptions $requestOptions = null + array|VersionRestoreParams $params, + ?RequestOptions $requestOptions = null, ): File { [$parsed, $options] = VersionRestoreParams::parseRequest( $params, - $requestOptions + $requestOptions, ); - $fileID = $parsed['fileID']; - unset($parsed['fileID']); + $fileID = $parsed['fileId']; + unset($parsed['fileId']); // @phpstan-ignore-next-line; return $this->client->request( diff --git a/src/Services/FilesService.php b/src/Services/FilesService.php index 9286e32d..25766cfa 100644 --- a/src/Services/FilesService.php +++ b/src/Services/FilesService.php @@ -6,9 +6,6 @@ use ImageKit\Client; use ImageKit\Core\Exceptions\APIException; -use ImageKit\ExtensionItem\AIAutoDescription; -use ImageKit\ExtensionItem\AutoTaggingExtension; -use ImageKit\ExtensionItem\RemoveBg; use ImageKit\Files\File; use ImageKit\Files\FileCopyParams; use ImageKit\Files\FileCopyResponse; @@ -17,11 +14,8 @@ use ImageKit\Files\FileRenameParams; use ImageKit\Files\FileRenameResponse; use ImageKit\Files\FileUpdateParams; -use ImageKit\Files\FileUpdateParams\Publish; use ImageKit\Files\FileUpdateResponse; use ImageKit\Files\FileUploadParams; -use ImageKit\Files\FileUploadParams\ResponseField; -use ImageKit\Files\FileUploadParams\Transformation; use ImageKit\Files\FileUploadResponse; use ImageKit\RequestOptions; use ImageKit\ServiceContracts\FilesContract; @@ -29,22 +23,20 @@ use ImageKit\Services\Files\MetadataService; use ImageKit\Services\Files\VersionsService; -use const ImageKit\Core\OMIT as omit; - final class FilesService implements FilesContract { /** - * @@api + * @api */ public BulkService $bulk; /** - * @@api + * @api */ public VersionsService $versions; /** - * @@api + * @api */ public MetadataService $metadata; @@ -63,63 +55,16 @@ public function __construct(private Client $client) * * This API updates the details or attributes of the current version of the file. You can update `tags`, `customCoordinates`, `customMetadata`, publication status, remove existing `AITags` and apply extensions using this API. * - * @param string|null $customCoordinates Define an important area in the image in the format `x,y,width,height` e.g. `10,10,100,100`. Send `null` to unset this value. - * @param array $customMetadata A key-value data to be associated with the asset. To unset a key, send `null` value for that key. Before setting any custom metadata on an asset you have to create the field using custom metadata fields API. - * @param string $description optional text to describe the contents of the file - * @param list $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. - * @param string|list $removeAITags An array of AITags associated with the file that you want to remove, e.g. `["car", "vehicle", "motorsports"]`. - * - * If you want to remove all AITags associated with the file, send a string - "all". - * - * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. - * @param list|null $tags An array of tags associated with the file, such as `["tag1", "tag2"]`. Send `null` to unset all tags associated with the file. - * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. - * @param Publish $publish configure the publication status of a file and its versions - * * @throws APIException */ public function update( string $fileID, - $customCoordinates = omit, - $customMetadata = omit, - $description = omit, - $extensions = omit, - $removeAITags = omit, - $tags = omit, - $webhookURL = omit, - $publish = omit, - ?RequestOptions $requestOptions = null, - ): FileUpdateResponse { - $params = [ - 'customCoordinates' => $customCoordinates, - 'customMetadata' => $customMetadata, - 'description' => $description, - 'extensions' => $extensions, - 'removeAITags' => $removeAITags, - 'tags' => $tags, - 'webhookURL' => $webhookURL, - 'publish' => $publish, - ]; - - return $this->updateRaw($fileID, $params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function updateRaw( - string $fileID, - array $params, + mixed $params, ?RequestOptions $requestOptions = null ): FileUpdateResponse { [$parsed, $options] = FileUpdateParams::parseRequest( $params, - $requestOptions + $requestOptions, ); // @phpstan-ignore-next-line; @@ -161,41 +106,19 @@ public function delete( * * Note: If any file at the destination has the same name as the source file, then the source file and its versions (if `includeFileVersions` is set to true) will be appended to the destination file version history. * - * @param string $destinationPath full path to the folder you want to copy the above file into - * @param string $sourceFilePath the full path of the file you want to copy - * @param bool $includeFileVersions Option to copy all versions of a file. By default, only the current version of the file is copied. When set to true, all versions of the file will be copied. Default value - `false`. + * @param array{ + * destinationPath: string, sourceFilePath: string, includeFileVersions?: bool + * }|FileCopyParams $params * * @throws APIException */ public function copy( - $destinationPath, - $sourceFilePath, - $includeFileVersions = omit, - ?RequestOptions $requestOptions = null, - ): FileCopyResponse { - $params = [ - 'destinationPath' => $destinationPath, - 'sourceFilePath' => $sourceFilePath, - 'includeFileVersions' => $includeFileVersions, - ]; - - return $this->copyRaw($params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function copyRaw( - array $params, + array|FileCopyParams $params, ?RequestOptions $requestOptions = null ): FileCopyResponse { [$parsed, $options] = FileCopyParams::parseRequest( $params, - $requestOptions + $requestOptions, ); // @phpstan-ignore-next-line; @@ -235,37 +158,19 @@ public function get( * * Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file. * - * @param string $destinationPath full path to the folder you want to move the above file into - * @param string $sourceFilePath the full path of the file you want to move + * @param array{ + * destinationPath: string, sourceFilePath: string + * }|FileMoveParams $params * * @throws APIException */ public function move( - $destinationPath, - $sourceFilePath, - ?RequestOptions $requestOptions = null - ): FileMoveResponse { - $params = [ - 'destinationPath' => $destinationPath, 'sourceFilePath' => $sourceFilePath, - ]; - - return $this->moveRaw($params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function moveRaw( - array $params, + array|FileMoveParams $params, ?RequestOptions $requestOptions = null ): FileMoveResponse { [$parsed, $options] = FileMoveParams::parseRequest( $params, - $requestOptions + $requestOptions, ); // @phpstan-ignore-next-line; @@ -285,50 +190,19 @@ public function moveRaw( * * Note: The old URLs will stop working. The file/file version URLs cached on CDN will continue to work unless a purge is requested. * - * @param string $filePath the full path of the file you want to rename - * @param string $newFileName The new name of the file. A filename can contain: - * - * Alphanumeric Characters: `a-z`, `A-Z`, `0-9` (including Unicode letters, marks, and numerals in other languages). - * Special Characters: `.`, `_`, and `-`. - * - * Any other character, including space, will be replaced by `_`. - * @param bool $purgeCache Option to purge cache for the old file and its versions' URLs. - * - * When set to true, it will internally issue a purge cache request on CDN to remove cached content of old file and its versions. This purge request is counted against your monthly purge quota. - * - * Note: If the old file were accessible at `https://ik.imagekit.io/demo/old-filename.jpg`, a purge cache request would be issued against `https://ik.imagekit.io/demo/old-filename.jpg*` (with a wildcard at the end). It will remove the file and its versions' URLs and any transformations made using query parameters on this file or its versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. + * @param array{ + * filePath: string, newFileName: string, purgeCache?: bool + * }|FileRenameParams $params * * @throws APIException */ public function rename( - $filePath, - $newFileName, - $purgeCache = omit, - ?RequestOptions $requestOptions = null, - ): FileRenameResponse { - $params = [ - 'filePath' => $filePath, - 'newFileName' => $newFileName, - 'purgeCache' => $purgeCache, - ]; - - return $this->renameRaw($params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function renameRaw( - array $params, + array|FileRenameParams $params, ?RequestOptions $requestOptions = null ): FileRenameResponse { [$parsed, $options] = FileRenameParams::parseRequest( $params, - $requestOptions + $requestOptions, ); // @phpstan-ignore-next-line; @@ -359,150 +233,41 @@ public function renameRaw( * - A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more. * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. * - * @param string $file The API accepts any of the following: - * - * - **Binary data** – send the raw bytes as `multipart/form-data`. - * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. - * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. - * - * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. - * @param string $fileName The name with which the file has to be uploaded. - * The file name can contain: - * - * - Alphanumeric Characters: `a-z`, `A-Z`, `0-9`. - * - Special Characters: `.`, `-` - * - * Any other character including space will be replaced by `_` - * @param string $token A unique value that the ImageKit.io server will use to recognize and prevent subsequent retries for the same request. We suggest using V4 UUIDs, or another random string with enough entropy to avoid collisions. This field is only required for authentication when uploading a file from the client side. - * - * **Note**: Sending a value that has been used in the past will result in a validation error. Even if your previous request resulted in an error, you should always send a new value for this field. - * @param string $checks Server-side checks to run on the asset. - * Read more about [Upload API checks](/docs/api-reference/upload-file/upload-file#upload-api-checks). - * @param string $customCoordinates Define an important area in the image. This is only relevant for image type files. - * - * - To be passed as a string with the x and y coordinates of the top-left corner, and width and height of the area of interest in the format `x,y,width,height`. For example - `10,10,100,100` - * - Can be used with fo-customtransformation. - * - If this field is not specified and the file is overwritten, then customCoordinates will be removed. - * @param array $customMetadata JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. - * @param string $description optional text to describe the contents of the file - * @param int $expire The time until your signature is valid. It must be a [Unix time](https://en.wikipedia.org/wiki/Unix_time) in less than 1 hour into the future. It should be in seconds. This field is only required for authentication when uploading a file from the client side. - * @param list $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. - * @param string $folder The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. - * - * The folder name can contain: - * - * - Alphanumeric Characters: `a-z` , `A-Z` , `0-9` - * - Special Characters: `/` , `_` , `-` - * - * Using multiple `/` creates a nested folder. - * @param bool $isPrivateFile Whether to mark the file as private or not. - * - * If `true`, the file is marked as private and is accessible only using named transformation or signed URL. - * @param bool $isPublished Whether to upload file as published or not. - * - * If `false`, the file is marked as unpublished, which restricts access to the file only via the media library. Files in draft or unpublished state can only be publicly accessed after being published. - * - * The option to upload in draft state is only available in custom enterprise pricing plans. - * @param bool $overwriteAITags If set to `true` and a file already exists at the exact location, its AITags will be removed. Set `overwriteAITags` to `false` to preserve AITags. - * @param bool $overwriteCustomMetadata if the request does not have `customMetadata`, and a file already exists at the exact location, existing customMetadata will be removed - * @param bool $overwriteFile if `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately - * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed - * @param string $publicKey Your ImageKit.io public key. This field is only required for authentication when uploading a file from the client side. - * @param list> $responseFields array of response field keys to include in the API response body - * @param string $signature HMAC-SHA1 digest of the token+expire using your ImageKit.io private API key as a key. Learn how to create a signature on the page below. This should be in lowercase. - * - * Signature must be calculated on the server-side. This field is only required for authentication when uploading a file from the client side. - * @param list $tags Set the tags while uploading the file. - * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. - * If this field is not specified and the file is overwritten, the existing tags will be removed. - * @param Transformation $transformation Configure pre-processing (`pre`) and post-processing (`post`) transformations. - * - * - `pre` — applied before the file is uploaded to the Media Library. - * Useful for reducing file size or applying basic optimizations upfront (e.g., resize, compress). - * - * - `post` — applied immediately after upload. - * Ideal for generating transformed versions (like video encodes or thumbnails) in advance, so they're ready for delivery without delay. - * - * You can mix and match any combination of post-processing types. - * @param bool $useUniqueFileName Whether to use a unique filename for this file or not. - * - * If `true`, ImageKit.io will add a unique suffix to the filename parameter to get a unique filename. - * - * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. - * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + * @param array{ + * file: string, + * fileName: string, + * token?: string, + * checks?: string, + * customCoordinates?: string, + * customMetadata?: array, + * description?: string, + * expire?: int, + * extensions?: list>, + * folder?: string, + * isPrivateFile?: bool, + * isPublished?: bool, + * overwriteAITags?: bool, + * overwriteCustomMetadata?: bool, + * overwriteFile?: bool, + * overwriteTags?: bool, + * publicKey?: string, + * responseFields?: list<"tags"|"customCoordinates"|"isPrivateFile"|"embeddedMetadata"|"isPublished"|"customMetadata"|"metadata"|"selectedFieldsSchema">, + * signature?: string, + * tags?: list, + * transformation?: array{post?: list>, pre?: string}, + * useUniqueFileName?: bool, + * webhookUrl?: string, + * }|FileUploadParams $params * * @throws APIException */ public function upload( - $file, - $fileName, - $token = omit, - $checks = omit, - $customCoordinates = omit, - $customMetadata = omit, - $description = omit, - $expire = omit, - $extensions = omit, - $folder = omit, - $isPrivateFile = omit, - $isPublished = omit, - $overwriteAITags = omit, - $overwriteCustomMetadata = omit, - $overwriteFile = omit, - $overwriteTags = omit, - $publicKey = omit, - $responseFields = omit, - $signature = omit, - $tags = omit, - $transformation = omit, - $useUniqueFileName = omit, - $webhookURL = omit, - ?RequestOptions $requestOptions = null, - ): FileUploadResponse { - $params = [ - 'file' => $file, - 'fileName' => $fileName, - 'token' => $token, - 'checks' => $checks, - 'customCoordinates' => $customCoordinates, - 'customMetadata' => $customMetadata, - 'description' => $description, - 'expire' => $expire, - 'extensions' => $extensions, - 'folder' => $folder, - 'isPrivateFile' => $isPrivateFile, - 'isPublished' => $isPublished, - 'overwriteAITags' => $overwriteAITags, - 'overwriteCustomMetadata' => $overwriteCustomMetadata, - 'overwriteFile' => $overwriteFile, - 'overwriteTags' => $overwriteTags, - 'publicKey' => $publicKey, - 'responseFields' => $responseFields, - 'signature' => $signature, - 'tags' => $tags, - 'transformation' => $transformation, - 'useUniqueFileName' => $useUniqueFileName, - 'webhookURL' => $webhookURL, - ]; - - return $this->uploadRaw($params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function uploadRaw( - array $params, + array|FileUploadParams $params, ?RequestOptions $requestOptions = null ): FileUploadResponse { [$parsed, $options] = FileUploadParams::parseRequest( $params, - $requestOptions + $requestOptions, ); $path = $this ->client diff --git a/src/Services/FoldersService.php b/src/Services/FoldersService.php index 66b99f37..4e8a9876 100644 --- a/src/Services/FoldersService.php +++ b/src/Services/FoldersService.php @@ -20,12 +20,10 @@ use ImageKit\ServiceContracts\FoldersContract; use ImageKit\Services\Folders\JobService; -use const ImageKit\Core\OMIT as omit; - final class FoldersService implements FoldersContract { /** - * @@api + * @api */ public JobService $job; @@ -42,41 +40,19 @@ public function __construct(private Client $client) * * This will create a new folder. You can specify the folder name and location of the parent folder where this new folder should be created. * - * @param string $folderName The folder will be created with this name. - * - * All characters except alphabets and numbers (inclusive of unicode letters, marks, and numerals in other languages) will be replaced by an underscore i.e. `_`. - * @param string $parentFolderPath The folder where the new folder should be created, for root use `/` else the path e.g. `containing/folder/`. - * - * Note: If any folder(s) is not present in the parentFolderPath parameter, it will be automatically created. For example, if you pass `/product/images/summer`, then `product`, `images`, and `summer` folders will be created if they don't already exist. + * @param array{ + * folderName: string, parentFolderPath: string + * }|FolderCreateParams $params * * @throws APIException */ public function create( - $folderName, - $parentFolderPath, - ?RequestOptions $requestOptions = null - ): FolderNewResponse { - $params = [ - 'folderName' => $folderName, 'parentFolderPath' => $parentFolderPath, - ]; - - return $this->createRaw($params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function createRaw( - array $params, + array|FolderCreateParams $params, ?RequestOptions $requestOptions = null ): FolderNewResponse { [$parsed, $options] = FolderCreateParams::parseRequest( $params, - $requestOptions + $requestOptions, ); // @phpstan-ignore-next-line; @@ -94,33 +70,17 @@ public function createRaw( * * This will delete a folder and all its contents permanently. The API returns an empty response. * - * @param string $folderPath Full path to the folder you want to delete. For example `/folder/to/delete/`. + * @param array{folderPath: string}|FolderDeleteParams $params * * @throws APIException */ public function delete( - $folderPath, - ?RequestOptions $requestOptions = null - ): FolderDeleteResponse { - $params = ['folderPath' => $folderPath]; - - return $this->deleteRaw($params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function deleteRaw( - array $params, + array|FolderDeleteParams $params, ?RequestOptions $requestOptions = null ): FolderDeleteResponse { [$parsed, $options] = FolderDeleteParams::parseRequest( $params, - $requestOptions + $requestOptions, ); // @phpstan-ignore-next-line; @@ -138,41 +98,19 @@ public function deleteRaw( * * This will copy one folder into another. The selected folder, its nested folders, files, and their versions (in `includeVersions` is set to true) are copied in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history. * - * @param string $destinationPath full path to the destination folder where you want to copy the source folder into - * @param string $sourceFolderPath the full path to the source folder you want to copy - * @param bool $includeVersions Option to copy all versions of files that are nested inside the selected folder. By default, only the current version of each file will be copied. When set to true, all versions of each file will be copied. Default value - `false`. + * @param array{ + * destinationPath: string, sourceFolderPath: string, includeVersions?: bool + * }|FolderCopyParams $params * * @throws APIException */ public function copy( - $destinationPath, - $sourceFolderPath, - $includeVersions = omit, - ?RequestOptions $requestOptions = null, - ): FolderCopyResponse { - $params = [ - 'destinationPath' => $destinationPath, - 'sourceFolderPath' => $sourceFolderPath, - 'includeVersions' => $includeVersions, - ]; - - return $this->copyRaw($params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function copyRaw( - array $params, + array|FolderCopyParams $params, ?RequestOptions $requestOptions = null ): FolderCopyResponse { [$parsed, $options] = FolderCopyParams::parseRequest( $params, - $requestOptions + $requestOptions, ); // @phpstan-ignore-next-line; @@ -190,38 +128,19 @@ public function copyRaw( * * This will move one folder into another. The selected folder, its nested folders, files, and their versions are moved in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history. * - * @param string $destinationPath full path to the destination folder where you want to move the source folder into - * @param string $sourceFolderPath the full path to the source folder you want to move + * @param array{ + * destinationPath: string, sourceFolderPath: string + * }|FolderMoveParams $params * * @throws APIException */ public function move( - $destinationPath, - $sourceFolderPath, - ?RequestOptions $requestOptions = null - ): FolderMoveResponse { - $params = [ - 'destinationPath' => $destinationPath, - 'sourceFolderPath' => $sourceFolderPath, - ]; - - return $this->moveRaw($params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function moveRaw( - array $params, + array|FolderMoveParams $params, ?RequestOptions $requestOptions = null ): FolderMoveResponse { [$parsed, $options] = FolderMoveParams::parseRequest( $params, - $requestOptions + $requestOptions, ); // @phpstan-ignore-next-line; @@ -239,49 +158,19 @@ public function moveRaw( * * This API allows you to rename an existing folder. The folder and all its nested assets and sub-folders will remain unchanged, but their paths will be updated to reflect the new folder name. * - * @param string $folderPath the full path to the folder you want to rename - * @param string $newFolderName The new name for the folder. - * - * All characters except alphabets and numbers (inclusive of unicode letters, marks, and numerals in other languages) and `-` will be replaced by an underscore i.e. `_`. - * @param bool $purgeCache Option to purge cache for the old nested files and their versions' URLs. - * - * When set to true, it will internally issue a purge cache request on CDN to remove the cached content of the old nested files and their versions. There will only be one purge request for all the nested files, which will be counted against your monthly purge quota. - * - * Note: A purge cache request will be issued against `https://ik.imagekit.io/old/folder/path*` (with a wildcard at the end). This will remove all nested files, their versions' URLs, and any transformations made using query parameters on these files or their versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. - * - * Default value - `false` + * @param array{ + * folderPath: string, newFolderName: string, purgeCache?: bool + * }|FolderRenameParams $params * * @throws APIException */ public function rename( - $folderPath, - $newFolderName, - $purgeCache = omit, - ?RequestOptions $requestOptions = null, - ): FolderRenameResponse { - $params = [ - 'folderPath' => $folderPath, - 'newFolderName' => $newFolderName, - 'purgeCache' => $purgeCache, - ]; - - return $this->renameRaw($params, $requestOptions); - } - - /** - * @api - * - * @param array $params - * - * @throws APIException - */ - public function renameRaw( - array $params, + array|FolderRenameParams $params, ?RequestOptions $requestOptions = null ): FolderRenameResponse { [$parsed, $options] = FolderRenameParams::parseRequest( $params, - $requestOptions + $requestOptions, ); // @phpstan-ignore-next-line; diff --git a/src/SolidColorOverlay.php b/src/SolidColorOverlay.php index ac11dae9..e960f51e 100644 --- a/src/SolidColorOverlay.php +++ b/src/SolidColorOverlay.php @@ -10,11 +10,11 @@ /** * @phpstan-type SolidColorOverlayShape = array{ - * position?: OverlayPosition, - * timing?: OverlayTiming, + * position?: OverlayPosition|null, + * timing?: OverlayTiming|null, * color: string, - * type: string, - * transformation?: list, + * type: "solidColor", + * transformation?: list|null, * } */ final class SolidColorOverlay implements BaseModel @@ -22,6 +22,7 @@ final class SolidColorOverlay implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "solidColor" $type */ #[Api] public string $type = 'solidColor'; diff --git a/src/SolidColorOverlayTransformation.php b/src/SolidColorOverlayTransformation.php index 4ca7703f..e43a258d 100644 --- a/src/SolidColorOverlayTransformation.php +++ b/src/SolidColorOverlayTransformation.php @@ -10,12 +10,12 @@ /** * @phpstan-type SolidColorOverlayTransformationShape = array{ - * alpha?: float, - * background?: string, - * gradient?: bool|string, - * height?: float|string, - * radius?: float|string, - * width?: float|string, + * alpha?: float|null, + * background?: string|null, + * gradient?: string|null|bool, + * height?: float|string|null, + * radius?: float|null|"max", + * width?: float|string|null, * } */ final class SolidColorOverlayTransformation implements BaseModel @@ -40,7 +40,7 @@ final class SolidColorOverlayTransformation implements BaseModel * Only works if the base asset is an image. See [gradient](https://imagekit.io/docs/effects-and-enhancements#gradient---e-gradient). */ #[Api(optional: true)] - public bool|string|null $gradient; + public string|bool|null $gradient; /** * Controls the height of the solid color overlay. Accepts a numeric value or an arithmetic expression. @@ -52,6 +52,8 @@ final class SolidColorOverlayTransformation implements BaseModel /** * Specifies the corner radius of the solid color overlay. Set to `max` for circular or oval shape. * See [radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). + * + * @var float|"max"|null $radius */ #[Api(optional: true)] public float|string|null $radius; @@ -72,11 +74,13 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param float|"max" $radius */ public static function with( ?float $alpha = null, ?string $background = null, - bool|string|null $gradient = null, + string|bool|null $gradient = null, float|string|null $height = null, float|string|null $radius = null, float|string|null $width = null, @@ -119,7 +123,7 @@ public function withBackground(string $background): self * Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. * Only works if the base asset is an image. See [gradient](https://imagekit.io/docs/effects-and-enhancements#gradient---e-gradient). */ - public function withGradient(bool|string $gradient): self + public function withGradient(string|bool $gradient): self { $obj = clone $this; $obj->gradient = $gradient; @@ -142,6 +146,8 @@ public function withHeight(float|string $height): self /** * Specifies the corner radius of the solid color overlay. Set to `max` for circular or oval shape. * See [radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). + * + * @param float|"max" $radius */ public function withRadius(float|string $radius): self { diff --git a/src/SolidColorOverlayTransformation/Gradient.php b/src/SolidColorOverlayTransformation/Gradient.php index fb769e5a..ccd1495c 100644 --- a/src/SolidColorOverlayTransformation/Gradient.php +++ b/src/SolidColorOverlayTransformation/Gradient.php @@ -17,8 +17,7 @@ final class Gradient implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/SolidColorOverlayTransformation/Height.php b/src/SolidColorOverlayTransformation/Height.php index 1f458195..dfe441b3 100644 --- a/src/SolidColorOverlayTransformation/Height.php +++ b/src/SolidColorOverlayTransformation/Height.php @@ -17,8 +17,7 @@ final class Height implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/SolidColorOverlayTransformation/Radius.php b/src/SolidColorOverlayTransformation/Radius.php index 1f1b4686..c1be8d24 100644 --- a/src/SolidColorOverlayTransformation/Radius.php +++ b/src/SolidColorOverlayTransformation/Radius.php @@ -17,8 +17,7 @@ final class Radius implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/SolidColorOverlayTransformation/Width.php b/src/SolidColorOverlayTransformation/Width.php index 9b727c04..f3b72449 100644 --- a/src/SolidColorOverlayTransformation/Width.php +++ b/src/SolidColorOverlayTransformation/Width.php @@ -17,8 +17,7 @@ final class Width implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/SrcOptions.php b/src/SrcOptions.php index 9e935024..fe6243a0 100644 --- a/src/SrcOptions.php +++ b/src/SrcOptions.php @@ -14,11 +14,11 @@ * @phpstan-type SrcOptionsShape = array{ * src: string, * urlEndpoint: string, - * expiresIn?: float, - * queryParameters?: array, - * signed?: bool, - * transformation?: list, - * transformationPosition?: value-of, + * expiresIn?: float|null, + * queryParameters?: array|null, + * signed?: bool|null, + * transformation?: list|null, + * transformationPosition?: value-of|null, * } */ final class SrcOptions implements BaseModel @@ -57,7 +57,7 @@ final class SrcOptions implements BaseModel * They can be any query parameters and not necessarily related to ImageKit. * This is especially useful if you want to add a versioning parameter to your URLs. * - * @var array|null $queryParameters + * @var array|null $queryParameters */ #[Api(map: 'string', optional: true)] public ?array $queryParameters; @@ -114,7 +114,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param array $queryParameters + * @param array $queryParameters * @param list $transformation * @param TransformationPosition|value-of $transformationPosition */ @@ -187,7 +187,7 @@ public function withExpiresIn(float $expiresIn): self * They can be any query parameters and not necessarily related to ImageKit. * This is especially useful if you want to add a versioning parameter to your URLs. * - * @param array $queryParameters + * @param array $queryParameters */ public function withQueryParameters(array $queryParameters): self { diff --git a/src/SubtitleOverlay.php b/src/SubtitleOverlay.php index f35111af..61ec1f15 100644 --- a/src/SubtitleOverlay.php +++ b/src/SubtitleOverlay.php @@ -11,12 +11,12 @@ /** * @phpstan-type SubtitleOverlayShape = array{ - * position?: OverlayPosition, - * timing?: OverlayTiming, + * position?: OverlayPosition|null, + * timing?: OverlayTiming|null, * input: string, - * type: string, - * encoding?: value-of, - * transformation?: list, + * type: "subtitle", + * encoding?: value-of|null, + * transformation?: list|null, * } */ final class SubtitleOverlay implements BaseModel @@ -24,6 +24,7 @@ final class SubtitleOverlay implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "subtitle" $type */ #[Api] public string $type = 'subtitle'; diff --git a/src/SubtitleOverlayTransformation.php b/src/SubtitleOverlayTransformation.php index 96ed629f..3b9ab809 100644 --- a/src/SubtitleOverlayTransformation.php +++ b/src/SubtitleOverlayTransformation.php @@ -13,13 +13,13 @@ * Subtitle styling options. [Learn more](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) from the docs. * * @phpstan-type SubtitleOverlayTransformationShape = array{ - * background?: string, - * color?: string, - * fontFamily?: string, - * fontOutline?: string, - * fontShadow?: string, - * fontSize?: float, - * typography?: value-of, + * background?: string|null, + * color?: string|null, + * fontFamily?: string|null, + * fontOutline?: string|null, + * fontShadow?: string|null, + * fontSize?: float|null, + * typography?: value-of|null, * } */ final class SubtitleOverlayTransformation implements BaseModel diff --git a/src/TextOverlay.php b/src/TextOverlay.php index b9bb4f7d..e379bdf1 100644 --- a/src/TextOverlay.php +++ b/src/TextOverlay.php @@ -11,12 +11,12 @@ /** * @phpstan-type TextOverlayShape = array{ - * position?: OverlayPosition, - * timing?: OverlayTiming, + * position?: OverlayPosition|null, + * timing?: OverlayTiming|null, * text: string, - * type: string, - * encoding?: value-of, - * transformation?: list, + * type: "text", + * encoding?: value-of|null, + * transformation?: list|null, * } */ final class TextOverlay implements BaseModel @@ -24,6 +24,7 @@ final class TextOverlay implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "text" $type */ #[Api] public string $type = 'text'; diff --git a/src/TextOverlayTransformation.php b/src/TextOverlayTransformation.php index 9b983150..296c6ef7 100644 --- a/src/TextOverlayTransformation.php +++ b/src/TextOverlayTransformation.php @@ -12,19 +12,19 @@ /** * @phpstan-type TextOverlayTransformationShape = array{ - * alpha?: float, - * background?: string, - * flip?: value-of, - * fontColor?: string, - * fontFamily?: string, - * fontSize?: float|string, - * innerAlignment?: value-of, - * lineHeight?: float|string, - * padding?: float|string, - * radius?: float|string, - * rotation?: float|string, - * typography?: string, - * width?: float|string, + * alpha?: float|null, + * background?: string|null, + * flip?: value-of|null, + * fontColor?: string|null, + * fontFamily?: string|null, + * fontSize?: float|string|null, + * innerAlignment?: value-of|null, + * lineHeight?: float|string|null, + * padding?: float|string|null, + * radius?: float|null|"max", + * rotation?: float|string|null, + * typography?: string|null, + * width?: float|string|null, * } */ final class TextOverlayTransformation implements BaseModel @@ -98,6 +98,8 @@ final class TextOverlayTransformation implements BaseModel /** * Specifies the corner radius of the text overlay. * Set to `max` to achieve a circular or oval shape. + * + * @var float|"max"|null $radius */ #[Api(optional: true)] public float|string|null $radius; @@ -137,6 +139,7 @@ public function __construct() * * @param Flip|value-of $flip * @param InnerAlignment|value-of $innerAlignment + * @param float|"max" $radius */ public static function with( ?float $alpha = null, @@ -284,6 +287,8 @@ public function withPadding(float|string $padding): self /** * Specifies the corner radius of the text overlay. * Set to `max` to achieve a circular or oval shape. + * + * @param float|"max" $radius */ public function withRadius(float|string $radius): self { diff --git a/src/TextOverlayTransformation/FontSize.php b/src/TextOverlayTransformation/FontSize.php index b3a3adf9..89f9c10f 100644 --- a/src/TextOverlayTransformation/FontSize.php +++ b/src/TextOverlayTransformation/FontSize.php @@ -16,8 +16,7 @@ final class FontSize implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/TextOverlayTransformation/LineHeight.php b/src/TextOverlayTransformation/LineHeight.php index 5b3d01d7..ab7bb004 100644 --- a/src/TextOverlayTransformation/LineHeight.php +++ b/src/TextOverlayTransformation/LineHeight.php @@ -17,8 +17,7 @@ final class LineHeight implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/TextOverlayTransformation/Padding.php b/src/TextOverlayTransformation/Padding.php index bbe361d2..442b0d40 100644 --- a/src/TextOverlayTransformation/Padding.php +++ b/src/TextOverlayTransformation/Padding.php @@ -18,8 +18,7 @@ final class Padding implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/TextOverlayTransformation/Radius.php b/src/TextOverlayTransformation/Radius.php index 2630b578..9998abf7 100644 --- a/src/TextOverlayTransformation/Radius.php +++ b/src/TextOverlayTransformation/Radius.php @@ -17,8 +17,7 @@ final class Radius implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/TextOverlayTransformation/Rotation.php b/src/TextOverlayTransformation/Rotation.php index 98d464fe..1952ed67 100644 --- a/src/TextOverlayTransformation/Rotation.php +++ b/src/TextOverlayTransformation/Rotation.php @@ -17,8 +17,7 @@ final class Rotation implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/TextOverlayTransformation/Width.php b/src/TextOverlayTransformation/Width.php index ea42449f..f1ae1eb5 100644 --- a/src/TextOverlayTransformation/Width.php +++ b/src/TextOverlayTransformation/Width.php @@ -17,8 +17,7 @@ final class Width implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Transformation.php b/src/Transformation.php index f315da99..6cf811d9 100644 --- a/src/Transformation.php +++ b/src/Transformation.php @@ -21,58 +21,58 @@ * See the [Transformations documentation](https://imagekit.io/docs/transformations). * * @phpstan-type TransformationShape = array{ - * aiChangeBackground?: string, - * aiDropShadow?: bool|string, - * aiEdit?: string, - * aiRemoveBackground?: bool, - * aiRemoveBackgroundExternal?: bool, - * aiRetouch?: bool, - * aiUpscale?: bool, - * aiVariation?: bool, - * aspectRatio?: float|string, - * audioCodec?: value-of, - * background?: string, - * blur?: float, - * border?: string, - * colorProfile?: bool, - * contrastStretch?: bool, - * crop?: value-of, - * cropMode?: value-of, - * defaultImage?: string, - * dpr?: float, - * duration?: float|string, - * endOffset?: float|string, - * flip?: value-of, - * focus?: string, - * format?: value-of, - * gradient?: bool|string, - * grayscale?: bool, - * height?: float|string, - * lossless?: bool, - * metadata?: bool, - * named?: string, - * opacity?: float, - * original?: bool, - * overlay?: Overlay, - * page?: float|string, - * progressive?: bool, - * quality?: float, - * radius?: float|string, - * raw?: string, - * rotation?: float|string, - * shadow?: bool|string, - * sharpen?: bool|float, - * startOffset?: float|string, - * streamingResolutions?: list>, - * trim?: bool|float, - * unsharpMask?: bool|string, - * videoCodec?: value-of, - * width?: float|string, - * x?: float|string, - * xCenter?: float|string, - * y?: float|string, - * yCenter?: float|string, - * zoom?: float, + * aiChangeBackground?: string|null, + * aiDropShadow?: string|null|bool, + * aiEdit?: string|null, + * aiRemoveBackground?: bool|null, + * aiRemoveBackgroundExternal?: bool|null, + * aiRetouch?: bool|null, + * aiUpscale?: bool|null, + * aiVariation?: bool|null, + * aspectRatio?: float|string|null, + * audioCodec?: value-of|null, + * background?: string|null, + * blur?: float|null, + * border?: string|null, + * colorProfile?: bool|null, + * contrastStretch?: bool|null, + * crop?: value-of|null, + * cropMode?: value-of|null, + * defaultImage?: string|null, + * dpr?: float|null, + * duration?: float|string|null, + * endOffset?: float|string|null, + * flip?: value-of|null, + * focus?: string|null, + * format?: value-of|null, + * gradient?: string|null|bool, + * grayscale?: bool|null, + * height?: float|string|null, + * lossless?: bool|null, + * metadata?: bool|null, + * named?: string|null, + * opacity?: float|null, + * original?: bool|null, + * overlay?: Overlay|null, + * page?: float|string|null, + * progressive?: bool|null, + * quality?: float|null, + * radius?: float|null|"max", + * raw?: string|null, + * rotation?: float|string|null, + * shadow?: string|null|bool, + * sharpen?: float|null|bool, + * startOffset?: float|string|null, + * streamingResolutions?: list>|null, + * trim?: float|null|bool, + * unsharpMask?: string|null|bool, + * videoCodec?: value-of|null, + * width?: float|string|null, + * x?: float|string|null, + * xCenter?: float|string|null, + * y?: float|string|null, + * yCenter?: float|string|null, + * zoom?: float|null, * } */ final class Transformation implements BaseModel @@ -97,7 +97,7 @@ final class Transformation implements BaseModel * See [AI Drop Shadow](https://imagekit.io/docs/ai-transformations#ai-drop-shadow-e-dropshadow). */ #[Api(optional: true)] - public bool|string|null $aiDropShadow; + public string|bool|null $aiDropShadow; /** * Uses AI to edit images based on a text prompt. Provide a text prompt or a base64-encoded prompt, @@ -285,7 +285,7 @@ final class Transformation implements BaseModel * See [Gradient](https://imagekit.io/docs/effects-and-enhancements#gradient---e-gradient). */ #[Api(optional: true)] - public bool|string|null $gradient; + public string|bool|null $gradient; /** * Enables a grayscale effect for images. See [Grayscale](https://imagekit.io/docs/effects-and-enhancements#grayscale---e-grayscale). @@ -371,6 +371,8 @@ final class Transformation implements BaseModel /** * Specifies the corner radius for rounded corners (e.g., 20) or `max` for circular or oval shape. * See [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). + * + * @var float|"max"|null $radius */ #[Api(optional: true)] public float|string|null $radius; @@ -398,7 +400,7 @@ final class Transformation implements BaseModel * See [Shadow](https://imagekit.io/docs/effects-and-enhancements#shadow---e-shadow). */ #[Api(optional: true)] - public bool|string|null $shadow; + public string|bool|null $shadow; /** * Sharpens the input image, highlighting edges and finer details. @@ -406,7 +408,7 @@ final class Transformation implements BaseModel * See [Sharpen](https://imagekit.io/docs/effects-and-enhancements#sharpen---e-sharpen). */ #[Api(optional: true)] - public bool|float|null $sharpen; + public float|bool|null $sharpen; /** * Specifies the start offset (in seconds) for trimming videos, e.g., `5` or `10.5`. @@ -431,7 +433,7 @@ final class Transformation implements BaseModel * See [Trim edges](https://imagekit.io/docs/effects-and-enhancements#trim-edges---t). */ #[Api(optional: true)] - public bool|float|null $trim; + public float|bool|null $trim; /** * Applies Unsharp Masking (USM), an image sharpening technique. @@ -439,7 +441,7 @@ final class Transformation implements BaseModel * See [Unsharp Mask](https://imagekit.io/docs/effects-and-enhancements#unsharp-mask---e-usm). */ #[Api(optional: true)] - public bool|string|null $unsharpMask; + public string|bool|null $unsharpMask; /** * Specifies the video codec, e.g., `h264`, `vp9`, `av1`, or `none`. See [Video codec](https://imagekit.io/docs/video-optimization#video-codec---vc). @@ -504,12 +506,13 @@ public function __construct() * @param CropMode|value-of $cropMode * @param Flip|value-of $flip * @param Format|value-of $format + * @param float|"max" $radius * @param list> $streamingResolutions * @param VideoCodec|value-of $videoCodec */ public static function with( ?string $aiChangeBackground = null, - bool|string|null $aiDropShadow = null, + string|bool|null $aiDropShadow = null, ?string $aiEdit = null, ?bool $aiRemoveBackground = null, ?bool $aiRemoveBackgroundExternal = null, @@ -532,7 +535,7 @@ public static function with( Flip|string|null $flip = null, ?string $focus = null, Format|string|null $format = null, - bool|string|null $gradient = null, + string|bool|null $gradient = null, ?bool $grayscale = null, float|string|null $height = null, ?bool $lossless = null, @@ -547,12 +550,12 @@ public static function with( float|string|null $radius = null, ?string $raw = null, float|string|null $rotation = null, - bool|string|null $shadow = null, - bool|float|null $sharpen = null, + string|bool|null $shadow = null, + float|bool|null $sharpen = null, float|string|null $startOffset = null, ?array $streamingResolutions = null, - bool|float|null $trim = null, - bool|string|null $unsharpMask = null, + float|bool|null $trim = null, + string|bool|null $unsharpMask = null, VideoCodec|string|null $videoCodec = null, float|string|null $width = null, float|string|null $x = null, @@ -640,7 +643,7 @@ public function withAIChangeBackground(string $aiChangeBackground): self * Supported inside overlay. * See [AI Drop Shadow](https://imagekit.io/docs/ai-transformations#ai-drop-shadow-e-dropshadow). */ - public function withAIDropShadow(bool|string $aiDropShadow): self + public function withAIDropShadow(string|bool $aiDropShadow): self { $obj = clone $this; $obj->aiDropShadow = $aiDropShadow; @@ -944,7 +947,7 @@ public function withFormat(Format|string $format): self * Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. * See [Gradient](https://imagekit.io/docs/effects-and-enhancements#gradient---e-gradient). */ - public function withGradient(bool|string $gradient): self + public function withGradient(string|bool $gradient): self { $obj = clone $this; $obj->gradient = $gradient; @@ -1091,6 +1094,8 @@ public function withQuality(float $quality): self /** * Specifies the corner radius for rounded corners (e.g., 20) or `max` for circular or oval shape. * See [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). + * + * @param float|"max" $radius */ public function withRadius(float|string $radius): self { @@ -1132,7 +1137,7 @@ public function withRotation(float|string $rotation): self * Pass `true` for a default shadow, or provide a string for a custom shadow. * See [Shadow](https://imagekit.io/docs/effects-and-enhancements#shadow---e-shadow). */ - public function withShadow(bool|string $shadow): self + public function withShadow(string|bool $shadow): self { $obj = clone $this; $obj->shadow = $shadow; @@ -1145,7 +1150,7 @@ public function withShadow(bool|string $shadow): self * Pass `true` for default sharpening, or provide a numeric value for custom sharpening. * See [Sharpen](https://imagekit.io/docs/effects-and-enhancements#sharpen---e-sharpen). */ - public function withSharpen(bool|float $sharpen): self + public function withSharpen(float|bool $sharpen): self { $obj = clone $this; $obj->sharpen = $sharpen; @@ -1185,7 +1190,7 @@ public function withStreamingResolutions(array $streamingResolutions): self * leaving only the central object in the output image. * See [Trim edges](https://imagekit.io/docs/effects-and-enhancements#trim-edges---t). */ - public function withTrim(bool|float $trim): self + public function withTrim(float|bool $trim): self { $obj = clone $this; $obj->trim = $trim; @@ -1198,7 +1203,7 @@ public function withTrim(bool|float $trim): self * Pass `true` for a default unsharp mask, or provide a string for a custom unsharp mask. * See [Unsharp Mask](https://imagekit.io/docs/effects-and-enhancements#unsharp-mask---e-usm). */ - public function withUnsharpMask(bool|string $unsharpMask): self + public function withUnsharpMask(string|bool $unsharpMask): self { $obj = clone $this; $obj->unsharpMask = $unsharpMask; diff --git a/src/Transformation/AIDropShadow.php b/src/Transformation/AIDropShadow.php index f241d19a..2c1914fa 100644 --- a/src/Transformation/AIDropShadow.php +++ b/src/Transformation/AIDropShadow.php @@ -20,8 +20,7 @@ final class AIDropShadow implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Transformation/AspectRatio.php b/src/Transformation/AspectRatio.php index b7079963..391cd233 100644 --- a/src/Transformation/AspectRatio.php +++ b/src/Transformation/AspectRatio.php @@ -18,8 +18,7 @@ final class AspectRatio implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Transformation/Duration.php b/src/Transformation/Duration.php index 9c6acb81..766a9cc5 100644 --- a/src/Transformation/Duration.php +++ b/src/Transformation/Duration.php @@ -18,8 +18,7 @@ final class Duration implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Transformation/EndOffset.php b/src/Transformation/EndOffset.php index 812867ba..9166d410 100644 --- a/src/Transformation/EndOffset.php +++ b/src/Transformation/EndOffset.php @@ -18,8 +18,7 @@ final class EndOffset implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Transformation/Gradient.php b/src/Transformation/Gradient.php index 32429f2a..94553f22 100644 --- a/src/Transformation/Gradient.php +++ b/src/Transformation/Gradient.php @@ -17,8 +17,7 @@ final class Gradient implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Transformation/Height.php b/src/Transformation/Height.php index 227a0456..deb84fdd 100644 --- a/src/Transformation/Height.php +++ b/src/Transformation/Height.php @@ -18,8 +18,7 @@ final class Height implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Transformation/Page.php b/src/Transformation/Page.php index 71856748..3fab3519 100644 --- a/src/Transformation/Page.php +++ b/src/Transformation/Page.php @@ -19,8 +19,7 @@ final class Page implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Transformation/Radius.php b/src/Transformation/Radius.php index d9aa35e9..84778e6c 100644 --- a/src/Transformation/Radius.php +++ b/src/Transformation/Radius.php @@ -17,8 +17,7 @@ final class Radius implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Transformation/Rotation.php b/src/Transformation/Rotation.php index 3131b9ad..41d73028 100644 --- a/src/Transformation/Rotation.php +++ b/src/Transformation/Rotation.php @@ -19,8 +19,7 @@ final class Rotation implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Transformation/Shadow.php b/src/Transformation/Shadow.php index 8961f7dc..0b85700f 100644 --- a/src/Transformation/Shadow.php +++ b/src/Transformation/Shadow.php @@ -19,8 +19,7 @@ final class Shadow implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Transformation/Sharpen.php b/src/Transformation/Sharpen.php index fdb9adfc..aec64aaa 100644 --- a/src/Transformation/Sharpen.php +++ b/src/Transformation/Sharpen.php @@ -18,8 +18,7 @@ final class Sharpen implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Transformation/StartOffset.php b/src/Transformation/StartOffset.php index 654c0e6f..9a1a0008 100644 --- a/src/Transformation/StartOffset.php +++ b/src/Transformation/StartOffset.php @@ -18,8 +18,7 @@ final class StartOffset implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Transformation/Trim.php b/src/Transformation/Trim.php index f145c2f7..9a480191 100644 --- a/src/Transformation/Trim.php +++ b/src/Transformation/Trim.php @@ -18,8 +18,7 @@ final class Trim implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Transformation/UnsharpMask.php b/src/Transformation/UnsharpMask.php index 73c91d23..c634a462 100644 --- a/src/Transformation/UnsharpMask.php +++ b/src/Transformation/UnsharpMask.php @@ -18,8 +18,7 @@ final class UnsharpMask implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Transformation/Width.php b/src/Transformation/Width.php index 98d75af1..ff4c9e61 100644 --- a/src/Transformation/Width.php +++ b/src/Transformation/Width.php @@ -18,8 +18,7 @@ final class Width implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Transformation/X.php b/src/Transformation/X.php index 0a5acbc2..d8af8a92 100644 --- a/src/Transformation/X.php +++ b/src/Transformation/X.php @@ -16,8 +16,7 @@ final class X implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Transformation/XCenter.php b/src/Transformation/XCenter.php index 91b329dc..e49a6b00 100644 --- a/src/Transformation/XCenter.php +++ b/src/Transformation/XCenter.php @@ -16,8 +16,7 @@ final class XCenter implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Transformation/Y.php b/src/Transformation/Y.php index 5338015b..b1da82b8 100644 --- a/src/Transformation/Y.php +++ b/src/Transformation/Y.php @@ -16,8 +16,7 @@ final class Y implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Transformation/YCenter.php b/src/Transformation/YCenter.php index 2520968d..601ca9d5 100644 --- a/src/Transformation/YCenter.php +++ b/src/Transformation/YCenter.php @@ -16,8 +16,7 @@ final class YCenter implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/VideoOverlay.php b/src/VideoOverlay.php index 5e9ceebf..4fffe44b 100644 --- a/src/VideoOverlay.php +++ b/src/VideoOverlay.php @@ -11,12 +11,12 @@ /** * @phpstan-type VideoOverlayShape = array{ - * position?: OverlayPosition, - * timing?: OverlayTiming, + * position?: OverlayPosition|null, + * timing?: OverlayTiming|null, * input: string, - * type: string, - * encoding?: value-of, - * transformation?: list, + * type: "video", + * encoding?: value-of|null, + * transformation?: list|null, * } */ final class VideoOverlay implements BaseModel @@ -24,6 +24,7 @@ final class VideoOverlay implements BaseModel /** @use SdkModel */ use SdkModel; + /** @var "video" $type */ #[Api] public string $type = 'video'; diff --git a/src/Webhooks/UnsafeUnwrapWebhookEvent.php b/src/Webhooks/UnsafeUnwrapWebhookEvent.php index 508250a3..82cec1af 100644 --- a/src/Webhooks/UnsafeUnwrapWebhookEvent.php +++ b/src/Webhooks/UnsafeUnwrapWebhookEvent.php @@ -16,8 +16,7 @@ final class UnsafeUnwrapWebhookEvent implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Webhooks/UnwrapWebhookEvent.php b/src/Webhooks/UnwrapWebhookEvent.php index 98b83129..4c0cc422 100644 --- a/src/Webhooks/UnwrapWebhookEvent.php +++ b/src/Webhooks/UnwrapWebhookEvent.php @@ -16,8 +16,7 @@ final class UnwrapWebhookEvent implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Webhooks/UploadPostTransformErrorEvent.php b/src/Webhooks/UploadPostTransformErrorEvent.php index cff5dbd2..2aad71ac 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent.php +++ b/src/Webhooks/UploadPostTransformErrorEvent.php @@ -16,7 +16,7 @@ * @phpstan-type UploadPostTransformErrorEventShape = array{ * id: string, * type: string, - * createdAt: \DateTimeInterface, + * created_at: \DateTimeInterface, * data: Data, * request: Request, * } @@ -41,8 +41,8 @@ final class UploadPostTransformErrorEvent implements BaseModel /** * Timestamp of when the event occurred in ISO8601 format. */ - #[Api('created_at')] - public \DateTimeInterface $createdAt; + #[Api] + public \DateTimeInterface $created_at; #[Api] public Data $data; @@ -56,7 +56,7 @@ final class UploadPostTransformErrorEvent implements BaseModel * To enforce required parameters use * ``` * UploadPostTransformErrorEvent::with( - * id: ..., type: ..., createdAt: ..., data: ..., request: ... + * id: ..., type: ..., created_at: ..., data: ..., request: ... * ) * ``` * @@ -84,7 +84,7 @@ public function __construct() public static function with( string $id, string $type, - \DateTimeInterface $createdAt, + \DateTimeInterface $created_at, Data $data, Request $request, ): self { @@ -92,7 +92,7 @@ public static function with( $obj->id = $id; $obj->type = $type; - $obj->createdAt = $createdAt; + $obj->created_at = $created_at; $obj->data = $data; $obj->request = $request; @@ -127,7 +127,7 @@ public function withType(string $type): self public function withCreatedAt(\DateTimeInterface $createdAt): self { $obj = clone $this; - $obj->createdAt = $createdAt; + $obj->created_at = $createdAt; return $obj; } diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data.php b/src/Webhooks/UploadPostTransformErrorEvent/Data.php index aeee7af3..3d9331db 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Data.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data.php @@ -11,7 +11,7 @@ /** * @phpstan-type DataShape = array{ - * fileID: string, + * fileId: string, * name: string, * path: string, * transformation: Transformation, @@ -26,8 +26,8 @@ final class Data implements BaseModel /** * Unique identifier of the originally uploaded file. */ - #[Api('fileId')] - public string $fileID; + #[Api] + public string $fileId; /** * Name of the file. @@ -55,7 +55,7 @@ final class Data implements BaseModel * * To enforce required parameters use * ``` - * Data::with(fileID: ..., name: ..., path: ..., transformation: ..., url: ...) + * Data::with(fileId: ..., name: ..., path: ..., transformation: ..., url: ...) * ``` * * Otherwise ensure the following setters are called @@ -80,7 +80,7 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - string $fileID, + string $fileId, string $name, string $path, Transformation $transformation, @@ -88,7 +88,7 @@ public static function with( ): self { $obj = new self; - $obj->fileID = $fileID; + $obj->fileId = $fileId; $obj->name = $name; $obj->path = $path; $obj->transformation = $transformation; @@ -103,7 +103,7 @@ public static function with( public function withFileID(string $fileID): self { $obj = clone $this; - $obj->fileID = $fileID; + $obj->fileId = $fileID; return $obj; } diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request.php b/src/Webhooks/UploadPostTransformErrorEvent/Request.php index 14fefb80..13988778 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request.php @@ -11,7 +11,7 @@ /** * @phpstan-type RequestShape = array{ - * transformation: Transformation, xRequestID: string + * transformation: Transformation, x_request_id: string * } */ final class Request implements BaseModel @@ -25,15 +25,15 @@ final class Request implements BaseModel /** * Unique identifier for the originating request. */ - #[Api('x_request_id')] - public string $xRequestID; + #[Api] + public string $x_request_id; /** * `new Request()` is missing required properties by the API. * * To enforce required parameters use * ``` - * Request::with(transformation: ..., xRequestID: ...) + * Request::with(transformation: ..., x_request_id: ...) * ``` * * Otherwise ensure the following setters are called @@ -54,12 +54,12 @@ public function __construct() */ public static function with( Transformation $transformation, - string $xRequestID + string $x_request_id ): self { $obj = new self; $obj->transformation = $transformation; - $obj->xRequestID = $xRequestID; + $obj->x_request_id = $x_request_id; return $obj; } @@ -78,7 +78,7 @@ public function withTransformation(Transformation $transformation): self public function withXRequestID(string $xRequestID): self { $obj = clone $this; - $obj->xRequestID = $xRequestID; + $obj->x_request_id = $xRequestID; return $obj; } diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php index af4ce75b..a41b9413 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php @@ -12,7 +12,7 @@ /** * @phpstan-type TransformationShape = array{ - * type: value-of, protocol?: value-of, value?: string + * type: value-of, protocol?: value-of|null, value?: string|null * } */ final class Transformation implements BaseModel diff --git a/src/Webhooks/UploadPostTransformSuccessEvent.php b/src/Webhooks/UploadPostTransformSuccessEvent.php index 49c55f8c..169daba2 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent.php @@ -16,7 +16,7 @@ * @phpstan-type UploadPostTransformSuccessEventShape = array{ * id: string, * type: string, - * createdAt: \DateTimeInterface, + * created_at: \DateTimeInterface, * data: Data, * request: Request, * } @@ -41,8 +41,8 @@ final class UploadPostTransformSuccessEvent implements BaseModel /** * Timestamp of when the event occurred in ISO8601 format. */ - #[Api('created_at')] - public \DateTimeInterface $createdAt; + #[Api] + public \DateTimeInterface $created_at; #[Api] public Data $data; @@ -56,7 +56,7 @@ final class UploadPostTransformSuccessEvent implements BaseModel * To enforce required parameters use * ``` * UploadPostTransformSuccessEvent::with( - * id: ..., type: ..., createdAt: ..., data: ..., request: ... + * id: ..., type: ..., created_at: ..., data: ..., request: ... * ) * ``` * @@ -84,7 +84,7 @@ public function __construct() public static function with( string $id, string $type, - \DateTimeInterface $createdAt, + \DateTimeInterface $created_at, Data $data, Request $request, ): self { @@ -92,7 +92,7 @@ public static function with( $obj->id = $id; $obj->type = $type; - $obj->createdAt = $createdAt; + $obj->created_at = $created_at; $obj->data = $data; $obj->request = $request; @@ -127,7 +127,7 @@ public function withType(string $type): self public function withCreatedAt(\DateTimeInterface $createdAt): self { $obj = clone $this; - $obj->createdAt = $createdAt; + $obj->created_at = $createdAt; return $obj; } diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Data.php b/src/Webhooks/UploadPostTransformSuccessEvent/Data.php index 511fbb1a..58204e4c 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Data.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Data.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type DataShape = array{fileID: string, name: string, url: string} + * @phpstan-type DataShape = array{fileId: string, name: string, url: string} */ final class Data implements BaseModel { @@ -19,8 +19,8 @@ final class Data implements BaseModel /** * Unique identifier of the originally uploaded file. */ - #[Api('fileId')] - public string $fileID; + #[Api] + public string $fileId; /** * Name of the file. @@ -39,7 +39,7 @@ final class Data implements BaseModel * * To enforce required parameters use * ``` - * Data::with(fileID: ..., name: ..., url: ...) + * Data::with(fileId: ..., name: ..., url: ...) * ``` * * Otherwise ensure the following setters are called @@ -58,11 +58,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. */ - public static function with(string $fileID, string $name, string $url): self + public static function with(string $fileId, string $name, string $url): self { $obj = new self; - $obj->fileID = $fileID; + $obj->fileId = $fileId; $obj->name = $name; $obj->url = $url; @@ -75,7 +75,7 @@ public static function with(string $fileID, string $name, string $url): self public function withFileID(string $fileID): self { $obj = clone $this; - $obj->fileID = $fileID; + $obj->fileId = $fileID; return $obj; } diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request.php index d06e8ea1..107c6fac 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request.php @@ -11,7 +11,7 @@ /** * @phpstan-type RequestShape = array{ - * transformation: Transformation, xRequestID: string + * transformation: Transformation, x_request_id: string * } */ final class Request implements BaseModel @@ -25,15 +25,15 @@ final class Request implements BaseModel /** * Unique identifier for the originating request. */ - #[Api('x_request_id')] - public string $xRequestID; + #[Api] + public string $x_request_id; /** * `new Request()` is missing required properties by the API. * * To enforce required parameters use * ``` - * Request::with(transformation: ..., xRequestID: ...) + * Request::with(transformation: ..., x_request_id: ...) * ``` * * Otherwise ensure the following setters are called @@ -54,12 +54,12 @@ public function __construct() */ public static function with( Transformation $transformation, - string $xRequestID + string $x_request_id ): self { $obj = new self; $obj->transformation = $transformation; - $obj->xRequestID = $xRequestID; + $obj->x_request_id = $x_request_id; return $obj; } @@ -78,7 +78,7 @@ public function withTransformation(Transformation $transformation): self public function withXRequestID(string $xRequestID): self { $obj = clone $this; - $obj->xRequestID = $xRequestID; + $obj->x_request_id = $xRequestID; return $obj; } diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php index 6cd1d5d2..5204dc6f 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php @@ -12,7 +12,7 @@ /** * @phpstan-type TransformationShape = array{ - * type: value-of, protocol?: value-of, value?: string + * type: value-of, protocol?: value-of|null, value?: string|null * } */ final class Transformation implements BaseModel diff --git a/src/Webhooks/UploadPreTransformErrorEvent.php b/src/Webhooks/UploadPreTransformErrorEvent.php index 29e81023..e0c4277e 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent.php +++ b/src/Webhooks/UploadPreTransformErrorEvent.php @@ -16,7 +16,7 @@ * @phpstan-type UploadPreTransformErrorEventShape = array{ * id: string, * type: string, - * createdAt: \DateTimeInterface, + * created_at: \DateTimeInterface, * data: Data, * request: Request, * } @@ -41,8 +41,8 @@ final class UploadPreTransformErrorEvent implements BaseModel /** * Timestamp of when the event occurred in ISO8601 format. */ - #[Api('created_at')] - public \DateTimeInterface $createdAt; + #[Api] + public \DateTimeInterface $created_at; #[Api] public Data $data; @@ -56,7 +56,7 @@ final class UploadPreTransformErrorEvent implements BaseModel * To enforce required parameters use * ``` * UploadPreTransformErrorEvent::with( - * id: ..., type: ..., createdAt: ..., data: ..., request: ... + * id: ..., type: ..., created_at: ..., data: ..., request: ... * ) * ``` * @@ -84,7 +84,7 @@ public function __construct() public static function with( string $id, string $type, - \DateTimeInterface $createdAt, + \DateTimeInterface $created_at, Data $data, Request $request, ): self { @@ -92,7 +92,7 @@ public static function with( $obj->id = $id; $obj->type = $type; - $obj->createdAt = $createdAt; + $obj->created_at = $created_at; $obj->data = $data; $obj->request = $request; @@ -127,7 +127,7 @@ public function withType(string $type): self public function withCreatedAt(\DateTimeInterface $createdAt): self { $obj = clone $this; - $obj->createdAt = $createdAt; + $obj->created_at = $createdAt; return $obj; } diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Request.php b/src/Webhooks/UploadPreTransformErrorEvent/Request.php index f5025066..de658422 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Request.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Request.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type RequestShape = array{transformation: string, xRequestID: string} + * @phpstan-type RequestShape = array{transformation: string, x_request_id: string} */ final class Request implements BaseModel { @@ -25,15 +25,15 @@ final class Request implements BaseModel /** * Unique identifier for the originating request. */ - #[Api('x_request_id')] - public string $xRequestID; + #[Api] + public string $x_request_id; /** * `new Request()` is missing required properties by the API. * * To enforce required parameters use * ``` - * Request::with(transformation: ..., xRequestID: ...) + * Request::with(transformation: ..., x_request_id: ...) * ``` * * Otherwise ensure the following setters are called @@ -54,12 +54,12 @@ public function __construct() */ public static function with( string $transformation, - string $xRequestID + string $x_request_id ): self { $obj = new self; $obj->transformation = $transformation; - $obj->xRequestID = $xRequestID; + $obj->x_request_id = $x_request_id; return $obj; } @@ -81,7 +81,7 @@ public function withTransformation(string $transformation): self public function withXRequestID(string $xRequestID): self { $obj = clone $this; - $obj->xRequestID = $xRequestID; + $obj->x_request_id = $xRequestID; return $obj; } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent.php b/src/Webhooks/UploadPreTransformSuccessEvent.php index 9cc13467..964bc434 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent.php @@ -16,7 +16,7 @@ * @phpstan-type UploadPreTransformSuccessEventShape = array{ * id: string, * type: string, - * createdAt: \DateTimeInterface, + * created_at: \DateTimeInterface, * data: Data, * request: Request, * } @@ -41,8 +41,8 @@ final class UploadPreTransformSuccessEvent implements BaseModel /** * Timestamp of when the event occurred in ISO8601 format. */ - #[Api('created_at')] - public \DateTimeInterface $createdAt; + #[Api] + public \DateTimeInterface $created_at; /** * Object containing details of a successful upload. @@ -59,7 +59,7 @@ final class UploadPreTransformSuccessEvent implements BaseModel * To enforce required parameters use * ``` * UploadPreTransformSuccessEvent::with( - * id: ..., type: ..., createdAt: ..., data: ..., request: ... + * id: ..., type: ..., created_at: ..., data: ..., request: ... * ) * ``` * @@ -87,7 +87,7 @@ public function __construct() public static function with( string $id, string $type, - \DateTimeInterface $createdAt, + \DateTimeInterface $created_at, Data $data, Request $request, ): self { @@ -95,7 +95,7 @@ public static function with( $obj->id = $id; $obj->type = $type; - $obj->createdAt = $createdAt; + $obj->created_at = $created_at; $obj->data = $data; $obj->request = $request; @@ -130,7 +130,7 @@ public function withType(string $type): self public function withCreatedAt(\DateTimeInterface $createdAt): self { $obj = clone $this; - $obj->createdAt = $createdAt; + $obj->created_at = $createdAt; return $obj; } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php index 3e81ebda..0f54ba55 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php @@ -17,31 +17,31 @@ * Object containing details of a successful upload. * * @phpstan-type DataShape = array{ - * aiTags?: list|null, - * audioCodec?: string, - * bitRate?: int, + * AITags?: list|null, + * audioCodec?: string|null, + * bitRate?: int|null, * customCoordinates?: string|null, - * customMetadata?: array, - * description?: string, - * duration?: int, - * embeddedMetadata?: array, - * extensionStatus?: ExtensionStatus, - * fileID?: string, - * filePath?: string, - * fileType?: string, - * height?: float, - * isPrivateFile?: bool, - * isPublished?: bool, - * metadata?: Metadata, - * name?: string, - * selectedFieldsSchema?: array, - * size?: float, + * customMetadata?: array|null, + * description?: string|null, + * duration?: int|null, + * embeddedMetadata?: array|null, + * extensionStatus?: ExtensionStatus|null, + * fileId?: string|null, + * filePath?: string|null, + * fileType?: string|null, + * height?: float|null, + * isPrivateFile?: bool|null, + * isPublished?: bool|null, + * metadata?: Metadata|null, + * name?: string|null, + * selectedFieldsSchema?: array|null, + * size?: float|null, * tags?: list|null, - * thumbnailURL?: string, - * url?: string, - * versionInfo?: VersionInfo, - * videoCodec?: string, - * width?: float, + * thumbnailUrl?: string|null, + * url?: string|null, + * versionInfo?: VersionInfo|null, + * videoCodec?: string|null, + * width?: float|null, * } */ final class Data implements BaseModel @@ -52,10 +52,10 @@ final class Data implements BaseModel /** * An array of tags assigned to the uploaded file by auto tagging. * - * @var list|null $aiTags + * @var list|null $AITags */ - #[Api('AITags', list: AITag::class, nullable: true, optional: true)] - public ?array $aiTags; + #[Api(list: AITag::class, nullable: true, optional: true)] + public ?array $AITags; /** * The audio codec used in the video (only for video). @@ -78,7 +78,7 @@ final class Data implements BaseModel /** * A key-value data associated with the asset. Use `responseField` in API request to get `customMetadata` in the upload API response. Before setting any custom metadata on an asset, you have to create the field using custom metadata fields API. Send `customMetadata` in `responseFields` in API request to get the value of this field. * - * @var array|null $customMetadata + * @var array|null $customMetadata */ #[Api(map: 'mixed', optional: true)] public ?array $customMetadata; @@ -98,7 +98,7 @@ final class Data implements BaseModel /** * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. Send `embeddedMetadata` in `responseFields` in API request to get embeddedMetadata in the upload API response. * - * @var array|null $embeddedMetadata + * @var array|null $embeddedMetadata */ #[Api(map: 'mixed', optional: true)] public ?array $embeddedMetadata; @@ -118,8 +118,8 @@ final class Data implements BaseModel /** * Unique fileId. Store this fileld in your database, as this will be used to perform update action on this file. */ - #[Api('fileId', optional: true)] - public ?string $fileID; + #[Api(optional: true)] + public ?string $fileId; /** * The relative path of the file in the media library e.g. `/marketing-assets/new-banner.jpg`. @@ -170,7 +170,7 @@ final class Data implements BaseModel * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @var array|null $selectedFieldsSchema + * @var array|null $selectedFieldsSchema */ #[Api(map: SelectedFieldsSchema::class, optional: true)] public ?array $selectedFieldsSchema; @@ -192,8 +192,8 @@ final class Data implements BaseModel /** * In the case of an image, a small thumbnail URL. */ - #[Api('thumbnailUrl', optional: true)] - public ?string $thumbnailURL; + #[Api(optional: true)] + public ?string $thumbnailUrl; /** * A publicly accessible URL of the file. @@ -229,14 +229,14 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list|null $aiTags - * @param array $customMetadata - * @param array $embeddedMetadata - * @param array $selectedFieldsSchema + * @param list|null $AITags + * @param array $customMetadata + * @param array $embeddedMetadata + * @param array $selectedFieldsSchema * @param list|null $tags */ public static function with( - ?array $aiTags = null, + ?array $AITags = null, ?string $audioCodec = null, ?int $bitRate = null, ?string $customCoordinates = null, @@ -245,7 +245,7 @@ public static function with( ?int $duration = null, ?array $embeddedMetadata = null, ?ExtensionStatus $extensionStatus = null, - ?string $fileID = null, + ?string $fileId = null, ?string $filePath = null, ?string $fileType = null, ?float $height = null, @@ -256,7 +256,7 @@ public static function with( ?array $selectedFieldsSchema = null, ?float $size = null, ?array $tags = null, - ?string $thumbnailURL = null, + ?string $thumbnailUrl = null, ?string $url = null, ?VersionInfo $versionInfo = null, ?string $videoCodec = null, @@ -264,7 +264,7 @@ public static function with( ): self { $obj = new self; - null !== $aiTags && $obj->aiTags = $aiTags; + null !== $AITags && $obj->AITags = $AITags; null !== $audioCodec && $obj->audioCodec = $audioCodec; null !== $bitRate && $obj->bitRate = $bitRate; null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; @@ -273,7 +273,7 @@ public static function with( null !== $duration && $obj->duration = $duration; null !== $embeddedMetadata && $obj->embeddedMetadata = $embeddedMetadata; null !== $extensionStatus && $obj->extensionStatus = $extensionStatus; - null !== $fileID && $obj->fileID = $fileID; + null !== $fileId && $obj->fileId = $fileId; null !== $filePath && $obj->filePath = $filePath; null !== $fileType && $obj->fileType = $fileType; null !== $height && $obj->height = $height; @@ -284,7 +284,7 @@ public static function with( null !== $selectedFieldsSchema && $obj->selectedFieldsSchema = $selectedFieldsSchema; null !== $size && $obj->size = $size; null !== $tags && $obj->tags = $tags; - null !== $thumbnailURL && $obj->thumbnailURL = $thumbnailURL; + null !== $thumbnailUrl && $obj->thumbnailUrl = $thumbnailUrl; null !== $url && $obj->url = $url; null !== $versionInfo && $obj->versionInfo = $versionInfo; null !== $videoCodec && $obj->videoCodec = $videoCodec; @@ -301,7 +301,7 @@ public static function with( public function withAITags(?array $aiTags): self { $obj = clone $this; - $obj->aiTags = $aiTags; + $obj->AITags = $aiTags; return $obj; } @@ -342,7 +342,7 @@ public function withCustomCoordinates(?string $customCoordinates): self /** * A key-value data associated with the asset. Use `responseField` in API request to get `customMetadata` in the upload API response. Before setting any custom metadata on an asset, you have to create the field using custom metadata fields API. Send `customMetadata` in `responseFields` in API request to get the value of this field. * - * @param array $customMetadata + * @param array $customMetadata */ public function withCustomMetadata(array $customMetadata): self { @@ -377,7 +377,7 @@ public function withDuration(int $duration): self /** * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. Send `embeddedMetadata` in `responseFields` in API request to get embeddedMetadata in the upload API response. * - * @param array $embeddedMetadata + * @param array $embeddedMetadata */ public function withEmbeddedMetadata(array $embeddedMetadata): self { @@ -410,7 +410,7 @@ public function withExtensionStatus(ExtensionStatus $extensionStatus): self public function withFileID(string $fileID): self { $obj = clone $this; - $obj->fileID = $fileID; + $obj->fileId = $fileID; return $obj; } @@ -499,7 +499,7 @@ public function withName(string $name): self * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @param array $selectedFieldsSchema + * @param array $selectedFieldsSchema */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { @@ -539,7 +539,7 @@ public function withTags(?array $tags): self public function withThumbnailURL(string $thumbnailURL): self { $obj = clone $this; - $obj->thumbnailURL = $thumbnailURL; + $obj->thumbnailUrl = $thumbnailURL; return $obj; } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php index 428704a5..468bd05a 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php @@ -10,7 +10,7 @@ /** * @phpstan-type AITagShape = array{ - * confidence?: float, name?: string, source?: string + * confidence?: float|null, name?: string|null, source?: string|null * } */ final class AITag implements BaseModel diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php index 25cb2506..ce98cf73 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php @@ -22,10 +22,10 @@ * If no extension was requested, then this parameter is not returned. * * @phpstan-type ExtensionStatusShape = array{ - * aiAutoDescription?: value-of, - * awsAutoTagging?: value-of, - * googleAutoTagging?: value-of, - * removeBg?: value-of, + * ai_auto_description?: value-of|null, + * aws_auto_tagging?: value-of|null, + * google_auto_tagging?: value-of|null, + * remove_bg?: value-of|null, * } */ final class ExtensionStatus implements BaseModel @@ -33,21 +33,21 @@ final class ExtensionStatus implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var value-of|null $aiAutoDescription */ + /** @var value-of|null $ai_auto_description */ #[Api('ai-auto-description', enum: AIAutoDescription::class, optional: true)] - public ?string $aiAutoDescription; + public ?string $ai_auto_description; - /** @var value-of|null $awsAutoTagging */ + /** @var value-of|null $aws_auto_tagging */ #[Api('aws-auto-tagging', enum: AwsAutoTagging::class, optional: true)] - public ?string $awsAutoTagging; + public ?string $aws_auto_tagging; - /** @var value-of|null $googleAutoTagging */ + /** @var value-of|null $google_auto_tagging */ #[Api('google-auto-tagging', enum: GoogleAutoTagging::class, optional: true)] - public ?string $googleAutoTagging; + public ?string $google_auto_tagging; - /** @var value-of|null $removeBg */ + /** @var value-of|null $remove_bg */ #[Api('remove-bg', enum: RemoveBg::class, optional: true)] - public ?string $removeBg; + public ?string $remove_bg; public function __construct() { @@ -59,23 +59,23 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AIAutoDescription|value-of $aiAutoDescription - * @param AwsAutoTagging|value-of $awsAutoTagging - * @param GoogleAutoTagging|value-of $googleAutoTagging - * @param RemoveBg|value-of $removeBg + * @param AIAutoDescription|value-of $ai_auto_description + * @param AwsAutoTagging|value-of $aws_auto_tagging + * @param GoogleAutoTagging|value-of $google_auto_tagging + * @param RemoveBg|value-of $remove_bg */ public static function with( - AIAutoDescription|string|null $aiAutoDescription = null, - AwsAutoTagging|string|null $awsAutoTagging = null, - GoogleAutoTagging|string|null $googleAutoTagging = null, - RemoveBg|string|null $removeBg = null, + AIAutoDescription|string|null $ai_auto_description = null, + AwsAutoTagging|string|null $aws_auto_tagging = null, + GoogleAutoTagging|string|null $google_auto_tagging = null, + RemoveBg|string|null $remove_bg = null, ): self { $obj = new self; - null !== $aiAutoDescription && $obj['aiAutoDescription'] = $aiAutoDescription; - null !== $awsAutoTagging && $obj['awsAutoTagging'] = $awsAutoTagging; - null !== $googleAutoTagging && $obj['googleAutoTagging'] = $googleAutoTagging; - null !== $removeBg && $obj['removeBg'] = $removeBg; + null !== $ai_auto_description && $obj['ai_auto_description'] = $ai_auto_description; + null !== $aws_auto_tagging && $obj['aws_auto_tagging'] = $aws_auto_tagging; + null !== $google_auto_tagging && $obj['google_auto_tagging'] = $google_auto_tagging; + null !== $remove_bg && $obj['remove_bg'] = $remove_bg; return $obj; } @@ -87,7 +87,7 @@ public function withAIAutoDescription( AIAutoDescription|string $aiAutoDescription ): self { $obj = clone $this; - $obj['aiAutoDescription'] = $aiAutoDescription; + $obj['ai_auto_description'] = $aiAutoDescription; return $obj; } @@ -99,7 +99,7 @@ public function withAwsAutoTagging( AwsAutoTagging|string $awsAutoTagging ): self { $obj = clone $this; - $obj['awsAutoTagging'] = $awsAutoTagging; + $obj['aws_auto_tagging'] = $awsAutoTagging; return $obj; } @@ -111,7 +111,7 @@ public function withGoogleAutoTagging( GoogleAutoTagging|string $googleAutoTagging ): self { $obj = clone $this; - $obj['googleAutoTagging'] = $googleAutoTagging; + $obj['google_auto_tagging'] = $googleAutoTagging; return $obj; } @@ -122,7 +122,7 @@ public function withGoogleAutoTagging( public function withRemoveBg(RemoveBg|string $removeBg): self { $obj = clone $this; - $obj['removeBg'] = $removeBg; + $obj['remove_bg'] = $removeBg; return $obj; } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php index 4d970ad3..2f8ff342 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php @@ -14,15 +14,15 @@ /** * @phpstan-type SelectedFieldsSchemaShape = array{ * type: value-of, - * defaultValue?: string|float|bool|list, - * isValueRequired?: bool, - * maxLength?: float, - * maxValue?: string|float, - * minLength?: float, - * minValue?: string|float, - * readOnly?: bool, - * selectOptions?: list, - * selectOptionsTruncated?: bool, + * defaultValue?: string|float|bool|null|list, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * readOnly?: bool|null, + * selectOptions?: list|null, + * selectOptionsTruncated?: bool|null, * } */ final class SelectedFieldsSchema implements BaseModel diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php index cf57b170..f43a1c4e 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php @@ -18,8 +18,7 @@ final class DefaultValue implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed.php index c44ff303..7af55194 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed.php @@ -13,8 +13,7 @@ final class Mixed implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MaxValue.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MaxValue.php index 0740dc6b..b33f49ef 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MaxValue.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MaxValue.php @@ -16,8 +16,7 @@ final class MaxValue implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MinValue.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MinValue.php index 8e9787ed..4e731680 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MinValue.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MinValue.php @@ -16,8 +16,7 @@ final class MinValue implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/SelectOption.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/SelectOption.php index 020147ca..404f3617 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/SelectOption.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/SelectOption.php @@ -13,8 +13,7 @@ final class SelectOption implements ConverterSource use SdkUnion; /** - * @return list|array + * @return list|array */ public static function variants(): array { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php index 4fc58454..19e7eb8d 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php @@ -11,7 +11,7 @@ /** * An object containing the file or file version's `id` (versionId) and `name`. * - * @phpstan-type VersionInfoShape = array{id?: string, name?: string} + * @phpstan-type VersionInfoShape = array{id?: string|null, name?: string|null} */ final class VersionInfo implements BaseModel { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Request.php b/src/Webhooks/UploadPreTransformSuccessEvent/Request.php index 0f3404b2..361eba75 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Request.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Request.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type RequestShape = array{transformation: string, xRequestID: string} + * @phpstan-type RequestShape = array{transformation: string, x_request_id: string} */ final class Request implements BaseModel { @@ -25,15 +25,15 @@ final class Request implements BaseModel /** * Unique identifier for the originating request. */ - #[Api('x_request_id')] - public string $xRequestID; + #[Api] + public string $x_request_id; /** * `new Request()` is missing required properties by the API. * * To enforce required parameters use * ``` - * Request::with(transformation: ..., xRequestID: ...) + * Request::with(transformation: ..., x_request_id: ...) * ``` * * Otherwise ensure the following setters are called @@ -54,12 +54,12 @@ public function __construct() */ public static function with( string $transformation, - string $xRequestID + string $x_request_id ): self { $obj = new self; $obj->transformation = $transformation; - $obj->xRequestID = $xRequestID; + $obj->x_request_id = $x_request_id; return $obj; } @@ -81,7 +81,7 @@ public function withTransformation(string $transformation): self public function withXRequestID(string $xRequestID): self { $obj = clone $this; - $obj->xRequestID = $xRequestID; + $obj->x_request_id = $xRequestID; return $obj; } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent.php b/src/Webhooks/VideoTransformationAcceptedEvent.php index 725574f9..6a98dd23 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent.php @@ -16,7 +16,7 @@ * @phpstan-type VideoTransformationAcceptedEventShape = array{ * id: string, * type: string, - * createdAt: \DateTimeInterface, + * created_at: \DateTimeInterface, * data: Data, * request: Request, * } @@ -41,8 +41,8 @@ final class VideoTransformationAcceptedEvent implements BaseModel /** * Timestamp when the event was created in ISO8601 format. */ - #[Api('created_at')] - public \DateTimeInterface $createdAt; + #[Api] + public \DateTimeInterface $created_at; #[Api] public Data $data; @@ -59,7 +59,7 @@ final class VideoTransformationAcceptedEvent implements BaseModel * To enforce required parameters use * ``` * VideoTransformationAcceptedEvent::with( - * id: ..., type: ..., createdAt: ..., data: ..., request: ... + * id: ..., type: ..., created_at: ..., data: ..., request: ... * ) * ``` * @@ -87,7 +87,7 @@ public function __construct() public static function with( string $id, string $type, - \DateTimeInterface $createdAt, + \DateTimeInterface $created_at, Data $data, Request $request, ): self { @@ -95,7 +95,7 @@ public static function with( $obj->id = $id; $obj->type = $type; - $obj->createdAt = $createdAt; + $obj->created_at = $created_at; $obj->data = $data; $obj->request = $request; @@ -130,7 +130,7 @@ public function withType(string $type): self public function withCreatedAt(\DateTimeInterface $createdAt): self { $obj = clone $this; - $obj->createdAt = $createdAt; + $obj->created_at = $createdAt; return $obj; } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php index 8b4a2d1e..bb8416b1 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php @@ -14,7 +14,7 @@ * Base information about a video transformation request. * * @phpstan-type TransformationShape = array{ - * type: value-of, options?: Options + * type: value-of, options?: Options|null * } */ final class Transformation implements BaseModel diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php index 4a982e93..801fc0b8 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php @@ -16,13 +16,13 @@ * Configuration options for video transformations. * * @phpstan-type OptionsShape = array{ - * audioCodec?: value-of, - * autoRotate?: bool, - * format?: value-of, - * quality?: int, - * streamProtocol?: value-of, - * variants?: list, - * videoCodec?: value-of, + * audio_codec?: value-of|null, + * auto_rotate?: bool|null, + * format?: value-of|null, + * quality?: int|null, + * stream_protocol?: value-of|null, + * variants?: list|null, + * video_codec?: value-of|null, * } */ final class Options implements BaseModel @@ -33,16 +33,16 @@ final class Options implements BaseModel /** * Audio codec used for encoding (aac or opus). * - * @var value-of|null $audioCodec + * @var value-of|null $audio_codec */ - #[Api('audio_codec', enum: AudioCodec::class, optional: true)] - public ?string $audioCodec; + #[Api(enum: AudioCodec::class, optional: true)] + public ?string $audio_codec; /** * Whether to automatically rotate the video based on metadata. */ - #[Api('auto_rotate', optional: true)] - public ?bool $autoRotate; + #[Api(optional: true)] + public ?bool $auto_rotate; /** * Output format for the transformed video or thumbnail. @@ -61,10 +61,10 @@ final class Options implements BaseModel /** * Streaming protocol for adaptive bitrate streaming. * - * @var value-of|null $streamProtocol + * @var value-of|null $stream_protocol */ - #[Api('stream_protocol', enum: StreamProtocol::class, optional: true)] - public ?string $streamProtocol; + #[Api(enum: StreamProtocol::class, optional: true)] + public ?string $stream_protocol; /** * Array of quality representations for adaptive bitrate streaming. @@ -77,10 +77,10 @@ final class Options implements BaseModel /** * Video codec used for encoding (h264, vp9, or av1). * - * @var value-of|null $videoCodec + * @var value-of|null $video_codec */ - #[Api('video_codec', enum: VideoCodec::class, optional: true)] - public ?string $videoCodec; + #[Api(enum: VideoCodec::class, optional: true)] + public ?string $video_codec; public function __construct() { @@ -92,30 +92,30 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AudioCodec|value-of $audioCodec + * @param AudioCodec|value-of $audio_codec * @param Format|value-of $format - * @param StreamProtocol|value-of $streamProtocol + * @param StreamProtocol|value-of $stream_protocol * @param list $variants - * @param VideoCodec|value-of $videoCodec + * @param VideoCodec|value-of $video_codec */ public static function with( - AudioCodec|string|null $audioCodec = null, - ?bool $autoRotate = null, + AudioCodec|string|null $audio_codec = null, + ?bool $auto_rotate = null, Format|string|null $format = null, ?int $quality = null, - StreamProtocol|string|null $streamProtocol = null, + StreamProtocol|string|null $stream_protocol = null, ?array $variants = null, - VideoCodec|string|null $videoCodec = null, + VideoCodec|string|null $video_codec = null, ): self { $obj = new self; - null !== $audioCodec && $obj['audioCodec'] = $audioCodec; - null !== $autoRotate && $obj->autoRotate = $autoRotate; + null !== $audio_codec && $obj['audio_codec'] = $audio_codec; + null !== $auto_rotate && $obj->auto_rotate = $auto_rotate; null !== $format && $obj['format'] = $format; null !== $quality && $obj->quality = $quality; - null !== $streamProtocol && $obj['streamProtocol'] = $streamProtocol; + null !== $stream_protocol && $obj['stream_protocol'] = $stream_protocol; null !== $variants && $obj->variants = $variants; - null !== $videoCodec && $obj['videoCodec'] = $videoCodec; + null !== $video_codec && $obj['video_codec'] = $video_codec; return $obj; } @@ -128,7 +128,7 @@ public static function with( public function withAudioCodec(AudioCodec|string $audioCodec): self { $obj = clone $this; - $obj['audioCodec'] = $audioCodec; + $obj['audio_codec'] = $audioCodec; return $obj; } @@ -139,7 +139,7 @@ public function withAudioCodec(AudioCodec|string $audioCodec): self public function withAutoRotate(bool $autoRotate): self { $obj = clone $this; - $obj->autoRotate = $autoRotate; + $obj->auto_rotate = $autoRotate; return $obj; } @@ -177,7 +177,7 @@ public function withStreamProtocol( StreamProtocol|string $streamProtocol ): self { $obj = clone $this; - $obj['streamProtocol'] = $streamProtocol; + $obj['stream_protocol'] = $streamProtocol; return $obj; } @@ -203,7 +203,7 @@ public function withVariants(array $variants): self public function withVideoCodec(VideoCodec|string $videoCodec): self { $obj = clone $this; - $obj['videoCodec'] = $videoCodec; + $obj['video_codec'] = $videoCodec; return $obj; } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Request.php b/src/Webhooks/VideoTransformationAcceptedEvent/Request.php index f8e2a238..d9696715 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Request.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Request.php @@ -12,7 +12,7 @@ * Information about the original request that triggered the video transformation. * * @phpstan-type RequestShape = array{ - * url: string, xRequestID: string, userAgent?: string + * url: string, x_request_id: string, user_agent?: string|null * } */ final class Request implements BaseModel @@ -29,21 +29,21 @@ final class Request implements BaseModel /** * Unique identifier for the originating transformation request. */ - #[Api('x_request_id')] - public string $xRequestID; + #[Api] + public string $x_request_id; /** * User-Agent header from the original request that triggered the transformation. */ - #[Api('user_agent', optional: true)] - public ?string $userAgent; + #[Api(optional: true)] + public ?string $user_agent; /** * `new Request()` is missing required properties by the API. * * To enforce required parameters use * ``` - * Request::with(url: ..., xRequestID: ...) + * Request::with(url: ..., x_request_id: ...) * ``` * * Otherwise ensure the following setters are called @@ -64,15 +64,15 @@ public function __construct() */ public static function with( string $url, - string $xRequestID, - ?string $userAgent = null + string $x_request_id, + ?string $user_agent = null ): self { $obj = new self; $obj->url = $url; - $obj->xRequestID = $xRequestID; + $obj->x_request_id = $x_request_id; - null !== $userAgent && $obj->userAgent = $userAgent; + null !== $user_agent && $obj->user_agent = $user_agent; return $obj; } @@ -94,7 +94,7 @@ public function withURL(string $url): self public function withXRequestID(string $xRequestID): self { $obj = clone $this; - $obj->xRequestID = $xRequestID; + $obj->x_request_id = $xRequestID; return $obj; } @@ -105,7 +105,7 @@ public function withXRequestID(string $xRequestID): self public function withUserAgent(string $userAgent): self { $obj = clone $this; - $obj->userAgent = $userAgent; + $obj->user_agent = $userAgent; return $obj; } diff --git a/src/Webhooks/VideoTransformationErrorEvent.php b/src/Webhooks/VideoTransformationErrorEvent.php index b1a4934f..2ed0417d 100644 --- a/src/Webhooks/VideoTransformationErrorEvent.php +++ b/src/Webhooks/VideoTransformationErrorEvent.php @@ -16,7 +16,7 @@ * @phpstan-type VideoTransformationErrorEventShape = array{ * id: string, * type: string, - * createdAt: \DateTimeInterface, + * created_at: \DateTimeInterface, * data: Data, * request: Request, * } @@ -41,8 +41,8 @@ final class VideoTransformationErrorEvent implements BaseModel /** * Timestamp when the event was created in ISO8601 format. */ - #[Api('created_at')] - public \DateTimeInterface $createdAt; + #[Api] + public \DateTimeInterface $created_at; #[Api] public Data $data; @@ -59,7 +59,7 @@ final class VideoTransformationErrorEvent implements BaseModel * To enforce required parameters use * ``` * VideoTransformationErrorEvent::with( - * id: ..., type: ..., createdAt: ..., data: ..., request: ... + * id: ..., type: ..., created_at: ..., data: ..., request: ... * ) * ``` * @@ -87,7 +87,7 @@ public function __construct() public static function with( string $id, string $type, - \DateTimeInterface $createdAt, + \DateTimeInterface $created_at, Data $data, Request $request, ): self { @@ -95,7 +95,7 @@ public static function with( $obj->id = $id; $obj->type = $type; - $obj->createdAt = $createdAt; + $obj->created_at = $created_at; $obj->data = $data; $obj->request = $request; @@ -130,7 +130,7 @@ public function withType(string $type): self public function withCreatedAt(\DateTimeInterface $createdAt): self { $obj = clone $this; - $obj->createdAt = $createdAt; + $obj->created_at = $createdAt; return $obj; } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php index 97e70b5f..dde3e2ed 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php @@ -13,7 +13,7 @@ /** * @phpstan-type TransformationShape = array{ - * type: value-of, error?: Error, options?: Options + * type: value-of, error?: Error|null, options?: Options|null * } */ final class Transformation implements BaseModel diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php index f2621301..0ea8da25 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php @@ -16,13 +16,13 @@ * Configuration options for video transformations. * * @phpstan-type OptionsShape = array{ - * audioCodec?: value-of, - * autoRotate?: bool, - * format?: value-of, - * quality?: int, - * streamProtocol?: value-of, - * variants?: list, - * videoCodec?: value-of, + * audio_codec?: value-of|null, + * auto_rotate?: bool|null, + * format?: value-of|null, + * quality?: int|null, + * stream_protocol?: value-of|null, + * variants?: list|null, + * video_codec?: value-of|null, * } */ final class Options implements BaseModel @@ -33,16 +33,16 @@ final class Options implements BaseModel /** * Audio codec used for encoding (aac or opus). * - * @var value-of|null $audioCodec + * @var value-of|null $audio_codec */ - #[Api('audio_codec', enum: AudioCodec::class, optional: true)] - public ?string $audioCodec; + #[Api(enum: AudioCodec::class, optional: true)] + public ?string $audio_codec; /** * Whether to automatically rotate the video based on metadata. */ - #[Api('auto_rotate', optional: true)] - public ?bool $autoRotate; + #[Api(optional: true)] + public ?bool $auto_rotate; /** * Output format for the transformed video or thumbnail. @@ -61,10 +61,10 @@ final class Options implements BaseModel /** * Streaming protocol for adaptive bitrate streaming. * - * @var value-of|null $streamProtocol + * @var value-of|null $stream_protocol */ - #[Api('stream_protocol', enum: StreamProtocol::class, optional: true)] - public ?string $streamProtocol; + #[Api(enum: StreamProtocol::class, optional: true)] + public ?string $stream_protocol; /** * Array of quality representations for adaptive bitrate streaming. @@ -77,10 +77,10 @@ final class Options implements BaseModel /** * Video codec used for encoding (h264, vp9, or av1). * - * @var value-of|null $videoCodec + * @var value-of|null $video_codec */ - #[Api('video_codec', enum: VideoCodec::class, optional: true)] - public ?string $videoCodec; + #[Api(enum: VideoCodec::class, optional: true)] + public ?string $video_codec; public function __construct() { @@ -92,30 +92,30 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AudioCodec|value-of $audioCodec + * @param AudioCodec|value-of $audio_codec * @param Format|value-of $format - * @param StreamProtocol|value-of $streamProtocol + * @param StreamProtocol|value-of $stream_protocol * @param list $variants - * @param VideoCodec|value-of $videoCodec + * @param VideoCodec|value-of $video_codec */ public static function with( - AudioCodec|string|null $audioCodec = null, - ?bool $autoRotate = null, + AudioCodec|string|null $audio_codec = null, + ?bool $auto_rotate = null, Format|string|null $format = null, ?int $quality = null, - StreamProtocol|string|null $streamProtocol = null, + StreamProtocol|string|null $stream_protocol = null, ?array $variants = null, - VideoCodec|string|null $videoCodec = null, + VideoCodec|string|null $video_codec = null, ): self { $obj = new self; - null !== $audioCodec && $obj['audioCodec'] = $audioCodec; - null !== $autoRotate && $obj->autoRotate = $autoRotate; + null !== $audio_codec && $obj['audio_codec'] = $audio_codec; + null !== $auto_rotate && $obj->auto_rotate = $auto_rotate; null !== $format && $obj['format'] = $format; null !== $quality && $obj->quality = $quality; - null !== $streamProtocol && $obj['streamProtocol'] = $streamProtocol; + null !== $stream_protocol && $obj['stream_protocol'] = $stream_protocol; null !== $variants && $obj->variants = $variants; - null !== $videoCodec && $obj['videoCodec'] = $videoCodec; + null !== $video_codec && $obj['video_codec'] = $video_codec; return $obj; } @@ -128,7 +128,7 @@ public static function with( public function withAudioCodec(AudioCodec|string $audioCodec): self { $obj = clone $this; - $obj['audioCodec'] = $audioCodec; + $obj['audio_codec'] = $audioCodec; return $obj; } @@ -139,7 +139,7 @@ public function withAudioCodec(AudioCodec|string $audioCodec): self public function withAutoRotate(bool $autoRotate): self { $obj = clone $this; - $obj->autoRotate = $autoRotate; + $obj->auto_rotate = $autoRotate; return $obj; } @@ -177,7 +177,7 @@ public function withStreamProtocol( StreamProtocol|string $streamProtocol ): self { $obj = clone $this; - $obj['streamProtocol'] = $streamProtocol; + $obj['stream_protocol'] = $streamProtocol; return $obj; } @@ -203,7 +203,7 @@ public function withVariants(array $variants): self public function withVideoCodec(VideoCodec|string $videoCodec): self { $obj = clone $this; - $obj['videoCodec'] = $videoCodec; + $obj['video_codec'] = $videoCodec; return $obj; } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Request.php b/src/Webhooks/VideoTransformationErrorEvent/Request.php index 9a4d9fdd..7ab351ab 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Request.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Request.php @@ -12,7 +12,7 @@ * Information about the original request that triggered the video transformation. * * @phpstan-type RequestShape = array{ - * url: string, xRequestID: string, userAgent?: string + * url: string, x_request_id: string, user_agent?: string|null * } */ final class Request implements BaseModel @@ -29,21 +29,21 @@ final class Request implements BaseModel /** * Unique identifier for the originating transformation request. */ - #[Api('x_request_id')] - public string $xRequestID; + #[Api] + public string $x_request_id; /** * User-Agent header from the original request that triggered the transformation. */ - #[Api('user_agent', optional: true)] - public ?string $userAgent; + #[Api(optional: true)] + public ?string $user_agent; /** * `new Request()` is missing required properties by the API. * * To enforce required parameters use * ``` - * Request::with(url: ..., xRequestID: ...) + * Request::with(url: ..., x_request_id: ...) * ``` * * Otherwise ensure the following setters are called @@ -64,15 +64,15 @@ public function __construct() */ public static function with( string $url, - string $xRequestID, - ?string $userAgent = null + string $x_request_id, + ?string $user_agent = null ): self { $obj = new self; $obj->url = $url; - $obj->xRequestID = $xRequestID; + $obj->x_request_id = $x_request_id; - null !== $userAgent && $obj->userAgent = $userAgent; + null !== $user_agent && $obj->user_agent = $user_agent; return $obj; } @@ -94,7 +94,7 @@ public function withURL(string $url): self public function withXRequestID(string $xRequestID): self { $obj = clone $this; - $obj->xRequestID = $xRequestID; + $obj->x_request_id = $xRequestID; return $obj; } @@ -105,7 +105,7 @@ public function withXRequestID(string $xRequestID): self public function withUserAgent(string $userAgent): self { $obj = clone $this; - $obj->userAgent = $userAgent; + $obj->user_agent = $userAgent; return $obj; } diff --git a/src/Webhooks/VideoTransformationReadyEvent.php b/src/Webhooks/VideoTransformationReadyEvent.php index 4a1cf3c0..bb25ce23 100644 --- a/src/Webhooks/VideoTransformationReadyEvent.php +++ b/src/Webhooks/VideoTransformationReadyEvent.php @@ -17,10 +17,10 @@ * @phpstan-type VideoTransformationReadyEventShape = array{ * id: string, * type: string, - * createdAt: \DateTimeInterface, + * created_at: \DateTimeInterface, * data: Data, * request: Request, - * timings?: Timings, + * timings?: Timings|null, * } */ final class VideoTransformationReadyEvent implements BaseModel @@ -43,8 +43,8 @@ final class VideoTransformationReadyEvent implements BaseModel /** * Timestamp when the event was created in ISO8601 format. */ - #[Api('created_at')] - public \DateTimeInterface $createdAt; + #[Api] + public \DateTimeInterface $created_at; #[Api] public Data $data; @@ -67,7 +67,7 @@ final class VideoTransformationReadyEvent implements BaseModel * To enforce required parameters use * ``` * VideoTransformationReadyEvent::with( - * id: ..., type: ..., createdAt: ..., data: ..., request: ... + * id: ..., type: ..., created_at: ..., data: ..., request: ... * ) * ``` * @@ -95,7 +95,7 @@ public function __construct() public static function with( string $id, string $type, - \DateTimeInterface $createdAt, + \DateTimeInterface $created_at, Data $data, Request $request, ?Timings $timings = null, @@ -104,7 +104,7 @@ public static function with( $obj->id = $id; $obj->type = $type; - $obj->createdAt = $createdAt; + $obj->created_at = $created_at; $obj->data = $data; $obj->request = $request; @@ -141,7 +141,7 @@ public function withType(string $type): self public function withCreatedAt(\DateTimeInterface $createdAt): self { $obj = clone $this; - $obj->createdAt = $createdAt; + $obj->created_at = $createdAt; return $obj; } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php index 63e007a7..9543c91d 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php @@ -13,7 +13,7 @@ /** * @phpstan-type TransformationShape = array{ - * type: value-of, options?: Options, output?: Output + * type: value-of, options?: Options|null, output?: Output|null * } */ final class Transformation implements BaseModel diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php index 70116837..72e7fd47 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php @@ -16,13 +16,13 @@ * Configuration options for video transformations. * * @phpstan-type OptionsShape = array{ - * audioCodec?: value-of, - * autoRotate?: bool, - * format?: value-of, - * quality?: int, - * streamProtocol?: value-of, - * variants?: list, - * videoCodec?: value-of, + * audio_codec?: value-of|null, + * auto_rotate?: bool|null, + * format?: value-of|null, + * quality?: int|null, + * stream_protocol?: value-of|null, + * variants?: list|null, + * video_codec?: value-of|null, * } */ final class Options implements BaseModel @@ -33,16 +33,16 @@ final class Options implements BaseModel /** * Audio codec used for encoding (aac or opus). * - * @var value-of|null $audioCodec + * @var value-of|null $audio_codec */ - #[Api('audio_codec', enum: AudioCodec::class, optional: true)] - public ?string $audioCodec; + #[Api(enum: AudioCodec::class, optional: true)] + public ?string $audio_codec; /** * Whether to automatically rotate the video based on metadata. */ - #[Api('auto_rotate', optional: true)] - public ?bool $autoRotate; + #[Api(optional: true)] + public ?bool $auto_rotate; /** * Output format for the transformed video or thumbnail. @@ -61,10 +61,10 @@ final class Options implements BaseModel /** * Streaming protocol for adaptive bitrate streaming. * - * @var value-of|null $streamProtocol + * @var value-of|null $stream_protocol */ - #[Api('stream_protocol', enum: StreamProtocol::class, optional: true)] - public ?string $streamProtocol; + #[Api(enum: StreamProtocol::class, optional: true)] + public ?string $stream_protocol; /** * Array of quality representations for adaptive bitrate streaming. @@ -77,10 +77,10 @@ final class Options implements BaseModel /** * Video codec used for encoding (h264, vp9, or av1). * - * @var value-of|null $videoCodec + * @var value-of|null $video_codec */ - #[Api('video_codec', enum: VideoCodec::class, optional: true)] - public ?string $videoCodec; + #[Api(enum: VideoCodec::class, optional: true)] + public ?string $video_codec; public function __construct() { @@ -92,30 +92,30 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AudioCodec|value-of $audioCodec + * @param AudioCodec|value-of $audio_codec * @param Format|value-of $format - * @param StreamProtocol|value-of $streamProtocol + * @param StreamProtocol|value-of $stream_protocol * @param list $variants - * @param VideoCodec|value-of $videoCodec + * @param VideoCodec|value-of $video_codec */ public static function with( - AudioCodec|string|null $audioCodec = null, - ?bool $autoRotate = null, + AudioCodec|string|null $audio_codec = null, + ?bool $auto_rotate = null, Format|string|null $format = null, ?int $quality = null, - StreamProtocol|string|null $streamProtocol = null, + StreamProtocol|string|null $stream_protocol = null, ?array $variants = null, - VideoCodec|string|null $videoCodec = null, + VideoCodec|string|null $video_codec = null, ): self { $obj = new self; - null !== $audioCodec && $obj['audioCodec'] = $audioCodec; - null !== $autoRotate && $obj->autoRotate = $autoRotate; + null !== $audio_codec && $obj['audio_codec'] = $audio_codec; + null !== $auto_rotate && $obj->auto_rotate = $auto_rotate; null !== $format && $obj['format'] = $format; null !== $quality && $obj->quality = $quality; - null !== $streamProtocol && $obj['streamProtocol'] = $streamProtocol; + null !== $stream_protocol && $obj['stream_protocol'] = $stream_protocol; null !== $variants && $obj->variants = $variants; - null !== $videoCodec && $obj['videoCodec'] = $videoCodec; + null !== $video_codec && $obj['video_codec'] = $video_codec; return $obj; } @@ -128,7 +128,7 @@ public static function with( public function withAudioCodec(AudioCodec|string $audioCodec): self { $obj = clone $this; - $obj['audioCodec'] = $audioCodec; + $obj['audio_codec'] = $audioCodec; return $obj; } @@ -139,7 +139,7 @@ public function withAudioCodec(AudioCodec|string $audioCodec): self public function withAutoRotate(bool $autoRotate): self { $obj = clone $this; - $obj->autoRotate = $autoRotate; + $obj->auto_rotate = $autoRotate; return $obj; } @@ -177,7 +177,7 @@ public function withStreamProtocol( StreamProtocol|string $streamProtocol ): self { $obj = clone $this; - $obj['streamProtocol'] = $streamProtocol; + $obj['stream_protocol'] = $streamProtocol; return $obj; } @@ -203,7 +203,7 @@ public function withVariants(array $variants): self public function withVideoCodec(VideoCodec|string $videoCodec): self { $obj = clone $this; - $obj['videoCodec'] = $videoCodec; + $obj['video_codec'] = $videoCodec; return $obj; } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php index 4c58dcd2..da660504 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php @@ -12,7 +12,9 @@ /** * Information about the transformed output video. * - * @phpstan-type OutputShape = array{url: string, videoMetadata?: VideoMetadata} + * @phpstan-type OutputShape = array{ + * url: string, video_metadata?: VideoMetadata|null + * } */ final class Output implements BaseModel { @@ -28,8 +30,8 @@ final class Output implements BaseModel /** * Metadata of the output video file. */ - #[Api('video_metadata', optional: true)] - public ?VideoMetadata $videoMetadata; + #[Api(optional: true)] + public ?VideoMetadata $video_metadata; /** * `new Output()` is missing required properties by the API. @@ -57,13 +59,13 @@ public function __construct() */ public static function with( string $url, - ?VideoMetadata $videoMetadata = null + ?VideoMetadata $video_metadata = null ): self { $obj = new self; $obj->url = $url; - null !== $videoMetadata && $obj->videoMetadata = $videoMetadata; + null !== $video_metadata && $obj->video_metadata = $video_metadata; return $obj; } @@ -85,7 +87,7 @@ public function withURL(string $url): self public function withVideoMetadata(VideoMetadata $videoMetadata): self { $obj = clone $this; - $obj->videoMetadata = $videoMetadata; + $obj->video_metadata = $videoMetadata; return $obj; } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Request.php b/src/Webhooks/VideoTransformationReadyEvent/Request.php index 1e9e0298..e7e636f1 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Request.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Request.php @@ -12,7 +12,7 @@ * Information about the original request that triggered the video transformation. * * @phpstan-type RequestShape = array{ - * url: string, xRequestID: string, userAgent?: string + * url: string, x_request_id: string, user_agent?: string|null * } */ final class Request implements BaseModel @@ -29,21 +29,21 @@ final class Request implements BaseModel /** * Unique identifier for the originating transformation request. */ - #[Api('x_request_id')] - public string $xRequestID; + #[Api] + public string $x_request_id; /** * User-Agent header from the original request that triggered the transformation. */ - #[Api('user_agent', optional: true)] - public ?string $userAgent; + #[Api(optional: true)] + public ?string $user_agent; /** * `new Request()` is missing required properties by the API. * * To enforce required parameters use * ``` - * Request::with(url: ..., xRequestID: ...) + * Request::with(url: ..., x_request_id: ...) * ``` * * Otherwise ensure the following setters are called @@ -64,15 +64,15 @@ public function __construct() */ public static function with( string $url, - string $xRequestID, - ?string $userAgent = null + string $x_request_id, + ?string $user_agent = null ): self { $obj = new self; $obj->url = $url; - $obj->xRequestID = $xRequestID; + $obj->x_request_id = $x_request_id; - null !== $userAgent && $obj->userAgent = $userAgent; + null !== $user_agent && $obj->user_agent = $user_agent; return $obj; } @@ -94,7 +94,7 @@ public function withURL(string $url): self public function withXRequestID(string $xRequestID): self { $obj = clone $this; - $obj->xRequestID = $xRequestID; + $obj->x_request_id = $xRequestID; return $obj; } @@ -105,7 +105,7 @@ public function withXRequestID(string $xRequestID): self public function withUserAgent(string $userAgent): self { $obj = clone $this; - $obj->userAgent = $userAgent; + $obj->user_agent = $userAgent; return $obj; } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Timings.php b/src/Webhooks/VideoTransformationReadyEvent/Timings.php index 5bde3218..400dceef 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Timings.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Timings.php @@ -12,7 +12,7 @@ * Performance metrics for the transformation process. * * @phpstan-type TimingsShape = array{ - * downloadDuration?: int, encodingDuration?: int + * download_duration?: int|null, encoding_duration?: int|null * } */ final class Timings implements BaseModel @@ -23,14 +23,14 @@ final class Timings implements BaseModel /** * Time spent downloading the source video from your origin or media library, in milliseconds. */ - #[Api('download_duration', optional: true)] - public ?int $downloadDuration; + #[Api(optional: true)] + public ?int $download_duration; /** * Time spent encoding the video, in milliseconds. */ - #[Api('encoding_duration', optional: true)] - public ?int $encodingDuration; + #[Api(optional: true)] + public ?int $encoding_duration; public function __construct() { @@ -43,13 +43,13 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - ?int $downloadDuration = null, - ?int $encodingDuration = null + ?int $download_duration = null, + ?int $encoding_duration = null ): self { $obj = new self; - null !== $downloadDuration && $obj->downloadDuration = $downloadDuration; - null !== $encodingDuration && $obj->encodingDuration = $encodingDuration; + null !== $download_duration && $obj->download_duration = $download_duration; + null !== $encoding_duration && $obj->encoding_duration = $encoding_duration; return $obj; } @@ -60,7 +60,7 @@ public static function with( public function withDownloadDuration(int $downloadDuration): self { $obj = clone $this; - $obj->downloadDuration = $downloadDuration; + $obj->download_duration = $downloadDuration; return $obj; } @@ -71,7 +71,7 @@ public function withDownloadDuration(int $downloadDuration): self public function withEncodingDuration(int $encodingDuration): self { $obj = clone $this; - $obj->encodingDuration = $encodingDuration; + $obj->encoding_duration = $encodingDuration; return $obj; } diff --git a/tests/Services/Accounts/OriginsTest.php b/tests/Services/Accounts/OriginsTest.php index e0110113..52dd4ec4 100644 --- a/tests/Services/Accounts/OriginsTest.php +++ b/tests/Services/Accounts/OriginsTest.php @@ -37,24 +37,24 @@ public function testCreate(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->accounts->origins->create( - accessKey: 'AKIAIOSFODNN7EXAMPLE', - bucket: 'gcs-media', - name: 'US S3 Storage', - secretKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', - type: 'AKENEO_PIM', - endpoint: 'https://s3.eu-central-1.wasabisys.com', - baseURL: 'https://akeneo.company.com', - clientEmail: 'service-account@project.iam.gserviceaccount.com', - privateKey: '-----BEGIN PRIVATE KEY-----\\nMIIEv...', - accountName: 'account123', - container: 'images', - sasToken: '?sv=2023-01-03&sr=c&sig=abc123', - clientID: 'akeneo-client-id', - clientSecret: 'akeneo-client-secret', - password: 'strongpassword123', - username: 'integration-user', - ); + $result = $this->client->accounts->origins->create([ + 'accessKey' => 'AKIAIOSFODNN7EXAMPLE', + 'bucket' => 'gcs-media', + 'name' => 'US S3 Storage', + 'secretKey' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', + 'type' => 'AKENEO_PIM', + 'endpoint' => 'https://s3.eu-central-1.wasabisys.com', + 'baseUrl' => 'https://akeneo.company.com', + 'clientEmail' => 'service-account@project.iam.gserviceaccount.com', + 'privateKey' => '-----BEGIN PRIVATE KEY-----\\nMIIEv...', + 'accountName' => 'account123', + 'container' => 'images', + 'sasToken' => '?sv=2023-01-03&sr=c&sig=abc123', + 'clientId' => 'akeneo-client-id', + 'clientSecret' => 'akeneo-client-secret', + 'password' => 'strongpassword123', + 'username' => 'integration-user', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -66,24 +66,24 @@ public function testCreateWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->accounts->origins->create( - accessKey: 'AKIAIOSFODNN7EXAMPLE', - bucket: 'gcs-media', - name: 'US S3 Storage', - secretKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', - type: 'AKENEO_PIM', - endpoint: 'https://s3.eu-central-1.wasabisys.com', - baseURL: 'https://akeneo.company.com', - clientEmail: 'service-account@project.iam.gserviceaccount.com', - privateKey: '-----BEGIN PRIVATE KEY-----\\nMIIEv...', - accountName: 'account123', - container: 'images', - sasToken: '?sv=2023-01-03&sr=c&sig=abc123', - clientID: 'akeneo-client-id', - clientSecret: 'akeneo-client-secret', - password: 'strongpassword123', - username: 'integration-user', - ); + $result = $this->client->accounts->origins->create([ + 'accessKey' => 'AKIAIOSFODNN7EXAMPLE', + 'bucket' => 'gcs-media', + 'name' => 'US S3 Storage', + 'secretKey' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', + 'type' => 'AKENEO_PIM', + 'endpoint' => 'https://s3.eu-central-1.wasabisys.com', + 'baseUrl' => 'https://akeneo.company.com', + 'clientEmail' => 'service-account@project.iam.gserviceaccount.com', + 'privateKey' => '-----BEGIN PRIVATE KEY-----\\nMIIEv...', + 'accountName' => 'account123', + 'container' => 'images', + 'sasToken' => '?sv=2023-01-03&sr=c&sig=abc123', + 'clientId' => 'akeneo-client-id', + 'clientSecret' => 'akeneo-client-secret', + 'password' => 'strongpassword123', + 'username' => 'integration-user', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -97,22 +97,24 @@ public function testUpdate(): void $result = $this->client->accounts->origins->update( 'id', - accessKey: 'AKIAIOSFODNN7EXAMPLE', - bucket: 'gcs-media', - name: 'US S3 Storage', - secretKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', - type: 'AKENEO_PIM', - endpoint: 'https://s3.eu-central-1.wasabisys.com', - baseURL: 'https://akeneo.company.com', - clientEmail: 'service-account@project.iam.gserviceaccount.com', - privateKey: '-----BEGIN PRIVATE KEY-----\\nMIIEv...', - accountName: 'account123', - container: 'images', - sasToken: '?sv=2023-01-03&sr=c&sig=abc123', - clientID: 'akeneo-client-id', - clientSecret: 'akeneo-client-secret', - password: 'strongpassword123', - username: 'integration-user', + [ + 'accessKey' => 'AKIAIOSFODNN7EXAMPLE', + 'bucket' => 'gcs-media', + 'name' => 'US S3 Storage', + 'secretKey' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', + 'type' => 'AKENEO_PIM', + 'endpoint' => 'https://s3.eu-central-1.wasabisys.com', + 'baseUrl' => 'https://akeneo.company.com', + 'clientEmail' => 'service-account@project.iam.gserviceaccount.com', + 'privateKey' => '-----BEGIN PRIVATE KEY-----\\nMIIEv...', + 'accountName' => 'account123', + 'container' => 'images', + 'sasToken' => '?sv=2023-01-03&sr=c&sig=abc123', + 'clientId' => 'akeneo-client-id', + 'clientSecret' => 'akeneo-client-secret', + 'password' => 'strongpassword123', + 'username' => 'integration-user', + ], ); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType @@ -127,22 +129,24 @@ public function testUpdateWithOptionalParams(): void $result = $this->client->accounts->origins->update( 'id', - accessKey: 'AKIAIOSFODNN7EXAMPLE', - bucket: 'gcs-media', - name: 'US S3 Storage', - secretKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', - type: 'AKENEO_PIM', - endpoint: 'https://s3.eu-central-1.wasabisys.com', - baseURL: 'https://akeneo.company.com', - clientEmail: 'service-account@project.iam.gserviceaccount.com', - privateKey: '-----BEGIN PRIVATE KEY-----\\nMIIEv...', - accountName: 'account123', - container: 'images', - sasToken: '?sv=2023-01-03&sr=c&sig=abc123', - clientID: 'akeneo-client-id', - clientSecret: 'akeneo-client-secret', - password: 'strongpassword123', - username: 'integration-user', + [ + 'accessKey' => 'AKIAIOSFODNN7EXAMPLE', + 'bucket' => 'gcs-media', + 'name' => 'US S3 Storage', + 'secretKey' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', + 'type' => 'AKENEO_PIM', + 'endpoint' => 'https://s3.eu-central-1.wasabisys.com', + 'baseUrl' => 'https://akeneo.company.com', + 'clientEmail' => 'service-account@project.iam.gserviceaccount.com', + 'privateKey' => '-----BEGIN PRIVATE KEY-----\\nMIIEv...', + 'accountName' => 'account123', + 'container' => 'images', + 'sasToken' => '?sv=2023-01-03&sr=c&sig=abc123', + 'clientId' => 'akeneo-client-id', + 'clientSecret' => 'akeneo-client-secret', + 'password' => 'strongpassword123', + 'username' => 'integration-user', + ], ); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType diff --git a/tests/Services/Accounts/URLEndpointsTest.php b/tests/Services/Accounts/URLEndpointsTest.php index f60887c7..afc49ad1 100644 --- a/tests/Services/Accounts/URLEndpointsTest.php +++ b/tests/Services/Accounts/URLEndpointsTest.php @@ -37,9 +37,9 @@ public function testCreate(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->accounts->urlEndpoints->create( - description: 'My custom URL endpoint' - ); + $result = $this->client->accounts->urlEndpoints->create([ + 'description' => 'My custom URL endpoint', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -51,9 +51,9 @@ public function testCreateWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->accounts->urlEndpoints->create( - description: 'My custom URL endpoint' - ); + $result = $this->client->accounts->urlEndpoints->create([ + 'description' => 'My custom URL endpoint', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -67,7 +67,7 @@ public function testUpdate(): void $result = $this->client->accounts->urlEndpoints->update( 'id', - description: 'My custom URL endpoint' + ['description' => 'My custom URL endpoint'] ); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType @@ -82,7 +82,7 @@ public function testUpdateWithOptionalParams(): void $result = $this->client->accounts->urlEndpoints->update( 'id', - description: 'My custom URL endpoint' + ['description' => 'My custom URL endpoint'] ); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType diff --git a/tests/Services/Accounts/UsageTest.php b/tests/Services/Accounts/UsageTest.php index 34023240..efd12e9d 100644 --- a/tests/Services/Accounts/UsageTest.php +++ b/tests/Services/Accounts/UsageTest.php @@ -37,10 +37,9 @@ public function testGet(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->accounts->usage->get( - endDate: new \DateTimeImmutable('2019-12-27'), - startDate: new \DateTimeImmutable('2019-12-27'), - ); + $result = $this->client->accounts->usage->get([ + 'endDate' => '2019-12-27', 'startDate' => '2019-12-27', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -52,10 +51,9 @@ public function testGetWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->accounts->usage->get( - endDate: new \DateTimeImmutable('2019-12-27'), - startDate: new \DateTimeImmutable('2019-12-27'), - ); + $result = $this->client->accounts->usage->get([ + 'endDate' => '2019-12-27', 'startDate' => '2019-12-27', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } diff --git a/tests/Services/AssetsTest.php b/tests/Services/AssetsTest.php index 38ea7df8..8969cd65 100644 --- a/tests/Services/AssetsTest.php +++ b/tests/Services/AssetsTest.php @@ -37,7 +37,7 @@ public function testList(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->assets->list(); + $result = $this->client->assets->list([]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } diff --git a/tests/Services/Beta/V2/FilesTest.php b/tests/Services/Beta/V2/FilesTest.php index cecc8625..6d1746fc 100644 --- a/tests/Services/Beta/V2/FilesTest.php +++ b/tests/Services/Beta/V2/FilesTest.php @@ -37,10 +37,9 @@ public function testUpload(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->beta->v2->files->upload( - file: 'file', - fileName: 'fileName' - ); + $result = $this->client->beta->v2->files->upload([ + 'file' => null, 'fileName' => 'fileName', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -52,10 +51,9 @@ public function testUploadWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->beta->v2->files->upload( - file: 'file', - fileName: 'fileName' - ); + $result = $this->client->beta->v2->files->upload([ + 'file' => null, 'fileName' => 'fileName', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } diff --git a/tests/Services/Cache/InvalidationTest.php b/tests/Services/Cache/InvalidationTest.php index 03bf6771..c1d79dc7 100644 --- a/tests/Services/Cache/InvalidationTest.php +++ b/tests/Services/Cache/InvalidationTest.php @@ -37,9 +37,9 @@ public function testCreate(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->cache->invalidation->create( - 'https://ik.imagekit.io/your_imagekit_id/default-image.jpg' - ); + $result = $this->client->cache->invalidation->create([ + 'url' => 'https://ik.imagekit.io/your_imagekit_id/default-image.jpg', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -51,9 +51,9 @@ public function testCreateWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->cache->invalidation->create( - 'https://ik.imagekit.io/your_imagekit_id/default-image.jpg' - ); + $result = $this->client->cache->invalidation->create([ + 'url' => 'https://ik.imagekit.io/your_imagekit_id/default-image.jpg', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } diff --git a/tests/Services/CustomMetadataFieldsTest.php b/tests/Services/CustomMetadataFieldsTest.php index 4386806b..028f9698 100644 --- a/tests/Services/CustomMetadataFieldsTest.php +++ b/tests/Services/CustomMetadataFieldsTest.php @@ -3,7 +3,6 @@ namespace Tests\Services; use ImageKit\Client; -use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; @@ -38,11 +37,9 @@ public function testCreate(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->customMetadataFields->create( - label: 'price', - name: 'price', - schema: Schema::with(type: 'Number') - ); + $result = $this->client->customMetadataFields->create([ + 'label' => 'price', 'name' => 'price', 'schema' => ['type' => 'Number'], + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -54,18 +51,20 @@ public function testCreateWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->customMetadataFields->create( - label: 'price', - name: 'price', - schema: Schema::with(type: 'Number') - ->withDefaultValue('string') - ->withIsValueRequired(true) - ->withMaxLength(0) - ->withMaxValue(3000) - ->withMinLength(0) - ->withMinValue(1000) - ->withSelectOptions(['small', 'medium', 'large', 30, 40, true]), - ); + $result = $this->client->customMetadataFields->create([ + 'label' => 'price', + 'name' => 'price', + 'schema' => [ + 'type' => 'Number', + 'defaultValue' => 'string', + 'isValueRequired' => true, + 'maxLength' => 0, + 'maxValue' => 3000, + 'minLength' => 0, + 'minValue' => 1000, + 'selectOptions' => ['small', 'medium', 'large', 30, 40, true], + ], + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -77,7 +76,7 @@ public function testUpdate(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->customMetadataFields->update('id'); + $result = $this->client->customMetadataFields->update('id', []); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -89,7 +88,7 @@ public function testList(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->customMetadataFields->list(); + $result = $this->client->customMetadataFields->list([]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } diff --git a/tests/Services/Files/BulkTest.php b/tests/Services/Files/BulkTest.php index 0a04bab7..a98521c9 100644 --- a/tests/Services/Files/BulkTest.php +++ b/tests/Services/Files/BulkTest.php @@ -37,9 +37,9 @@ public function testDelete(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->bulk->delete( - ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'] - ); + $result = $this->client->files->bulk->delete([ + 'fileIds' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -51,9 +51,9 @@ public function testDeleteWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->bulk->delete( - ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'] - ); + $result = $this->client->files->bulk->delete([ + 'fileIds' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -65,10 +65,10 @@ public function testAddTags(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->bulk->addTags( - fileIDs: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], - tags: ['t-shirt', 'round-neck', 'sale2019'], - ); + $result = $this->client->files->bulk->addTags([ + 'fileIds' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + 'tags' => ['t-shirt', 'round-neck', 'sale2019'], + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -80,10 +80,10 @@ public function testAddTagsWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->bulk->addTags( - fileIDs: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], - tags: ['t-shirt', 'round-neck', 'sale2019'], - ); + $result = $this->client->files->bulk->addTags([ + 'fileIds' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + 'tags' => ['t-shirt', 'round-neck', 'sale2019'], + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -95,10 +95,10 @@ public function testRemoveAITags(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->bulk->removeAITags( - aiTags: ['t-shirt', 'round-neck', 'sale2019'], - fileIDs: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], - ); + $result = $this->client->files->bulk->removeAITags([ + 'AITags' => ['t-shirt', 'round-neck', 'sale2019'], + 'fileIds' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -110,10 +110,10 @@ public function testRemoveAITagsWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->bulk->removeAITags( - aiTags: ['t-shirt', 'round-neck', 'sale2019'], - fileIDs: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], - ); + $result = $this->client->files->bulk->removeAITags([ + 'AITags' => ['t-shirt', 'round-neck', 'sale2019'], + 'fileIds' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -125,10 +125,10 @@ public function testRemoveTags(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->bulk->removeTags( - fileIDs: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], - tags: ['t-shirt', 'round-neck', 'sale2019'], - ); + $result = $this->client->files->bulk->removeTags([ + 'fileIds' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + 'tags' => ['t-shirt', 'round-neck', 'sale2019'], + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -140,10 +140,10 @@ public function testRemoveTagsWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->bulk->removeTags( - fileIDs: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], - tags: ['t-shirt', 'round-neck', 'sale2019'], - ); + $result = $this->client->files->bulk->removeTags([ + 'fileIds' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + 'tags' => ['t-shirt', 'round-neck', 'sale2019'], + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } diff --git a/tests/Services/Files/MetadataTest.php b/tests/Services/Files/MetadataTest.php index ff3adb12..f46b1823 100644 --- a/tests/Services/Files/MetadataTest.php +++ b/tests/Services/Files/MetadataTest.php @@ -49,7 +49,9 @@ public function testGetFromURL(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->metadata->getFromURL('https://example.com'); + $result = $this->client->files->metadata->getFromURL([ + 'url' => 'https://example.com', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -61,7 +63,9 @@ public function testGetFromURLWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->metadata->getFromURL('https://example.com'); + $result = $this->client->files->metadata->getFromURL([ + 'url' => 'https://example.com', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } diff --git a/tests/Services/Files/VersionsTest.php b/tests/Services/Files/VersionsTest.php index 7b686340..4492f2ef 100644 --- a/tests/Services/Files/VersionsTest.php +++ b/tests/Services/Files/VersionsTest.php @@ -49,7 +49,10 @@ public function testDelete(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->versions->delete('versionId', 'fileId'); + $result = $this->client->files->versions->delete( + 'versionId', + ['fileId' => 'fileId'] + ); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -61,7 +64,10 @@ public function testDeleteWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->versions->delete('versionId', 'fileId'); + $result = $this->client->files->versions->delete( + 'versionId', + ['fileId' => 'fileId'] + ); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -73,7 +79,10 @@ public function testGet(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->versions->get('versionId', 'fileId'); + $result = $this->client->files->versions->get( + 'versionId', + ['fileId' => 'fileId'] + ); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -85,7 +94,10 @@ public function testGetWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->versions->get('versionId', 'fileId'); + $result = $this->client->files->versions->get( + 'versionId', + ['fileId' => 'fileId'] + ); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -97,7 +109,10 @@ public function testRestore(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->versions->restore('versionId', 'fileId'); + $result = $this->client->files->versions->restore( + 'versionId', + ['fileId' => 'fileId'] + ); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -109,7 +124,10 @@ public function testRestoreWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->versions->restore('versionId', 'fileId'); + $result = $this->client->files->versions->restore( + 'versionId', + ['fileId' => 'fileId'] + ); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index c2a9ad6f..5c24ea1e 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -37,7 +37,7 @@ public function testUpdate(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->update('fileId'); + $result = $this->client->files->update('fileId', []); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -61,10 +61,10 @@ public function testCopy(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->copy( - destinationPath: '/folder/to/copy/into/', - sourceFilePath: '/path/to/file.jpg', - ); + $result = $this->client->files->copy([ + 'destinationPath' => '/folder/to/copy/into/', + 'sourceFilePath' => '/path/to/file.jpg', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -76,10 +76,10 @@ public function testCopyWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->copy( - destinationPath: '/folder/to/copy/into/', - sourceFilePath: '/path/to/file.jpg', - ); + $result = $this->client->files->copy([ + 'destinationPath' => '/folder/to/copy/into/', + 'sourceFilePath' => '/path/to/file.jpg', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -103,10 +103,10 @@ public function testMove(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->move( - destinationPath: '/folder/to/move/into/', - sourceFilePath: '/path/to/file.jpg', - ); + $result = $this->client->files->move([ + 'destinationPath' => '/folder/to/move/into/', + 'sourceFilePath' => '/path/to/file.jpg', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -118,10 +118,10 @@ public function testMoveWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->move( - destinationPath: '/folder/to/move/into/', - sourceFilePath: '/path/to/file.jpg', - ); + $result = $this->client->files->move([ + 'destinationPath' => '/folder/to/move/into/', + 'sourceFilePath' => '/path/to/file.jpg', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -133,10 +133,9 @@ public function testRename(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->rename( - filePath: '/path/to/file.jpg', - newFileName: 'newFileName.jpg' - ); + $result = $this->client->files->rename([ + 'filePath' => '/path/to/file.jpg', 'newFileName' => 'newFileName.jpg', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -148,10 +147,9 @@ public function testRenameWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->rename( - filePath: '/path/to/file.jpg', - newFileName: 'newFileName.jpg' - ); + $result = $this->client->files->rename([ + 'filePath' => '/path/to/file.jpg', 'newFileName' => 'newFileName.jpg', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -163,7 +161,9 @@ public function testUpload(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->upload(file: 'file', fileName: 'fileName'); + $result = $this->client->files->upload([ + 'file' => null, 'fileName' => 'fileName', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -175,7 +175,9 @@ public function testUploadWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->upload(file: 'file', fileName: 'fileName'); + $result = $this->client->files->upload([ + 'file' => null, 'fileName' => 'fileName', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } diff --git a/tests/Services/FoldersTest.php b/tests/Services/FoldersTest.php index 017baa06..7133c613 100644 --- a/tests/Services/FoldersTest.php +++ b/tests/Services/FoldersTest.php @@ -37,10 +37,9 @@ public function testCreate(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->folders->create( - folderName: 'summer', - parentFolderPath: '/product/images/' - ); + $result = $this->client->folders->create([ + 'folderName' => 'summer', 'parentFolderPath' => '/product/images/', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -52,10 +51,9 @@ public function testCreateWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->folders->create( - folderName: 'summer', - parentFolderPath: '/product/images/' - ); + $result = $this->client->folders->create([ + 'folderName' => 'summer', 'parentFolderPath' => '/product/images/', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -67,7 +65,9 @@ public function testDelete(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->folders->delete('/folder/to/delete/'); + $result = $this->client->folders->delete([ + 'folderPath' => '/folder/to/delete/', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -79,7 +79,9 @@ public function testDeleteWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->folders->delete('/folder/to/delete/'); + $result = $this->client->folders->delete([ + 'folderPath' => '/folder/to/delete/', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -91,10 +93,10 @@ public function testCopy(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->folders->copy( - destinationPath: '/path/of/destination/folder', - sourceFolderPath: '/path/of/source/folder', - ); + $result = $this->client->folders->copy([ + 'destinationPath' => '/path/of/destination/folder', + 'sourceFolderPath' => '/path/of/source/folder', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -106,10 +108,10 @@ public function testCopyWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->folders->copy( - destinationPath: '/path/of/destination/folder', - sourceFolderPath: '/path/of/source/folder', - ); + $result = $this->client->folders->copy([ + 'destinationPath' => '/path/of/destination/folder', + 'sourceFolderPath' => '/path/of/source/folder', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -121,10 +123,10 @@ public function testMove(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->folders->move( - destinationPath: '/path/of/destination/folder', - sourceFolderPath: '/path/of/source/folder', - ); + $result = $this->client->folders->move([ + 'destinationPath' => '/path/of/destination/folder', + 'sourceFolderPath' => '/path/of/source/folder', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -136,10 +138,10 @@ public function testMoveWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->folders->move( - destinationPath: '/path/of/destination/folder', - sourceFolderPath: '/path/of/source/folder', - ); + $result = $this->client->folders->move([ + 'destinationPath' => '/path/of/destination/folder', + 'sourceFolderPath' => '/path/of/source/folder', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -151,10 +153,9 @@ public function testRename(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->folders->rename( - folderPath: '/path/of/folder', - newFolderName: 'new-folder-name' - ); + $result = $this->client->folders->rename([ + 'folderPath' => '/path/of/folder', 'newFolderName' => 'new-folder-name', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } @@ -166,10 +167,9 @@ public function testRenameWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->folders->rename( - folderPath: '/path/of/folder', - newFolderName: 'new-folder-name' - ); + $result = $this->client->folders->rename([ + 'folderPath' => '/path/of/folder', 'newFolderName' => 'new-folder-name', + ]); $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType } From cf2eb10b550e628dcd50528ea1ba6d18aba812f3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Nov 2025 20:33:48 +0000 Subject: [PATCH 071/193] chore(internal): codegen related update --- src/Accounts/Origins/OriginCreateParams.php | 2 +- src/Accounts/Origins/OriginUpdateParams.php | 2 +- src/Accounts/URLEndpoints/URLEndpointCreateParams.php | 2 +- src/Accounts/URLEndpoints/URLEndpointUpdateParams.php | 2 +- src/Accounts/Usage/UsageGetParams.php | 2 +- src/Assets/AssetListParams.php | 2 +- src/Beta/V2/Files/FileUploadParams.php | 2 +- src/Cache/Invalidation/InvalidationCreateParams.php | 2 +- src/CustomMetadataFields/CustomMetadataFieldCreateParams.php | 2 +- src/CustomMetadataFields/CustomMetadataFieldListParams.php | 2 +- src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php | 2 +- src/Files/Bulk/BulkAddTagsParams.php | 2 +- src/Files/Bulk/BulkDeleteParams.php | 2 +- src/Files/Bulk/BulkRemoveAITagsParams.php | 2 +- src/Files/Bulk/BulkRemoveTagsParams.php | 2 +- src/Files/FileCopyParams.php | 2 +- src/Files/FileMoveParams.php | 2 +- src/Files/FileRenameParams.php | 2 +- src/Files/FileUpdateParams.php | 2 +- src/Files/FileUploadParams.php | 2 +- src/Files/Metadata/MetadataGetFromURLParams.php | 2 +- src/Files/Versions/VersionDeleteParams.php | 2 +- src/Files/Versions/VersionGetParams.php | 2 +- src/Files/Versions/VersionRestoreParams.php | 2 +- src/Folders/FolderCopyParams.php | 2 +- src/Folders/FolderCreateParams.php | 2 +- src/Folders/FolderDeleteParams.php | 2 +- src/Folders/FolderMoveParams.php | 2 +- src/Folders/FolderRenameParams.php | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/Accounts/Origins/OriginCreateParams.php b/src/Accounts/Origins/OriginCreateParams.php index ce0c57af..2729608a 100644 --- a/src/Accounts/Origins/OriginCreateParams.php +++ b/src/Accounts/Origins/OriginCreateParams.php @@ -13,7 +13,7 @@ * **Note:** This API is currently in beta. * Creates a new origin and returns the origin object. * - * @see ImageKit\Accounts\Origins->create + * @see ImageKit\STAINLESS_FIXME_Accounts\OriginsService::create() * * @phpstan-type OriginCreateParamsShape = array{ * accessKey: string, diff --git a/src/Accounts/Origins/OriginUpdateParams.php b/src/Accounts/Origins/OriginUpdateParams.php index a28ead9c..6273b25e 100644 --- a/src/Accounts/Origins/OriginUpdateParams.php +++ b/src/Accounts/Origins/OriginUpdateParams.php @@ -13,7 +13,7 @@ * **Note:** This API is currently in beta. * Updates the origin identified by `id` and returns the updated origin object. * - * @see ImageKit\Accounts\Origins->update + * @see ImageKit\STAINLESS_FIXME_Accounts\OriginsService::update() * * @phpstan-type OriginUpdateParamsShape = array{ * accessKey: string, diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php index ad49a4b7..a0b825b4 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php @@ -17,7 +17,7 @@ * **Note:** This API is currently in beta. * Creates a new URL‑endpoint and returns the resulting object. * - * @see ImageKit\Accounts\URLEndpoints->create + * @see ImageKit\STAINLESS_FIXME_Accounts\URLEndpointsService::create() * * @phpstan-type URLEndpointCreateParamsShape = array{ * description: string, diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php index b5d525df..63f895f1 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php @@ -17,7 +17,7 @@ * **Note:** This API is currently in beta. * Updates the URL‑endpoint identified by `id` and returns the updated object. * - * @see ImageKit\Accounts\URLEndpoints->update + * @see ImageKit\STAINLESS_FIXME_Accounts\URLEndpointsService::update() * * @phpstan-type URLEndpointUpdateParamsShape = array{ * description: string, diff --git a/src/Accounts/Usage/UsageGetParams.php b/src/Accounts/Usage/UsageGetParams.php index e5e7e19e..d81ce556 100644 --- a/src/Accounts/Usage/UsageGetParams.php +++ b/src/Accounts/Usage/UsageGetParams.php @@ -12,7 +12,7 @@ /** * Get the account usage information between two dates. Note that the API response includes data from the start date while excluding data from the end date. In other words, the data covers the period starting from the specified start date up to, but not including, the end date. * - * @see ImageKit\Accounts\Usage->get + * @see ImageKit\STAINLESS_FIXME_Accounts\UsageService::get() * * @phpstan-type UsageGetParamsShape = array{ * endDate: \DateTimeInterface, startDate: \DateTimeInterface diff --git a/src/Assets/AssetListParams.php b/src/Assets/AssetListParams.php index aeec3988..a314f1fb 100644 --- a/src/Assets/AssetListParams.php +++ b/src/Assets/AssetListParams.php @@ -15,7 +15,7 @@ /** * This API can list all the uploaded files and folders in your ImageKit.io media library. In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and provide this generated string as the value of the `searchQuery`. * - * @see ImageKit\Assets->list + * @see ImageKit\AssetsService::list() * * @phpstan-type AssetListParamsShape = array{ * fileType?: FileType|value-of, diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index f2f91a80..6b78c080 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -31,7 +31,7 @@ * - A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more. * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. * - * @see ImageKit\Beta\V2\Files->upload + * @see ImageKit\STAINLESS_FIXME_Beta\STAINLESS_FIXME_V2\FilesService::upload() * * @phpstan-type FileUploadParamsShape = array{ * file: string, diff --git a/src/Cache/Invalidation/InvalidationCreateParams.php b/src/Cache/Invalidation/InvalidationCreateParams.php index 42876312..5bba0eb0 100644 --- a/src/Cache/Invalidation/InvalidationCreateParams.php +++ b/src/Cache/Invalidation/InvalidationCreateParams.php @@ -12,7 +12,7 @@ /** * This API will purge CDN cache and ImageKit.io's internal cache for a file. Note: Purge cache is an asynchronous process and it may take some time to reflect the changes. * - * @see ImageKit\Cache\Invalidation->create + * @see ImageKit\STAINLESS_FIXME_Cache\InvalidationService::create() * * @phpstan-type InvalidationCreateParamsShape = array{url: string} */ diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php index 6b663ad8..b94a28ea 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php @@ -13,7 +13,7 @@ /** * This API creates a new custom metadata field. Once a custom metadata field is created either through this API or using the dashboard UI, its value can be set on the assets. The value of a field for an asset can be set using the media library UI or programmatically through upload or update assets API. * - * @see ImageKit\CustomMetadataFields->create + * @see ImageKit\CustomMetadataFieldsService::create() * * @phpstan-type CustomMetadataFieldCreateParamsShape = array{ * label: string, name: string, schema: Schema diff --git a/src/CustomMetadataFields/CustomMetadataFieldListParams.php b/src/CustomMetadataFields/CustomMetadataFieldListParams.php index 1c258f8c..98724f12 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldListParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldListParams.php @@ -14,7 +14,7 @@ * * You can also filter results by a specific folder path to retrieve custom metadata fields applicable at that location. This path-specific filtering is useful when using the **Path policy** feature to determine which custom metadata fields are selected for a given path. * - * @see ImageKit\CustomMetadataFields->list + * @see ImageKit\CustomMetadataFieldsService::list() * * @phpstan-type CustomMetadataFieldListParamsShape = array{ * folderPath?: string, includeDeleted?: bool diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php index b6e11c19..5c1c42c2 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php @@ -13,7 +13,7 @@ /** * This API updates the label or schema of an existing custom metadata field. * - * @see ImageKit\CustomMetadataFields->update + * @see ImageKit\CustomMetadataFieldsService::update() * * @phpstan-type CustomMetadataFieldUpdateParamsShape = array{ * label?: string, schema?: Schema diff --git a/src/Files/Bulk/BulkAddTagsParams.php b/src/Files/Bulk/BulkAddTagsParams.php index 1e0f944d..da8aa34c 100644 --- a/src/Files/Bulk/BulkAddTagsParams.php +++ b/src/Files/Bulk/BulkAddTagsParams.php @@ -12,7 +12,7 @@ /** * This API adds tags to multiple files in bulk. A maximum of 50 files can be specified at a time. * - * @see ImageKit\Files\Bulk->addTags + * @see ImageKit\STAINLESS_FIXME_Files\BulkService::addTags() * * @phpstan-type BulkAddTagsParamsShape = array{ * fileIds: list, tags: list diff --git a/src/Files/Bulk/BulkDeleteParams.php b/src/Files/Bulk/BulkDeleteParams.php index dd3306d8..c125575a 100644 --- a/src/Files/Bulk/BulkDeleteParams.php +++ b/src/Files/Bulk/BulkDeleteParams.php @@ -16,7 +16,7 @@ * * A maximum of 100 files can be deleted at a time. * - * @see ImageKit\Files\Bulk->delete + * @see ImageKit\STAINLESS_FIXME_Files\BulkService::delete() * * @phpstan-type BulkDeleteParamsShape = array{fileIds: list} */ diff --git a/src/Files/Bulk/BulkRemoveAITagsParams.php b/src/Files/Bulk/BulkRemoveAITagsParams.php index 61459768..d15d4447 100644 --- a/src/Files/Bulk/BulkRemoveAITagsParams.php +++ b/src/Files/Bulk/BulkRemoveAITagsParams.php @@ -12,7 +12,7 @@ /** * This API removes AITags from multiple files in bulk. A maximum of 50 files can be specified at a time. * - * @see ImageKit\Files\Bulk->removeAITags + * @see ImageKit\STAINLESS_FIXME_Files\BulkService::removeAITags() * * @phpstan-type BulkRemoveAITagsParamsShape = array{ * AITags: list, fileIds: list diff --git a/src/Files/Bulk/BulkRemoveTagsParams.php b/src/Files/Bulk/BulkRemoveTagsParams.php index bea1085b..ee2d3e1a 100644 --- a/src/Files/Bulk/BulkRemoveTagsParams.php +++ b/src/Files/Bulk/BulkRemoveTagsParams.php @@ -12,7 +12,7 @@ /** * This API removes tags from multiple files in bulk. A maximum of 50 files can be specified at a time. * - * @see ImageKit\Files\Bulk->removeTags + * @see ImageKit\STAINLESS_FIXME_Files\BulkService::removeTags() * * @phpstan-type BulkRemoveTagsParamsShape = array{ * fileIds: list, tags: list diff --git a/src/Files/FileCopyParams.php b/src/Files/FileCopyParams.php index 92ff9b52..3e5069c1 100644 --- a/src/Files/FileCopyParams.php +++ b/src/Files/FileCopyParams.php @@ -14,7 +14,7 @@ * * Note: If any file at the destination has the same name as the source file, then the source file and its versions (if `includeFileVersions` is set to true) will be appended to the destination file version history. * - * @see ImageKit\Files->copy + * @see ImageKit\FilesService::copy() * * @phpstan-type FileCopyParamsShape = array{ * destinationPath: string, sourceFilePath: string, includeFileVersions?: bool diff --git a/src/Files/FileMoveParams.php b/src/Files/FileMoveParams.php index 23f919f4..e8f2d7d3 100644 --- a/src/Files/FileMoveParams.php +++ b/src/Files/FileMoveParams.php @@ -14,7 +14,7 @@ * * Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file. * - * @see ImageKit\Files->move + * @see ImageKit\FilesService::move() * * @phpstan-type FileMoveParamsShape = array{ * destinationPath: string, sourceFilePath: string diff --git a/src/Files/FileRenameParams.php b/src/Files/FileRenameParams.php index 49bcb049..f4b2898d 100644 --- a/src/Files/FileRenameParams.php +++ b/src/Files/FileRenameParams.php @@ -14,7 +14,7 @@ * * Note: The old URLs will stop working. The file/file version URLs cached on CDN will continue to work unless a purge is requested. * - * @see ImageKit\Files->rename + * @see ImageKit\FilesService::rename() * * @phpstan-type FileRenameParamsShape = array{ * filePath: string, newFileName: string, purgeCache?: bool diff --git a/src/Files/FileUpdateParams.php b/src/Files/FileUpdateParams.php index 274e6839..d901f9ae 100644 --- a/src/Files/FileUpdateParams.php +++ b/src/Files/FileUpdateParams.php @@ -18,7 +18,7 @@ /** * This API updates the details or attributes of the current version of the file. You can update `tags`, `customCoordinates`, `customMetadata`, publication status, remove existing `AITags` and apply extensions using this API. * - * @see ImageKit\Files->update + * @see ImageKit\FilesService::update() * * @phpstan-type FileUpdateParamsShape = array{ * customCoordinates?: string|null, diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index e1308dba..3e1798fe 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -31,7 +31,7 @@ * - A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more. * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. * - * @see ImageKit\Files->upload + * @see ImageKit\FilesService::upload() * * @phpstan-type FileUploadParamsShape = array{ * file: string, diff --git a/src/Files/Metadata/MetadataGetFromURLParams.php b/src/Files/Metadata/MetadataGetFromURLParams.php index db5defa0..0851b458 100644 --- a/src/Files/Metadata/MetadataGetFromURLParams.php +++ b/src/Files/Metadata/MetadataGetFromURLParams.php @@ -12,7 +12,7 @@ /** * Get image EXIF, pHash, and other metadata from ImageKit.io powered remote URL using this API. * - * @see ImageKit\Files\Metadata->getFromURL + * @see ImageKit\STAINLESS_FIXME_Files\MetadataService::getFromURL() * * @phpstan-type MetadataGetFromURLParamsShape = array{url: string} */ diff --git a/src/Files/Versions/VersionDeleteParams.php b/src/Files/Versions/VersionDeleteParams.php index 71a33a10..c9a9078d 100644 --- a/src/Files/Versions/VersionDeleteParams.php +++ b/src/Files/Versions/VersionDeleteParams.php @@ -14,7 +14,7 @@ * * Note: If you want to delete all versions of a file, use the delete file API. * - * @see ImageKit\Files\Versions->delete + * @see ImageKit\STAINLESS_FIXME_Files\VersionsService::delete() * * @phpstan-type VersionDeleteParamsShape = array{fileId: string} */ diff --git a/src/Files/Versions/VersionGetParams.php b/src/Files/Versions/VersionGetParams.php index 82bfe8c0..40aebd3d 100644 --- a/src/Files/Versions/VersionGetParams.php +++ b/src/Files/Versions/VersionGetParams.php @@ -12,7 +12,7 @@ /** * This API returns an object with details or attributes of a file version. * - * @see ImageKit\Files\Versions->get + * @see ImageKit\STAINLESS_FIXME_Files\VersionsService::get() * * @phpstan-type VersionGetParamsShape = array{fileId: string} */ diff --git a/src/Files/Versions/VersionRestoreParams.php b/src/Files/Versions/VersionRestoreParams.php index 1eee6e39..b62336f2 100644 --- a/src/Files/Versions/VersionRestoreParams.php +++ b/src/Files/Versions/VersionRestoreParams.php @@ -12,7 +12,7 @@ /** * This API restores a file version as the current file version. * - * @see ImageKit\Files\Versions->restore + * @see ImageKit\STAINLESS_FIXME_Files\VersionsService::restore() * * @phpstan-type VersionRestoreParamsShape = array{fileId: string} */ diff --git a/src/Folders/FolderCopyParams.php b/src/Folders/FolderCopyParams.php index fa5e5196..7cbc935d 100644 --- a/src/Folders/FolderCopyParams.php +++ b/src/Folders/FolderCopyParams.php @@ -12,7 +12,7 @@ /** * This will copy one folder into another. The selected folder, its nested folders, files, and their versions (in `includeVersions` is set to true) are copied in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history. * - * @see ImageKit\Folders->copy + * @see ImageKit\FoldersService::copy() * * @phpstan-type FolderCopyParamsShape = array{ * destinationPath: string, sourceFolderPath: string, includeVersions?: bool diff --git a/src/Folders/FolderCreateParams.php b/src/Folders/FolderCreateParams.php index 93d8c6b5..e5c423ad 100644 --- a/src/Folders/FolderCreateParams.php +++ b/src/Folders/FolderCreateParams.php @@ -12,7 +12,7 @@ /** * This will create a new folder. You can specify the folder name and location of the parent folder where this new folder should be created. * - * @see ImageKit\Folders->create + * @see ImageKit\FoldersService::create() * * @phpstan-type FolderCreateParamsShape = array{ * folderName: string, parentFolderPath: string diff --git a/src/Folders/FolderDeleteParams.php b/src/Folders/FolderDeleteParams.php index f1eaa2c1..6b1e6e37 100644 --- a/src/Folders/FolderDeleteParams.php +++ b/src/Folders/FolderDeleteParams.php @@ -12,7 +12,7 @@ /** * This will delete a folder and all its contents permanently. The API returns an empty response. * - * @see ImageKit\Folders->delete + * @see ImageKit\FoldersService::delete() * * @phpstan-type FolderDeleteParamsShape = array{folderPath: string} */ diff --git a/src/Folders/FolderMoveParams.php b/src/Folders/FolderMoveParams.php index 761b433e..7967cc32 100644 --- a/src/Folders/FolderMoveParams.php +++ b/src/Folders/FolderMoveParams.php @@ -12,7 +12,7 @@ /** * This will move one folder into another. The selected folder, its nested folders, files, and their versions are moved in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history. * - * @see ImageKit\Folders->move + * @see ImageKit\FoldersService::move() * * @phpstan-type FolderMoveParamsShape = array{ * destinationPath: string, sourceFolderPath: string diff --git a/src/Folders/FolderRenameParams.php b/src/Folders/FolderRenameParams.php index 795485b5..977f3464 100644 --- a/src/Folders/FolderRenameParams.php +++ b/src/Folders/FolderRenameParams.php @@ -12,7 +12,7 @@ /** * This API allows you to rename an existing folder. The folder and all its nested assets and sub-folders will remain unchanged, but their paths will be updated to reflect the new folder name. * - * @see ImageKit\Folders->rename + * @see ImageKit\FoldersService::rename() * * @phpstan-type FolderRenameParamsShape = array{ * folderPath: string, newFolderName: string, purgeCache?: bool From 7649278a7a6c5e74a7f58e1743c1843f3f1f1f47 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Nov 2025 22:07:35 +0000 Subject: [PATCH 072/193] fix: revert accidental code deletion --- src/Accounts/Origins/OriginCreateParams.php | 2 +- src/Accounts/Origins/OriginUpdateParams.php | 2 +- src/Accounts/URLEndpoints/URLEndpointCreateParams.php | 2 +- src/Accounts/URLEndpoints/URLEndpointUpdateParams.php | 2 +- src/Accounts/Usage/UsageGetParams.php | 2 +- src/Assets/AssetListParams.php | 2 +- src/Beta/V2/Files/FileUploadParams.php | 2 +- src/Cache/Invalidation/InvalidationCreateParams.php | 2 +- src/CustomMetadataFields/CustomMetadataFieldCreateParams.php | 2 +- src/CustomMetadataFields/CustomMetadataFieldListParams.php | 2 +- src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php | 2 +- src/Files/Bulk/BulkAddTagsParams.php | 2 +- src/Files/Bulk/BulkDeleteParams.php | 2 +- src/Files/Bulk/BulkRemoveAITagsParams.php | 2 +- src/Files/Bulk/BulkRemoveTagsParams.php | 2 +- src/Files/FileCopyParams.php | 2 +- src/Files/FileMoveParams.php | 2 +- src/Files/FileRenameParams.php | 2 +- src/Files/FileUpdateParams.php | 2 +- src/Files/FileUploadParams.php | 2 +- src/Files/Metadata/MetadataGetFromURLParams.php | 2 +- src/Files/Versions/VersionDeleteParams.php | 2 +- src/Files/Versions/VersionGetParams.php | 2 +- src/Files/Versions/VersionRestoreParams.php | 2 +- src/Folders/FolderCopyParams.php | 2 +- src/Folders/FolderCreateParams.php | 2 +- src/Folders/FolderDeleteParams.php | 2 +- src/Folders/FolderMoveParams.php | 2 +- src/Folders/FolderRenameParams.php | 2 +- 29 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/Accounts/Origins/OriginCreateParams.php b/src/Accounts/Origins/OriginCreateParams.php index 2729608a..04b6afaa 100644 --- a/src/Accounts/Origins/OriginCreateParams.php +++ b/src/Accounts/Origins/OriginCreateParams.php @@ -13,7 +13,7 @@ * **Note:** This API is currently in beta. * Creates a new origin and returns the origin object. * - * @see ImageKit\STAINLESS_FIXME_Accounts\OriginsService::create() + * @see ImageKit\Services\Accounts\OriginsService::create() * * @phpstan-type OriginCreateParamsShape = array{ * accessKey: string, diff --git a/src/Accounts/Origins/OriginUpdateParams.php b/src/Accounts/Origins/OriginUpdateParams.php index 6273b25e..15880724 100644 --- a/src/Accounts/Origins/OriginUpdateParams.php +++ b/src/Accounts/Origins/OriginUpdateParams.php @@ -13,7 +13,7 @@ * **Note:** This API is currently in beta. * Updates the origin identified by `id` and returns the updated origin object. * - * @see ImageKit\STAINLESS_FIXME_Accounts\OriginsService::update() + * @see ImageKit\Services\Accounts\OriginsService::update() * * @phpstan-type OriginUpdateParamsShape = array{ * accessKey: string, diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php index a0b825b4..d2ed1a26 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php @@ -17,7 +17,7 @@ * **Note:** This API is currently in beta. * Creates a new URL‑endpoint and returns the resulting object. * - * @see ImageKit\STAINLESS_FIXME_Accounts\URLEndpointsService::create() + * @see ImageKit\Services\Accounts\URLEndpointsService::create() * * @phpstan-type URLEndpointCreateParamsShape = array{ * description: string, diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php index 63f895f1..7488c4c1 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php @@ -17,7 +17,7 @@ * **Note:** This API is currently in beta. * Updates the URL‑endpoint identified by `id` and returns the updated object. * - * @see ImageKit\STAINLESS_FIXME_Accounts\URLEndpointsService::update() + * @see ImageKit\Services\Accounts\URLEndpointsService::update() * * @phpstan-type URLEndpointUpdateParamsShape = array{ * description: string, diff --git a/src/Accounts/Usage/UsageGetParams.php b/src/Accounts/Usage/UsageGetParams.php index d81ce556..4635ffab 100644 --- a/src/Accounts/Usage/UsageGetParams.php +++ b/src/Accounts/Usage/UsageGetParams.php @@ -12,7 +12,7 @@ /** * Get the account usage information between two dates. Note that the API response includes data from the start date while excluding data from the end date. In other words, the data covers the period starting from the specified start date up to, but not including, the end date. * - * @see ImageKit\STAINLESS_FIXME_Accounts\UsageService::get() + * @see ImageKit\Services\Accounts\UsageService::get() * * @phpstan-type UsageGetParamsShape = array{ * endDate: \DateTimeInterface, startDate: \DateTimeInterface diff --git a/src/Assets/AssetListParams.php b/src/Assets/AssetListParams.php index a314f1fb..522abe42 100644 --- a/src/Assets/AssetListParams.php +++ b/src/Assets/AssetListParams.php @@ -15,7 +15,7 @@ /** * This API can list all the uploaded files and folders in your ImageKit.io media library. In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and provide this generated string as the value of the `searchQuery`. * - * @see ImageKit\AssetsService::list() + * @see ImageKit\Services\AssetsService::list() * * @phpstan-type AssetListParamsShape = array{ * fileType?: FileType|value-of, diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index 6b78c080..4fa9f145 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -31,7 +31,7 @@ * - A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more. * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. * - * @see ImageKit\STAINLESS_FIXME_Beta\STAINLESS_FIXME_V2\FilesService::upload() + * @see ImageKit\Services\Beta\V2\FilesService::upload() * * @phpstan-type FileUploadParamsShape = array{ * file: string, diff --git a/src/Cache/Invalidation/InvalidationCreateParams.php b/src/Cache/Invalidation/InvalidationCreateParams.php index 5bba0eb0..3c1d5701 100644 --- a/src/Cache/Invalidation/InvalidationCreateParams.php +++ b/src/Cache/Invalidation/InvalidationCreateParams.php @@ -12,7 +12,7 @@ /** * This API will purge CDN cache and ImageKit.io's internal cache for a file. Note: Purge cache is an asynchronous process and it may take some time to reflect the changes. * - * @see ImageKit\STAINLESS_FIXME_Cache\InvalidationService::create() + * @see ImageKit\Services\Cache\InvalidationService::create() * * @phpstan-type InvalidationCreateParamsShape = array{url: string} */ diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php index b94a28ea..8fc02499 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php @@ -13,7 +13,7 @@ /** * This API creates a new custom metadata field. Once a custom metadata field is created either through this API or using the dashboard UI, its value can be set on the assets. The value of a field for an asset can be set using the media library UI or programmatically through upload or update assets API. * - * @see ImageKit\CustomMetadataFieldsService::create() + * @see ImageKit\Services\CustomMetadataFieldsService::create() * * @phpstan-type CustomMetadataFieldCreateParamsShape = array{ * label: string, name: string, schema: Schema diff --git a/src/CustomMetadataFields/CustomMetadataFieldListParams.php b/src/CustomMetadataFields/CustomMetadataFieldListParams.php index 98724f12..96947925 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldListParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldListParams.php @@ -14,7 +14,7 @@ * * You can also filter results by a specific folder path to retrieve custom metadata fields applicable at that location. This path-specific filtering is useful when using the **Path policy** feature to determine which custom metadata fields are selected for a given path. * - * @see ImageKit\CustomMetadataFieldsService::list() + * @see ImageKit\Services\CustomMetadataFieldsService::list() * * @phpstan-type CustomMetadataFieldListParamsShape = array{ * folderPath?: string, includeDeleted?: bool diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php index 5c1c42c2..4f72f5be 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php @@ -13,7 +13,7 @@ /** * This API updates the label or schema of an existing custom metadata field. * - * @see ImageKit\CustomMetadataFieldsService::update() + * @see ImageKit\Services\CustomMetadataFieldsService::update() * * @phpstan-type CustomMetadataFieldUpdateParamsShape = array{ * label?: string, schema?: Schema diff --git a/src/Files/Bulk/BulkAddTagsParams.php b/src/Files/Bulk/BulkAddTagsParams.php index da8aa34c..f12e7f7c 100644 --- a/src/Files/Bulk/BulkAddTagsParams.php +++ b/src/Files/Bulk/BulkAddTagsParams.php @@ -12,7 +12,7 @@ /** * This API adds tags to multiple files in bulk. A maximum of 50 files can be specified at a time. * - * @see ImageKit\STAINLESS_FIXME_Files\BulkService::addTags() + * @see ImageKit\Services\Files\BulkService::addTags() * * @phpstan-type BulkAddTagsParamsShape = array{ * fileIds: list, tags: list diff --git a/src/Files/Bulk/BulkDeleteParams.php b/src/Files/Bulk/BulkDeleteParams.php index c125575a..46c84062 100644 --- a/src/Files/Bulk/BulkDeleteParams.php +++ b/src/Files/Bulk/BulkDeleteParams.php @@ -16,7 +16,7 @@ * * A maximum of 100 files can be deleted at a time. * - * @see ImageKit\STAINLESS_FIXME_Files\BulkService::delete() + * @see ImageKit\Services\Files\BulkService::delete() * * @phpstan-type BulkDeleteParamsShape = array{fileIds: list} */ diff --git a/src/Files/Bulk/BulkRemoveAITagsParams.php b/src/Files/Bulk/BulkRemoveAITagsParams.php index d15d4447..4ef93b02 100644 --- a/src/Files/Bulk/BulkRemoveAITagsParams.php +++ b/src/Files/Bulk/BulkRemoveAITagsParams.php @@ -12,7 +12,7 @@ /** * This API removes AITags from multiple files in bulk. A maximum of 50 files can be specified at a time. * - * @see ImageKit\STAINLESS_FIXME_Files\BulkService::removeAITags() + * @see ImageKit\Services\Files\BulkService::removeAITags() * * @phpstan-type BulkRemoveAITagsParamsShape = array{ * AITags: list, fileIds: list diff --git a/src/Files/Bulk/BulkRemoveTagsParams.php b/src/Files/Bulk/BulkRemoveTagsParams.php index ee2d3e1a..9f334add 100644 --- a/src/Files/Bulk/BulkRemoveTagsParams.php +++ b/src/Files/Bulk/BulkRemoveTagsParams.php @@ -12,7 +12,7 @@ /** * This API removes tags from multiple files in bulk. A maximum of 50 files can be specified at a time. * - * @see ImageKit\STAINLESS_FIXME_Files\BulkService::removeTags() + * @see ImageKit\Services\Files\BulkService::removeTags() * * @phpstan-type BulkRemoveTagsParamsShape = array{ * fileIds: list, tags: list diff --git a/src/Files/FileCopyParams.php b/src/Files/FileCopyParams.php index 3e5069c1..c9209ee6 100644 --- a/src/Files/FileCopyParams.php +++ b/src/Files/FileCopyParams.php @@ -14,7 +14,7 @@ * * Note: If any file at the destination has the same name as the source file, then the source file and its versions (if `includeFileVersions` is set to true) will be appended to the destination file version history. * - * @see ImageKit\FilesService::copy() + * @see ImageKit\Services\FilesService::copy() * * @phpstan-type FileCopyParamsShape = array{ * destinationPath: string, sourceFilePath: string, includeFileVersions?: bool diff --git a/src/Files/FileMoveParams.php b/src/Files/FileMoveParams.php index e8f2d7d3..079945ba 100644 --- a/src/Files/FileMoveParams.php +++ b/src/Files/FileMoveParams.php @@ -14,7 +14,7 @@ * * Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file. * - * @see ImageKit\FilesService::move() + * @see ImageKit\Services\FilesService::move() * * @phpstan-type FileMoveParamsShape = array{ * destinationPath: string, sourceFilePath: string diff --git a/src/Files/FileRenameParams.php b/src/Files/FileRenameParams.php index f4b2898d..ccfb738b 100644 --- a/src/Files/FileRenameParams.php +++ b/src/Files/FileRenameParams.php @@ -14,7 +14,7 @@ * * Note: The old URLs will stop working. The file/file version URLs cached on CDN will continue to work unless a purge is requested. * - * @see ImageKit\FilesService::rename() + * @see ImageKit\Services\FilesService::rename() * * @phpstan-type FileRenameParamsShape = array{ * filePath: string, newFileName: string, purgeCache?: bool diff --git a/src/Files/FileUpdateParams.php b/src/Files/FileUpdateParams.php index d901f9ae..22e81329 100644 --- a/src/Files/FileUpdateParams.php +++ b/src/Files/FileUpdateParams.php @@ -18,7 +18,7 @@ /** * This API updates the details or attributes of the current version of the file. You can update `tags`, `customCoordinates`, `customMetadata`, publication status, remove existing `AITags` and apply extensions using this API. * - * @see ImageKit\FilesService::update() + * @see ImageKit\Services\FilesService::update() * * @phpstan-type FileUpdateParamsShape = array{ * customCoordinates?: string|null, diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index 3e1798fe..c32eb1c6 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -31,7 +31,7 @@ * - A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more. * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. * - * @see ImageKit\FilesService::upload() + * @see ImageKit\Services\FilesService::upload() * * @phpstan-type FileUploadParamsShape = array{ * file: string, diff --git a/src/Files/Metadata/MetadataGetFromURLParams.php b/src/Files/Metadata/MetadataGetFromURLParams.php index 0851b458..a79711f5 100644 --- a/src/Files/Metadata/MetadataGetFromURLParams.php +++ b/src/Files/Metadata/MetadataGetFromURLParams.php @@ -12,7 +12,7 @@ /** * Get image EXIF, pHash, and other metadata from ImageKit.io powered remote URL using this API. * - * @see ImageKit\STAINLESS_FIXME_Files\MetadataService::getFromURL() + * @see ImageKit\Services\Files\MetadataService::getFromURL() * * @phpstan-type MetadataGetFromURLParamsShape = array{url: string} */ diff --git a/src/Files/Versions/VersionDeleteParams.php b/src/Files/Versions/VersionDeleteParams.php index c9a9078d..3ce4ae2f 100644 --- a/src/Files/Versions/VersionDeleteParams.php +++ b/src/Files/Versions/VersionDeleteParams.php @@ -14,7 +14,7 @@ * * Note: If you want to delete all versions of a file, use the delete file API. * - * @see ImageKit\STAINLESS_FIXME_Files\VersionsService::delete() + * @see ImageKit\Services\Files\VersionsService::delete() * * @phpstan-type VersionDeleteParamsShape = array{fileId: string} */ diff --git a/src/Files/Versions/VersionGetParams.php b/src/Files/Versions/VersionGetParams.php index 40aebd3d..41ffb2f2 100644 --- a/src/Files/Versions/VersionGetParams.php +++ b/src/Files/Versions/VersionGetParams.php @@ -12,7 +12,7 @@ /** * This API returns an object with details or attributes of a file version. * - * @see ImageKit\STAINLESS_FIXME_Files\VersionsService::get() + * @see ImageKit\Services\Files\VersionsService::get() * * @phpstan-type VersionGetParamsShape = array{fileId: string} */ diff --git a/src/Files/Versions/VersionRestoreParams.php b/src/Files/Versions/VersionRestoreParams.php index b62336f2..3fe2713f 100644 --- a/src/Files/Versions/VersionRestoreParams.php +++ b/src/Files/Versions/VersionRestoreParams.php @@ -12,7 +12,7 @@ /** * This API restores a file version as the current file version. * - * @see ImageKit\STAINLESS_FIXME_Files\VersionsService::restore() + * @see ImageKit\Services\Files\VersionsService::restore() * * @phpstan-type VersionRestoreParamsShape = array{fileId: string} */ diff --git a/src/Folders/FolderCopyParams.php b/src/Folders/FolderCopyParams.php index 7cbc935d..f636eb89 100644 --- a/src/Folders/FolderCopyParams.php +++ b/src/Folders/FolderCopyParams.php @@ -12,7 +12,7 @@ /** * This will copy one folder into another. The selected folder, its nested folders, files, and their versions (in `includeVersions` is set to true) are copied in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history. * - * @see ImageKit\FoldersService::copy() + * @see ImageKit\Services\FoldersService::copy() * * @phpstan-type FolderCopyParamsShape = array{ * destinationPath: string, sourceFolderPath: string, includeVersions?: bool diff --git a/src/Folders/FolderCreateParams.php b/src/Folders/FolderCreateParams.php index e5c423ad..6afb10b4 100644 --- a/src/Folders/FolderCreateParams.php +++ b/src/Folders/FolderCreateParams.php @@ -12,7 +12,7 @@ /** * This will create a new folder. You can specify the folder name and location of the parent folder where this new folder should be created. * - * @see ImageKit\FoldersService::create() + * @see ImageKit\Services\FoldersService::create() * * @phpstan-type FolderCreateParamsShape = array{ * folderName: string, parentFolderPath: string diff --git a/src/Folders/FolderDeleteParams.php b/src/Folders/FolderDeleteParams.php index 6b1e6e37..211f0f7c 100644 --- a/src/Folders/FolderDeleteParams.php +++ b/src/Folders/FolderDeleteParams.php @@ -12,7 +12,7 @@ /** * This will delete a folder and all its contents permanently. The API returns an empty response. * - * @see ImageKit\FoldersService::delete() + * @see ImageKit\Services\FoldersService::delete() * * @phpstan-type FolderDeleteParamsShape = array{folderPath: string} */ diff --git a/src/Folders/FolderMoveParams.php b/src/Folders/FolderMoveParams.php index 7967cc32..d0949c62 100644 --- a/src/Folders/FolderMoveParams.php +++ b/src/Folders/FolderMoveParams.php @@ -12,7 +12,7 @@ /** * This will move one folder into another. The selected folder, its nested folders, files, and their versions are moved in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history. * - * @see ImageKit\FoldersService::move() + * @see ImageKit\Services\FoldersService::move() * * @phpstan-type FolderMoveParamsShape = array{ * destinationPath: string, sourceFolderPath: string diff --git a/src/Folders/FolderRenameParams.php b/src/Folders/FolderRenameParams.php index 977f3464..7ed1b8ac 100644 --- a/src/Folders/FolderRenameParams.php +++ b/src/Folders/FolderRenameParams.php @@ -12,7 +12,7 @@ /** * This API allows you to rename an existing folder. The folder and all its nested assets and sub-folders will remain unchanged, but their paths will be updated to reflect the new folder name. * - * @see ImageKit\FoldersService::rename() + * @see ImageKit\Services\FoldersService::rename() * * @phpstan-type FolderRenameParamsShape = array{ * folderPath: string, newFolderName: string, purgeCache?: bool From 59bcbf0d82436725efb8f63c405a088ab92b10c2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 12 Nov 2025 23:19:11 +0000 Subject: [PATCH 073/193] fix: rename invalid types --- .../FileUploadResponse/SelectedFieldsSchema/DefaultValue.php | 4 ++-- .../DefaultValue/{Mixed.php => Mixed1.php} | 2 +- src/Core/Util.php | 4 ++-- .../CustomMetadataField/Schema/DefaultValue.php | 4 ++-- .../Schema/DefaultValue/{Mixed.php => Mixed1.php} | 2 +- .../CustomMetadataFieldCreateParams/Schema/DefaultValue.php | 4 ++-- .../Schema/DefaultValue/{Mixed.php => Mixed1.php} | 2 +- .../CustomMetadataFieldUpdateParams/Schema/DefaultValue.php | 4 ++-- .../Schema/DefaultValue/{Mixed.php => Mixed1.php} | 2 +- src/Files/File/SelectedFieldsSchema/DefaultValue.php | 4 ++-- .../DefaultValue/{Mixed.php => Mixed1.php} | 2 +- .../FileUploadResponse/SelectedFieldsSchema/DefaultValue.php | 4 ++-- .../DefaultValue/{Mixed.php => Mixed1.php} | 2 +- .../Data/SelectedFieldsSchema/DefaultValue.php | 4 ++-- .../DefaultValue/{Mixed.php => Mixed1.php} | 2 +- 15 files changed, 23 insertions(+), 23 deletions(-) rename src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/{Mixed.php => Mixed1.php} (91%) rename src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/{Mixed.php => Mixed1.php} (91%) rename src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/{Mixed.php => Mixed1.php} (91%) rename src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/{Mixed.php => Mixed1.php} (91%) rename src/Files/File/SelectedFieldsSchema/DefaultValue/{Mixed.php => Mixed1.php} (91%) rename src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/{Mixed.php => Mixed1.php} (91%) rename src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/{Mixed.php => Mixed1.php} (91%) diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php index 95b65241..cb78e96f 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php @@ -4,7 +4,7 @@ namespace ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; -use ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed; +use ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed1; use ImageKit\Core\Concerns\SdkUnion; use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; @@ -22,6 +22,6 @@ final class DefaultValue implements ConverterSource */ public static function variants(): array { - return ['string', 'float', 'bool', new ListOf(Mixed::class)]; + return ['string', 'float', 'bool', new ListOf(Mixed1::class)]; } } diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed1.php similarity index 91% rename from src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed.php rename to src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed1.php index 75472dea..90aeaf70 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed1.php @@ -8,7 +8,7 @@ use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; -final class Mixed implements ConverterSource +final class Mixed1 implements ConverterSource { use SdkUnion; diff --git a/src/Core/Util.php b/src/Core/Util.php index ba3232a3..74798fa3 100644 --- a/src/Core/Util.php +++ b/src/Core/Util.php @@ -28,9 +28,9 @@ final class Util /** * @return array */ - public static function get_object_vars(object $object1): array + public static function get_object_vars(object $object): array { - return get_object_vars($object1); + return get_object_vars($object); } /** diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php index 4d38f231..09b65b08 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php @@ -8,7 +8,7 @@ use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; use ImageKit\Core\Conversion\ListOf; -use ImageKit\CustomMetadataFields\CustomMetadataField\Schema\DefaultValue\Mixed; +use ImageKit\CustomMetadataFields\CustomMetadataField\Schema\DefaultValue\Mixed1; /** * The default value for this custom metadata field. Data type of default value depends on the field type. @@ -22,6 +22,6 @@ final class DefaultValue implements ConverterSource */ public static function variants(): array { - return ['string', 'float', 'bool', new ListOf(Mixed::class)]; + return ['string', 'float', 'bool', new ListOf(Mixed1::class)]; } } diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed.php b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed1.php similarity index 91% rename from src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed.php rename to src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed1.php index 61699711..c6394ea4 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed1.php @@ -8,7 +8,7 @@ use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; -final class Mixed implements ConverterSource +final class Mixed1 implements ConverterSource { use SdkUnion; diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php index ab34df3f..b3de59f9 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php @@ -8,7 +8,7 @@ use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; use ImageKit\Core\Conversion\ListOf; -use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\DefaultValue\Mixed; +use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\DefaultValue\Mixed1; /** * The default value for this custom metadata field. This property is only required if `isValueRequired` property is set to `true`. The value should match the `type` of custom metadata field. @@ -22,6 +22,6 @@ final class DefaultValue implements ConverterSource */ public static function variants(): array { - return ['string', 'float', 'bool', new ListOf(Mixed::class)]; + return ['string', 'float', 'bool', new ListOf(Mixed1::class)]; } } diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed1.php similarity index 91% rename from src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed.php rename to src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed1.php index 6d1ff028..064aa6dc 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed1.php @@ -8,7 +8,7 @@ use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; -final class Mixed implements ConverterSource +final class Mixed1 implements ConverterSource { use SdkUnion; diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php index 78cc80d6..3adb99ef 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php @@ -8,7 +8,7 @@ use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; use ImageKit\Core\Conversion\ListOf; -use ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue\Mixed; +use ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue\Mixed1; /** * The default value for this custom metadata field. This property is only required if `isValueRequired` property is set to `true`. The value should match the `type` of custom metadata field. @@ -22,6 +22,6 @@ final class DefaultValue implements ConverterSource */ public static function variants(): array { - return ['string', 'float', 'bool', new ListOf(Mixed::class)]; + return ['string', 'float', 'bool', new ListOf(Mixed1::class)]; } } diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed1.php similarity index 91% rename from src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed.php rename to src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed1.php index 2da1ea78..668bd228 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed1.php @@ -8,7 +8,7 @@ use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; -final class Mixed implements ConverterSource +final class Mixed1 implements ConverterSource { use SdkUnion; diff --git a/src/Files/File/SelectedFieldsSchema/DefaultValue.php b/src/Files/File/SelectedFieldsSchema/DefaultValue.php index 0a59980c..64f9cb8b 100644 --- a/src/Files/File/SelectedFieldsSchema/DefaultValue.php +++ b/src/Files/File/SelectedFieldsSchema/DefaultValue.php @@ -8,7 +8,7 @@ use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; use ImageKit\Core\Conversion\ListOf; -use ImageKit\Files\File\SelectedFieldsSchema\DefaultValue\Mixed; +use ImageKit\Files\File\SelectedFieldsSchema\DefaultValue\Mixed1; /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. @@ -22,6 +22,6 @@ final class DefaultValue implements ConverterSource */ public static function variants(): array { - return ['string', 'float', 'bool', new ListOf(Mixed::class)]; + return ['string', 'float', 'bool', new ListOf(Mixed1::class)]; } } diff --git a/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed.php b/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed1.php similarity index 91% rename from src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed.php rename to src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed1.php index 5986006e..8e1b6335 100644 --- a/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed.php +++ b/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed1.php @@ -8,7 +8,7 @@ use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; -final class Mixed implements ConverterSource +final class Mixed1 implements ConverterSource { use SdkUnion; diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php index 774c0c9b..9fd5afc3 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php @@ -8,7 +8,7 @@ use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; use ImageKit\Core\Conversion\ListOf; -use ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed; +use ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed1; /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. @@ -22,6 +22,6 @@ final class DefaultValue implements ConverterSource */ public static function variants(): array { - return ['string', 'float', 'bool', new ListOf(Mixed::class)]; + return ['string', 'float', 'bool', new ListOf(Mixed1::class)]; } } diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed1.php similarity index 91% rename from src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed.php rename to src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed1.php index 4779d9fc..f1e7a465 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed1.php @@ -8,7 +8,7 @@ use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; -final class Mixed implements ConverterSource +final class Mixed1 implements ConverterSource { use SdkUnion; diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php index f43a1c4e..faaedb79 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php @@ -8,7 +8,7 @@ use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; use ImageKit\Core\Conversion\ListOf; -use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue\Mixed; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue\Mixed1; /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. @@ -22,6 +22,6 @@ final class DefaultValue implements ConverterSource */ public static function variants(): array { - return ['string', 'float', 'bool', new ListOf(Mixed::class)]; + return ['string', 'float', 'bool', new ListOf(Mixed1::class)]; } } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed1.php similarity index 91% rename from src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed.php rename to src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed1.php index 7af55194..ab030054 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed1.php @@ -8,7 +8,7 @@ use ImageKit\Core\Conversion\Contracts\Converter; use ImageKit\Core\Conversion\Contracts\ConverterSource; -final class Mixed implements ConverterSource +final class Mixed1 implements ConverterSource { use SdkUnion; From 2809bb451cd619af703ec50d29eba0b1a19371cf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 13 Nov 2025 20:52:57 +0000 Subject: [PATCH 074/193] fix(php): fix typo in options parsing --- src/Client.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Client.php b/src/Client.php index e76ee04d..6bf96901 100644 --- a/src/Client.php +++ b/src/Client.php @@ -70,7 +70,7 @@ public function __construct( ?string $baseUrl = null, ) { $this->privateKey = (string) ($privateKey ?? getenv('IMAGEKIT_PRIVATE_KEY')); - $this->password = (string) ($password ?? getenv('OPTIONAL_IMAGEKIT_IGNORES_THIS') ?: PHP.Literal(do_not_set)); + $this->password = (string) ($password ?? getenv('OPTIONAL_IMAGEKIT_IGNORES_THIS') ?: 'do_not_set'); $this->baseUrlOverridden = !is_null($baseUrl); From cecffe1980bb81dedee05968b8046c95c4db02d1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 20 Nov 2025 18:49:31 +0000 Subject: [PATCH 075/193] chore(client): refactor error type constructors --- src/Core/Exceptions/APITimeoutException.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/Exceptions/APITimeoutException.php b/src/Core/Exceptions/APITimeoutException.php index e3397769..94d0216a 100644 --- a/src/Core/Exceptions/APITimeoutException.php +++ b/src/Core/Exceptions/APITimeoutException.php @@ -10,7 +10,7 @@ class APITimeoutException extends APIConnectionException protected const DESC = 'ImageKit API Timeout Exception'; public function __construct( - public RequestInterface $request, + RequestInterface $request, ?\Throwable $previous = null, string $message = 'Request timed out.', ) { From 4cb4ba01a9054a10d74cad43d64228f685bfde2e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 24 Nov 2025 20:01:08 +0000 Subject: [PATCH 076/193] fix: phpStan linter errors --- src/Core/BaseClient.php | 2 +- src/Core/Concerns/SdkParams.php | 3 +-- src/Core/Util.php | 11 +++++++++-- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/Core/BaseClient.php b/src/Core/BaseClient.php index be05bc19..9cc18ee2 100644 --- a/src/Core/BaseClient.php +++ b/src/Core/BaseClient.php @@ -287,8 +287,8 @@ protected function sendRequest( ): ResponseInterface { assert(null !== $opts->streamFactory && null !== $opts->transporter); + /** @var RequestInterface */ $req = $req->withHeader('X-Stainless-Retry-Count', strval($retryCount)); - $req = Util::withSetBody($opts->streamFactory, req: $req, body: $data); $rsp = null; diff --git a/src/Core/Concerns/SdkParams.php b/src/Core/Concerns/SdkParams.php index 2797d525..f6cbd5ca 100644 --- a/src/Core/Concerns/SdkParams.php +++ b/src/Core/Concerns/SdkParams.php @@ -15,12 +15,11 @@ trait SdkParams { /** - * @param array|self|null $params * @param array|RequestOptions|null $options * * @return array{array, RequestOptions} */ - public static function parseRequest(array|self|null $params, array|RequestOptions|null $options): array + public static function parseRequest(mixed $params, array|RequestOptions|null $options): array { $value = is_array($params) ? Util::array_filter_omit($params) : $params; $converter = self::converter(); diff --git a/src/Core/Util.php b/src/Core/Util.php index 74798fa3..556718e2 100644 --- a/src/Core/Util.php +++ b/src/Core/Util.php @@ -52,9 +52,9 @@ public static function array_transform_keys(array $array, array $map): array } /** - * @param array $arr + * @param array $arr * - * @return array + * @return array */ public static function array_filter_omit(array $arr): array { @@ -149,6 +149,7 @@ public static function withSetHeaders( ): RequestInterface { foreach ($headers as $name => $value) { if (is_null($value)) { + /** @var RequestInterface */ $req = $req->withoutHeader($name); } else { $value = is_int($value) @@ -156,6 +157,8 @@ public static function withSetHeaders( : (is_array($value) ? array_map(static fn ($v) => (string) $v, array: $value) : $value); + + /** @var RequestInterface */ $req = $req->withHeader($name, $value); } } @@ -190,6 +193,7 @@ public static function withSetBody( mixed $body ): RequestInterface { if ($body instanceof StreamInterface) { + /** @var RequestInterface */ return $req->withBody($body); } @@ -199,6 +203,7 @@ public static function withSetBody( $encoded = json_encode($body, flags: self::JSON_ENCODE_FLAGS); $stream = $factory->createStream($encoded); + /** @var RequestInterface */ return $req->withBody($stream); } } @@ -208,12 +213,14 @@ public static function withSetBody( $encoded = implode('', iterator_to_array($gen)); $stream = $factory->createStream($encoded); + /** @var RequestInterface */ return $req->withHeader('Content-Type', "{$contentType}; boundary={$boundary}")->withBody($stream); } if (is_resource($body)) { $stream = $factory->createStreamFromResource($body); + /** @var RequestInterface */ return $req->withBody($stream); } From 2a67006f8a94fec12ca7d862cd6340d6a1b39f4e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Nov 2025 15:52:04 +0000 Subject: [PATCH 077/193] chore: use single quote strings --- README.md | 26 +++++++++---------- src/Accounts/Origins/OriginCreateParams.php | 4 +-- .../Origins/OriginRequest/AkeneoPim.php | 4 +-- .../Origins/OriginRequest/AzureBlob.php | 4 +-- .../OriginRequest/CloudinaryBackup.php | 4 +-- src/Accounts/Origins/OriginRequest/Gcs.php | 4 +-- src/Accounts/Origins/OriginRequest/S3.php | 4 +-- .../Origins/OriginRequest/S3Compatible.php | 4 +-- .../Origins/OriginRequest/WebFolder.php | 4 +-- .../Origins/OriginRequest/WebProxy.php | 4 +-- .../Origins/OriginResponse/AkeneoPim.php | 4 +-- .../Origins/OriginResponse/AzureBlob.php | 4 +-- .../OriginResponse/CloudinaryBackup.php | 4 +-- src/Accounts/Origins/OriginResponse/Gcs.php | 4 +-- src/Accounts/Origins/OriginResponse/S3.php | 4 +-- .../Origins/OriginResponse/S3Compatible.php | 4 +-- .../Origins/OriginResponse/WebFolder.php | 4 +-- .../Origins/OriginResponse/WebProxy.php | 4 +-- src/Accounts/Origins/OriginUpdateParams.php | 4 +-- .../URLRewriter/Akamai.php | 4 +-- .../URLRewriter/Cloudinary.php | 4 +-- .../URLRewriter/Imgix.php | 4 +-- .../URLEndpointRequest/URLRewriter/Akamai.php | 4 +-- .../URLRewriter/Cloudinary.php | 4 +-- .../URLEndpointRequest/URLRewriter/Imgix.php | 4 +-- .../URLRewriter/Akamai.php | 4 +-- .../URLRewriter/Cloudinary.php | 4 +-- .../URLEndpointResponse/URLRewriter/Imgix.php | 4 +-- .../URLRewriter/Akamai.php | 4 +-- .../URLRewriter/Cloudinary.php | 4 +-- .../URLRewriter/Imgix.php | 4 +-- .../Transformation/Post/Abs.php | 4 +-- .../Transformation/Post/GifToVideo.php | 4 +-- .../Transformation/Post/Thumbnail.php | 4 +-- .../Transformation/Post/Transformation.php | 4 +-- src/ExtensionItem/AIAutoDescription.php | 4 +-- src/ExtensionItem/RemoveBg.php | 4 +-- src/Files/FileUpdateParams.php | 8 +++--- .../Transformation/Post/Abs.php | 4 +-- .../Transformation/Post/GifToVideo.php | 4 +-- .../Transformation/Post/Thumbnail.php | 4 +-- .../Transformation/Post/Transformation.php | 4 +-- .../UpdateFileRequest/UpdateFileDetails.php | 8 +++--- src/ImageOverlay.php | 4 +-- src/Services/AssetsService.php | 4 +-- src/Services/Beta/V2/FilesService.php | 2 +- src/Services/CustomMetadataFieldsService.php | 2 +- src/Services/FilesService.php | 2 +- src/SolidColorOverlay.php | 4 +-- src/SolidColorOverlayTransformation.php | 8 +++--- src/SubtitleOverlay.php | 4 +-- src/TextOverlay.php | 4 +-- src/TextOverlayTransformation.php | 8 +++--- src/Transformation.php | 8 +++--- src/VideoOverlay.php | 4 +-- tests/Services/Accounts/OriginsTest.php | 8 +++--- 56 files changed, 132 insertions(+), 132 deletions(-) diff --git a/README.md b/README.md index ab04349a..8ef475a2 100644 --- a/README.md +++ b/README.md @@ -42,13 +42,13 @@ Parameters with a default value must be set by name. use ImageKit\Client; $client = new Client( - privateKey: getenv("IMAGEKIT_PRIVATE_KEY") ?: "My Private Key", - password: getenv("OPTIONAL_IMAGEKIT_IGNORES_THIS") ?: "do_not_set", + privateKey: getenv('IMAGEKIT_PRIVATE_KEY') ?: 'My Private Key', + password: getenv('OPTIONAL_IMAGEKIT_IGNORES_THIS') ?: 'do_not_set', ); $response = $client->files->upload([ - "file" => "https://www.example.com/public-url.jpg", - "fileName" => "file-name.jpg", + 'file' => 'https://www.example.com/public-url.jpg', + 'fileName' => 'file-name.jpg', ]); var_dump($response->videoCodec); @@ -72,8 +72,8 @@ use ImageKit\Core\Exceptions\APIConnectionException; try { $response = $client->files->upload([ - "file" => "https://www.example.com/public-url.jpg", - "fileName" => "file-name.jpg", + 'file' => 'https://www.example.com/public-url.jpg', + 'fileName' => 'file-name.jpg', ]); } catch (APIConnectionException $e) { echo "The server could not be reached", PHP_EOL; @@ -122,8 +122,8 @@ $client = new Client(maxRetries: 0); // Or, configure per-request: $result = $client->files->upload( [ - "file" => "https://www.example.com/public-url.jpg", - "fileName" => "file-name.jpg", + 'file' => 'https://www.example.com/public-url.jpg', + 'fileName' => 'file-name.jpg', ], RequestOptions::with(maxRetries: 5), ); @@ -146,13 +146,13 @@ use ImageKit\RequestOptions; $response = $client->files->upload( [ - "file" => "https://www.example.com/public-url.jpg", - "fileName" => "file-name.jpg", + 'file' => 'https://www.example.com/public-url.jpg', + 'fileName' => 'file-name.jpg', ], RequestOptions::with( - extraQueryParams: ["my_query_parameter" => "value"], - extraBodyParams: ["my_body_parameter" => "value"], - extraHeaders: ["my-header" => "value"], + extraQueryParams: ['my_query_parameter' => 'value'], + extraBodyParams: ['my_body_parameter' => 'value'], + extraHeaders: ['my-header' => 'value'], ), ); ``` diff --git a/src/Accounts/Origins/OriginCreateParams.php b/src/Accounts/Origins/OriginCreateParams.php index 04b6afaa..fa203eaf 100644 --- a/src/Accounts/Origins/OriginCreateParams.php +++ b/src/Accounts/Origins/OriginCreateParams.php @@ -20,7 +20,7 @@ * bucket: string, * name: string, * secretKey: string, - * type: "AKENEO_PIM", + * type: 'AKENEO_PIM', * baseUrlForCanonicalHeader?: string, * includeCanonicalHeader?: bool, * prefix?: string, @@ -45,7 +45,7 @@ final class OriginCreateParams implements BaseModel use SdkModel; use SdkParams; - /** @var "AKENEO_PIM" $type */ + /** @var 'AKENEO_PIM' $type */ #[Api] public string $type = 'AKENEO_PIM'; diff --git a/src/Accounts/Origins/OriginRequest/AkeneoPim.php b/src/Accounts/Origins/OriginRequest/AkeneoPim.php index 03b252e2..bf5080f0 100644 --- a/src/Accounts/Origins/OriginRequest/AkeneoPim.php +++ b/src/Accounts/Origins/OriginRequest/AkeneoPim.php @@ -15,7 +15,7 @@ * clientSecret: string, * name: string, * password: string, - * type: "AKENEO_PIM", + * type: 'AKENEO_PIM', * username: string, * baseUrlForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, @@ -26,7 +26,7 @@ final class AkeneoPim implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "AKENEO_PIM" $type */ + /** @var 'AKENEO_PIM' $type */ #[Api] public string $type = 'AKENEO_PIM'; diff --git a/src/Accounts/Origins/OriginRequest/AzureBlob.php b/src/Accounts/Origins/OriginRequest/AzureBlob.php index 69b1ae89..ef743bf4 100644 --- a/src/Accounts/Origins/OriginRequest/AzureBlob.php +++ b/src/Accounts/Origins/OriginRequest/AzureBlob.php @@ -14,7 +14,7 @@ * container: string, * name: string, * sasToken: string, - * type: "AZURE_BLOB", + * type: 'AZURE_BLOB', * baseUrlForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * prefix?: string|null, @@ -25,7 +25,7 @@ final class AzureBlob implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "AZURE_BLOB" $type */ + /** @var 'AZURE_BLOB' $type */ #[Api] public string $type = 'AZURE_BLOB'; diff --git a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php index 4a1a4fba..b30dd831 100644 --- a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php @@ -14,7 +14,7 @@ * bucket: string, * name: string, * secretKey: string, - * type: "CLOUDINARY_BACKUP", + * type: 'CLOUDINARY_BACKUP', * baseUrlForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * prefix?: string|null, @@ -25,7 +25,7 @@ final class CloudinaryBackup implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "CLOUDINARY_BACKUP" $type */ + /** @var 'CLOUDINARY_BACKUP' $type */ #[Api] public string $type = 'CLOUDINARY_BACKUP'; diff --git a/src/Accounts/Origins/OriginRequest/Gcs.php b/src/Accounts/Origins/OriginRequest/Gcs.php index 9ccf0ae7..8c539ffc 100644 --- a/src/Accounts/Origins/OriginRequest/Gcs.php +++ b/src/Accounts/Origins/OriginRequest/Gcs.php @@ -14,7 +14,7 @@ * clientEmail: string, * name: string, * privateKey: string, - * type: "GCS", + * type: 'GCS', * baseUrlForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * prefix?: string|null, @@ -25,7 +25,7 @@ final class Gcs implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "GCS" $type */ + /** @var 'GCS' $type */ #[Api] public string $type = 'GCS'; diff --git a/src/Accounts/Origins/OriginRequest/S3.php b/src/Accounts/Origins/OriginRequest/S3.php index ad1297e4..9886a4eb 100644 --- a/src/Accounts/Origins/OriginRequest/S3.php +++ b/src/Accounts/Origins/OriginRequest/S3.php @@ -14,7 +14,7 @@ * bucket: string, * name: string, * secretKey: string, - * type: "S3", + * type: 'S3', * baseUrlForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * prefix?: string|null, @@ -25,7 +25,7 @@ final class S3 implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "S3" $type */ + /** @var 'S3' $type */ #[Api] public string $type = 'S3'; diff --git a/src/Accounts/Origins/OriginRequest/S3Compatible.php b/src/Accounts/Origins/OriginRequest/S3Compatible.php index 77602543..29e40e57 100644 --- a/src/Accounts/Origins/OriginRequest/S3Compatible.php +++ b/src/Accounts/Origins/OriginRequest/S3Compatible.php @@ -15,7 +15,7 @@ * endpoint: string, * name: string, * secretKey: string, - * type: "S3_COMPATIBLE", + * type: 'S3_COMPATIBLE', * baseUrlForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * prefix?: string|null, @@ -27,7 +27,7 @@ final class S3Compatible implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "S3_COMPATIBLE" $type */ + /** @var 'S3_COMPATIBLE' $type */ #[Api] public string $type = 'S3_COMPATIBLE'; diff --git a/src/Accounts/Origins/OriginRequest/WebFolder.php b/src/Accounts/Origins/OriginRequest/WebFolder.php index c482cc16..e6c41de7 100644 --- a/src/Accounts/Origins/OriginRequest/WebFolder.php +++ b/src/Accounts/Origins/OriginRequest/WebFolder.php @@ -12,7 +12,7 @@ * @phpstan-type WebFolderShape = array{ * baseUrl: string, * name: string, - * type: "WEB_FOLDER", + * type: 'WEB_FOLDER', * baseUrlForCanonicalHeader?: string|null, * forwardHostHeaderToOrigin?: bool|null, * includeCanonicalHeader?: bool|null, @@ -23,7 +23,7 @@ final class WebFolder implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "WEB_FOLDER" $type */ + /** @var 'WEB_FOLDER' $type */ #[Api] public string $type = 'WEB_FOLDER'; diff --git a/src/Accounts/Origins/OriginRequest/WebProxy.php b/src/Accounts/Origins/OriginRequest/WebProxy.php index 54ee74fd..8408222e 100644 --- a/src/Accounts/Origins/OriginRequest/WebProxy.php +++ b/src/Accounts/Origins/OriginRequest/WebProxy.php @@ -11,7 +11,7 @@ /** * @phpstan-type WebProxyShape = array{ * name: string, - * type: "WEB_PROXY", + * type: 'WEB_PROXY', * baseUrlForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * } @@ -21,7 +21,7 @@ final class WebProxy implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "WEB_PROXY" $type */ + /** @var 'WEB_PROXY' $type */ #[Api] public string $type = 'WEB_PROXY'; diff --git a/src/Accounts/Origins/OriginResponse/AkeneoPim.php b/src/Accounts/Origins/OriginResponse/AkeneoPim.php index 56c76b55..b03178d8 100644 --- a/src/Accounts/Origins/OriginResponse/AkeneoPim.php +++ b/src/Accounts/Origins/OriginResponse/AkeneoPim.php @@ -14,7 +14,7 @@ * baseUrl: string, * includeCanonicalHeader: bool, * name: string, - * type: "AKENEO_PIM", + * type: 'AKENEO_PIM', * baseUrlForCanonicalHeader?: string|null, * } */ @@ -23,7 +23,7 @@ final class AkeneoPim implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "AKENEO_PIM" $type */ + /** @var 'AKENEO_PIM' $type */ #[Api] public string $type = 'AKENEO_PIM'; diff --git a/src/Accounts/Origins/OriginResponse/AzureBlob.php b/src/Accounts/Origins/OriginResponse/AzureBlob.php index e44b3d00..832d5195 100644 --- a/src/Accounts/Origins/OriginResponse/AzureBlob.php +++ b/src/Accounts/Origins/OriginResponse/AzureBlob.php @@ -16,7 +16,7 @@ * includeCanonicalHeader: bool, * name: string, * prefix: string, - * type: "AZURE_BLOB", + * type: 'AZURE_BLOB', * baseUrlForCanonicalHeader?: string|null, * } */ @@ -25,7 +25,7 @@ final class AzureBlob implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "AZURE_BLOB" $type */ + /** @var 'AZURE_BLOB' $type */ #[Api] public string $type = 'AZURE_BLOB'; diff --git a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php index a7db701d..360dd86d 100644 --- a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php @@ -15,7 +15,7 @@ * includeCanonicalHeader: bool, * name: string, * prefix: string, - * type: "CLOUDINARY_BACKUP", + * type: 'CLOUDINARY_BACKUP', * baseUrlForCanonicalHeader?: string|null, * } */ @@ -24,7 +24,7 @@ final class CloudinaryBackup implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "CLOUDINARY_BACKUP" $type */ + /** @var 'CLOUDINARY_BACKUP' $type */ #[Api] public string $type = 'CLOUDINARY_BACKUP'; diff --git a/src/Accounts/Origins/OriginResponse/Gcs.php b/src/Accounts/Origins/OriginResponse/Gcs.php index 508d56c4..bc5edc5a 100644 --- a/src/Accounts/Origins/OriginResponse/Gcs.php +++ b/src/Accounts/Origins/OriginResponse/Gcs.php @@ -16,7 +16,7 @@ * includeCanonicalHeader: bool, * name: string, * prefix: string, - * type: "GCS", + * type: 'GCS', * baseUrlForCanonicalHeader?: string|null, * } */ @@ -25,7 +25,7 @@ final class Gcs implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "GCS" $type */ + /** @var 'GCS' $type */ #[Api] public string $type = 'GCS'; diff --git a/src/Accounts/Origins/OriginResponse/S3.php b/src/Accounts/Origins/OriginResponse/S3.php index dd790e55..a4e5742f 100644 --- a/src/Accounts/Origins/OriginResponse/S3.php +++ b/src/Accounts/Origins/OriginResponse/S3.php @@ -15,7 +15,7 @@ * includeCanonicalHeader: bool, * name: string, * prefix: string, - * type: "S3", + * type: 'S3', * baseUrlForCanonicalHeader?: string|null, * } */ @@ -24,7 +24,7 @@ final class S3 implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "S3" $type */ + /** @var 'S3' $type */ #[Api] public string $type = 'S3'; diff --git a/src/Accounts/Origins/OriginResponse/S3Compatible.php b/src/Accounts/Origins/OriginResponse/S3Compatible.php index 2fee9615..7db13ab0 100644 --- a/src/Accounts/Origins/OriginResponse/S3Compatible.php +++ b/src/Accounts/Origins/OriginResponse/S3Compatible.php @@ -17,7 +17,7 @@ * name: string, * prefix: string, * s3ForcePathStyle: bool, - * type: "S3_COMPATIBLE", + * type: 'S3_COMPATIBLE', * baseUrlForCanonicalHeader?: string|null, * } */ @@ -26,7 +26,7 @@ final class S3Compatible implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "S3_COMPATIBLE" $type */ + /** @var 'S3_COMPATIBLE' $type */ #[Api] public string $type = 'S3_COMPATIBLE'; diff --git a/src/Accounts/Origins/OriginResponse/WebFolder.php b/src/Accounts/Origins/OriginResponse/WebFolder.php index d2202768..34d87e50 100644 --- a/src/Accounts/Origins/OriginResponse/WebFolder.php +++ b/src/Accounts/Origins/OriginResponse/WebFolder.php @@ -15,7 +15,7 @@ * forwardHostHeaderToOrigin: bool, * includeCanonicalHeader: bool, * name: string, - * type: "WEB_FOLDER", + * type: 'WEB_FOLDER', * baseUrlForCanonicalHeader?: string|null, * } */ @@ -24,7 +24,7 @@ final class WebFolder implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "WEB_FOLDER" $type */ + /** @var 'WEB_FOLDER' $type */ #[Api] public string $type = 'WEB_FOLDER'; diff --git a/src/Accounts/Origins/OriginResponse/WebProxy.php b/src/Accounts/Origins/OriginResponse/WebProxy.php index 6e2801b4..ee6cb00a 100644 --- a/src/Accounts/Origins/OriginResponse/WebProxy.php +++ b/src/Accounts/Origins/OriginResponse/WebProxy.php @@ -13,7 +13,7 @@ * id: string, * includeCanonicalHeader: bool, * name: string, - * type: "WEB_PROXY", + * type: 'WEB_PROXY', * baseUrlForCanonicalHeader?: string|null, * } */ @@ -22,7 +22,7 @@ final class WebProxy implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "WEB_PROXY" $type */ + /** @var 'WEB_PROXY' $type */ #[Api] public string $type = 'WEB_PROXY'; diff --git a/src/Accounts/Origins/OriginUpdateParams.php b/src/Accounts/Origins/OriginUpdateParams.php index 15880724..6309661a 100644 --- a/src/Accounts/Origins/OriginUpdateParams.php +++ b/src/Accounts/Origins/OriginUpdateParams.php @@ -20,7 +20,7 @@ * bucket: string, * name: string, * secretKey: string, - * type: "AKENEO_PIM", + * type: 'AKENEO_PIM', * baseUrlForCanonicalHeader?: string, * includeCanonicalHeader?: bool, * prefix?: string, @@ -45,7 +45,7 @@ final class OriginUpdateParams implements BaseModel use SdkModel; use SdkParams; - /** @var "AKENEO_PIM" $type */ + /** @var 'AKENEO_PIM' $type */ #[Api] public string $type = 'AKENEO_PIM'; diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php index 63a33094..c4e5c4dc 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php @@ -9,14 +9,14 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type AkamaiShape = array{type: "AKAMAI"} + * @phpstan-type AkamaiShape = array{type: 'AKAMAI'} */ final class Akamai implements BaseModel { /** @use SdkModel */ use SdkModel; - /** @var "AKAMAI" $type */ + /** @var 'AKAMAI' $type */ #[Api] public string $type = 'AKAMAI'; diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php index 4fca97d5..309a97f8 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php @@ -10,7 +10,7 @@ /** * @phpstan-type CloudinaryShape = array{ - * type: "CLOUDINARY", preserveAssetDeliveryTypes?: bool|null + * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null * } */ final class Cloudinary implements BaseModel @@ -18,7 +18,7 @@ final class Cloudinary implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "CLOUDINARY" $type */ + /** @var 'CLOUDINARY' $type */ #[Api] public string $type = 'CLOUDINARY'; diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php index 444a6702..f6ab1caa 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php @@ -9,14 +9,14 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type ImgixShape = array{type: "IMGIX"} + * @phpstan-type ImgixShape = array{type: 'IMGIX'} */ final class Imgix implements BaseModel { /** @use SdkModel */ use SdkModel; - /** @var "IMGIX" $type */ + /** @var 'IMGIX' $type */ #[Api] public string $type = 'IMGIX'; diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php index 69c71709..0064ffd0 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php @@ -9,14 +9,14 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type AkamaiShape = array{type: "AKAMAI"} + * @phpstan-type AkamaiShape = array{type: 'AKAMAI'} */ final class Akamai implements BaseModel { /** @use SdkModel */ use SdkModel; - /** @var "AKAMAI" $type */ + /** @var 'AKAMAI' $type */ #[Api] public string $type = 'AKAMAI'; diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php index 5b093623..b2640680 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php @@ -10,7 +10,7 @@ /** * @phpstan-type CloudinaryShape = array{ - * type: "CLOUDINARY", preserveAssetDeliveryTypes?: bool|null + * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null * } */ final class Cloudinary implements BaseModel @@ -18,7 +18,7 @@ final class Cloudinary implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "CLOUDINARY" $type */ + /** @var 'CLOUDINARY' $type */ #[Api] public string $type = 'CLOUDINARY'; diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php index 40532eab..11fddcec 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php @@ -9,14 +9,14 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type ImgixShape = array{type: "IMGIX"} + * @phpstan-type ImgixShape = array{type: 'IMGIX'} */ final class Imgix implements BaseModel { /** @use SdkModel */ use SdkModel; - /** @var "IMGIX" $type */ + /** @var 'IMGIX' $type */ #[Api] public string $type = 'IMGIX'; diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php index 25404af0..2ef54321 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php @@ -9,14 +9,14 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type AkamaiShape = array{type: "AKAMAI"} + * @phpstan-type AkamaiShape = array{type: 'AKAMAI'} */ final class Akamai implements BaseModel { /** @use SdkModel */ use SdkModel; - /** @var "AKAMAI" $type */ + /** @var 'AKAMAI' $type */ #[Api] public string $type = 'AKAMAI'; diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php index 34e3e009..be5ca4db 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php @@ -10,7 +10,7 @@ /** * @phpstan-type CloudinaryShape = array{ - * preserveAssetDeliveryTypes: bool, type: "CLOUDINARY" + * preserveAssetDeliveryTypes: bool, type: 'CLOUDINARY' * } */ final class Cloudinary implements BaseModel @@ -18,7 +18,7 @@ final class Cloudinary implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "CLOUDINARY" $type */ + /** @var 'CLOUDINARY' $type */ #[Api] public string $type = 'CLOUDINARY'; diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php index 1728d849..b78f7dc6 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php @@ -9,14 +9,14 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type ImgixShape = array{type: "IMGIX"} + * @phpstan-type ImgixShape = array{type: 'IMGIX'} */ final class Imgix implements BaseModel { /** @use SdkModel */ use SdkModel; - /** @var "IMGIX" $type */ + /** @var 'IMGIX' $type */ #[Api] public string $type = 'IMGIX'; diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php index 379b3a3a..b611107e 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php @@ -9,14 +9,14 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type AkamaiShape = array{type: "AKAMAI"} + * @phpstan-type AkamaiShape = array{type: 'AKAMAI'} */ final class Akamai implements BaseModel { /** @use SdkModel */ use SdkModel; - /** @var "AKAMAI" $type */ + /** @var 'AKAMAI' $type */ #[Api] public string $type = 'AKAMAI'; diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php index e7c6f229..24c8107c 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php @@ -10,7 +10,7 @@ /** * @phpstan-type CloudinaryShape = array{ - * type: "CLOUDINARY", preserveAssetDeliveryTypes?: bool|null + * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null * } */ final class Cloudinary implements BaseModel @@ -18,7 +18,7 @@ final class Cloudinary implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "CLOUDINARY" $type */ + /** @var 'CLOUDINARY' $type */ #[Api] public string $type = 'CLOUDINARY'; diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php index 64b71ce7..7e4bbd7f 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php @@ -9,14 +9,14 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type ImgixShape = array{type: "IMGIX"} + * @phpstan-type ImgixShape = array{type: 'IMGIX'} */ final class Imgix implements BaseModel { /** @use SdkModel */ use SdkModel; - /** @var "IMGIX" $type */ + /** @var 'IMGIX' $type */ #[Api] public string $type = 'IMGIX'; diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php index bff5a2ee..39f0e749 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php @@ -11,7 +11,7 @@ /** * @phpstan-type AbsShape = array{ - * protocol: value-of, type: "abs", value: string + * protocol: value-of, type: 'abs', value: string * } */ final class Abs implements BaseModel @@ -22,7 +22,7 @@ final class Abs implements BaseModel /** * Adaptive Bitrate Streaming (ABS) setup. * - * @var "abs" $type + * @var 'abs' $type */ #[Api] public string $type = 'abs'; diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php index 84002589..513f7375 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type GifToVideoShape = array{type: "gif-to-video", value?: string|null} + * @phpstan-type GifToVideoShape = array{type: 'gif-to-video', value?: string|null} */ final class GifToVideo implements BaseModel { @@ -19,7 +19,7 @@ final class GifToVideo implements BaseModel /** * Converts an animated GIF into an MP4. * - * @var "gif-to-video" $type + * @var 'gif-to-video' $type */ #[Api] public string $type = 'gif-to-video'; diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php index c184880f..e2939bd0 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type ThumbnailShape = array{type: "thumbnail", value?: string|null} + * @phpstan-type ThumbnailShape = array{type: 'thumbnail', value?: string|null} */ final class Thumbnail implements BaseModel { @@ -19,7 +19,7 @@ final class Thumbnail implements BaseModel /** * Generates a thumbnail image. * - * @var "thumbnail" $type + * @var 'thumbnail' $type */ #[Api] public string $type = 'thumbnail'; diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php index 436f9f92..72267248 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type TransformationShape = array{type: "transformation", value: string} + * @phpstan-type TransformationShape = array{type: 'transformation', value: string} */ final class Transformation implements BaseModel { @@ -19,7 +19,7 @@ final class Transformation implements BaseModel /** * Transformation type. * - * @var "transformation" $type + * @var 'transformation' $type */ #[Api] public string $type = 'transformation'; diff --git a/src/ExtensionItem/AIAutoDescription.php b/src/ExtensionItem/AIAutoDescription.php index 1a704e45..f07380a7 100644 --- a/src/ExtensionItem/AIAutoDescription.php +++ b/src/ExtensionItem/AIAutoDescription.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type AIAutoDescriptionShape = array{name: "ai-auto-description"} + * @phpstan-type AIAutoDescriptionShape = array{name: 'ai-auto-description'} */ final class AIAutoDescription implements BaseModel { @@ -19,7 +19,7 @@ final class AIAutoDescription implements BaseModel /** * Specifies the auto description extension. * - * @var "ai-auto-description" $name + * @var 'ai-auto-description' $name */ #[Api] public string $name = 'ai-auto-description'; diff --git a/src/ExtensionItem/RemoveBg.php b/src/ExtensionItem/RemoveBg.php index d22a7011..3a724641 100644 --- a/src/ExtensionItem/RemoveBg.php +++ b/src/ExtensionItem/RemoveBg.php @@ -10,7 +10,7 @@ use ImageKit\ExtensionItem\RemoveBg\Options; /** - * @phpstan-type RemoveBgShape = array{name: "remove-bg", options?: Options|null} + * @phpstan-type RemoveBgShape = array{name: 'remove-bg', options?: Options|null} */ final class RemoveBg implements BaseModel { @@ -20,7 +20,7 @@ final class RemoveBg implements BaseModel /** * Specifies the background removal extension. * - * @var "remove-bg" $name + * @var 'remove-bg' $name */ #[Api] public string $name = 'remove-bg'; diff --git a/src/Files/FileUpdateParams.php b/src/Files/FileUpdateParams.php index 22e81329..da425a65 100644 --- a/src/Files/FileUpdateParams.php +++ b/src/Files/FileUpdateParams.php @@ -25,7 +25,7 @@ * customMetadata?: array, * description?: string, * extensions?: list, - * removeAITags?: "all"|list, + * removeAITags?: 'all'|list, * tags?: list|null, * webhookUrl?: string, * publish?: Publish, @@ -72,7 +72,7 @@ final class FileUpdateParams implements BaseModel * * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. * - * @var "all"|list|null $removeAITags + * @var 'all'|list|null $removeAITags */ #[Api(union: RemoveAITags::class, optional: true)] public string|array|null $removeAITags; @@ -109,7 +109,7 @@ public function __construct() * * @param array $customMetadata * @param list $extensions - * @param "all"|list $removeAITags + * @param 'all'|list $removeAITags * @param list|null $tags */ public static function with( @@ -191,7 +191,7 @@ public function withExtensions(array $extensions): self * * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. * - * @param "all"|list $removeAITags + * @param 'all'|list $removeAITags */ public function withRemoveAITags(string|array $removeAITags): self { diff --git a/src/Files/FileUploadParams/Transformation/Post/Abs.php b/src/Files/FileUploadParams/Transformation/Post/Abs.php index 69d350e5..66e47a43 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Abs.php +++ b/src/Files/FileUploadParams/Transformation/Post/Abs.php @@ -11,7 +11,7 @@ /** * @phpstan-type AbsShape = array{ - * protocol: value-of, type: "abs", value: string + * protocol: value-of, type: 'abs', value: string * } */ final class Abs implements BaseModel @@ -22,7 +22,7 @@ final class Abs implements BaseModel /** * Adaptive Bitrate Streaming (ABS) setup. * - * @var "abs" $type + * @var 'abs' $type */ #[Api] public string $type = 'abs'; diff --git a/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php b/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php index a68c9793..02cd1e14 100644 --- a/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php +++ b/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type GifToVideoShape = array{type: "gif-to-video", value?: string|null} + * @phpstan-type GifToVideoShape = array{type: 'gif-to-video', value?: string|null} */ final class GifToVideo implements BaseModel { @@ -19,7 +19,7 @@ final class GifToVideo implements BaseModel /** * Converts an animated GIF into an MP4. * - * @var "gif-to-video" $type + * @var 'gif-to-video' $type */ #[Api] public string $type = 'gif-to-video'; diff --git a/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php b/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php index 8153291c..7d1d1cb2 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php +++ b/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type ThumbnailShape = array{type: "thumbnail", value?: string|null} + * @phpstan-type ThumbnailShape = array{type: 'thumbnail', value?: string|null} */ final class Thumbnail implements BaseModel { @@ -19,7 +19,7 @@ final class Thumbnail implements BaseModel /** * Generates a thumbnail image. * - * @var "thumbnail" $type + * @var 'thumbnail' $type */ #[Api] public string $type = 'thumbnail'; diff --git a/src/Files/FileUploadParams/Transformation/Post/Transformation.php b/src/Files/FileUploadParams/Transformation/Post/Transformation.php index afa7d09a..299dd06c 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Transformation.php +++ b/src/Files/FileUploadParams/Transformation/Post/Transformation.php @@ -9,7 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-type TransformationShape = array{type: "transformation", value: string} + * @phpstan-type TransformationShape = array{type: 'transformation', value: string} */ final class Transformation implements BaseModel { @@ -19,7 +19,7 @@ final class Transformation implements BaseModel /** * Transformation type. * - * @var "transformation" $type + * @var 'transformation' $type */ #[Api] public string $type = 'transformation'; diff --git a/src/Files/UpdateFileRequest/UpdateFileDetails.php b/src/Files/UpdateFileRequest/UpdateFileDetails.php index 0e02e728..b81158c3 100644 --- a/src/Files/UpdateFileRequest/UpdateFileDetails.php +++ b/src/Files/UpdateFileRequest/UpdateFileDetails.php @@ -19,7 +19,7 @@ * customMetadata?: array|null, * description?: string|null, * extensions?: list|null, - * removeAITags?: null|"all"|list, + * removeAITags?: null|'all'|list, * tags?: list|null, * webhookUrl?: string|null, * } @@ -64,7 +64,7 @@ final class UpdateFileDetails implements BaseModel * * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. * - * @var "all"|list|null $removeAITags + * @var 'all'|list|null $removeAITags */ #[Api(union: RemoveAITags::class, optional: true)] public string|array|null $removeAITags; @@ -95,7 +95,7 @@ public function __construct() * * @param array $customMetadata * @param list $extensions - * @param "all"|list $removeAITags + * @param 'all'|list $removeAITags * @param list|null $tags */ public static function with( @@ -175,7 +175,7 @@ public function withExtensions(array $extensions): self * * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. * - * @param "all"|list $removeAITags + * @param 'all'|list $removeAITags */ public function withRemoveAITags(string|array $removeAITags): self { diff --git a/src/ImageOverlay.php b/src/ImageOverlay.php index 50d423bd..06641bfe 100644 --- a/src/ImageOverlay.php +++ b/src/ImageOverlay.php @@ -14,7 +14,7 @@ * position?: OverlayPosition|null, * timing?: OverlayTiming|null, * input: string, - * type: "image", + * type: 'image', * encoding?: value-of|null, * transformation?: list|null, * } @@ -24,7 +24,7 @@ final class ImageOverlay implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "image" $type */ + /** @var 'image' $type */ #[Api] public string $type = 'image'; diff --git a/src/Services/AssetsService.php b/src/Services/AssetsService.php index 22e91eef..847fde85 100644 --- a/src/Services/AssetsService.php +++ b/src/Services/AssetsService.php @@ -28,13 +28,13 @@ public function __construct(private Client $client) {} * This API can list all the uploaded files and folders in your ImageKit.io media library. In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and provide this generated string as the value of the `searchQuery`. * * @param array{ - * fileType?: "all"|"image"|"non-image", + * fileType?: 'all'|'image'|'non-image', * limit?: int, * path?: string, * searchQuery?: string, * skip?: int, * sort?: value-of, - * type?: "file"|"file-version"|"folder"|"all", + * type?: 'file'|'file-version'|'folder'|'all', * }|AssetListParams $params * * @return list diff --git a/src/Services/Beta/V2/FilesService.php b/src/Services/Beta/V2/FilesService.php index 444e93bd..50a9f2ea 100644 --- a/src/Services/Beta/V2/FilesService.php +++ b/src/Services/Beta/V2/FilesService.php @@ -52,7 +52,7 @@ public function __construct(private Client $client) {} * overwriteCustomMetadata?: bool, * overwriteFile?: bool, * overwriteTags?: bool, - * responseFields?: list<"tags"|"customCoordinates"|"isPrivateFile"|"embeddedMetadata"|"isPublished"|"customMetadata"|"metadata"|"selectedFieldsSchema">, + * responseFields?: list<'tags'|'customCoordinates'|'isPrivateFile'|'embeddedMetadata'|'isPublished'|'customMetadata'|'metadata'|'selectedFieldsSchema'>, * tags?: list, * transformation?: array{post?: list>, pre?: string}, * useUniqueFileName?: bool, diff --git a/src/Services/CustomMetadataFieldsService.php b/src/Services/CustomMetadataFieldsService.php index 46348727..028eafeb 100644 --- a/src/Services/CustomMetadataFieldsService.php +++ b/src/Services/CustomMetadataFieldsService.php @@ -31,7 +31,7 @@ public function __construct(private Client $client) {} * label: string, * name: string, * schema: array{ - * type: "Text"|"Textarea"|"Number"|"Date"|"Boolean"|"SingleSelect"|"MultiSelect", + * type: 'Text'|'Textarea'|'Number'|'Date'|'Boolean'|'SingleSelect'|'MultiSelect', * defaultValue?: mixed, * isValueRequired?: bool, * maxLength?: float, diff --git a/src/Services/FilesService.php b/src/Services/FilesService.php index 25766cfa..1d014ff2 100644 --- a/src/Services/FilesService.php +++ b/src/Services/FilesService.php @@ -251,7 +251,7 @@ public function rename( * overwriteFile?: bool, * overwriteTags?: bool, * publicKey?: string, - * responseFields?: list<"tags"|"customCoordinates"|"isPrivateFile"|"embeddedMetadata"|"isPublished"|"customMetadata"|"metadata"|"selectedFieldsSchema">, + * responseFields?: list<'tags'|'customCoordinates'|'isPrivateFile'|'embeddedMetadata'|'isPublished'|'customMetadata'|'metadata'|'selectedFieldsSchema'>, * signature?: string, * tags?: list, * transformation?: array{post?: list>, pre?: string}, diff --git a/src/SolidColorOverlay.php b/src/SolidColorOverlay.php index e960f51e..0d1cdc6e 100644 --- a/src/SolidColorOverlay.php +++ b/src/SolidColorOverlay.php @@ -13,7 +13,7 @@ * position?: OverlayPosition|null, * timing?: OverlayTiming|null, * color: string, - * type: "solidColor", + * type: 'solidColor', * transformation?: list|null, * } */ @@ -22,7 +22,7 @@ final class SolidColorOverlay implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "solidColor" $type */ + /** @var 'solidColor' $type */ #[Api] public string $type = 'solidColor'; diff --git a/src/SolidColorOverlayTransformation.php b/src/SolidColorOverlayTransformation.php index e43a258d..a6e980dc 100644 --- a/src/SolidColorOverlayTransformation.php +++ b/src/SolidColorOverlayTransformation.php @@ -14,7 +14,7 @@ * background?: string|null, * gradient?: string|null|bool, * height?: float|string|null, - * radius?: float|null|"max", + * radius?: float|null|'max', * width?: float|string|null, * } */ @@ -53,7 +53,7 @@ final class SolidColorOverlayTransformation implements BaseModel * Specifies the corner radius of the solid color overlay. Set to `max` for circular or oval shape. * See [radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). * - * @var float|"max"|null $radius + * @var float|'max'|null $radius */ #[Api(optional: true)] public float|string|null $radius; @@ -75,7 +75,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param float|"max" $radius + * @param float|'max' $radius */ public static function with( ?float $alpha = null, @@ -147,7 +147,7 @@ public function withHeight(float|string $height): self * Specifies the corner radius of the solid color overlay. Set to `max` for circular or oval shape. * See [radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). * - * @param float|"max" $radius + * @param float|'max' $radius */ public function withRadius(float|string $radius): self { diff --git a/src/SubtitleOverlay.php b/src/SubtitleOverlay.php index 61ec1f15..7b847251 100644 --- a/src/SubtitleOverlay.php +++ b/src/SubtitleOverlay.php @@ -14,7 +14,7 @@ * position?: OverlayPosition|null, * timing?: OverlayTiming|null, * input: string, - * type: "subtitle", + * type: 'subtitle', * encoding?: value-of|null, * transformation?: list|null, * } @@ -24,7 +24,7 @@ final class SubtitleOverlay implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "subtitle" $type */ + /** @var 'subtitle' $type */ #[Api] public string $type = 'subtitle'; diff --git a/src/TextOverlay.php b/src/TextOverlay.php index e379bdf1..d8488d0e 100644 --- a/src/TextOverlay.php +++ b/src/TextOverlay.php @@ -14,7 +14,7 @@ * position?: OverlayPosition|null, * timing?: OverlayTiming|null, * text: string, - * type: "text", + * type: 'text', * encoding?: value-of|null, * transformation?: list|null, * } @@ -24,7 +24,7 @@ final class TextOverlay implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "text" $type */ + /** @var 'text' $type */ #[Api] public string $type = 'text'; diff --git a/src/TextOverlayTransformation.php b/src/TextOverlayTransformation.php index 296c6ef7..b7cf6087 100644 --- a/src/TextOverlayTransformation.php +++ b/src/TextOverlayTransformation.php @@ -21,7 +21,7 @@ * innerAlignment?: value-of|null, * lineHeight?: float|string|null, * padding?: float|string|null, - * radius?: float|null|"max", + * radius?: float|null|'max', * rotation?: float|string|null, * typography?: string|null, * width?: float|string|null, @@ -99,7 +99,7 @@ final class TextOverlayTransformation implements BaseModel * Specifies the corner radius of the text overlay. * Set to `max` to achieve a circular or oval shape. * - * @var float|"max"|null $radius + * @var float|'max'|null $radius */ #[Api(optional: true)] public float|string|null $radius; @@ -139,7 +139,7 @@ public function __construct() * * @param Flip|value-of $flip * @param InnerAlignment|value-of $innerAlignment - * @param float|"max" $radius + * @param float|'max' $radius */ public static function with( ?float $alpha = null, @@ -288,7 +288,7 @@ public function withPadding(float|string $padding): self * Specifies the corner radius of the text overlay. * Set to `max` to achieve a circular or oval shape. * - * @param float|"max" $radius + * @param float|'max' $radius */ public function withRadius(float|string $radius): self { diff --git a/src/Transformation.php b/src/Transformation.php index 6cf811d9..6f3be054 100644 --- a/src/Transformation.php +++ b/src/Transformation.php @@ -57,7 +57,7 @@ * page?: float|string|null, * progressive?: bool|null, * quality?: float|null, - * radius?: float|null|"max", + * radius?: float|null|'max', * raw?: string|null, * rotation?: float|string|null, * shadow?: string|null|bool, @@ -372,7 +372,7 @@ final class Transformation implements BaseModel * Specifies the corner radius for rounded corners (e.g., 20) or `max` for circular or oval shape. * See [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). * - * @var float|"max"|null $radius + * @var float|'max'|null $radius */ #[Api(optional: true)] public float|string|null $radius; @@ -506,7 +506,7 @@ public function __construct() * @param CropMode|value-of $cropMode * @param Flip|value-of $flip * @param Format|value-of $format - * @param float|"max" $radius + * @param float|'max' $radius * @param list> $streamingResolutions * @param VideoCodec|value-of $videoCodec */ @@ -1095,7 +1095,7 @@ public function withQuality(float $quality): self * Specifies the corner radius for rounded corners (e.g., 20) or `max` for circular or oval shape. * See [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). * - * @param float|"max" $radius + * @param float|'max' $radius */ public function withRadius(float|string $radius): self { diff --git a/src/VideoOverlay.php b/src/VideoOverlay.php index 4fffe44b..390bf821 100644 --- a/src/VideoOverlay.php +++ b/src/VideoOverlay.php @@ -14,7 +14,7 @@ * position?: OverlayPosition|null, * timing?: OverlayTiming|null, * input: string, - * type: "video", + * type: 'video', * encoding?: value-of|null, * transformation?: list|null, * } @@ -24,7 +24,7 @@ final class VideoOverlay implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var "video" $type */ + /** @var 'video' $type */ #[Api] public string $type = 'video'; diff --git a/tests/Services/Accounts/OriginsTest.php b/tests/Services/Accounts/OriginsTest.php index 52dd4ec4..91ca3841 100644 --- a/tests/Services/Accounts/OriginsTest.php +++ b/tests/Services/Accounts/OriginsTest.php @@ -46,7 +46,7 @@ public function testCreate(): void 'endpoint' => 'https://s3.eu-central-1.wasabisys.com', 'baseUrl' => 'https://akeneo.company.com', 'clientEmail' => 'service-account@project.iam.gserviceaccount.com', - 'privateKey' => '-----BEGIN PRIVATE KEY-----\\nMIIEv...', + 'privateKey' => '-----BEGIN PRIVATE KEY-----\nMIIEv...', 'accountName' => 'account123', 'container' => 'images', 'sasToken' => '?sv=2023-01-03&sr=c&sig=abc123', @@ -75,7 +75,7 @@ public function testCreateWithOptionalParams(): void 'endpoint' => 'https://s3.eu-central-1.wasabisys.com', 'baseUrl' => 'https://akeneo.company.com', 'clientEmail' => 'service-account@project.iam.gserviceaccount.com', - 'privateKey' => '-----BEGIN PRIVATE KEY-----\\nMIIEv...', + 'privateKey' => '-----BEGIN PRIVATE KEY-----\nMIIEv...', 'accountName' => 'account123', 'container' => 'images', 'sasToken' => '?sv=2023-01-03&sr=c&sig=abc123', @@ -106,7 +106,7 @@ public function testUpdate(): void 'endpoint' => 'https://s3.eu-central-1.wasabisys.com', 'baseUrl' => 'https://akeneo.company.com', 'clientEmail' => 'service-account@project.iam.gserviceaccount.com', - 'privateKey' => '-----BEGIN PRIVATE KEY-----\\nMIIEv...', + 'privateKey' => '-----BEGIN PRIVATE KEY-----\nMIIEv...', 'accountName' => 'account123', 'container' => 'images', 'sasToken' => '?sv=2023-01-03&sr=c&sig=abc123', @@ -138,7 +138,7 @@ public function testUpdateWithOptionalParams(): void 'endpoint' => 'https://s3.eu-central-1.wasabisys.com', 'baseUrl' => 'https://akeneo.company.com', 'clientEmail' => 'service-account@project.iam.gserviceaccount.com', - 'privateKey' => '-----BEGIN PRIVATE KEY-----\\nMIIEv...', + 'privateKey' => '-----BEGIN PRIVATE KEY-----\nMIIEv...', 'accountName' => 'account123', 'container' => 'images', 'sasToken' => '?sv=2023-01-03&sr=c&sig=abc123', From 420892242261f1a4e5099a1dbfe7bd2705ce88c5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Nov 2025 16:16:15 +0000 Subject: [PATCH 078/193] chore: typing updates --- .../CustomMetadataFieldDeleteResponse.php | 2 +- src/Files/FileCopyResponse.php | 2 +- src/Files/FileMoveResponse.php | 2 +- src/Files/Versions/VersionDeleteResponse.php | 2 +- src/Folders/FolderDeleteResponse.php | 2 +- src/Folders/FolderNewResponse.php | 2 +- src/GetImageAttributesOptions.php | 8 ++++---- src/ImageOverlay.php | 8 ++++---- src/SrcOptions.php | 8 ++++---- src/VideoOverlay.php | 8 ++++---- 10 files changed, 22 insertions(+), 22 deletions(-) diff --git a/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php b/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php index 439cbbbd..dc4f8224 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php +++ b/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php @@ -10,7 +10,7 @@ use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** - * @phpstan-type CustomMetadataFieldDeleteResponseShape = array{} + * @phpstan-type CustomMetadataFieldDeleteResponseShape = array */ final class CustomMetadataFieldDeleteResponse implements BaseModel, ResponseConverter { diff --git a/src/Files/FileCopyResponse.php b/src/Files/FileCopyResponse.php index 6b7d6af4..5c17ae0b 100644 --- a/src/Files/FileCopyResponse.php +++ b/src/Files/FileCopyResponse.php @@ -10,7 +10,7 @@ use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** - * @phpstan-type FileCopyResponseShape = array{} + * @phpstan-type FileCopyResponseShape = array */ final class FileCopyResponse implements BaseModel, ResponseConverter { diff --git a/src/Files/FileMoveResponse.php b/src/Files/FileMoveResponse.php index 57d350dc..22924fc9 100644 --- a/src/Files/FileMoveResponse.php +++ b/src/Files/FileMoveResponse.php @@ -10,7 +10,7 @@ use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** - * @phpstan-type FileMoveResponseShape = array{} + * @phpstan-type FileMoveResponseShape = array */ final class FileMoveResponse implements BaseModel, ResponseConverter { diff --git a/src/Files/Versions/VersionDeleteResponse.php b/src/Files/Versions/VersionDeleteResponse.php index d17bd8e6..b1a08bff 100644 --- a/src/Files/Versions/VersionDeleteResponse.php +++ b/src/Files/Versions/VersionDeleteResponse.php @@ -10,7 +10,7 @@ use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** - * @phpstan-type VersionDeleteResponseShape = array{} + * @phpstan-type VersionDeleteResponseShape = array */ final class VersionDeleteResponse implements BaseModel, ResponseConverter { diff --git a/src/Folders/FolderDeleteResponse.php b/src/Folders/FolderDeleteResponse.php index 537b0dd1..86e61ceb 100644 --- a/src/Folders/FolderDeleteResponse.php +++ b/src/Folders/FolderDeleteResponse.php @@ -10,7 +10,7 @@ use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** - * @phpstan-type FolderDeleteResponseShape = array{} + * @phpstan-type FolderDeleteResponseShape = array */ final class FolderDeleteResponse implements BaseModel, ResponseConverter { diff --git a/src/Folders/FolderNewResponse.php b/src/Folders/FolderNewResponse.php index 02f8940a..123d3c73 100644 --- a/src/Folders/FolderNewResponse.php +++ b/src/Folders/FolderNewResponse.php @@ -10,7 +10,7 @@ use ImageKit\Core\Conversion\Contracts\ResponseConverter; /** - * @phpstan-type FolderNewResponseShape = array{} + * @phpstan-type FolderNewResponseShape = array */ final class FolderNewResponse implements BaseModel, ResponseConverter { diff --git a/src/GetImageAttributesOptions.php b/src/GetImageAttributesOptions.php index 5c4e55d1..2ed8b1e9 100644 --- a/src/GetImageAttributesOptions.php +++ b/src/GetImageAttributesOptions.php @@ -18,7 +18,7 @@ * expiresIn?: float|null, * queryParameters?: array|null, * signed?: bool|null, - * transformation?: list|null, + * transformation?: list|null, * transformationPosition?: value-of|null, * deviceBreakpoints?: list|null, * imageBreakpoints?: list|null, @@ -80,7 +80,7 @@ final class GetImageAttributesOptions implements BaseModel * An array of objects specifying the transformations to be applied in the URL. If more than one transformation is specified, they are applied in the order they are specified as chained transformations. * See [Chained transformations](https://imagekit.io/docs/transformations#chained-transformations). * - * @var list|null $transformation + * @var list|null $transformation */ #[Api(list: Transformation::class, optional: true)] public ?array $transformation; @@ -168,7 +168,7 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param array $queryParameters - * @param list $transformation + * @param list $transformation * @param TransformationPosition|value-of $transformationPosition * @param list $deviceBreakpoints * @param list $imageBreakpoints @@ -278,7 +278,7 @@ public function withSigned(bool $signed): self * An array of objects specifying the transformations to be applied in the URL. If more than one transformation is specified, they are applied in the order they are specified as chained transformations. * See [Chained transformations](https://imagekit.io/docs/transformations#chained-transformations). * - * @param list $transformation + * @param list $transformation */ public function withTransformation(array $transformation): self { diff --git a/src/ImageOverlay.php b/src/ImageOverlay.php index 06641bfe..ec0018a9 100644 --- a/src/ImageOverlay.php +++ b/src/ImageOverlay.php @@ -16,7 +16,7 @@ * input: string, * type: 'image', * encoding?: value-of|null, - * transformation?: list|null, + * transformation?: list|null, * } */ final class ImageOverlay implements BaseModel @@ -55,7 +55,7 @@ final class ImageOverlay implements BaseModel * Array of transformations to be applied to the overlay image. Supported transformations depends on the base/parent asset. * See overlays on [Images](https://imagekit.io/docs/add-overlays-on-images#list-of-supported-image-transformations-in-image-layers) and [Videos](https://imagekit.io/docs/add-overlays-on-videos#list-of-transformations-supported-on-image-overlay). * - * @var list|null $transformation + * @var list|null $transformation */ #[Api(list: Transformation::class, optional: true)] public ?array $transformation; @@ -85,7 +85,7 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Encoding|value-of $encoding - * @param list $transformation + * @param list $transformation */ public static function with( string $input, @@ -153,7 +153,7 @@ public function withEncoding(Encoding|string $encoding): self * Array of transformations to be applied to the overlay image. Supported transformations depends on the base/parent asset. * See overlays on [Images](https://imagekit.io/docs/add-overlays-on-images#list-of-supported-image-transformations-in-image-layers) and [Videos](https://imagekit.io/docs/add-overlays-on-videos#list-of-transformations-supported-on-image-overlay). * - * @param list $transformation + * @param list $transformation */ public function withTransformation(array $transformation): self { diff --git a/src/SrcOptions.php b/src/SrcOptions.php index fe6243a0..a1c95b39 100644 --- a/src/SrcOptions.php +++ b/src/SrcOptions.php @@ -17,7 +17,7 @@ * expiresIn?: float|null, * queryParameters?: array|null, * signed?: bool|null, - * transformation?: list|null, + * transformation?: list|null, * transformationPosition?: value-of|null, * } */ @@ -75,7 +75,7 @@ final class SrcOptions implements BaseModel * An array of objects specifying the transformations to be applied in the URL. If more than one transformation is specified, they are applied in the order they are specified as chained transformations. * See [Chained transformations](https://imagekit.io/docs/transformations#chained-transformations). * - * @var list|null $transformation + * @var list|null $transformation */ #[Api(list: Transformation::class, optional: true)] public ?array $transformation; @@ -115,7 +115,7 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param array $queryParameters - * @param list $transformation + * @param list $transformation * @param TransformationPosition|value-of $transformationPosition */ public static function with( @@ -215,7 +215,7 @@ public function withSigned(bool $signed): self * An array of objects specifying the transformations to be applied in the URL. If more than one transformation is specified, they are applied in the order they are specified as chained transformations. * See [Chained transformations](https://imagekit.io/docs/transformations#chained-transformations). * - * @param list $transformation + * @param list $transformation */ public function withTransformation(array $transformation): self { diff --git a/src/VideoOverlay.php b/src/VideoOverlay.php index 390bf821..1d4ffbc7 100644 --- a/src/VideoOverlay.php +++ b/src/VideoOverlay.php @@ -16,7 +16,7 @@ * input: string, * type: 'video', * encoding?: value-of|null, - * transformation?: list|null, + * transformation?: list|null, * } */ final class VideoOverlay implements BaseModel @@ -55,7 +55,7 @@ final class VideoOverlay implements BaseModel * Array of transformation to be applied to the overlay video. Except `streamingResolutions`, all other video transformations are supported. * See [Video transformations](https://imagekit.io/docs/video-transformation). * - * @var list|null $transformation + * @var list|null $transformation */ #[Api(list: Transformation::class, optional: true)] public ?array $transformation; @@ -85,7 +85,7 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Encoding|value-of $encoding - * @param list $transformation + * @param list $transformation */ public static function with( string $input, @@ -153,7 +153,7 @@ public function withEncoding(Encoding|string $encoding): self * Array of transformation to be applied to the overlay video. Except `streamingResolutions`, all other video transformations are supported. * See [Video transformations](https://imagekit.io/docs/video-transformation). * - * @param list $transformation + * @param list $transformation */ public function withTransformation(array $transformation): self { From bcbfa809e6b7e3f995cd8cddf8b55da68a89bedf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 26 Nov 2025 16:27:26 +0000 Subject: [PATCH 079/193] chore: use non-trivial test assertions --- tests/Services/Accounts/OriginsTest.php | 107 +++++++------------ tests/Services/Accounts/URLEndpointsTest.php | 36 +++++-- tests/Services/Accounts/UsageTest.php | 7 +- tests/Services/AssetsTest.php | 3 +- tests/Services/Beta/V2/FilesTest.php | 52 ++++++++- tests/Services/Cache/InvalidationTest.php | 11 +- tests/Services/CustomMetadataFieldsTest.php | 17 ++- tests/Services/Files/BulkTest.php | 28 +++-- tests/Services/Files/MetadataTest.php | 10 +- tests/Services/Files/VersionsTest.php | 23 ++-- tests/Services/FilesTest.php | 92 +++++++++++++--- tests/Services/Folders/JobTest.php | 4 +- tests/Services/FoldersTest.php | 40 +++++-- 13 files changed, 294 insertions(+), 136 deletions(-) diff --git a/tests/Services/Accounts/OriginsTest.php b/tests/Services/Accounts/OriginsTest.php index 91ca3841..1dec703e 100644 --- a/tests/Services/Accounts/OriginsTest.php +++ b/tests/Services/Accounts/OriginsTest.php @@ -38,25 +38,14 @@ public function testCreate(): void } $result = $this->client->accounts->origins->create([ - 'accessKey' => 'AKIAIOSFODNN7EXAMPLE', - 'bucket' => 'gcs-media', - 'name' => 'US S3 Storage', - 'secretKey' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', - 'type' => 'AKENEO_PIM', - 'endpoint' => 'https://s3.eu-central-1.wasabisys.com', - 'baseUrl' => 'https://akeneo.company.com', - 'clientEmail' => 'service-account@project.iam.gserviceaccount.com', - 'privateKey' => '-----BEGIN PRIVATE KEY-----\nMIIEv...', - 'accountName' => 'account123', - 'container' => 'images', - 'sasToken' => '?sv=2023-01-03&sr=c&sig=abc123', - 'clientId' => 'akeneo-client-id', - 'clientSecret' => 'akeneo-client-secret', - 'password' => 'strongpassword123', - 'username' => 'integration-user', + 'accessKey' => 'AKIATEST123', + 'bucket' => 'test-bucket', + 'name' => 'My S3 Origin', + 'secretKey' => 'secrettest123', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertNotNull($result); } #[Test] @@ -67,25 +56,17 @@ public function testCreateWithOptionalParams(): void } $result = $this->client->accounts->origins->create([ - 'accessKey' => 'AKIAIOSFODNN7EXAMPLE', - 'bucket' => 'gcs-media', - 'name' => 'US S3 Storage', - 'secretKey' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', - 'type' => 'AKENEO_PIM', - 'endpoint' => 'https://s3.eu-central-1.wasabisys.com', - 'baseUrl' => 'https://akeneo.company.com', - 'clientEmail' => 'service-account@project.iam.gserviceaccount.com', - 'privateKey' => '-----BEGIN PRIVATE KEY-----\nMIIEv...', - 'accountName' => 'account123', - 'container' => 'images', - 'sasToken' => '?sv=2023-01-03&sr=c&sig=abc123', - 'clientId' => 'akeneo-client-id', - 'clientSecret' => 'akeneo-client-secret', - 'password' => 'strongpassword123', - 'username' => 'integration-user', + 'accessKey' => 'AKIATEST123', + 'bucket' => 'test-bucket', + 'name' => 'My S3 Origin', + 'secretKey' => 'secrettest123', + 'baseUrlForCanonicalHeader' => 'https://cdn.example.com', + 'includeCanonicalHeader' => false, + 'prefix' => 'images', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertNotNull($result); } #[Test] @@ -98,26 +79,15 @@ public function testUpdate(): void $result = $this->client->accounts->origins->update( 'id', [ - 'accessKey' => 'AKIAIOSFODNN7EXAMPLE', - 'bucket' => 'gcs-media', - 'name' => 'US S3 Storage', - 'secretKey' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', - 'type' => 'AKENEO_PIM', - 'endpoint' => 'https://s3.eu-central-1.wasabisys.com', - 'baseUrl' => 'https://akeneo.company.com', - 'clientEmail' => 'service-account@project.iam.gserviceaccount.com', - 'privateKey' => '-----BEGIN PRIVATE KEY-----\nMIIEv...', - 'accountName' => 'account123', - 'container' => 'images', - 'sasToken' => '?sv=2023-01-03&sr=c&sig=abc123', - 'clientId' => 'akeneo-client-id', - 'clientSecret' => 'akeneo-client-secret', - 'password' => 'strongpassword123', - 'username' => 'integration-user', + 'accessKey' => 'AKIATEST123', + 'bucket' => 'test-bucket', + 'name' => 'My S3 Origin', + 'secretKey' => 'secrettest123', ], ); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertNotNull($result); } #[Test] @@ -130,26 +100,18 @@ public function testUpdateWithOptionalParams(): void $result = $this->client->accounts->origins->update( 'id', [ - 'accessKey' => 'AKIAIOSFODNN7EXAMPLE', - 'bucket' => 'gcs-media', - 'name' => 'US S3 Storage', - 'secretKey' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', - 'type' => 'AKENEO_PIM', - 'endpoint' => 'https://s3.eu-central-1.wasabisys.com', - 'baseUrl' => 'https://akeneo.company.com', - 'clientEmail' => 'service-account@project.iam.gserviceaccount.com', - 'privateKey' => '-----BEGIN PRIVATE KEY-----\nMIIEv...', - 'accountName' => 'account123', - 'container' => 'images', - 'sasToken' => '?sv=2023-01-03&sr=c&sig=abc123', - 'clientId' => 'akeneo-client-id', - 'clientSecret' => 'akeneo-client-secret', - 'password' => 'strongpassword123', - 'username' => 'integration-user', + 'accessKey' => 'AKIATEST123', + 'bucket' => 'test-bucket', + 'name' => 'My S3 Origin', + 'secretKey' => 'secrettest123', + 'baseUrlForCanonicalHeader' => 'https://cdn.example.com', + 'includeCanonicalHeader' => false, + 'prefix' => 'images', ], ); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertNotNull($result); } #[Test] @@ -161,7 +123,8 @@ public function testList(): void $result = $this->client->accounts->origins->list(); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertIsList($result); } #[Test] @@ -173,7 +136,8 @@ public function testDelete(): void $result = $this->client->accounts->origins->delete('id'); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertNull($result); } #[Test] @@ -185,6 +149,7 @@ public function testGet(): void $result = $this->client->accounts->origins->get('id'); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertNotNull($result); } } diff --git a/tests/Services/Accounts/URLEndpointsTest.php b/tests/Services/Accounts/URLEndpointsTest.php index afc49ad1..a93ca5b4 100644 --- a/tests/Services/Accounts/URLEndpointsTest.php +++ b/tests/Services/Accounts/URLEndpointsTest.php @@ -2,6 +2,7 @@ namespace Tests\Services\Accounts; +use ImageKit\Accounts\URLEndpoints\URLEndpointResponse; use ImageKit\Client; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; @@ -41,7 +42,8 @@ public function testCreate(): void 'description' => 'My custom URL endpoint', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(URLEndpointResponse::class, $result); } #[Test] @@ -53,9 +55,15 @@ public function testCreateWithOptionalParams(): void $result = $this->client->accounts->urlEndpoints->create([ 'description' => 'My custom URL endpoint', + 'origins' => ['origin-id-1'], + 'urlPrefix' => 'product-images', + 'urlRewriter' => [ + 'type' => 'CLOUDINARY', 'preserveAssetDeliveryTypes' => true, + ], ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(URLEndpointResponse::class, $result); } #[Test] @@ -70,7 +78,8 @@ public function testUpdate(): void ['description' => 'My custom URL endpoint'] ); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(URLEndpointResponse::class, $result); } #[Test] @@ -82,10 +91,18 @@ public function testUpdateWithOptionalParams(): void $result = $this->client->accounts->urlEndpoints->update( 'id', - ['description' => 'My custom URL endpoint'] + [ + 'description' => 'My custom URL endpoint', + 'origins' => ['origin-id-1'], + 'urlPrefix' => 'product-images', + 'urlRewriter' => [ + 'type' => 'CLOUDINARY', 'preserveAssetDeliveryTypes' => true, + ], + ], ); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(URLEndpointResponse::class, $result); } #[Test] @@ -97,7 +114,8 @@ public function testList(): void $result = $this->client->accounts->urlEndpoints->list(); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertIsList($result); } #[Test] @@ -109,7 +127,8 @@ public function testDelete(): void $result = $this->client->accounts->urlEndpoints->delete('id'); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertNull($result); } #[Test] @@ -121,6 +140,7 @@ public function testGet(): void $result = $this->client->accounts->urlEndpoints->get('id'); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(URLEndpointResponse::class, $result); } } diff --git a/tests/Services/Accounts/UsageTest.php b/tests/Services/Accounts/UsageTest.php index efd12e9d..65ac225a 100644 --- a/tests/Services/Accounts/UsageTest.php +++ b/tests/Services/Accounts/UsageTest.php @@ -2,6 +2,7 @@ namespace Tests\Services\Accounts; +use ImageKit\Accounts\Usage\UsageGetResponse; use ImageKit\Client; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; @@ -41,7 +42,8 @@ public function testGet(): void 'endDate' => '2019-12-27', 'startDate' => '2019-12-27', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(UsageGetResponse::class, $result); } #[Test] @@ -55,6 +57,7 @@ public function testGetWithOptionalParams(): void 'endDate' => '2019-12-27', 'startDate' => '2019-12-27', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(UsageGetResponse::class, $result); } } diff --git a/tests/Services/AssetsTest.php b/tests/Services/AssetsTest.php index 8969cd65..1411c21c 100644 --- a/tests/Services/AssetsTest.php +++ b/tests/Services/AssetsTest.php @@ -39,6 +39,7 @@ public function testList(): void $result = $this->client->assets->list([]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertIsList($result); } } diff --git a/tests/Services/Beta/V2/FilesTest.php b/tests/Services/Beta/V2/FilesTest.php index 6d1746fc..c7d98a3e 100644 --- a/tests/Services/Beta/V2/FilesTest.php +++ b/tests/Services/Beta/V2/FilesTest.php @@ -2,6 +2,7 @@ namespace Tests\Services\Beta\V2; +use ImageKit\Beta\V2\Files\FileUploadResponse; use ImageKit\Client; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; @@ -41,7 +42,8 @@ public function testUpload(): void 'file' => null, 'fileName' => 'fileName', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(FileUploadResponse::class, $result); } #[Test] @@ -52,9 +54,53 @@ public function testUploadWithOptionalParams(): void } $result = $this->client->beta->v2->files->upload([ - 'file' => null, 'fileName' => 'fileName', + 'file' => null, + 'fileName' => 'fileName', + 'token' => 'token', + 'checks' => '"request.folder" : "marketing/"\n', + 'customCoordinates' => 'customCoordinates', + 'customMetadata' => ['brand' => 'bar', 'color' => 'bar'], + 'description' => 'Running shoes', + 'extensions' => [ + [ + 'name' => 'remove-bg', + 'options' => [ + 'add_shadow' => true, + 'bg_color' => 'bg_color', + 'bg_image_url' => 'bg_image_url', + 'semitransparency' => true, + ], + ], + [ + 'maxTags' => 5, 'minConfidence' => 95, 'name' => 'google-auto-tagging', + ], + ['name' => 'ai-auto-description'], + ], + 'folder' => 'folder', + 'isPrivateFile' => true, + 'isPublished' => true, + 'overwriteAITags' => true, + 'overwriteCustomMetadata' => true, + 'overwriteFile' => true, + 'overwriteTags' => true, + 'responseFields' => ['tags', 'customCoordinates', 'isPrivateFile'], + 'tags' => ['t-shirt', 'round-neck', 'men'], + 'transformation' => [ + 'post' => [ + ['type' => 'thumbnail', 'value' => 'w-150,h-150'], + [ + 'protocol' => 'dash', + 'type' => 'abs', + 'value' => 'sr-240_360_480_720_1080', + ], + ], + 'pre' => 'w-300,h-300,q-80', + ], + 'useUniqueFileName' => true, + 'webhookUrl' => 'https://example.com', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(FileUploadResponse::class, $result); } } diff --git a/tests/Services/Cache/InvalidationTest.php b/tests/Services/Cache/InvalidationTest.php index c1d79dc7..780fa380 100644 --- a/tests/Services/Cache/InvalidationTest.php +++ b/tests/Services/Cache/InvalidationTest.php @@ -2,6 +2,8 @@ namespace Tests\Services\Cache; +use ImageKit\Cache\Invalidation\InvalidationGetResponse; +use ImageKit\Cache\Invalidation\InvalidationNewResponse; use ImageKit\Client; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; @@ -41,7 +43,8 @@ public function testCreate(): void 'url' => 'https://ik.imagekit.io/your_imagekit_id/default-image.jpg', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(InvalidationNewResponse::class, $result); } #[Test] @@ -55,7 +58,8 @@ public function testCreateWithOptionalParams(): void 'url' => 'https://ik.imagekit.io/your_imagekit_id/default-image.jpg', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(InvalidationNewResponse::class, $result); } #[Test] @@ -67,6 +71,7 @@ public function testGet(): void $result = $this->client->cache->invalidation->get('requestId'); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(InvalidationGetResponse::class, $result); } } diff --git a/tests/Services/CustomMetadataFieldsTest.php b/tests/Services/CustomMetadataFieldsTest.php index 028f9698..6087bebc 100644 --- a/tests/Services/CustomMetadataFieldsTest.php +++ b/tests/Services/CustomMetadataFieldsTest.php @@ -3,6 +3,8 @@ namespace Tests\Services; use ImageKit\Client; +use ImageKit\CustomMetadataFields\CustomMetadataField; +use ImageKit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; @@ -41,7 +43,8 @@ public function testCreate(): void 'label' => 'price', 'name' => 'price', 'schema' => ['type' => 'Number'], ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(CustomMetadataField::class, $result); } #[Test] @@ -66,7 +69,8 @@ public function testCreateWithOptionalParams(): void ], ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(CustomMetadataField::class, $result); } #[Test] @@ -78,7 +82,8 @@ public function testUpdate(): void $result = $this->client->customMetadataFields->update('id', []); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(CustomMetadataField::class, $result); } #[Test] @@ -90,7 +95,8 @@ public function testList(): void $result = $this->client->customMetadataFields->list([]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertIsList($result); } #[Test] @@ -102,6 +108,7 @@ public function testDelete(): void $result = $this->client->customMetadataFields->delete('id'); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(CustomMetadataFieldDeleteResponse::class, $result); } } diff --git a/tests/Services/Files/BulkTest.php b/tests/Services/Files/BulkTest.php index a98521c9..4a3f369c 100644 --- a/tests/Services/Files/BulkTest.php +++ b/tests/Services/Files/BulkTest.php @@ -3,6 +3,10 @@ namespace Tests\Services\Files; use ImageKit\Client; +use ImageKit\Files\Bulk\BulkAddTagsResponse; +use ImageKit\Files\Bulk\BulkDeleteResponse; +use ImageKit\Files\Bulk\BulkRemoveAITagsResponse; +use ImageKit\Files\Bulk\BulkRemoveTagsResponse; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; @@ -41,7 +45,8 @@ public function testDelete(): void 'fileIds' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(BulkDeleteResponse::class, $result); } #[Test] @@ -55,7 +60,8 @@ public function testDeleteWithOptionalParams(): void 'fileIds' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(BulkDeleteResponse::class, $result); } #[Test] @@ -70,7 +76,8 @@ public function testAddTags(): void 'tags' => ['t-shirt', 'round-neck', 'sale2019'], ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(BulkAddTagsResponse::class, $result); } #[Test] @@ -85,7 +92,8 @@ public function testAddTagsWithOptionalParams(): void 'tags' => ['t-shirt', 'round-neck', 'sale2019'], ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(BulkAddTagsResponse::class, $result); } #[Test] @@ -100,7 +108,8 @@ public function testRemoveAITags(): void 'fileIds' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(BulkRemoveAITagsResponse::class, $result); } #[Test] @@ -115,7 +124,8 @@ public function testRemoveAITagsWithOptionalParams(): void 'fileIds' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(BulkRemoveAITagsResponse::class, $result); } #[Test] @@ -130,7 +140,8 @@ public function testRemoveTags(): void 'tags' => ['t-shirt', 'round-neck', 'sale2019'], ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(BulkRemoveTagsResponse::class, $result); } #[Test] @@ -145,6 +156,7 @@ public function testRemoveTagsWithOptionalParams(): void 'tags' => ['t-shirt', 'round-neck', 'sale2019'], ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(BulkRemoveTagsResponse::class, $result); } } diff --git a/tests/Services/Files/MetadataTest.php b/tests/Services/Files/MetadataTest.php index f46b1823..2a9cd233 100644 --- a/tests/Services/Files/MetadataTest.php +++ b/tests/Services/Files/MetadataTest.php @@ -3,6 +3,7 @@ namespace Tests\Services\Files; use ImageKit\Client; +use ImageKit\Files\Metadata; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; @@ -39,7 +40,8 @@ public function testGet(): void $result = $this->client->files->metadata->get('fileId'); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(Metadata::class, $result); } #[Test] @@ -53,7 +55,8 @@ public function testGetFromURL(): void 'url' => 'https://example.com', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(Metadata::class, $result); } #[Test] @@ -67,6 +70,7 @@ public function testGetFromURLWithOptionalParams(): void 'url' => 'https://example.com', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(Metadata::class, $result); } } diff --git a/tests/Services/Files/VersionsTest.php b/tests/Services/Files/VersionsTest.php index 4492f2ef..4cb353d6 100644 --- a/tests/Services/Files/VersionsTest.php +++ b/tests/Services/Files/VersionsTest.php @@ -3,6 +3,8 @@ namespace Tests\Services\Files; use ImageKit\Client; +use ImageKit\Files\File; +use ImageKit\Files\Versions\VersionDeleteResponse; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; @@ -39,7 +41,8 @@ public function testList(): void $result = $this->client->files->versions->list('fileId'); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertIsList($result); } #[Test] @@ -54,7 +57,8 @@ public function testDelete(): void ['fileId' => 'fileId'] ); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(VersionDeleteResponse::class, $result); } #[Test] @@ -69,7 +73,8 @@ public function testDeleteWithOptionalParams(): void ['fileId' => 'fileId'] ); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(VersionDeleteResponse::class, $result); } #[Test] @@ -84,7 +89,8 @@ public function testGet(): void ['fileId' => 'fileId'] ); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(File::class, $result); } #[Test] @@ -99,7 +105,8 @@ public function testGetWithOptionalParams(): void ['fileId' => 'fileId'] ); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(File::class, $result); } #[Test] @@ -114,7 +121,8 @@ public function testRestore(): void ['fileId' => 'fileId'] ); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(File::class, $result); } #[Test] @@ -129,6 +137,7 @@ public function testRestoreWithOptionalParams(): void ['fileId' => 'fileId'] ); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(File::class, $result); } } diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index 5c24ea1e..93e15e5c 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -3,6 +3,12 @@ namespace Tests\Services; use ImageKit\Client; +use ImageKit\Files\File; +use ImageKit\Files\FileCopyResponse; +use ImageKit\Files\FileMoveResponse; +use ImageKit\Files\FileRenameResponse; +use ImageKit\Files\FileUpdateResponse; +use ImageKit\Files\FileUploadResponse; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; @@ -39,7 +45,8 @@ public function testUpdate(): void $result = $this->client->files->update('fileId', []); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(FileUpdateResponse::class, $result); } #[Test] @@ -51,7 +58,8 @@ public function testDelete(): void $result = $this->client->files->delete('fileId'); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertNull($result); } #[Test] @@ -66,7 +74,8 @@ public function testCopy(): void 'sourceFilePath' => '/path/to/file.jpg', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(FileCopyResponse::class, $result); } #[Test] @@ -79,9 +88,11 @@ public function testCopyWithOptionalParams(): void $result = $this->client->files->copy([ 'destinationPath' => '/folder/to/copy/into/', 'sourceFilePath' => '/path/to/file.jpg', + 'includeFileVersions' => false, ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(FileCopyResponse::class, $result); } #[Test] @@ -93,7 +104,8 @@ public function testGet(): void $result = $this->client->files->get('fileId'); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(File::class, $result); } #[Test] @@ -108,7 +120,8 @@ public function testMove(): void 'sourceFilePath' => '/path/to/file.jpg', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(FileMoveResponse::class, $result); } #[Test] @@ -123,7 +136,8 @@ public function testMoveWithOptionalParams(): void 'sourceFilePath' => '/path/to/file.jpg', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(FileMoveResponse::class, $result); } #[Test] @@ -137,7 +151,8 @@ public function testRename(): void 'filePath' => '/path/to/file.jpg', 'newFileName' => 'newFileName.jpg', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(FileRenameResponse::class, $result); } #[Test] @@ -148,10 +163,13 @@ public function testRenameWithOptionalParams(): void } $result = $this->client->files->rename([ - 'filePath' => '/path/to/file.jpg', 'newFileName' => 'newFileName.jpg', + 'filePath' => '/path/to/file.jpg', + 'newFileName' => 'newFileName.jpg', + 'purgeCache' => true, ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(FileRenameResponse::class, $result); } #[Test] @@ -165,7 +183,8 @@ public function testUpload(): void 'file' => null, 'fileName' => 'fileName', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(FileUploadResponse::class, $result); } #[Test] @@ -176,9 +195,56 @@ public function testUploadWithOptionalParams(): void } $result = $this->client->files->upload([ - 'file' => null, 'fileName' => 'fileName', + 'file' => null, + 'fileName' => 'fileName', + 'token' => 'token', + 'checks' => '"request.folder" : "marketing/"\n', + 'customCoordinates' => 'customCoordinates', + 'customMetadata' => ['brand' => 'bar', 'color' => 'bar'], + 'description' => 'Running shoes', + 'expire' => 0, + 'extensions' => [ + [ + 'name' => 'remove-bg', + 'options' => [ + 'add_shadow' => true, + 'bg_color' => 'bg_color', + 'bg_image_url' => 'bg_image_url', + 'semitransparency' => true, + ], + ], + [ + 'maxTags' => 5, 'minConfidence' => 95, 'name' => 'google-auto-tagging', + ], + ['name' => 'ai-auto-description'], + ], + 'folder' => 'folder', + 'isPrivateFile' => true, + 'isPublished' => true, + 'overwriteAITags' => true, + 'overwriteCustomMetadata' => true, + 'overwriteFile' => true, + 'overwriteTags' => true, + 'publicKey' => 'publicKey', + 'responseFields' => ['tags', 'customCoordinates', 'isPrivateFile'], + 'signature' => 'signature', + 'tags' => ['t-shirt', 'round-neck', 'men'], + 'transformation' => [ + 'post' => [ + ['type' => 'thumbnail', 'value' => 'w-150,h-150'], + [ + 'protocol' => 'dash', + 'type' => 'abs', + 'value' => 'sr-240_360_480_720_1080', + ], + ], + 'pre' => 'w-300,h-300,q-80', + ], + 'useUniqueFileName' => true, + 'webhookUrl' => 'https://example.com', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(FileUploadResponse::class, $result); } } diff --git a/tests/Services/Folders/JobTest.php b/tests/Services/Folders/JobTest.php index d2e92346..08813d08 100644 --- a/tests/Services/Folders/JobTest.php +++ b/tests/Services/Folders/JobTest.php @@ -3,6 +3,7 @@ namespace Tests\Services\Folders; use ImageKit\Client; +use ImageKit\Folders\Job\JobGetResponse; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; @@ -39,6 +40,7 @@ public function testGet(): void $result = $this->client->folders->job->get('jobId'); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(JobGetResponse::class, $result); } } diff --git a/tests/Services/FoldersTest.php b/tests/Services/FoldersTest.php index 7133c613..108b1730 100644 --- a/tests/Services/FoldersTest.php +++ b/tests/Services/FoldersTest.php @@ -3,6 +3,11 @@ namespace Tests\Services; use ImageKit\Client; +use ImageKit\Folders\FolderCopyResponse; +use ImageKit\Folders\FolderDeleteResponse; +use ImageKit\Folders\FolderMoveResponse; +use ImageKit\Folders\FolderNewResponse; +use ImageKit\Folders\FolderRenameResponse; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; @@ -41,7 +46,8 @@ public function testCreate(): void 'folderName' => 'summer', 'parentFolderPath' => '/product/images/', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(FolderNewResponse::class, $result); } #[Test] @@ -55,7 +61,8 @@ public function testCreateWithOptionalParams(): void 'folderName' => 'summer', 'parentFolderPath' => '/product/images/', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(FolderNewResponse::class, $result); } #[Test] @@ -69,7 +76,8 @@ public function testDelete(): void 'folderPath' => '/folder/to/delete/', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(FolderDeleteResponse::class, $result); } #[Test] @@ -83,7 +91,8 @@ public function testDeleteWithOptionalParams(): void 'folderPath' => '/folder/to/delete/', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(FolderDeleteResponse::class, $result); } #[Test] @@ -98,7 +107,8 @@ public function testCopy(): void 'sourceFolderPath' => '/path/of/source/folder', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(FolderCopyResponse::class, $result); } #[Test] @@ -111,9 +121,11 @@ public function testCopyWithOptionalParams(): void $result = $this->client->folders->copy([ 'destinationPath' => '/path/of/destination/folder', 'sourceFolderPath' => '/path/of/source/folder', + 'includeVersions' => true, ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(FolderCopyResponse::class, $result); } #[Test] @@ -128,7 +140,8 @@ public function testMove(): void 'sourceFolderPath' => '/path/of/source/folder', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(FolderMoveResponse::class, $result); } #[Test] @@ -143,7 +156,8 @@ public function testMoveWithOptionalParams(): void 'sourceFolderPath' => '/path/of/source/folder', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(FolderMoveResponse::class, $result); } #[Test] @@ -157,7 +171,8 @@ public function testRename(): void 'folderPath' => '/path/of/folder', 'newFolderName' => 'new-folder-name', ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(FolderRenameResponse::class, $result); } #[Test] @@ -168,9 +183,12 @@ public function testRenameWithOptionalParams(): void } $result = $this->client->folders->rename([ - 'folderPath' => '/path/of/folder', 'newFolderName' => 'new-folder-name', + 'folderPath' => '/path/of/folder', + 'newFolderName' => 'new-folder-name', + 'purgeCache' => true, ]); - $this->assertTrue(true); // @phpstan-ignore method.alreadyNarrowedType + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(FolderRenameResponse::class, $result); } } From a11b7519be814fe8955f2a3d564b342572883cf2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 2 Dec 2025 22:31:45 +0000 Subject: [PATCH 080/193] chore: formatting --- src/ServiceContracts/Accounts/OriginsContract.php | 4 +--- src/ServiceContracts/Accounts/URLEndpointsContract.php | 4 +--- src/ServiceContracts/Files/BulkContract.php | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/ServiceContracts/Accounts/OriginsContract.php b/src/ServiceContracts/Accounts/OriginsContract.php index 0b0cbadf..54c5c68f 100644 --- a/src/ServiceContracts/Accounts/OriginsContract.php +++ b/src/ServiceContracts/Accounts/OriginsContract.php @@ -45,9 +45,7 @@ public function update( * * @throws APIException */ - public function list( - ?RequestOptions $requestOptions = null - ): array; + public function list(?RequestOptions $requestOptions = null): array; /** * @api diff --git a/src/ServiceContracts/Accounts/URLEndpointsContract.php b/src/ServiceContracts/Accounts/URLEndpointsContract.php index f4142c72..6dd1cf33 100644 --- a/src/ServiceContracts/Accounts/URLEndpointsContract.php +++ b/src/ServiceContracts/Accounts/URLEndpointsContract.php @@ -44,9 +44,7 @@ public function update( * * @throws APIException */ - public function list( - ?RequestOptions $requestOptions = null - ): array; + public function list(?RequestOptions $requestOptions = null): array; /** * @api diff --git a/src/ServiceContracts/Files/BulkContract.php b/src/ServiceContracts/Files/BulkContract.php index eaecf6d1..5d1aca5a 100644 --- a/src/ServiceContracts/Files/BulkContract.php +++ b/src/ServiceContracts/Files/BulkContract.php @@ -62,6 +62,6 @@ public function removeAITags( */ public function removeTags( array|BulkRemoveTagsParams $params, - ?RequestOptions $requestOptions = null, + ?RequestOptions $requestOptions = null ): BulkRemoveTagsResponse; } From 577f5285b139a39f605dc3e38773eb0ecf5bbef5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 3 Dec 2025 17:01:48 +0000 Subject: [PATCH 081/193] chore: be more targeted in suppressing superfluous linter warnings --- src/Core/Concerns/SdkModel.php | 2 +- src/Core/Concerns/SdkPage.php | 9 ++------- src/Core/Concerns/SdkUnion.php | 1 - src/Core/Conversion/PropertyInfo.php | 2 +- src/Files/File/SelectedFieldsSchema.php | 7 ++++--- src/RequestOptions.php | 3 ++- src/Services/Accounts/OriginsService.php | 10 +++++----- src/Services/Accounts/URLEndpointsService.php | 10 +++++----- src/Services/Accounts/UsageService.php | 2 +- src/Services/AssetsService.php | 2 +- src/Services/Beta/V2/FilesService.php | 2 +- src/Services/Cache/InvalidationService.php | 4 ++-- src/Services/CustomMetadataFieldsService.php | 8 ++++---- src/Services/Files/BulkService.php | 8 ++++---- src/Services/Files/MetadataService.php | 4 ++-- src/Services/Files/VersionsService.php | 8 ++++---- src/Services/FilesService.php | 14 +++++++------- src/Services/Folders/JobService.php | 2 +- src/Services/FoldersService.php | 10 +++++----- 19 files changed, 52 insertions(+), 56 deletions(-) diff --git a/src/Core/Concerns/SdkModel.php b/src/Core/Concerns/SdkModel.php index 1b538e3e..b94a1f03 100644 --- a/src/Core/Concerns/SdkModel.php +++ b/src/Core/Concerns/SdkModel.php @@ -213,7 +213,7 @@ public function offsetUnset(mixed $offset): void */ public function jsonSerialize(): array { - // @phpstan-ignore-next-line + // @phpstan-ignore-next-line argument.type return Conversion::dump(self::converter(), value: $this->__serialize()); } diff --git a/src/Core/Concerns/SdkPage.php b/src/Core/Concerns/SdkPage.php index 25f2e976..2641b20b 100644 --- a/src/Core/Concerns/SdkPage.php +++ b/src/Core/Concerns/SdkPage.php @@ -37,12 +37,7 @@ abstract public function getItems(): array; public function hasNextPage(): bool { - $items = $this->getItems(); - if (empty($items)) { - return false; - } - - return null != $this->nextRequest(); + return !is_null($this->nextRequest()); } /** @@ -65,7 +60,7 @@ public function getNextPage(): static [$req, $opts] = $next; - // @phpstan-ignore-next-line + // @phpstan-ignore-next-line argument.type return $this->client->request(...$req, convert: $this->convert, page: $this::class, options: $opts); } diff --git a/src/Core/Concerns/SdkUnion.php b/src/Core/Concerns/SdkUnion.php index 87356601..5fd7012f 100644 --- a/src/Core/Concerns/SdkUnion.php +++ b/src/Core/Concerns/SdkUnion.php @@ -34,7 +34,6 @@ public static function converter(): Converter return static::$converter; } - // @phpstan-ignore-next-line return static::$converter = new UnionOf(discriminator: static::discriminator(), variants: static::variants()); } } diff --git a/src/Core/Conversion/PropertyInfo.php b/src/Core/Conversion/PropertyInfo.php index 0cfd7c72..b4b83776 100644 --- a/src/Core/Conversion/PropertyInfo.php +++ b/src/Core/Conversion/PropertyInfo.php @@ -59,7 +59,7 @@ private static function parse(array|Converter|ConverterSource|\ReflectionType|st } if ($type instanceof \ReflectionUnionType) { - // @phpstan-ignore-next-line + // @phpstan-ignore-next-line argument.type return new UnionOf(array_map(static fn ($t) => self::parse($t), array: $type->getTypes())); } diff --git a/src/Files/File/SelectedFieldsSchema.php b/src/Files/File/SelectedFieldsSchema.php index b4ba9d82..f6026df6 100644 --- a/src/Files/File/SelectedFieldsSchema.php +++ b/src/Files/File/SelectedFieldsSchema.php @@ -13,7 +13,7 @@ /** * @phpstan-type SelectedFieldsSchemaShape = array{ - * type: value-of, + * type: value-of<\ImageKit\Files\File\SelectedFieldsSchema\Type>, * defaultValue?: string|float|bool|null|list, * isValueRequired?: bool|null, * maxLength?: float|null, @@ -158,8 +158,9 @@ public static function with( * * @param Type|value-of $type */ - public function withType(Type|string $type): self - { + public function withType( + Type|string $type + ): self { $obj = clone $this; $obj['type'] = $type; diff --git a/src/RequestOptions.php b/src/RequestOptions.php index f3283ff0..6f45538e 100644 --- a/src/RequestOptions.php +++ b/src/RequestOptions.php @@ -83,7 +83,8 @@ public static function parse(RequestOptions|array|null ...$options): self { $parsed = array_map(static fn ($o) => $o instanceof self ? $o->toProperties() : $o ?? [], array: $options); - return self::with(...array_merge(...$parsed)); // @phpstan-ignore-line + // @phpstan-ignore-next-line argument.type + return self::with(...array_merge(...$parsed)); } /** diff --git a/src/Services/Accounts/OriginsService.php b/src/Services/Accounts/OriginsService.php index c5e836df..f9de6a1f 100644 --- a/src/Services/Accounts/OriginsService.php +++ b/src/Services/Accounts/OriginsService.php @@ -45,7 +45,7 @@ public function create( $requestOptions, ); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'post', path: 'v1/accounts/origins', @@ -73,7 +73,7 @@ public function update( $requestOptions, ); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'put', path: ['v1/accounts/origins/%1$s', $id], @@ -95,7 +95,7 @@ public function update( */ public function list(?RequestOptions $requestOptions = null): array { - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'get', path: 'v1/accounts/origins', @@ -116,7 +116,7 @@ public function delete( string $id, ?RequestOptions $requestOptions = null ): mixed { - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'delete', path: ['v1/accounts/origins/%1$s', $id], @@ -137,7 +137,7 @@ public function get( string $id, ?RequestOptions $requestOptions = null ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'get', path: ['v1/accounts/origins/%1$s', $id], diff --git a/src/Services/Accounts/URLEndpointsService.php b/src/Services/Accounts/URLEndpointsService.php index 2d3a5349..6077645b 100644 --- a/src/Services/Accounts/URLEndpointsService.php +++ b/src/Services/Accounts/URLEndpointsService.php @@ -44,7 +44,7 @@ public function create( $requestOptions, ); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'post', path: 'v1/accounts/url-endpoints', @@ -79,7 +79,7 @@ public function update( $requestOptions, ); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'put', path: ['v1/accounts/url-endpoints/%1$s', $id], @@ -101,7 +101,7 @@ public function update( */ public function list(?RequestOptions $requestOptions = null): array { - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'get', path: 'v1/accounts/url-endpoints', @@ -122,7 +122,7 @@ public function delete( string $id, ?RequestOptions $requestOptions = null ): mixed { - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'delete', path: ['v1/accounts/url-endpoints/%1$s', $id], @@ -143,7 +143,7 @@ public function get( string $id, ?RequestOptions $requestOptions = null ): URLEndpointResponse { - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'get', path: ['v1/accounts/url-endpoints/%1$s', $id], diff --git a/src/Services/Accounts/UsageService.php b/src/Services/Accounts/UsageService.php index fadeb0bb..e60676bf 100644 --- a/src/Services/Accounts/UsageService.php +++ b/src/Services/Accounts/UsageService.php @@ -38,7 +38,7 @@ public function get( $requestOptions, ); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'get', path: 'v1/accounts/usage', diff --git a/src/Services/AssetsService.php b/src/Services/AssetsService.php index 847fde85..0487868a 100644 --- a/src/Services/AssetsService.php +++ b/src/Services/AssetsService.php @@ -50,7 +50,7 @@ public function list( $requestOptions, ); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'get', path: 'v1/files', diff --git a/src/Services/Beta/V2/FilesService.php b/src/Services/Beta/V2/FilesService.php index 50a9f2ea..6ac42f00 100644 --- a/src/Services/Beta/V2/FilesService.php +++ b/src/Services/Beta/V2/FilesService.php @@ -73,7 +73,7 @@ public function upload( ->client ->baseUrlOverridden ? 'api/v2/files/upload' : 'https://upload.imagekit.io/api/v2/files/upload'; - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'post', path: $path, diff --git a/src/Services/Cache/InvalidationService.php b/src/Services/Cache/InvalidationService.php index 047ea21e..6a363259 100644 --- a/src/Services/Cache/InvalidationService.php +++ b/src/Services/Cache/InvalidationService.php @@ -37,7 +37,7 @@ public function create( $requestOptions, ); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'post', path: 'v1/files/purge', @@ -58,7 +58,7 @@ public function get( string $requestID, ?RequestOptions $requestOptions = null ): InvalidationGetResponse { - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'get', path: ['v1/files/purge/%1$s', $requestID], diff --git a/src/Services/CustomMetadataFieldsService.php b/src/Services/CustomMetadataFieldsService.php index 028eafeb..bb3585a4 100644 --- a/src/Services/CustomMetadataFieldsService.php +++ b/src/Services/CustomMetadataFieldsService.php @@ -53,7 +53,7 @@ public function create( $requestOptions, ); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'post', path: 'v1/customMetadataFields', @@ -93,7 +93,7 @@ public function update( $requestOptions, ); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'patch', path: ['v1/customMetadataFields/%1$s', $id], @@ -127,7 +127,7 @@ public function list( $requestOptions, ); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'get', path: 'v1/customMetadataFields', @@ -148,7 +148,7 @@ public function delete( string $id, ?RequestOptions $requestOptions = null ): CustomMetadataFieldDeleteResponse { - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'delete', path: ['v1/customMetadataFields/%1$s', $id], diff --git a/src/Services/Files/BulkService.php b/src/Services/Files/BulkService.php index db8236ed..65a3887d 100644 --- a/src/Services/Files/BulkService.php +++ b/src/Services/Files/BulkService.php @@ -46,7 +46,7 @@ public function delete( $requestOptions, ); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'post', path: 'v1/files/batch/deleteByFileIds', @@ -76,7 +76,7 @@ public function addTags( $requestOptions, ); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'post', path: 'v1/files/addTags', @@ -106,7 +106,7 @@ public function removeAITags( $requestOptions, ); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'post', path: 'v1/files/removeAITags', @@ -136,7 +136,7 @@ public function removeTags( $requestOptions, ); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'post', path: 'v1/files/removeTags', diff --git a/src/Services/Files/MetadataService.php b/src/Services/Files/MetadataService.php index d7aabb64..18eb892b 100644 --- a/src/Services/Files/MetadataService.php +++ b/src/Services/Files/MetadataService.php @@ -31,7 +31,7 @@ public function get( string $fileID, ?RequestOptions $requestOptions = null ): Metadata { - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'get', path: ['v1/files/%1$s/metadata', $fileID], @@ -58,7 +58,7 @@ public function getFromURL( $requestOptions, ); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'get', path: 'v1/files/metadata', diff --git a/src/Services/Files/VersionsService.php b/src/Services/Files/VersionsService.php index dc213148..e9e88e43 100644 --- a/src/Services/Files/VersionsService.php +++ b/src/Services/Files/VersionsService.php @@ -35,7 +35,7 @@ public function list( string $fileID, ?RequestOptions $requestOptions = null ): array { - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'get', path: ['v1/files/%1$s/versions', $fileID], @@ -67,7 +67,7 @@ public function delete( $fileID = $parsed['fileId']; unset($parsed['fileId']); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'delete', path: ['v1/files/%1$s/versions/%2$s', $fileID, $versionID], @@ -97,7 +97,7 @@ public function get( $fileID = $parsed['fileId']; unset($parsed['fileId']); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'get', path: ['v1/files/%1$s/versions/%2$s', $fileID, $versionID], @@ -127,7 +127,7 @@ public function restore( $fileID = $parsed['fileId']; unset($parsed['fileId']); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'put', path: ['v1/files/%1$s/versions/%2$s/restore', $fileID, $versionID], diff --git a/src/Services/FilesService.php b/src/Services/FilesService.php index 1d014ff2..96997fd6 100644 --- a/src/Services/FilesService.php +++ b/src/Services/FilesService.php @@ -67,7 +67,7 @@ public function update( $requestOptions, ); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'patch', path: ['v1/files/%1$s/details', $fileID], @@ -90,7 +90,7 @@ public function delete( string $fileID, ?RequestOptions $requestOptions = null ): mixed { - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'delete', path: ['v1/files/%1$s', $fileID], @@ -121,7 +121,7 @@ public function copy( $requestOptions, ); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'post', path: 'v1/files/copy', @@ -142,7 +142,7 @@ public function get( string $fileID, ?RequestOptions $requestOptions = null ): File { - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'get', path: ['v1/files/%1$s/details', $fileID], @@ -173,7 +173,7 @@ public function move( $requestOptions, ); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'post', path: 'v1/files/move', @@ -205,7 +205,7 @@ public function rename( $requestOptions, ); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'put', path: 'v1/files/rename', @@ -273,7 +273,7 @@ public function upload( ->client ->baseUrlOverridden ? 'api/v1/files/upload' : 'https://upload.imagekit.io/api/v1/files/upload'; - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'post', path: $path, diff --git a/src/Services/Folders/JobService.php b/src/Services/Folders/JobService.php index 48f3d7bd..b9fd0873 100644 --- a/src/Services/Folders/JobService.php +++ b/src/Services/Folders/JobService.php @@ -28,7 +28,7 @@ public function get( string $jobID, ?RequestOptions $requestOptions = null ): JobGetResponse { - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'get', path: ['v1/bulkJobs/%1$s', $jobID], diff --git a/src/Services/FoldersService.php b/src/Services/FoldersService.php index 4e8a9876..79eee222 100644 --- a/src/Services/FoldersService.php +++ b/src/Services/FoldersService.php @@ -55,7 +55,7 @@ public function create( $requestOptions, ); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'post', path: 'v1/folder', @@ -83,7 +83,7 @@ public function delete( $requestOptions, ); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'delete', path: 'v1/folder', @@ -113,7 +113,7 @@ public function copy( $requestOptions, ); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'post', path: 'v1/bulkJobs/copyFolder', @@ -143,7 +143,7 @@ public function move( $requestOptions, ); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'post', path: 'v1/bulkJobs/moveFolder', @@ -173,7 +173,7 @@ public function rename( $requestOptions, ); - // @phpstan-ignore-next-line; + // @phpstan-ignore-next-line return.type return $this->client->request( method: 'post', path: 'v1/bulkJobs/renameFolder', From 574a0bbda02bdae57ec2a5655aee2f1264d8a1c3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 3 Dec 2025 18:55:53 +0000 Subject: [PATCH 082/193] chore: better support for phpstan --- tests/Services/Beta/V2/FilesTest.php | 4 ++-- tests/Services/FilesTest.php | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tests/Services/Beta/V2/FilesTest.php b/tests/Services/Beta/V2/FilesTest.php index c7d98a3e..3fe1e7b5 100644 --- a/tests/Services/Beta/V2/FilesTest.php +++ b/tests/Services/Beta/V2/FilesTest.php @@ -39,7 +39,7 @@ public function testUpload(): void } $result = $this->client->beta->v2->files->upload([ - 'file' => null, 'fileName' => 'fileName', + 'file' => file_get_contents(__FILE__) ?: '', 'fileName' => 'fileName', ]); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -54,7 +54,7 @@ public function testUploadWithOptionalParams(): void } $result = $this->client->beta->v2->files->upload([ - 'file' => null, + 'file' => file_get_contents(__FILE__) ?: '', 'fileName' => 'fileName', 'token' => 'token', 'checks' => '"request.folder" : "marketing/"\n', diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index 93e15e5c..557324d3 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -180,7 +180,7 @@ public function testUpload(): void } $result = $this->client->files->upload([ - 'file' => null, 'fileName' => 'fileName', + 'file' => file_get_contents(__FILE__) ?: '', 'fileName' => 'fileName', ]); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -195,7 +195,7 @@ public function testUploadWithOptionalParams(): void } $result = $this->client->files->upload([ - 'file' => null, + 'file' => file_get_contents(__FILE__) ?: '', 'fileName' => 'fileName', 'token' => 'token', 'checks' => '"request.folder" : "marketing/"\n', From eee2c6ec19c56a1635840341ee047f6e3b790142 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 5 Dec 2025 14:14:36 +0000 Subject: [PATCH 083/193] feat: allow both model class instances and arrays in setters --- scripts/lint | 2 +- src/Accounts/Origins/OriginCreateParams.php | 82 +++---- .../Origins/OriginRequest/AkeneoPim.php | 32 +-- .../Origins/OriginRequest/AzureBlob.php | 28 +-- .../OriginRequest/CloudinaryBackup.php | 28 +-- src/Accounts/Origins/OriginRequest/Gcs.php | 28 +-- src/Accounts/Origins/OriginRequest/S3.php | 28 +-- .../Origins/OriginRequest/S3Compatible.php | 36 +-- .../Origins/OriginRequest/WebFolder.php | 20 +- .../Origins/OriginRequest/WebProxy.php | 12 +- .../Origins/OriginResponse/AkeneoPim.php | 20 +- .../Origins/OriginResponse/AzureBlob.php | 28 +-- .../OriginResponse/CloudinaryBackup.php | 24 +- src/Accounts/Origins/OriginResponse/Gcs.php | 28 +-- src/Accounts/Origins/OriginResponse/S3.php | 24 +- .../Origins/OriginResponse/S3Compatible.php | 32 +-- .../Origins/OriginResponse/WebFolder.php | 24 +- .../Origins/OriginResponse/WebProxy.php | 16 +- src/Accounts/Origins/OriginUpdateParams.php | 82 +++---- .../URLEndpoints/URLEndpointCreateParams.php | 34 ++- .../URLRewriter/Cloudinary.php | 4 +- .../URLEndpoints/URLEndpointRequest.php | 30 ++- .../URLRewriter/Cloudinary.php | 4 +- .../URLEndpoints/URLEndpointResponse.php | 34 +-- .../URLRewriter/Cloudinary.php | 4 +- .../URLEndpoints/URLEndpointUpdateParams.php | 34 ++- .../URLRewriter/Cloudinary.php | 4 +- src/Accounts/Usage/UsageGetParams.php | 8 +- src/Accounts/Usage/UsageGetResponse.php | 20 +- src/Assets/AssetListParams.php | 16 +- src/BaseOverlay.php | 38 +++- src/Beta/V2/Files/FileUploadParams.php | 122 ++++++---- .../Files/FileUploadParams/Transformation.php | 21 +- .../Transformation/Post/Abs.php | 4 +- .../Transformation/Post/GifToVideo.php | 4 +- .../Transformation/Post/Thumbnail.php | 4 +- .../Transformation/Post/Transformation.php | 4 +- src/Beta/V2/Files/FileUploadResponse.php | 208 ++++++++++++------ .../V2/Files/FileUploadResponse/AITag.php | 12 +- .../SelectedFieldsSchema.php | 36 +-- .../Files/FileUploadResponse/VersionInfo.php | 8 +- .../Invalidation/InvalidationCreateParams.php | 4 +- .../Invalidation/InvalidationNewResponse.php | 4 +- .../CustomMetadataField.php | 43 +++- .../CustomMetadataField/Schema.php | 28 +-- .../CustomMetadataFieldCreateParams.php | 53 ++++- .../Schema.php | 28 +-- .../CustomMetadataFieldListParams.php | 8 +- .../CustomMetadataFieldUpdateParams.php | 43 +++- .../Schema.php | 28 +-- src/ExtensionItem/AutoTaggingExtension.php | 8 +- src/ExtensionItem/RemoveBg.php | 23 +- src/ExtensionItem/RemoveBg/Options.php | 16 +- src/Files/Bulk/BulkAddTagsParams.php | 8 +- src/Files/Bulk/BulkAddTagsResponse.php | 4 +- src/Files/Bulk/BulkDeleteParams.php | 4 +- src/Files/Bulk/BulkDeleteResponse.php | 4 +- src/Files/Bulk/BulkRemoveAITagsParams.php | 8 +- src/Files/Bulk/BulkRemoveAITagsResponse.php | 4 +- src/Files/Bulk/BulkRemoveTagsParams.php | 8 +- src/Files/Bulk/BulkRemoveTagsResponse.php | 4 +- src/Files/File.php | 129 ++++++----- src/Files/File/AITag.php | 12 +- src/Files/File/SelectedFieldsSchema.php | 36 +-- src/Files/File/VersionInfo.php | 8 +- src/Files/FileCopyParams.php | 12 +- src/Files/FileMoveParams.php | 8 +- src/Files/FileRenameParams.php | 12 +- src/Files/FileRenameResponse.php | 4 +- src/Files/FileUpdateParams.php | 65 ++++-- src/Files/FileUpdateParams/Publish.php | 8 +- src/Files/FileUpdateResponse.php | 158 ++++++++----- src/Files/FileUploadParams.php | 134 ++++++----- src/Files/FileUploadParams/Transformation.php | 21 +- .../Transformation/Post/Abs.php | 4 +- .../Transformation/Post/GifToVideo.php | 4 +- .../Transformation/Post/Thumbnail.php | 4 +- .../Transformation/Post/Transformation.php | 4 +- src/Files/FileUploadResponse.php | 208 ++++++++++++------ src/Files/FileUploadResponse/AITag.php | 12 +- .../SelectedFieldsSchema.php | 36 +-- src/Files/FileUploadResponse/VersionInfo.php | 8 +- src/Files/Folder.php | 20 +- src/Files/Metadata.php | 83 ++++--- src/Files/Metadata/Exif.php | 158 +++++++++++-- src/Files/Metadata/Exif/Exif.php | 104 ++++----- src/Files/Metadata/Exif/Gps.php | 4 +- src/Files/Metadata/Exif/Image.php | 44 ++-- src/Files/Metadata/Exif/Interoperability.php | 8 +- src/Files/Metadata/Exif/Thumbnail.php | 24 +- .../Metadata/MetadataGetFromURLParams.php | 4 +- .../ChangePublicationStatus.php | 16 +- .../ChangePublicationStatus/Publish.php | 8 +- .../UpdateFileRequest/UpdateFileDetails.php | 42 ++-- src/Files/Versions/VersionDeleteParams.php | 4 +- src/Files/Versions/VersionGetParams.php | 4 +- src/Files/Versions/VersionRestoreParams.php | 4 +- src/Folders/FolderCopyParams.php | 12 +- src/Folders/FolderCopyResponse.php | 4 +- src/Folders/FolderCreateParams.php | 8 +- src/Folders/FolderDeleteParams.php | 4 +- src/Folders/FolderMoveParams.php | 8 +- src/Folders/FolderMoveResponse.php | 4 +- src/Folders/FolderRenameParams.php | 12 +- src/Folders/FolderRenameResponse.php | 4 +- src/Folders/Job/JobGetResponse.php | 8 +- src/GetImageAttributesOptions.php | 40 ++-- src/ImageOverlay.php | 45 +++- src/OverlayPosition.php | 8 +- src/OverlayTiming.php | 12 +- src/ResponsiveImageAttributes.php | 16 +- src/SolidColorOverlay.php | 63 ++++-- src/SolidColorOverlayTransformation.php | 24 +- src/SrcOptions.php | 24 +- src/SubtitleOverlay.php | 66 ++++-- src/SubtitleOverlayTransformation.php | 24 +- src/TextOverlay.php | 79 +++++-- src/TextOverlayTransformation.php | 44 ++-- src/Transformation.php | 180 +++++++-------- src/VideoOverlay.php | 45 +++- src/Webhooks/BaseWebhookEvent.php | 8 +- .../UploadPostTransformErrorEvent.php | 56 +++-- .../UploadPostTransformErrorEvent/Data.php | 33 +-- .../Data/Transformation.php | 13 +- .../Data/Transformation/Error.php | 4 +- .../UploadPostTransformErrorEvent/Request.php | 26 ++- .../Request/Transformation.php | 4 +- .../UploadPostTransformSuccessEvent.php | 42 ++-- .../UploadPostTransformSuccessEvent/Data.php | 12 +- .../Request.php | 26 ++- .../Request/Transformation.php | 4 +- src/Webhooks/UploadPreTransformErrorEvent.php | 42 ++-- .../UploadPreTransformErrorEvent/Data.php | 25 ++- .../Data/Transformation.php | 13 +- .../Data/Transformation/Error.php | 4 +- .../UploadPreTransformErrorEvent/Request.php | 8 +- .../UploadPreTransformSuccessEvent.php | 93 ++++++-- .../UploadPreTransformSuccessEvent/Data.php | 208 ++++++++++++------ .../Data/AITag.php | 12 +- .../Data/SelectedFieldsSchema.php | 36 +-- .../Data/VersionInfo.php | 8 +- .../Request.php | 8 +- .../VideoTransformationAcceptedEvent.php | 42 ++-- .../VideoTransformationAcceptedEvent/Data.php | 32 ++- .../Data/Asset.php | 4 +- .../Data/Transformation.php | 31 ++- .../Data/Transformation/Options.php | 12 +- .../Request.php | 12 +- .../VideoTransformationErrorEvent.php | 42 ++-- .../VideoTransformationErrorEvent/Data.php | 34 ++- .../Data/Asset.php | 4 +- .../Data/Transformation.php | 43 +++- .../Data/Transformation/Options.php | 12 +- .../VideoTransformationErrorEvent/Request.php | 12 +- .../VideoTransformationReadyEvent.php | 57 +++-- .../VideoTransformationReadyEvent/Data.php | 34 ++- .../Data/Asset.php | 4 +- .../Data/Transformation.php | 43 +++- .../Data/Transformation/Options.php | 12 +- .../Data/Transformation/Output.php | 20 +- .../Transformation/Output/VideoMetadata.php | 16 +- .../VideoTransformationReadyEvent/Request.php | 12 +- .../VideoTransformationReadyEvent/Timings.php | 8 +- 163 files changed, 3063 insertions(+), 1813 deletions(-) diff --git a/scripts/lint b/scripts/lint index 13f2f013..211ce906 100755 --- a/scripts/lint +++ b/scripts/lint @@ -5,4 +5,4 @@ set -e cd -- "$(dirname -- "$0")/.." echo "==> Running PHPStan" -exec -- ./vendor/bin/phpstan analyse --memory-limit=2G +exec -- ./vendor/bin/phpstan analyse --memory-limit=12G diff --git a/src/Accounts/Origins/OriginCreateParams.php b/src/Accounts/Origins/OriginCreateParams.php index fa203eaf..65ae3a7e 100644 --- a/src/Accounts/Origins/OriginCreateParams.php +++ b/src/Accounts/Origins/OriginCreateParams.php @@ -227,27 +227,27 @@ public static function with( ): self { $obj = new self; - $obj->accessKey = $accessKey; - $obj->bucket = $bucket; - $obj->name = $name; - $obj->secretKey = $secretKey; - $obj->endpoint = $endpoint; - $obj->baseUrl = $baseUrl; - $obj->clientEmail = $clientEmail; - $obj->privateKey = $privateKey; - $obj->accountName = $accountName; - $obj->container = $container; - $obj->sasToken = $sasToken; - $obj->clientId = $clientId; - $obj->clientSecret = $clientSecret; - $obj->password = $password; - $obj->username = $username; - - null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; - null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; - null !== $prefix && $obj->prefix = $prefix; - null !== $s3ForcePathStyle && $obj->s3ForcePathStyle = $s3ForcePathStyle; - null !== $forwardHostHeaderToOrigin && $obj->forwardHostHeaderToOrigin = $forwardHostHeaderToOrigin; + $obj['accessKey'] = $accessKey; + $obj['bucket'] = $bucket; + $obj['name'] = $name; + $obj['secretKey'] = $secretKey; + $obj['endpoint'] = $endpoint; + $obj['baseUrl'] = $baseUrl; + $obj['clientEmail'] = $clientEmail; + $obj['privateKey'] = $privateKey; + $obj['accountName'] = $accountName; + $obj['container'] = $container; + $obj['sasToken'] = $sasToken; + $obj['clientId'] = $clientId; + $obj['clientSecret'] = $clientSecret; + $obj['password'] = $password; + $obj['username'] = $username; + + null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + null !== $prefix && $obj['prefix'] = $prefix; + null !== $s3ForcePathStyle && $obj['s3ForcePathStyle'] = $s3ForcePathStyle; + null !== $forwardHostHeaderToOrigin && $obj['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; return $obj; } @@ -258,7 +258,7 @@ public static function with( public function withAccessKey(string $accessKey): self { $obj = clone $this; - $obj->accessKey = $accessKey; + $obj['accessKey'] = $accessKey; return $obj; } @@ -266,7 +266,7 @@ public function withAccessKey(string $accessKey): self public function withBucket(string $bucket): self { $obj = clone $this; - $obj->bucket = $bucket; + $obj['bucket'] = $bucket; return $obj; } @@ -277,7 +277,7 @@ public function withBucket(string $bucket): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -288,7 +288,7 @@ public function withName(string $name): self public function withSecretKey(string $secretKey): self { $obj = clone $this; - $obj->secretKey = $secretKey; + $obj['secretKey'] = $secretKey; return $obj; } @@ -300,7 +300,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; + $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } @@ -312,7 +312,7 @@ public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { $obj = clone $this; - $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; return $obj; } @@ -320,7 +320,7 @@ public function withIncludeCanonicalHeader( public function withPrefix(string $prefix): self { $obj = clone $this; - $obj->prefix = $prefix; + $obj['prefix'] = $prefix; return $obj; } @@ -331,7 +331,7 @@ public function withPrefix(string $prefix): self public function withEndpoint(string $endpoint): self { $obj = clone $this; - $obj->endpoint = $endpoint; + $obj['endpoint'] = $endpoint; return $obj; } @@ -342,7 +342,7 @@ public function withEndpoint(string $endpoint): self public function withS3ForcePathStyle(bool $s3ForcePathStyle): self { $obj = clone $this; - $obj->s3ForcePathStyle = $s3ForcePathStyle; + $obj['s3ForcePathStyle'] = $s3ForcePathStyle; return $obj; } @@ -353,7 +353,7 @@ public function withS3ForcePathStyle(bool $s3ForcePathStyle): self public function withBaseURL(string $baseURL): self { $obj = clone $this; - $obj->baseUrl = $baseURL; + $obj['baseUrl'] = $baseURL; return $obj; } @@ -365,7 +365,7 @@ public function withForwardHostHeaderToOrigin( bool $forwardHostHeaderToOrigin ): self { $obj = clone $this; - $obj->forwardHostHeaderToOrigin = $forwardHostHeaderToOrigin; + $obj['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; return $obj; } @@ -373,7 +373,7 @@ public function withForwardHostHeaderToOrigin( public function withClientEmail(string $clientEmail): self { $obj = clone $this; - $obj->clientEmail = $clientEmail; + $obj['clientEmail'] = $clientEmail; return $obj; } @@ -381,7 +381,7 @@ public function withClientEmail(string $clientEmail): self public function withPrivateKey(string $privateKey): self { $obj = clone $this; - $obj->privateKey = $privateKey; + $obj['privateKey'] = $privateKey; return $obj; } @@ -389,7 +389,7 @@ public function withPrivateKey(string $privateKey): self public function withAccountName(string $accountName): self { $obj = clone $this; - $obj->accountName = $accountName; + $obj['accountName'] = $accountName; return $obj; } @@ -397,7 +397,7 @@ public function withAccountName(string $accountName): self public function withContainer(string $container): self { $obj = clone $this; - $obj->container = $container; + $obj['container'] = $container; return $obj; } @@ -405,7 +405,7 @@ public function withContainer(string $container): self public function withSasToken(string $sasToken): self { $obj = clone $this; - $obj->sasToken = $sasToken; + $obj['sasToken'] = $sasToken; return $obj; } @@ -416,7 +416,7 @@ public function withSasToken(string $sasToken): self public function withClientID(string $clientID): self { $obj = clone $this; - $obj->clientId = $clientID; + $obj['clientId'] = $clientID; return $obj; } @@ -427,7 +427,7 @@ public function withClientID(string $clientID): self public function withClientSecret(string $clientSecret): self { $obj = clone $this; - $obj->clientSecret = $clientSecret; + $obj['clientSecret'] = $clientSecret; return $obj; } @@ -438,7 +438,7 @@ public function withClientSecret(string $clientSecret): self public function withPassword(string $password): self { $obj = clone $this; - $obj->password = $password; + $obj['password'] = $password; return $obj; } @@ -449,7 +449,7 @@ public function withPassword(string $password): self public function withUsername(string $username): self { $obj = clone $this; - $obj->username = $username; + $obj['username'] = $username; return $obj; } diff --git a/src/Accounts/Origins/OriginRequest/AkeneoPim.php b/src/Accounts/Origins/OriginRequest/AkeneoPim.php index bf5080f0..e52266f1 100644 --- a/src/Accounts/Origins/OriginRequest/AkeneoPim.php +++ b/src/Accounts/Origins/OriginRequest/AkeneoPim.php @@ -127,15 +127,15 @@ public static function with( ): self { $obj = new self; - $obj->baseUrl = $baseUrl; - $obj->clientId = $clientId; - $obj->clientSecret = $clientSecret; - $obj->name = $name; - $obj->password = $password; - $obj->username = $username; + $obj['baseUrl'] = $baseUrl; + $obj['clientId'] = $clientId; + $obj['clientSecret'] = $clientSecret; + $obj['name'] = $name; + $obj['password'] = $password; + $obj['username'] = $username; - null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; - null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; return $obj; } @@ -146,7 +146,7 @@ public static function with( public function withBaseURL(string $baseURL): self { $obj = clone $this; - $obj->baseUrl = $baseURL; + $obj['baseUrl'] = $baseURL; return $obj; } @@ -157,7 +157,7 @@ public function withBaseURL(string $baseURL): self public function withClientID(string $clientID): self { $obj = clone $this; - $obj->clientId = $clientID; + $obj['clientId'] = $clientID; return $obj; } @@ -168,7 +168,7 @@ public function withClientID(string $clientID): self public function withClientSecret(string $clientSecret): self { $obj = clone $this; - $obj->clientSecret = $clientSecret; + $obj['clientSecret'] = $clientSecret; return $obj; } @@ -179,7 +179,7 @@ public function withClientSecret(string $clientSecret): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -190,7 +190,7 @@ public function withName(string $name): self public function withPassword(string $password): self { $obj = clone $this; - $obj->password = $password; + $obj['password'] = $password; return $obj; } @@ -201,7 +201,7 @@ public function withPassword(string $password): self public function withUsername(string $username): self { $obj = clone $this; - $obj->username = $username; + $obj['username'] = $username; return $obj; } @@ -213,7 +213,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; + $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } @@ -225,7 +225,7 @@ public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { $obj = clone $this; - $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginRequest/AzureBlob.php b/src/Accounts/Origins/OriginRequest/AzureBlob.php index ef743bf4..a3052687 100644 --- a/src/Accounts/Origins/OriginRequest/AzureBlob.php +++ b/src/Accounts/Origins/OriginRequest/AzureBlob.php @@ -98,14 +98,14 @@ public static function with( ): self { $obj = new self; - $obj->accountName = $accountName; - $obj->container = $container; - $obj->name = $name; - $obj->sasToken = $sasToken; + $obj['accountName'] = $accountName; + $obj['container'] = $container; + $obj['name'] = $name; + $obj['sasToken'] = $sasToken; - null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; - null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; - null !== $prefix && $obj->prefix = $prefix; + null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + null !== $prefix && $obj['prefix'] = $prefix; return $obj; } @@ -113,7 +113,7 @@ public static function with( public function withAccountName(string $accountName): self { $obj = clone $this; - $obj->accountName = $accountName; + $obj['accountName'] = $accountName; return $obj; } @@ -121,7 +121,7 @@ public function withAccountName(string $accountName): self public function withContainer(string $container): self { $obj = clone $this; - $obj->container = $container; + $obj['container'] = $container; return $obj; } @@ -132,7 +132,7 @@ public function withContainer(string $container): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -140,7 +140,7 @@ public function withName(string $name): self public function withSasToken(string $sasToken): self { $obj = clone $this; - $obj->sasToken = $sasToken; + $obj['sasToken'] = $sasToken; return $obj; } @@ -152,7 +152,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; + $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } @@ -164,7 +164,7 @@ public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { $obj = clone $this; - $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; return $obj; } @@ -172,7 +172,7 @@ public function withIncludeCanonicalHeader( public function withPrefix(string $prefix): self { $obj = clone $this; - $obj->prefix = $prefix; + $obj['prefix'] = $prefix; return $obj; } diff --git a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php index b30dd831..ac6ede7d 100644 --- a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php @@ -110,14 +110,14 @@ public static function with( ): self { $obj = new self; - $obj->accessKey = $accessKey; - $obj->bucket = $bucket; - $obj->name = $name; - $obj->secretKey = $secretKey; + $obj['accessKey'] = $accessKey; + $obj['bucket'] = $bucket; + $obj['name'] = $name; + $obj['secretKey'] = $secretKey; - null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; - null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; - null !== $prefix && $obj->prefix = $prefix; + null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + null !== $prefix && $obj['prefix'] = $prefix; return $obj; } @@ -128,7 +128,7 @@ public static function with( public function withAccessKey(string $accessKey): self { $obj = clone $this; - $obj->accessKey = $accessKey; + $obj['accessKey'] = $accessKey; return $obj; } @@ -139,7 +139,7 @@ public function withAccessKey(string $accessKey): self public function withBucket(string $bucket): self { $obj = clone $this; - $obj->bucket = $bucket; + $obj['bucket'] = $bucket; return $obj; } @@ -150,7 +150,7 @@ public function withBucket(string $bucket): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -161,7 +161,7 @@ public function withName(string $name): self public function withSecretKey(string $secretKey): self { $obj = clone $this; - $obj->secretKey = $secretKey; + $obj['secretKey'] = $secretKey; return $obj; } @@ -173,7 +173,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; + $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } @@ -185,7 +185,7 @@ public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { $obj = clone $this; - $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; return $obj; } @@ -196,7 +196,7 @@ public function withIncludeCanonicalHeader( public function withPrefix(string $prefix): self { $obj = clone $this; - $obj->prefix = $prefix; + $obj['prefix'] = $prefix; return $obj; } diff --git a/src/Accounts/Origins/OriginRequest/Gcs.php b/src/Accounts/Origins/OriginRequest/Gcs.php index 8c539ffc..e49d978b 100644 --- a/src/Accounts/Origins/OriginRequest/Gcs.php +++ b/src/Accounts/Origins/OriginRequest/Gcs.php @@ -98,14 +98,14 @@ public static function with( ): self { $obj = new self; - $obj->bucket = $bucket; - $obj->clientEmail = $clientEmail; - $obj->name = $name; - $obj->privateKey = $privateKey; + $obj['bucket'] = $bucket; + $obj['clientEmail'] = $clientEmail; + $obj['name'] = $name; + $obj['privateKey'] = $privateKey; - null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; - null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; - null !== $prefix && $obj->prefix = $prefix; + null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + null !== $prefix && $obj['prefix'] = $prefix; return $obj; } @@ -113,7 +113,7 @@ public static function with( public function withBucket(string $bucket): self { $obj = clone $this; - $obj->bucket = $bucket; + $obj['bucket'] = $bucket; return $obj; } @@ -121,7 +121,7 @@ public function withBucket(string $bucket): self public function withClientEmail(string $clientEmail): self { $obj = clone $this; - $obj->clientEmail = $clientEmail; + $obj['clientEmail'] = $clientEmail; return $obj; } @@ -132,7 +132,7 @@ public function withClientEmail(string $clientEmail): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -140,7 +140,7 @@ public function withName(string $name): self public function withPrivateKey(string $privateKey): self { $obj = clone $this; - $obj->privateKey = $privateKey; + $obj['privateKey'] = $privateKey; return $obj; } @@ -152,7 +152,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; + $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } @@ -164,7 +164,7 @@ public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { $obj = clone $this; - $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; return $obj; } @@ -172,7 +172,7 @@ public function withIncludeCanonicalHeader( public function withPrefix(string $prefix): self { $obj = clone $this; - $obj->prefix = $prefix; + $obj['prefix'] = $prefix; return $obj; } diff --git a/src/Accounts/Origins/OriginRequest/S3.php b/src/Accounts/Origins/OriginRequest/S3.php index 9886a4eb..57f783fc 100644 --- a/src/Accounts/Origins/OriginRequest/S3.php +++ b/src/Accounts/Origins/OriginRequest/S3.php @@ -106,14 +106,14 @@ public static function with( ): self { $obj = new self; - $obj->accessKey = $accessKey; - $obj->bucket = $bucket; - $obj->name = $name; - $obj->secretKey = $secretKey; + $obj['accessKey'] = $accessKey; + $obj['bucket'] = $bucket; + $obj['name'] = $name; + $obj['secretKey'] = $secretKey; - null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; - null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; - null !== $prefix && $obj->prefix = $prefix; + null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + null !== $prefix && $obj['prefix'] = $prefix; return $obj; } @@ -124,7 +124,7 @@ public static function with( public function withAccessKey(string $accessKey): self { $obj = clone $this; - $obj->accessKey = $accessKey; + $obj['accessKey'] = $accessKey; return $obj; } @@ -135,7 +135,7 @@ public function withAccessKey(string $accessKey): self public function withBucket(string $bucket): self { $obj = clone $this; - $obj->bucket = $bucket; + $obj['bucket'] = $bucket; return $obj; } @@ -146,7 +146,7 @@ public function withBucket(string $bucket): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -157,7 +157,7 @@ public function withName(string $name): self public function withSecretKey(string $secretKey): self { $obj = clone $this; - $obj->secretKey = $secretKey; + $obj['secretKey'] = $secretKey; return $obj; } @@ -169,7 +169,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; + $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } @@ -181,7 +181,7 @@ public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { $obj = clone $this; - $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; return $obj; } @@ -192,7 +192,7 @@ public function withIncludeCanonicalHeader( public function withPrefix(string $prefix): self { $obj = clone $this; - $obj->prefix = $prefix; + $obj['prefix'] = $prefix; return $obj; } diff --git a/src/Accounts/Origins/OriginRequest/S3Compatible.php b/src/Accounts/Origins/OriginRequest/S3Compatible.php index 29e40e57..b82425d1 100644 --- a/src/Accounts/Origins/OriginRequest/S3Compatible.php +++ b/src/Accounts/Origins/OriginRequest/S3Compatible.php @@ -129,16 +129,16 @@ public static function with( ): self { $obj = new self; - $obj->accessKey = $accessKey; - $obj->bucket = $bucket; - $obj->endpoint = $endpoint; - $obj->name = $name; - $obj->secretKey = $secretKey; + $obj['accessKey'] = $accessKey; + $obj['bucket'] = $bucket; + $obj['endpoint'] = $endpoint; + $obj['name'] = $name; + $obj['secretKey'] = $secretKey; - null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; - null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; - null !== $prefix && $obj->prefix = $prefix; - null !== $s3ForcePathStyle && $obj->s3ForcePathStyle = $s3ForcePathStyle; + null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + null !== $prefix && $obj['prefix'] = $prefix; + null !== $s3ForcePathStyle && $obj['s3ForcePathStyle'] = $s3ForcePathStyle; return $obj; } @@ -149,7 +149,7 @@ public static function with( public function withAccessKey(string $accessKey): self { $obj = clone $this; - $obj->accessKey = $accessKey; + $obj['accessKey'] = $accessKey; return $obj; } @@ -160,7 +160,7 @@ public function withAccessKey(string $accessKey): self public function withBucket(string $bucket): self { $obj = clone $this; - $obj->bucket = $bucket; + $obj['bucket'] = $bucket; return $obj; } @@ -171,7 +171,7 @@ public function withBucket(string $bucket): self public function withEndpoint(string $endpoint): self { $obj = clone $this; - $obj->endpoint = $endpoint; + $obj['endpoint'] = $endpoint; return $obj; } @@ -182,7 +182,7 @@ public function withEndpoint(string $endpoint): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -193,7 +193,7 @@ public function withName(string $name): self public function withSecretKey(string $secretKey): self { $obj = clone $this; - $obj->secretKey = $secretKey; + $obj['secretKey'] = $secretKey; return $obj; } @@ -205,7 +205,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; + $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } @@ -217,7 +217,7 @@ public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { $obj = clone $this; - $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; return $obj; } @@ -228,7 +228,7 @@ public function withIncludeCanonicalHeader( public function withPrefix(string $prefix): self { $obj = clone $this; - $obj->prefix = $prefix; + $obj['prefix'] = $prefix; return $obj; } @@ -239,7 +239,7 @@ public function withPrefix(string $prefix): self public function withS3ForcePathStyle(bool $s3ForcePathStyle): self { $obj = clone $this; - $obj->s3ForcePathStyle = $s3ForcePathStyle; + $obj['s3ForcePathStyle'] = $s3ForcePathStyle; return $obj; } diff --git a/src/Accounts/Origins/OriginRequest/WebFolder.php b/src/Accounts/Origins/OriginRequest/WebFolder.php index e6c41de7..5b404dce 100644 --- a/src/Accounts/Origins/OriginRequest/WebFolder.php +++ b/src/Accounts/Origins/OriginRequest/WebFolder.php @@ -90,12 +90,12 @@ public static function with( ): self { $obj = new self; - $obj->baseUrl = $baseUrl; - $obj->name = $name; + $obj['baseUrl'] = $baseUrl; + $obj['name'] = $name; - null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; - null !== $forwardHostHeaderToOrigin && $obj->forwardHostHeaderToOrigin = $forwardHostHeaderToOrigin; - null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $forwardHostHeaderToOrigin && $obj['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; + null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; return $obj; } @@ -106,7 +106,7 @@ public static function with( public function withBaseURL(string $baseURL): self { $obj = clone $this; - $obj->baseUrl = $baseURL; + $obj['baseUrl'] = $baseURL; return $obj; } @@ -117,7 +117,7 @@ public function withBaseURL(string $baseURL): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -129,7 +129,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; + $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } @@ -141,7 +141,7 @@ public function withForwardHostHeaderToOrigin( bool $forwardHostHeaderToOrigin ): self { $obj = clone $this; - $obj->forwardHostHeaderToOrigin = $forwardHostHeaderToOrigin; + $obj['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; return $obj; } @@ -153,7 +153,7 @@ public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { $obj = clone $this; - $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginRequest/WebProxy.php b/src/Accounts/Origins/OriginRequest/WebProxy.php index 8408222e..44050bcc 100644 --- a/src/Accounts/Origins/OriginRequest/WebProxy.php +++ b/src/Accounts/Origins/OriginRequest/WebProxy.php @@ -74,10 +74,10 @@ public static function with( ): self { $obj = new self; - $obj->name = $name; + $obj['name'] = $name; - null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; - null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; return $obj; } @@ -88,7 +88,7 @@ public static function with( public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -100,7 +100,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; + $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } @@ -112,7 +112,7 @@ public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { $obj = clone $this; - $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginResponse/AkeneoPim.php b/src/Accounts/Origins/OriginResponse/AkeneoPim.php index b03178d8..5dfd02a0 100644 --- a/src/Accounts/Origins/OriginResponse/AkeneoPim.php +++ b/src/Accounts/Origins/OriginResponse/AkeneoPim.php @@ -94,12 +94,12 @@ public static function with( ): self { $obj = new self; - $obj->id = $id; - $obj->baseUrl = $baseUrl; - $obj->includeCanonicalHeader = $includeCanonicalHeader; - $obj->name = $name; + $obj['id'] = $id; + $obj['baseUrl'] = $baseUrl; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $obj['name'] = $name; - null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; return $obj; } @@ -110,7 +110,7 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -121,7 +121,7 @@ public function withID(string $id): self public function withBaseURL(string $baseURL): self { $obj = clone $this; - $obj->baseUrl = $baseURL; + $obj['baseUrl'] = $baseURL; return $obj; } @@ -133,7 +133,7 @@ public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { $obj = clone $this; - $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; return $obj; } @@ -144,7 +144,7 @@ public function withIncludeCanonicalHeader( public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -156,7 +156,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; + $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginResponse/AzureBlob.php b/src/Accounts/Origins/OriginResponse/AzureBlob.php index 832d5195..dd31ff0d 100644 --- a/src/Accounts/Origins/OriginResponse/AzureBlob.php +++ b/src/Accounts/Origins/OriginResponse/AzureBlob.php @@ -110,14 +110,14 @@ public static function with( ): self { $obj = new self; - $obj->id = $id; - $obj->accountName = $accountName; - $obj->container = $container; - $obj->includeCanonicalHeader = $includeCanonicalHeader; - $obj->name = $name; - $obj->prefix = $prefix; + $obj['id'] = $id; + $obj['accountName'] = $accountName; + $obj['container'] = $container; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $obj['name'] = $name; + $obj['prefix'] = $prefix; - null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; return $obj; } @@ -128,7 +128,7 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -136,7 +136,7 @@ public function withID(string $id): self public function withAccountName(string $accountName): self { $obj = clone $this; - $obj->accountName = $accountName; + $obj['accountName'] = $accountName; return $obj; } @@ -144,7 +144,7 @@ public function withAccountName(string $accountName): self public function withContainer(string $container): self { $obj = clone $this; - $obj->container = $container; + $obj['container'] = $container; return $obj; } @@ -156,7 +156,7 @@ public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { $obj = clone $this; - $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; return $obj; } @@ -167,7 +167,7 @@ public function withIncludeCanonicalHeader( public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -175,7 +175,7 @@ public function withName(string $name): self public function withPrefix(string $prefix): self { $obj = clone $this; - $obj->prefix = $prefix; + $obj['prefix'] = $prefix; return $obj; } @@ -187,7 +187,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; + $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php index 360dd86d..62fd6501 100644 --- a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php @@ -105,13 +105,13 @@ public static function with( ): self { $obj = new self; - $obj->id = $id; - $obj->bucket = $bucket; - $obj->includeCanonicalHeader = $includeCanonicalHeader; - $obj->name = $name; - $obj->prefix = $prefix; + $obj['id'] = $id; + $obj['bucket'] = $bucket; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $obj['name'] = $name; + $obj['prefix'] = $prefix; - null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; return $obj; } @@ -122,7 +122,7 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -133,7 +133,7 @@ public function withID(string $id): self public function withBucket(string $bucket): self { $obj = clone $this; - $obj->bucket = $bucket; + $obj['bucket'] = $bucket; return $obj; } @@ -145,7 +145,7 @@ public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { $obj = clone $this; - $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; return $obj; } @@ -156,7 +156,7 @@ public function withIncludeCanonicalHeader( public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -167,7 +167,7 @@ public function withName(string $name): self public function withPrefix(string $prefix): self { $obj = clone $this; - $obj->prefix = $prefix; + $obj['prefix'] = $prefix; return $obj; } @@ -179,7 +179,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; + $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginResponse/Gcs.php b/src/Accounts/Origins/OriginResponse/Gcs.php index bc5edc5a..7640d56e 100644 --- a/src/Accounts/Origins/OriginResponse/Gcs.php +++ b/src/Accounts/Origins/OriginResponse/Gcs.php @@ -110,14 +110,14 @@ public static function with( ): self { $obj = new self; - $obj->id = $id; - $obj->bucket = $bucket; - $obj->clientEmail = $clientEmail; - $obj->includeCanonicalHeader = $includeCanonicalHeader; - $obj->name = $name; - $obj->prefix = $prefix; + $obj['id'] = $id; + $obj['bucket'] = $bucket; + $obj['clientEmail'] = $clientEmail; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $obj['name'] = $name; + $obj['prefix'] = $prefix; - null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; return $obj; } @@ -128,7 +128,7 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -136,7 +136,7 @@ public function withID(string $id): self public function withBucket(string $bucket): self { $obj = clone $this; - $obj->bucket = $bucket; + $obj['bucket'] = $bucket; return $obj; } @@ -144,7 +144,7 @@ public function withBucket(string $bucket): self public function withClientEmail(string $clientEmail): self { $obj = clone $this; - $obj->clientEmail = $clientEmail; + $obj['clientEmail'] = $clientEmail; return $obj; } @@ -156,7 +156,7 @@ public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { $obj = clone $this; - $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; return $obj; } @@ -167,7 +167,7 @@ public function withIncludeCanonicalHeader( public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -175,7 +175,7 @@ public function withName(string $name): self public function withPrefix(string $prefix): self { $obj = clone $this; - $obj->prefix = $prefix; + $obj['prefix'] = $prefix; return $obj; } @@ -187,7 +187,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; + $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginResponse/S3.php b/src/Accounts/Origins/OriginResponse/S3.php index a4e5742f..afd76141 100644 --- a/src/Accounts/Origins/OriginResponse/S3.php +++ b/src/Accounts/Origins/OriginResponse/S3.php @@ -105,13 +105,13 @@ public static function with( ): self { $obj = new self; - $obj->id = $id; - $obj->bucket = $bucket; - $obj->includeCanonicalHeader = $includeCanonicalHeader; - $obj->name = $name; - $obj->prefix = $prefix; + $obj['id'] = $id; + $obj['bucket'] = $bucket; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $obj['name'] = $name; + $obj['prefix'] = $prefix; - null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; return $obj; } @@ -122,7 +122,7 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -133,7 +133,7 @@ public function withID(string $id): self public function withBucket(string $bucket): self { $obj = clone $this; - $obj->bucket = $bucket; + $obj['bucket'] = $bucket; return $obj; } @@ -145,7 +145,7 @@ public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { $obj = clone $this; - $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; return $obj; } @@ -156,7 +156,7 @@ public function withIncludeCanonicalHeader( public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -167,7 +167,7 @@ public function withName(string $name): self public function withPrefix(string $prefix): self { $obj = clone $this; - $obj->prefix = $prefix; + $obj['prefix'] = $prefix; return $obj; } @@ -179,7 +179,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; + $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginResponse/S3Compatible.php b/src/Accounts/Origins/OriginResponse/S3Compatible.php index 7db13ab0..d86d3c02 100644 --- a/src/Accounts/Origins/OriginResponse/S3Compatible.php +++ b/src/Accounts/Origins/OriginResponse/S3Compatible.php @@ -129,15 +129,15 @@ public static function with( ): self { $obj = new self; - $obj->id = $id; - $obj->bucket = $bucket; - $obj->endpoint = $endpoint; - $obj->includeCanonicalHeader = $includeCanonicalHeader; - $obj->name = $name; - $obj->prefix = $prefix; - $obj->s3ForcePathStyle = $s3ForcePathStyle; + $obj['id'] = $id; + $obj['bucket'] = $bucket; + $obj['endpoint'] = $endpoint; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $obj['name'] = $name; + $obj['prefix'] = $prefix; + $obj['s3ForcePathStyle'] = $s3ForcePathStyle; - null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; return $obj; } @@ -148,7 +148,7 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -159,7 +159,7 @@ public function withID(string $id): self public function withBucket(string $bucket): self { $obj = clone $this; - $obj->bucket = $bucket; + $obj['bucket'] = $bucket; return $obj; } @@ -170,7 +170,7 @@ public function withBucket(string $bucket): self public function withEndpoint(string $endpoint): self { $obj = clone $this; - $obj->endpoint = $endpoint; + $obj['endpoint'] = $endpoint; return $obj; } @@ -182,7 +182,7 @@ public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { $obj = clone $this; - $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; return $obj; } @@ -193,7 +193,7 @@ public function withIncludeCanonicalHeader( public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -204,7 +204,7 @@ public function withName(string $name): self public function withPrefix(string $prefix): self { $obj = clone $this; - $obj->prefix = $prefix; + $obj['prefix'] = $prefix; return $obj; } @@ -215,7 +215,7 @@ public function withPrefix(string $prefix): self public function withS3ForcePathStyle(bool $s3ForcePathStyle): self { $obj = clone $this; - $obj->s3ForcePathStyle = $s3ForcePathStyle; + $obj['s3ForcePathStyle'] = $s3ForcePathStyle; return $obj; } @@ -227,7 +227,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; + $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginResponse/WebFolder.php b/src/Accounts/Origins/OriginResponse/WebFolder.php index 34d87e50..1e1d61ff 100644 --- a/src/Accounts/Origins/OriginResponse/WebFolder.php +++ b/src/Accounts/Origins/OriginResponse/WebFolder.php @@ -109,13 +109,13 @@ public static function with( ): self { $obj = new self; - $obj->id = $id; - $obj->baseUrl = $baseUrl; - $obj->forwardHostHeaderToOrigin = $forwardHostHeaderToOrigin; - $obj->includeCanonicalHeader = $includeCanonicalHeader; - $obj->name = $name; + $obj['id'] = $id; + $obj['baseUrl'] = $baseUrl; + $obj['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $obj['name'] = $name; - null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; return $obj; } @@ -126,7 +126,7 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -137,7 +137,7 @@ public function withID(string $id): self public function withBaseURL(string $baseURL): self { $obj = clone $this; - $obj->baseUrl = $baseURL; + $obj['baseUrl'] = $baseURL; return $obj; } @@ -149,7 +149,7 @@ public function withForwardHostHeaderToOrigin( bool $forwardHostHeaderToOrigin ): self { $obj = clone $this; - $obj->forwardHostHeaderToOrigin = $forwardHostHeaderToOrigin; + $obj['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; return $obj; } @@ -161,7 +161,7 @@ public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { $obj = clone $this; - $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; return $obj; } @@ -172,7 +172,7 @@ public function withIncludeCanonicalHeader( public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -184,7 +184,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; + $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginResponse/WebProxy.php b/src/Accounts/Origins/OriginResponse/WebProxy.php index ee6cb00a..c7d324de 100644 --- a/src/Accounts/Origins/OriginResponse/WebProxy.php +++ b/src/Accounts/Origins/OriginResponse/WebProxy.php @@ -82,11 +82,11 @@ public static function with( ): self { $obj = new self; - $obj->id = $id; - $obj->includeCanonicalHeader = $includeCanonicalHeader; - $obj->name = $name; + $obj['id'] = $id; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $obj['name'] = $name; - null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; + null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; return $obj; } @@ -97,7 +97,7 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -109,7 +109,7 @@ public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { $obj = clone $this; - $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; return $obj; } @@ -120,7 +120,7 @@ public function withIncludeCanonicalHeader( public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -132,7 +132,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; + $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginUpdateParams.php b/src/Accounts/Origins/OriginUpdateParams.php index 6309661a..fd9f5f38 100644 --- a/src/Accounts/Origins/OriginUpdateParams.php +++ b/src/Accounts/Origins/OriginUpdateParams.php @@ -227,27 +227,27 @@ public static function with( ): self { $obj = new self; - $obj->accessKey = $accessKey; - $obj->bucket = $bucket; - $obj->name = $name; - $obj->secretKey = $secretKey; - $obj->endpoint = $endpoint; - $obj->baseUrl = $baseUrl; - $obj->clientEmail = $clientEmail; - $obj->privateKey = $privateKey; - $obj->accountName = $accountName; - $obj->container = $container; - $obj->sasToken = $sasToken; - $obj->clientId = $clientId; - $obj->clientSecret = $clientSecret; - $obj->password = $password; - $obj->username = $username; - - null !== $baseUrlForCanonicalHeader && $obj->baseUrlForCanonicalHeader = $baseUrlForCanonicalHeader; - null !== $includeCanonicalHeader && $obj->includeCanonicalHeader = $includeCanonicalHeader; - null !== $prefix && $obj->prefix = $prefix; - null !== $s3ForcePathStyle && $obj->s3ForcePathStyle = $s3ForcePathStyle; - null !== $forwardHostHeaderToOrigin && $obj->forwardHostHeaderToOrigin = $forwardHostHeaderToOrigin; + $obj['accessKey'] = $accessKey; + $obj['bucket'] = $bucket; + $obj['name'] = $name; + $obj['secretKey'] = $secretKey; + $obj['endpoint'] = $endpoint; + $obj['baseUrl'] = $baseUrl; + $obj['clientEmail'] = $clientEmail; + $obj['privateKey'] = $privateKey; + $obj['accountName'] = $accountName; + $obj['container'] = $container; + $obj['sasToken'] = $sasToken; + $obj['clientId'] = $clientId; + $obj['clientSecret'] = $clientSecret; + $obj['password'] = $password; + $obj['username'] = $username; + + null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + null !== $prefix && $obj['prefix'] = $prefix; + null !== $s3ForcePathStyle && $obj['s3ForcePathStyle'] = $s3ForcePathStyle; + null !== $forwardHostHeaderToOrigin && $obj['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; return $obj; } @@ -258,7 +258,7 @@ public static function with( public function withAccessKey(string $accessKey): self { $obj = clone $this; - $obj->accessKey = $accessKey; + $obj['accessKey'] = $accessKey; return $obj; } @@ -266,7 +266,7 @@ public function withAccessKey(string $accessKey): self public function withBucket(string $bucket): self { $obj = clone $this; - $obj->bucket = $bucket; + $obj['bucket'] = $bucket; return $obj; } @@ -277,7 +277,7 @@ public function withBucket(string $bucket): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -288,7 +288,7 @@ public function withName(string $name): self public function withSecretKey(string $secretKey): self { $obj = clone $this; - $obj->secretKey = $secretKey; + $obj['secretKey'] = $secretKey; return $obj; } @@ -300,7 +300,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj->baseUrlForCanonicalHeader = $baseURLForCanonicalHeader; + $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } @@ -312,7 +312,7 @@ public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { $obj = clone $this; - $obj->includeCanonicalHeader = $includeCanonicalHeader; + $obj['includeCanonicalHeader'] = $includeCanonicalHeader; return $obj; } @@ -320,7 +320,7 @@ public function withIncludeCanonicalHeader( public function withPrefix(string $prefix): self { $obj = clone $this; - $obj->prefix = $prefix; + $obj['prefix'] = $prefix; return $obj; } @@ -331,7 +331,7 @@ public function withPrefix(string $prefix): self public function withEndpoint(string $endpoint): self { $obj = clone $this; - $obj->endpoint = $endpoint; + $obj['endpoint'] = $endpoint; return $obj; } @@ -342,7 +342,7 @@ public function withEndpoint(string $endpoint): self public function withS3ForcePathStyle(bool $s3ForcePathStyle): self { $obj = clone $this; - $obj->s3ForcePathStyle = $s3ForcePathStyle; + $obj['s3ForcePathStyle'] = $s3ForcePathStyle; return $obj; } @@ -353,7 +353,7 @@ public function withS3ForcePathStyle(bool $s3ForcePathStyle): self public function withBaseURL(string $baseURL): self { $obj = clone $this; - $obj->baseUrl = $baseURL; + $obj['baseUrl'] = $baseURL; return $obj; } @@ -365,7 +365,7 @@ public function withForwardHostHeaderToOrigin( bool $forwardHostHeaderToOrigin ): self { $obj = clone $this; - $obj->forwardHostHeaderToOrigin = $forwardHostHeaderToOrigin; + $obj['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; return $obj; } @@ -373,7 +373,7 @@ public function withForwardHostHeaderToOrigin( public function withClientEmail(string $clientEmail): self { $obj = clone $this; - $obj->clientEmail = $clientEmail; + $obj['clientEmail'] = $clientEmail; return $obj; } @@ -381,7 +381,7 @@ public function withClientEmail(string $clientEmail): self public function withPrivateKey(string $privateKey): self { $obj = clone $this; - $obj->privateKey = $privateKey; + $obj['privateKey'] = $privateKey; return $obj; } @@ -389,7 +389,7 @@ public function withPrivateKey(string $privateKey): self public function withAccountName(string $accountName): self { $obj = clone $this; - $obj->accountName = $accountName; + $obj['accountName'] = $accountName; return $obj; } @@ -397,7 +397,7 @@ public function withAccountName(string $accountName): self public function withContainer(string $container): self { $obj = clone $this; - $obj->container = $container; + $obj['container'] = $container; return $obj; } @@ -405,7 +405,7 @@ public function withContainer(string $container): self public function withSasToken(string $sasToken): self { $obj = clone $this; - $obj->sasToken = $sasToken; + $obj['sasToken'] = $sasToken; return $obj; } @@ -416,7 +416,7 @@ public function withSasToken(string $sasToken): self public function withClientID(string $clientID): self { $obj = clone $this; - $obj->clientId = $clientID; + $obj['clientId'] = $clientID; return $obj; } @@ -427,7 +427,7 @@ public function withClientID(string $clientID): self public function withClientSecret(string $clientSecret): self { $obj = clone $this; - $obj->clientSecret = $clientSecret; + $obj['clientSecret'] = $clientSecret; return $obj; } @@ -438,7 +438,7 @@ public function withClientSecret(string $clientSecret): self public function withPassword(string $password): self { $obj = clone $this; - $obj->password = $password; + $obj['password'] = $password; return $obj; } @@ -449,7 +449,7 @@ public function withPassword(string $password): self public function withUsername(string $username): self { $obj = clone $this; - $obj->username = $username; + $obj['username'] = $username; return $obj; } diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php index d2ed1a26..44850543 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php @@ -23,7 +23,9 @@ * description: string, * origins?: list, * urlPrefix?: string, - * urlRewriter?: Cloudinary|Imgix|Akamai, + * urlRewriter?: Cloudinary|array{ + * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null + * }|Imgix|array{type: 'IMGIX'}|Akamai|array{type: 'AKAMAI'}, * } */ final class URLEndpointCreateParams implements BaseModel @@ -83,20 +85,23 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param list $origins + * @param Cloudinary|array{ + * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null + * }|Imgix|array{type: 'IMGIX'}|Akamai|array{type: 'AKAMAI'} $urlRewriter */ public static function with( string $description, ?array $origins = null, ?string $urlPrefix = null, - Cloudinary|Imgix|Akamai|null $urlRewriter = null, + Cloudinary|array|Imgix|Akamai|null $urlRewriter = null, ): self { $obj = new self; - $obj->description = $description; + $obj['description'] = $description; - null !== $origins && $obj->origins = $origins; - null !== $urlPrefix && $obj->urlPrefix = $urlPrefix; - null !== $urlRewriter && $obj->urlRewriter = $urlRewriter; + null !== $origins && $obj['origins'] = $origins; + null !== $urlPrefix && $obj['urlPrefix'] = $urlPrefix; + null !== $urlRewriter && $obj['urlRewriter'] = $urlRewriter; return $obj; } @@ -107,7 +112,7 @@ public static function with( public function withDescription(string $description): self { $obj = clone $this; - $obj->description = $description; + $obj['description'] = $description; return $obj; } @@ -120,7 +125,7 @@ public function withDescription(string $description): self public function withOrigins(array $origins): self { $obj = clone $this; - $obj->origins = $origins; + $obj['origins'] = $origins; return $obj; } @@ -131,18 +136,23 @@ public function withOrigins(array $origins): self public function withURLPrefix(string $urlPrefix): self { $obj = clone $this; - $obj->urlPrefix = $urlPrefix; + $obj['urlPrefix'] = $urlPrefix; return $obj; } /** * Configuration for third-party URL rewriting. + * + * @param Cloudinary|array{ + * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null + * }|Imgix|array{type: 'IMGIX'}|Akamai|array{type: 'AKAMAI'} $urlRewriter */ - public function withURLRewriter(Cloudinary|Imgix|Akamai $urlRewriter): self - { + public function withURLRewriter( + Cloudinary|array|Imgix|Akamai $urlRewriter + ): self { $obj = clone $this; - $obj->urlRewriter = $urlRewriter; + $obj['urlRewriter'] = $urlRewriter; return $obj; } diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php index 309a97f8..05d46382 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php @@ -42,7 +42,7 @@ public static function with(?bool $preserveAssetDeliveryTypes = null): self { $obj = new self; - null !== $preserveAssetDeliveryTypes && $obj->preserveAssetDeliveryTypes = $preserveAssetDeliveryTypes; + null !== $preserveAssetDeliveryTypes && $obj['preserveAssetDeliveryTypes'] = $preserveAssetDeliveryTypes; return $obj; } @@ -54,7 +54,7 @@ public function withPreserveAssetDeliveryTypes( bool $preserveAssetDeliveryTypes ): self { $obj = clone $this; - $obj->preserveAssetDeliveryTypes = $preserveAssetDeliveryTypes; + $obj['preserveAssetDeliveryTypes'] = $preserveAssetDeliveryTypes; return $obj; } diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest.php b/src/Accounts/URLEndpoints/URLEndpointRequest.php index 0cf5f5bf..9a22913c 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest.php @@ -78,20 +78,23 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param list $origins + * @param Cloudinary|array{ + * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null + * }|Imgix|array{type: 'IMGIX'}|Akamai|array{type: 'AKAMAI'} $urlRewriter */ public static function with( string $description, ?array $origins = null, ?string $urlPrefix = null, - Cloudinary|Imgix|Akamai|null $urlRewriter = null, + Cloudinary|array|Imgix|Akamai|null $urlRewriter = null, ): self { $obj = new self; - $obj->description = $description; + $obj['description'] = $description; - null !== $origins && $obj->origins = $origins; - null !== $urlPrefix && $obj->urlPrefix = $urlPrefix; - null !== $urlRewriter && $obj->urlRewriter = $urlRewriter; + null !== $origins && $obj['origins'] = $origins; + null !== $urlPrefix && $obj['urlPrefix'] = $urlPrefix; + null !== $urlRewriter && $obj['urlRewriter'] = $urlRewriter; return $obj; } @@ -102,7 +105,7 @@ public static function with( public function withDescription(string $description): self { $obj = clone $this; - $obj->description = $description; + $obj['description'] = $description; return $obj; } @@ -115,7 +118,7 @@ public function withDescription(string $description): self public function withOrigins(array $origins): self { $obj = clone $this; - $obj->origins = $origins; + $obj['origins'] = $origins; return $obj; } @@ -126,18 +129,23 @@ public function withOrigins(array $origins): self public function withURLPrefix(string $urlPrefix): self { $obj = clone $this; - $obj->urlPrefix = $urlPrefix; + $obj['urlPrefix'] = $urlPrefix; return $obj; } /** * Configuration for third-party URL rewriting. + * + * @param Cloudinary|array{ + * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null + * }|Imgix|array{type: 'IMGIX'}|Akamai|array{type: 'AKAMAI'} $urlRewriter */ - public function withURLRewriter(Cloudinary|Imgix|Akamai $urlRewriter): self - { + public function withURLRewriter( + Cloudinary|array|Imgix|Akamai $urlRewriter + ): self { $obj = clone $this; - $obj->urlRewriter = $urlRewriter; + $obj['urlRewriter'] = $urlRewriter; return $obj; } diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php index b2640680..e6bd935d 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php @@ -42,7 +42,7 @@ public static function with(?bool $preserveAssetDeliveryTypes = null): self { $obj = new self; - null !== $preserveAssetDeliveryTypes && $obj->preserveAssetDeliveryTypes = $preserveAssetDeliveryTypes; + null !== $preserveAssetDeliveryTypes && $obj['preserveAssetDeliveryTypes'] = $preserveAssetDeliveryTypes; return $obj; } @@ -54,7 +54,7 @@ public function withPreserveAssetDeliveryTypes( bool $preserveAssetDeliveryTypes ): self { $obj = clone $this; - $obj->preserveAssetDeliveryTypes = $preserveAssetDeliveryTypes; + $obj['preserveAssetDeliveryTypes'] = $preserveAssetDeliveryTypes; return $obj; } diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse.php b/src/Accounts/URLEndpoints/URLEndpointResponse.php index f73efefb..afa47fc0 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse.php @@ -95,22 +95,25 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param list $origins + * @param Cloudinary|array{ + * preserveAssetDeliveryTypes: bool, type: 'CLOUDINARY' + * }|Imgix|array{type: 'IMGIX'}|Akamai|array{type: 'AKAMAI'} $urlRewriter */ public static function with( string $id, string $description, array $origins = [], string $urlPrefix = '', - Cloudinary|Imgix|Akamai|null $urlRewriter = null, + Cloudinary|array|Imgix|Akamai|null $urlRewriter = null, ): self { $obj = new self; - $obj->id = $id; - $obj->description = $description; - $obj->origins = $origins; - $obj->urlPrefix = $urlPrefix; + $obj['id'] = $id; + $obj['description'] = $description; + $obj['origins'] = $origins; + $obj['urlPrefix'] = $urlPrefix; - null !== $urlRewriter && $obj->urlRewriter = $urlRewriter; + null !== $urlRewriter && $obj['urlRewriter'] = $urlRewriter; return $obj; } @@ -121,7 +124,7 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -132,7 +135,7 @@ public function withID(string $id): self public function withDescription(string $description): self { $obj = clone $this; - $obj->description = $description; + $obj['description'] = $description; return $obj; } @@ -145,7 +148,7 @@ public function withDescription(string $description): self public function withOrigins(array $origins): self { $obj = clone $this; - $obj->origins = $origins; + $obj['origins'] = $origins; return $obj; } @@ -156,18 +159,23 @@ public function withOrigins(array $origins): self public function withURLPrefix(string $urlPrefix): self { $obj = clone $this; - $obj->urlPrefix = $urlPrefix; + $obj['urlPrefix'] = $urlPrefix; return $obj; } /** * Configuration for third-party URL rewriting. + * + * @param Cloudinary|array{ + * preserveAssetDeliveryTypes: bool, type: 'CLOUDINARY' + * }|Imgix|array{type: 'IMGIX'}|Akamai|array{type: 'AKAMAI'} $urlRewriter */ - public function withURLRewriter(Cloudinary|Imgix|Akamai $urlRewriter): self - { + public function withURLRewriter( + Cloudinary|array|Imgix|Akamai $urlRewriter + ): self { $obj = clone $this; - $obj->urlRewriter = $urlRewriter; + $obj['urlRewriter'] = $urlRewriter; return $obj; } diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php index be5ca4db..94a53044 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php @@ -56,7 +56,7 @@ public static function with(bool $preserveAssetDeliveryTypes = false): self { $obj = new self; - $obj->preserveAssetDeliveryTypes = $preserveAssetDeliveryTypes; + $obj['preserveAssetDeliveryTypes'] = $preserveAssetDeliveryTypes; return $obj; } @@ -68,7 +68,7 @@ public function withPreserveAssetDeliveryTypes( bool $preserveAssetDeliveryTypes ): self { $obj = clone $this; - $obj->preserveAssetDeliveryTypes = $preserveAssetDeliveryTypes; + $obj['preserveAssetDeliveryTypes'] = $preserveAssetDeliveryTypes; return $obj; } diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php index 7488c4c1..2ad34c9d 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php @@ -23,7 +23,9 @@ * description: string, * origins?: list, * urlPrefix?: string, - * urlRewriter?: Cloudinary|Imgix|Akamai, + * urlRewriter?: Cloudinary|array{ + * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null + * }|Imgix|array{type: 'IMGIX'}|Akamai|array{type: 'AKAMAI'}, * } */ final class URLEndpointUpdateParams implements BaseModel @@ -83,20 +85,23 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param list $origins + * @param Cloudinary|array{ + * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null + * }|Imgix|array{type: 'IMGIX'}|Akamai|array{type: 'AKAMAI'} $urlRewriter */ public static function with( string $description, ?array $origins = null, ?string $urlPrefix = null, - Cloudinary|Imgix|Akamai|null $urlRewriter = null, + Cloudinary|array|Imgix|Akamai|null $urlRewriter = null, ): self { $obj = new self; - $obj->description = $description; + $obj['description'] = $description; - null !== $origins && $obj->origins = $origins; - null !== $urlPrefix && $obj->urlPrefix = $urlPrefix; - null !== $urlRewriter && $obj->urlRewriter = $urlRewriter; + null !== $origins && $obj['origins'] = $origins; + null !== $urlPrefix && $obj['urlPrefix'] = $urlPrefix; + null !== $urlRewriter && $obj['urlRewriter'] = $urlRewriter; return $obj; } @@ -107,7 +112,7 @@ public static function with( public function withDescription(string $description): self { $obj = clone $this; - $obj->description = $description; + $obj['description'] = $description; return $obj; } @@ -120,7 +125,7 @@ public function withDescription(string $description): self public function withOrigins(array $origins): self { $obj = clone $this; - $obj->origins = $origins; + $obj['origins'] = $origins; return $obj; } @@ -131,18 +136,23 @@ public function withOrigins(array $origins): self public function withURLPrefix(string $urlPrefix): self { $obj = clone $this; - $obj->urlPrefix = $urlPrefix; + $obj['urlPrefix'] = $urlPrefix; return $obj; } /** * Configuration for third-party URL rewriting. + * + * @param Cloudinary|array{ + * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null + * }|Imgix|array{type: 'IMGIX'}|Akamai|array{type: 'AKAMAI'} $urlRewriter */ - public function withURLRewriter(Cloudinary|Imgix|Akamai $urlRewriter): self - { + public function withURLRewriter( + Cloudinary|array|Imgix|Akamai $urlRewriter + ): self { $obj = clone $this; - $obj->urlRewriter = $urlRewriter; + $obj['urlRewriter'] = $urlRewriter; return $obj; } diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php index 24c8107c..2c551c92 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php @@ -42,7 +42,7 @@ public static function with(?bool $preserveAssetDeliveryTypes = null): self { $obj = new self; - null !== $preserveAssetDeliveryTypes && $obj->preserveAssetDeliveryTypes = $preserveAssetDeliveryTypes; + null !== $preserveAssetDeliveryTypes && $obj['preserveAssetDeliveryTypes'] = $preserveAssetDeliveryTypes; return $obj; } @@ -54,7 +54,7 @@ public function withPreserveAssetDeliveryTypes( bool $preserveAssetDeliveryTypes ): self { $obj = clone $this; - $obj->preserveAssetDeliveryTypes = $preserveAssetDeliveryTypes; + $obj['preserveAssetDeliveryTypes'] = $preserveAssetDeliveryTypes; return $obj; } diff --git a/src/Accounts/Usage/UsageGetParams.php b/src/Accounts/Usage/UsageGetParams.php index 4635ffab..7122f556 100644 --- a/src/Accounts/Usage/UsageGetParams.php +++ b/src/Accounts/Usage/UsageGetParams.php @@ -66,8 +66,8 @@ public static function with( ): self { $obj = new self; - $obj->endDate = $endDate; - $obj->startDate = $startDate; + $obj['endDate'] = $endDate; + $obj['startDate'] = $startDate; return $obj; } @@ -78,7 +78,7 @@ public static function with( public function withEndDate(\DateTimeInterface $endDate): self { $obj = clone $this; - $obj->endDate = $endDate; + $obj['endDate'] = $endDate; return $obj; } @@ -89,7 +89,7 @@ public function withEndDate(\DateTimeInterface $endDate): self public function withStartDate(\DateTimeInterface $startDate): self { $obj = clone $this; - $obj->startDate = $startDate; + $obj['startDate'] = $startDate; return $obj; } diff --git a/src/Accounts/Usage/UsageGetResponse.php b/src/Accounts/Usage/UsageGetResponse.php index 628abccb..69bc2390 100644 --- a/src/Accounts/Usage/UsageGetResponse.php +++ b/src/Accounts/Usage/UsageGetResponse.php @@ -75,11 +75,11 @@ public static function with( ): self { $obj = new self; - null !== $bandwidthBytes && $obj->bandwidthBytes = $bandwidthBytes; - null !== $extensionUnitsCount && $obj->extensionUnitsCount = $extensionUnitsCount; - null !== $mediaLibraryStorageBytes && $obj->mediaLibraryStorageBytes = $mediaLibraryStorageBytes; - null !== $originalCacheStorageBytes && $obj->originalCacheStorageBytes = $originalCacheStorageBytes; - null !== $videoProcessingUnitsCount && $obj->videoProcessingUnitsCount = $videoProcessingUnitsCount; + null !== $bandwidthBytes && $obj['bandwidthBytes'] = $bandwidthBytes; + null !== $extensionUnitsCount && $obj['extensionUnitsCount'] = $extensionUnitsCount; + null !== $mediaLibraryStorageBytes && $obj['mediaLibraryStorageBytes'] = $mediaLibraryStorageBytes; + null !== $originalCacheStorageBytes && $obj['originalCacheStorageBytes'] = $originalCacheStorageBytes; + null !== $videoProcessingUnitsCount && $obj['videoProcessingUnitsCount'] = $videoProcessingUnitsCount; return $obj; } @@ -90,7 +90,7 @@ public static function with( public function withBandwidthBytes(int $bandwidthBytes): self { $obj = clone $this; - $obj->bandwidthBytes = $bandwidthBytes; + $obj['bandwidthBytes'] = $bandwidthBytes; return $obj; } @@ -101,7 +101,7 @@ public function withBandwidthBytes(int $bandwidthBytes): self public function withExtensionUnitsCount(int $extensionUnitsCount): self { $obj = clone $this; - $obj->extensionUnitsCount = $extensionUnitsCount; + $obj['extensionUnitsCount'] = $extensionUnitsCount; return $obj; } @@ -113,7 +113,7 @@ public function withMediaLibraryStorageBytes( int $mediaLibraryStorageBytes ): self { $obj = clone $this; - $obj->mediaLibraryStorageBytes = $mediaLibraryStorageBytes; + $obj['mediaLibraryStorageBytes'] = $mediaLibraryStorageBytes; return $obj; } @@ -125,7 +125,7 @@ public function withOriginalCacheStorageBytes( int $originalCacheStorageBytes ): self { $obj = clone $this; - $obj->originalCacheStorageBytes = $originalCacheStorageBytes; + $obj['originalCacheStorageBytes'] = $originalCacheStorageBytes; return $obj; } @@ -137,7 +137,7 @@ public function withVideoProcessingUnitsCount( int $videoProcessingUnitsCount ): self { $obj = clone $this; - $obj->videoProcessingUnitsCount = $videoProcessingUnitsCount; + $obj['videoProcessingUnitsCount'] = $videoProcessingUnitsCount; return $obj; } diff --git a/src/Assets/AssetListParams.php b/src/Assets/AssetListParams.php index 522abe42..459d52d8 100644 --- a/src/Assets/AssetListParams.php +++ b/src/Assets/AssetListParams.php @@ -127,10 +127,10 @@ public static function with( $obj = new self; null !== $fileType && $obj['fileType'] = $fileType; - null !== $limit && $obj->limit = $limit; - null !== $path && $obj->path = $path; - null !== $searchQuery && $obj->searchQuery = $searchQuery; - null !== $skip && $obj->skip = $skip; + null !== $limit && $obj['limit'] = $limit; + null !== $path && $obj['path'] = $path; + null !== $searchQuery && $obj['searchQuery'] = $searchQuery; + null !== $skip && $obj['skip'] = $skip; null !== $sort && $obj['sort'] = $sort; null !== $type && $obj['type'] = $type; @@ -160,7 +160,7 @@ public function withFileType(FileType|string $fileType): self public function withLimit(int $limit): self { $obj = clone $this; - $obj->limit = $limit; + $obj['limit'] = $limit; return $obj; } @@ -174,7 +174,7 @@ public function withLimit(int $limit): self public function withPath(string $path): self { $obj = clone $this; - $obj->path = $path; + $obj['path'] = $path; return $obj; } @@ -193,7 +193,7 @@ public function withPath(string $path): self public function withSearchQuery(string $searchQuery): self { $obj = clone $this; - $obj->searchQuery = $searchQuery; + $obj['searchQuery'] = $searchQuery; return $obj; } @@ -204,7 +204,7 @@ public function withSearchQuery(string $searchQuery): self public function withSkip(int $skip): self { $obj = clone $this; - $obj->skip = $skip; + $obj['skip'] = $skip; return $obj; } diff --git a/src/BaseOverlay.php b/src/BaseOverlay.php index 44dcfa05..fc7328e7 100644 --- a/src/BaseOverlay.php +++ b/src/BaseOverlay.php @@ -7,6 +7,7 @@ use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\OverlayPosition\Focus; /** * @phpstan-type BaseOverlayShape = array{ @@ -33,31 +34,52 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param OverlayPosition|array{ + * focus?: value-of|null, x?: float|string|null, y?: float|string|null + * } $position + * @param OverlayTiming|array{ + * duration?: float|string|null, + * end?: float|string|null, + * start?: float|string|null, + * } $timing */ public static function with( - ?OverlayPosition $position = null, - ?OverlayTiming $timing = null + OverlayPosition|array|null $position = null, + OverlayTiming|array|null $timing = null ): self { $obj = new self; - null !== $position && $obj->position = $position; - null !== $timing && $obj->timing = $timing; + null !== $position && $obj['position'] = $position; + null !== $timing && $obj['timing'] = $timing; return $obj; } - public function withPosition(OverlayPosition $position): self + /** + * @param OverlayPosition|array{ + * focus?: value-of|null, x?: float|string|null, y?: float|string|null + * } $position + */ + public function withPosition(OverlayPosition|array $position): self { $obj = clone $this; - $obj->position = $position; + $obj['position'] = $position; return $obj; } - public function withTiming(OverlayTiming $timing): self + /** + * @param OverlayTiming|array{ + * duration?: float|string|null, + * end?: float|string|null, + * start?: float|string|null, + * } $timing + */ + public function withTiming(OverlayTiming|array $timing): self { $obj = clone $this; - $obj->timing = $timing; + $obj['timing'] = $timing; return $obj; } diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index 4fa9f145..6e8b6415 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -6,6 +6,9 @@ use ImageKit\Beta\V2\Files\FileUploadParams\ResponseField; use ImageKit\Beta\V2\Files\FileUploadParams\Transformation; +use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs; +use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\GifToVideo; +use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Thumbnail; use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Concerns\SdkParams; @@ -13,7 +16,9 @@ use ImageKit\ExtensionItem; use ImageKit\ExtensionItem\AIAutoDescription; use ImageKit\ExtensionItem\AutoTaggingExtension; +use ImageKit\ExtensionItem\AutoTaggingExtension\Name; use ImageKit\ExtensionItem\RemoveBg; +use ImageKit\ExtensionItem\RemoveBg\Options; /** * The V2 API enhances security by verifying the entire payload using JWT. This API is in beta. @@ -41,7 +46,11 @@ * customCoordinates?: string, * customMetadata?: array, * description?: string, - * extensions?: list, + * extensions?: list + * }|AIAutoDescription|array{name: 'ai-auto-description'}>, * folder?: string, * isPrivateFile?: bool, * isPublished?: bool, @@ -51,7 +60,10 @@ * overwriteTags?: bool, * responseFields?: list>, * tags?: list, - * transformation?: Transformation, + * transformation?: Transformation|array{ + * post?: list<\ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Transformation|GifToVideo|Thumbnail|Abs>|null, + * pre?: string|null, + * }, * useUniqueFileName?: bool, * webhookUrl?: string, * } @@ -251,9 +263,17 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param array $customMetadata - * @param list $extensions + * @param list + * }|AIAutoDescription|array{name: 'ai-auto-description'}> $extensions * @param list> $responseFields * @param list $tags + * @param Transformation|array{ + * post?: list|null, + * pre?: string|null, + * } $transformation */ public static function with( string $file, @@ -273,33 +293,33 @@ public static function with( ?bool $overwriteTags = null, ?array $responseFields = null, ?array $tags = null, - ?Transformation $transformation = null, + Transformation|array|null $transformation = null, ?bool $useUniqueFileName = null, ?string $webhookUrl = null, ): self { $obj = new self; - $obj->file = $file; - $obj->fileName = $fileName; - - null !== $token && $obj->token = $token; - null !== $checks && $obj->checks = $checks; - null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; - null !== $customMetadata && $obj->customMetadata = $customMetadata; - null !== $description && $obj->description = $description; - null !== $extensions && $obj->extensions = $extensions; - null !== $folder && $obj->folder = $folder; - null !== $isPrivateFile && $obj->isPrivateFile = $isPrivateFile; - null !== $isPublished && $obj->isPublished = $isPublished; - null !== $overwriteAITags && $obj->overwriteAITags = $overwriteAITags; - null !== $overwriteCustomMetadata && $obj->overwriteCustomMetadata = $overwriteCustomMetadata; - null !== $overwriteFile && $obj->overwriteFile = $overwriteFile; - null !== $overwriteTags && $obj->overwriteTags = $overwriteTags; + $obj['file'] = $file; + $obj['fileName'] = $fileName; + + null !== $token && $obj['token'] = $token; + null !== $checks && $obj['checks'] = $checks; + null !== $customCoordinates && $obj['customCoordinates'] = $customCoordinates; + null !== $customMetadata && $obj['customMetadata'] = $customMetadata; + null !== $description && $obj['description'] = $description; + null !== $extensions && $obj['extensions'] = $extensions; + null !== $folder && $obj['folder'] = $folder; + null !== $isPrivateFile && $obj['isPrivateFile'] = $isPrivateFile; + null !== $isPublished && $obj['isPublished'] = $isPublished; + null !== $overwriteAITags && $obj['overwriteAITags'] = $overwriteAITags; + null !== $overwriteCustomMetadata && $obj['overwriteCustomMetadata'] = $overwriteCustomMetadata; + null !== $overwriteFile && $obj['overwriteFile'] = $overwriteFile; + null !== $overwriteTags && $obj['overwriteTags'] = $overwriteTags; null !== $responseFields && $obj['responseFields'] = $responseFields; - null !== $tags && $obj->tags = $tags; - null !== $transformation && $obj->transformation = $transformation; - null !== $useUniqueFileName && $obj->useUniqueFileName = $useUniqueFileName; - null !== $webhookUrl && $obj->webhookUrl = $webhookUrl; + null !== $tags && $obj['tags'] = $tags; + null !== $transformation && $obj['transformation'] = $transformation; + null !== $useUniqueFileName && $obj['useUniqueFileName'] = $useUniqueFileName; + null !== $webhookUrl && $obj['webhookUrl'] = $webhookUrl; return $obj; } @@ -316,7 +336,7 @@ public static function with( public function withFile(string $file): self { $obj = clone $this; - $obj->file = $file; + $obj['file'] = $file; return $obj; } @@ -327,7 +347,7 @@ public function withFile(string $file): self public function withFileName(string $fileName): self { $obj = clone $this; - $obj->fileName = $fileName; + $obj['fileName'] = $fileName; return $obj; } @@ -343,7 +363,7 @@ public function withFileName(string $fileName): self public function withToken(string $token): self { $obj = clone $this; - $obj->token = $token; + $obj['token'] = $token; return $obj; } @@ -355,7 +375,7 @@ public function withToken(string $token): self public function withChecks(string $checks): self { $obj = clone $this; - $obj->checks = $checks; + $obj['checks'] = $checks; return $obj; } @@ -370,7 +390,7 @@ public function withChecks(string $checks): self public function withCustomCoordinates(string $customCoordinates): self { $obj = clone $this; - $obj->customCoordinates = $customCoordinates; + $obj['customCoordinates'] = $customCoordinates; return $obj; } @@ -383,7 +403,7 @@ public function withCustomCoordinates(string $customCoordinates): self public function withCustomMetadata(array $customMetadata): self { $obj = clone $this; - $obj->customMetadata = $customMetadata; + $obj['customMetadata'] = $customMetadata; return $obj; } @@ -394,7 +414,7 @@ public function withCustomMetadata(array $customMetadata): self public function withDescription(string $description): self { $obj = clone $this; - $obj->description = $description; + $obj['description'] = $description; return $obj; } @@ -402,12 +422,16 @@ public function withDescription(string $description): self /** * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * - * @param list $extensions + * @param list + * }|AIAutoDescription|array{name: 'ai-auto-description'}> $extensions */ public function withExtensions(array $extensions): self { $obj = clone $this; - $obj->extensions = $extensions; + $obj['extensions'] = $extensions; return $obj; } @@ -418,7 +442,7 @@ public function withExtensions(array $extensions): self public function withFolder(string $folder): self { $obj = clone $this; - $obj->folder = $folder; + $obj['folder'] = $folder; return $obj; } @@ -431,7 +455,7 @@ public function withFolder(string $folder): self public function withIsPrivateFile(bool $isPrivateFile): self { $obj = clone $this; - $obj->isPrivateFile = $isPrivateFile; + $obj['isPrivateFile'] = $isPrivateFile; return $obj; } @@ -446,7 +470,7 @@ public function withIsPrivateFile(bool $isPrivateFile): self public function withIsPublished(bool $isPublished): self { $obj = clone $this; - $obj->isPublished = $isPublished; + $obj['isPublished'] = $isPublished; return $obj; } @@ -457,7 +481,7 @@ public function withIsPublished(bool $isPublished): self public function withOverwriteAITags(bool $overwriteAITags): self { $obj = clone $this; - $obj->overwriteAITags = $overwriteAITags; + $obj['overwriteAITags'] = $overwriteAITags; return $obj; } @@ -469,7 +493,7 @@ public function withOverwriteCustomMetadata( bool $overwriteCustomMetadata ): self { $obj = clone $this; - $obj->overwriteCustomMetadata = $overwriteCustomMetadata; + $obj['overwriteCustomMetadata'] = $overwriteCustomMetadata; return $obj; } @@ -480,7 +504,7 @@ public function withOverwriteCustomMetadata( public function withOverwriteFile(bool $overwriteFile): self { $obj = clone $this; - $obj->overwriteFile = $overwriteFile; + $obj['overwriteFile'] = $overwriteFile; return $obj; } @@ -491,7 +515,7 @@ public function withOverwriteFile(bool $overwriteFile): self public function withOverwriteTags(bool $overwriteTags): self { $obj = clone $this; - $obj->overwriteTags = $overwriteTags; + $obj['overwriteTags'] = $overwriteTags; return $obj; } @@ -519,7 +543,7 @@ public function withResponseFields(array $responseFields): self public function withTags(array $tags): self { $obj = clone $this; - $obj->tags = $tags; + $obj['tags'] = $tags; return $obj; } @@ -534,11 +558,17 @@ public function withTags(array $tags): self * Ideal for generating transformed versions (like video encodes or thumbnails) in advance, so they're ready for delivery without delay. * * You can mix and match any combination of post-processing types. + * + * @param Transformation|array{ + * post?: list|null, + * pre?: string|null, + * } $transformation */ - public function withTransformation(Transformation $transformation): self - { + public function withTransformation( + Transformation|array $transformation + ): self { $obj = clone $this; - $obj->transformation = $transformation; + $obj['transformation'] = $transformation; return $obj; } @@ -553,7 +583,7 @@ public function withTransformation(Transformation $transformation): self public function withUseUniqueFileName(bool $useUniqueFileName): self { $obj = clone $this; - $obj->useUniqueFileName = $useUniqueFileName; + $obj['useUniqueFileName'] = $useUniqueFileName; return $obj; } @@ -564,7 +594,7 @@ public function withUseUniqueFileName(bool $useUniqueFileName): self public function withWebhookURL(string $webhookURL): self { $obj = clone $this; - $obj->webhookUrl = $webhookURL; + $obj['webhookUrl'] = $webhookURL; return $obj; } diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation.php index 5075d5ec..e44f14de 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation.php @@ -6,6 +6,7 @@ use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post; use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs; +use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs\Protocol; use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\GifToVideo; use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Thumbnail; use ImageKit\Core\Attributes\Api; @@ -59,14 +60,18 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $post + * @param list, type: 'abs', value: string}> $post */ public static function with(?array $post = null, ?string $pre = null): self { $obj = new self; - null !== $post && $obj->post = $post; - null !== $pre && $obj->pre = $pre; + null !== $post && $obj['post'] = $post; + null !== $pre && $obj['pre'] = $pre; return $obj; } @@ -76,12 +81,16 @@ public static function with(?array $post = null, ?string $pre = null): self * Each item must match one of the following types: * `transformation`, `gif-to-video`, `thumbnail`, `abs`. * - * @param list $post + * @param list, type: 'abs', value: string}> $post */ public function withPost(array $post): self { $obj = clone $this; - $obj->post = $post; + $obj['post'] = $post; return $obj; } @@ -92,7 +101,7 @@ public function withPost(array $post): self public function withPre(string $pre): self { $obj = clone $this; - $obj->pre = $pre; + $obj['pre'] = $pre; return $obj; } diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php index 39f0e749..4c803805 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php @@ -72,7 +72,7 @@ public static function with(Protocol|string $protocol, string $value): self $obj = new self; $obj['protocol'] = $protocol; - $obj->value = $value; + $obj['value'] = $value; return $obj; } @@ -96,7 +96,7 @@ public function withProtocol(Protocol|string $protocol): self public function withValue(string $value): self { $obj = clone $this; - $obj->value = $value; + $obj['value'] = $value; return $obj; } diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php index 513f7375..9cbc8a9c 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php @@ -45,7 +45,7 @@ public static function with(?string $value = null): self { $obj = new self; - null !== $value && $obj->value = $value; + null !== $value && $obj['value'] = $value; return $obj; } @@ -57,7 +57,7 @@ public static function with(?string $value = null): self public function withValue(string $value): self { $obj = clone $this; - $obj->value = $value; + $obj['value'] = $value; return $obj; } diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php index e2939bd0..8ffbc1d2 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php @@ -45,7 +45,7 @@ public static function with(?string $value = null): self { $obj = new self; - null !== $value && $obj->value = $value; + null !== $value && $obj['value'] = $value; return $obj; } @@ -57,7 +57,7 @@ public static function with(?string $value = null): self public function withValue(string $value): self { $obj = clone $this; - $obj->value = $value; + $obj['value'] = $value; return $obj; } diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php index 72267248..7f547d69 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php @@ -59,7 +59,7 @@ public static function with(string $value): self { $obj = new self; - $obj->value = $value; + $obj['value'] = $value; return $obj; } @@ -71,7 +71,7 @@ public static function with(string $value): self public function withValue(string $value): self { $obj = clone $this; - $obj->value = $value; + $obj['value'] = $value; return $obj; } diff --git a/src/Beta/V2/Files/FileUploadResponse.php b/src/Beta/V2/Files/FileUploadResponse.php index 34f13599..a3edadeb 100644 --- a/src/Beta/V2/Files/FileUploadResponse.php +++ b/src/Beta/V2/Files/FileUploadResponse.php @@ -6,7 +6,12 @@ use ImageKit\Beta\V2\Files\FileUploadResponse\AITag; use ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; +use ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\AIAutoDescription; +use ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\AwsAutoTagging; +use ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\GoogleAutoTagging; +use ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\RemoveBg; use ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; +use ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\Type; use ImageKit\Beta\V2\Files\FileUploadResponse\VersionInfo; use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; @@ -14,6 +19,7 @@ use ImageKit\Core\Contracts\BaseModel; use ImageKit\Core\Conversion\Contracts\ResponseConverter; use ImageKit\Files\Metadata; +use ImageKit\Files\Metadata\Exif; /** * Object containing details of a successful upload. @@ -233,11 +239,47 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list|null $AITags + * @param list|null $AITags * @param array $customMetadata * @param array $embeddedMetadata - * @param array $selectedFieldsSchema + * @param ExtensionStatus|array{ + * ai_auto_description?: value-of|null, + * aws_auto_tagging?: value-of|null, + * google_auto_tagging?: value-of|null, + * remove_bg?: value-of|null, + * } $extensionStatus + * @param Metadata|array{ + * audioCodec?: string|null, + * bitRate?: int|null, + * density?: int|null, + * duration?: int|null, + * exif?: Exif|null, + * format?: string|null, + * hasColorProfile?: bool|null, + * hasTransparency?: bool|null, + * height?: int|null, + * pHash?: string|null, + * quality?: int|null, + * size?: int|null, + * videoCodec?: string|null, + * width?: int|null, + * } $metadata + * @param array, + * defaultValue?: string|float|bool|list|null, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * readOnly?: bool|null, + * selectOptions?: list|null, + * selectOptionsTruncated?: bool|null, + * }> $selectedFieldsSchema * @param list|null $tags + * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo */ public static function with( ?array $AITags = null, @@ -248,51 +290,51 @@ public static function with( ?string $description = null, ?int $duration = null, ?array $embeddedMetadata = null, - ?ExtensionStatus $extensionStatus = null, + ExtensionStatus|array|null $extensionStatus = null, ?string $fileId = null, ?string $filePath = null, ?string $fileType = null, ?float $height = null, ?bool $isPrivateFile = null, ?bool $isPublished = null, - ?Metadata $metadata = null, + Metadata|array|null $metadata = null, ?string $name = null, ?array $selectedFieldsSchema = null, ?float $size = null, ?array $tags = null, ?string $thumbnailUrl = null, ?string $url = null, - ?VersionInfo $versionInfo = null, + VersionInfo|array|null $versionInfo = null, ?string $videoCodec = null, ?float $width = null, ): self { $obj = new self; - null !== $AITags && $obj->AITags = $AITags; - null !== $audioCodec && $obj->audioCodec = $audioCodec; - null !== $bitRate && $obj->bitRate = $bitRate; - null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; - null !== $customMetadata && $obj->customMetadata = $customMetadata; - null !== $description && $obj->description = $description; - null !== $duration && $obj->duration = $duration; - null !== $embeddedMetadata && $obj->embeddedMetadata = $embeddedMetadata; - null !== $extensionStatus && $obj->extensionStatus = $extensionStatus; - null !== $fileId && $obj->fileId = $fileId; - null !== $filePath && $obj->filePath = $filePath; - null !== $fileType && $obj->fileType = $fileType; - null !== $height && $obj->height = $height; - null !== $isPrivateFile && $obj->isPrivateFile = $isPrivateFile; - null !== $isPublished && $obj->isPublished = $isPublished; - null !== $metadata && $obj->metadata = $metadata; - null !== $name && $obj->name = $name; - null !== $selectedFieldsSchema && $obj->selectedFieldsSchema = $selectedFieldsSchema; - null !== $size && $obj->size = $size; - null !== $tags && $obj->tags = $tags; - null !== $thumbnailUrl && $obj->thumbnailUrl = $thumbnailUrl; - null !== $url && $obj->url = $url; - null !== $versionInfo && $obj->versionInfo = $versionInfo; - null !== $videoCodec && $obj->videoCodec = $videoCodec; - null !== $width && $obj->width = $width; + null !== $AITags && $obj['AITags'] = $AITags; + null !== $audioCodec && $obj['audioCodec'] = $audioCodec; + null !== $bitRate && $obj['bitRate'] = $bitRate; + null !== $customCoordinates && $obj['customCoordinates'] = $customCoordinates; + null !== $customMetadata && $obj['customMetadata'] = $customMetadata; + null !== $description && $obj['description'] = $description; + null !== $duration && $obj['duration'] = $duration; + null !== $embeddedMetadata && $obj['embeddedMetadata'] = $embeddedMetadata; + null !== $extensionStatus && $obj['extensionStatus'] = $extensionStatus; + null !== $fileId && $obj['fileId'] = $fileId; + null !== $filePath && $obj['filePath'] = $filePath; + null !== $fileType && $obj['fileType'] = $fileType; + null !== $height && $obj['height'] = $height; + null !== $isPrivateFile && $obj['isPrivateFile'] = $isPrivateFile; + null !== $isPublished && $obj['isPublished'] = $isPublished; + null !== $metadata && $obj['metadata'] = $metadata; + null !== $name && $obj['name'] = $name; + null !== $selectedFieldsSchema && $obj['selectedFieldsSchema'] = $selectedFieldsSchema; + null !== $size && $obj['size'] = $size; + null !== $tags && $obj['tags'] = $tags; + null !== $thumbnailUrl && $obj['thumbnailUrl'] = $thumbnailUrl; + null !== $url && $obj['url'] = $url; + null !== $versionInfo && $obj['versionInfo'] = $versionInfo; + null !== $videoCodec && $obj['videoCodec'] = $videoCodec; + null !== $width && $obj['width'] = $width; return $obj; } @@ -300,12 +342,14 @@ public static function with( /** * An array of tags assigned to the uploaded file by auto tagging. * - * @param list|null $aiTags + * @param list|null $aiTags */ public function withAITags(?array $aiTags): self { $obj = clone $this; - $obj->AITags = $aiTags; + $obj['AITags'] = $aiTags; return $obj; } @@ -316,7 +360,7 @@ public function withAITags(?array $aiTags): self public function withAudioCodec(string $audioCodec): self { $obj = clone $this; - $obj->audioCodec = $audioCodec; + $obj['audioCodec'] = $audioCodec; return $obj; } @@ -327,7 +371,7 @@ public function withAudioCodec(string $audioCodec): self public function withBitRate(int $bitRate): self { $obj = clone $this; - $obj->bitRate = $bitRate; + $obj['bitRate'] = $bitRate; return $obj; } @@ -338,7 +382,7 @@ public function withBitRate(int $bitRate): self public function withCustomCoordinates(?string $customCoordinates): self { $obj = clone $this; - $obj->customCoordinates = $customCoordinates; + $obj['customCoordinates'] = $customCoordinates; return $obj; } @@ -351,7 +395,7 @@ public function withCustomCoordinates(?string $customCoordinates): self public function withCustomMetadata(array $customMetadata): self { $obj = clone $this; - $obj->customMetadata = $customMetadata; + $obj['customMetadata'] = $customMetadata; return $obj; } @@ -362,7 +406,7 @@ public function withCustomMetadata(array $customMetadata): self public function withDescription(string $description): self { $obj = clone $this; - $obj->description = $description; + $obj['description'] = $description; return $obj; } @@ -373,7 +417,7 @@ public function withDescription(string $description): self public function withDuration(int $duration): self { $obj = clone $this; - $obj->duration = $duration; + $obj['duration'] = $duration; return $obj; } @@ -386,7 +430,7 @@ public function withDuration(int $duration): self public function withEmbeddedMetadata(array $embeddedMetadata): self { $obj = clone $this; - $obj->embeddedMetadata = $embeddedMetadata; + $obj['embeddedMetadata'] = $embeddedMetadata; return $obj; } @@ -399,11 +443,19 @@ public function withEmbeddedMetadata(array $embeddedMetadata): self * `pending`: The extension will finish processing in some time. On completion, the final status (success / failed) will be sent to the `webhookUrl` provided. * * If no extension was requested, then this parameter is not returned. - */ - public function withExtensionStatus(ExtensionStatus $extensionStatus): self - { + * + * @param ExtensionStatus|array{ + * ai_auto_description?: value-of|null, + * aws_auto_tagging?: value-of|null, + * google_auto_tagging?: value-of|null, + * remove_bg?: value-of|null, + * } $extensionStatus + */ + public function withExtensionStatus( + ExtensionStatus|array $extensionStatus + ): self { $obj = clone $this; - $obj->extensionStatus = $extensionStatus; + $obj['extensionStatus'] = $extensionStatus; return $obj; } @@ -414,7 +466,7 @@ public function withExtensionStatus(ExtensionStatus $extensionStatus): self public function withFileID(string $fileID): self { $obj = clone $this; - $obj->fileId = $fileID; + $obj['fileId'] = $fileID; return $obj; } @@ -425,7 +477,7 @@ public function withFileID(string $fileID): self public function withFilePath(string $filePath): self { $obj = clone $this; - $obj->filePath = $filePath; + $obj['filePath'] = $filePath; return $obj; } @@ -436,7 +488,7 @@ public function withFilePath(string $filePath): self public function withFileType(string $fileType): self { $obj = clone $this; - $obj->fileType = $fileType; + $obj['fileType'] = $fileType; return $obj; } @@ -447,7 +499,7 @@ public function withFileType(string $fileType): self public function withHeight(float $height): self { $obj = clone $this; - $obj->height = $height; + $obj['height'] = $height; return $obj; } @@ -458,7 +510,7 @@ public function withHeight(float $height): self public function withIsPrivateFile(bool $isPrivateFile): self { $obj = clone $this; - $obj->isPrivateFile = $isPrivateFile; + $obj['isPrivateFile'] = $isPrivateFile; return $obj; } @@ -469,18 +521,35 @@ public function withIsPrivateFile(bool $isPrivateFile): self public function withIsPublished(bool $isPublished): self { $obj = clone $this; - $obj->isPublished = $isPublished; + $obj['isPublished'] = $isPublished; return $obj; } /** * Legacy metadata. Send `metadata` in `responseFields` in API request to get metadata in the upload API response. - */ - public function withMetadata(Metadata $metadata): self + * + * @param Metadata|array{ + * audioCodec?: string|null, + * bitRate?: int|null, + * density?: int|null, + * duration?: int|null, + * exif?: Exif|null, + * format?: string|null, + * hasColorProfile?: bool|null, + * hasTransparency?: bool|null, + * height?: int|null, + * pHash?: string|null, + * quality?: int|null, + * size?: int|null, + * videoCodec?: string|null, + * width?: int|null, + * } $metadata + */ + public function withMetadata(Metadata|array $metadata): self { $obj = clone $this; - $obj->metadata = $metadata; + $obj['metadata'] = $metadata; return $obj; } @@ -491,7 +560,7 @@ public function withMetadata(Metadata $metadata): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -503,12 +572,23 @@ public function withName(string $name): self * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @param array $selectedFieldsSchema + * @param array, + * defaultValue?: string|float|bool|list|null, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * readOnly?: bool|null, + * selectOptions?: list|null, + * selectOptionsTruncated?: bool|null, + * }> $selectedFieldsSchema */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { $obj = clone $this; - $obj->selectedFieldsSchema = $selectedFieldsSchema; + $obj['selectedFieldsSchema'] = $selectedFieldsSchema; return $obj; } @@ -519,7 +599,7 @@ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self public function withSize(float $size): self { $obj = clone $this; - $obj->size = $size; + $obj['size'] = $size; return $obj; } @@ -532,7 +612,7 @@ public function withSize(float $size): self public function withTags(?array $tags): self { $obj = clone $this; - $obj->tags = $tags; + $obj['tags'] = $tags; return $obj; } @@ -543,7 +623,7 @@ public function withTags(?array $tags): self public function withThumbnailURL(string $thumbnailURL): self { $obj = clone $this; - $obj->thumbnailUrl = $thumbnailURL; + $obj['thumbnailUrl'] = $thumbnailURL; return $obj; } @@ -554,18 +634,20 @@ public function withThumbnailURL(string $thumbnailURL): self public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } /** * An object containing the file or file version's `id` (versionId) and `name`. + * + * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo */ - public function withVersionInfo(VersionInfo $versionInfo): self + public function withVersionInfo(VersionInfo|array $versionInfo): self { $obj = clone $this; - $obj->versionInfo = $versionInfo; + $obj['versionInfo'] = $versionInfo; return $obj; } @@ -576,7 +658,7 @@ public function withVersionInfo(VersionInfo $versionInfo): self public function withVideoCodec(string $videoCodec): self { $obj = clone $this; - $obj->videoCodec = $videoCodec; + $obj['videoCodec'] = $videoCodec; return $obj; } @@ -587,7 +669,7 @@ public function withVideoCodec(string $videoCodec): self public function withWidth(float $width): self { $obj = clone $this; - $obj->width = $width; + $obj['width'] = $width; return $obj; } diff --git a/src/Beta/V2/Files/FileUploadResponse/AITag.php b/src/Beta/V2/Files/FileUploadResponse/AITag.php index 3a5eb82c..d5fd5f56 100644 --- a/src/Beta/V2/Files/FileUploadResponse/AITag.php +++ b/src/Beta/V2/Files/FileUploadResponse/AITag.php @@ -53,9 +53,9 @@ public static function with( ): self { $obj = new self; - null !== $confidence && $obj->confidence = $confidence; - null !== $name && $obj->name = $name; - null !== $source && $obj->source = $source; + null !== $confidence && $obj['confidence'] = $confidence; + null !== $name && $obj['name'] = $name; + null !== $source && $obj['source'] = $source; return $obj; } @@ -66,7 +66,7 @@ public static function with( public function withConfidence(float $confidence): self { $obj = clone $this; - $obj->confidence = $confidence; + $obj['confidence'] = $confidence; return $obj; } @@ -77,7 +77,7 @@ public function withConfidence(float $confidence): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -88,7 +88,7 @@ public function withName(string $name): self public function withSource(string $source): self { $obj = clone $this; - $obj->source = $source; + $obj['source'] = $source; return $obj; } diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php index ab7b564f..0b2216d7 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php @@ -140,15 +140,15 @@ public static function with( $obj['type'] = $type; - null !== $defaultValue && $obj->defaultValue = $defaultValue; - null !== $isValueRequired && $obj->isValueRequired = $isValueRequired; - null !== $maxLength && $obj->maxLength = $maxLength; - null !== $maxValue && $obj->maxValue = $maxValue; - null !== $minLength && $obj->minLength = $minLength; - null !== $minValue && $obj->minValue = $minValue; - null !== $readOnly && $obj->readOnly = $readOnly; - null !== $selectOptions && $obj->selectOptions = $selectOptions; - null !== $selectOptionsTruncated && $obj->selectOptionsTruncated = $selectOptionsTruncated; + null !== $defaultValue && $obj['defaultValue'] = $defaultValue; + null !== $isValueRequired && $obj['isValueRequired'] = $isValueRequired; + null !== $maxLength && $obj['maxLength'] = $maxLength; + null !== $maxValue && $obj['maxValue'] = $maxValue; + null !== $minLength && $obj['minLength'] = $minLength; + null !== $minValue && $obj['minValue'] = $minValue; + null !== $readOnly && $obj['readOnly'] = $readOnly; + null !== $selectOptions && $obj['selectOptions'] = $selectOptions; + null !== $selectOptionsTruncated && $obj['selectOptionsTruncated'] = $selectOptionsTruncated; return $obj; } @@ -175,7 +175,7 @@ public function withDefaultValue( string|float|bool|array $defaultValue ): self { $obj = clone $this; - $obj->defaultValue = $defaultValue; + $obj['defaultValue'] = $defaultValue; return $obj; } @@ -186,7 +186,7 @@ public function withDefaultValue( public function withIsValueRequired(bool $isValueRequired): self { $obj = clone $this; - $obj->isValueRequired = $isValueRequired; + $obj['isValueRequired'] = $isValueRequired; return $obj; } @@ -197,7 +197,7 @@ public function withIsValueRequired(bool $isValueRequired): self public function withMaxLength(float $maxLength): self { $obj = clone $this; - $obj->maxLength = $maxLength; + $obj['maxLength'] = $maxLength; return $obj; } @@ -208,7 +208,7 @@ public function withMaxLength(float $maxLength): self public function withMaxValue(string|float $maxValue): self { $obj = clone $this; - $obj->maxValue = $maxValue; + $obj['maxValue'] = $maxValue; return $obj; } @@ -219,7 +219,7 @@ public function withMaxValue(string|float $maxValue): self public function withMinLength(float $minLength): self { $obj = clone $this; - $obj->minLength = $minLength; + $obj['minLength'] = $minLength; return $obj; } @@ -230,7 +230,7 @@ public function withMinLength(float $minLength): self public function withMinValue(string|float $minValue): self { $obj = clone $this; - $obj->minValue = $minValue; + $obj['minValue'] = $minValue; return $obj; } @@ -241,7 +241,7 @@ public function withMinValue(string|float $minValue): self public function withReadOnly(bool $readOnly): self { $obj = clone $this; - $obj->readOnly = $readOnly; + $obj['readOnly'] = $readOnly; return $obj; } @@ -254,7 +254,7 @@ public function withReadOnly(bool $readOnly): self public function withSelectOptions(array $selectOptions): self { $obj = clone $this; - $obj->selectOptions = $selectOptions; + $obj['selectOptions'] = $selectOptions; return $obj; } @@ -266,7 +266,7 @@ public function withSelectOptionsTruncated( bool $selectOptionsTruncated ): self { $obj = clone $this; - $obj->selectOptionsTruncated = $selectOptionsTruncated; + $obj['selectOptionsTruncated'] = $selectOptionsTruncated; return $obj; } diff --git a/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php b/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php index 168e2587..e88cb571 100644 --- a/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php +++ b/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php @@ -44,8 +44,8 @@ public static function with(?string $id = null, ?string $name = null): self { $obj = new self; - null !== $id && $obj->id = $id; - null !== $name && $obj->name = $name; + null !== $id && $obj['id'] = $id; + null !== $name && $obj['name'] = $name; return $obj; } @@ -56,7 +56,7 @@ public static function with(?string $id = null, ?string $name = null): self public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -67,7 +67,7 @@ public function withID(string $id): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } diff --git a/src/Cache/Invalidation/InvalidationCreateParams.php b/src/Cache/Invalidation/InvalidationCreateParams.php index 3c1d5701..48864392 100644 --- a/src/Cache/Invalidation/InvalidationCreateParams.php +++ b/src/Cache/Invalidation/InvalidationCreateParams.php @@ -56,7 +56,7 @@ public static function with(string $url): self { $obj = new self; - $obj->url = $url; + $obj['url'] = $url; return $obj; } @@ -67,7 +67,7 @@ public static function with(string $url): self public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } diff --git a/src/Cache/Invalidation/InvalidationNewResponse.php b/src/Cache/Invalidation/InvalidationNewResponse.php index 909d870b..e79fc053 100644 --- a/src/Cache/Invalidation/InvalidationNewResponse.php +++ b/src/Cache/Invalidation/InvalidationNewResponse.php @@ -40,7 +40,7 @@ public static function with(?string $requestId = null): self { $obj = new self; - null !== $requestId && $obj->requestId = $requestId; + null !== $requestId && $obj['requestId'] = $requestId; return $obj; } @@ -51,7 +51,7 @@ public static function with(?string $requestId = null): self public function withRequestID(string $requestID): self { $obj = clone $this; - $obj->requestId = $requestID; + $obj['requestId'] = $requestID; return $obj; } diff --git a/src/CustomMetadataFields/CustomMetadataField.php b/src/CustomMetadataFields/CustomMetadataField.php index c8dde28e..e5d7e868 100644 --- a/src/CustomMetadataFields/CustomMetadataField.php +++ b/src/CustomMetadataFields/CustomMetadataField.php @@ -10,6 +10,7 @@ use ImageKit\Core\Contracts\BaseModel; use ImageKit\Core\Conversion\Contracts\ResponseConverter; use ImageKit\CustomMetadataFields\CustomMetadataField\Schema; +use ImageKit\CustomMetadataFields\CustomMetadataField\Schema\Type; /** * Object containing details of a custom metadata field. @@ -76,19 +77,30 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Schema|array{ + * type: value-of, + * defaultValue?: string|float|bool|list|null, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * selectOptions?: list|null, + * } $schema */ public static function with( string $id, string $label, string $name, - Schema $schema + Schema|array $schema ): self { $obj = new self; - $obj->id = $id; - $obj->label = $label; - $obj->name = $name; - $obj->schema = $schema; + $obj['id'] = $id; + $obj['label'] = $label; + $obj['name'] = $name; + $obj['schema'] = $schema; return $obj; } @@ -99,7 +111,7 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -110,7 +122,7 @@ public function withID(string $id): self public function withLabel(string $label): self { $obj = clone $this; - $obj->label = $label; + $obj['label'] = $label; return $obj; } @@ -121,18 +133,29 @@ public function withLabel(string $label): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } /** * An object that describes the rules for the custom metadata field value. + * + * @param Schema|array{ + * type: value-of, + * defaultValue?: string|float|bool|list|null, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * selectOptions?: list|null, + * } $schema */ - public function withSchema(Schema $schema): self + public function withSchema(Schema|array $schema): self { $obj = clone $this; - $obj->schema = $schema; + $obj['schema'] = $schema; return $obj; } diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema.php b/src/CustomMetadataFields/CustomMetadataField/Schema.php index 81bf0df3..d5604036 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema.php @@ -126,13 +126,13 @@ public static function with( $obj['type'] = $type; - null !== $defaultValue && $obj->defaultValue = $defaultValue; - null !== $isValueRequired && $obj->isValueRequired = $isValueRequired; - null !== $maxLength && $obj->maxLength = $maxLength; - null !== $maxValue && $obj->maxValue = $maxValue; - null !== $minLength && $obj->minLength = $minLength; - null !== $minValue && $obj->minValue = $minValue; - null !== $selectOptions && $obj->selectOptions = $selectOptions; + null !== $defaultValue && $obj['defaultValue'] = $defaultValue; + null !== $isValueRequired && $obj['isValueRequired'] = $isValueRequired; + null !== $maxLength && $obj['maxLength'] = $maxLength; + null !== $maxValue && $obj['maxValue'] = $maxValue; + null !== $minLength && $obj['minLength'] = $minLength; + null !== $minValue && $obj['minValue'] = $minValue; + null !== $selectOptions && $obj['selectOptions'] = $selectOptions; return $obj; } @@ -159,7 +159,7 @@ public function withDefaultValue( string|float|bool|array $defaultValue ): self { $obj = clone $this; - $obj->defaultValue = $defaultValue; + $obj['defaultValue'] = $defaultValue; return $obj; } @@ -170,7 +170,7 @@ public function withDefaultValue( public function withIsValueRequired(bool $isValueRequired): self { $obj = clone $this; - $obj->isValueRequired = $isValueRequired; + $obj['isValueRequired'] = $isValueRequired; return $obj; } @@ -181,7 +181,7 @@ public function withIsValueRequired(bool $isValueRequired): self public function withMaxLength(float $maxLength): self { $obj = clone $this; - $obj->maxLength = $maxLength; + $obj['maxLength'] = $maxLength; return $obj; } @@ -192,7 +192,7 @@ public function withMaxLength(float $maxLength): self public function withMaxValue(string|float $maxValue): self { $obj = clone $this; - $obj->maxValue = $maxValue; + $obj['maxValue'] = $maxValue; return $obj; } @@ -203,7 +203,7 @@ public function withMaxValue(string|float $maxValue): self public function withMinLength(float $minLength): self { $obj = clone $this; - $obj->minLength = $minLength; + $obj['minLength'] = $minLength; return $obj; } @@ -214,7 +214,7 @@ public function withMinLength(float $minLength): self public function withMinValue(string|float $minValue): self { $obj = clone $this; - $obj->minValue = $minValue; + $obj['minValue'] = $minValue; return $obj; } @@ -227,7 +227,7 @@ public function withMinValue(string|float $minValue): self public function withSelectOptions(array $selectOptions): self { $obj = clone $this; - $obj->selectOptions = $selectOptions; + $obj['selectOptions'] = $selectOptions; return $obj; } diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php index 8fc02499..29dff291 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php @@ -9,6 +9,7 @@ use ImageKit\Core\Concerns\SdkParams; use ImageKit\Core\Contracts\BaseModel; use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; +use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\Type; /** * This API creates a new custom metadata field. Once a custom metadata field is created either through this API or using the dashboard UI, its value can be set on the assets. The value of a field for an asset can be set using the media library UI or programmatically through upload or update assets API. @@ -16,7 +17,18 @@ * @see ImageKit\Services\CustomMetadataFieldsService::create() * * @phpstan-type CustomMetadataFieldCreateParamsShape = array{ - * label: string, name: string, schema: Schema + * label: string, + * name: string, + * schema: Schema|array{ + * type: value-of, + * defaultValue?: string|float|bool|null|list, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * selectOptions?: list|null, + * }, * } */ final class CustomMetadataFieldCreateParams implements BaseModel @@ -66,17 +78,28 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Schema|array{ + * type: value-of, + * defaultValue?: string|float|bool|list|null, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * selectOptions?: list|null, + * } $schema */ public static function with( string $label, string $name, - Schema $schema + Schema|array $schema ): self { $obj = new self; - $obj->label = $label; - $obj->name = $name; - $obj->schema = $schema; + $obj['label'] = $label; + $obj['name'] = $name; + $obj['schema'] = $schema; return $obj; } @@ -87,7 +110,7 @@ public static function with( public function withLabel(string $label): self { $obj = clone $this; - $obj->label = $label; + $obj['label'] = $label; return $obj; } @@ -98,15 +121,27 @@ public function withLabel(string $label): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } - public function withSchema(Schema $schema): self + /** + * @param Schema|array{ + * type: value-of, + * defaultValue?: string|float|bool|list|null, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * selectOptions?: list|null, + * } $schema + */ + public function withSchema(Schema|array $schema): self { $obj = clone $this; - $obj->schema = $schema; + $obj['schema'] = $schema; return $obj; } diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php index 8ac0e6ee..5b661865 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php @@ -124,13 +124,13 @@ public static function with( $obj['type'] = $type; - null !== $defaultValue && $obj->defaultValue = $defaultValue; - null !== $isValueRequired && $obj->isValueRequired = $isValueRequired; - null !== $maxLength && $obj->maxLength = $maxLength; - null !== $maxValue && $obj->maxValue = $maxValue; - null !== $minLength && $obj->minLength = $minLength; - null !== $minValue && $obj->minValue = $minValue; - null !== $selectOptions && $obj->selectOptions = $selectOptions; + null !== $defaultValue && $obj['defaultValue'] = $defaultValue; + null !== $isValueRequired && $obj['isValueRequired'] = $isValueRequired; + null !== $maxLength && $obj['maxLength'] = $maxLength; + null !== $maxValue && $obj['maxValue'] = $maxValue; + null !== $minLength && $obj['minLength'] = $minLength; + null !== $minValue && $obj['minValue'] = $minValue; + null !== $selectOptions && $obj['selectOptions'] = $selectOptions; return $obj; } @@ -157,7 +157,7 @@ public function withDefaultValue( string|float|bool|array $defaultValue ): self { $obj = clone $this; - $obj->defaultValue = $defaultValue; + $obj['defaultValue'] = $defaultValue; return $obj; } @@ -168,7 +168,7 @@ public function withDefaultValue( public function withIsValueRequired(bool $isValueRequired): self { $obj = clone $this; - $obj->isValueRequired = $isValueRequired; + $obj['isValueRequired'] = $isValueRequired; return $obj; } @@ -179,7 +179,7 @@ public function withIsValueRequired(bool $isValueRequired): self public function withMaxLength(float $maxLength): self { $obj = clone $this; - $obj->maxLength = $maxLength; + $obj['maxLength'] = $maxLength; return $obj; } @@ -190,7 +190,7 @@ public function withMaxLength(float $maxLength): self public function withMaxValue(string|float $maxValue): self { $obj = clone $this; - $obj->maxValue = $maxValue; + $obj['maxValue'] = $maxValue; return $obj; } @@ -201,7 +201,7 @@ public function withMaxValue(string|float $maxValue): self public function withMinLength(float $minLength): self { $obj = clone $this; - $obj->minLength = $minLength; + $obj['minLength'] = $minLength; return $obj; } @@ -212,7 +212,7 @@ public function withMinLength(float $minLength): self public function withMinValue(string|float $minValue): self { $obj = clone $this; - $obj->minValue = $minValue; + $obj['minValue'] = $minValue; return $obj; } @@ -225,7 +225,7 @@ public function withMinValue(string|float $minValue): self public function withSelectOptions(array $selectOptions): self { $obj = clone $this; - $obj->selectOptions = $selectOptions; + $obj['selectOptions'] = $selectOptions; return $obj; } diff --git a/src/CustomMetadataFields/CustomMetadataFieldListParams.php b/src/CustomMetadataFields/CustomMetadataFieldListParams.php index 96947925..6fa40afd 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldListParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldListParams.php @@ -54,8 +54,8 @@ public static function with( ): self { $obj = new self; - null !== $folderPath && $obj->folderPath = $folderPath; - null !== $includeDeleted && $obj->includeDeleted = $includeDeleted; + null !== $folderPath && $obj['folderPath'] = $folderPath; + null !== $includeDeleted && $obj['includeDeleted'] = $includeDeleted; return $obj; } @@ -66,7 +66,7 @@ public static function with( public function withFolderPath(string $folderPath): self { $obj = clone $this; - $obj->folderPath = $folderPath; + $obj['folderPath'] = $folderPath; return $obj; } @@ -77,7 +77,7 @@ public function withFolderPath(string $folderPath): self public function withIncludeDeleted(bool $includeDeleted): self { $obj = clone $this; - $obj->includeDeleted = $includeDeleted; + $obj['includeDeleted'] = $includeDeleted; return $obj; } diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php index 4f72f5be..677e560d 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php @@ -16,7 +16,16 @@ * @see ImageKit\Services\CustomMetadataFieldsService::update() * * @phpstan-type CustomMetadataFieldUpdateParamsShape = array{ - * label?: string, schema?: Schema + * label?: string, + * schema?: Schema|array{ + * defaultValue?: string|float|bool|null|list, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * selectOptions?: list|null, + * }, * } */ final class CustomMetadataFieldUpdateParams implements BaseModel @@ -46,15 +55,25 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Schema|array{ + * defaultValue?: string|float|bool|list|null, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * selectOptions?: list|null, + * } $schema */ public static function with( ?string $label = null, - ?Schema $schema = null + Schema|array|null $schema = null ): self { $obj = new self; - null !== $label && $obj->label = $label; - null !== $schema && $obj->schema = $schema; + null !== $label && $obj['label'] = $label; + null !== $schema && $obj['schema'] = $schema; return $obj; } @@ -65,18 +84,28 @@ public static function with( public function withLabel(string $label): self { $obj = clone $this; - $obj->label = $label; + $obj['label'] = $label; return $obj; } /** * An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. + * + * @param Schema|array{ + * defaultValue?: string|float|bool|list|null, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * selectOptions?: list|null, + * } $schema */ - public function withSchema(Schema $schema): self + public function withSchema(Schema|array $schema): self { $obj = clone $this; - $obj->schema = $schema; + $obj['schema'] = $schema; return $obj; } diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php index b63c9541..697060c3 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php @@ -98,13 +98,13 @@ public static function with( ): self { $obj = new self; - null !== $defaultValue && $obj->defaultValue = $defaultValue; - null !== $isValueRequired && $obj->isValueRequired = $isValueRequired; - null !== $maxLength && $obj->maxLength = $maxLength; - null !== $maxValue && $obj->maxValue = $maxValue; - null !== $minLength && $obj->minLength = $minLength; - null !== $minValue && $obj->minValue = $minValue; - null !== $selectOptions && $obj->selectOptions = $selectOptions; + null !== $defaultValue && $obj['defaultValue'] = $defaultValue; + null !== $isValueRequired && $obj['isValueRequired'] = $isValueRequired; + null !== $maxLength && $obj['maxLength'] = $maxLength; + null !== $maxValue && $obj['maxValue'] = $maxValue; + null !== $minLength && $obj['minLength'] = $minLength; + null !== $minValue && $obj['minValue'] = $minValue; + null !== $selectOptions && $obj['selectOptions'] = $selectOptions; return $obj; } @@ -118,7 +118,7 @@ public function withDefaultValue( string|float|bool|array $defaultValue ): self { $obj = clone $this; - $obj->defaultValue = $defaultValue; + $obj['defaultValue'] = $defaultValue; return $obj; } @@ -129,7 +129,7 @@ public function withDefaultValue( public function withIsValueRequired(bool $isValueRequired): self { $obj = clone $this; - $obj->isValueRequired = $isValueRequired; + $obj['isValueRequired'] = $isValueRequired; return $obj; } @@ -140,7 +140,7 @@ public function withIsValueRequired(bool $isValueRequired): self public function withMaxLength(float $maxLength): self { $obj = clone $this; - $obj->maxLength = $maxLength; + $obj['maxLength'] = $maxLength; return $obj; } @@ -151,7 +151,7 @@ public function withMaxLength(float $maxLength): self public function withMaxValue(string|float $maxValue): self { $obj = clone $this; - $obj->maxValue = $maxValue; + $obj['maxValue'] = $maxValue; return $obj; } @@ -162,7 +162,7 @@ public function withMaxValue(string|float $maxValue): self public function withMinLength(float $minLength): self { $obj = clone $this; - $obj->minLength = $minLength; + $obj['minLength'] = $minLength; return $obj; } @@ -173,7 +173,7 @@ public function withMinLength(float $minLength): self public function withMinValue(string|float $minValue): self { $obj = clone $this; - $obj->minValue = $minValue; + $obj['minValue'] = $minValue; return $obj; } @@ -186,7 +186,7 @@ public function withMinValue(string|float $minValue): self public function withSelectOptions(array $selectOptions): self { $obj = clone $this; - $obj->selectOptions = $selectOptions; + $obj['selectOptions'] = $selectOptions; return $obj; } diff --git a/src/ExtensionItem/AutoTaggingExtension.php b/src/ExtensionItem/AutoTaggingExtension.php index 1de2f0e8..761fda47 100644 --- a/src/ExtensionItem/AutoTaggingExtension.php +++ b/src/ExtensionItem/AutoTaggingExtension.php @@ -75,8 +75,8 @@ public static function with( ): self { $obj = new self; - $obj->maxTags = $maxTags; - $obj->minConfidence = $minConfidence; + $obj['maxTags'] = $maxTags; + $obj['minConfidence'] = $minConfidence; $obj['name'] = $name; return $obj; @@ -88,7 +88,7 @@ public static function with( public function withMaxTags(int $maxTags): self { $obj = clone $this; - $obj->maxTags = $maxTags; + $obj['maxTags'] = $maxTags; return $obj; } @@ -99,7 +99,7 @@ public function withMaxTags(int $maxTags): self public function withMinConfidence(int $minConfidence): self { $obj = clone $this; - $obj->minConfidence = $minConfidence; + $obj['minConfidence'] = $minConfidence; return $obj; } diff --git a/src/ExtensionItem/RemoveBg.php b/src/ExtensionItem/RemoveBg.php index 3a724641..262ff188 100644 --- a/src/ExtensionItem/RemoveBg.php +++ b/src/ExtensionItem/RemoveBg.php @@ -37,20 +37,35 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Options|array{ + * add_shadow?: bool|null, + * bg_color?: string|null, + * bg_image_url?: string|null, + * semitransparency?: bool|null, + * } $options */ - public static function with(?Options $options = null): self + public static function with(Options|array|null $options = null): self { $obj = new self; - null !== $options && $obj->options = $options; + null !== $options && $obj['options'] = $options; return $obj; } - public function withOptions(Options $options): self + /** + * @param Options|array{ + * add_shadow?: bool|null, + * bg_color?: string|null, + * bg_image_url?: string|null, + * semitransparency?: bool|null, + * } $options + */ + public function withOptions(Options|array $options): self { $obj = clone $this; - $obj->options = $options; + $obj['options'] = $options; return $obj; } diff --git a/src/ExtensionItem/RemoveBg/Options.php b/src/ExtensionItem/RemoveBg/Options.php index 84504f34..b5366788 100644 --- a/src/ExtensionItem/RemoveBg/Options.php +++ b/src/ExtensionItem/RemoveBg/Options.php @@ -63,10 +63,10 @@ public static function with( ): self { $obj = new self; - null !== $add_shadow && $obj->add_shadow = $add_shadow; - null !== $bg_color && $obj->bg_color = $bg_color; - null !== $bg_image_url && $obj->bg_image_url = $bg_image_url; - null !== $semitransparency && $obj->semitransparency = $semitransparency; + null !== $add_shadow && $obj['add_shadow'] = $add_shadow; + null !== $bg_color && $obj['bg_color'] = $bg_color; + null !== $bg_image_url && $obj['bg_image_url'] = $bg_image_url; + null !== $semitransparency && $obj['semitransparency'] = $semitransparency; return $obj; } @@ -77,7 +77,7 @@ public static function with( public function withAddShadow(bool $addShadow): self { $obj = clone $this; - $obj->add_shadow = $addShadow; + $obj['add_shadow'] = $addShadow; return $obj; } @@ -88,7 +88,7 @@ public function withAddShadow(bool $addShadow): self public function withBgColor(string $bgColor): self { $obj = clone $this; - $obj->bg_color = $bgColor; + $obj['bg_color'] = $bgColor; return $obj; } @@ -99,7 +99,7 @@ public function withBgColor(string $bgColor): self public function withBgImageURL(string $bgImageURL): self { $obj = clone $this; - $obj->bg_image_url = $bgImageURL; + $obj['bg_image_url'] = $bgImageURL; return $obj; } @@ -110,7 +110,7 @@ public function withBgImageURL(string $bgImageURL): self public function withSemitransparency(bool $semitransparency): self { $obj = clone $this; - $obj->semitransparency = $semitransparency; + $obj['semitransparency'] = $semitransparency; return $obj; } diff --git a/src/Files/Bulk/BulkAddTagsParams.php b/src/Files/Bulk/BulkAddTagsParams.php index f12e7f7c..4d8c2bd6 100644 --- a/src/Files/Bulk/BulkAddTagsParams.php +++ b/src/Files/Bulk/BulkAddTagsParams.php @@ -71,8 +71,8 @@ public static function with(array $fileIds, array $tags): self { $obj = new self; - $obj->fileIds = $fileIds; - $obj->tags = $tags; + $obj['fileIds'] = $fileIds; + $obj['tags'] = $tags; return $obj; } @@ -85,7 +85,7 @@ public static function with(array $fileIds, array $tags): self public function withFileIDs(array $fileIDs): self { $obj = clone $this; - $obj->fileIds = $fileIDs; + $obj['fileIds'] = $fileIDs; return $obj; } @@ -98,7 +98,7 @@ public function withFileIDs(array $fileIDs): self public function withTags(array $tags): self { $obj = clone $this; - $obj->tags = $tags; + $obj['tags'] = $tags; return $obj; } diff --git a/src/Files/Bulk/BulkAddTagsResponse.php b/src/Files/Bulk/BulkAddTagsResponse.php index f53ab9ae..05c9c5bc 100644 --- a/src/Files/Bulk/BulkAddTagsResponse.php +++ b/src/Files/Bulk/BulkAddTagsResponse.php @@ -46,7 +46,7 @@ public static function with(?array $successfullyUpdatedFileIds = null): self { $obj = new self; - null !== $successfullyUpdatedFileIds && $obj->successfullyUpdatedFileIds = $successfullyUpdatedFileIds; + null !== $successfullyUpdatedFileIds && $obj['successfullyUpdatedFileIds'] = $successfullyUpdatedFileIds; return $obj; } @@ -60,7 +60,7 @@ public function withSuccessfullyUpdatedFileIDs( array $successfullyUpdatedFileIDs ): self { $obj = clone $this; - $obj->successfullyUpdatedFileIds = $successfullyUpdatedFileIDs; + $obj['successfullyUpdatedFileIds'] = $successfullyUpdatedFileIDs; return $obj; } diff --git a/src/Files/Bulk/BulkDeleteParams.php b/src/Files/Bulk/BulkDeleteParams.php index 46c84062..d387345f 100644 --- a/src/Files/Bulk/BulkDeleteParams.php +++ b/src/Files/Bulk/BulkDeleteParams.php @@ -64,7 +64,7 @@ public static function with(array $fileIds): self { $obj = new self; - $obj->fileIds = $fileIds; + $obj['fileIds'] = $fileIds; return $obj; } @@ -77,7 +77,7 @@ public static function with(array $fileIds): self public function withFileIDs(array $fileIDs): self { $obj = clone $this; - $obj->fileIds = $fileIDs; + $obj['fileIds'] = $fileIDs; return $obj; } diff --git a/src/Files/Bulk/BulkDeleteResponse.php b/src/Files/Bulk/BulkDeleteResponse.php index 80b6f678..cebbbb1e 100644 --- a/src/Files/Bulk/BulkDeleteResponse.php +++ b/src/Files/Bulk/BulkDeleteResponse.php @@ -46,7 +46,7 @@ public static function with(?array $successfullyDeletedFileIds = null): self { $obj = new self; - null !== $successfullyDeletedFileIds && $obj->successfullyDeletedFileIds = $successfullyDeletedFileIds; + null !== $successfullyDeletedFileIds && $obj['successfullyDeletedFileIds'] = $successfullyDeletedFileIds; return $obj; } @@ -60,7 +60,7 @@ public function withSuccessfullyDeletedFileIDs( array $successfullyDeletedFileIDs ): self { $obj = clone $this; - $obj->successfullyDeletedFileIds = $successfullyDeletedFileIDs; + $obj['successfullyDeletedFileIds'] = $successfullyDeletedFileIDs; return $obj; } diff --git a/src/Files/Bulk/BulkRemoveAITagsParams.php b/src/Files/Bulk/BulkRemoveAITagsParams.php index 4ef93b02..7a31eb45 100644 --- a/src/Files/Bulk/BulkRemoveAITagsParams.php +++ b/src/Files/Bulk/BulkRemoveAITagsParams.php @@ -71,8 +71,8 @@ public static function with(array $AITags, array $fileIds): self { $obj = new self; - $obj->AITags = $AITags; - $obj->fileIds = $fileIds; + $obj['AITags'] = $AITags; + $obj['fileIds'] = $fileIds; return $obj; } @@ -85,7 +85,7 @@ public static function with(array $AITags, array $fileIds): self public function withAITags(array $aiTags): self { $obj = clone $this; - $obj->AITags = $aiTags; + $obj['AITags'] = $aiTags; return $obj; } @@ -98,7 +98,7 @@ public function withAITags(array $aiTags): self public function withFileIDs(array $fileIDs): self { $obj = clone $this; - $obj->fileIds = $fileIDs; + $obj['fileIds'] = $fileIDs; return $obj; } diff --git a/src/Files/Bulk/BulkRemoveAITagsResponse.php b/src/Files/Bulk/BulkRemoveAITagsResponse.php index f8dccd49..92c6da45 100644 --- a/src/Files/Bulk/BulkRemoveAITagsResponse.php +++ b/src/Files/Bulk/BulkRemoveAITagsResponse.php @@ -46,7 +46,7 @@ public static function with(?array $successfullyUpdatedFileIds = null): self { $obj = new self; - null !== $successfullyUpdatedFileIds && $obj->successfullyUpdatedFileIds = $successfullyUpdatedFileIds; + null !== $successfullyUpdatedFileIds && $obj['successfullyUpdatedFileIds'] = $successfullyUpdatedFileIds; return $obj; } @@ -60,7 +60,7 @@ public function withSuccessfullyUpdatedFileIDs( array $successfullyUpdatedFileIDs ): self { $obj = clone $this; - $obj->successfullyUpdatedFileIds = $successfullyUpdatedFileIDs; + $obj['successfullyUpdatedFileIds'] = $successfullyUpdatedFileIDs; return $obj; } diff --git a/src/Files/Bulk/BulkRemoveTagsParams.php b/src/Files/Bulk/BulkRemoveTagsParams.php index 9f334add..fe483474 100644 --- a/src/Files/Bulk/BulkRemoveTagsParams.php +++ b/src/Files/Bulk/BulkRemoveTagsParams.php @@ -71,8 +71,8 @@ public static function with(array $fileIds, array $tags): self { $obj = new self; - $obj->fileIds = $fileIds; - $obj->tags = $tags; + $obj['fileIds'] = $fileIds; + $obj['tags'] = $tags; return $obj; } @@ -85,7 +85,7 @@ public static function with(array $fileIds, array $tags): self public function withFileIDs(array $fileIDs): self { $obj = clone $this; - $obj->fileIds = $fileIDs; + $obj['fileIds'] = $fileIDs; return $obj; } @@ -98,7 +98,7 @@ public function withFileIDs(array $fileIDs): self public function withTags(array $tags): self { $obj = clone $this; - $obj->tags = $tags; + $obj['tags'] = $tags; return $obj; } diff --git a/src/Files/Bulk/BulkRemoveTagsResponse.php b/src/Files/Bulk/BulkRemoveTagsResponse.php index 4323db6a..c2605294 100644 --- a/src/Files/Bulk/BulkRemoveTagsResponse.php +++ b/src/Files/Bulk/BulkRemoveTagsResponse.php @@ -46,7 +46,7 @@ public static function with(?array $successfullyUpdatedFileIds = null): self { $obj = new self; - null !== $successfullyUpdatedFileIds && $obj->successfullyUpdatedFileIds = $successfullyUpdatedFileIds; + null !== $successfullyUpdatedFileIds && $obj['successfullyUpdatedFileIds'] = $successfullyUpdatedFileIds; return $obj; } @@ -60,7 +60,7 @@ public function withSuccessfullyUpdatedFileIDs( array $successfullyUpdatedFileIDs ): self { $obj = clone $this; - $obj->successfullyUpdatedFileIds = $successfullyUpdatedFileIDs; + $obj['successfullyUpdatedFileIds'] = $successfullyUpdatedFileIDs; return $obj; } diff --git a/src/Files/File.php b/src/Files/File.php index 6ddfa189..2032c1fd 100644 --- a/src/Files/File.php +++ b/src/Files/File.php @@ -212,11 +212,25 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list|null $AITags + * @param list|null $AITags * @param array $customMetadata - * @param array $selectedFieldsSchema + * @param array, + * defaultValue?: string|float|bool|list|null, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * readOnly?: bool|null, + * selectOptions?: list|null, + * selectOptionsTruncated?: bool|null, + * }> $selectedFieldsSchema * @param list|null $tags * @param Type|value-of $type + * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo */ public static function with( ?array $AITags = null, @@ -240,34 +254,34 @@ public static function with( Type|string|null $type = null, ?\DateTimeInterface $updatedAt = null, ?string $url = null, - ?VersionInfo $versionInfo = null, + VersionInfo|array|null $versionInfo = null, ?float $width = null, ): self { $obj = new self; - null !== $AITags && $obj->AITags = $AITags; - null !== $createdAt && $obj->createdAt = $createdAt; - null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; - null !== $customMetadata && $obj->customMetadata = $customMetadata; - null !== $description && $obj->description = $description; - null !== $fileId && $obj->fileId = $fileId; - null !== $filePath && $obj->filePath = $filePath; - null !== $fileType && $obj->fileType = $fileType; - null !== $hasAlpha && $obj->hasAlpha = $hasAlpha; - null !== $height && $obj->height = $height; - null !== $isPrivateFile && $obj->isPrivateFile = $isPrivateFile; - null !== $isPublished && $obj->isPublished = $isPublished; - null !== $mime && $obj->mime = $mime; - null !== $name && $obj->name = $name; - null !== $selectedFieldsSchema && $obj->selectedFieldsSchema = $selectedFieldsSchema; - null !== $size && $obj->size = $size; - null !== $tags && $obj->tags = $tags; - null !== $thumbnail && $obj->thumbnail = $thumbnail; + null !== $AITags && $obj['AITags'] = $AITags; + null !== $createdAt && $obj['createdAt'] = $createdAt; + null !== $customCoordinates && $obj['customCoordinates'] = $customCoordinates; + null !== $customMetadata && $obj['customMetadata'] = $customMetadata; + null !== $description && $obj['description'] = $description; + null !== $fileId && $obj['fileId'] = $fileId; + null !== $filePath && $obj['filePath'] = $filePath; + null !== $fileType && $obj['fileType'] = $fileType; + null !== $hasAlpha && $obj['hasAlpha'] = $hasAlpha; + null !== $height && $obj['height'] = $height; + null !== $isPrivateFile && $obj['isPrivateFile'] = $isPrivateFile; + null !== $isPublished && $obj['isPublished'] = $isPublished; + null !== $mime && $obj['mime'] = $mime; + null !== $name && $obj['name'] = $name; + null !== $selectedFieldsSchema && $obj['selectedFieldsSchema'] = $selectedFieldsSchema; + null !== $size && $obj['size'] = $size; + null !== $tags && $obj['tags'] = $tags; + null !== $thumbnail && $obj['thumbnail'] = $thumbnail; null !== $type && $obj['type'] = $type; - null !== $updatedAt && $obj->updatedAt = $updatedAt; - null !== $url && $obj->url = $url; - null !== $versionInfo && $obj->versionInfo = $versionInfo; - null !== $width && $obj->width = $width; + null !== $updatedAt && $obj['updatedAt'] = $updatedAt; + null !== $url && $obj['url'] = $url; + null !== $versionInfo && $obj['versionInfo'] = $versionInfo; + null !== $width && $obj['width'] = $width; return $obj; } @@ -275,12 +289,14 @@ public static function with( /** * An array of tags assigned to the file by auto tagging. * - * @param list|null $aiTags + * @param list|null $aiTags */ public function withAITags(?array $aiTags): self { $obj = clone $this; - $obj->AITags = $aiTags; + $obj['AITags'] = $aiTags; return $obj; } @@ -291,7 +307,7 @@ public function withAITags(?array $aiTags): self public function withCreatedAt(\DateTimeInterface $createdAt): self { $obj = clone $this; - $obj->createdAt = $createdAt; + $obj['createdAt'] = $createdAt; return $obj; } @@ -302,7 +318,7 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self public function withCustomCoordinates(?string $customCoordinates): self { $obj = clone $this; - $obj->customCoordinates = $customCoordinates; + $obj['customCoordinates'] = $customCoordinates; return $obj; } @@ -315,7 +331,7 @@ public function withCustomCoordinates(?string $customCoordinates): self public function withCustomMetadata(array $customMetadata): self { $obj = clone $this; - $obj->customMetadata = $customMetadata; + $obj['customMetadata'] = $customMetadata; return $obj; } @@ -326,7 +342,7 @@ public function withCustomMetadata(array $customMetadata): self public function withDescription(string $description): self { $obj = clone $this; - $obj->description = $description; + $obj['description'] = $description; return $obj; } @@ -337,7 +353,7 @@ public function withDescription(string $description): self public function withFileID(string $fileID): self { $obj = clone $this; - $obj->fileId = $fileID; + $obj['fileId'] = $fileID; return $obj; } @@ -348,7 +364,7 @@ public function withFileID(string $fileID): self public function withFilePath(string $filePath): self { $obj = clone $this; - $obj->filePath = $filePath; + $obj['filePath'] = $filePath; return $obj; } @@ -359,7 +375,7 @@ public function withFilePath(string $filePath): self public function withFileType(string $fileType): self { $obj = clone $this; - $obj->fileType = $fileType; + $obj['fileType'] = $fileType; return $obj; } @@ -370,7 +386,7 @@ public function withFileType(string $fileType): self public function withHasAlpha(bool $hasAlpha): self { $obj = clone $this; - $obj->hasAlpha = $hasAlpha; + $obj['hasAlpha'] = $hasAlpha; return $obj; } @@ -381,7 +397,7 @@ public function withHasAlpha(bool $hasAlpha): self public function withHeight(float $height): self { $obj = clone $this; - $obj->height = $height; + $obj['height'] = $height; return $obj; } @@ -392,7 +408,7 @@ public function withHeight(float $height): self public function withIsPrivateFile(bool $isPrivateFile): self { $obj = clone $this; - $obj->isPrivateFile = $isPrivateFile; + $obj['isPrivateFile'] = $isPrivateFile; return $obj; } @@ -403,7 +419,7 @@ public function withIsPrivateFile(bool $isPrivateFile): self public function withIsPublished(bool $isPublished): self { $obj = clone $this; - $obj->isPublished = $isPublished; + $obj['isPublished'] = $isPublished; return $obj; } @@ -414,7 +430,7 @@ public function withIsPublished(bool $isPublished): self public function withMime(string $mime): self { $obj = clone $this; - $obj->mime = $mime; + $obj['mime'] = $mime; return $obj; } @@ -425,7 +441,7 @@ public function withMime(string $mime): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -437,12 +453,23 @@ public function withName(string $name): self * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @param array $selectedFieldsSchema + * @param array, + * defaultValue?: string|float|bool|list|null, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * readOnly?: bool|null, + * selectOptions?: list|null, + * selectOptionsTruncated?: bool|null, + * }> $selectedFieldsSchema */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { $obj = clone $this; - $obj->selectedFieldsSchema = $selectedFieldsSchema; + $obj['selectedFieldsSchema'] = $selectedFieldsSchema; return $obj; } @@ -453,7 +480,7 @@ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self public function withSize(float $size): self { $obj = clone $this; - $obj->size = $size; + $obj['size'] = $size; return $obj; } @@ -466,7 +493,7 @@ public function withSize(float $size): self public function withTags(?array $tags): self { $obj = clone $this; - $obj->tags = $tags; + $obj['tags'] = $tags; return $obj; } @@ -477,7 +504,7 @@ public function withTags(?array $tags): self public function withThumbnail(string $thumbnail): self { $obj = clone $this; - $obj->thumbnail = $thumbnail; + $obj['thumbnail'] = $thumbnail; return $obj; } @@ -501,7 +528,7 @@ public function withType(Type|string $type): self public function withUpdatedAt(\DateTimeInterface $updatedAt): self { $obj = clone $this; - $obj->updatedAt = $updatedAt; + $obj['updatedAt'] = $updatedAt; return $obj; } @@ -512,18 +539,20 @@ public function withUpdatedAt(\DateTimeInterface $updatedAt): self public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } /** * An object with details of the file version. + * + * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo */ - public function withVersionInfo(VersionInfo $versionInfo): self + public function withVersionInfo(VersionInfo|array $versionInfo): self { $obj = clone $this; - $obj->versionInfo = $versionInfo; + $obj['versionInfo'] = $versionInfo; return $obj; } @@ -534,7 +563,7 @@ public function withVersionInfo(VersionInfo $versionInfo): self public function withWidth(float $width): self { $obj = clone $this; - $obj->width = $width; + $obj['width'] = $width; return $obj; } diff --git a/src/Files/File/AITag.php b/src/Files/File/AITag.php index 7adaa23d..7aa68a3d 100644 --- a/src/Files/File/AITag.php +++ b/src/Files/File/AITag.php @@ -53,9 +53,9 @@ public static function with( ): self { $obj = new self; - null !== $confidence && $obj->confidence = $confidence; - null !== $name && $obj->name = $name; - null !== $source && $obj->source = $source; + null !== $confidence && $obj['confidence'] = $confidence; + null !== $name && $obj['name'] = $name; + null !== $source && $obj['source'] = $source; return $obj; } @@ -66,7 +66,7 @@ public static function with( public function withConfidence(float $confidence): self { $obj = clone $this; - $obj->confidence = $confidence; + $obj['confidence'] = $confidence; return $obj; } @@ -77,7 +77,7 @@ public function withConfidence(float $confidence): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -88,7 +88,7 @@ public function withName(string $name): self public function withSource(string $source): self { $obj = clone $this; - $obj->source = $source; + $obj['source'] = $source; return $obj; } diff --git a/src/Files/File/SelectedFieldsSchema.php b/src/Files/File/SelectedFieldsSchema.php index f6026df6..768dff10 100644 --- a/src/Files/File/SelectedFieldsSchema.php +++ b/src/Files/File/SelectedFieldsSchema.php @@ -140,15 +140,15 @@ public static function with( $obj['type'] = $type; - null !== $defaultValue && $obj->defaultValue = $defaultValue; - null !== $isValueRequired && $obj->isValueRequired = $isValueRequired; - null !== $maxLength && $obj->maxLength = $maxLength; - null !== $maxValue && $obj->maxValue = $maxValue; - null !== $minLength && $obj->minLength = $minLength; - null !== $minValue && $obj->minValue = $minValue; - null !== $readOnly && $obj->readOnly = $readOnly; - null !== $selectOptions && $obj->selectOptions = $selectOptions; - null !== $selectOptionsTruncated && $obj->selectOptionsTruncated = $selectOptionsTruncated; + null !== $defaultValue && $obj['defaultValue'] = $defaultValue; + null !== $isValueRequired && $obj['isValueRequired'] = $isValueRequired; + null !== $maxLength && $obj['maxLength'] = $maxLength; + null !== $maxValue && $obj['maxValue'] = $maxValue; + null !== $minLength && $obj['minLength'] = $minLength; + null !== $minValue && $obj['minValue'] = $minValue; + null !== $readOnly && $obj['readOnly'] = $readOnly; + null !== $selectOptions && $obj['selectOptions'] = $selectOptions; + null !== $selectOptionsTruncated && $obj['selectOptionsTruncated'] = $selectOptionsTruncated; return $obj; } @@ -176,7 +176,7 @@ public function withDefaultValue( string|float|bool|array $defaultValue ): self { $obj = clone $this; - $obj->defaultValue = $defaultValue; + $obj['defaultValue'] = $defaultValue; return $obj; } @@ -187,7 +187,7 @@ public function withDefaultValue( public function withIsValueRequired(bool $isValueRequired): self { $obj = clone $this; - $obj->isValueRequired = $isValueRequired; + $obj['isValueRequired'] = $isValueRequired; return $obj; } @@ -198,7 +198,7 @@ public function withIsValueRequired(bool $isValueRequired): self public function withMaxLength(float $maxLength): self { $obj = clone $this; - $obj->maxLength = $maxLength; + $obj['maxLength'] = $maxLength; return $obj; } @@ -209,7 +209,7 @@ public function withMaxLength(float $maxLength): self public function withMaxValue(string|float $maxValue): self { $obj = clone $this; - $obj->maxValue = $maxValue; + $obj['maxValue'] = $maxValue; return $obj; } @@ -220,7 +220,7 @@ public function withMaxValue(string|float $maxValue): self public function withMinLength(float $minLength): self { $obj = clone $this; - $obj->minLength = $minLength; + $obj['minLength'] = $minLength; return $obj; } @@ -231,7 +231,7 @@ public function withMinLength(float $minLength): self public function withMinValue(string|float $minValue): self { $obj = clone $this; - $obj->minValue = $minValue; + $obj['minValue'] = $minValue; return $obj; } @@ -242,7 +242,7 @@ public function withMinValue(string|float $minValue): self public function withReadOnly(bool $readOnly): self { $obj = clone $this; - $obj->readOnly = $readOnly; + $obj['readOnly'] = $readOnly; return $obj; } @@ -255,7 +255,7 @@ public function withReadOnly(bool $readOnly): self public function withSelectOptions(array $selectOptions): self { $obj = clone $this; - $obj->selectOptions = $selectOptions; + $obj['selectOptions'] = $selectOptions; return $obj; } @@ -267,7 +267,7 @@ public function withSelectOptionsTruncated( bool $selectOptionsTruncated ): self { $obj = clone $this; - $obj->selectOptionsTruncated = $selectOptionsTruncated; + $obj['selectOptionsTruncated'] = $selectOptionsTruncated; return $obj; } diff --git a/src/Files/File/VersionInfo.php b/src/Files/File/VersionInfo.php index ab1b59c1..463e3d86 100644 --- a/src/Files/File/VersionInfo.php +++ b/src/Files/File/VersionInfo.php @@ -44,8 +44,8 @@ public static function with(?string $id = null, ?string $name = null): self { $obj = new self; - null !== $id && $obj->id = $id; - null !== $name && $obj->name = $name; + null !== $id && $obj['id'] = $id; + null !== $name && $obj['name'] = $name; return $obj; } @@ -56,7 +56,7 @@ public static function with(?string $id = null, ?string $name = null): self public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -67,7 +67,7 @@ public function withID(string $id): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } diff --git a/src/Files/FileCopyParams.php b/src/Files/FileCopyParams.php index c9209ee6..8a4a47c5 100644 --- a/src/Files/FileCopyParams.php +++ b/src/Files/FileCopyParams.php @@ -75,10 +75,10 @@ public static function with( ): self { $obj = new self; - $obj->destinationPath = $destinationPath; - $obj->sourceFilePath = $sourceFilePath; + $obj['destinationPath'] = $destinationPath; + $obj['sourceFilePath'] = $sourceFilePath; - null !== $includeFileVersions && $obj->includeFileVersions = $includeFileVersions; + null !== $includeFileVersions && $obj['includeFileVersions'] = $includeFileVersions; return $obj; } @@ -89,7 +89,7 @@ public static function with( public function withDestinationPath(string $destinationPath): self { $obj = clone $this; - $obj->destinationPath = $destinationPath; + $obj['destinationPath'] = $destinationPath; return $obj; } @@ -100,7 +100,7 @@ public function withDestinationPath(string $destinationPath): self public function withSourceFilePath(string $sourceFilePath): self { $obj = clone $this; - $obj->sourceFilePath = $sourceFilePath; + $obj['sourceFilePath'] = $sourceFilePath; return $obj; } @@ -111,7 +111,7 @@ public function withSourceFilePath(string $sourceFilePath): self public function withIncludeFileVersions(bool $includeFileVersions): self { $obj = clone $this; - $obj->includeFileVersions = $includeFileVersions; + $obj['includeFileVersions'] = $includeFileVersions; return $obj; } diff --git a/src/Files/FileMoveParams.php b/src/Files/FileMoveParams.php index 079945ba..dfb22275 100644 --- a/src/Files/FileMoveParams.php +++ b/src/Files/FileMoveParams.php @@ -68,8 +68,8 @@ public static function with( ): self { $obj = new self; - $obj->destinationPath = $destinationPath; - $obj->sourceFilePath = $sourceFilePath; + $obj['destinationPath'] = $destinationPath; + $obj['sourceFilePath'] = $sourceFilePath; return $obj; } @@ -80,7 +80,7 @@ public static function with( public function withDestinationPath(string $destinationPath): self { $obj = clone $this; - $obj->destinationPath = $destinationPath; + $obj['destinationPath'] = $destinationPath; return $obj; } @@ -91,7 +91,7 @@ public function withDestinationPath(string $destinationPath): self public function withSourceFilePath(string $sourceFilePath): self { $obj = clone $this; - $obj->sourceFilePath = $sourceFilePath; + $obj['sourceFilePath'] = $sourceFilePath; return $obj; } diff --git a/src/Files/FileRenameParams.php b/src/Files/FileRenameParams.php index ccfb738b..0ade7782 100644 --- a/src/Files/FileRenameParams.php +++ b/src/Files/FileRenameParams.php @@ -88,10 +88,10 @@ public static function with( ): self { $obj = new self; - $obj->filePath = $filePath; - $obj->newFileName = $newFileName; + $obj['filePath'] = $filePath; + $obj['newFileName'] = $newFileName; - null !== $purgeCache && $obj->purgeCache = $purgeCache; + null !== $purgeCache && $obj['purgeCache'] = $purgeCache; return $obj; } @@ -102,7 +102,7 @@ public static function with( public function withFilePath(string $filePath): self { $obj = clone $this; - $obj->filePath = $filePath; + $obj['filePath'] = $filePath; return $obj; } @@ -118,7 +118,7 @@ public function withFilePath(string $filePath): self public function withNewFileName(string $newFileName): self { $obj = clone $this; - $obj->newFileName = $newFileName; + $obj['newFileName'] = $newFileName; return $obj; } @@ -137,7 +137,7 @@ public function withNewFileName(string $newFileName): self public function withPurgeCache(bool $purgeCache): self { $obj = clone $this; - $obj->purgeCache = $purgeCache; + $obj['purgeCache'] = $purgeCache; return $obj; } diff --git a/src/Files/FileRenameResponse.php b/src/Files/FileRenameResponse.php index c331d934..4ee6b9cb 100644 --- a/src/Files/FileRenameResponse.php +++ b/src/Files/FileRenameResponse.php @@ -40,7 +40,7 @@ public static function with(?string $purgeRequestId = null): self { $obj = new self; - null !== $purgeRequestId && $obj->purgeRequestId = $purgeRequestId; + null !== $purgeRequestId && $obj['purgeRequestId'] = $purgeRequestId; return $obj; } @@ -51,7 +51,7 @@ public static function with(?string $purgeRequestId = null): self public function withPurgeRequestID(string $purgeRequestID): self { $obj = clone $this; - $obj->purgeRequestId = $purgeRequestID; + $obj['purgeRequestId'] = $purgeRequestID; return $obj; } diff --git a/src/Files/FileUpdateParams.php b/src/Files/FileUpdateParams.php index da425a65..2f33032e 100644 --- a/src/Files/FileUpdateParams.php +++ b/src/Files/FileUpdateParams.php @@ -11,7 +11,9 @@ use ImageKit\ExtensionItem; use ImageKit\ExtensionItem\AIAutoDescription; use ImageKit\ExtensionItem\AutoTaggingExtension; +use ImageKit\ExtensionItem\AutoTaggingExtension\Name; use ImageKit\ExtensionItem\RemoveBg; +use ImageKit\ExtensionItem\RemoveBg\Options; use ImageKit\Files\FileUpdateParams\Publish; use ImageKit\Files\FileUpdateParams\RemoveAITags; @@ -24,11 +26,15 @@ * customCoordinates?: string|null, * customMetadata?: array, * description?: string, - * extensions?: list, + * extensions?: list + * }|AIAutoDescription|array{name: 'ai-auto-description'}>, * removeAITags?: 'all'|list, * tags?: list|null, * webhookUrl?: string, - * publish?: Publish, + * publish?: Publish|array{isPublished: bool, includeFileVersions?: bool|null}, * } */ final class FileUpdateParams implements BaseModel @@ -108,9 +114,16 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param array $customMetadata - * @param list $extensions + * @param list + * }|AIAutoDescription|array{name: 'ai-auto-description'}> $extensions * @param 'all'|list $removeAITags * @param list|null $tags + * @param Publish|array{ + * isPublished: bool, includeFileVersions?: bool|null + * } $publish */ public static function with( ?string $customCoordinates = null, @@ -120,18 +133,18 @@ public static function with( string|array|null $removeAITags = null, ?array $tags = null, ?string $webhookUrl = null, - ?Publish $publish = null, + Publish|array|null $publish = null, ): self { $obj = new self; - null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; - null !== $customMetadata && $obj->customMetadata = $customMetadata; - null !== $description && $obj->description = $description; - null !== $extensions && $obj->extensions = $extensions; - null !== $removeAITags && $obj->removeAITags = $removeAITags; - null !== $tags && $obj->tags = $tags; - null !== $webhookUrl && $obj->webhookUrl = $webhookUrl; - null !== $publish && $obj->publish = $publish; + null !== $customCoordinates && $obj['customCoordinates'] = $customCoordinates; + null !== $customMetadata && $obj['customMetadata'] = $customMetadata; + null !== $description && $obj['description'] = $description; + null !== $extensions && $obj['extensions'] = $extensions; + null !== $removeAITags && $obj['removeAITags'] = $removeAITags; + null !== $tags && $obj['tags'] = $tags; + null !== $webhookUrl && $obj['webhookUrl'] = $webhookUrl; + null !== $publish && $obj['publish'] = $publish; return $obj; } @@ -142,7 +155,7 @@ public static function with( public function withCustomCoordinates(?string $customCoordinates): self { $obj = clone $this; - $obj->customCoordinates = $customCoordinates; + $obj['customCoordinates'] = $customCoordinates; return $obj; } @@ -155,7 +168,7 @@ public function withCustomCoordinates(?string $customCoordinates): self public function withCustomMetadata(array $customMetadata): self { $obj = clone $this; - $obj->customMetadata = $customMetadata; + $obj['customMetadata'] = $customMetadata; return $obj; } @@ -166,7 +179,7 @@ public function withCustomMetadata(array $customMetadata): self public function withDescription(string $description): self { $obj = clone $this; - $obj->description = $description; + $obj['description'] = $description; return $obj; } @@ -174,12 +187,16 @@ public function withDescription(string $description): self /** * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * - * @param list $extensions + * @param list + * }|AIAutoDescription|array{name: 'ai-auto-description'}> $extensions */ public function withExtensions(array $extensions): self { $obj = clone $this; - $obj->extensions = $extensions; + $obj['extensions'] = $extensions; return $obj; } @@ -196,7 +213,7 @@ public function withExtensions(array $extensions): self public function withRemoveAITags(string|array $removeAITags): self { $obj = clone $this; - $obj->removeAITags = $removeAITags; + $obj['removeAITags'] = $removeAITags; return $obj; } @@ -209,7 +226,7 @@ public function withRemoveAITags(string|array $removeAITags): self public function withTags(?array $tags): self { $obj = clone $this; - $obj->tags = $tags; + $obj['tags'] = $tags; return $obj; } @@ -220,18 +237,22 @@ public function withTags(?array $tags): self public function withWebhookURL(string $webhookURL): self { $obj = clone $this; - $obj->webhookUrl = $webhookURL; + $obj['webhookUrl'] = $webhookURL; return $obj; } /** * Configure the publication status of a file and its versions. + * + * @param Publish|array{ + * isPublished: bool, includeFileVersions?: bool|null + * } $publish */ - public function withPublish(Publish $publish): self + public function withPublish(Publish|array $publish): self { $obj = clone $this; - $obj->publish = $publish; + $obj['publish'] = $publish; return $obj; } diff --git a/src/Files/FileUpdateParams/Publish.php b/src/Files/FileUpdateParams/Publish.php index 322c55fa..d74a236b 100644 --- a/src/Files/FileUpdateParams/Publish.php +++ b/src/Files/FileUpdateParams/Publish.php @@ -62,9 +62,9 @@ public static function with( ): self { $obj = new self; - $obj->isPublished = $isPublished; + $obj['isPublished'] = $isPublished; - null !== $includeFileVersions && $obj->includeFileVersions = $includeFileVersions; + null !== $includeFileVersions && $obj['includeFileVersions'] = $includeFileVersions; return $obj; } @@ -75,7 +75,7 @@ public static function with( public function withIsPublished(bool $isPublished): self { $obj = clone $this; - $obj->isPublished = $isPublished; + $obj['isPublished'] = $isPublished; return $obj; } @@ -86,7 +86,7 @@ public function withIsPublished(bool $isPublished): self public function withIncludeFileVersions(bool $includeFileVersions): self { $obj = clone $this; - $obj->includeFileVersions = $includeFileVersions; + $obj['includeFileVersions'] = $includeFileVersions; return $obj; } diff --git a/src/Files/FileUpdateResponse.php b/src/Files/FileUpdateResponse.php index 9e9147fa..ea6e0d15 100644 --- a/src/Files/FileUpdateResponse.php +++ b/src/Files/FileUpdateResponse.php @@ -14,6 +14,10 @@ use ImageKit\Files\File\Type; use ImageKit\Files\File\VersionInfo; use ImageKit\Files\FileUpdateResponse\ExtensionStatus; +use ImageKit\Files\FileUpdateResponse\ExtensionStatus\AIAutoDescription; +use ImageKit\Files\FileUpdateResponse\ExtensionStatus\AwsAutoTagging; +use ImageKit\Files\FileUpdateResponse\ExtensionStatus\GoogleAutoTagging; +use ImageKit\Files\FileUpdateResponse\ExtensionStatus\RemoveBg; /** * Object containing details of a file or file version. @@ -217,11 +221,31 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list|null $AITags + * @param list|null $AITags * @param array $customMetadata - * @param array $selectedFieldsSchema + * @param array, + * defaultValue?: string|float|bool|list|null, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * readOnly?: bool|null, + * selectOptions?: list|null, + * selectOptionsTruncated?: bool|null, + * }> $selectedFieldsSchema * @param list|null $tags * @param Type|value-of $type + * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo + * @param ExtensionStatus|array{ + * ai_auto_description?: value-of|null, + * aws_auto_tagging?: value-of|null, + * google_auto_tagging?: value-of|null, + * remove_bg?: value-of|null, + * } $extensionStatus */ public static function with( ?array $AITags = null, @@ -245,36 +269,36 @@ public static function with( Type|string|null $type = null, ?\DateTimeInterface $updatedAt = null, ?string $url = null, - ?VersionInfo $versionInfo = null, + VersionInfo|array|null $versionInfo = null, ?float $width = null, - ?ExtensionStatus $extensionStatus = null, + ExtensionStatus|array|null $extensionStatus = null, ): self { $obj = new self; - null !== $AITags && $obj->AITags = $AITags; - null !== $createdAt && $obj->createdAt = $createdAt; - null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; - null !== $customMetadata && $obj->customMetadata = $customMetadata; - null !== $description && $obj->description = $description; - null !== $fileId && $obj->fileId = $fileId; - null !== $filePath && $obj->filePath = $filePath; - null !== $fileType && $obj->fileType = $fileType; - null !== $hasAlpha && $obj->hasAlpha = $hasAlpha; - null !== $height && $obj->height = $height; - null !== $isPrivateFile && $obj->isPrivateFile = $isPrivateFile; - null !== $isPublished && $obj->isPublished = $isPublished; - null !== $mime && $obj->mime = $mime; - null !== $name && $obj->name = $name; - null !== $selectedFieldsSchema && $obj->selectedFieldsSchema = $selectedFieldsSchema; - null !== $size && $obj->size = $size; - null !== $tags && $obj->tags = $tags; - null !== $thumbnail && $obj->thumbnail = $thumbnail; + null !== $AITags && $obj['AITags'] = $AITags; + null !== $createdAt && $obj['createdAt'] = $createdAt; + null !== $customCoordinates && $obj['customCoordinates'] = $customCoordinates; + null !== $customMetadata && $obj['customMetadata'] = $customMetadata; + null !== $description && $obj['description'] = $description; + null !== $fileId && $obj['fileId'] = $fileId; + null !== $filePath && $obj['filePath'] = $filePath; + null !== $fileType && $obj['fileType'] = $fileType; + null !== $hasAlpha && $obj['hasAlpha'] = $hasAlpha; + null !== $height && $obj['height'] = $height; + null !== $isPrivateFile && $obj['isPrivateFile'] = $isPrivateFile; + null !== $isPublished && $obj['isPublished'] = $isPublished; + null !== $mime && $obj['mime'] = $mime; + null !== $name && $obj['name'] = $name; + null !== $selectedFieldsSchema && $obj['selectedFieldsSchema'] = $selectedFieldsSchema; + null !== $size && $obj['size'] = $size; + null !== $tags && $obj['tags'] = $tags; + null !== $thumbnail && $obj['thumbnail'] = $thumbnail; null !== $type && $obj['type'] = $type; - null !== $updatedAt && $obj->updatedAt = $updatedAt; - null !== $url && $obj->url = $url; - null !== $versionInfo && $obj->versionInfo = $versionInfo; - null !== $width && $obj->width = $width; - null !== $extensionStatus && $obj->extensionStatus = $extensionStatus; + null !== $updatedAt && $obj['updatedAt'] = $updatedAt; + null !== $url && $obj['url'] = $url; + null !== $versionInfo && $obj['versionInfo'] = $versionInfo; + null !== $width && $obj['width'] = $width; + null !== $extensionStatus && $obj['extensionStatus'] = $extensionStatus; return $obj; } @@ -282,12 +306,14 @@ public static function with( /** * An array of tags assigned to the file by auto tagging. * - * @param list|null $aiTags + * @param list|null $aiTags */ public function withAITags(?array $aiTags): self { $obj = clone $this; - $obj->AITags = $aiTags; + $obj['AITags'] = $aiTags; return $obj; } @@ -298,7 +324,7 @@ public function withAITags(?array $aiTags): self public function withCreatedAt(\DateTimeInterface $createdAt): self { $obj = clone $this; - $obj->createdAt = $createdAt; + $obj['createdAt'] = $createdAt; return $obj; } @@ -309,7 +335,7 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self public function withCustomCoordinates(?string $customCoordinates): self { $obj = clone $this; - $obj->customCoordinates = $customCoordinates; + $obj['customCoordinates'] = $customCoordinates; return $obj; } @@ -322,7 +348,7 @@ public function withCustomCoordinates(?string $customCoordinates): self public function withCustomMetadata(array $customMetadata): self { $obj = clone $this; - $obj->customMetadata = $customMetadata; + $obj['customMetadata'] = $customMetadata; return $obj; } @@ -333,7 +359,7 @@ public function withCustomMetadata(array $customMetadata): self public function withDescription(string $description): self { $obj = clone $this; - $obj->description = $description; + $obj['description'] = $description; return $obj; } @@ -344,7 +370,7 @@ public function withDescription(string $description): self public function withFileID(string $fileID): self { $obj = clone $this; - $obj->fileId = $fileID; + $obj['fileId'] = $fileID; return $obj; } @@ -355,7 +381,7 @@ public function withFileID(string $fileID): self public function withFilePath(string $filePath): self { $obj = clone $this; - $obj->filePath = $filePath; + $obj['filePath'] = $filePath; return $obj; } @@ -366,7 +392,7 @@ public function withFilePath(string $filePath): self public function withFileType(string $fileType): self { $obj = clone $this; - $obj->fileType = $fileType; + $obj['fileType'] = $fileType; return $obj; } @@ -377,7 +403,7 @@ public function withFileType(string $fileType): self public function withHasAlpha(bool $hasAlpha): self { $obj = clone $this; - $obj->hasAlpha = $hasAlpha; + $obj['hasAlpha'] = $hasAlpha; return $obj; } @@ -388,7 +414,7 @@ public function withHasAlpha(bool $hasAlpha): self public function withHeight(float $height): self { $obj = clone $this; - $obj->height = $height; + $obj['height'] = $height; return $obj; } @@ -399,7 +425,7 @@ public function withHeight(float $height): self public function withIsPrivateFile(bool $isPrivateFile): self { $obj = clone $this; - $obj->isPrivateFile = $isPrivateFile; + $obj['isPrivateFile'] = $isPrivateFile; return $obj; } @@ -410,7 +436,7 @@ public function withIsPrivateFile(bool $isPrivateFile): self public function withIsPublished(bool $isPublished): self { $obj = clone $this; - $obj->isPublished = $isPublished; + $obj['isPublished'] = $isPublished; return $obj; } @@ -421,7 +447,7 @@ public function withIsPublished(bool $isPublished): self public function withMime(string $mime): self { $obj = clone $this; - $obj->mime = $mime; + $obj['mime'] = $mime; return $obj; } @@ -432,7 +458,7 @@ public function withMime(string $mime): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -444,12 +470,23 @@ public function withName(string $name): self * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @param array $selectedFieldsSchema + * @param array, + * defaultValue?: string|float|bool|list|null, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * readOnly?: bool|null, + * selectOptions?: list|null, + * selectOptionsTruncated?: bool|null, + * }> $selectedFieldsSchema */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { $obj = clone $this; - $obj->selectedFieldsSchema = $selectedFieldsSchema; + $obj['selectedFieldsSchema'] = $selectedFieldsSchema; return $obj; } @@ -460,7 +497,7 @@ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self public function withSize(float $size): self { $obj = clone $this; - $obj->size = $size; + $obj['size'] = $size; return $obj; } @@ -473,7 +510,7 @@ public function withSize(float $size): self public function withTags(?array $tags): self { $obj = clone $this; - $obj->tags = $tags; + $obj['tags'] = $tags; return $obj; } @@ -484,7 +521,7 @@ public function withTags(?array $tags): self public function withThumbnail(string $thumbnail): self { $obj = clone $this; - $obj->thumbnail = $thumbnail; + $obj['thumbnail'] = $thumbnail; return $obj; } @@ -508,7 +545,7 @@ public function withType(Type|string $type): self public function withUpdatedAt(\DateTimeInterface $updatedAt): self { $obj = clone $this; - $obj->updatedAt = $updatedAt; + $obj['updatedAt'] = $updatedAt; return $obj; } @@ -519,18 +556,20 @@ public function withUpdatedAt(\DateTimeInterface $updatedAt): self public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } /** * An object with details of the file version. + * + * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo */ - public function withVersionInfo(VersionInfo $versionInfo): self + public function withVersionInfo(VersionInfo|array $versionInfo): self { $obj = clone $this; - $obj->versionInfo = $versionInfo; + $obj['versionInfo'] = $versionInfo; return $obj; } @@ -541,15 +580,24 @@ public function withVersionInfo(VersionInfo $versionInfo): self public function withWidth(float $width): self { $obj = clone $this; - $obj->width = $width; + $obj['width'] = $width; return $obj; } - public function withExtensionStatus(ExtensionStatus $extensionStatus): self - { + /** + * @param ExtensionStatus|array{ + * ai_auto_description?: value-of|null, + * aws_auto_tagging?: value-of|null, + * google_auto_tagging?: value-of|null, + * remove_bg?: value-of|null, + * } $extensionStatus + */ + public function withExtensionStatus( + ExtensionStatus|array $extensionStatus + ): self { $obj = clone $this; - $obj->extensionStatus = $extensionStatus; + $obj['extensionStatus'] = $extensionStatus; return $obj; } diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index c32eb1c6..30f342f2 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -11,9 +11,14 @@ use ImageKit\ExtensionItem; use ImageKit\ExtensionItem\AIAutoDescription; use ImageKit\ExtensionItem\AutoTaggingExtension; +use ImageKit\ExtensionItem\AutoTaggingExtension\Name; use ImageKit\ExtensionItem\RemoveBg; +use ImageKit\ExtensionItem\RemoveBg\Options; use ImageKit\Files\FileUploadParams\ResponseField; use ImageKit\Files\FileUploadParams\Transformation; +use ImageKit\Files\FileUploadParams\Transformation\Post\Abs; +use ImageKit\Files\FileUploadParams\Transformation\Post\GifToVideo; +use ImageKit\Files\FileUploadParams\Transformation\Post\Thumbnail; /** * ImageKit.io allows you to upload files directly from both the server and client sides. For server-side uploads, private API key authentication is used. For client-side uploads, generate a one-time `token`, `signature`, and `expire` from your secure backend using private API. [Learn more](/docs/api-reference/upload-file/upload-file#how-to-implement-client-side-file-upload) about how to implement client-side file upload. @@ -42,7 +47,11 @@ * customMetadata?: array, * description?: string, * expire?: int, - * extensions?: list, + * extensions?: list + * }|AIAutoDescription|array{name: 'ai-auto-description'}>, * folder?: string, * isPrivateFile?: bool, * isPublished?: bool, @@ -54,7 +63,10 @@ * responseFields?: list>, * signature?: string, * tags?: list, - * transformation?: Transformation, + * transformation?: Transformation|array{ + * post?: list<\ImageKit\Files\FileUploadParams\Transformation\Post\Transformation|GifToVideo|Thumbnail|Abs>|null, + * pre?: string|null, + * }, * useUniqueFileName?: bool, * webhookUrl?: string, * } @@ -284,9 +296,17 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param array $customMetadata - * @param list $extensions + * @param list + * }|AIAutoDescription|array{name: 'ai-auto-description'}> $extensions * @param list> $responseFields * @param list $tags + * @param Transformation|array{ + * post?: list|null, + * pre?: string|null, + * } $transformation */ public static function with( string $file, @@ -309,36 +329,36 @@ public static function with( ?array $responseFields = null, ?string $signature = null, ?array $tags = null, - ?Transformation $transformation = null, + Transformation|array|null $transformation = null, ?bool $useUniqueFileName = null, ?string $webhookUrl = null, ): self { $obj = new self; - $obj->file = $file; - $obj->fileName = $fileName; - - null !== $token && $obj->token = $token; - null !== $checks && $obj->checks = $checks; - null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; - null !== $customMetadata && $obj->customMetadata = $customMetadata; - null !== $description && $obj->description = $description; - null !== $expire && $obj->expire = $expire; - null !== $extensions && $obj->extensions = $extensions; - null !== $folder && $obj->folder = $folder; - null !== $isPrivateFile && $obj->isPrivateFile = $isPrivateFile; - null !== $isPublished && $obj->isPublished = $isPublished; - null !== $overwriteAITags && $obj->overwriteAITags = $overwriteAITags; - null !== $overwriteCustomMetadata && $obj->overwriteCustomMetadata = $overwriteCustomMetadata; - null !== $overwriteFile && $obj->overwriteFile = $overwriteFile; - null !== $overwriteTags && $obj->overwriteTags = $overwriteTags; - null !== $publicKey && $obj->publicKey = $publicKey; + $obj['file'] = $file; + $obj['fileName'] = $fileName; + + null !== $token && $obj['token'] = $token; + null !== $checks && $obj['checks'] = $checks; + null !== $customCoordinates && $obj['customCoordinates'] = $customCoordinates; + null !== $customMetadata && $obj['customMetadata'] = $customMetadata; + null !== $description && $obj['description'] = $description; + null !== $expire && $obj['expire'] = $expire; + null !== $extensions && $obj['extensions'] = $extensions; + null !== $folder && $obj['folder'] = $folder; + null !== $isPrivateFile && $obj['isPrivateFile'] = $isPrivateFile; + null !== $isPublished && $obj['isPublished'] = $isPublished; + null !== $overwriteAITags && $obj['overwriteAITags'] = $overwriteAITags; + null !== $overwriteCustomMetadata && $obj['overwriteCustomMetadata'] = $overwriteCustomMetadata; + null !== $overwriteFile && $obj['overwriteFile'] = $overwriteFile; + null !== $overwriteTags && $obj['overwriteTags'] = $overwriteTags; + null !== $publicKey && $obj['publicKey'] = $publicKey; null !== $responseFields && $obj['responseFields'] = $responseFields; - null !== $signature && $obj->signature = $signature; - null !== $tags && $obj->tags = $tags; - null !== $transformation && $obj->transformation = $transformation; - null !== $useUniqueFileName && $obj->useUniqueFileName = $useUniqueFileName; - null !== $webhookUrl && $obj->webhookUrl = $webhookUrl; + null !== $signature && $obj['signature'] = $signature; + null !== $tags && $obj['tags'] = $tags; + null !== $transformation && $obj['transformation'] = $transformation; + null !== $useUniqueFileName && $obj['useUniqueFileName'] = $useUniqueFileName; + null !== $webhookUrl && $obj['webhookUrl'] = $webhookUrl; return $obj; } @@ -355,7 +375,7 @@ public static function with( public function withFile(string $file): self { $obj = clone $this; - $obj->file = $file; + $obj['file'] = $file; return $obj; } @@ -372,7 +392,7 @@ public function withFile(string $file): self public function withFileName(string $fileName): self { $obj = clone $this; - $obj->fileName = $fileName; + $obj['fileName'] = $fileName; return $obj; } @@ -385,7 +405,7 @@ public function withFileName(string $fileName): self public function withToken(string $token): self { $obj = clone $this; - $obj->token = $token; + $obj['token'] = $token; return $obj; } @@ -397,7 +417,7 @@ public function withToken(string $token): self public function withChecks(string $checks): self { $obj = clone $this; - $obj->checks = $checks; + $obj['checks'] = $checks; return $obj; } @@ -412,7 +432,7 @@ public function withChecks(string $checks): self public function withCustomCoordinates(string $customCoordinates): self { $obj = clone $this; - $obj->customCoordinates = $customCoordinates; + $obj['customCoordinates'] = $customCoordinates; return $obj; } @@ -425,7 +445,7 @@ public function withCustomCoordinates(string $customCoordinates): self public function withCustomMetadata(array $customMetadata): self { $obj = clone $this; - $obj->customMetadata = $customMetadata; + $obj['customMetadata'] = $customMetadata; return $obj; } @@ -436,7 +456,7 @@ public function withCustomMetadata(array $customMetadata): self public function withDescription(string $description): self { $obj = clone $this; - $obj->description = $description; + $obj['description'] = $description; return $obj; } @@ -447,7 +467,7 @@ public function withDescription(string $description): self public function withExpire(int $expire): self { $obj = clone $this; - $obj->expire = $expire; + $obj['expire'] = $expire; return $obj; } @@ -455,12 +475,16 @@ public function withExpire(int $expire): self /** * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * - * @param list $extensions + * @param list + * }|AIAutoDescription|array{name: 'ai-auto-description'}> $extensions */ public function withExtensions(array $extensions): self { $obj = clone $this; - $obj->extensions = $extensions; + $obj['extensions'] = $extensions; return $obj; } @@ -478,7 +502,7 @@ public function withExtensions(array $extensions): self public function withFolder(string $folder): self { $obj = clone $this; - $obj->folder = $folder; + $obj['folder'] = $folder; return $obj; } @@ -491,7 +515,7 @@ public function withFolder(string $folder): self public function withIsPrivateFile(bool $isPrivateFile): self { $obj = clone $this; - $obj->isPrivateFile = $isPrivateFile; + $obj['isPrivateFile'] = $isPrivateFile; return $obj; } @@ -506,7 +530,7 @@ public function withIsPrivateFile(bool $isPrivateFile): self public function withIsPublished(bool $isPublished): self { $obj = clone $this; - $obj->isPublished = $isPublished; + $obj['isPublished'] = $isPublished; return $obj; } @@ -517,7 +541,7 @@ public function withIsPublished(bool $isPublished): self public function withOverwriteAITags(bool $overwriteAITags): self { $obj = clone $this; - $obj->overwriteAITags = $overwriteAITags; + $obj['overwriteAITags'] = $overwriteAITags; return $obj; } @@ -529,7 +553,7 @@ public function withOverwriteCustomMetadata( bool $overwriteCustomMetadata ): self { $obj = clone $this; - $obj->overwriteCustomMetadata = $overwriteCustomMetadata; + $obj['overwriteCustomMetadata'] = $overwriteCustomMetadata; return $obj; } @@ -540,7 +564,7 @@ public function withOverwriteCustomMetadata( public function withOverwriteFile(bool $overwriteFile): self { $obj = clone $this; - $obj->overwriteFile = $overwriteFile; + $obj['overwriteFile'] = $overwriteFile; return $obj; } @@ -551,7 +575,7 @@ public function withOverwriteFile(bool $overwriteFile): self public function withOverwriteTags(bool $overwriteTags): self { $obj = clone $this; - $obj->overwriteTags = $overwriteTags; + $obj['overwriteTags'] = $overwriteTags; return $obj; } @@ -562,7 +586,7 @@ public function withOverwriteTags(bool $overwriteTags): self public function withPublicKey(string $publicKey): self { $obj = clone $this; - $obj->publicKey = $publicKey; + $obj['publicKey'] = $publicKey; return $obj; } @@ -588,7 +612,7 @@ public function withResponseFields(array $responseFields): self public function withSignature(string $signature): self { $obj = clone $this; - $obj->signature = $signature; + $obj['signature'] = $signature; return $obj; } @@ -603,7 +627,7 @@ public function withSignature(string $signature): self public function withTags(array $tags): self { $obj = clone $this; - $obj->tags = $tags; + $obj['tags'] = $tags; return $obj; } @@ -618,11 +642,17 @@ public function withTags(array $tags): self * Ideal for generating transformed versions (like video encodes or thumbnails) in advance, so they're ready for delivery without delay. * * You can mix and match any combination of post-processing types. + * + * @param Transformation|array{ + * post?: list|null, + * pre?: string|null, + * } $transformation */ - public function withTransformation(Transformation $transformation): self - { + public function withTransformation( + Transformation|array $transformation + ): self { $obj = clone $this; - $obj->transformation = $transformation; + $obj['transformation'] = $transformation; return $obj; } @@ -637,7 +667,7 @@ public function withTransformation(Transformation $transformation): self public function withUseUniqueFileName(bool $useUniqueFileName): self { $obj = clone $this; - $obj->useUniqueFileName = $useUniqueFileName; + $obj['useUniqueFileName'] = $useUniqueFileName; return $obj; } @@ -648,7 +678,7 @@ public function withUseUniqueFileName(bool $useUniqueFileName): self public function withWebhookURL(string $webhookURL): self { $obj = clone $this; - $obj->webhookUrl = $webhookURL; + $obj['webhookUrl'] = $webhookURL; return $obj; } diff --git a/src/Files/FileUploadParams/Transformation.php b/src/Files/FileUploadParams/Transformation.php index 97b6cdc5..05f482c9 100644 --- a/src/Files/FileUploadParams/Transformation.php +++ b/src/Files/FileUploadParams/Transformation.php @@ -9,6 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; use ImageKit\Files\FileUploadParams\Transformation\Post; use ImageKit\Files\FileUploadParams\Transformation\Post\Abs; +use ImageKit\Files\FileUploadParams\Transformation\Post\Abs\Protocol; use ImageKit\Files\FileUploadParams\Transformation\Post\GifToVideo; use ImageKit\Files\FileUploadParams\Transformation\Post\Thumbnail; @@ -59,14 +60,18 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $post + * @param list, type: 'abs', value: string}> $post */ public static function with(?array $post = null, ?string $pre = null): self { $obj = new self; - null !== $post && $obj->post = $post; - null !== $pre && $obj->pre = $pre; + null !== $post && $obj['post'] = $post; + null !== $pre && $obj['pre'] = $pre; return $obj; } @@ -76,12 +81,16 @@ public static function with(?array $post = null, ?string $pre = null): self * Each item must match one of the following types: * `transformation`, `gif-to-video`, `thumbnail`, `abs`. * - * @param list $post + * @param list, type: 'abs', value: string}> $post */ public function withPost(array $post): self { $obj = clone $this; - $obj->post = $post; + $obj['post'] = $post; return $obj; } @@ -92,7 +101,7 @@ public function withPost(array $post): self public function withPre(string $pre): self { $obj = clone $this; - $obj->pre = $pre; + $obj['pre'] = $pre; return $obj; } diff --git a/src/Files/FileUploadParams/Transformation/Post/Abs.php b/src/Files/FileUploadParams/Transformation/Post/Abs.php index 66e47a43..f2e325fa 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Abs.php +++ b/src/Files/FileUploadParams/Transformation/Post/Abs.php @@ -72,7 +72,7 @@ public static function with(Protocol|string $protocol, string $value): self $obj = new self; $obj['protocol'] = $protocol; - $obj->value = $value; + $obj['value'] = $value; return $obj; } @@ -96,7 +96,7 @@ public function withProtocol(Protocol|string $protocol): self public function withValue(string $value): self { $obj = clone $this; - $obj->value = $value; + $obj['value'] = $value; return $obj; } diff --git a/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php b/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php index 02cd1e14..42df6e9c 100644 --- a/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php +++ b/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php @@ -45,7 +45,7 @@ public static function with(?string $value = null): self { $obj = new self; - null !== $value && $obj->value = $value; + null !== $value && $obj['value'] = $value; return $obj; } @@ -57,7 +57,7 @@ public static function with(?string $value = null): self public function withValue(string $value): self { $obj = clone $this; - $obj->value = $value; + $obj['value'] = $value; return $obj; } diff --git a/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php b/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php index 7d1d1cb2..86665fbd 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php +++ b/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php @@ -45,7 +45,7 @@ public static function with(?string $value = null): self { $obj = new self; - null !== $value && $obj->value = $value; + null !== $value && $obj['value'] = $value; return $obj; } @@ -57,7 +57,7 @@ public static function with(?string $value = null): self public function withValue(string $value): self { $obj = clone $this; - $obj->value = $value; + $obj['value'] = $value; return $obj; } diff --git a/src/Files/FileUploadParams/Transformation/Post/Transformation.php b/src/Files/FileUploadParams/Transformation/Post/Transformation.php index 299dd06c..3baf5a9d 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Transformation.php +++ b/src/Files/FileUploadParams/Transformation/Post/Transformation.php @@ -59,7 +59,7 @@ public static function with(string $value): self { $obj = new self; - $obj->value = $value; + $obj['value'] = $value; return $obj; } @@ -71,7 +71,7 @@ public static function with(string $value): self public function withValue(string $value): self { $obj = clone $this; - $obj->value = $value; + $obj['value'] = $value; return $obj; } diff --git a/src/Files/FileUploadResponse.php b/src/Files/FileUploadResponse.php index f76727b1..e909d2d8 100644 --- a/src/Files/FileUploadResponse.php +++ b/src/Files/FileUploadResponse.php @@ -11,8 +11,14 @@ use ImageKit\Core\Conversion\Contracts\ResponseConverter; use ImageKit\Files\FileUploadResponse\AITag; use ImageKit\Files\FileUploadResponse\ExtensionStatus; +use ImageKit\Files\FileUploadResponse\ExtensionStatus\AIAutoDescription; +use ImageKit\Files\FileUploadResponse\ExtensionStatus\AwsAutoTagging; +use ImageKit\Files\FileUploadResponse\ExtensionStatus\GoogleAutoTagging; +use ImageKit\Files\FileUploadResponse\ExtensionStatus\RemoveBg; use ImageKit\Files\FileUploadResponse\SelectedFieldsSchema; +use ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\Type; use ImageKit\Files\FileUploadResponse\VersionInfo; +use ImageKit\Files\Metadata\Exif; /** * Object containing details of a successful upload. @@ -232,11 +238,47 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list|null $AITags + * @param list|null $AITags * @param array $customMetadata * @param array $embeddedMetadata - * @param array $selectedFieldsSchema + * @param ExtensionStatus|array{ + * ai_auto_description?: value-of|null, + * aws_auto_tagging?: value-of|null, + * google_auto_tagging?: value-of|null, + * remove_bg?: value-of|null, + * } $extensionStatus + * @param Metadata|array{ + * audioCodec?: string|null, + * bitRate?: int|null, + * density?: int|null, + * duration?: int|null, + * exif?: Exif|null, + * format?: string|null, + * hasColorProfile?: bool|null, + * hasTransparency?: bool|null, + * height?: int|null, + * pHash?: string|null, + * quality?: int|null, + * size?: int|null, + * videoCodec?: string|null, + * width?: int|null, + * } $metadata + * @param array, + * defaultValue?: string|float|bool|list|null, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * readOnly?: bool|null, + * selectOptions?: list|null, + * selectOptionsTruncated?: bool|null, + * }> $selectedFieldsSchema * @param list|null $tags + * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo */ public static function with( ?array $AITags = null, @@ -247,51 +289,51 @@ public static function with( ?string $description = null, ?int $duration = null, ?array $embeddedMetadata = null, - ?ExtensionStatus $extensionStatus = null, + ExtensionStatus|array|null $extensionStatus = null, ?string $fileId = null, ?string $filePath = null, ?string $fileType = null, ?float $height = null, ?bool $isPrivateFile = null, ?bool $isPublished = null, - ?Metadata $metadata = null, + Metadata|array|null $metadata = null, ?string $name = null, ?array $selectedFieldsSchema = null, ?float $size = null, ?array $tags = null, ?string $thumbnailUrl = null, ?string $url = null, - ?VersionInfo $versionInfo = null, + VersionInfo|array|null $versionInfo = null, ?string $videoCodec = null, ?float $width = null, ): self { $obj = new self; - null !== $AITags && $obj->AITags = $AITags; - null !== $audioCodec && $obj->audioCodec = $audioCodec; - null !== $bitRate && $obj->bitRate = $bitRate; - null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; - null !== $customMetadata && $obj->customMetadata = $customMetadata; - null !== $description && $obj->description = $description; - null !== $duration && $obj->duration = $duration; - null !== $embeddedMetadata && $obj->embeddedMetadata = $embeddedMetadata; - null !== $extensionStatus && $obj->extensionStatus = $extensionStatus; - null !== $fileId && $obj->fileId = $fileId; - null !== $filePath && $obj->filePath = $filePath; - null !== $fileType && $obj->fileType = $fileType; - null !== $height && $obj->height = $height; - null !== $isPrivateFile && $obj->isPrivateFile = $isPrivateFile; - null !== $isPublished && $obj->isPublished = $isPublished; - null !== $metadata && $obj->metadata = $metadata; - null !== $name && $obj->name = $name; - null !== $selectedFieldsSchema && $obj->selectedFieldsSchema = $selectedFieldsSchema; - null !== $size && $obj->size = $size; - null !== $tags && $obj->tags = $tags; - null !== $thumbnailUrl && $obj->thumbnailUrl = $thumbnailUrl; - null !== $url && $obj->url = $url; - null !== $versionInfo && $obj->versionInfo = $versionInfo; - null !== $videoCodec && $obj->videoCodec = $videoCodec; - null !== $width && $obj->width = $width; + null !== $AITags && $obj['AITags'] = $AITags; + null !== $audioCodec && $obj['audioCodec'] = $audioCodec; + null !== $bitRate && $obj['bitRate'] = $bitRate; + null !== $customCoordinates && $obj['customCoordinates'] = $customCoordinates; + null !== $customMetadata && $obj['customMetadata'] = $customMetadata; + null !== $description && $obj['description'] = $description; + null !== $duration && $obj['duration'] = $duration; + null !== $embeddedMetadata && $obj['embeddedMetadata'] = $embeddedMetadata; + null !== $extensionStatus && $obj['extensionStatus'] = $extensionStatus; + null !== $fileId && $obj['fileId'] = $fileId; + null !== $filePath && $obj['filePath'] = $filePath; + null !== $fileType && $obj['fileType'] = $fileType; + null !== $height && $obj['height'] = $height; + null !== $isPrivateFile && $obj['isPrivateFile'] = $isPrivateFile; + null !== $isPublished && $obj['isPublished'] = $isPublished; + null !== $metadata && $obj['metadata'] = $metadata; + null !== $name && $obj['name'] = $name; + null !== $selectedFieldsSchema && $obj['selectedFieldsSchema'] = $selectedFieldsSchema; + null !== $size && $obj['size'] = $size; + null !== $tags && $obj['tags'] = $tags; + null !== $thumbnailUrl && $obj['thumbnailUrl'] = $thumbnailUrl; + null !== $url && $obj['url'] = $url; + null !== $versionInfo && $obj['versionInfo'] = $versionInfo; + null !== $videoCodec && $obj['videoCodec'] = $videoCodec; + null !== $width && $obj['width'] = $width; return $obj; } @@ -299,12 +341,14 @@ public static function with( /** * An array of tags assigned to the uploaded file by auto tagging. * - * @param list|null $aiTags + * @param list|null $aiTags */ public function withAITags(?array $aiTags): self { $obj = clone $this; - $obj->AITags = $aiTags; + $obj['AITags'] = $aiTags; return $obj; } @@ -315,7 +359,7 @@ public function withAITags(?array $aiTags): self public function withAudioCodec(string $audioCodec): self { $obj = clone $this; - $obj->audioCodec = $audioCodec; + $obj['audioCodec'] = $audioCodec; return $obj; } @@ -326,7 +370,7 @@ public function withAudioCodec(string $audioCodec): self public function withBitRate(int $bitRate): self { $obj = clone $this; - $obj->bitRate = $bitRate; + $obj['bitRate'] = $bitRate; return $obj; } @@ -337,7 +381,7 @@ public function withBitRate(int $bitRate): self public function withCustomCoordinates(?string $customCoordinates): self { $obj = clone $this; - $obj->customCoordinates = $customCoordinates; + $obj['customCoordinates'] = $customCoordinates; return $obj; } @@ -350,7 +394,7 @@ public function withCustomCoordinates(?string $customCoordinates): self public function withCustomMetadata(array $customMetadata): self { $obj = clone $this; - $obj->customMetadata = $customMetadata; + $obj['customMetadata'] = $customMetadata; return $obj; } @@ -361,7 +405,7 @@ public function withCustomMetadata(array $customMetadata): self public function withDescription(string $description): self { $obj = clone $this; - $obj->description = $description; + $obj['description'] = $description; return $obj; } @@ -372,7 +416,7 @@ public function withDescription(string $description): self public function withDuration(int $duration): self { $obj = clone $this; - $obj->duration = $duration; + $obj['duration'] = $duration; return $obj; } @@ -385,7 +429,7 @@ public function withDuration(int $duration): self public function withEmbeddedMetadata(array $embeddedMetadata): self { $obj = clone $this; - $obj->embeddedMetadata = $embeddedMetadata; + $obj['embeddedMetadata'] = $embeddedMetadata; return $obj; } @@ -398,11 +442,19 @@ public function withEmbeddedMetadata(array $embeddedMetadata): self * `pending`: The extension will finish processing in some time. On completion, the final status (success / failed) will be sent to the `webhookUrl` provided. * * If no extension was requested, then this parameter is not returned. - */ - public function withExtensionStatus(ExtensionStatus $extensionStatus): self - { + * + * @param ExtensionStatus|array{ + * ai_auto_description?: value-of|null, + * aws_auto_tagging?: value-of|null, + * google_auto_tagging?: value-of|null, + * remove_bg?: value-of|null, + * } $extensionStatus + */ + public function withExtensionStatus( + ExtensionStatus|array $extensionStatus + ): self { $obj = clone $this; - $obj->extensionStatus = $extensionStatus; + $obj['extensionStatus'] = $extensionStatus; return $obj; } @@ -413,7 +465,7 @@ public function withExtensionStatus(ExtensionStatus $extensionStatus): self public function withFileID(string $fileID): self { $obj = clone $this; - $obj->fileId = $fileID; + $obj['fileId'] = $fileID; return $obj; } @@ -424,7 +476,7 @@ public function withFileID(string $fileID): self public function withFilePath(string $filePath): self { $obj = clone $this; - $obj->filePath = $filePath; + $obj['filePath'] = $filePath; return $obj; } @@ -435,7 +487,7 @@ public function withFilePath(string $filePath): self public function withFileType(string $fileType): self { $obj = clone $this; - $obj->fileType = $fileType; + $obj['fileType'] = $fileType; return $obj; } @@ -446,7 +498,7 @@ public function withFileType(string $fileType): self public function withHeight(float $height): self { $obj = clone $this; - $obj->height = $height; + $obj['height'] = $height; return $obj; } @@ -457,7 +509,7 @@ public function withHeight(float $height): self public function withIsPrivateFile(bool $isPrivateFile): self { $obj = clone $this; - $obj->isPrivateFile = $isPrivateFile; + $obj['isPrivateFile'] = $isPrivateFile; return $obj; } @@ -468,18 +520,35 @@ public function withIsPrivateFile(bool $isPrivateFile): self public function withIsPublished(bool $isPublished): self { $obj = clone $this; - $obj->isPublished = $isPublished; + $obj['isPublished'] = $isPublished; return $obj; } /** * Legacy metadata. Send `metadata` in `responseFields` in API request to get metadata in the upload API response. - */ - public function withMetadata(Metadata $metadata): self + * + * @param Metadata|array{ + * audioCodec?: string|null, + * bitRate?: int|null, + * density?: int|null, + * duration?: int|null, + * exif?: Exif|null, + * format?: string|null, + * hasColorProfile?: bool|null, + * hasTransparency?: bool|null, + * height?: int|null, + * pHash?: string|null, + * quality?: int|null, + * size?: int|null, + * videoCodec?: string|null, + * width?: int|null, + * } $metadata + */ + public function withMetadata(Metadata|array $metadata): self { $obj = clone $this; - $obj->metadata = $metadata; + $obj['metadata'] = $metadata; return $obj; } @@ -490,7 +559,7 @@ public function withMetadata(Metadata $metadata): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -502,12 +571,23 @@ public function withName(string $name): self * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @param array $selectedFieldsSchema + * @param array, + * defaultValue?: string|float|bool|list|null, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * readOnly?: bool|null, + * selectOptions?: list|null, + * selectOptionsTruncated?: bool|null, + * }> $selectedFieldsSchema */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { $obj = clone $this; - $obj->selectedFieldsSchema = $selectedFieldsSchema; + $obj['selectedFieldsSchema'] = $selectedFieldsSchema; return $obj; } @@ -518,7 +598,7 @@ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self public function withSize(float $size): self { $obj = clone $this; - $obj->size = $size; + $obj['size'] = $size; return $obj; } @@ -531,7 +611,7 @@ public function withSize(float $size): self public function withTags(?array $tags): self { $obj = clone $this; - $obj->tags = $tags; + $obj['tags'] = $tags; return $obj; } @@ -542,7 +622,7 @@ public function withTags(?array $tags): self public function withThumbnailURL(string $thumbnailURL): self { $obj = clone $this; - $obj->thumbnailUrl = $thumbnailURL; + $obj['thumbnailUrl'] = $thumbnailURL; return $obj; } @@ -553,18 +633,20 @@ public function withThumbnailURL(string $thumbnailURL): self public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } /** * An object containing the file or file version's `id` (versionId) and `name`. + * + * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo */ - public function withVersionInfo(VersionInfo $versionInfo): self + public function withVersionInfo(VersionInfo|array $versionInfo): self { $obj = clone $this; - $obj->versionInfo = $versionInfo; + $obj['versionInfo'] = $versionInfo; return $obj; } @@ -575,7 +657,7 @@ public function withVersionInfo(VersionInfo $versionInfo): self public function withVideoCodec(string $videoCodec): self { $obj = clone $this; - $obj->videoCodec = $videoCodec; + $obj['videoCodec'] = $videoCodec; return $obj; } @@ -586,7 +668,7 @@ public function withVideoCodec(string $videoCodec): self public function withWidth(float $width): self { $obj = clone $this; - $obj->width = $width; + $obj['width'] = $width; return $obj; } diff --git a/src/Files/FileUploadResponse/AITag.php b/src/Files/FileUploadResponse/AITag.php index 9afb2657..6e0289cf 100644 --- a/src/Files/FileUploadResponse/AITag.php +++ b/src/Files/FileUploadResponse/AITag.php @@ -53,9 +53,9 @@ public static function with( ): self { $obj = new self; - null !== $confidence && $obj->confidence = $confidence; - null !== $name && $obj->name = $name; - null !== $source && $obj->source = $source; + null !== $confidence && $obj['confidence'] = $confidence; + null !== $name && $obj['name'] = $name; + null !== $source && $obj['source'] = $source; return $obj; } @@ -66,7 +66,7 @@ public static function with( public function withConfidence(float $confidence): self { $obj = clone $this; - $obj->confidence = $confidence; + $obj['confidence'] = $confidence; return $obj; } @@ -77,7 +77,7 @@ public function withConfidence(float $confidence): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -88,7 +88,7 @@ public function withName(string $name): self public function withSource(string $source): self { $obj = clone $this; - $obj->source = $source; + $obj['source'] = $source; return $obj; } diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema.php b/src/Files/FileUploadResponse/SelectedFieldsSchema.php index be83d169..21ccb878 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema.php @@ -140,15 +140,15 @@ public static function with( $obj['type'] = $type; - null !== $defaultValue && $obj->defaultValue = $defaultValue; - null !== $isValueRequired && $obj->isValueRequired = $isValueRequired; - null !== $maxLength && $obj->maxLength = $maxLength; - null !== $maxValue && $obj->maxValue = $maxValue; - null !== $minLength && $obj->minLength = $minLength; - null !== $minValue && $obj->minValue = $minValue; - null !== $readOnly && $obj->readOnly = $readOnly; - null !== $selectOptions && $obj->selectOptions = $selectOptions; - null !== $selectOptionsTruncated && $obj->selectOptionsTruncated = $selectOptionsTruncated; + null !== $defaultValue && $obj['defaultValue'] = $defaultValue; + null !== $isValueRequired && $obj['isValueRequired'] = $isValueRequired; + null !== $maxLength && $obj['maxLength'] = $maxLength; + null !== $maxValue && $obj['maxValue'] = $maxValue; + null !== $minLength && $obj['minLength'] = $minLength; + null !== $minValue && $obj['minValue'] = $minValue; + null !== $readOnly && $obj['readOnly'] = $readOnly; + null !== $selectOptions && $obj['selectOptions'] = $selectOptions; + null !== $selectOptionsTruncated && $obj['selectOptionsTruncated'] = $selectOptionsTruncated; return $obj; } @@ -175,7 +175,7 @@ public function withDefaultValue( string|float|bool|array $defaultValue ): self { $obj = clone $this; - $obj->defaultValue = $defaultValue; + $obj['defaultValue'] = $defaultValue; return $obj; } @@ -186,7 +186,7 @@ public function withDefaultValue( public function withIsValueRequired(bool $isValueRequired): self { $obj = clone $this; - $obj->isValueRequired = $isValueRequired; + $obj['isValueRequired'] = $isValueRequired; return $obj; } @@ -197,7 +197,7 @@ public function withIsValueRequired(bool $isValueRequired): self public function withMaxLength(float $maxLength): self { $obj = clone $this; - $obj->maxLength = $maxLength; + $obj['maxLength'] = $maxLength; return $obj; } @@ -208,7 +208,7 @@ public function withMaxLength(float $maxLength): self public function withMaxValue(string|float $maxValue): self { $obj = clone $this; - $obj->maxValue = $maxValue; + $obj['maxValue'] = $maxValue; return $obj; } @@ -219,7 +219,7 @@ public function withMaxValue(string|float $maxValue): self public function withMinLength(float $minLength): self { $obj = clone $this; - $obj->minLength = $minLength; + $obj['minLength'] = $minLength; return $obj; } @@ -230,7 +230,7 @@ public function withMinLength(float $minLength): self public function withMinValue(string|float $minValue): self { $obj = clone $this; - $obj->minValue = $minValue; + $obj['minValue'] = $minValue; return $obj; } @@ -241,7 +241,7 @@ public function withMinValue(string|float $minValue): self public function withReadOnly(bool $readOnly): self { $obj = clone $this; - $obj->readOnly = $readOnly; + $obj['readOnly'] = $readOnly; return $obj; } @@ -254,7 +254,7 @@ public function withReadOnly(bool $readOnly): self public function withSelectOptions(array $selectOptions): self { $obj = clone $this; - $obj->selectOptions = $selectOptions; + $obj['selectOptions'] = $selectOptions; return $obj; } @@ -266,7 +266,7 @@ public function withSelectOptionsTruncated( bool $selectOptionsTruncated ): self { $obj = clone $this; - $obj->selectOptionsTruncated = $selectOptionsTruncated; + $obj['selectOptionsTruncated'] = $selectOptionsTruncated; return $obj; } diff --git a/src/Files/FileUploadResponse/VersionInfo.php b/src/Files/FileUploadResponse/VersionInfo.php index 0a2540db..6ca2b25b 100644 --- a/src/Files/FileUploadResponse/VersionInfo.php +++ b/src/Files/FileUploadResponse/VersionInfo.php @@ -44,8 +44,8 @@ public static function with(?string $id = null, ?string $name = null): self { $obj = new self; - null !== $id && $obj->id = $id; - null !== $name && $obj->name = $name; + null !== $id && $obj['id'] = $id; + null !== $name && $obj['name'] = $name; return $obj; } @@ -56,7 +56,7 @@ public static function with(?string $id = null, ?string $name = null): self public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -67,7 +67,7 @@ public function withID(string $id): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } diff --git a/src/Files/Folder.php b/src/Files/Folder.php index cd32a254..78570d76 100644 --- a/src/Files/Folder.php +++ b/src/Files/Folder.php @@ -84,12 +84,12 @@ public static function with( ): self { $obj = new self; - null !== $createdAt && $obj->createdAt = $createdAt; - null !== $folderId && $obj->folderId = $folderId; - null !== $folderPath && $obj->folderPath = $folderPath; - null !== $name && $obj->name = $name; + null !== $createdAt && $obj['createdAt'] = $createdAt; + null !== $folderId && $obj['folderId'] = $folderId; + null !== $folderPath && $obj['folderPath'] = $folderPath; + null !== $name && $obj['name'] = $name; null !== $type && $obj['type'] = $type; - null !== $updatedAt && $obj->updatedAt = $updatedAt; + null !== $updatedAt && $obj['updatedAt'] = $updatedAt; return $obj; } @@ -100,7 +100,7 @@ public static function with( public function withCreatedAt(\DateTimeInterface $createdAt): self { $obj = clone $this; - $obj->createdAt = $createdAt; + $obj['createdAt'] = $createdAt; return $obj; } @@ -111,7 +111,7 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self public function withFolderID(string $folderID): self { $obj = clone $this; - $obj->folderId = $folderID; + $obj['folderId'] = $folderID; return $obj; } @@ -122,7 +122,7 @@ public function withFolderID(string $folderID): self public function withFolderPath(string $folderPath): self { $obj = clone $this; - $obj->folderPath = $folderPath; + $obj['folderPath'] = $folderPath; return $obj; } @@ -133,7 +133,7 @@ public function withFolderPath(string $folderPath): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -157,7 +157,7 @@ public function withType(Type|string $type): self public function withUpdatedAt(\DateTimeInterface $updatedAt): self { $obj = clone $this; - $obj->updatedAt = $updatedAt; + $obj['updatedAt'] = $updatedAt; return $obj; } diff --git a/src/Files/Metadata.php b/src/Files/Metadata.php index 462c13ea..f9bfa73b 100644 --- a/src/Files/Metadata.php +++ b/src/Files/Metadata.php @@ -8,6 +8,10 @@ use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; use ImageKit\Files\Metadata\Exif; +use ImageKit\Files\Metadata\Exif\Gps; +use ImageKit\Files\Metadata\Exif\Image; +use ImageKit\Files\Metadata\Exif\Interoperability; +use ImageKit\Files\Metadata\Exif\Thumbnail; /** * JSON object containing metadata. @@ -124,13 +128,22 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Exif|array{ + * exif?: Exif\Exif|null, + * gps?: Gps|null, + * image?: Image|null, + * interoperability?: Interoperability|null, + * makernote?: array|null, + * thumbnail?: Thumbnail|null, + * } $exif */ public static function with( ?string $audioCodec = null, ?int $bitRate = null, ?int $density = null, ?int $duration = null, - ?Exif $exif = null, + Exif|array|null $exif = null, ?string $format = null, ?bool $hasColorProfile = null, ?bool $hasTransparency = null, @@ -143,20 +156,20 @@ public static function with( ): self { $obj = new self; - null !== $audioCodec && $obj->audioCodec = $audioCodec; - null !== $bitRate && $obj->bitRate = $bitRate; - null !== $density && $obj->density = $density; - null !== $duration && $obj->duration = $duration; - null !== $exif && $obj->exif = $exif; - null !== $format && $obj->format = $format; - null !== $hasColorProfile && $obj->hasColorProfile = $hasColorProfile; - null !== $hasTransparency && $obj->hasTransparency = $hasTransparency; - null !== $height && $obj->height = $height; - null !== $pHash && $obj->pHash = $pHash; - null !== $quality && $obj->quality = $quality; - null !== $size && $obj->size = $size; - null !== $videoCodec && $obj->videoCodec = $videoCodec; - null !== $width && $obj->width = $width; + null !== $audioCodec && $obj['audioCodec'] = $audioCodec; + null !== $bitRate && $obj['bitRate'] = $bitRate; + null !== $density && $obj['density'] = $density; + null !== $duration && $obj['duration'] = $duration; + null !== $exif && $obj['exif'] = $exif; + null !== $format && $obj['format'] = $format; + null !== $hasColorProfile && $obj['hasColorProfile'] = $hasColorProfile; + null !== $hasTransparency && $obj['hasTransparency'] = $hasTransparency; + null !== $height && $obj['height'] = $height; + null !== $pHash && $obj['pHash'] = $pHash; + null !== $quality && $obj['quality'] = $quality; + null !== $size && $obj['size'] = $size; + null !== $videoCodec && $obj['videoCodec'] = $videoCodec; + null !== $width && $obj['width'] = $width; return $obj; } @@ -167,7 +180,7 @@ public static function with( public function withAudioCodec(string $audioCodec): self { $obj = clone $this; - $obj->audioCodec = $audioCodec; + $obj['audioCodec'] = $audioCodec; return $obj; } @@ -178,7 +191,7 @@ public function withAudioCodec(string $audioCodec): self public function withBitRate(int $bitRate): self { $obj = clone $this; - $obj->bitRate = $bitRate; + $obj['bitRate'] = $bitRate; return $obj; } @@ -189,7 +202,7 @@ public function withBitRate(int $bitRate): self public function withDensity(int $density): self { $obj = clone $this; - $obj->density = $density; + $obj['density'] = $density; return $obj; } @@ -200,15 +213,25 @@ public function withDensity(int $density): self public function withDuration(int $duration): self { $obj = clone $this; - $obj->duration = $duration; + $obj['duration'] = $duration; return $obj; } - public function withExif(Exif $exif): self + /** + * @param Exif|array{ + * exif?: Exif\Exif|null, + * gps?: Gps|null, + * image?: Image|null, + * interoperability?: Interoperability|null, + * makernote?: array|null, + * thumbnail?: Thumbnail|null, + * } $exif + */ + public function withExif(Exif|array $exif): self { $obj = clone $this; - $obj->exif = $exif; + $obj['exif'] = $exif; return $obj; } @@ -219,7 +242,7 @@ public function withExif(Exif $exif): self public function withFormat(string $format): self { $obj = clone $this; - $obj->format = $format; + $obj['format'] = $format; return $obj; } @@ -230,7 +253,7 @@ public function withFormat(string $format): self public function withHasColorProfile(bool $hasColorProfile): self { $obj = clone $this; - $obj->hasColorProfile = $hasColorProfile; + $obj['hasColorProfile'] = $hasColorProfile; return $obj; } @@ -241,7 +264,7 @@ public function withHasColorProfile(bool $hasColorProfile): self public function withHasTransparency(bool $hasTransparency): self { $obj = clone $this; - $obj->hasTransparency = $hasTransparency; + $obj['hasTransparency'] = $hasTransparency; return $obj; } @@ -252,7 +275,7 @@ public function withHasTransparency(bool $hasTransparency): self public function withHeight(int $height): self { $obj = clone $this; - $obj->height = $height; + $obj['height'] = $height; return $obj; } @@ -263,7 +286,7 @@ public function withHeight(int $height): self public function withPHash(string $pHash): self { $obj = clone $this; - $obj->pHash = $pHash; + $obj['pHash'] = $pHash; return $obj; } @@ -274,7 +297,7 @@ public function withPHash(string $pHash): self public function withQuality(int $quality): self { $obj = clone $this; - $obj->quality = $quality; + $obj['quality'] = $quality; return $obj; } @@ -285,7 +308,7 @@ public function withQuality(int $quality): self public function withSize(int $size): self { $obj = clone $this; - $obj->size = $size; + $obj['size'] = $size; return $obj; } @@ -296,7 +319,7 @@ public function withSize(int $size): self public function withVideoCodec(string $videoCodec): self { $obj = clone $this; - $obj->videoCodec = $videoCodec; + $obj['videoCodec'] = $videoCodec; return $obj; } @@ -307,7 +330,7 @@ public function withVideoCodec(string $videoCodec): self public function withWidth(int $width): self { $obj = clone $this; - $obj->width = $width; + $obj['width'] = $width; return $obj; } diff --git a/src/Files/Metadata/Exif.php b/src/Files/Metadata/Exif.php index f55dc126..88ddd30e 100644 --- a/src/Files/Metadata/Exif.php +++ b/src/Files/Metadata/Exif.php @@ -71,69 +71,172 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * + * @param Exif\Exif|array{ + * ApertureValue?: float|null, + * ColorSpace?: int|null, + * CreateDate?: string|null, + * CustomRendered?: int|null, + * DateTimeOriginal?: string|null, + * ExifImageHeight?: int|null, + * ExifImageWidth?: int|null, + * ExifVersion?: string|null, + * ExposureCompensation?: float|null, + * ExposureMode?: int|null, + * ExposureProgram?: int|null, + * ExposureTime?: float|null, + * Flash?: int|null, + * FlashpixVersion?: string|null, + * FNumber?: float|null, + * FocalLength?: int|null, + * FocalPlaneResolutionUnit?: int|null, + * FocalPlaneXResolution?: float|null, + * FocalPlaneYResolution?: float|null, + * InteropOffset?: int|null, + * ISO?: int|null, + * MeteringMode?: int|null, + * SceneCaptureType?: int|null, + * ShutterSpeedValue?: float|null, + * SubSecTime?: string|null, + * WhiteBalance?: int|null, + * } $exif + * @param Gps|array{GPSVersionID?: list|null} $gps + * @param Image|array{ + * ExifOffset?: int|null, + * GPSInfo?: int|null, + * Make?: string|null, + * Model?: string|null, + * ModifyDate?: string|null, + * Orientation?: int|null, + * ResolutionUnit?: int|null, + * Software?: string|null, + * XResolution?: int|null, + * YCbCrPositioning?: int|null, + * YResolution?: int|null, + * } $image + * @param Interoperability|array{ + * InteropIndex?: string|null, InteropVersion?: string|null + * } $interoperability * @param array $makernote + * @param Thumbnail|array{ + * Compression?: int|null, + * ResolutionUnit?: int|null, + * ThumbnailLength?: int|null, + * ThumbnailOffset?: int|null, + * XResolution?: int|null, + * YResolution?: int|null, + * } $thumbnail */ public static function with( - ?Exif\Exif $exif = null, - ?Gps $gps = null, - ?Image $image = null, - ?Interoperability $interoperability = null, + Exif\Exif|array|null $exif = null, + Gps|array|null $gps = null, + Image|array|null $image = null, + Interoperability|array|null $interoperability = null, ?array $makernote = null, - ?Thumbnail $thumbnail = null, + Thumbnail|array|null $thumbnail = null, ): self { $obj = new self; - null !== $exif && $obj->exif = $exif; - null !== $gps && $obj->gps = $gps; - null !== $image && $obj->image = $image; - null !== $interoperability && $obj->interoperability = $interoperability; - null !== $makernote && $obj->makernote = $makernote; - null !== $thumbnail && $obj->thumbnail = $thumbnail; + null !== $exif && $obj['exif'] = $exif; + null !== $gps && $obj['gps'] = $gps; + null !== $image && $obj['image'] = $image; + null !== $interoperability && $obj['interoperability'] = $interoperability; + null !== $makernote && $obj['makernote'] = $makernote; + null !== $thumbnail && $obj['thumbnail'] = $thumbnail; return $obj; } /** * Object containing Exif details. + * + * @param Exif\Exif|array{ + * ApertureValue?: float|null, + * ColorSpace?: int|null, + * CreateDate?: string|null, + * CustomRendered?: int|null, + * DateTimeOriginal?: string|null, + * ExifImageHeight?: int|null, + * ExifImageWidth?: int|null, + * ExifVersion?: string|null, + * ExposureCompensation?: float|null, + * ExposureMode?: int|null, + * ExposureProgram?: int|null, + * ExposureTime?: float|null, + * Flash?: int|null, + * FlashpixVersion?: string|null, + * FNumber?: float|null, + * FocalLength?: int|null, + * FocalPlaneResolutionUnit?: int|null, + * FocalPlaneXResolution?: float|null, + * FocalPlaneYResolution?: float|null, + * InteropOffset?: int|null, + * ISO?: int|null, + * MeteringMode?: int|null, + * SceneCaptureType?: int|null, + * ShutterSpeedValue?: float|null, + * SubSecTime?: string|null, + * WhiteBalance?: int|null, + * } $exif */ - public function withExif(Exif\Exif $exif): self - { + public function withExif( + Exif\Exif|array $exif + ): self { $obj = clone $this; - $obj->exif = $exif; + $obj['exif'] = $exif; return $obj; } /** * Object containing GPS information. + * + * @param Gps|array{GPSVersionID?: list|null} $gps */ - public function withGps(Gps $gps): self + public function withGps(Gps|array $gps): self { $obj = clone $this; - $obj->gps = $gps; + $obj['gps'] = $gps; return $obj; } /** * Object containing EXIF image information. + * + * @param Image|array{ + * ExifOffset?: int|null, + * GPSInfo?: int|null, + * Make?: string|null, + * Model?: string|null, + * ModifyDate?: string|null, + * Orientation?: int|null, + * ResolutionUnit?: int|null, + * Software?: string|null, + * XResolution?: int|null, + * YCbCrPositioning?: int|null, + * YResolution?: int|null, + * } $image */ - public function withImage(Image $image): self + public function withImage(Image|array $image): self { $obj = clone $this; - $obj->image = $image; + $obj['image'] = $image; return $obj; } /** * JSON object. + * + * @param Interoperability|array{ + * InteropIndex?: string|null, InteropVersion?: string|null + * } $interoperability */ public function withInteroperability( - Interoperability $interoperability + Interoperability|array $interoperability ): self { $obj = clone $this; - $obj->interoperability = $interoperability; + $obj['interoperability'] = $interoperability; return $obj; } @@ -144,18 +247,27 @@ public function withInteroperability( public function withMakernote(array $makernote): self { $obj = clone $this; - $obj->makernote = $makernote; + $obj['makernote'] = $makernote; return $obj; } /** * Object containing Thumbnail information. + * + * @param Thumbnail|array{ + * Compression?: int|null, + * ResolutionUnit?: int|null, + * ThumbnailLength?: int|null, + * ThumbnailOffset?: int|null, + * XResolution?: int|null, + * YResolution?: int|null, + * } $thumbnail */ - public function withThumbnail(Thumbnail $thumbnail): self + public function withThumbnail(Thumbnail|array $thumbnail): self { $obj = clone $this; - $obj->thumbnail = $thumbnail; + $obj['thumbnail'] = $thumbnail; return $obj; } diff --git a/src/Files/Metadata/Exif/Exif.php b/src/Files/Metadata/Exif/Exif.php index bd5ba41c..4e17ff97 100644 --- a/src/Files/Metadata/Exif/Exif.php +++ b/src/Files/Metadata/Exif/Exif.php @@ -163,32 +163,32 @@ public static function with( ): self { $obj = new self; - null !== $ApertureValue && $obj->ApertureValue = $ApertureValue; - null !== $ColorSpace && $obj->ColorSpace = $ColorSpace; - null !== $CreateDate && $obj->CreateDate = $CreateDate; - null !== $CustomRendered && $obj->CustomRendered = $CustomRendered; - null !== $DateTimeOriginal && $obj->DateTimeOriginal = $DateTimeOriginal; - null !== $ExifImageHeight && $obj->ExifImageHeight = $ExifImageHeight; - null !== $ExifImageWidth && $obj->ExifImageWidth = $ExifImageWidth; - null !== $ExifVersion && $obj->ExifVersion = $ExifVersion; - null !== $ExposureCompensation && $obj->ExposureCompensation = $ExposureCompensation; - null !== $ExposureMode && $obj->ExposureMode = $ExposureMode; - null !== $ExposureProgram && $obj->ExposureProgram = $ExposureProgram; - null !== $ExposureTime && $obj->ExposureTime = $ExposureTime; - null !== $Flash && $obj->Flash = $Flash; - null !== $FlashpixVersion && $obj->FlashpixVersion = $FlashpixVersion; - null !== $FNumber && $obj->FNumber = $FNumber; - null !== $FocalLength && $obj->FocalLength = $FocalLength; - null !== $FocalPlaneResolutionUnit && $obj->FocalPlaneResolutionUnit = $FocalPlaneResolutionUnit; - null !== $FocalPlaneXResolution && $obj->FocalPlaneXResolution = $FocalPlaneXResolution; - null !== $FocalPlaneYResolution && $obj->FocalPlaneYResolution = $FocalPlaneYResolution; - null !== $InteropOffset && $obj->InteropOffset = $InteropOffset; - null !== $ISO && $obj->ISO = $ISO; - null !== $MeteringMode && $obj->MeteringMode = $MeteringMode; - null !== $SceneCaptureType && $obj->SceneCaptureType = $SceneCaptureType; - null !== $ShutterSpeedValue && $obj->ShutterSpeedValue = $ShutterSpeedValue; - null !== $SubSecTime && $obj->SubSecTime = $SubSecTime; - null !== $WhiteBalance && $obj->WhiteBalance = $WhiteBalance; + null !== $ApertureValue && $obj['ApertureValue'] = $ApertureValue; + null !== $ColorSpace && $obj['ColorSpace'] = $ColorSpace; + null !== $CreateDate && $obj['CreateDate'] = $CreateDate; + null !== $CustomRendered && $obj['CustomRendered'] = $CustomRendered; + null !== $DateTimeOriginal && $obj['DateTimeOriginal'] = $DateTimeOriginal; + null !== $ExifImageHeight && $obj['ExifImageHeight'] = $ExifImageHeight; + null !== $ExifImageWidth && $obj['ExifImageWidth'] = $ExifImageWidth; + null !== $ExifVersion && $obj['ExifVersion'] = $ExifVersion; + null !== $ExposureCompensation && $obj['ExposureCompensation'] = $ExposureCompensation; + null !== $ExposureMode && $obj['ExposureMode'] = $ExposureMode; + null !== $ExposureProgram && $obj['ExposureProgram'] = $ExposureProgram; + null !== $ExposureTime && $obj['ExposureTime'] = $ExposureTime; + null !== $Flash && $obj['Flash'] = $Flash; + null !== $FlashpixVersion && $obj['FlashpixVersion'] = $FlashpixVersion; + null !== $FNumber && $obj['FNumber'] = $FNumber; + null !== $FocalLength && $obj['FocalLength'] = $FocalLength; + null !== $FocalPlaneResolutionUnit && $obj['FocalPlaneResolutionUnit'] = $FocalPlaneResolutionUnit; + null !== $FocalPlaneXResolution && $obj['FocalPlaneXResolution'] = $FocalPlaneXResolution; + null !== $FocalPlaneYResolution && $obj['FocalPlaneYResolution'] = $FocalPlaneYResolution; + null !== $InteropOffset && $obj['InteropOffset'] = $InteropOffset; + null !== $ISO && $obj['ISO'] = $ISO; + null !== $MeteringMode && $obj['MeteringMode'] = $MeteringMode; + null !== $SceneCaptureType && $obj['SceneCaptureType'] = $SceneCaptureType; + null !== $ShutterSpeedValue && $obj['ShutterSpeedValue'] = $ShutterSpeedValue; + null !== $SubSecTime && $obj['SubSecTime'] = $SubSecTime; + null !== $WhiteBalance && $obj['WhiteBalance'] = $WhiteBalance; return $obj; } @@ -196,7 +196,7 @@ public static function with( public function withApertureValue(float $apertureValue): self { $obj = clone $this; - $obj->ApertureValue = $apertureValue; + $obj['ApertureValue'] = $apertureValue; return $obj; } @@ -204,7 +204,7 @@ public function withApertureValue(float $apertureValue): self public function withColorSpace(int $colorSpace): self { $obj = clone $this; - $obj->ColorSpace = $colorSpace; + $obj['ColorSpace'] = $colorSpace; return $obj; } @@ -212,7 +212,7 @@ public function withColorSpace(int $colorSpace): self public function withCreateDate(string $createDate): self { $obj = clone $this; - $obj->CreateDate = $createDate; + $obj['CreateDate'] = $createDate; return $obj; } @@ -220,7 +220,7 @@ public function withCreateDate(string $createDate): self public function withCustomRendered(int $customRendered): self { $obj = clone $this; - $obj->CustomRendered = $customRendered; + $obj['CustomRendered'] = $customRendered; return $obj; } @@ -228,7 +228,7 @@ public function withCustomRendered(int $customRendered): self public function withDateTimeOriginal(string $dateTimeOriginal): self { $obj = clone $this; - $obj->DateTimeOriginal = $dateTimeOriginal; + $obj['DateTimeOriginal'] = $dateTimeOriginal; return $obj; } @@ -236,7 +236,7 @@ public function withDateTimeOriginal(string $dateTimeOriginal): self public function withExifImageHeight(int $exifImageHeight): self { $obj = clone $this; - $obj->ExifImageHeight = $exifImageHeight; + $obj['ExifImageHeight'] = $exifImageHeight; return $obj; } @@ -244,7 +244,7 @@ public function withExifImageHeight(int $exifImageHeight): self public function withExifImageWidth(int $exifImageWidth): self { $obj = clone $this; - $obj->ExifImageWidth = $exifImageWidth; + $obj['ExifImageWidth'] = $exifImageWidth; return $obj; } @@ -252,7 +252,7 @@ public function withExifImageWidth(int $exifImageWidth): self public function withExifVersion(string $exifVersion): self { $obj = clone $this; - $obj->ExifVersion = $exifVersion; + $obj['ExifVersion'] = $exifVersion; return $obj; } @@ -260,7 +260,7 @@ public function withExifVersion(string $exifVersion): self public function withExposureCompensation(float $exposureCompensation): self { $obj = clone $this; - $obj->ExposureCompensation = $exposureCompensation; + $obj['ExposureCompensation'] = $exposureCompensation; return $obj; } @@ -268,7 +268,7 @@ public function withExposureCompensation(float $exposureCompensation): self public function withExposureMode(int $exposureMode): self { $obj = clone $this; - $obj->ExposureMode = $exposureMode; + $obj['ExposureMode'] = $exposureMode; return $obj; } @@ -276,7 +276,7 @@ public function withExposureMode(int $exposureMode): self public function withExposureProgram(int $exposureProgram): self { $obj = clone $this; - $obj->ExposureProgram = $exposureProgram; + $obj['ExposureProgram'] = $exposureProgram; return $obj; } @@ -284,7 +284,7 @@ public function withExposureProgram(int $exposureProgram): self public function withExposureTime(float $exposureTime): self { $obj = clone $this; - $obj->ExposureTime = $exposureTime; + $obj['ExposureTime'] = $exposureTime; return $obj; } @@ -292,7 +292,7 @@ public function withExposureTime(float $exposureTime): self public function withFlash(int $flash): self { $obj = clone $this; - $obj->Flash = $flash; + $obj['Flash'] = $flash; return $obj; } @@ -300,7 +300,7 @@ public function withFlash(int $flash): self public function withFlashpixVersion(string $flashpixVersion): self { $obj = clone $this; - $obj->FlashpixVersion = $flashpixVersion; + $obj['FlashpixVersion'] = $flashpixVersion; return $obj; } @@ -308,7 +308,7 @@ public function withFlashpixVersion(string $flashpixVersion): self public function withFNumber(float $fNumber): self { $obj = clone $this; - $obj->FNumber = $fNumber; + $obj['FNumber'] = $fNumber; return $obj; } @@ -316,7 +316,7 @@ public function withFNumber(float $fNumber): self public function withFocalLength(int $focalLength): self { $obj = clone $this; - $obj->FocalLength = $focalLength; + $obj['FocalLength'] = $focalLength; return $obj; } @@ -325,7 +325,7 @@ public function withFocalPlaneResolutionUnit( int $focalPlaneResolutionUnit ): self { $obj = clone $this; - $obj->FocalPlaneResolutionUnit = $focalPlaneResolutionUnit; + $obj['FocalPlaneResolutionUnit'] = $focalPlaneResolutionUnit; return $obj; } @@ -334,7 +334,7 @@ public function withFocalPlaneXResolution( float $focalPlaneXResolution ): self { $obj = clone $this; - $obj->FocalPlaneXResolution = $focalPlaneXResolution; + $obj['FocalPlaneXResolution'] = $focalPlaneXResolution; return $obj; } @@ -343,7 +343,7 @@ public function withFocalPlaneYResolution( float $focalPlaneYResolution ): self { $obj = clone $this; - $obj->FocalPlaneYResolution = $focalPlaneYResolution; + $obj['FocalPlaneYResolution'] = $focalPlaneYResolution; return $obj; } @@ -351,7 +351,7 @@ public function withFocalPlaneYResolution( public function withInteropOffset(int $interopOffset): self { $obj = clone $this; - $obj->InteropOffset = $interopOffset; + $obj['InteropOffset'] = $interopOffset; return $obj; } @@ -359,7 +359,7 @@ public function withInteropOffset(int $interopOffset): self public function withISO(int $iso): self { $obj = clone $this; - $obj->ISO = $iso; + $obj['ISO'] = $iso; return $obj; } @@ -367,7 +367,7 @@ public function withISO(int $iso): self public function withMeteringMode(int $meteringMode): self { $obj = clone $this; - $obj->MeteringMode = $meteringMode; + $obj['MeteringMode'] = $meteringMode; return $obj; } @@ -375,7 +375,7 @@ public function withMeteringMode(int $meteringMode): self public function withSceneCaptureType(int $sceneCaptureType): self { $obj = clone $this; - $obj->SceneCaptureType = $sceneCaptureType; + $obj['SceneCaptureType'] = $sceneCaptureType; return $obj; } @@ -383,7 +383,7 @@ public function withSceneCaptureType(int $sceneCaptureType): self public function withShutterSpeedValue(float $shutterSpeedValue): self { $obj = clone $this; - $obj->ShutterSpeedValue = $shutterSpeedValue; + $obj['ShutterSpeedValue'] = $shutterSpeedValue; return $obj; } @@ -391,7 +391,7 @@ public function withShutterSpeedValue(float $shutterSpeedValue): self public function withSubSecTime(string $subSecTime): self { $obj = clone $this; - $obj->SubSecTime = $subSecTime; + $obj['SubSecTime'] = $subSecTime; return $obj; } @@ -399,7 +399,7 @@ public function withSubSecTime(string $subSecTime): self public function withWhiteBalance(int $whiteBalance): self { $obj = clone $this; - $obj->WhiteBalance = $whiteBalance; + $obj['WhiteBalance'] = $whiteBalance; return $obj; } diff --git a/src/Files/Metadata/Exif/Gps.php b/src/Files/Metadata/Exif/Gps.php index 708f83d7..b3345002 100644 --- a/src/Files/Metadata/Exif/Gps.php +++ b/src/Files/Metadata/Exif/Gps.php @@ -38,7 +38,7 @@ public static function with(?array $GPSVersionID = null): self { $obj = new self; - null !== $GPSVersionID && $obj->GPSVersionID = $GPSVersionID; + null !== $GPSVersionID && $obj['GPSVersionID'] = $GPSVersionID; return $obj; } @@ -49,7 +49,7 @@ public static function with(?array $GPSVersionID = null): self public function withGpsVersionID(array $gpsVersionID): self { $obj = clone $this; - $obj->GPSVersionID = $gpsVersionID; + $obj['GPSVersionID'] = $gpsVersionID; return $obj; } diff --git a/src/Files/Metadata/Exif/Image.php b/src/Files/Metadata/Exif/Image.php index 45c9a51c..fe9d96f0 100644 --- a/src/Files/Metadata/Exif/Image.php +++ b/src/Files/Metadata/Exif/Image.php @@ -88,17 +88,17 @@ public static function with( ): self { $obj = new self; - null !== $ExifOffset && $obj->ExifOffset = $ExifOffset; - null !== $GPSInfo && $obj->GPSInfo = $GPSInfo; - null !== $Make && $obj->Make = $Make; - null !== $Model && $obj->Model = $Model; - null !== $ModifyDate && $obj->ModifyDate = $ModifyDate; - null !== $Orientation && $obj->Orientation = $Orientation; - null !== $ResolutionUnit && $obj->ResolutionUnit = $ResolutionUnit; - null !== $Software && $obj->Software = $Software; - null !== $XResolution && $obj->XResolution = $XResolution; - null !== $YCbCrPositioning && $obj->YCbCrPositioning = $YCbCrPositioning; - null !== $YResolution && $obj->YResolution = $YResolution; + null !== $ExifOffset && $obj['ExifOffset'] = $ExifOffset; + null !== $GPSInfo && $obj['GPSInfo'] = $GPSInfo; + null !== $Make && $obj['Make'] = $Make; + null !== $Model && $obj['Model'] = $Model; + null !== $ModifyDate && $obj['ModifyDate'] = $ModifyDate; + null !== $Orientation && $obj['Orientation'] = $Orientation; + null !== $ResolutionUnit && $obj['ResolutionUnit'] = $ResolutionUnit; + null !== $Software && $obj['Software'] = $Software; + null !== $XResolution && $obj['XResolution'] = $XResolution; + null !== $YCbCrPositioning && $obj['YCbCrPositioning'] = $YCbCrPositioning; + null !== $YResolution && $obj['YResolution'] = $YResolution; return $obj; } @@ -106,7 +106,7 @@ public static function with( public function withExifOffset(int $exifOffset): self { $obj = clone $this; - $obj->ExifOffset = $exifOffset; + $obj['ExifOffset'] = $exifOffset; return $obj; } @@ -114,7 +114,7 @@ public function withExifOffset(int $exifOffset): self public function withGpsInfo(int $gpsInfo): self { $obj = clone $this; - $obj->GPSInfo = $gpsInfo; + $obj['GPSInfo'] = $gpsInfo; return $obj; } @@ -122,7 +122,7 @@ public function withGpsInfo(int $gpsInfo): self public function withMake(string $make): self { $obj = clone $this; - $obj->Make = $make; + $obj['Make'] = $make; return $obj; } @@ -130,7 +130,7 @@ public function withMake(string $make): self public function withModel(string $model): self { $obj = clone $this; - $obj->Model = $model; + $obj['Model'] = $model; return $obj; } @@ -138,7 +138,7 @@ public function withModel(string $model): self public function withModifyDate(string $modifyDate): self { $obj = clone $this; - $obj->ModifyDate = $modifyDate; + $obj['ModifyDate'] = $modifyDate; return $obj; } @@ -146,7 +146,7 @@ public function withModifyDate(string $modifyDate): self public function withOrientation(int $orientation): self { $obj = clone $this; - $obj->Orientation = $orientation; + $obj['Orientation'] = $orientation; return $obj; } @@ -154,7 +154,7 @@ public function withOrientation(int $orientation): self public function withResolutionUnit(int $resolutionUnit): self { $obj = clone $this; - $obj->ResolutionUnit = $resolutionUnit; + $obj['ResolutionUnit'] = $resolutionUnit; return $obj; } @@ -162,7 +162,7 @@ public function withResolutionUnit(int $resolutionUnit): self public function withSoftware(string $software): self { $obj = clone $this; - $obj->Software = $software; + $obj['Software'] = $software; return $obj; } @@ -170,7 +170,7 @@ public function withSoftware(string $software): self public function withXResolution(int $xResolution): self { $obj = clone $this; - $obj->XResolution = $xResolution; + $obj['XResolution'] = $xResolution; return $obj; } @@ -178,7 +178,7 @@ public function withXResolution(int $xResolution): self public function withYCbCrPositioning(int $yCbCrPositioning): self { $obj = clone $this; - $obj->YCbCrPositioning = $yCbCrPositioning; + $obj['YCbCrPositioning'] = $yCbCrPositioning; return $obj; } @@ -186,7 +186,7 @@ public function withYCbCrPositioning(int $yCbCrPositioning): self public function withYResolution(int $yResolution): self { $obj = clone $this; - $obj->YResolution = $yResolution; + $obj['YResolution'] = $yResolution; return $obj; } diff --git a/src/Files/Metadata/Exif/Interoperability.php b/src/Files/Metadata/Exif/Interoperability.php index 04698375..7e87290e 100644 --- a/src/Files/Metadata/Exif/Interoperability.php +++ b/src/Files/Metadata/Exif/Interoperability.php @@ -42,8 +42,8 @@ public static function with( ): self { $obj = new self; - null !== $InteropIndex && $obj->InteropIndex = $InteropIndex; - null !== $InteropVersion && $obj->InteropVersion = $InteropVersion; + null !== $InteropIndex && $obj['InteropIndex'] = $InteropIndex; + null !== $InteropVersion && $obj['InteropVersion'] = $InteropVersion; return $obj; } @@ -51,7 +51,7 @@ public static function with( public function withInteropIndex(string $interopIndex): self { $obj = clone $this; - $obj->InteropIndex = $interopIndex; + $obj['InteropIndex'] = $interopIndex; return $obj; } @@ -59,7 +59,7 @@ public function withInteropIndex(string $interopIndex): self public function withInteropVersion(string $interopVersion): self { $obj = clone $this; - $obj->InteropVersion = $interopVersion; + $obj['InteropVersion'] = $interopVersion; return $obj; } diff --git a/src/Files/Metadata/Exif/Thumbnail.php b/src/Files/Metadata/Exif/Thumbnail.php index d1e9bf63..6433b85d 100644 --- a/src/Files/Metadata/Exif/Thumbnail.php +++ b/src/Files/Metadata/Exif/Thumbnail.php @@ -63,12 +63,12 @@ public static function with( ): self { $obj = new self; - null !== $Compression && $obj->Compression = $Compression; - null !== $ResolutionUnit && $obj->ResolutionUnit = $ResolutionUnit; - null !== $ThumbnailLength && $obj->ThumbnailLength = $ThumbnailLength; - null !== $ThumbnailOffset && $obj->ThumbnailOffset = $ThumbnailOffset; - null !== $XResolution && $obj->XResolution = $XResolution; - null !== $YResolution && $obj->YResolution = $YResolution; + null !== $Compression && $obj['Compression'] = $Compression; + null !== $ResolutionUnit && $obj['ResolutionUnit'] = $ResolutionUnit; + null !== $ThumbnailLength && $obj['ThumbnailLength'] = $ThumbnailLength; + null !== $ThumbnailOffset && $obj['ThumbnailOffset'] = $ThumbnailOffset; + null !== $XResolution && $obj['XResolution'] = $XResolution; + null !== $YResolution && $obj['YResolution'] = $YResolution; return $obj; } @@ -76,7 +76,7 @@ public static function with( public function withCompression(int $compression): self { $obj = clone $this; - $obj->Compression = $compression; + $obj['Compression'] = $compression; return $obj; } @@ -84,7 +84,7 @@ public function withCompression(int $compression): self public function withResolutionUnit(int $resolutionUnit): self { $obj = clone $this; - $obj->ResolutionUnit = $resolutionUnit; + $obj['ResolutionUnit'] = $resolutionUnit; return $obj; } @@ -92,7 +92,7 @@ public function withResolutionUnit(int $resolutionUnit): self public function withThumbnailLength(int $thumbnailLength): self { $obj = clone $this; - $obj->ThumbnailLength = $thumbnailLength; + $obj['ThumbnailLength'] = $thumbnailLength; return $obj; } @@ -100,7 +100,7 @@ public function withThumbnailLength(int $thumbnailLength): self public function withThumbnailOffset(int $thumbnailOffset): self { $obj = clone $this; - $obj->ThumbnailOffset = $thumbnailOffset; + $obj['ThumbnailOffset'] = $thumbnailOffset; return $obj; } @@ -108,7 +108,7 @@ public function withThumbnailOffset(int $thumbnailOffset): self public function withXResolution(int $xResolution): self { $obj = clone $this; - $obj->XResolution = $xResolution; + $obj['XResolution'] = $xResolution; return $obj; } @@ -116,7 +116,7 @@ public function withXResolution(int $xResolution): self public function withYResolution(int $yResolution): self { $obj = clone $this; - $obj->YResolution = $yResolution; + $obj['YResolution'] = $yResolution; return $obj; } diff --git a/src/Files/Metadata/MetadataGetFromURLParams.php b/src/Files/Metadata/MetadataGetFromURLParams.php index a79711f5..79d9954e 100644 --- a/src/Files/Metadata/MetadataGetFromURLParams.php +++ b/src/Files/Metadata/MetadataGetFromURLParams.php @@ -56,7 +56,7 @@ public static function with(string $url): self { $obj = new self; - $obj->url = $url; + $obj['url'] = $url; return $obj; } @@ -67,7 +67,7 @@ public static function with(string $url): self public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } diff --git a/src/Files/UpdateFileRequest/ChangePublicationStatus.php b/src/Files/UpdateFileRequest/ChangePublicationStatus.php index 32a4606d..1022e2ab 100644 --- a/src/Files/UpdateFileRequest/ChangePublicationStatus.php +++ b/src/Files/UpdateFileRequest/ChangePublicationStatus.php @@ -32,23 +32,31 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Publish|array{ + * isPublished: bool, includeFileVersions?: bool|null + * } $publish */ - public static function with(?Publish $publish = null): self + public static function with(Publish|array|null $publish = null): self { $obj = new self; - null !== $publish && $obj->publish = $publish; + null !== $publish && $obj['publish'] = $publish; return $obj; } /** * Configure the publication status of a file and its versions. + * + * @param Publish|array{ + * isPublished: bool, includeFileVersions?: bool|null + * } $publish */ - public function withPublish(Publish $publish): self + public function withPublish(Publish|array $publish): self { $obj = clone $this; - $obj->publish = $publish; + $obj['publish'] = $publish; return $obj; } diff --git a/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php b/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php index 95a3d19b..d89a95df 100644 --- a/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php +++ b/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php @@ -62,9 +62,9 @@ public static function with( ): self { $obj = new self; - $obj->isPublished = $isPublished; + $obj['isPublished'] = $isPublished; - null !== $includeFileVersions && $obj->includeFileVersions = $includeFileVersions; + null !== $includeFileVersions && $obj['includeFileVersions'] = $includeFileVersions; return $obj; } @@ -75,7 +75,7 @@ public static function with( public function withIsPublished(bool $isPublished): self { $obj = clone $this; - $obj->isPublished = $isPublished; + $obj['isPublished'] = $isPublished; return $obj; } @@ -86,7 +86,7 @@ public function withIsPublished(bool $isPublished): self public function withIncludeFileVersions(bool $includeFileVersions): self { $obj = clone $this; - $obj->includeFileVersions = $includeFileVersions; + $obj['includeFileVersions'] = $includeFileVersions; return $obj; } diff --git a/src/Files/UpdateFileRequest/UpdateFileDetails.php b/src/Files/UpdateFileRequest/UpdateFileDetails.php index b81158c3..a4f519d8 100644 --- a/src/Files/UpdateFileRequest/UpdateFileDetails.php +++ b/src/Files/UpdateFileRequest/UpdateFileDetails.php @@ -10,7 +10,9 @@ use ImageKit\ExtensionItem; use ImageKit\ExtensionItem\AIAutoDescription; use ImageKit\ExtensionItem\AutoTaggingExtension; +use ImageKit\ExtensionItem\AutoTaggingExtension\Name; use ImageKit\ExtensionItem\RemoveBg; +use ImageKit\ExtensionItem\RemoveBg\Options; use ImageKit\Files\UpdateFileRequest\UpdateFileDetails\RemoveAITags; /** @@ -94,7 +96,11 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param array $customMetadata - * @param list $extensions + * @param list + * }|AIAutoDescription|array{name: 'ai-auto-description'}> $extensions * @param 'all'|list $removeAITags * @param list|null $tags */ @@ -109,13 +115,13 @@ public static function with( ): self { $obj = new self; - null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; - null !== $customMetadata && $obj->customMetadata = $customMetadata; - null !== $description && $obj->description = $description; - null !== $extensions && $obj->extensions = $extensions; - null !== $removeAITags && $obj->removeAITags = $removeAITags; - null !== $tags && $obj->tags = $tags; - null !== $webhookUrl && $obj->webhookUrl = $webhookUrl; + null !== $customCoordinates && $obj['customCoordinates'] = $customCoordinates; + null !== $customMetadata && $obj['customMetadata'] = $customMetadata; + null !== $description && $obj['description'] = $description; + null !== $extensions && $obj['extensions'] = $extensions; + null !== $removeAITags && $obj['removeAITags'] = $removeAITags; + null !== $tags && $obj['tags'] = $tags; + null !== $webhookUrl && $obj['webhookUrl'] = $webhookUrl; return $obj; } @@ -126,7 +132,7 @@ public static function with( public function withCustomCoordinates(?string $customCoordinates): self { $obj = clone $this; - $obj->customCoordinates = $customCoordinates; + $obj['customCoordinates'] = $customCoordinates; return $obj; } @@ -139,7 +145,7 @@ public function withCustomCoordinates(?string $customCoordinates): self public function withCustomMetadata(array $customMetadata): self { $obj = clone $this; - $obj->customMetadata = $customMetadata; + $obj['customMetadata'] = $customMetadata; return $obj; } @@ -150,7 +156,7 @@ public function withCustomMetadata(array $customMetadata): self public function withDescription(string $description): self { $obj = clone $this; - $obj->description = $description; + $obj['description'] = $description; return $obj; } @@ -158,12 +164,16 @@ public function withDescription(string $description): self /** * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * - * @param list $extensions + * @param list + * }|AIAutoDescription|array{name: 'ai-auto-description'}> $extensions */ public function withExtensions(array $extensions): self { $obj = clone $this; - $obj->extensions = $extensions; + $obj['extensions'] = $extensions; return $obj; } @@ -180,7 +190,7 @@ public function withExtensions(array $extensions): self public function withRemoveAITags(string|array $removeAITags): self { $obj = clone $this; - $obj->removeAITags = $removeAITags; + $obj['removeAITags'] = $removeAITags; return $obj; } @@ -193,7 +203,7 @@ public function withRemoveAITags(string|array $removeAITags): self public function withTags(?array $tags): self { $obj = clone $this; - $obj->tags = $tags; + $obj['tags'] = $tags; return $obj; } @@ -204,7 +214,7 @@ public function withTags(?array $tags): self public function withWebhookURL(string $webhookURL): self { $obj = clone $this; - $obj->webhookUrl = $webhookURL; + $obj['webhookUrl'] = $webhookURL; return $obj; } diff --git a/src/Files/Versions/VersionDeleteParams.php b/src/Files/Versions/VersionDeleteParams.php index 3ce4ae2f..769db9f6 100644 --- a/src/Files/Versions/VersionDeleteParams.php +++ b/src/Files/Versions/VersionDeleteParams.php @@ -55,7 +55,7 @@ public static function with(string $fileId): self { $obj = new self; - $obj->fileId = $fileId; + $obj['fileId'] = $fileId; return $obj; } @@ -63,7 +63,7 @@ public static function with(string $fileId): self public function withFileID(string $fileID): self { $obj = clone $this; - $obj->fileId = $fileID; + $obj['fileId'] = $fileID; return $obj; } diff --git a/src/Files/Versions/VersionGetParams.php b/src/Files/Versions/VersionGetParams.php index 41ffb2f2..036cc88a 100644 --- a/src/Files/Versions/VersionGetParams.php +++ b/src/Files/Versions/VersionGetParams.php @@ -53,7 +53,7 @@ public static function with(string $fileId): self { $obj = new self; - $obj->fileId = $fileId; + $obj['fileId'] = $fileId; return $obj; } @@ -61,7 +61,7 @@ public static function with(string $fileId): self public function withFileID(string $fileID): self { $obj = clone $this; - $obj->fileId = $fileID; + $obj['fileId'] = $fileID; return $obj; } diff --git a/src/Files/Versions/VersionRestoreParams.php b/src/Files/Versions/VersionRestoreParams.php index 3fe2713f..344f2812 100644 --- a/src/Files/Versions/VersionRestoreParams.php +++ b/src/Files/Versions/VersionRestoreParams.php @@ -53,7 +53,7 @@ public static function with(string $fileId): self { $obj = new self; - $obj->fileId = $fileId; + $obj['fileId'] = $fileId; return $obj; } @@ -61,7 +61,7 @@ public static function with(string $fileId): self public function withFileID(string $fileID): self { $obj = clone $this; - $obj->fileId = $fileID; + $obj['fileId'] = $fileID; return $obj; } diff --git a/src/Folders/FolderCopyParams.php b/src/Folders/FolderCopyParams.php index f636eb89..216fba6f 100644 --- a/src/Folders/FolderCopyParams.php +++ b/src/Folders/FolderCopyParams.php @@ -73,10 +73,10 @@ public static function with( ): self { $obj = new self; - $obj->destinationPath = $destinationPath; - $obj->sourceFolderPath = $sourceFolderPath; + $obj['destinationPath'] = $destinationPath; + $obj['sourceFolderPath'] = $sourceFolderPath; - null !== $includeVersions && $obj->includeVersions = $includeVersions; + null !== $includeVersions && $obj['includeVersions'] = $includeVersions; return $obj; } @@ -87,7 +87,7 @@ public static function with( public function withDestinationPath(string $destinationPath): self { $obj = clone $this; - $obj->destinationPath = $destinationPath; + $obj['destinationPath'] = $destinationPath; return $obj; } @@ -98,7 +98,7 @@ public function withDestinationPath(string $destinationPath): self public function withSourceFolderPath(string $sourceFolderPath): self { $obj = clone $this; - $obj->sourceFolderPath = $sourceFolderPath; + $obj['sourceFolderPath'] = $sourceFolderPath; return $obj; } @@ -109,7 +109,7 @@ public function withSourceFolderPath(string $sourceFolderPath): self public function withIncludeVersions(bool $includeVersions): self { $obj = clone $this; - $obj->includeVersions = $includeVersions; + $obj['includeVersions'] = $includeVersions; return $obj; } diff --git a/src/Folders/FolderCopyResponse.php b/src/Folders/FolderCopyResponse.php index abe370bf..8ffcee2b 100644 --- a/src/Folders/FolderCopyResponse.php +++ b/src/Folders/FolderCopyResponse.php @@ -56,7 +56,7 @@ public static function with(string $jobId): self { $obj = new self; - $obj->jobId = $jobId; + $obj['jobId'] = $jobId; return $obj; } @@ -67,7 +67,7 @@ public static function with(string $jobId): self public function withJobID(string $jobID): self { $obj = clone $this; - $obj->jobId = $jobID; + $obj['jobId'] = $jobID; return $obj; } diff --git a/src/Folders/FolderCreateParams.php b/src/Folders/FolderCreateParams.php index 6afb10b4..f36bc1b0 100644 --- a/src/Folders/FolderCreateParams.php +++ b/src/Folders/FolderCreateParams.php @@ -70,8 +70,8 @@ public static function with( ): self { $obj = new self; - $obj->folderName = $folderName; - $obj->parentFolderPath = $parentFolderPath; + $obj['folderName'] = $folderName; + $obj['parentFolderPath'] = $parentFolderPath; return $obj; } @@ -84,7 +84,7 @@ public static function with( public function withFolderName(string $folderName): self { $obj = clone $this; - $obj->folderName = $folderName; + $obj['folderName'] = $folderName; return $obj; } @@ -97,7 +97,7 @@ public function withFolderName(string $folderName): self public function withParentFolderPath(string $parentFolderPath): self { $obj = clone $this; - $obj->parentFolderPath = $parentFolderPath; + $obj['parentFolderPath'] = $parentFolderPath; return $obj; } diff --git a/src/Folders/FolderDeleteParams.php b/src/Folders/FolderDeleteParams.php index 211f0f7c..d0f8d7b7 100644 --- a/src/Folders/FolderDeleteParams.php +++ b/src/Folders/FolderDeleteParams.php @@ -56,7 +56,7 @@ public static function with(string $folderPath): self { $obj = new self; - $obj->folderPath = $folderPath; + $obj['folderPath'] = $folderPath; return $obj; } @@ -67,7 +67,7 @@ public static function with(string $folderPath): self public function withFolderPath(string $folderPath): self { $obj = clone $this; - $obj->folderPath = $folderPath; + $obj['folderPath'] = $folderPath; return $obj; } diff --git a/src/Folders/FolderMoveParams.php b/src/Folders/FolderMoveParams.php index d0949c62..c49d4221 100644 --- a/src/Folders/FolderMoveParams.php +++ b/src/Folders/FolderMoveParams.php @@ -66,8 +66,8 @@ public static function with( ): self { $obj = new self; - $obj->destinationPath = $destinationPath; - $obj->sourceFolderPath = $sourceFolderPath; + $obj['destinationPath'] = $destinationPath; + $obj['sourceFolderPath'] = $sourceFolderPath; return $obj; } @@ -78,7 +78,7 @@ public static function with( public function withDestinationPath(string $destinationPath): self { $obj = clone $this; - $obj->destinationPath = $destinationPath; + $obj['destinationPath'] = $destinationPath; return $obj; } @@ -89,7 +89,7 @@ public function withDestinationPath(string $destinationPath): self public function withSourceFolderPath(string $sourceFolderPath): self { $obj = clone $this; - $obj->sourceFolderPath = $sourceFolderPath; + $obj['sourceFolderPath'] = $sourceFolderPath; return $obj; } diff --git a/src/Folders/FolderMoveResponse.php b/src/Folders/FolderMoveResponse.php index ba1a9f56..c71ff8c6 100644 --- a/src/Folders/FolderMoveResponse.php +++ b/src/Folders/FolderMoveResponse.php @@ -56,7 +56,7 @@ public static function with(string $jobId): self { $obj = new self; - $obj->jobId = $jobId; + $obj['jobId'] = $jobId; return $obj; } @@ -67,7 +67,7 @@ public static function with(string $jobId): self public function withJobID(string $jobID): self { $obj = clone $this; - $obj->jobId = $jobID; + $obj['jobId'] = $jobID; return $obj; } diff --git a/src/Folders/FolderRenameParams.php b/src/Folders/FolderRenameParams.php index 7ed1b8ac..ec803298 100644 --- a/src/Folders/FolderRenameParams.php +++ b/src/Folders/FolderRenameParams.php @@ -81,10 +81,10 @@ public static function with( ): self { $obj = new self; - $obj->folderPath = $folderPath; - $obj->newFolderName = $newFolderName; + $obj['folderPath'] = $folderPath; + $obj['newFolderName'] = $newFolderName; - null !== $purgeCache && $obj->purgeCache = $purgeCache; + null !== $purgeCache && $obj['purgeCache'] = $purgeCache; return $obj; } @@ -95,7 +95,7 @@ public static function with( public function withFolderPath(string $folderPath): self { $obj = clone $this; - $obj->folderPath = $folderPath; + $obj['folderPath'] = $folderPath; return $obj; } @@ -108,7 +108,7 @@ public function withFolderPath(string $folderPath): self public function withNewFolderName(string $newFolderName): self { $obj = clone $this; - $obj->newFolderName = $newFolderName; + $obj['newFolderName'] = $newFolderName; return $obj; } @@ -125,7 +125,7 @@ public function withNewFolderName(string $newFolderName): self public function withPurgeCache(bool $purgeCache): self { $obj = clone $this; - $obj->purgeCache = $purgeCache; + $obj['purgeCache'] = $purgeCache; return $obj; } diff --git a/src/Folders/FolderRenameResponse.php b/src/Folders/FolderRenameResponse.php index 392ed037..aeec78d7 100644 --- a/src/Folders/FolderRenameResponse.php +++ b/src/Folders/FolderRenameResponse.php @@ -56,7 +56,7 @@ public static function with(string $jobId): self { $obj = new self; - $obj->jobId = $jobId; + $obj['jobId'] = $jobId; return $obj; } @@ -67,7 +67,7 @@ public static function with(string $jobId): self public function withJobID(string $jobID): self { $obj = clone $this; - $obj->jobId = $jobID; + $obj['jobId'] = $jobID; return $obj; } diff --git a/src/Folders/Job/JobGetResponse.php b/src/Folders/Job/JobGetResponse.php index 7842a59b..16c299c5 100644 --- a/src/Folders/Job/JobGetResponse.php +++ b/src/Folders/Job/JobGetResponse.php @@ -76,8 +76,8 @@ public static function with( ): self { $obj = new self; - null !== $jobId && $obj->jobId = $jobId; - null !== $purgeRequestId && $obj->purgeRequestId = $purgeRequestId; + null !== $jobId && $obj['jobId'] = $jobId; + null !== $purgeRequestId && $obj['purgeRequestId'] = $purgeRequestId; null !== $status && $obj['status'] = $status; null !== $type && $obj['type'] = $type; @@ -90,7 +90,7 @@ public static function with( public function withJobID(string $jobID): self { $obj = clone $this; - $obj->jobId = $jobID; + $obj['jobId'] = $jobID; return $obj; } @@ -101,7 +101,7 @@ public function withJobID(string $jobID): self public function withPurgeRequestID(string $purgeRequestID): self { $obj = clone $this; - $obj->purgeRequestId = $purgeRequestID; + $obj['purgeRequestId'] = $purgeRequestID; return $obj; } diff --git a/src/GetImageAttributesOptions.php b/src/GetImageAttributesOptions.php index 2ed8b1e9..2335349d 100644 --- a/src/GetImageAttributesOptions.php +++ b/src/GetImageAttributesOptions.php @@ -188,18 +188,18 @@ public static function with( ): self { $obj = new self; - $obj->src = $src; - $obj->urlEndpoint = $urlEndpoint; + $obj['src'] = $src; + $obj['urlEndpoint'] = $urlEndpoint; - null !== $expiresIn && $obj->expiresIn = $expiresIn; - null !== $queryParameters && $obj->queryParameters = $queryParameters; - null !== $signed && $obj->signed = $signed; - null !== $transformation && $obj->transformation = $transformation; + null !== $expiresIn && $obj['expiresIn'] = $expiresIn; + null !== $queryParameters && $obj['queryParameters'] = $queryParameters; + null !== $signed && $obj['signed'] = $signed; + null !== $transformation && $obj['transformation'] = $transformation; null !== $transformationPosition && $obj['transformationPosition'] = $transformationPosition; - null !== $deviceBreakpoints && $obj->deviceBreakpoints = $deviceBreakpoints; - null !== $imageBreakpoints && $obj->imageBreakpoints = $imageBreakpoints; - null !== $sizes && $obj->sizes = $sizes; - null !== $width && $obj->width = $width; + null !== $deviceBreakpoints && $obj['deviceBreakpoints'] = $deviceBreakpoints; + null !== $imageBreakpoints && $obj['imageBreakpoints'] = $imageBreakpoints; + null !== $sizes && $obj['sizes'] = $sizes; + null !== $width && $obj['width'] = $width; return $obj; } @@ -211,7 +211,7 @@ public static function with( public function withSrc(string $src): self { $obj = clone $this; - $obj->src = $src; + $obj['src'] = $src; return $obj; } @@ -222,7 +222,7 @@ public function withSrc(string $src): self public function withURLEndpoint(string $urlEndpoint): self { $obj = clone $this; - $obj->urlEndpoint = $urlEndpoint; + $obj['urlEndpoint'] = $urlEndpoint; return $obj; } @@ -240,7 +240,7 @@ public function withURLEndpoint(string $urlEndpoint): self public function withExpiresIn(float $expiresIn): self { $obj = clone $this; - $obj->expiresIn = $expiresIn; + $obj['expiresIn'] = $expiresIn; return $obj; } @@ -255,7 +255,7 @@ public function withExpiresIn(float $expiresIn): self public function withQueryParameters(array $queryParameters): self { $obj = clone $this; - $obj->queryParameters = $queryParameters; + $obj['queryParameters'] = $queryParameters; return $obj; } @@ -269,7 +269,7 @@ public function withQueryParameters(array $queryParameters): self public function withSigned(bool $signed): self { $obj = clone $this; - $obj->signed = $signed; + $obj['signed'] = $signed; return $obj; } @@ -283,7 +283,7 @@ public function withSigned(bool $signed): self public function withTransformation(array $transformation): self { $obj = clone $this; - $obj->transformation = $transformation; + $obj['transformation'] = $transformation; return $obj; } @@ -316,7 +316,7 @@ public function withTransformationPosition( public function withDeviceBreakpoints(array $deviceBreakpoints): self { $obj = clone $this; - $obj->deviceBreakpoints = $deviceBreakpoints; + $obj['deviceBreakpoints'] = $deviceBreakpoints; return $obj; } @@ -334,7 +334,7 @@ public function withDeviceBreakpoints(array $deviceBreakpoints): self public function withImageBreakpoints(array $imageBreakpoints): self { $obj = clone $this; - $obj->imageBreakpoints = $imageBreakpoints; + $obj['imageBreakpoints'] = $imageBreakpoints; return $obj; } @@ -351,7 +351,7 @@ public function withImageBreakpoints(array $imageBreakpoints): self public function withSizes(string $sizes): self { $obj = clone $this; - $obj->sizes = $sizes; + $obj['sizes'] = $sizes; return $obj; } @@ -367,7 +367,7 @@ public function withSizes(string $sizes): self public function withWidth(float $width): self { $obj = clone $this; - $obj->width = $width; + $obj['width'] = $width; return $obj; } diff --git a/src/ImageOverlay.php b/src/ImageOverlay.php index ec0018a9..b0971eca 100644 --- a/src/ImageOverlay.php +++ b/src/ImageOverlay.php @@ -8,6 +8,7 @@ use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; use ImageKit\ImageOverlay\Encoding; +use ImageKit\OverlayPosition\Focus; /** * @phpstan-type ImageOverlayShape = array{ @@ -84,40 +85,60 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * + * @param OverlayPosition|array{ + * focus?: value-of|null, x?: float|string|null, y?: float|string|null + * } $position + * @param OverlayTiming|array{ + * duration?: float|string|null, + * end?: float|string|null, + * start?: float|string|null, + * } $timing * @param Encoding|value-of $encoding * @param list $transformation */ public static function with( string $input, - ?OverlayPosition $position = null, - ?OverlayTiming $timing = null, + OverlayPosition|array|null $position = null, + OverlayTiming|array|null $timing = null, Encoding|string|null $encoding = null, ?array $transformation = null, ): self { $obj = new self; - $obj->input = $input; + $obj['input'] = $input; - null !== $position && $obj->position = $position; - null !== $timing && $obj->timing = $timing; + null !== $position && $obj['position'] = $position; + null !== $timing && $obj['timing'] = $timing; null !== $encoding && $obj['encoding'] = $encoding; - null !== $transformation && $obj->transformation = $transformation; + null !== $transformation && $obj['transformation'] = $transformation; return $obj; } - public function withPosition(OverlayPosition $position): self + /** + * @param OverlayPosition|array{ + * focus?: value-of|null, x?: float|string|null, y?: float|string|null + * } $position + */ + public function withPosition(OverlayPosition|array $position): self { $obj = clone $this; - $obj->position = $position; + $obj['position'] = $position; return $obj; } - public function withTiming(OverlayTiming $timing): self + /** + * @param OverlayTiming|array{ + * duration?: float|string|null, + * end?: float|string|null, + * start?: float|string|null, + * } $timing + */ + public function withTiming(OverlayTiming|array $timing): self { $obj = clone $this; - $obj->timing = $timing; + $obj['timing'] = $timing; return $obj; } @@ -128,7 +149,7 @@ public function withTiming(OverlayTiming $timing): self public function withInput(string $input): self { $obj = clone $this; - $obj->input = $input; + $obj['input'] = $input; return $obj; } @@ -158,7 +179,7 @@ public function withEncoding(Encoding|string $encoding): self public function withTransformation(array $transformation): self { $obj = clone $this; - $obj->transformation = $transformation; + $obj['transformation'] = $transformation; return $obj; } diff --git a/src/OverlayPosition.php b/src/OverlayPosition.php index dd816305..e768f71e 100644 --- a/src/OverlayPosition.php +++ b/src/OverlayPosition.php @@ -66,8 +66,8 @@ public static function with( $obj = new self; null !== $focus && $obj['focus'] = $focus; - null !== $x && $obj->x = $x; - null !== $y && $obj->y = $y; + null !== $x && $obj['x'] = $x; + null !== $y && $obj['y'] = $y; return $obj; } @@ -95,7 +95,7 @@ public function withFocus(Focus|string $focus): self public function withX(float|string $x): self { $obj = clone $this; - $obj->x = $x; + $obj['x'] = $x; return $obj; } @@ -109,7 +109,7 @@ public function withX(float|string $x): self public function withY(float|string $y): self { $obj = clone $this; - $obj->y = $y; + $obj['y'] = $y; return $obj; } diff --git a/src/OverlayTiming.php b/src/OverlayTiming.php index 1a67e254..d5d28caf 100644 --- a/src/OverlayTiming.php +++ b/src/OverlayTiming.php @@ -65,9 +65,9 @@ public static function with( ): self { $obj = new self; - null !== $duration && $obj->duration = $duration; - null !== $end && $obj->end = $end; - null !== $start && $obj->start = $start; + null !== $duration && $obj['duration'] = $duration; + null !== $end && $obj['end'] = $end; + null !== $start && $obj['start'] = $start; return $obj; } @@ -81,7 +81,7 @@ public static function with( public function withDuration(float|string $duration): self { $obj = clone $this; - $obj->duration = $duration; + $obj['duration'] = $duration; return $obj; } @@ -96,7 +96,7 @@ public function withDuration(float|string $duration): self public function withEnd(float|string $end): self { $obj = clone $this; - $obj->end = $end; + $obj['end'] = $end; return $obj; } @@ -110,7 +110,7 @@ public function withEnd(float|string $end): self public function withStart(float|string $start): self { $obj = clone $this; - $obj->start = $start; + $obj['start'] = $start; return $obj; } diff --git a/src/ResponsiveImageAttributes.php b/src/ResponsiveImageAttributes.php index 2e7015f9..06ece216 100644 --- a/src/ResponsiveImageAttributes.php +++ b/src/ResponsiveImageAttributes.php @@ -79,11 +79,11 @@ public static function with( ): self { $obj = new self; - $obj->src = $src; + $obj['src'] = $src; - null !== $sizes && $obj->sizes = $sizes; - null !== $srcSet && $obj->srcSet = $srcSet; - null !== $width && $obj->width = $width; + null !== $sizes && $obj['sizes'] = $sizes; + null !== $srcSet && $obj['srcSet'] = $srcSet; + null !== $width && $obj['width'] = $width; return $obj; } @@ -94,7 +94,7 @@ public static function with( public function withSrc(string $src): self { $obj = clone $this; - $obj->src = $src; + $obj['src'] = $src; return $obj; } @@ -106,7 +106,7 @@ public function withSrc(string $src): self public function withSizes(string $sizes): self { $obj = clone $this; - $obj->sizes = $sizes; + $obj['sizes'] = $sizes; return $obj; } @@ -118,7 +118,7 @@ public function withSizes(string $sizes): self public function withSrcSet(string $srcSet): self { $obj = clone $this; - $obj->srcSet = $srcSet; + $obj['srcSet'] = $srcSet; return $obj; } @@ -129,7 +129,7 @@ public function withSrcSet(string $srcSet): self public function withWidth(float $width): self { $obj = clone $this; - $obj->width = $width; + $obj['width'] = $width; return $obj; } diff --git a/src/SolidColorOverlay.php b/src/SolidColorOverlay.php index 0d1cdc6e..e4cc6e4e 100644 --- a/src/SolidColorOverlay.php +++ b/src/SolidColorOverlay.php @@ -7,6 +7,7 @@ use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\OverlayPosition\Focus; /** * @phpstan-type SolidColorOverlayShape = array{ @@ -72,37 +73,64 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $transformation + * @param OverlayPosition|array{ + * focus?: value-of|null, x?: float|string|null, y?: float|string|null + * } $position + * @param OverlayTiming|array{ + * duration?: float|string|null, + * end?: float|string|null, + * start?: float|string|null, + * } $timing + * @param list $transformation */ public static function with( string $color, - ?OverlayPosition $position = null, - ?OverlayTiming $timing = null, + OverlayPosition|array|null $position = null, + OverlayTiming|array|null $timing = null, ?array $transformation = null, ): self { $obj = new self; - $obj->color = $color; + $obj['color'] = $color; - null !== $position && $obj->position = $position; - null !== $timing && $obj->timing = $timing; - null !== $transformation && $obj->transformation = $transformation; + null !== $position && $obj['position'] = $position; + null !== $timing && $obj['timing'] = $timing; + null !== $transformation && $obj['transformation'] = $transformation; return $obj; } - public function withPosition(OverlayPosition $position): self + /** + * @param OverlayPosition|array{ + * focus?: value-of|null, x?: float|string|null, y?: float|string|null + * } $position + */ + public function withPosition(OverlayPosition|array $position): self { $obj = clone $this; - $obj->position = $position; + $obj['position'] = $position; return $obj; } - public function withTiming(OverlayTiming $timing): self + /** + * @param OverlayTiming|array{ + * duration?: float|string|null, + * end?: float|string|null, + * start?: float|string|null, + * } $timing + */ + public function withTiming(OverlayTiming|array $timing): self { $obj = clone $this; - $obj->timing = $timing; + $obj['timing'] = $timing; return $obj; } @@ -114,7 +142,7 @@ public function withTiming(OverlayTiming $timing): self public function withColor(string $color): self { $obj = clone $this; - $obj->color = $color; + $obj['color'] = $color; return $obj; } @@ -123,12 +151,19 @@ public function withColor(string $color): self * Control width and height of the solid color overlay. Supported transformations depend on the base/parent asset. * See overlays on [Images](https://imagekit.io/docs/add-overlays-on-images#apply-transformation-on-solid-color-overlay) and [Videos](https://imagekit.io/docs/add-overlays-on-videos#apply-transformations-on-solid-color-block-overlay). * - * @param list $transformation + * @param list $transformation */ public function withTransformation(array $transformation): self { $obj = clone $this; - $obj->transformation = $transformation; + $obj['transformation'] = $transformation; return $obj; } diff --git a/src/SolidColorOverlayTransformation.php b/src/SolidColorOverlayTransformation.php index a6e980dc..83fbe11e 100644 --- a/src/SolidColorOverlayTransformation.php +++ b/src/SolidColorOverlayTransformation.php @@ -87,12 +87,12 @@ public static function with( ): self { $obj = new self; - null !== $alpha && $obj->alpha = $alpha; - null !== $background && $obj->background = $background; - null !== $gradient && $obj->gradient = $gradient; - null !== $height && $obj->height = $height; - null !== $radius && $obj->radius = $radius; - null !== $width && $obj->width = $width; + null !== $alpha && $obj['alpha'] = $alpha; + null !== $background && $obj['background'] = $background; + null !== $gradient && $obj['gradient'] = $gradient; + null !== $height && $obj['height'] = $height; + null !== $radius && $obj['radius'] = $radius; + null !== $width && $obj['width'] = $width; return $obj; } @@ -103,7 +103,7 @@ public static function with( public function withAlpha(float $alpha): self { $obj = clone $this; - $obj->alpha = $alpha; + $obj['alpha'] = $alpha; return $obj; } @@ -114,7 +114,7 @@ public function withAlpha(float $alpha): self public function withBackground(string $background): self { $obj = clone $this; - $obj->background = $background; + $obj['background'] = $background; return $obj; } @@ -126,7 +126,7 @@ public function withBackground(string $background): self public function withGradient(string|bool $gradient): self { $obj = clone $this; - $obj->gradient = $gradient; + $obj['gradient'] = $gradient; return $obj; } @@ -138,7 +138,7 @@ public function withGradient(string|bool $gradient): self public function withHeight(float|string $height): self { $obj = clone $this; - $obj->height = $height; + $obj['height'] = $height; return $obj; } @@ -152,7 +152,7 @@ public function withHeight(float|string $height): self public function withRadius(float|string $radius): self { $obj = clone $this; - $obj->radius = $radius; + $obj['radius'] = $radius; return $obj; } @@ -164,7 +164,7 @@ public function withRadius(float|string $radius): self public function withWidth(float|string $width): self { $obj = clone $this; - $obj->width = $width; + $obj['width'] = $width; return $obj; } diff --git a/src/SrcOptions.php b/src/SrcOptions.php index a1c95b39..5227df84 100644 --- a/src/SrcOptions.php +++ b/src/SrcOptions.php @@ -129,13 +129,13 @@ public static function with( ): self { $obj = new self; - $obj->src = $src; - $obj->urlEndpoint = $urlEndpoint; + $obj['src'] = $src; + $obj['urlEndpoint'] = $urlEndpoint; - null !== $expiresIn && $obj->expiresIn = $expiresIn; - null !== $queryParameters && $obj->queryParameters = $queryParameters; - null !== $signed && $obj->signed = $signed; - null !== $transformation && $obj->transformation = $transformation; + null !== $expiresIn && $obj['expiresIn'] = $expiresIn; + null !== $queryParameters && $obj['queryParameters'] = $queryParameters; + null !== $signed && $obj['signed'] = $signed; + null !== $transformation && $obj['transformation'] = $transformation; null !== $transformationPosition && $obj['transformationPosition'] = $transformationPosition; return $obj; @@ -148,7 +148,7 @@ public static function with( public function withSrc(string $src): self { $obj = clone $this; - $obj->src = $src; + $obj['src'] = $src; return $obj; } @@ -159,7 +159,7 @@ public function withSrc(string $src): self public function withURLEndpoint(string $urlEndpoint): self { $obj = clone $this; - $obj->urlEndpoint = $urlEndpoint; + $obj['urlEndpoint'] = $urlEndpoint; return $obj; } @@ -177,7 +177,7 @@ public function withURLEndpoint(string $urlEndpoint): self public function withExpiresIn(float $expiresIn): self { $obj = clone $this; - $obj->expiresIn = $expiresIn; + $obj['expiresIn'] = $expiresIn; return $obj; } @@ -192,7 +192,7 @@ public function withExpiresIn(float $expiresIn): self public function withQueryParameters(array $queryParameters): self { $obj = clone $this; - $obj->queryParameters = $queryParameters; + $obj['queryParameters'] = $queryParameters; return $obj; } @@ -206,7 +206,7 @@ public function withQueryParameters(array $queryParameters): self public function withSigned(bool $signed): self { $obj = clone $this; - $obj->signed = $signed; + $obj['signed'] = $signed; return $obj; } @@ -220,7 +220,7 @@ public function withSigned(bool $signed): self public function withTransformation(array $transformation): self { $obj = clone $this; - $obj->transformation = $transformation; + $obj['transformation'] = $transformation; return $obj; } diff --git a/src/SubtitleOverlay.php b/src/SubtitleOverlay.php index 7b847251..b0756d26 100644 --- a/src/SubtitleOverlay.php +++ b/src/SubtitleOverlay.php @@ -7,7 +7,9 @@ use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\OverlayPosition\Focus; use ImageKit\SubtitleOverlay\Encoding; +use ImageKit\SubtitleOverlayTransformation\Typography; /** * @phpstan-type SubtitleOverlayShape = array{ @@ -83,40 +85,68 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * + * @param OverlayPosition|array{ + * focus?: value-of|null, x?: float|string|null, y?: float|string|null + * } $position + * @param OverlayTiming|array{ + * duration?: float|string|null, + * end?: float|string|null, + * start?: float|string|null, + * } $timing * @param Encoding|value-of $encoding - * @param list $transformation + * @param list|null, + * }> $transformation */ public static function with( string $input, - ?OverlayPosition $position = null, - ?OverlayTiming $timing = null, + OverlayPosition|array|null $position = null, + OverlayTiming|array|null $timing = null, Encoding|string|null $encoding = null, ?array $transformation = null, ): self { $obj = new self; - $obj->input = $input; + $obj['input'] = $input; - null !== $position && $obj->position = $position; - null !== $timing && $obj->timing = $timing; + null !== $position && $obj['position'] = $position; + null !== $timing && $obj['timing'] = $timing; null !== $encoding && $obj['encoding'] = $encoding; - null !== $transformation && $obj->transformation = $transformation; + null !== $transformation && $obj['transformation'] = $transformation; return $obj; } - public function withPosition(OverlayPosition $position): self + /** + * @param OverlayPosition|array{ + * focus?: value-of|null, x?: float|string|null, y?: float|string|null + * } $position + */ + public function withPosition(OverlayPosition|array $position): self { $obj = clone $this; - $obj->position = $position; + $obj['position'] = $position; return $obj; } - public function withTiming(OverlayTiming $timing): self + /** + * @param OverlayTiming|array{ + * duration?: float|string|null, + * end?: float|string|null, + * start?: float|string|null, + * } $timing + */ + public function withTiming(OverlayTiming|array $timing): self { $obj = clone $this; - $obj->timing = $timing; + $obj['timing'] = $timing; return $obj; } @@ -127,7 +157,7 @@ public function withTiming(OverlayTiming $timing): self public function withInput(string $input): self { $obj = clone $this; - $obj->input = $input; + $obj['input'] = $input; return $obj; } @@ -151,12 +181,20 @@ public function withEncoding(Encoding|string $encoding): self /** * Control styling of the subtitle. See [Styling subtitles](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer). * - * @param list $transformation + * @param list|null, + * }> $transformation */ public function withTransformation(array $transformation): self { $obj = clone $this; - $obj->transformation = $transformation; + $obj['transformation'] = $transformation; return $obj; } diff --git a/src/SubtitleOverlayTransformation.php b/src/SubtitleOverlayTransformation.php index 3b9ab809..fc35d23f 100644 --- a/src/SubtitleOverlayTransformation.php +++ b/src/SubtitleOverlayTransformation.php @@ -110,12 +110,12 @@ public static function with( ): self { $obj = new self; - null !== $background && $obj->background = $background; - null !== $color && $obj->color = $color; - null !== $fontFamily && $obj->fontFamily = $fontFamily; - null !== $fontOutline && $obj->fontOutline = $fontOutline; - null !== $fontShadow && $obj->fontShadow = $fontShadow; - null !== $fontSize && $obj->fontSize = $fontSize; + null !== $background && $obj['background'] = $background; + null !== $color && $obj['color'] = $color; + null !== $fontFamily && $obj['fontFamily'] = $fontFamily; + null !== $fontOutline && $obj['fontOutline'] = $fontOutline; + null !== $fontShadow && $obj['fontShadow'] = $fontShadow; + null !== $fontSize && $obj['fontSize'] = $fontSize; null !== $typography && $obj['typography'] = $typography; return $obj; @@ -129,7 +129,7 @@ public static function with( public function withBackground(string $background): self { $obj = clone $this; - $obj->background = $background; + $obj['background'] = $background; return $obj; } @@ -142,7 +142,7 @@ public function withBackground(string $background): self public function withColor(string $color): self { $obj = clone $this; - $obj->color = $color; + $obj['color'] = $color; return $obj; } @@ -153,7 +153,7 @@ public function withColor(string $color): self public function withFontFamily(string $fontFamily): self { $obj = clone $this; - $obj->fontFamily = $fontFamily; + $obj['fontFamily'] = $fontFamily; return $obj; } @@ -168,7 +168,7 @@ public function withFontFamily(string $fontFamily): self public function withFontOutline(string $fontOutline): self { $obj = clone $this; - $obj->fontOutline = $fontOutline; + $obj['fontOutline'] = $fontOutline; return $obj; } @@ -183,7 +183,7 @@ public function withFontOutline(string $fontOutline): self public function withFontShadow(string $fontShadow): self { $obj = clone $this; - $obj->fontShadow = $fontShadow; + $obj['fontShadow'] = $fontShadow; return $obj; } @@ -196,7 +196,7 @@ public function withFontShadow(string $fontShadow): self public function withFontSize(float $fontSize): self { $obj = clone $this; - $obj->fontSize = $fontSize; + $obj['fontSize'] = $fontSize; return $obj; } diff --git a/src/TextOverlay.php b/src/TextOverlay.php index d8488d0e..bdcebe56 100644 --- a/src/TextOverlay.php +++ b/src/TextOverlay.php @@ -7,7 +7,10 @@ use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\OverlayPosition\Focus; use ImageKit\TextOverlay\Encoding; +use ImageKit\TextOverlayTransformation\Flip; +use ImageKit\TextOverlayTransformation\InnerAlignment; /** * @phpstan-type TextOverlayShape = array{ @@ -83,40 +86,74 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * + * @param OverlayPosition|array{ + * focus?: value-of|null, x?: float|string|null, y?: float|string|null + * } $position + * @param OverlayTiming|array{ + * duration?: float|string|null, + * end?: float|string|null, + * start?: float|string|null, + * } $timing * @param Encoding|value-of $encoding - * @param list $transformation + * @param list|null, + * fontColor?: string|null, + * fontFamily?: string|null, + * fontSize?: float|string|null, + * innerAlignment?: value-of|null, + * lineHeight?: float|string|null, + * padding?: float|string|null, + * radius?: float|'max'|null, + * rotation?: float|string|null, + * typography?: string|null, + * width?: float|string|null, + * }> $transformation */ public static function with( string $text, - ?OverlayPosition $position = null, - ?OverlayTiming $timing = null, + OverlayPosition|array|null $position = null, + OverlayTiming|array|null $timing = null, Encoding|string|null $encoding = null, ?array $transformation = null, ): self { $obj = new self; - $obj->text = $text; + $obj['text'] = $text; - null !== $position && $obj->position = $position; - null !== $timing && $obj->timing = $timing; + null !== $position && $obj['position'] = $position; + null !== $timing && $obj['timing'] = $timing; null !== $encoding && $obj['encoding'] = $encoding; - null !== $transformation && $obj->transformation = $transformation; + null !== $transformation && $obj['transformation'] = $transformation; return $obj; } - public function withPosition(OverlayPosition $position): self + /** + * @param OverlayPosition|array{ + * focus?: value-of|null, x?: float|string|null, y?: float|string|null + * } $position + */ + public function withPosition(OverlayPosition|array $position): self { $obj = clone $this; - $obj->position = $position; + $obj['position'] = $position; return $obj; } - public function withTiming(OverlayTiming $timing): self + /** + * @param OverlayTiming|array{ + * duration?: float|string|null, + * end?: float|string|null, + * start?: float|string|null, + * } $timing + */ + public function withTiming(OverlayTiming|array $timing): self { $obj = clone $this; - $obj->timing = $timing; + $obj['timing'] = $timing; return $obj; } @@ -127,7 +164,7 @@ public function withTiming(OverlayTiming $timing): self public function withText(string $text): self { $obj = clone $this; - $obj->text = $text; + $obj['text'] = $text; return $obj; } @@ -151,12 +188,26 @@ public function withEncoding(Encoding|string $encoding): self /** * Control styling of the text overlay. See [Text overlays](https://imagekit.io/docs/add-overlays-on-images#text-overlay). * - * @param list $transformation + * @param list|null, + * fontColor?: string|null, + * fontFamily?: string|null, + * fontSize?: float|string|null, + * innerAlignment?: value-of|null, + * lineHeight?: float|string|null, + * padding?: float|string|null, + * radius?: float|'max'|null, + * rotation?: float|string|null, + * typography?: string|null, + * width?: float|string|null, + * }> $transformation */ public function withTransformation(array $transformation): self { $obj = clone $this; - $obj->transformation = $transformation; + $obj['transformation'] = $transformation; return $obj; } diff --git a/src/TextOverlayTransformation.php b/src/TextOverlayTransformation.php index b7cf6087..621a3c16 100644 --- a/src/TextOverlayTransformation.php +++ b/src/TextOverlayTransformation.php @@ -158,19 +158,19 @@ public static function with( ): self { $obj = new self; - null !== $alpha && $obj->alpha = $alpha; - null !== $background && $obj->background = $background; + null !== $alpha && $obj['alpha'] = $alpha; + null !== $background && $obj['background'] = $background; null !== $flip && $obj['flip'] = $flip; - null !== $fontColor && $obj->fontColor = $fontColor; - null !== $fontFamily && $obj->fontFamily = $fontFamily; - null !== $fontSize && $obj->fontSize = $fontSize; + null !== $fontColor && $obj['fontColor'] = $fontColor; + null !== $fontFamily && $obj['fontFamily'] = $fontFamily; + null !== $fontSize && $obj['fontSize'] = $fontSize; null !== $innerAlignment && $obj['innerAlignment'] = $innerAlignment; - null !== $lineHeight && $obj->lineHeight = $lineHeight; - null !== $padding && $obj->padding = $padding; - null !== $radius && $obj->radius = $radius; - null !== $rotation && $obj->rotation = $rotation; - null !== $typography && $obj->typography = $typography; - null !== $width && $obj->width = $width; + null !== $lineHeight && $obj['lineHeight'] = $lineHeight; + null !== $padding && $obj['padding'] = $padding; + null !== $radius && $obj['radius'] = $radius; + null !== $rotation && $obj['rotation'] = $rotation; + null !== $typography && $obj['typography'] = $typography; + null !== $width && $obj['width'] = $width; return $obj; } @@ -181,7 +181,7 @@ public static function with( public function withAlpha(float $alpha): self { $obj = clone $this; - $obj->alpha = $alpha; + $obj['alpha'] = $alpha; return $obj; } @@ -193,7 +193,7 @@ public function withAlpha(float $alpha): self public function withBackground(string $background): self { $obj = clone $this; - $obj->background = $background; + $obj['background'] = $background; return $obj; } @@ -217,7 +217,7 @@ public function withFlip(Flip|string $flip): self public function withFontColor(string $fontColor): self { $obj = clone $this; - $obj->fontColor = $fontColor; + $obj['fontColor'] = $fontColor; return $obj; } @@ -229,7 +229,7 @@ public function withFontColor(string $fontColor): self public function withFontFamily(string $fontFamily): self { $obj = clone $this; - $obj->fontFamily = $fontFamily; + $obj['fontFamily'] = $fontFamily; return $obj; } @@ -240,7 +240,7 @@ public function withFontFamily(string $fontFamily): self public function withFontSize(float|string $fontSize): self { $obj = clone $this; - $obj->fontSize = $fontSize; + $obj['fontSize'] = $fontSize; return $obj; } @@ -266,7 +266,7 @@ public function withInnerAlignment( public function withLineHeight(float|string $lineHeight): self { $obj = clone $this; - $obj->lineHeight = $lineHeight; + $obj['lineHeight'] = $lineHeight; return $obj; } @@ -279,7 +279,7 @@ public function withLineHeight(float|string $lineHeight): self public function withPadding(float|string $padding): self { $obj = clone $this; - $obj->padding = $padding; + $obj['padding'] = $padding; return $obj; } @@ -293,7 +293,7 @@ public function withPadding(float|string $padding): self public function withRadius(float|string $radius): self { $obj = clone $this; - $obj->radius = $radius; + $obj['radius'] = $radius; return $obj; } @@ -305,7 +305,7 @@ public function withRadius(float|string $radius): self public function withRotation(float|string $rotation): self { $obj = clone $this; - $obj->rotation = $rotation; + $obj['rotation'] = $rotation; return $obj; } @@ -319,7 +319,7 @@ public function withRotation(float|string $rotation): self public function withTypography(string $typography): self { $obj = clone $this; - $obj->typography = $typography; + $obj['typography'] = $typography; return $obj; } @@ -331,7 +331,7 @@ public function withTypography(string $typography): self public function withWidth(float|string $width): self { $obj = clone $this; - $obj->width = $width; + $obj['width'] = $width; return $obj; } diff --git a/src/Transformation.php b/src/Transformation.php index 6f3be054..aec21b27 100644 --- a/src/Transformation.php +++ b/src/Transformation.php @@ -566,58 +566,58 @@ public static function with( ): self { $obj = new self; - null !== $aiChangeBackground && $obj->aiChangeBackground = $aiChangeBackground; - null !== $aiDropShadow && $obj->aiDropShadow = $aiDropShadow; - null !== $aiEdit && $obj->aiEdit = $aiEdit; - null !== $aiRemoveBackground && $obj->aiRemoveBackground = $aiRemoveBackground; - null !== $aiRemoveBackgroundExternal && $obj->aiRemoveBackgroundExternal = $aiRemoveBackgroundExternal; - null !== $aiRetouch && $obj->aiRetouch = $aiRetouch; - null !== $aiUpscale && $obj->aiUpscale = $aiUpscale; - null !== $aiVariation && $obj->aiVariation = $aiVariation; - null !== $aspectRatio && $obj->aspectRatio = $aspectRatio; + null !== $aiChangeBackground && $obj['aiChangeBackground'] = $aiChangeBackground; + null !== $aiDropShadow && $obj['aiDropShadow'] = $aiDropShadow; + null !== $aiEdit && $obj['aiEdit'] = $aiEdit; + null !== $aiRemoveBackground && $obj['aiRemoveBackground'] = $aiRemoveBackground; + null !== $aiRemoveBackgroundExternal && $obj['aiRemoveBackgroundExternal'] = $aiRemoveBackgroundExternal; + null !== $aiRetouch && $obj['aiRetouch'] = $aiRetouch; + null !== $aiUpscale && $obj['aiUpscale'] = $aiUpscale; + null !== $aiVariation && $obj['aiVariation'] = $aiVariation; + null !== $aspectRatio && $obj['aspectRatio'] = $aspectRatio; null !== $audioCodec && $obj['audioCodec'] = $audioCodec; - null !== $background && $obj->background = $background; - null !== $blur && $obj->blur = $blur; - null !== $border && $obj->border = $border; - null !== $colorProfile && $obj->colorProfile = $colorProfile; - null !== $contrastStretch && $obj->contrastStretch = $contrastStretch; + null !== $background && $obj['background'] = $background; + null !== $blur && $obj['blur'] = $blur; + null !== $border && $obj['border'] = $border; + null !== $colorProfile && $obj['colorProfile'] = $colorProfile; + null !== $contrastStretch && $obj['contrastStretch'] = $contrastStretch; null !== $crop && $obj['crop'] = $crop; null !== $cropMode && $obj['cropMode'] = $cropMode; - null !== $defaultImage && $obj->defaultImage = $defaultImage; - null !== $dpr && $obj->dpr = $dpr; - null !== $duration && $obj->duration = $duration; - null !== $endOffset && $obj->endOffset = $endOffset; + null !== $defaultImage && $obj['defaultImage'] = $defaultImage; + null !== $dpr && $obj['dpr'] = $dpr; + null !== $duration && $obj['duration'] = $duration; + null !== $endOffset && $obj['endOffset'] = $endOffset; null !== $flip && $obj['flip'] = $flip; - null !== $focus && $obj->focus = $focus; + null !== $focus && $obj['focus'] = $focus; null !== $format && $obj['format'] = $format; - null !== $gradient && $obj->gradient = $gradient; - null !== $grayscale && $obj->grayscale = $grayscale; - null !== $height && $obj->height = $height; - null !== $lossless && $obj->lossless = $lossless; - null !== $metadata && $obj->metadata = $metadata; - null !== $named && $obj->named = $named; - null !== $opacity && $obj->opacity = $opacity; - null !== $original && $obj->original = $original; - null !== $overlay && $obj->overlay = $overlay; - null !== $page && $obj->page = $page; - null !== $progressive && $obj->progressive = $progressive; - null !== $quality && $obj->quality = $quality; - null !== $radius && $obj->radius = $radius; - null !== $raw && $obj->raw = $raw; - null !== $rotation && $obj->rotation = $rotation; - null !== $shadow && $obj->shadow = $shadow; - null !== $sharpen && $obj->sharpen = $sharpen; - null !== $startOffset && $obj->startOffset = $startOffset; + null !== $gradient && $obj['gradient'] = $gradient; + null !== $grayscale && $obj['grayscale'] = $grayscale; + null !== $height && $obj['height'] = $height; + null !== $lossless && $obj['lossless'] = $lossless; + null !== $metadata && $obj['metadata'] = $metadata; + null !== $named && $obj['named'] = $named; + null !== $opacity && $obj['opacity'] = $opacity; + null !== $original && $obj['original'] = $original; + null !== $overlay && $obj['overlay'] = $overlay; + null !== $page && $obj['page'] = $page; + null !== $progressive && $obj['progressive'] = $progressive; + null !== $quality && $obj['quality'] = $quality; + null !== $radius && $obj['radius'] = $radius; + null !== $raw && $obj['raw'] = $raw; + null !== $rotation && $obj['rotation'] = $rotation; + null !== $shadow && $obj['shadow'] = $shadow; + null !== $sharpen && $obj['sharpen'] = $sharpen; + null !== $startOffset && $obj['startOffset'] = $startOffset; null !== $streamingResolutions && $obj['streamingResolutions'] = $streamingResolutions; - null !== $trim && $obj->trim = $trim; - null !== $unsharpMask && $obj->unsharpMask = $unsharpMask; + null !== $trim && $obj['trim'] = $trim; + null !== $unsharpMask && $obj['unsharpMask'] = $unsharpMask; null !== $videoCodec && $obj['videoCodec'] = $videoCodec; - null !== $width && $obj->width = $width; - null !== $x && $obj->x = $x; - null !== $xCenter && $obj->xCenter = $xCenter; - null !== $y && $obj->y = $y; - null !== $yCenter && $obj->yCenter = $yCenter; - null !== $zoom && $obj->zoom = $zoom; + null !== $width && $obj['width'] = $width; + null !== $x && $obj['x'] = $x; + null !== $xCenter && $obj['xCenter'] = $xCenter; + null !== $y && $obj['y'] = $y; + null !== $yCenter && $obj['yCenter'] = $yCenter; + null !== $zoom && $obj['zoom'] = $zoom; return $obj; } @@ -631,7 +631,7 @@ public static function with( public function withAIChangeBackground(string $aiChangeBackground): self { $obj = clone $this; - $obj->aiChangeBackground = $aiChangeBackground; + $obj['aiChangeBackground'] = $aiChangeBackground; return $obj; } @@ -646,7 +646,7 @@ public function withAIChangeBackground(string $aiChangeBackground): self public function withAIDropShadow(string|bool $aiDropShadow): self { $obj = clone $this; - $obj->aiDropShadow = $aiDropShadow; + $obj['aiDropShadow'] = $aiDropShadow; return $obj; } @@ -660,7 +660,7 @@ public function withAIDropShadow(string|bool $aiDropShadow): self public function withAIEdit(string $aiEdit): self { $obj = clone $this; - $obj->aiEdit = $aiEdit; + $obj['aiEdit'] = $aiEdit; return $obj; } @@ -673,7 +673,7 @@ public function withAIEdit(string $aiEdit): self public function withAIRemoveBackground(bool $aiRemoveBackground): self { $obj = clone $this; - $obj->aiRemoveBackground = $aiRemoveBackground; + $obj['aiRemoveBackground'] = $aiRemoveBackground; return $obj; } @@ -688,7 +688,7 @@ public function withAIRemoveBackgroundExternal( bool $aiRemoveBackgroundExternal ): self { $obj = clone $this; - $obj->aiRemoveBackgroundExternal = $aiRemoveBackgroundExternal; + $obj['aiRemoveBackgroundExternal'] = $aiRemoveBackgroundExternal; return $obj; } @@ -700,7 +700,7 @@ public function withAIRemoveBackgroundExternal( public function withAIRetouch(bool $aiRetouch): self { $obj = clone $this; - $obj->aiRetouch = $aiRetouch; + $obj['aiRetouch'] = $aiRetouch; return $obj; } @@ -712,7 +712,7 @@ public function withAIRetouch(bool $aiRetouch): self public function withAIUpscale(bool $aiUpscale): self { $obj = clone $this; - $obj->aiUpscale = $aiUpscale; + $obj['aiUpscale'] = $aiUpscale; return $obj; } @@ -725,7 +725,7 @@ public function withAIUpscale(bool $aiUpscale): self public function withAIVariation(bool $aiVariation): self { $obj = clone $this; - $obj->aiVariation = $aiVariation; + $obj['aiVariation'] = $aiVariation; return $obj; } @@ -738,7 +738,7 @@ public function withAIVariation(bool $aiVariation): self public function withAspectRatio(float|string $aspectRatio): self { $obj = clone $this; - $obj->aspectRatio = $aspectRatio; + $obj['aspectRatio'] = $aspectRatio; return $obj; } @@ -766,7 +766,7 @@ public function withAudioCodec(AudioCodec|string $audioCodec): self public function withBackground(string $background): self { $obj = clone $this; - $obj->background = $background; + $obj['background'] = $background; return $obj; } @@ -778,7 +778,7 @@ public function withBackground(string $background): self public function withBlur(float $blur): self { $obj = clone $this; - $obj->blur = $blur; + $obj['blur'] = $blur; return $obj; } @@ -791,7 +791,7 @@ public function withBlur(float $blur): self public function withBorder(string $border): self { $obj = clone $this; - $obj->border = $border; + $obj['border'] = $border; return $obj; } @@ -803,7 +803,7 @@ public function withBorder(string $border): self public function withColorProfile(bool $colorProfile): self { $obj = clone $this; - $obj->colorProfile = $colorProfile; + $obj['colorProfile'] = $colorProfile; return $obj; } @@ -815,7 +815,7 @@ public function withColorProfile(bool $colorProfile): self public function withContrastStretch(bool $contrastStretch): self { $obj = clone $this; - $obj->contrastStretch = $contrastStretch; + $obj['contrastStretch'] = $contrastStretch; return $obj; } @@ -853,7 +853,7 @@ public function withCropMode(CropMode|string $cropMode): self public function withDefaultImage(string $defaultImage): self { $obj = clone $this; - $obj->defaultImage = $defaultImage; + $obj['defaultImage'] = $defaultImage; return $obj; } @@ -865,7 +865,7 @@ public function withDefaultImage(string $defaultImage): self public function withDpr(float $dpr): self { $obj = clone $this; - $obj->dpr = $dpr; + $obj['dpr'] = $dpr; return $obj; } @@ -878,7 +878,7 @@ public function withDpr(float $dpr): self public function withDuration(float|string $duration): self { $obj = clone $this; - $obj->duration = $duration; + $obj['duration'] = $duration; return $obj; } @@ -891,7 +891,7 @@ public function withDuration(float|string $duration): self public function withEndOffset(float|string $endOffset): self { $obj = clone $this; - $obj->endOffset = $endOffset; + $obj['endOffset'] = $endOffset; return $obj; } @@ -922,7 +922,7 @@ public function withFlip(Flip|string $flip): self public function withFocus(string $focus): self { $obj = clone $this; - $obj->focus = $focus; + $obj['focus'] = $focus; return $obj; } @@ -950,7 +950,7 @@ public function withFormat(Format|string $format): self public function withGradient(string|bool $gradient): self { $obj = clone $this; - $obj->gradient = $gradient; + $obj['gradient'] = $gradient; return $obj; } @@ -961,7 +961,7 @@ public function withGradient(string|bool $gradient): self public function withGrayscale(bool $grayscale): self { $obj = clone $this; - $obj->grayscale = $grayscale; + $obj['grayscale'] = $grayscale; return $obj; } @@ -974,7 +974,7 @@ public function withGrayscale(bool $grayscale): self public function withHeight(float|string $height): self { $obj = clone $this; - $obj->height = $height; + $obj['height'] = $height; return $obj; } @@ -986,7 +986,7 @@ public function withHeight(float|string $height): self public function withLossless(bool $lossless): self { $obj = clone $this; - $obj->lossless = $lossless; + $obj['lossless'] = $lossless; return $obj; } @@ -999,7 +999,7 @@ public function withLossless(bool $lossless): self public function withMetadata(bool $metadata): self { $obj = clone $this; - $obj->metadata = $metadata; + $obj['metadata'] = $metadata; return $obj; } @@ -1010,7 +1010,7 @@ public function withMetadata(bool $metadata): self public function withNamed(string $named): self { $obj = clone $this; - $obj->named = $named; + $obj['named'] = $named; return $obj; } @@ -1021,7 +1021,7 @@ public function withNamed(string $named): self public function withOpacity(float $opacity): self { $obj = clone $this; - $obj->opacity = $opacity; + $obj['opacity'] = $opacity; return $obj; } @@ -1033,7 +1033,7 @@ public function withOpacity(float $opacity): self public function withOriginal(bool $original): self { $obj = clone $this; - $obj->original = $original; + $obj['original'] = $original; return $obj; } @@ -1046,7 +1046,7 @@ public function withOriginal(bool $original): self public function withOverlay(Overlay $overlay): self { $obj = clone $this; - $obj->overlay = $overlay; + $obj['overlay'] = $overlay; return $obj; } @@ -1060,7 +1060,7 @@ public function withOverlay(Overlay $overlay): self public function withPage(float|string $page): self { $obj = clone $this; - $obj->page = $page; + $obj['page'] = $page; return $obj; } @@ -1073,7 +1073,7 @@ public function withPage(float|string $page): self public function withProgressive(bool $progressive): self { $obj = clone $this; - $obj->progressive = $progressive; + $obj['progressive'] = $progressive; return $obj; } @@ -1086,7 +1086,7 @@ public function withProgressive(bool $progressive): self public function withQuality(float $quality): self { $obj = clone $this; - $obj->quality = $quality; + $obj['quality'] = $quality; return $obj; } @@ -1100,7 +1100,7 @@ public function withQuality(float $quality): self public function withRadius(float|string $radius): self { $obj = clone $this; - $obj->radius = $radius; + $obj['radius'] = $radius; return $obj; } @@ -1112,7 +1112,7 @@ public function withRadius(float|string $radius): self public function withRaw(string $raw): self { $obj = clone $this; - $obj->raw = $raw; + $obj['raw'] = $raw; return $obj; } @@ -1126,7 +1126,7 @@ public function withRaw(string $raw): self public function withRotation(float|string $rotation): self { $obj = clone $this; - $obj->rotation = $rotation; + $obj['rotation'] = $rotation; return $obj; } @@ -1140,7 +1140,7 @@ public function withRotation(float|string $rotation): self public function withShadow(string|bool $shadow): self { $obj = clone $this; - $obj->shadow = $shadow; + $obj['shadow'] = $shadow; return $obj; } @@ -1153,7 +1153,7 @@ public function withShadow(string|bool $shadow): self public function withSharpen(float|bool $sharpen): self { $obj = clone $this; - $obj->sharpen = $sharpen; + $obj['sharpen'] = $sharpen; return $obj; } @@ -1166,7 +1166,7 @@ public function withSharpen(float|bool $sharpen): self public function withStartOffset(float|string $startOffset): self { $obj = clone $this; - $obj->startOffset = $startOffset; + $obj['startOffset'] = $startOffset; return $obj; } @@ -1193,7 +1193,7 @@ public function withStreamingResolutions(array $streamingResolutions): self public function withTrim(float|bool $trim): self { $obj = clone $this; - $obj->trim = $trim; + $obj['trim'] = $trim; return $obj; } @@ -1206,7 +1206,7 @@ public function withTrim(float|bool $trim): self public function withUnsharpMask(string|bool $unsharpMask): self { $obj = clone $this; - $obj->unsharpMask = $unsharpMask; + $obj['unsharpMask'] = $unsharpMask; return $obj; } @@ -1232,7 +1232,7 @@ public function withVideoCodec(VideoCodec|string $videoCodec): self public function withWidth(float|string $width): self { $obj = clone $this; - $obj->width = $width; + $obj['width'] = $width; return $obj; } @@ -1243,7 +1243,7 @@ public function withWidth(float|string $width): self public function withX(float|string $x): self { $obj = clone $this; - $obj->x = $x; + $obj['x'] = $x; return $obj; } @@ -1254,7 +1254,7 @@ public function withX(float|string $x): self public function withXCenter(float|string $xCenter): self { $obj = clone $this; - $obj->xCenter = $xCenter; + $obj['xCenter'] = $xCenter; return $obj; } @@ -1265,7 +1265,7 @@ public function withXCenter(float|string $xCenter): self public function withY(float|string $y): self { $obj = clone $this; - $obj->y = $y; + $obj['y'] = $y; return $obj; } @@ -1276,7 +1276,7 @@ public function withY(float|string $y): self public function withYCenter(float|string $yCenter): self { $obj = clone $this; - $obj->yCenter = $yCenter; + $obj['yCenter'] = $yCenter; return $obj; } @@ -1289,7 +1289,7 @@ public function withYCenter(float|string $yCenter): self public function withZoom(float $zoom): self { $obj = clone $this; - $obj->zoom = $zoom; + $obj['zoom'] = $zoom; return $obj; } diff --git a/src/VideoOverlay.php b/src/VideoOverlay.php index 1d4ffbc7..03ee74e1 100644 --- a/src/VideoOverlay.php +++ b/src/VideoOverlay.php @@ -7,6 +7,7 @@ use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\OverlayPosition\Focus; use ImageKit\VideoOverlay\Encoding; /** @@ -84,40 +85,60 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * + * @param OverlayPosition|array{ + * focus?: value-of|null, x?: float|string|null, y?: float|string|null + * } $position + * @param OverlayTiming|array{ + * duration?: float|string|null, + * end?: float|string|null, + * start?: float|string|null, + * } $timing * @param Encoding|value-of $encoding * @param list $transformation */ public static function with( string $input, - ?OverlayPosition $position = null, - ?OverlayTiming $timing = null, + OverlayPosition|array|null $position = null, + OverlayTiming|array|null $timing = null, Encoding|string|null $encoding = null, ?array $transformation = null, ): self { $obj = new self; - $obj->input = $input; + $obj['input'] = $input; - null !== $position && $obj->position = $position; - null !== $timing && $obj->timing = $timing; + null !== $position && $obj['position'] = $position; + null !== $timing && $obj['timing'] = $timing; null !== $encoding && $obj['encoding'] = $encoding; - null !== $transformation && $obj->transformation = $transformation; + null !== $transformation && $obj['transformation'] = $transformation; return $obj; } - public function withPosition(OverlayPosition $position): self + /** + * @param OverlayPosition|array{ + * focus?: value-of|null, x?: float|string|null, y?: float|string|null + * } $position + */ + public function withPosition(OverlayPosition|array $position): self { $obj = clone $this; - $obj->position = $position; + $obj['position'] = $position; return $obj; } - public function withTiming(OverlayTiming $timing): self + /** + * @param OverlayTiming|array{ + * duration?: float|string|null, + * end?: float|string|null, + * start?: float|string|null, + * } $timing + */ + public function withTiming(OverlayTiming|array $timing): self { $obj = clone $this; - $obj->timing = $timing; + $obj['timing'] = $timing; return $obj; } @@ -128,7 +149,7 @@ public function withTiming(OverlayTiming $timing): self public function withInput(string $input): self { $obj = clone $this; - $obj->input = $input; + $obj['input'] = $input; return $obj; } @@ -158,7 +179,7 @@ public function withEncoding(Encoding|string $encoding): self public function withTransformation(array $transformation): self { $obj = clone $this; - $obj->transformation = $transformation; + $obj['transformation'] = $transformation; return $obj; } diff --git a/src/Webhooks/BaseWebhookEvent.php b/src/Webhooks/BaseWebhookEvent.php index 42cc512c..43921b82 100644 --- a/src/Webhooks/BaseWebhookEvent.php +++ b/src/Webhooks/BaseWebhookEvent.php @@ -56,8 +56,8 @@ public static function with(string $id, string $type): self { $obj = new self; - $obj->id = $id; - $obj->type = $type; + $obj['id'] = $id; + $obj['type'] = $type; return $obj; } @@ -68,7 +68,7 @@ public static function with(string $id, string $type): self public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -79,7 +79,7 @@ public function withID(string $id): self public function withType(string $type): self { $obj = clone $this; - $obj->type = $type; + $obj['type'] = $type; return $obj; } diff --git a/src/Webhooks/UploadPostTransformErrorEvent.php b/src/Webhooks/UploadPostTransformErrorEvent.php index 2aad71ac..cc3503dd 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent.php +++ b/src/Webhooks/UploadPostTransformErrorEvent.php @@ -8,6 +8,7 @@ use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; use ImageKit\Webhooks\UploadPostTransformErrorEvent\Data; +use ImageKit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation; use ImageKit\Webhooks\UploadPostTransformErrorEvent\Request; /** @@ -80,21 +81,33 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Data|array{ + * fileId: string, + * name: string, + * path: string, + * transformation: Transformation, + * url: string, + * } $data + * @param Request|array{ + * transformation: Request\Transformation, + * x_request_id: string, + * } $request */ public static function with( string $id, string $type, \DateTimeInterface $created_at, - Data $data, - Request $request, + Data|array $data, + Request|array $request, ): self { $obj = new self; - $obj->id = $id; - $obj->type = $type; - $obj->created_at = $created_at; - $obj->data = $data; - $obj->request = $request; + $obj['id'] = $id; + $obj['type'] = $type; + $obj['created_at'] = $created_at; + $obj['data'] = $data; + $obj['request'] = $request; return $obj; } @@ -105,7 +118,7 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -116,7 +129,7 @@ public function withID(string $id): self public function withType(string $type): self { $obj = clone $this; - $obj->type = $type; + $obj['type'] = $type; return $obj; } @@ -127,23 +140,38 @@ public function withType(string $type): self public function withCreatedAt(\DateTimeInterface $createdAt): self { $obj = clone $this; - $obj->created_at = $createdAt; + $obj['created_at'] = $createdAt; return $obj; } - public function withData(Data $data): self + /** + * @param Data|array{ + * fileId: string, + * name: string, + * path: string, + * transformation: Transformation, + * url: string, + * } $data + */ + public function withData(Data|array $data): self { $obj = clone $this; - $obj->data = $data; + $obj['data'] = $data; return $obj; } - public function withRequest(Request $request): self + /** + * @param Request|array{ + * transformation: Request\Transformation, + * x_request_id: string, + * } $request + */ + public function withRequest(Request|array $request): self { $obj = clone $this; - $obj->request = $request; + $obj['request'] = $request; return $obj; } diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data.php b/src/Webhooks/UploadPostTransformErrorEvent/Data.php index 3d9331db..c39f11d7 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Data.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data.php @@ -8,6 +8,7 @@ use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; use ImageKit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation; +use ImageKit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation\Error; /** * @phpstan-type DataShape = array{ @@ -78,21 +79,23 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Transformation|array{error: Error} $transformation */ public static function with( string $fileId, string $name, string $path, - Transformation $transformation, + Transformation|array $transformation, string $url, ): self { $obj = new self; - $obj->fileId = $fileId; - $obj->name = $name; - $obj->path = $path; - $obj->transformation = $transformation; - $obj->url = $url; + $obj['fileId'] = $fileId; + $obj['name'] = $name; + $obj['path'] = $path; + $obj['transformation'] = $transformation; + $obj['url'] = $url; return $obj; } @@ -103,7 +106,7 @@ public static function with( public function withFileID(string $fileID): self { $obj = clone $this; - $obj->fileId = $fileID; + $obj['fileId'] = $fileID; return $obj; } @@ -114,7 +117,7 @@ public function withFileID(string $fileID): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -125,15 +128,19 @@ public function withName(string $name): self public function withPath(string $path): self { $obj = clone $this; - $obj->path = $path; + $obj['path'] = $path; return $obj; } - public function withTransformation(Transformation $transformation): self - { + /** + * @param Transformation|array{error: Error} $transformation + */ + public function withTransformation( + Transformation|array $transformation + ): self { $obj = clone $this; - $obj->transformation = $transformation; + $obj['transformation'] = $transformation; return $obj; } @@ -144,7 +151,7 @@ public function withTransformation(Transformation $transformation): self public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php index 236638dd..c1925b42 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php @@ -43,20 +43,25 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Error|array{reason: string} $error */ - public static function with(Error $error): self + public static function with(Error|array $error): self { $obj = new self; - $obj->error = $error; + $obj['error'] = $error; return $obj; } - public function withError(Error $error): self + /** + * @param Error|array{reason: string} $error + */ + public function withError(Error|array $error): self { $obj = clone $this; - $obj->error = $error; + $obj['error'] = $error; return $obj; } diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php index acd1bd95..e628b2db 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php @@ -50,7 +50,7 @@ public static function with(string $reason): self { $obj = new self; - $obj->reason = $reason; + $obj['reason'] = $reason; return $obj; } @@ -61,7 +61,7 @@ public static function with(string $reason): self public function withReason(string $reason): self { $obj = clone $this; - $obj->reason = $reason; + $obj['reason'] = $reason; return $obj; } diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request.php b/src/Webhooks/UploadPostTransformErrorEvent/Request.php index 13988778..387cf479 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request.php @@ -8,6 +8,8 @@ use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; use ImageKit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation; +use ImageKit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation\Protocol; +use ImageKit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation\Type; /** * @phpstan-type RequestShape = array{ @@ -51,23 +53,33 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Transformation|array{ + * type: value-of, protocol?: value-of|null, value?: string|null + * } $transformation */ public static function with( - Transformation $transformation, + Transformation|array $transformation, string $x_request_id ): self { $obj = new self; - $obj->transformation = $transformation; - $obj->x_request_id = $x_request_id; + $obj['transformation'] = $transformation; + $obj['x_request_id'] = $x_request_id; return $obj; } - public function withTransformation(Transformation $transformation): self - { + /** + * @param Transformation|array{ + * type: value-of, protocol?: value-of|null, value?: string|null + * } $transformation + */ + public function withTransformation( + Transformation|array $transformation + ): self { $obj = clone $this; - $obj->transformation = $transformation; + $obj['transformation'] = $transformation; return $obj; } @@ -78,7 +90,7 @@ public function withTransformation(Transformation $transformation): self public function withXRequestID(string $xRequestID): self { $obj = clone $this; - $obj->x_request_id = $xRequestID; + $obj['x_request_id'] = $xRequestID; return $obj; } diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php index a41b9413..f4852e88 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php @@ -79,7 +79,7 @@ public static function with( $obj['type'] = $type; null !== $protocol && $obj['protocol'] = $protocol; - null !== $value && $obj->value = $value; + null !== $value && $obj['value'] = $value; return $obj; } @@ -116,7 +116,7 @@ public function withProtocol(Protocol|string $protocol): self public function withValue(string $value): self { $obj = clone $this; - $obj->value = $value; + $obj['value'] = $value; return $obj; } diff --git a/src/Webhooks/UploadPostTransformSuccessEvent.php b/src/Webhooks/UploadPostTransformSuccessEvent.php index 169daba2..f6f4deeb 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent.php @@ -9,6 +9,7 @@ use ImageKit\Core\Contracts\BaseModel; use ImageKit\Webhooks\UploadPostTransformSuccessEvent\Data; use ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request; +use ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation; /** * Triggered when a post-transformation completes successfully. The transformed version of the file is now ready and can be accessed via the provided URL. Note that each post-transformation generates a separate webhook event. @@ -80,21 +81,26 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Data|array{fileId: string, name: string, url: string} $data + * @param Request|array{ + * transformation: Transformation, x_request_id: string + * } $request */ public static function with( string $id, string $type, \DateTimeInterface $created_at, - Data $data, - Request $request, + Data|array $data, + Request|array $request, ): self { $obj = new self; - $obj->id = $id; - $obj->type = $type; - $obj->created_at = $created_at; - $obj->data = $data; - $obj->request = $request; + $obj['id'] = $id; + $obj['type'] = $type; + $obj['created_at'] = $created_at; + $obj['data'] = $data; + $obj['request'] = $request; return $obj; } @@ -105,7 +111,7 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -116,7 +122,7 @@ public function withID(string $id): self public function withType(string $type): self { $obj = clone $this; - $obj->type = $type; + $obj['type'] = $type; return $obj; } @@ -127,23 +133,31 @@ public function withType(string $type): self public function withCreatedAt(\DateTimeInterface $createdAt): self { $obj = clone $this; - $obj->created_at = $createdAt; + $obj['created_at'] = $createdAt; return $obj; } - public function withData(Data $data): self + /** + * @param Data|array{fileId: string, name: string, url: string} $data + */ + public function withData(Data|array $data): self { $obj = clone $this; - $obj->data = $data; + $obj['data'] = $data; return $obj; } - public function withRequest(Request $request): self + /** + * @param Request|array{ + * transformation: Transformation, x_request_id: string + * } $request + */ + public function withRequest(Request|array $request): self { $obj = clone $this; - $obj->request = $request; + $obj['request'] = $request; return $obj; } diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Data.php b/src/Webhooks/UploadPostTransformSuccessEvent/Data.php index 58204e4c..b3ba5cb6 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Data.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Data.php @@ -62,9 +62,9 @@ public static function with(string $fileId, string $name, string $url): self { $obj = new self; - $obj->fileId = $fileId; - $obj->name = $name; - $obj->url = $url; + $obj['fileId'] = $fileId; + $obj['name'] = $name; + $obj['url'] = $url; return $obj; } @@ -75,7 +75,7 @@ public static function with(string $fileId, string $name, string $url): self public function withFileID(string $fileID): self { $obj = clone $this; - $obj->fileId = $fileID; + $obj['fileId'] = $fileID; return $obj; } @@ -86,7 +86,7 @@ public function withFileID(string $fileID): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -97,7 +97,7 @@ public function withName(string $name): self public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request.php index 107c6fac..bcfa762e 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request.php @@ -8,6 +8,8 @@ use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; use ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation; +use ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation\Protocol; +use ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation\Type; /** * @phpstan-type RequestShape = array{ @@ -51,23 +53,33 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Transformation|array{ + * type: value-of, protocol?: value-of|null, value?: string|null + * } $transformation */ public static function with( - Transformation $transformation, + Transformation|array $transformation, string $x_request_id ): self { $obj = new self; - $obj->transformation = $transformation; - $obj->x_request_id = $x_request_id; + $obj['transformation'] = $transformation; + $obj['x_request_id'] = $x_request_id; return $obj; } - public function withTransformation(Transformation $transformation): self - { + /** + * @param Transformation|array{ + * type: value-of, protocol?: value-of|null, value?: string|null + * } $transformation + */ + public function withTransformation( + Transformation|array $transformation + ): self { $obj = clone $this; - $obj->transformation = $transformation; + $obj['transformation'] = $transformation; return $obj; } @@ -78,7 +90,7 @@ public function withTransformation(Transformation $transformation): self public function withXRequestID(string $xRequestID): self { $obj = clone $this; - $obj->x_request_id = $xRequestID; + $obj['x_request_id'] = $xRequestID; return $obj; } diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php index 5204dc6f..b71282f2 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php @@ -79,7 +79,7 @@ public static function with( $obj['type'] = $type; null !== $protocol && $obj['protocol'] = $protocol; - null !== $value && $obj->value = $value; + null !== $value && $obj['value'] = $value; return $obj; } @@ -116,7 +116,7 @@ public function withProtocol(Protocol|string $protocol): self public function withValue(string $value): self { $obj = clone $this; - $obj->value = $value; + $obj['value'] = $value; return $obj; } diff --git a/src/Webhooks/UploadPreTransformErrorEvent.php b/src/Webhooks/UploadPreTransformErrorEvent.php index e0c4277e..8ba413a9 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent.php +++ b/src/Webhooks/UploadPreTransformErrorEvent.php @@ -8,6 +8,7 @@ use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; use ImageKit\Webhooks\UploadPreTransformErrorEvent\Data; +use ImageKit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation; use ImageKit\Webhooks\UploadPreTransformErrorEvent\Request; /** @@ -80,21 +81,26 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Data|array{ + * name: string, path: string, transformation: Transformation + * } $data + * @param Request|array{transformation: string, x_request_id: string} $request */ public static function with( string $id, string $type, \DateTimeInterface $created_at, - Data $data, - Request $request, + Data|array $data, + Request|array $request, ): self { $obj = new self; - $obj->id = $id; - $obj->type = $type; - $obj->created_at = $created_at; - $obj->data = $data; - $obj->request = $request; + $obj['id'] = $id; + $obj['type'] = $type; + $obj['created_at'] = $created_at; + $obj['data'] = $data; + $obj['request'] = $request; return $obj; } @@ -105,7 +111,7 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -116,7 +122,7 @@ public function withID(string $id): self public function withType(string $type): self { $obj = clone $this; - $obj->type = $type; + $obj['type'] = $type; return $obj; } @@ -127,23 +133,31 @@ public function withType(string $type): self public function withCreatedAt(\DateTimeInterface $createdAt): self { $obj = clone $this; - $obj->created_at = $createdAt; + $obj['created_at'] = $createdAt; return $obj; } - public function withData(Data $data): self + /** + * @param Data|array{ + * name: string, path: string, transformation: Transformation + * } $data + */ + public function withData(Data|array $data): self { $obj = clone $this; - $obj->data = $data; + $obj['data'] = $data; return $obj; } - public function withRequest(Request $request): self + /** + * @param Request|array{transformation: string, x_request_id: string} $request + */ + public function withRequest(Request|array $request): self { $obj = clone $this; - $obj->request = $request; + $obj['request'] = $request; return $obj; } diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data.php b/src/Webhooks/UploadPreTransformErrorEvent/Data.php index 4916c375..52ef6fda 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Data.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data.php @@ -8,6 +8,7 @@ use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; use ImageKit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation; +use ImageKit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation\Error; /** * @phpstan-type DataShape = array{ @@ -57,17 +58,19 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Transformation|array{error: Error} $transformation */ public static function with( string $name, string $path, - Transformation $transformation + Transformation|array $transformation ): self { $obj = new self; - $obj->name = $name; - $obj->path = $path; - $obj->transformation = $transformation; + $obj['name'] = $name; + $obj['path'] = $path; + $obj['transformation'] = $transformation; return $obj; } @@ -78,7 +81,7 @@ public static function with( public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -89,15 +92,19 @@ public function withName(string $name): self public function withPath(string $path): self { $obj = clone $this; - $obj->path = $path; + $obj['path'] = $path; return $obj; } - public function withTransformation(Transformation $transformation): self - { + /** + * @param Transformation|array{error: Error} $transformation + */ + public function withTransformation( + Transformation|array $transformation + ): self { $obj = clone $this; - $obj->transformation = $transformation; + $obj['transformation'] = $transformation; return $obj; } diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php index 222a7f92..c4dd55bc 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php @@ -43,20 +43,25 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Error|array{reason: string} $error */ - public static function with(Error $error): self + public static function with(Error|array $error): self { $obj = new self; - $obj->error = $error; + $obj['error'] = $error; return $obj; } - public function withError(Error $error): self + /** + * @param Error|array{reason: string} $error + */ + public function withError(Error|array $error): self { $obj = clone $this; - $obj->error = $error; + $obj['error'] = $error; return $obj; } diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php index 546a3ec9..4083d249 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php @@ -50,7 +50,7 @@ public static function with(string $reason): self { $obj = new self; - $obj->reason = $reason; + $obj['reason'] = $reason; return $obj; } @@ -61,7 +61,7 @@ public static function with(string $reason): self public function withReason(string $reason): self { $obj = clone $this; - $obj->reason = $reason; + $obj['reason'] = $reason; return $obj; } diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Request.php b/src/Webhooks/UploadPreTransformErrorEvent/Request.php index de658422..4a482ebc 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Request.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Request.php @@ -58,8 +58,8 @@ public static function with( ): self { $obj = new self; - $obj->transformation = $transformation; - $obj->x_request_id = $x_request_id; + $obj['transformation'] = $transformation; + $obj['x_request_id'] = $x_request_id; return $obj; } @@ -70,7 +70,7 @@ public static function with( public function withTransformation(string $transformation): self { $obj = clone $this; - $obj->transformation = $transformation; + $obj['transformation'] = $transformation; return $obj; } @@ -81,7 +81,7 @@ public function withTransformation(string $transformation): self public function withXRequestID(string $xRequestID): self { $obj = clone $this; - $obj->x_request_id = $xRequestID; + $obj['x_request_id'] = $xRequestID; return $obj; } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent.php b/src/Webhooks/UploadPreTransformSuccessEvent.php index 964bc434..e514a6cf 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent.php @@ -7,7 +7,12 @@ use ImageKit\Core\Attributes\Api; use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Files\Metadata; use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\AITag; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\VersionInfo; use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Request; /** @@ -83,21 +88,50 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Data|array{ + * AITags?: list|null, + * audioCodec?: string|null, + * bitRate?: int|null, + * customCoordinates?: string|null, + * customMetadata?: array|null, + * description?: string|null, + * duration?: int|null, + * embeddedMetadata?: array|null, + * extensionStatus?: ExtensionStatus|null, + * fileId?: string|null, + * filePath?: string|null, + * fileType?: string|null, + * height?: float|null, + * isPrivateFile?: bool|null, + * isPublished?: bool|null, + * metadata?: Metadata|null, + * name?: string|null, + * selectedFieldsSchema?: array|null, + * size?: float|null, + * tags?: list|null, + * thumbnailUrl?: string|null, + * url?: string|null, + * versionInfo?: VersionInfo|null, + * videoCodec?: string|null, + * width?: float|null, + * } $data + * @param Request|array{transformation: string, x_request_id: string} $request */ public static function with( string $id, string $type, \DateTimeInterface $created_at, - Data $data, - Request $request, + Data|array $data, + Request|array $request, ): self { $obj = new self; - $obj->id = $id; - $obj->type = $type; - $obj->created_at = $created_at; - $obj->data = $data; - $obj->request = $request; + $obj['id'] = $id; + $obj['type'] = $type; + $obj['created_at'] = $created_at; + $obj['data'] = $data; + $obj['request'] = $request; return $obj; } @@ -108,7 +142,7 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -119,7 +153,7 @@ public function withID(string $id): self public function withType(string $type): self { $obj = clone $this; - $obj->type = $type; + $obj['type'] = $type; return $obj; } @@ -130,26 +164,57 @@ public function withType(string $type): self public function withCreatedAt(\DateTimeInterface $createdAt): self { $obj = clone $this; - $obj->created_at = $createdAt; + $obj['created_at'] = $createdAt; return $obj; } /** * Object containing details of a successful upload. + * + * @param Data|array{ + * AITags?: list|null, + * audioCodec?: string|null, + * bitRate?: int|null, + * customCoordinates?: string|null, + * customMetadata?: array|null, + * description?: string|null, + * duration?: int|null, + * embeddedMetadata?: array|null, + * extensionStatus?: ExtensionStatus|null, + * fileId?: string|null, + * filePath?: string|null, + * fileType?: string|null, + * height?: float|null, + * isPrivateFile?: bool|null, + * isPublished?: bool|null, + * metadata?: Metadata|null, + * name?: string|null, + * selectedFieldsSchema?: array|null, + * size?: float|null, + * tags?: list|null, + * thumbnailUrl?: string|null, + * url?: string|null, + * versionInfo?: VersionInfo|null, + * videoCodec?: string|null, + * width?: float|null, + * } $data */ - public function withData(Data $data): self + public function withData(Data|array $data): self { $obj = clone $this; - $obj->data = $data; + $obj['data'] = $data; return $obj; } - public function withRequest(Request $request): self + /** + * @param Request|array{transformation: string, x_request_id: string} $request + */ + public function withRequest(Request|array $request): self { $obj = clone $this; - $obj->request = $request; + $obj['request'] = $request; return $obj; } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php index 0f54ba55..0de318a4 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php @@ -8,9 +8,15 @@ use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; use ImageKit\Files\Metadata; +use ImageKit\Files\Metadata\Exif; use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\AITag; use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\AIAutoDescription; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\AwsAutoTagging; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\GoogleAutoTagging; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\RemoveBg; use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\Type; use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\VersionInfo; /** @@ -229,11 +235,47 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list|null $AITags + * @param list|null $AITags * @param array $customMetadata * @param array $embeddedMetadata - * @param array $selectedFieldsSchema + * @param ExtensionStatus|array{ + * ai_auto_description?: value-of|null, + * aws_auto_tagging?: value-of|null, + * google_auto_tagging?: value-of|null, + * remove_bg?: value-of|null, + * } $extensionStatus + * @param Metadata|array{ + * audioCodec?: string|null, + * bitRate?: int|null, + * density?: int|null, + * duration?: int|null, + * exif?: Exif|null, + * format?: string|null, + * hasColorProfile?: bool|null, + * hasTransparency?: bool|null, + * height?: int|null, + * pHash?: string|null, + * quality?: int|null, + * size?: int|null, + * videoCodec?: string|null, + * width?: int|null, + * } $metadata + * @param array, + * defaultValue?: string|float|bool|list|null, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * readOnly?: bool|null, + * selectOptions?: list|null, + * selectOptionsTruncated?: bool|null, + * }> $selectedFieldsSchema * @param list|null $tags + * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo */ public static function with( ?array $AITags = null, @@ -244,51 +286,51 @@ public static function with( ?string $description = null, ?int $duration = null, ?array $embeddedMetadata = null, - ?ExtensionStatus $extensionStatus = null, + ExtensionStatus|array|null $extensionStatus = null, ?string $fileId = null, ?string $filePath = null, ?string $fileType = null, ?float $height = null, ?bool $isPrivateFile = null, ?bool $isPublished = null, - ?Metadata $metadata = null, + Metadata|array|null $metadata = null, ?string $name = null, ?array $selectedFieldsSchema = null, ?float $size = null, ?array $tags = null, ?string $thumbnailUrl = null, ?string $url = null, - ?VersionInfo $versionInfo = null, + VersionInfo|array|null $versionInfo = null, ?string $videoCodec = null, ?float $width = null, ): self { $obj = new self; - null !== $AITags && $obj->AITags = $AITags; - null !== $audioCodec && $obj->audioCodec = $audioCodec; - null !== $bitRate && $obj->bitRate = $bitRate; - null !== $customCoordinates && $obj->customCoordinates = $customCoordinates; - null !== $customMetadata && $obj->customMetadata = $customMetadata; - null !== $description && $obj->description = $description; - null !== $duration && $obj->duration = $duration; - null !== $embeddedMetadata && $obj->embeddedMetadata = $embeddedMetadata; - null !== $extensionStatus && $obj->extensionStatus = $extensionStatus; - null !== $fileId && $obj->fileId = $fileId; - null !== $filePath && $obj->filePath = $filePath; - null !== $fileType && $obj->fileType = $fileType; - null !== $height && $obj->height = $height; - null !== $isPrivateFile && $obj->isPrivateFile = $isPrivateFile; - null !== $isPublished && $obj->isPublished = $isPublished; - null !== $metadata && $obj->metadata = $metadata; - null !== $name && $obj->name = $name; - null !== $selectedFieldsSchema && $obj->selectedFieldsSchema = $selectedFieldsSchema; - null !== $size && $obj->size = $size; - null !== $tags && $obj->tags = $tags; - null !== $thumbnailUrl && $obj->thumbnailUrl = $thumbnailUrl; - null !== $url && $obj->url = $url; - null !== $versionInfo && $obj->versionInfo = $versionInfo; - null !== $videoCodec && $obj->videoCodec = $videoCodec; - null !== $width && $obj->width = $width; + null !== $AITags && $obj['AITags'] = $AITags; + null !== $audioCodec && $obj['audioCodec'] = $audioCodec; + null !== $bitRate && $obj['bitRate'] = $bitRate; + null !== $customCoordinates && $obj['customCoordinates'] = $customCoordinates; + null !== $customMetadata && $obj['customMetadata'] = $customMetadata; + null !== $description && $obj['description'] = $description; + null !== $duration && $obj['duration'] = $duration; + null !== $embeddedMetadata && $obj['embeddedMetadata'] = $embeddedMetadata; + null !== $extensionStatus && $obj['extensionStatus'] = $extensionStatus; + null !== $fileId && $obj['fileId'] = $fileId; + null !== $filePath && $obj['filePath'] = $filePath; + null !== $fileType && $obj['fileType'] = $fileType; + null !== $height && $obj['height'] = $height; + null !== $isPrivateFile && $obj['isPrivateFile'] = $isPrivateFile; + null !== $isPublished && $obj['isPublished'] = $isPublished; + null !== $metadata && $obj['metadata'] = $metadata; + null !== $name && $obj['name'] = $name; + null !== $selectedFieldsSchema && $obj['selectedFieldsSchema'] = $selectedFieldsSchema; + null !== $size && $obj['size'] = $size; + null !== $tags && $obj['tags'] = $tags; + null !== $thumbnailUrl && $obj['thumbnailUrl'] = $thumbnailUrl; + null !== $url && $obj['url'] = $url; + null !== $versionInfo && $obj['versionInfo'] = $versionInfo; + null !== $videoCodec && $obj['videoCodec'] = $videoCodec; + null !== $width && $obj['width'] = $width; return $obj; } @@ -296,12 +338,14 @@ public static function with( /** * An array of tags assigned to the uploaded file by auto tagging. * - * @param list|null $aiTags + * @param list|null $aiTags */ public function withAITags(?array $aiTags): self { $obj = clone $this; - $obj->AITags = $aiTags; + $obj['AITags'] = $aiTags; return $obj; } @@ -312,7 +356,7 @@ public function withAITags(?array $aiTags): self public function withAudioCodec(string $audioCodec): self { $obj = clone $this; - $obj->audioCodec = $audioCodec; + $obj['audioCodec'] = $audioCodec; return $obj; } @@ -323,7 +367,7 @@ public function withAudioCodec(string $audioCodec): self public function withBitRate(int $bitRate): self { $obj = clone $this; - $obj->bitRate = $bitRate; + $obj['bitRate'] = $bitRate; return $obj; } @@ -334,7 +378,7 @@ public function withBitRate(int $bitRate): self public function withCustomCoordinates(?string $customCoordinates): self { $obj = clone $this; - $obj->customCoordinates = $customCoordinates; + $obj['customCoordinates'] = $customCoordinates; return $obj; } @@ -347,7 +391,7 @@ public function withCustomCoordinates(?string $customCoordinates): self public function withCustomMetadata(array $customMetadata): self { $obj = clone $this; - $obj->customMetadata = $customMetadata; + $obj['customMetadata'] = $customMetadata; return $obj; } @@ -358,7 +402,7 @@ public function withCustomMetadata(array $customMetadata): self public function withDescription(string $description): self { $obj = clone $this; - $obj->description = $description; + $obj['description'] = $description; return $obj; } @@ -369,7 +413,7 @@ public function withDescription(string $description): self public function withDuration(int $duration): self { $obj = clone $this; - $obj->duration = $duration; + $obj['duration'] = $duration; return $obj; } @@ -382,7 +426,7 @@ public function withDuration(int $duration): self public function withEmbeddedMetadata(array $embeddedMetadata): self { $obj = clone $this; - $obj->embeddedMetadata = $embeddedMetadata; + $obj['embeddedMetadata'] = $embeddedMetadata; return $obj; } @@ -395,11 +439,19 @@ public function withEmbeddedMetadata(array $embeddedMetadata): self * `pending`: The extension will finish processing in some time. On completion, the final status (success / failed) will be sent to the `webhookUrl` provided. * * If no extension was requested, then this parameter is not returned. - */ - public function withExtensionStatus(ExtensionStatus $extensionStatus): self - { + * + * @param ExtensionStatus|array{ + * ai_auto_description?: value-of|null, + * aws_auto_tagging?: value-of|null, + * google_auto_tagging?: value-of|null, + * remove_bg?: value-of|null, + * } $extensionStatus + */ + public function withExtensionStatus( + ExtensionStatus|array $extensionStatus + ): self { $obj = clone $this; - $obj->extensionStatus = $extensionStatus; + $obj['extensionStatus'] = $extensionStatus; return $obj; } @@ -410,7 +462,7 @@ public function withExtensionStatus(ExtensionStatus $extensionStatus): self public function withFileID(string $fileID): self { $obj = clone $this; - $obj->fileId = $fileID; + $obj['fileId'] = $fileID; return $obj; } @@ -421,7 +473,7 @@ public function withFileID(string $fileID): self public function withFilePath(string $filePath): self { $obj = clone $this; - $obj->filePath = $filePath; + $obj['filePath'] = $filePath; return $obj; } @@ -432,7 +484,7 @@ public function withFilePath(string $filePath): self public function withFileType(string $fileType): self { $obj = clone $this; - $obj->fileType = $fileType; + $obj['fileType'] = $fileType; return $obj; } @@ -443,7 +495,7 @@ public function withFileType(string $fileType): self public function withHeight(float $height): self { $obj = clone $this; - $obj->height = $height; + $obj['height'] = $height; return $obj; } @@ -454,7 +506,7 @@ public function withHeight(float $height): self public function withIsPrivateFile(bool $isPrivateFile): self { $obj = clone $this; - $obj->isPrivateFile = $isPrivateFile; + $obj['isPrivateFile'] = $isPrivateFile; return $obj; } @@ -465,18 +517,35 @@ public function withIsPrivateFile(bool $isPrivateFile): self public function withIsPublished(bool $isPublished): self { $obj = clone $this; - $obj->isPublished = $isPublished; + $obj['isPublished'] = $isPublished; return $obj; } /** * Legacy metadata. Send `metadata` in `responseFields` in API request to get metadata in the upload API response. - */ - public function withMetadata(Metadata $metadata): self + * + * @param Metadata|array{ + * audioCodec?: string|null, + * bitRate?: int|null, + * density?: int|null, + * duration?: int|null, + * exif?: Exif|null, + * format?: string|null, + * hasColorProfile?: bool|null, + * hasTransparency?: bool|null, + * height?: int|null, + * pHash?: string|null, + * quality?: int|null, + * size?: int|null, + * videoCodec?: string|null, + * width?: int|null, + * } $metadata + */ + public function withMetadata(Metadata|array $metadata): self { $obj = clone $this; - $obj->metadata = $metadata; + $obj['metadata'] = $metadata; return $obj; } @@ -487,7 +556,7 @@ public function withMetadata(Metadata $metadata): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -499,12 +568,23 @@ public function withName(string $name): self * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @param array $selectedFieldsSchema + * @param array, + * defaultValue?: string|float|bool|list|null, + * isValueRequired?: bool|null, + * maxLength?: float|null, + * maxValue?: string|float|null, + * minLength?: float|null, + * minValue?: string|float|null, + * readOnly?: bool|null, + * selectOptions?: list|null, + * selectOptionsTruncated?: bool|null, + * }> $selectedFieldsSchema */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { $obj = clone $this; - $obj->selectedFieldsSchema = $selectedFieldsSchema; + $obj['selectedFieldsSchema'] = $selectedFieldsSchema; return $obj; } @@ -515,7 +595,7 @@ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self public function withSize(float $size): self { $obj = clone $this; - $obj->size = $size; + $obj['size'] = $size; return $obj; } @@ -528,7 +608,7 @@ public function withSize(float $size): self public function withTags(?array $tags): self { $obj = clone $this; - $obj->tags = $tags; + $obj['tags'] = $tags; return $obj; } @@ -539,7 +619,7 @@ public function withTags(?array $tags): self public function withThumbnailURL(string $thumbnailURL): self { $obj = clone $this; - $obj->thumbnailUrl = $thumbnailURL; + $obj['thumbnailUrl'] = $thumbnailURL; return $obj; } @@ -550,18 +630,20 @@ public function withThumbnailURL(string $thumbnailURL): self public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } /** * An object containing the file or file version's `id` (versionId) and `name`. + * + * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo */ - public function withVersionInfo(VersionInfo $versionInfo): self + public function withVersionInfo(VersionInfo|array $versionInfo): self { $obj = clone $this; - $obj->versionInfo = $versionInfo; + $obj['versionInfo'] = $versionInfo; return $obj; } @@ -572,7 +654,7 @@ public function withVersionInfo(VersionInfo $versionInfo): self public function withVideoCodec(string $videoCodec): self { $obj = clone $this; - $obj->videoCodec = $videoCodec; + $obj['videoCodec'] = $videoCodec; return $obj; } @@ -583,7 +665,7 @@ public function withVideoCodec(string $videoCodec): self public function withWidth(float $width): self { $obj = clone $this; - $obj->width = $width; + $obj['width'] = $width; return $obj; } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php index 468bd05a..0b10fa67 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php @@ -53,9 +53,9 @@ public static function with( ): self { $obj = new self; - null !== $confidence && $obj->confidence = $confidence; - null !== $name && $obj->name = $name; - null !== $source && $obj->source = $source; + null !== $confidence && $obj['confidence'] = $confidence; + null !== $name && $obj['name'] = $name; + null !== $source && $obj['source'] = $source; return $obj; } @@ -66,7 +66,7 @@ public static function with( public function withConfidence(float $confidence): self { $obj = clone $this; - $obj->confidence = $confidence; + $obj['confidence'] = $confidence; return $obj; } @@ -77,7 +77,7 @@ public function withConfidence(float $confidence): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } @@ -88,7 +88,7 @@ public function withName(string $name): self public function withSource(string $source): self { $obj = clone $this; - $obj->source = $source; + $obj['source'] = $source; return $obj; } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php index 2f8ff342..dfd4a61b 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php @@ -140,15 +140,15 @@ public static function with( $obj['type'] = $type; - null !== $defaultValue && $obj->defaultValue = $defaultValue; - null !== $isValueRequired && $obj->isValueRequired = $isValueRequired; - null !== $maxLength && $obj->maxLength = $maxLength; - null !== $maxValue && $obj->maxValue = $maxValue; - null !== $minLength && $obj->minLength = $minLength; - null !== $minValue && $obj->minValue = $minValue; - null !== $readOnly && $obj->readOnly = $readOnly; - null !== $selectOptions && $obj->selectOptions = $selectOptions; - null !== $selectOptionsTruncated && $obj->selectOptionsTruncated = $selectOptionsTruncated; + null !== $defaultValue && $obj['defaultValue'] = $defaultValue; + null !== $isValueRequired && $obj['isValueRequired'] = $isValueRequired; + null !== $maxLength && $obj['maxLength'] = $maxLength; + null !== $maxValue && $obj['maxValue'] = $maxValue; + null !== $minLength && $obj['minLength'] = $minLength; + null !== $minValue && $obj['minValue'] = $minValue; + null !== $readOnly && $obj['readOnly'] = $readOnly; + null !== $selectOptions && $obj['selectOptions'] = $selectOptions; + null !== $selectOptionsTruncated && $obj['selectOptionsTruncated'] = $selectOptionsTruncated; return $obj; } @@ -175,7 +175,7 @@ public function withDefaultValue( string|float|bool|array $defaultValue ): self { $obj = clone $this; - $obj->defaultValue = $defaultValue; + $obj['defaultValue'] = $defaultValue; return $obj; } @@ -186,7 +186,7 @@ public function withDefaultValue( public function withIsValueRequired(bool $isValueRequired): self { $obj = clone $this; - $obj->isValueRequired = $isValueRequired; + $obj['isValueRequired'] = $isValueRequired; return $obj; } @@ -197,7 +197,7 @@ public function withIsValueRequired(bool $isValueRequired): self public function withMaxLength(float $maxLength): self { $obj = clone $this; - $obj->maxLength = $maxLength; + $obj['maxLength'] = $maxLength; return $obj; } @@ -208,7 +208,7 @@ public function withMaxLength(float $maxLength): self public function withMaxValue(string|float $maxValue): self { $obj = clone $this; - $obj->maxValue = $maxValue; + $obj['maxValue'] = $maxValue; return $obj; } @@ -219,7 +219,7 @@ public function withMaxValue(string|float $maxValue): self public function withMinLength(float $minLength): self { $obj = clone $this; - $obj->minLength = $minLength; + $obj['minLength'] = $minLength; return $obj; } @@ -230,7 +230,7 @@ public function withMinLength(float $minLength): self public function withMinValue(string|float $minValue): self { $obj = clone $this; - $obj->minValue = $minValue; + $obj['minValue'] = $minValue; return $obj; } @@ -241,7 +241,7 @@ public function withMinValue(string|float $minValue): self public function withReadOnly(bool $readOnly): self { $obj = clone $this; - $obj->readOnly = $readOnly; + $obj['readOnly'] = $readOnly; return $obj; } @@ -254,7 +254,7 @@ public function withReadOnly(bool $readOnly): self public function withSelectOptions(array $selectOptions): self { $obj = clone $this; - $obj->selectOptions = $selectOptions; + $obj['selectOptions'] = $selectOptions; return $obj; } @@ -266,7 +266,7 @@ public function withSelectOptionsTruncated( bool $selectOptionsTruncated ): self { $obj = clone $this; - $obj->selectOptionsTruncated = $selectOptionsTruncated; + $obj['selectOptionsTruncated'] = $selectOptionsTruncated; return $obj; } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php index 19e7eb8d..ec4ddd02 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php @@ -44,8 +44,8 @@ public static function with(?string $id = null, ?string $name = null): self { $obj = new self; - null !== $id && $obj->id = $id; - null !== $name && $obj->name = $name; + null !== $id && $obj['id'] = $id; + null !== $name && $obj['name'] = $name; return $obj; } @@ -56,7 +56,7 @@ public static function with(?string $id = null, ?string $name = null): self public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -67,7 +67,7 @@ public function withID(string $id): self public function withName(string $name): self { $obj = clone $this; - $obj->name = $name; + $obj['name'] = $name; return $obj; } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Request.php b/src/Webhooks/UploadPreTransformSuccessEvent/Request.php index 361eba75..3b60c437 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Request.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Request.php @@ -58,8 +58,8 @@ public static function with( ): self { $obj = new self; - $obj->transformation = $transformation; - $obj->x_request_id = $x_request_id; + $obj['transformation'] = $transformation; + $obj['x_request_id'] = $x_request_id; return $obj; } @@ -70,7 +70,7 @@ public static function with( public function withTransformation(string $transformation): self { $obj = clone $this; - $obj->transformation = $transformation; + $obj['transformation'] = $transformation; return $obj; } @@ -81,7 +81,7 @@ public function withTransformation(string $transformation): self public function withXRequestID(string $xRequestID): self { $obj = clone $this; - $obj->x_request_id = $xRequestID; + $obj['x_request_id'] = $xRequestID; return $obj; } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent.php b/src/Webhooks/VideoTransformationAcceptedEvent.php index 6a98dd23..3ecd1e35 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent.php @@ -8,6 +8,8 @@ use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data; +use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Asset; +use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation; use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Request; /** @@ -83,21 +85,26 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Data|array{asset: Asset, transformation: Transformation} $data + * @param Request|array{ + * url: string, x_request_id: string, user_agent?: string|null + * } $request */ public static function with( string $id, string $type, \DateTimeInterface $created_at, - Data $data, - Request $request, + Data|array $data, + Request|array $request, ): self { $obj = new self; - $obj->id = $id; - $obj->type = $type; - $obj->created_at = $created_at; - $obj->data = $data; - $obj->request = $request; + $obj['id'] = $id; + $obj['type'] = $type; + $obj['created_at'] = $created_at; + $obj['data'] = $data; + $obj['request'] = $request; return $obj; } @@ -108,7 +115,7 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -119,7 +126,7 @@ public function withID(string $id): self public function withType(string $type): self { $obj = clone $this; - $obj->type = $type; + $obj['type'] = $type; return $obj; } @@ -130,26 +137,33 @@ public function withType(string $type): self public function withCreatedAt(\DateTimeInterface $createdAt): self { $obj = clone $this; - $obj->created_at = $createdAt; + $obj['created_at'] = $createdAt; return $obj; } - public function withData(Data $data): self + /** + * @param Data|array{asset: Asset, transformation: Transformation} $data + */ + public function withData(Data|array $data): self { $obj = clone $this; - $obj->data = $data; + $obj['data'] = $data; return $obj; } /** * Information about the original request that triggered the video transformation. + * + * @param Request|array{ + * url: string, x_request_id: string, user_agent?: string|null + * } $request */ - public function withRequest(Request $request): self + public function withRequest(Request|array $request): self { $obj = clone $this; - $obj->request = $request; + $obj['request'] = $request; return $obj; } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data.php index 199e8599..5066ab42 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data.php @@ -9,6 +9,8 @@ use ImageKit\Core\Contracts\BaseModel; use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Asset; use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation; +use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; +use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Type; /** * @phpstan-type DataShape = array{asset: Asset, transformation: Transformation} @@ -53,37 +55,49 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Asset|array{url: string} $asset + * @param Transformation|array{ + * type: value-of, options?: Options|null + * } $transformation */ public static function with( - Asset $asset, - Transformation $transformation + Asset|array $asset, + Transformation|array $transformation ): self { $obj = new self; - $obj->asset = $asset; - $obj->transformation = $transformation; + $obj['asset'] = $asset; + $obj['transformation'] = $transformation; return $obj; } /** * Information about the source video asset being transformed. + * + * @param Asset|array{url: string} $asset */ - public function withAsset(Asset $asset): self + public function withAsset(Asset|array $asset): self { $obj = clone $this; - $obj->asset = $asset; + $obj['asset'] = $asset; return $obj; } /** * Base information about a video transformation request. + * + * @param Transformation|array{ + * type: value-of, options?: Options|null + * } $transformation */ - public function withTransformation(Transformation $transformation): self - { + public function withTransformation( + Transformation|array $transformation + ): self { $obj = clone $this; - $obj->transformation = $transformation; + $obj['transformation'] = $transformation; return $obj; } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php index c1994f58..66526230 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php @@ -52,7 +52,7 @@ public static function with(string $url): self { $obj = new self; - $obj->url = $url; + $obj['url'] = $url; return $obj; } @@ -63,7 +63,7 @@ public static function with(string $url): self public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php index bb8416b1..3b5be3be 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php @@ -8,6 +8,10 @@ use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; +use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\AudioCodec; +use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\Format; +use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\StreamProtocol; +use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\VideoCodec; use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Type; /** @@ -64,16 +68,25 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Type|value-of $type + * @param Options|array{ + * audio_codec?: value-of|null, + * auto_rotate?: bool|null, + * format?: value-of|null, + * quality?: int|null, + * stream_protocol?: value-of|null, + * variants?: list|null, + * video_codec?: value-of|null, + * } $options */ public static function with( Type|string $type, - ?Options $options = null + Options|array|null $options = null ): self { $obj = new self; $obj['type'] = $type; - null !== $options && $obj->options = $options; + null !== $options && $obj['options'] = $options; return $obj; } @@ -96,11 +109,21 @@ public function withType(Type|string $type): self /** * Configuration options for video transformations. + * + * @param Options|array{ + * audio_codec?: value-of|null, + * auto_rotate?: bool|null, + * format?: value-of|null, + * quality?: int|null, + * stream_protocol?: value-of|null, + * variants?: list|null, + * video_codec?: value-of|null, + * } $options */ - public function withOptions(Options $options): self + public function withOptions(Options|array $options): self { $obj = clone $this; - $obj->options = $options; + $obj['options'] = $options; return $obj; } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php index 801fc0b8..8bf1d697 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php @@ -110,11 +110,11 @@ public static function with( $obj = new self; null !== $audio_codec && $obj['audio_codec'] = $audio_codec; - null !== $auto_rotate && $obj->auto_rotate = $auto_rotate; + null !== $auto_rotate && $obj['auto_rotate'] = $auto_rotate; null !== $format && $obj['format'] = $format; - null !== $quality && $obj->quality = $quality; + null !== $quality && $obj['quality'] = $quality; null !== $stream_protocol && $obj['stream_protocol'] = $stream_protocol; - null !== $variants && $obj->variants = $variants; + null !== $variants && $obj['variants'] = $variants; null !== $video_codec && $obj['video_codec'] = $video_codec; return $obj; @@ -139,7 +139,7 @@ public function withAudioCodec(AudioCodec|string $audioCodec): self public function withAutoRotate(bool $autoRotate): self { $obj = clone $this; - $obj->auto_rotate = $autoRotate; + $obj['auto_rotate'] = $autoRotate; return $obj; } @@ -163,7 +163,7 @@ public function withFormat(Format|string $format): self public function withQuality(int $quality): self { $obj = clone $this; - $obj->quality = $quality; + $obj['quality'] = $quality; return $obj; } @@ -190,7 +190,7 @@ public function withStreamProtocol( public function withVariants(array $variants): self { $obj = clone $this; - $obj->variants = $variants; + $obj['variants'] = $variants; return $obj; } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Request.php b/src/Webhooks/VideoTransformationAcceptedEvent/Request.php index d9696715..8e6be5ae 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Request.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Request.php @@ -69,10 +69,10 @@ public static function with( ): self { $obj = new self; - $obj->url = $url; - $obj->x_request_id = $x_request_id; + $obj['url'] = $url; + $obj['x_request_id'] = $x_request_id; - null !== $user_agent && $obj->user_agent = $user_agent; + null !== $user_agent && $obj['user_agent'] = $user_agent; return $obj; } @@ -83,7 +83,7 @@ public static function with( public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } @@ -94,7 +94,7 @@ public function withURL(string $url): self public function withXRequestID(string $xRequestID): self { $obj = clone $this; - $obj->x_request_id = $xRequestID; + $obj['x_request_id'] = $xRequestID; return $obj; } @@ -105,7 +105,7 @@ public function withXRequestID(string $xRequestID): self public function withUserAgent(string $userAgent): self { $obj = clone $this; - $obj->user_agent = $userAgent; + $obj['user_agent'] = $userAgent; return $obj; } diff --git a/src/Webhooks/VideoTransformationErrorEvent.php b/src/Webhooks/VideoTransformationErrorEvent.php index 2ed0417d..03a4edf3 100644 --- a/src/Webhooks/VideoTransformationErrorEvent.php +++ b/src/Webhooks/VideoTransformationErrorEvent.php @@ -8,6 +8,8 @@ use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; use ImageKit\Webhooks\VideoTransformationErrorEvent\Data; +use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Asset; +use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; use ImageKit\Webhooks\VideoTransformationErrorEvent\Request; /** @@ -83,21 +85,26 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Data|array{asset: Asset, transformation: Transformation} $data + * @param Request|array{ + * url: string, x_request_id: string, user_agent?: string|null + * } $request */ public static function with( string $id, string $type, \DateTimeInterface $created_at, - Data $data, - Request $request, + Data|array $data, + Request|array $request, ): self { $obj = new self; - $obj->id = $id; - $obj->type = $type; - $obj->created_at = $created_at; - $obj->data = $data; - $obj->request = $request; + $obj['id'] = $id; + $obj['type'] = $type; + $obj['created_at'] = $created_at; + $obj['data'] = $data; + $obj['request'] = $request; return $obj; } @@ -108,7 +115,7 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -119,7 +126,7 @@ public function withID(string $id): self public function withType(string $type): self { $obj = clone $this; - $obj->type = $type; + $obj['type'] = $type; return $obj; } @@ -130,26 +137,33 @@ public function withType(string $type): self public function withCreatedAt(\DateTimeInterface $createdAt): self { $obj = clone $this; - $obj->created_at = $createdAt; + $obj['created_at'] = $createdAt; return $obj; } - public function withData(Data $data): self + /** + * @param Data|array{asset: Asset, transformation: Transformation} $data + */ + public function withData(Data|array $data): self { $obj = clone $this; - $obj->data = $data; + $obj['data'] = $data; return $obj; } /** * Information about the original request that triggered the video transformation. + * + * @param Request|array{ + * url: string, x_request_id: string, user_agent?: string|null + * } $request */ - public function withRequest(Request $request): self + public function withRequest(Request|array $request): self { $obj = clone $this; - $obj->request = $request; + $obj['request'] = $request; return $obj; } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data.php b/src/Webhooks/VideoTransformationErrorEvent/Data.php index 351b0c01..e89f365a 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data.php @@ -9,6 +9,9 @@ use ImageKit\Core\Contracts\BaseModel; use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Asset; use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; +use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error; +use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; +use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Type; /** * @phpstan-type DataShape = array{asset: Asset, transformation: Transformation} @@ -50,34 +53,47 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Asset|array{url: string} $asset + * @param Transformation|array{ + * type: value-of, error?: Error|null, options?: Options|null + * } $transformation */ public static function with( - Asset $asset, - Transformation $transformation + Asset|array $asset, + Transformation|array $transformation ): self { $obj = new self; - $obj->asset = $asset; - $obj->transformation = $transformation; + $obj['asset'] = $asset; + $obj['transformation'] = $transformation; return $obj; } /** * Information about the source video asset being transformed. + * + * @param Asset|array{url: string} $asset */ - public function withAsset(Asset $asset): self + public function withAsset(Asset|array $asset): self { $obj = clone $this; - $obj->asset = $asset; + $obj['asset'] = $asset; return $obj; } - public function withTransformation(Transformation $transformation): self - { + /** + * @param Transformation|array{ + * type: value-of, error?: Error|null, options?: Options|null + * } $transformation + */ + public function withTransformation( + Transformation|array $transformation + ): self { $obj = clone $this; - $obj->transformation = $transformation; + $obj['transformation'] = $transformation; return $obj; } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php index cca52134..43f99467 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php @@ -52,7 +52,7 @@ public static function with(string $url): self { $obj = new self; - $obj->url = $url; + $obj['url'] = $url; return $obj; } @@ -63,7 +63,7 @@ public static function with(string $url): self public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php index dde3e2ed..0ec41fc1 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php @@ -8,7 +8,12 @@ use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error; +use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error\Reason; use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; +use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\AudioCodec; +use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\Format; +use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\StreamProtocol; +use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\VideoCodec; use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Type; /** @@ -69,18 +74,28 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Type|value-of $type + * @param Error|array{reason: value-of} $error + * @param Options|array{ + * audio_codec?: value-of|null, + * auto_rotate?: bool|null, + * format?: value-of|null, + * quality?: int|null, + * stream_protocol?: value-of|null, + * variants?: list|null, + * video_codec?: value-of|null, + * } $options */ public static function with( Type|string $type, - ?Error $error = null, - ?Options $options = null + Error|array|null $error = null, + Options|array|null $options = null ): self { $obj = new self; $obj['type'] = $type; - null !== $error && $obj->error = $error; - null !== $options && $obj->options = $options; + null !== $error && $obj['error'] = $error; + null !== $options && $obj['options'] = $options; return $obj; } @@ -103,22 +118,34 @@ public function withType(Type|string $type): self /** * Details about the transformation error. + * + * @param Error|array{reason: value-of} $error */ - public function withError(Error $error): self + public function withError(Error|array $error): self { $obj = clone $this; - $obj->error = $error; + $obj['error'] = $error; return $obj; } /** * Configuration options for video transformations. + * + * @param Options|array{ + * audio_codec?: value-of|null, + * auto_rotate?: bool|null, + * format?: value-of|null, + * quality?: int|null, + * stream_protocol?: value-of|null, + * variants?: list|null, + * video_codec?: value-of|null, + * } $options */ - public function withOptions(Options $options): self + public function withOptions(Options|array $options): self { $obj = clone $this; - $obj->options = $options; + $obj['options'] = $options; return $obj; } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php index 0ea8da25..2047a83f 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php @@ -110,11 +110,11 @@ public static function with( $obj = new self; null !== $audio_codec && $obj['audio_codec'] = $audio_codec; - null !== $auto_rotate && $obj->auto_rotate = $auto_rotate; + null !== $auto_rotate && $obj['auto_rotate'] = $auto_rotate; null !== $format && $obj['format'] = $format; - null !== $quality && $obj->quality = $quality; + null !== $quality && $obj['quality'] = $quality; null !== $stream_protocol && $obj['stream_protocol'] = $stream_protocol; - null !== $variants && $obj->variants = $variants; + null !== $variants && $obj['variants'] = $variants; null !== $video_codec && $obj['video_codec'] = $video_codec; return $obj; @@ -139,7 +139,7 @@ public function withAudioCodec(AudioCodec|string $audioCodec): self public function withAutoRotate(bool $autoRotate): self { $obj = clone $this; - $obj->auto_rotate = $autoRotate; + $obj['auto_rotate'] = $autoRotate; return $obj; } @@ -163,7 +163,7 @@ public function withFormat(Format|string $format): self public function withQuality(int $quality): self { $obj = clone $this; - $obj->quality = $quality; + $obj['quality'] = $quality; return $obj; } @@ -190,7 +190,7 @@ public function withStreamProtocol( public function withVariants(array $variants): self { $obj = clone $this; - $obj->variants = $variants; + $obj['variants'] = $variants; return $obj; } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Request.php b/src/Webhooks/VideoTransformationErrorEvent/Request.php index 7ab351ab..dbe3a181 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Request.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Request.php @@ -69,10 +69,10 @@ public static function with( ): self { $obj = new self; - $obj->url = $url; - $obj->x_request_id = $x_request_id; + $obj['url'] = $url; + $obj['x_request_id'] = $x_request_id; - null !== $user_agent && $obj->user_agent = $user_agent; + null !== $user_agent && $obj['user_agent'] = $user_agent; return $obj; } @@ -83,7 +83,7 @@ public static function with( public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } @@ -94,7 +94,7 @@ public function withURL(string $url): self public function withXRequestID(string $xRequestID): self { $obj = clone $this; - $obj->x_request_id = $xRequestID; + $obj['x_request_id'] = $xRequestID; return $obj; } @@ -105,7 +105,7 @@ public function withXRequestID(string $xRequestID): self public function withUserAgent(string $userAgent): self { $obj = clone $this; - $obj->user_agent = $userAgent; + $obj['user_agent'] = $userAgent; return $obj; } diff --git a/src/Webhooks/VideoTransformationReadyEvent.php b/src/Webhooks/VideoTransformationReadyEvent.php index bb25ce23..afe1f0e1 100644 --- a/src/Webhooks/VideoTransformationReadyEvent.php +++ b/src/Webhooks/VideoTransformationReadyEvent.php @@ -8,6 +8,8 @@ use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; use ImageKit\Webhooks\VideoTransformationReadyEvent\Data; +use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Asset; +use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; use ImageKit\Webhooks\VideoTransformationReadyEvent\Request; use ImageKit\Webhooks\VideoTransformationReadyEvent\Timings; @@ -91,24 +93,32 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Data|array{asset: Asset, transformation: Transformation} $data + * @param Request|array{ + * url: string, x_request_id: string, user_agent?: string|null + * } $request + * @param Timings|array{ + * download_duration?: int|null, encoding_duration?: int|null + * } $timings */ public static function with( string $id, string $type, \DateTimeInterface $created_at, - Data $data, - Request $request, - ?Timings $timings = null, + Data|array $data, + Request|array $request, + Timings|array|null $timings = null, ): self { $obj = new self; - $obj->id = $id; - $obj->type = $type; - $obj->created_at = $created_at; - $obj->data = $data; - $obj->request = $request; + $obj['id'] = $id; + $obj['type'] = $type; + $obj['created_at'] = $created_at; + $obj['data'] = $data; + $obj['request'] = $request; - null !== $timings && $obj->timings = $timings; + null !== $timings && $obj['timings'] = $timings; return $obj; } @@ -119,7 +129,7 @@ public static function with( public function withID(string $id): self { $obj = clone $this; - $obj->id = $id; + $obj['id'] = $id; return $obj; } @@ -130,7 +140,7 @@ public function withID(string $id): self public function withType(string $type): self { $obj = clone $this; - $obj->type = $type; + $obj['type'] = $type; return $obj; } @@ -141,37 +151,48 @@ public function withType(string $type): self public function withCreatedAt(\DateTimeInterface $createdAt): self { $obj = clone $this; - $obj->created_at = $createdAt; + $obj['created_at'] = $createdAt; return $obj; } - public function withData(Data $data): self + /** + * @param Data|array{asset: Asset, transformation: Transformation} $data + */ + public function withData(Data|array $data): self { $obj = clone $this; - $obj->data = $data; + $obj['data'] = $data; return $obj; } /** * Information about the original request that triggered the video transformation. + * + * @param Request|array{ + * url: string, x_request_id: string, user_agent?: string|null + * } $request */ - public function withRequest(Request $request): self + public function withRequest(Request|array $request): self { $obj = clone $this; - $obj->request = $request; + $obj['request'] = $request; return $obj; } /** * Performance metrics for the transformation process. + * + * @param Timings|array{ + * download_duration?: int|null, encoding_duration?: int|null + * } $timings */ - public function withTimings(Timings $timings): self + public function withTimings(Timings|array $timings): self { $obj = clone $this; - $obj->timings = $timings; + $obj['timings'] = $timings; return $obj; } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data.php b/src/Webhooks/VideoTransformationReadyEvent/Data.php index e2d65b11..72e5f807 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data.php @@ -9,6 +9,9 @@ use ImageKit\Core\Contracts\BaseModel; use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Asset; use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; +use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; +use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output; +use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Type; /** * @phpstan-type DataShape = array{asset: Asset, transformation: Transformation} @@ -50,34 +53,47 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param Asset|array{url: string} $asset + * @param Transformation|array{ + * type: value-of, options?: Options|null, output?: Output|null + * } $transformation */ public static function with( - Asset $asset, - Transformation $transformation + Asset|array $asset, + Transformation|array $transformation ): self { $obj = new self; - $obj->asset = $asset; - $obj->transformation = $transformation; + $obj['asset'] = $asset; + $obj['transformation'] = $transformation; return $obj; } /** * Information about the source video asset being transformed. + * + * @param Asset|array{url: string} $asset */ - public function withAsset(Asset $asset): self + public function withAsset(Asset|array $asset): self { $obj = clone $this; - $obj->asset = $asset; + $obj['asset'] = $asset; return $obj; } - public function withTransformation(Transformation $transformation): self - { + /** + * @param Transformation|array{ + * type: value-of, options?: Options|null, output?: Output|null + * } $transformation + */ + public function withTransformation( + Transformation|array $transformation + ): self { $obj = clone $this; - $obj->transformation = $transformation; + $obj['transformation'] = $transformation; return $obj; } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php index 5e4c59b3..06040f20 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php @@ -52,7 +52,7 @@ public static function with(string $url): self { $obj = new self; - $obj->url = $url; + $obj['url'] = $url; return $obj; } @@ -63,7 +63,7 @@ public static function with(string $url): self public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php index 9543c91d..e8dfc6c9 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php @@ -8,7 +8,12 @@ use ImageKit\Core\Concerns\SdkModel; use ImageKit\Core\Contracts\BaseModel; use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; +use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\AudioCodec; +use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\Format; +use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\StreamProtocol; +use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\VideoCodec; use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output; +use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output\VideoMetadata; use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Type; /** @@ -69,18 +74,28 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Type|value-of $type + * @param Options|array{ + * audio_codec?: value-of|null, + * auto_rotate?: bool|null, + * format?: value-of|null, + * quality?: int|null, + * stream_protocol?: value-of|null, + * variants?: list|null, + * video_codec?: value-of|null, + * } $options + * @param Output|array{url: string, video_metadata?: VideoMetadata|null} $output */ public static function with( Type|string $type, - ?Options $options = null, - ?Output $output = null + Options|array|null $options = null, + Output|array|null $output = null, ): self { $obj = new self; $obj['type'] = $type; - null !== $options && $obj->options = $options; - null !== $output && $obj->output = $output; + null !== $options && $obj['options'] = $options; + null !== $output && $obj['output'] = $output; return $obj; } @@ -103,22 +118,34 @@ public function withType(Type|string $type): self /** * Configuration options for video transformations. + * + * @param Options|array{ + * audio_codec?: value-of|null, + * auto_rotate?: bool|null, + * format?: value-of|null, + * quality?: int|null, + * stream_protocol?: value-of|null, + * variants?: list|null, + * video_codec?: value-of|null, + * } $options */ - public function withOptions(Options $options): self + public function withOptions(Options|array $options): self { $obj = clone $this; - $obj->options = $options; + $obj['options'] = $options; return $obj; } /** * Information about the transformed output video. + * + * @param Output|array{url: string, video_metadata?: VideoMetadata|null} $output */ - public function withOutput(Output $output): self + public function withOutput(Output|array $output): self { $obj = clone $this; - $obj->output = $output; + $obj['output'] = $output; return $obj; } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php index 72e7fd47..4b89df67 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php @@ -110,11 +110,11 @@ public static function with( $obj = new self; null !== $audio_codec && $obj['audio_codec'] = $audio_codec; - null !== $auto_rotate && $obj->auto_rotate = $auto_rotate; + null !== $auto_rotate && $obj['auto_rotate'] = $auto_rotate; null !== $format && $obj['format'] = $format; - null !== $quality && $obj->quality = $quality; + null !== $quality && $obj['quality'] = $quality; null !== $stream_protocol && $obj['stream_protocol'] = $stream_protocol; - null !== $variants && $obj->variants = $variants; + null !== $variants && $obj['variants'] = $variants; null !== $video_codec && $obj['video_codec'] = $video_codec; return $obj; @@ -139,7 +139,7 @@ public function withAudioCodec(AudioCodec|string $audioCodec): self public function withAutoRotate(bool $autoRotate): self { $obj = clone $this; - $obj->auto_rotate = $autoRotate; + $obj['auto_rotate'] = $autoRotate; return $obj; } @@ -163,7 +163,7 @@ public function withFormat(Format|string $format): self public function withQuality(int $quality): self { $obj = clone $this; - $obj->quality = $quality; + $obj['quality'] = $quality; return $obj; } @@ -190,7 +190,7 @@ public function withStreamProtocol( public function withVariants(array $variants): self { $obj = clone $this; - $obj->variants = $variants; + $obj['variants'] = $variants; return $obj; } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php index da660504..8707c193 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php @@ -56,16 +56,20 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param VideoMetadata|array{ + * bitrate: int, duration: float, height: int, width: int + * } $video_metadata */ public static function with( string $url, - ?VideoMetadata $video_metadata = null + VideoMetadata|array|null $video_metadata = null ): self { $obj = new self; - $obj->url = $url; + $obj['url'] = $url; - null !== $video_metadata && $obj->video_metadata = $video_metadata; + null !== $video_metadata && $obj['video_metadata'] = $video_metadata; return $obj; } @@ -76,18 +80,22 @@ public static function with( public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } /** * Metadata of the output video file. + * + * @param VideoMetadata|array{ + * bitrate: int, duration: float, height: int, width: int + * } $videoMetadata */ - public function withVideoMetadata(VideoMetadata $videoMetadata): self + public function withVideoMetadata(VideoMetadata|array $videoMetadata): self { $obj = clone $this; - $obj->video_metadata = $videoMetadata; + $obj['video_metadata'] = $videoMetadata; return $obj; } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php index 663b6aaa..cf3ddf7c 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php @@ -80,10 +80,10 @@ public static function with( ): self { $obj = new self; - $obj->bitrate = $bitrate; - $obj->duration = $duration; - $obj->height = $height; - $obj->width = $width; + $obj['bitrate'] = $bitrate; + $obj['duration'] = $duration; + $obj['height'] = $height; + $obj['width'] = $width; return $obj; } @@ -94,7 +94,7 @@ public static function with( public function withBitrate(int $bitrate): self { $obj = clone $this; - $obj->bitrate = $bitrate; + $obj['bitrate'] = $bitrate; return $obj; } @@ -105,7 +105,7 @@ public function withBitrate(int $bitrate): self public function withDuration(float $duration): self { $obj = clone $this; - $obj->duration = $duration; + $obj['duration'] = $duration; return $obj; } @@ -116,7 +116,7 @@ public function withDuration(float $duration): self public function withHeight(int $height): self { $obj = clone $this; - $obj->height = $height; + $obj['height'] = $height; return $obj; } @@ -127,7 +127,7 @@ public function withHeight(int $height): self public function withWidth(int $width): self { $obj = clone $this; - $obj->width = $width; + $obj['width'] = $width; return $obj; } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Request.php b/src/Webhooks/VideoTransformationReadyEvent/Request.php index e7e636f1..8b981105 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Request.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Request.php @@ -69,10 +69,10 @@ public static function with( ): self { $obj = new self; - $obj->url = $url; - $obj->x_request_id = $x_request_id; + $obj['url'] = $url; + $obj['x_request_id'] = $x_request_id; - null !== $user_agent && $obj->user_agent = $user_agent; + null !== $user_agent && $obj['user_agent'] = $user_agent; return $obj; } @@ -83,7 +83,7 @@ public static function with( public function withURL(string $url): self { $obj = clone $this; - $obj->url = $url; + $obj['url'] = $url; return $obj; } @@ -94,7 +94,7 @@ public function withURL(string $url): self public function withXRequestID(string $xRequestID): self { $obj = clone $this; - $obj->x_request_id = $xRequestID; + $obj['x_request_id'] = $xRequestID; return $obj; } @@ -105,7 +105,7 @@ public function withXRequestID(string $xRequestID): self public function withUserAgent(string $userAgent): self { $obj = clone $this; - $obj->user_agent = $userAgent; + $obj['user_agent'] = $userAgent; return $obj; } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Timings.php b/src/Webhooks/VideoTransformationReadyEvent/Timings.php index 400dceef..cbfe486c 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Timings.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Timings.php @@ -48,8 +48,8 @@ public static function with( ): self { $obj = new self; - null !== $download_duration && $obj->download_duration = $download_duration; - null !== $encoding_duration && $obj->encoding_duration = $encoding_duration; + null !== $download_duration && $obj['download_duration'] = $download_duration; + null !== $encoding_duration && $obj['encoding_duration'] = $encoding_duration; return $obj; } @@ -60,7 +60,7 @@ public static function with( public function withDownloadDuration(int $downloadDuration): self { $obj = clone $this; - $obj->download_duration = $downloadDuration; + $obj['download_duration'] = $downloadDuration; return $obj; } @@ -71,7 +71,7 @@ public function withDownloadDuration(int $downloadDuration): self public function withEncodingDuration(int $encodingDuration): self { $obj = clone $this; - $obj->encoding_duration = $encodingDuration; + $obj['encoding_duration'] = $encodingDuration; return $obj; } From 264d6cf84f2853f08a2457d22b9aade5e7c6d375 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 8 Dec 2025 09:58:40 +0000 Subject: [PATCH 084/193] feat(api): update package names for Python and PHP targets in configuration --- .stats.yml | 2 +- README.md | 12 +++--- composer.json | 2 +- src/Accounts/Origins/OriginCreateParams.php | 12 +++--- src/Accounts/Origins/OriginRequest.php | 24 ++++++------ .../Origins/OriginRequest/AkeneoPim.php | 8 ++-- .../Origins/OriginRequest/AzureBlob.php | 8 ++-- .../OriginRequest/CloudinaryBackup.php | 8 ++-- src/Accounts/Origins/OriginRequest/Gcs.php | 8 ++-- src/Accounts/Origins/OriginRequest/S3.php | 8 ++-- .../Origins/OriginRequest/S3Compatible.php | 8 ++-- .../Origins/OriginRequest/WebFolder.php | 8 ++-- .../Origins/OriginRequest/WebProxy.php | 8 ++-- src/Accounts/Origins/OriginResponse.php | 24 ++++++------ .../Origins/OriginResponse/AkeneoPim.php | 8 ++-- .../Origins/OriginResponse/AzureBlob.php | 8 ++-- .../OriginResponse/CloudinaryBackup.php | 8 ++-- src/Accounts/Origins/OriginResponse/Gcs.php | 8 ++-- src/Accounts/Origins/OriginResponse/S3.php | 8 ++-- .../Origins/OriginResponse/S3Compatible.php | 8 ++-- .../Origins/OriginResponse/WebFolder.php | 8 ++-- .../Origins/OriginResponse/WebProxy.php | 8 ++-- src/Accounts/Origins/OriginUpdateParams.php | 12 +++--- .../URLEndpoints/URLEndpointCreateParams.php | 20 +++++----- .../URLEndpointCreateParams/URLRewriter.php | 14 +++---- .../URLRewriter/Akamai.php | 8 ++-- .../URLRewriter/Cloudinary.php | 8 ++-- .../URLRewriter/Imgix.php | 8 ++-- .../URLEndpoints/URLEndpointRequest.php | 18 ++++----- .../URLEndpointRequest/URLRewriter.php | 14 +++---- .../URLEndpointRequest/URLRewriter/Akamai.php | 8 ++-- .../URLRewriter/Cloudinary.php | 8 ++-- .../URLEndpointRequest/URLRewriter/Imgix.php | 8 ++-- .../URLEndpoints/URLEndpointResponse.php | 22 +++++------ .../URLEndpointResponse/URLRewriter.php | 14 +++---- .../URLRewriter/Akamai.php | 8 ++-- .../URLRewriter/Cloudinary.php | 8 ++-- .../URLEndpointResponse/URLRewriter/Imgix.php | 8 ++-- .../URLEndpoints/URLEndpointUpdateParams.php | 20 +++++----- .../URLEndpointUpdateParams/URLRewriter.php | 14 +++---- .../URLRewriter/Akamai.php | 8 ++-- .../URLRewriter/Cloudinary.php | 8 ++-- .../URLRewriter/Imgix.php | 8 ++-- src/Accounts/Usage/UsageGetParams.php | 12 +++--- src/Accounts/Usage/UsageGetResponse.php | 12 +++--- src/Assets/AssetListParams.php | 18 ++++----- src/Assets/AssetListParams/FileType.php | 2 +- src/Assets/AssetListParams/Sort.php | 2 +- src/Assets/AssetListParams/Type.php | 2 +- src/Assets/AssetListResponseItem.php | 12 +++--- src/BaseOverlay.php | 10 ++--- src/Beta/V2/Files/FileUploadParams.php | 38 +++++++++---------- .../Files/FileUploadParams/ResponseField.php | 2 +- .../Files/FileUploadParams/Transformation.php | 20 +++++----- .../FileUploadParams/Transformation/Post.php | 16 ++++---- .../Transformation/Post/Abs.php | 10 ++--- .../Transformation/Post/Abs/Protocol.php | 2 +- .../Transformation/Post/GifToVideo.php | 8 ++-- .../Transformation/Post/Thumbnail.php | 8 ++-- .../Transformation/Post/Transformation.php | 8 ++-- src/Beta/V2/Files/FileUploadResponse.php | 36 +++++++++--------- .../V2/Files/FileUploadResponse/AITag.php | 8 ++-- .../FileUploadResponse/ExtensionStatus.php | 18 ++++----- .../ExtensionStatus/AIAutoDescription.php | 2 +- .../ExtensionStatus/AwsAutoTagging.php | 2 +- .../ExtensionStatus/GoogleAutoTagging.php | 2 +- .../ExtensionStatus/RemoveBg.php | 2 +- .../SelectedFieldsSchema.php | 16 ++++---- .../SelectedFieldsSchema/DefaultValue.php | 12 +++--- .../DefaultValue/Mixed1.php | 8 ++-- .../SelectedFieldsSchema/MaxValue.php | 8 ++-- .../SelectedFieldsSchema/MinValue.php | 8 ++-- .../SelectedFieldsSchema/SelectOption.php | 8 ++-- .../SelectedFieldsSchema/Type.php | 2 +- .../Files/FileUploadResponse/VersionInfo.php | 8 ++-- .../Invalidation/InvalidationCreateParams.php | 12 +++--- .../Invalidation/InvalidationGetResponse.php | 14 +++---- .../InvalidationGetResponse/Status.php | 2 +- .../Invalidation/InvalidationNewResponse.php | 12 +++--- src/Client.php | 20 +++++----- src/Core.php | 4 +- src/Core/Attributes/Api.php | 12 +++--- src/Core/BaseClient.php | 18 ++++----- src/Core/Concerns/SdkEnum.php | 6 +-- src/Core/Concerns/SdkModel.php | 16 ++++---- src/Core/Concerns/SdkPage.php | 14 +++---- src/Core/Concerns/SdkParams.php | 10 ++--- src/Core/Concerns/SdkResponse.php | 4 +- src/Core/Concerns/SdkUnion.php | 8 ++-- src/Core/Contracts/BaseModel.php | 4 +- src/Core/Contracts/BasePage.php | 12 +++--- src/Core/Contracts/BaseStream.php | 6 +-- src/Core/Conversion.php | 12 +++--- src/Core/Conversion/CoerceState.php | 2 +- src/Core/Conversion/Concerns/ArrayOf.php | 12 +++--- src/Core/Conversion/Contracts/Converter.php | 6 +-- .../Conversion/Contracts/ConverterSource.php | 2 +- .../Contracts/ResponseConverter.php | 2 +- src/Core/Conversion/DumpState.php | 2 +- src/Core/Conversion/EnumOf.php | 6 +-- src/Core/Conversion/ListOf.php | 6 +-- src/Core/Conversion/MapOf.php | 6 +-- src/Core/Conversion/ModelOf.php | 10 ++--- src/Core/Conversion/PropertyInfo.php | 8 ++-- src/Core/Conversion/UnionOf.php | 10 ++--- .../Exceptions/APIConnectionException.php | 4 +- src/Core/Exceptions/APIException.php | 4 +- src/Core/Exceptions/APIStatusException.php | 6 +-- src/Core/Exceptions/APITimeoutException.php | 4 +- .../Exceptions/AuthenticationException.php | 4 +- src/Core/Exceptions/BadRequestException.php | 4 +- src/Core/Exceptions/ConflictException.php | 4 +- ...KitException.php => ImagekitException.php} | 6 +-- .../Exceptions/InternalServerException.php | 4 +- src/Core/Exceptions/NotFoundException.php | 4 +- .../Exceptions/PermissionDeniedException.php | 4 +- src/Core/Exceptions/RateLimitException.php | 4 +- .../UnprocessableEntityException.php | 4 +- src/Core/Implementation/Omit.php | 2 +- src/Core/Util.php | 2 +- .../CustomMetadataField.php | 18 ++++----- .../CustomMetadataField/Schema.php | 16 ++++---- .../Schema/DefaultValue.php | 12 +++--- .../Schema/DefaultValue/Mixed1.php | 8 ++-- .../CustomMetadataField/Schema/MaxValue.php | 8 ++-- .../CustomMetadataField/Schema/MinValue.php | 8 ++-- .../Schema/SelectOption.php | 8 ++-- .../CustomMetadataField/Schema/Type.php | 2 +- .../CustomMetadataFieldCreateParams.php | 16 ++++---- .../Schema.php | 16 ++++---- .../Schema/DefaultValue.php | 12 +++--- .../Schema/DefaultValue/Mixed1.php | 8 ++-- .../Schema/MaxValue.php | 8 ++-- .../Schema/MinValue.php | 8 ++-- .../Schema/SelectOption.php | 8 ++-- .../Schema/Type.php | 2 +- .../CustomMetadataFieldDeleteResponse.php | 10 ++--- .../CustomMetadataFieldListParams.php | 12 +++--- .../CustomMetadataFieldUpdateParams.php | 14 +++---- .../Schema.php | 12 +++--- .../Schema/DefaultValue.php | 12 +++--- .../Schema/DefaultValue/Mixed1.php | 8 ++-- .../Schema/MaxValue.php | 8 ++-- .../Schema/MinValue.php | 8 ++-- .../Schema/SelectOption.php | 8 ++-- src/ExtensionItem.php | 14 +++---- src/ExtensionItem/AIAutoDescription.php | 8 ++-- src/ExtensionItem/AutoTaggingExtension.php | 10 ++--- .../AutoTaggingExtension/Name.php | 2 +- src/ExtensionItem/RemoveBg.php | 10 ++--- src/ExtensionItem/RemoveBg/Options.php | 8 ++-- src/Files/Bulk/BulkAddTagsParams.php | 12 +++--- src/Files/Bulk/BulkAddTagsResponse.php | 12 +++--- src/Files/Bulk/BulkDeleteParams.php | 12 +++--- src/Files/Bulk/BulkDeleteResponse.php | 12 +++--- src/Files/Bulk/BulkRemoveAITagsParams.php | 12 +++--- src/Files/Bulk/BulkRemoveAITagsResponse.php | 12 +++--- src/Files/Bulk/BulkRemoveTagsParams.php | 12 +++--- src/Files/Bulk/BulkRemoveTagsResponse.php | 12 +++--- src/Files/File.php | 22 +++++------ src/Files/File/AITag.php | 8 ++-- src/Files/File/SelectedFieldsSchema.php | 16 ++++---- .../SelectedFieldsSchema/DefaultValue.php | 12 +++--- .../DefaultValue/Mixed1.php | 8 ++-- .../File/SelectedFieldsSchema/MaxValue.php | 8 ++-- .../File/SelectedFieldsSchema/MinValue.php | 8 ++-- .../SelectedFieldsSchema/SelectOption.php | 8 ++-- src/Files/File/SelectedFieldsSchema/Type.php | 2 +- src/Files/File/Type.php | 2 +- src/Files/File/VersionInfo.php | 8 ++-- src/Files/FileCopyParams.php | 12 +++--- src/Files/FileCopyResponse.php | 10 ++--- src/Files/FileMoveParams.php | 12 +++--- src/Files/FileMoveResponse.php | 10 ++--- src/Files/FileRenameParams.php | 12 +++--- src/Files/FileRenameResponse.php | 12 +++--- src/Files/FileUpdateParams.php | 30 +++++++-------- src/Files/FileUpdateParams/Publish.php | 8 ++-- src/Files/FileUpdateParams/RemoveAITags.php | 10 ++--- src/Files/FileUpdateResponse.php | 32 ++++++++-------- .../FileUpdateResponse/ExtensionStatus.php | 18 ++++----- .../ExtensionStatus/AIAutoDescription.php | 2 +- .../ExtensionStatus/AwsAutoTagging.php | 2 +- .../ExtensionStatus/GoogleAutoTagging.php | 2 +- .../ExtensionStatus/RemoveBg.php | 2 +- src/Files/FileUploadParams.php | 38 +++++++++---------- src/Files/FileUploadParams/ResponseField.php | 2 +- src/Files/FileUploadParams/Transformation.php | 20 +++++----- .../FileUploadParams/Transformation/Post.php | 16 ++++---- .../Transformation/Post/Abs.php | 10 ++--- .../Transformation/Post/Abs/Protocol.php | 2 +- .../Transformation/Post/GifToVideo.php | 8 ++-- .../Transformation/Post/Thumbnail.php | 8 ++-- .../Transformation/Post/Transformation.php | 8 ++-- src/Files/FileUploadResponse.php | 34 ++++++++--------- src/Files/FileUploadResponse/AITag.php | 8 ++-- .../FileUploadResponse/ExtensionStatus.php | 18 ++++----- .../ExtensionStatus/AIAutoDescription.php | 2 +- .../ExtensionStatus/AwsAutoTagging.php | 2 +- .../ExtensionStatus/GoogleAutoTagging.php | 2 +- .../ExtensionStatus/RemoveBg.php | 2 +- .../SelectedFieldsSchema.php | 16 ++++---- .../SelectedFieldsSchema/DefaultValue.php | 12 +++--- .../DefaultValue/Mixed1.php | 8 ++-- .../SelectedFieldsSchema/MaxValue.php | 8 ++-- .../SelectedFieldsSchema/MinValue.php | 8 ++-- .../SelectedFieldsSchema/SelectOption.php | 8 ++-- .../SelectedFieldsSchema/Type.php | 2 +- src/Files/FileUploadResponse/VersionInfo.php | 8 ++-- src/Files/Folder.php | 10 ++--- src/Files/Folder/Type.php | 2 +- src/Files/Metadata.php | 20 +++++----- src/Files/Metadata/Exif.php | 18 ++++----- src/Files/Metadata/Exif/Exif.php | 8 ++-- src/Files/Metadata/Exif/Gps.php | 8 ++-- src/Files/Metadata/Exif/Image.php | 8 ++-- src/Files/Metadata/Exif/Interoperability.php | 8 ++-- src/Files/Metadata/Exif/Thumbnail.php | 8 ++-- .../Metadata/MetadataGetFromURLParams.php | 12 +++--- src/Files/UpdateFileRequest.php | 12 +++--- .../ChangePublicationStatus.php | 10 ++--- .../ChangePublicationStatus/Publish.php | 8 ++-- .../UpdateFileRequest/UpdateFileDetails.php | 24 ++++++------ .../UpdateFileDetails/RemoveAITags.php | 10 ++--- src/Files/Versions/VersionDeleteParams.php | 12 +++--- src/Files/Versions/VersionDeleteResponse.php | 10 ++--- src/Files/Versions/VersionGetParams.php | 12 +++--- src/Files/Versions/VersionRestoreParams.php | 12 +++--- src/Folders/FolderCopyParams.php | 12 +++--- src/Folders/FolderCopyResponse.php | 12 +++--- src/Folders/FolderCreateParams.php | 12 +++--- src/Folders/FolderDeleteParams.php | 12 +++--- src/Folders/FolderDeleteResponse.php | 10 ++--- src/Folders/FolderMoveParams.php | 12 +++--- src/Folders/FolderMoveResponse.php | 12 +++--- src/Folders/FolderNewResponse.php | 10 ++--- src/Folders/FolderRenameParams.php | 12 +++--- src/Folders/FolderRenameResponse.php | 12 +++--- src/Folders/Job/JobGetResponse.php | 18 ++++----- src/Folders/Job/JobGetResponse/Status.php | 2 +- src/Folders/Job/JobGetResponse/Type.php | 2 +- src/GetImageAttributesOptions.php | 8 ++-- src/ImageOverlay.php | 12 +++--- src/ImageOverlay/Encoding.php | 2 +- src/Overlay.php | 8 ++-- src/OverlayPosition.php | 10 ++--- src/OverlayPosition/Focus.php | 2 +- src/OverlayPosition/X.php | 8 ++-- src/OverlayPosition/Y.php | 8 ++-- src/OverlayTiming.php | 8 ++-- src/OverlayTiming/Duration.php | 8 ++-- src/OverlayTiming/End.php | 8 ++-- src/OverlayTiming/Start.php | 8 ++-- src/RequestOptions.php | 12 +++--- src/ResponsiveImageAttributes.php | 8 ++-- .../Accounts/OriginsContract.php | 22 +++++------ .../Accounts/URLEndpointsContract.php | 12 +++--- .../Accounts/UsageContract.php | 10 ++--- src/ServiceContracts/AccountsContract.php | 2 +- src/ServiceContracts/AssetsContract.php | 12 +++--- .../Beta/V2/FilesContract.php | 10 ++--- src/ServiceContracts/Beta/V2Contract.php | 2 +- src/ServiceContracts/BetaContract.php | 2 +- .../Cache/InvalidationContract.php | 12 +++--- src/ServiceContracts/CacheContract.php | 2 +- .../CustomMetadataFieldsContract.php | 16 ++++---- src/ServiceContracts/Files/BulkContract.php | 22 +++++------ .../Files/MetadataContract.php | 10 ++--- .../Files/VersionsContract.php | 16 ++++---- src/ServiceContracts/FilesContract.php | 26 ++++++------- src/ServiceContracts/Folders/JobContract.php | 8 ++-- src/ServiceContracts/FoldersContract.php | 26 ++++++------- src/ServiceContracts/WebhooksContract.php | 2 +- src/Services/Accounts/OriginsService.php | 34 ++++++++--------- src/Services/Accounts/URLEndpointsService.php | 18 ++++----- src/Services/Accounts/UsageService.php | 14 +++---- src/Services/AccountsService.php | 12 +++--- src/Services/AssetsService.php | 22 +++++------ src/Services/Beta/V2/FilesService.php | 14 +++---- src/Services/Beta/V2Service.php | 8 ++-- src/Services/BetaService.php | 8 ++-- src/Services/Cache/InvalidationService.php | 16 ++++---- src/Services/CacheService.php | 8 ++-- src/Services/CustomMetadataFieldsService.php | 22 +++++------ src/Services/Files/BulkService.php | 26 ++++++------- src/Services/Files/MetadataService.php | 14 +++---- src/Services/Files/VersionsService.php | 22 +++++------ src/Services/FilesService.php | 38 +++++++++---------- src/Services/Folders/JobService.php | 12 +++--- src/Services/FoldersService.php | 32 ++++++++-------- src/Services/WebhooksService.php | 6 +-- src/SolidColorOverlay.php | 10 ++--- src/SolidColorOverlayTransformation.php | 8 ++-- .../Gradient.php | 8 ++-- .../Height.php | 8 ++-- .../Radius.php | 8 ++-- src/SolidColorOverlayTransformation/Width.php | 8 ++-- src/SrcOptions.php | 8 ++-- src/StreamingResolution.php | 2 +- src/SubtitleOverlay.php | 16 ++++---- src/SubtitleOverlay/Encoding.php | 2 +- src/SubtitleOverlayTransformation.php | 10 ++--- .../Typography.php | 2 +- src/TextOverlay.php | 18 ++++----- src/TextOverlay/Encoding.php | 2 +- src/TextOverlayTransformation.php | 12 +++--- src/TextOverlayTransformation/Flip.php | 2 +- src/TextOverlayTransformation/FontSize.php | 8 ++-- .../InnerAlignment.php | 2 +- src/TextOverlayTransformation/LineHeight.php | 8 ++-- src/TextOverlayTransformation/Padding.php | 8 ++-- src/TextOverlayTransformation/Radius.php | 8 ++-- src/TextOverlayTransformation/Rotation.php | 8 ++-- src/TextOverlayTransformation/Width.php | 8 ++-- src/Transformation.php | 22 +++++------ src/Transformation/AIDropShadow.php | 8 ++-- src/Transformation/AspectRatio.php | 8 ++-- src/Transformation/AudioCodec.php | 2 +- src/Transformation/Crop.php | 2 +- src/Transformation/CropMode.php | 2 +- src/Transformation/Duration.php | 8 ++-- src/Transformation/EndOffset.php | 8 ++-- src/Transformation/Flip.php | 2 +- src/Transformation/Format.php | 2 +- src/Transformation/Gradient.php | 8 ++-- src/Transformation/Height.php | 8 ++-- src/Transformation/Page.php | 8 ++-- src/Transformation/Radius.php | 8 ++-- src/Transformation/Rotation.php | 8 ++-- src/Transformation/Shadow.php | 8 ++-- src/Transformation/Sharpen.php | 8 ++-- src/Transformation/StartOffset.php | 8 ++-- src/Transformation/Trim.php | 8 ++-- src/Transformation/UnsharpMask.php | 8 ++-- src/Transformation/VideoCodec.php | 2 +- src/Transformation/Width.php | 8 ++-- src/Transformation/X.php | 8 ++-- src/Transformation/XCenter.php | 8 ++-- src/Transformation/Y.php | 8 ++-- src/Transformation/YCenter.php | 8 ++-- src/TransformationPosition.php | 2 +- src/VideoOverlay.php | 12 +++--- src/VideoOverlay/Encoding.php | 2 +- src/Webhooks/BaseWebhookEvent.php | 8 ++-- src/Webhooks/UnsafeUnwrapWebhookEvent.php | 8 ++-- src/Webhooks/UnwrapWebhookEvent.php | 8 ++-- .../UploadPostTransformErrorEvent.php | 16 ++++---- .../UploadPostTransformErrorEvent/Data.php | 12 +++--- .../Data/Transformation.php | 10 ++--- .../Data/Transformation/Error.php | 8 ++-- .../UploadPostTransformErrorEvent/Request.php | 14 +++---- .../Request/Transformation.php | 12 +++--- .../Request/Transformation/Protocol.php | 2 +- .../Request/Transformation/Type.php | 2 +- .../UploadPostTransformSuccessEvent.php | 16 ++++---- .../UploadPostTransformSuccessEvent/Data.php | 8 ++-- .../Request.php | 14 +++---- .../Request/Transformation.php | 12 +++--- .../Request/Transformation/Protocol.php | 2 +- .../Request/Transformation/Type.php | 2 +- src/Webhooks/UploadPreTransformErrorEvent.php | 16 ++++---- .../UploadPreTransformErrorEvent/Data.php | 12 +++--- .../Data/Transformation.php | 10 ++--- .../Data/Transformation/Error.php | 8 ++-- .../UploadPreTransformErrorEvent/Request.php | 8 ++-- .../UploadPreTransformSuccessEvent.php | 24 ++++++------ .../UploadPreTransformSuccessEvent/Data.php | 32 ++++++++-------- .../Data/AITag.php | 8 ++-- .../Data/ExtensionStatus.php | 18 ++++----- .../ExtensionStatus/AIAutoDescription.php | 2 +- .../Data/ExtensionStatus/AwsAutoTagging.php | 2 +- .../ExtensionStatus/GoogleAutoTagging.php | 2 +- .../Data/ExtensionStatus/RemoveBg.php | 2 +- .../Data/SelectedFieldsSchema.php | 16 ++++---- .../SelectedFieldsSchema/DefaultValue.php | 12 +++--- .../DefaultValue/Mixed1.php | 8 ++-- .../Data/SelectedFieldsSchema/MaxValue.php | 8 ++-- .../Data/SelectedFieldsSchema/MinValue.php | 8 ++-- .../SelectedFieldsSchema/SelectOption.php | 8 ++-- .../Data/SelectedFieldsSchema/Type.php | 2 +- .../Data/VersionInfo.php | 8 ++-- .../Request.php | 8 ++-- .../VideoTransformationAcceptedEvent.php | 18 ++++----- .../VideoTransformationAcceptedEvent/Data.php | 16 ++++---- .../Data/Asset.php | 8 ++-- .../Data/Transformation.php | 20 +++++----- .../Data/Transformation/Options.php | 18 ++++----- .../Transformation/Options/AudioCodec.php | 2 +- .../Data/Transformation/Options/Format.php | 2 +- .../Transformation/Options/StreamProtocol.php | 2 +- .../Transformation/Options/VideoCodec.php | 2 +- .../Data/Transformation/Type.php | 2 +- .../Request.php | 8 ++-- .../VideoTransformationErrorEvent.php | 18 ++++----- .../VideoTransformationErrorEvent/Data.php | 18 ++++----- .../Data/Asset.php | 8 ++-- .../Data/Transformation.php | 26 ++++++------- .../Data/Transformation/Error.php | 10 ++--- .../Data/Transformation/Error/Reason.php | 2 +- .../Data/Transformation/Options.php | 18 ++++----- .../Transformation/Options/AudioCodec.php | 2 +- .../Data/Transformation/Options/Format.php | 2 +- .../Transformation/Options/StreamProtocol.php | 2 +- .../Transformation/Options/VideoCodec.php | 2 +- .../Data/Transformation/Type.php | 2 +- .../VideoTransformationErrorEvent/Request.php | 8 ++-- .../VideoTransformationReadyEvent.php | 20 +++++----- .../VideoTransformationReadyEvent/Data.php | 18 ++++----- .../Data/Asset.php | 8 ++-- .../Data/Transformation.php | 26 ++++++------- .../Data/Transformation/Options.php | 18 ++++----- .../Transformation/Options/AudioCodec.php | 2 +- .../Data/Transformation/Options/Format.php | 2 +- .../Transformation/Options/StreamProtocol.php | 2 +- .../Transformation/Options/VideoCodec.php | 2 +- .../Data/Transformation/Output.php | 10 ++--- .../Transformation/Output/VideoMetadata.php | 8 ++-- .../Data/Transformation/Type.php | 2 +- .../VideoTransformationReadyEvent/Request.php | 8 ++-- .../VideoTransformationReadyEvent/Timings.php | 8 ++-- tests/Core/TestModel.php | 6 +-- tests/Services/Accounts/OriginsTest.php | 2 +- tests/Services/Accounts/URLEndpointsTest.php | 4 +- tests/Services/Accounts/UsageTest.php | 4 +- tests/Services/AssetsTest.php | 2 +- tests/Services/Beta/V2/FilesTest.php | 4 +- tests/Services/Cache/InvalidationTest.php | 6 +-- tests/Services/CustomMetadataFieldsTest.php | 6 +-- tests/Services/Files/BulkTest.php | 10 ++--- tests/Services/Files/MetadataTest.php | 4 +- tests/Services/Files/VersionsTest.php | 6 +-- tests/Services/FilesTest.php | 14 +++---- tests/Services/Folders/JobTest.php | 4 +- tests/Services/FoldersTest.php | 12 +++--- tests/Services/WebhooksTest.php | 2 +- 435 files changed, 2099 insertions(+), 2099 deletions(-) rename src/Core/Exceptions/{ImageKitException.php => ImagekitException.php} (63%) diff --git a/.stats.yml b/.stats.yml index ae3aead6..8577a4cc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-9d184cb502ab32a85db2889c796cdfebe812f2a55a604df79c85dd4b5e7e2add.yml openapi_spec_hash: a9aa620376fce66532c84f9364209b0b -config_hash: eb4cf65a4c6b26a2901076eff5810d5d +config_hash: 10b48f323ed534664483af1952174d52 diff --git a/README.md b/README.md index 8ef475a2..edc408f5 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ Parameters with a default value must be set by name. ```php withName("Joey")`. ### Handling errors -When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `ImageKit\Core\Exceptions\APIException` will be thrown: +When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `Imagekit\Core\Exceptions\APIException` will be thrown: ```php files->upload([ @@ -113,8 +113,8 @@ You can use the `maxRetries` option to configure or disable this: ```php files->upload( [ diff --git a/composer.json b/composer.json index 1482d609..f19a6279 100644 --- a/composer.json +++ b/composer.json @@ -7,7 +7,7 @@ "src/Client.php" ], "psr-4": { - "ImageKit\\": "src/" + "Imagekit\\": "src/" } }, "autoload-dev": { diff --git a/src/Accounts/Origins/OriginCreateParams.php b/src/Accounts/Origins/OriginCreateParams.php index 65ae3a7e..02a00151 100644 --- a/src/Accounts/Origins/OriginCreateParams.php +++ b/src/Accounts/Origins/OriginCreateParams.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace ImageKit\Accounts\Origins; +namespace Imagekit\Accounts\Origins; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; /** * **Note:** This API is currently in beta. * Creates a new origin and returns the origin object. * - * @see ImageKit\Services\Accounts\OriginsService::create() + * @see Imagekit\Services\Accounts\OriginsService::create() * * @phpstan-type OriginCreateParamsShape = array{ * accessKey: string, diff --git a/src/Accounts/Origins/OriginRequest.php b/src/Accounts/Origins/OriginRequest.php index 1f30f86c..e9317273 100644 --- a/src/Accounts/Origins/OriginRequest.php +++ b/src/Accounts/Origins/OriginRequest.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace ImageKit\Accounts\Origins; +namespace Imagekit\Accounts\Origins; -use ImageKit\Accounts\Origins\OriginRequest\AkeneoPim; -use ImageKit\Accounts\Origins\OriginRequest\AzureBlob; -use ImageKit\Accounts\Origins\OriginRequest\CloudinaryBackup; -use ImageKit\Accounts\Origins\OriginRequest\Gcs; -use ImageKit\Accounts\Origins\OriginRequest\S3; -use ImageKit\Accounts\Origins\OriginRequest\S3Compatible; -use ImageKit\Accounts\Origins\OriginRequest\WebFolder; -use ImageKit\Accounts\Origins\OriginRequest\WebProxy; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Accounts\Origins\OriginRequest\AkeneoPim; +use Imagekit\Accounts\Origins\OriginRequest\AzureBlob; +use Imagekit\Accounts\Origins\OriginRequest\CloudinaryBackup; +use Imagekit\Accounts\Origins\OriginRequest\Gcs; +use Imagekit\Accounts\Origins\OriginRequest\S3; +use Imagekit\Accounts\Origins\OriginRequest\S3Compatible; +use Imagekit\Accounts\Origins\OriginRequest\WebFolder; +use Imagekit\Accounts\Origins\OriginRequest\WebProxy; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Schema for origin request resources. diff --git a/src/Accounts/Origins/OriginRequest/AkeneoPim.php b/src/Accounts/Origins/OriginRequest/AkeneoPim.php index e52266f1..1d74753c 100644 --- a/src/Accounts/Origins/OriginRequest/AkeneoPim.php +++ b/src/Accounts/Origins/OriginRequest/AkeneoPim.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\Origins\OriginRequest; +namespace Imagekit\Accounts\Origins\OriginRequest; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type AkeneoPimShape = array{ diff --git a/src/Accounts/Origins/OriginRequest/AzureBlob.php b/src/Accounts/Origins/OriginRequest/AzureBlob.php index a3052687..f9f10555 100644 --- a/src/Accounts/Origins/OriginRequest/AzureBlob.php +++ b/src/Accounts/Origins/OriginRequest/AzureBlob.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\Origins\OriginRequest; +namespace Imagekit\Accounts\Origins\OriginRequest; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type AzureBlobShape = array{ diff --git a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php index ac6ede7d..91f457d8 100644 --- a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\Origins\OriginRequest; +namespace Imagekit\Accounts\Origins\OriginRequest; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type CloudinaryBackupShape = array{ diff --git a/src/Accounts/Origins/OriginRequest/Gcs.php b/src/Accounts/Origins/OriginRequest/Gcs.php index e49d978b..7a5159d5 100644 --- a/src/Accounts/Origins/OriginRequest/Gcs.php +++ b/src/Accounts/Origins/OriginRequest/Gcs.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\Origins\OriginRequest; +namespace Imagekit\Accounts\Origins\OriginRequest; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type GcsShape = array{ diff --git a/src/Accounts/Origins/OriginRequest/S3.php b/src/Accounts/Origins/OriginRequest/S3.php index 57f783fc..5fbc04fd 100644 --- a/src/Accounts/Origins/OriginRequest/S3.php +++ b/src/Accounts/Origins/OriginRequest/S3.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\Origins\OriginRequest; +namespace Imagekit\Accounts\Origins\OriginRequest; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type S3Shape = array{ diff --git a/src/Accounts/Origins/OriginRequest/S3Compatible.php b/src/Accounts/Origins/OriginRequest/S3Compatible.php index b82425d1..3eb10c85 100644 --- a/src/Accounts/Origins/OriginRequest/S3Compatible.php +++ b/src/Accounts/Origins/OriginRequest/S3Compatible.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\Origins\OriginRequest; +namespace Imagekit\Accounts\Origins\OriginRequest; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type S3CompatibleShape = array{ diff --git a/src/Accounts/Origins/OriginRequest/WebFolder.php b/src/Accounts/Origins/OriginRequest/WebFolder.php index 5b404dce..0f5ce61b 100644 --- a/src/Accounts/Origins/OriginRequest/WebFolder.php +++ b/src/Accounts/Origins/OriginRequest/WebFolder.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\Origins\OriginRequest; +namespace Imagekit\Accounts\Origins\OriginRequest; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type WebFolderShape = array{ diff --git a/src/Accounts/Origins/OriginRequest/WebProxy.php b/src/Accounts/Origins/OriginRequest/WebProxy.php index 44050bcc..5d95d5e3 100644 --- a/src/Accounts/Origins/OriginRequest/WebProxy.php +++ b/src/Accounts/Origins/OriginRequest/WebProxy.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\Origins\OriginRequest; +namespace Imagekit\Accounts\Origins\OriginRequest; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type WebProxyShape = array{ diff --git a/src/Accounts/Origins/OriginResponse.php b/src/Accounts/Origins/OriginResponse.php index 6ecf0ba4..8d39b427 100644 --- a/src/Accounts/Origins/OriginResponse.php +++ b/src/Accounts/Origins/OriginResponse.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace ImageKit\Accounts\Origins; +namespace Imagekit\Accounts\Origins; -use ImageKit\Accounts\Origins\OriginResponse\AkeneoPim; -use ImageKit\Accounts\Origins\OriginResponse\AzureBlob; -use ImageKit\Accounts\Origins\OriginResponse\CloudinaryBackup; -use ImageKit\Accounts\Origins\OriginResponse\Gcs; -use ImageKit\Accounts\Origins\OriginResponse\S3; -use ImageKit\Accounts\Origins\OriginResponse\S3Compatible; -use ImageKit\Accounts\Origins\OriginResponse\WebFolder; -use ImageKit\Accounts\Origins\OriginResponse\WebProxy; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Accounts\Origins\OriginResponse\AkeneoPim; +use Imagekit\Accounts\Origins\OriginResponse\AzureBlob; +use Imagekit\Accounts\Origins\OriginResponse\CloudinaryBackup; +use Imagekit\Accounts\Origins\OriginResponse\Gcs; +use Imagekit\Accounts\Origins\OriginResponse\S3; +use Imagekit\Accounts\Origins\OriginResponse\S3Compatible; +use Imagekit\Accounts\Origins\OriginResponse\WebFolder; +use Imagekit\Accounts\Origins\OriginResponse\WebProxy; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Origin object as returned by the API (sensitive fields removed). diff --git a/src/Accounts/Origins/OriginResponse/AkeneoPim.php b/src/Accounts/Origins/OriginResponse/AkeneoPim.php index 5dfd02a0..49025821 100644 --- a/src/Accounts/Origins/OriginResponse/AkeneoPim.php +++ b/src/Accounts/Origins/OriginResponse/AkeneoPim.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\Origins\OriginResponse; +namespace Imagekit\Accounts\Origins\OriginResponse; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type AkeneoPimShape = array{ diff --git a/src/Accounts/Origins/OriginResponse/AzureBlob.php b/src/Accounts/Origins/OriginResponse/AzureBlob.php index dd31ff0d..f96db808 100644 --- a/src/Accounts/Origins/OriginResponse/AzureBlob.php +++ b/src/Accounts/Origins/OriginResponse/AzureBlob.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\Origins\OriginResponse; +namespace Imagekit\Accounts\Origins\OriginResponse; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type AzureBlobShape = array{ diff --git a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php index 62fd6501..30620016 100644 --- a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\Origins\OriginResponse; +namespace Imagekit\Accounts\Origins\OriginResponse; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type CloudinaryBackupShape = array{ diff --git a/src/Accounts/Origins/OriginResponse/Gcs.php b/src/Accounts/Origins/OriginResponse/Gcs.php index 7640d56e..9f65d7fb 100644 --- a/src/Accounts/Origins/OriginResponse/Gcs.php +++ b/src/Accounts/Origins/OriginResponse/Gcs.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\Origins\OriginResponse; +namespace Imagekit\Accounts\Origins\OriginResponse; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type GcsShape = array{ diff --git a/src/Accounts/Origins/OriginResponse/S3.php b/src/Accounts/Origins/OriginResponse/S3.php index afd76141..3b465864 100644 --- a/src/Accounts/Origins/OriginResponse/S3.php +++ b/src/Accounts/Origins/OriginResponse/S3.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\Origins\OriginResponse; +namespace Imagekit\Accounts\Origins\OriginResponse; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type S3Shape = array{ diff --git a/src/Accounts/Origins/OriginResponse/S3Compatible.php b/src/Accounts/Origins/OriginResponse/S3Compatible.php index d86d3c02..80389cf8 100644 --- a/src/Accounts/Origins/OriginResponse/S3Compatible.php +++ b/src/Accounts/Origins/OriginResponse/S3Compatible.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\Origins\OriginResponse; +namespace Imagekit\Accounts\Origins\OriginResponse; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type S3CompatibleShape = array{ diff --git a/src/Accounts/Origins/OriginResponse/WebFolder.php b/src/Accounts/Origins/OriginResponse/WebFolder.php index 1e1d61ff..07f89fb2 100644 --- a/src/Accounts/Origins/OriginResponse/WebFolder.php +++ b/src/Accounts/Origins/OriginResponse/WebFolder.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\Origins\OriginResponse; +namespace Imagekit\Accounts\Origins\OriginResponse; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type WebFolderShape = array{ diff --git a/src/Accounts/Origins/OriginResponse/WebProxy.php b/src/Accounts/Origins/OriginResponse/WebProxy.php index c7d324de..bbc5aea0 100644 --- a/src/Accounts/Origins/OriginResponse/WebProxy.php +++ b/src/Accounts/Origins/OriginResponse/WebProxy.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\Origins\OriginResponse; +namespace Imagekit\Accounts\Origins\OriginResponse; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type WebProxyShape = array{ diff --git a/src/Accounts/Origins/OriginUpdateParams.php b/src/Accounts/Origins/OriginUpdateParams.php index fd9f5f38..0e486ecf 100644 --- a/src/Accounts/Origins/OriginUpdateParams.php +++ b/src/Accounts/Origins/OriginUpdateParams.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace ImageKit\Accounts\Origins; +namespace Imagekit\Accounts\Origins; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; /** * **Note:** This API is currently in beta. * Updates the origin identified by `id` and returns the updated origin object. * - * @see ImageKit\Services\Accounts\OriginsService::update() + * @see Imagekit\Services\Accounts\OriginsService::update() * * @phpstan-type OriginUpdateParamsShape = array{ * accessKey: string, diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php index 44850543..2eb86ecf 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace ImageKit\Accounts\URLEndpoints; +namespace Imagekit\Accounts\URLEndpoints; -use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter; -use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Akamai; -use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Cloudinary; -use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Imgix; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter; +use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Akamai; +use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Cloudinary; +use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Imgix; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; /** * **Note:** This API is currently in beta. * Creates a new URL‑endpoint and returns the resulting object. * - * @see ImageKit\Services\Accounts\URLEndpointsService::create() + * @see Imagekit\Services\Accounts\URLEndpointsService::create() * * @phpstan-type URLEndpointCreateParamsShape = array{ * description: string, diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php index e12e7dfb..802940d1 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams; +namespace Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams; -use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Akamai; -use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Cloudinary; -use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Imgix; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Akamai; +use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Cloudinary; +use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Imgix; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Configuration for third-party URL rewriting. diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php index c4e5c4dc..6634161b 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter; +namespace Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type AkamaiShape = array{type: 'AKAMAI'} diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php index 05d46382..b7fb169f 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter; +namespace Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type CloudinaryShape = array{ diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php index f6ab1caa..aa5455bb 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter; +namespace Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type ImgixShape = array{type: 'IMGIX'} diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest.php b/src/Accounts/URLEndpoints/URLEndpointRequest.php index 9a22913c..308cc40e 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace ImageKit\Accounts\URLEndpoints; - -use ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter; -use ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\Akamai; -use ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\Cloudinary; -use ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\Imgix; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +namespace Imagekit\Accounts\URLEndpoints; + +use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter; +use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\Akamai; +use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\Cloudinary; +use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\Imgix; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * Schema for URL endpoint resource. diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php index 9e38453c..5d1af17a 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace ImageKit\Accounts\URLEndpoints\URLEndpointRequest; +namespace Imagekit\Accounts\URLEndpoints\URLEndpointRequest; -use ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\Akamai; -use ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\Cloudinary; -use ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\Imgix; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\Akamai; +use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\Cloudinary; +use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\Imgix; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Configuration for third-party URL rewriting. diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php index 0064ffd0..687b40fd 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter; +namespace Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type AkamaiShape = array{type: 'AKAMAI'} diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php index e6bd935d..56361c98 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter; +namespace Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type CloudinaryShape = array{ diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php index 11fddcec..614765d6 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter; +namespace Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type ImgixShape = array{type: 'IMGIX'} diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse.php b/src/Accounts/URLEndpoints/URLEndpointResponse.php index afa47fc0..6f3a8ea6 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace ImageKit\Accounts\URLEndpoints; - -use ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter; -use ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\Akamai; -use ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\Cloudinary; -use ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\Imgix; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkResponse; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Core\Conversion\Contracts\ResponseConverter; +namespace Imagekit\Accounts\URLEndpoints; + +use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter; +use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\Akamai; +use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\Cloudinary; +use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\Imgix; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkResponse; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * URL‑endpoint object as returned by the API. diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php index 765d78eb..89243e87 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace ImageKit\Accounts\URLEndpoints\URLEndpointResponse; +namespace Imagekit\Accounts\URLEndpoints\URLEndpointResponse; -use ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\Akamai; -use ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\Cloudinary; -use ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\Imgix; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\Akamai; +use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\Cloudinary; +use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\Imgix; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Configuration for third-party URL rewriting. diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php index 2ef54321..cff1eab3 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter; +namespace Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type AkamaiShape = array{type: 'AKAMAI'} diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php index 94a53044..2ca69b96 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter; +namespace Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type CloudinaryShape = array{ diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php index b78f7dc6..36a3c3f7 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter; +namespace Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type ImgixShape = array{type: 'IMGIX'} diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php index 2ad34c9d..29050d5c 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace ImageKit\Accounts\URLEndpoints; +namespace Imagekit\Accounts\URLEndpoints; -use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter; -use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Akamai; -use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Cloudinary; -use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Imgix; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter; +use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Akamai; +use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Cloudinary; +use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Imgix; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; /** * **Note:** This API is currently in beta. * Updates the URL‑endpoint identified by `id` and returns the updated object. * - * @see ImageKit\Services\Accounts\URLEndpointsService::update() + * @see Imagekit\Services\Accounts\URLEndpointsService::update() * * @phpstan-type URLEndpointUpdateParamsShape = array{ * description: string, diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php index 9b451859..c6a05390 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams; +namespace Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams; -use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Akamai; -use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Cloudinary; -use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Imgix; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Akamai; +use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Cloudinary; +use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Imgix; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Configuration for third-party URL rewriting. diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php index b611107e..f2992233 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter; +namespace Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type AkamaiShape = array{type: 'AKAMAI'} diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php index 2c551c92..bee8d4af 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter; +namespace Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type CloudinaryShape = array{ diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php index 7e4bbd7f..515cf738 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter; +namespace Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type ImgixShape = array{type: 'IMGIX'} diff --git a/src/Accounts/Usage/UsageGetParams.php b/src/Accounts/Usage/UsageGetParams.php index 7122f556..b6c8767d 100644 --- a/src/Accounts/Usage/UsageGetParams.php +++ b/src/Accounts/Usage/UsageGetParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace ImageKit\Accounts\Usage; +namespace Imagekit\Accounts\Usage; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; /** * Get the account usage information between two dates. Note that the API response includes data from the start date while excluding data from the end date. In other words, the data covers the period starting from the specified start date up to, but not including, the end date. * - * @see ImageKit\Services\Accounts\UsageService::get() + * @see Imagekit\Services\Accounts\UsageService::get() * * @phpstan-type UsageGetParamsShape = array{ * endDate: \DateTimeInterface, startDate: \DateTimeInterface diff --git a/src/Accounts/Usage/UsageGetResponse.php b/src/Accounts/Usage/UsageGetResponse.php index 69bc2390..b9b24b8e 100644 --- a/src/Accounts/Usage/UsageGetResponse.php +++ b/src/Accounts/Usage/UsageGetResponse.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Accounts\Usage; +namespace Imagekit\Accounts\Usage; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkResponse; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Core\Conversion\Contracts\ResponseConverter; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkResponse; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type UsageGetResponseShape = array{ diff --git a/src/Assets/AssetListParams.php b/src/Assets/AssetListParams.php index 459d52d8..5fa60c7e 100644 --- a/src/Assets/AssetListParams.php +++ b/src/Assets/AssetListParams.php @@ -2,20 +2,20 @@ declare(strict_types=1); -namespace ImageKit\Assets; +namespace Imagekit\Assets; -use ImageKit\Assets\AssetListParams\FileType; -use ImageKit\Assets\AssetListParams\Sort; -use ImageKit\Assets\AssetListParams\Type; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Assets\AssetListParams\FileType; +use Imagekit\Assets\AssetListParams\Sort; +use Imagekit\Assets\AssetListParams\Type; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; /** * This API can list all the uploaded files and folders in your ImageKit.io media library. In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and provide this generated string as the value of the `searchQuery`. * - * @see ImageKit\Services\AssetsService::list() + * @see Imagekit\Services\AssetsService::list() * * @phpstan-type AssetListParamsShape = array{ * fileType?: FileType|value-of, diff --git a/src/Assets/AssetListParams/FileType.php b/src/Assets/AssetListParams/FileType.php index 8c812108..522b96fc 100644 --- a/src/Assets/AssetListParams/FileType.php +++ b/src/Assets/AssetListParams/FileType.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Assets\AssetListParams; +namespace Imagekit\Assets\AssetListParams; /** * Filter results by file type. diff --git a/src/Assets/AssetListParams/Sort.php b/src/Assets/AssetListParams/Sort.php index ff5a2378..51eb8459 100644 --- a/src/Assets/AssetListParams/Sort.php +++ b/src/Assets/AssetListParams/Sort.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Assets\AssetListParams; +namespace Imagekit\Assets\AssetListParams; /** * Sort the results by one of the supported fields in ascending or descending order. diff --git a/src/Assets/AssetListParams/Type.php b/src/Assets/AssetListParams/Type.php index a4d41c10..13ce10ab 100644 --- a/src/Assets/AssetListParams/Type.php +++ b/src/Assets/AssetListParams/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Assets\AssetListParams; +namespace Imagekit\Assets\AssetListParams; /** * Filter results by asset type. diff --git a/src/Assets/AssetListResponseItem.php b/src/Assets/AssetListResponseItem.php index 0d49d2e0..500d7c3d 100644 --- a/src/Assets/AssetListResponseItem.php +++ b/src/Assets/AssetListResponseItem.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Assets; +namespace Imagekit\Assets; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Files\File; -use ImageKit\Files\Folder; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Files\File; +use Imagekit\Files\Folder; /** * Object containing details of a file or file version. diff --git a/src/BaseOverlay.php b/src/BaseOverlay.php index fc7328e7..f9509201 100644 --- a/src/BaseOverlay.php +++ b/src/BaseOverlay.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit; +namespace Imagekit; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\OverlayPosition\Focus; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\OverlayPosition\Focus; /** * @phpstan-type BaseOverlayShape = array{ diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index 6e8b6415..1770a1f3 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -2,23 +2,23 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files; - -use ImageKit\Beta\V2\Files\FileUploadParams\ResponseField; -use ImageKit\Beta\V2\Files\FileUploadParams\Transformation; -use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs; -use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\GifToVideo; -use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Thumbnail; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\ExtensionItem; -use ImageKit\ExtensionItem\AIAutoDescription; -use ImageKit\ExtensionItem\AutoTaggingExtension; -use ImageKit\ExtensionItem\AutoTaggingExtension\Name; -use ImageKit\ExtensionItem\RemoveBg; -use ImageKit\ExtensionItem\RemoveBg\Options; +namespace Imagekit\Beta\V2\Files; + +use Imagekit\Beta\V2\Files\FileUploadParams\ResponseField; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\GifToVideo; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Thumbnail; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\ExtensionItem; +use Imagekit\ExtensionItem\AIAutoDescription; +use Imagekit\ExtensionItem\AutoTaggingExtension; +use Imagekit\ExtensionItem\AutoTaggingExtension\Name; +use Imagekit\ExtensionItem\RemoveBg; +use Imagekit\ExtensionItem\RemoveBg\Options; /** * The V2 API enhances security by verifying the entire payload using JWT. This API is in beta. @@ -36,7 +36,7 @@ * - A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more. * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. * - * @see ImageKit\Services\Beta\V2\FilesService::upload() + * @see Imagekit\Services\Beta\V2\FilesService::upload() * * @phpstan-type FileUploadParamsShape = array{ * file: string, @@ -61,7 +61,7 @@ * responseFields?: list>, * tags?: list, * transformation?: Transformation|array{ - * post?: list<\ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Transformation|GifToVideo|Thumbnail|Abs>|null, + * post?: list<\Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Transformation|GifToVideo|Thumbnail|Abs>|null, * pre?: string|null, * }, * useUniqueFileName?: bool, diff --git a/src/Beta/V2/Files/FileUploadParams/ResponseField.php b/src/Beta/V2/Files/FileUploadParams/ResponseField.php index 04a9aeb2..72fc2f32 100644 --- a/src/Beta/V2/Files/FileUploadParams/ResponseField.php +++ b/src/Beta/V2/Files/FileUploadParams/ResponseField.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadParams; +namespace Imagekit\Beta\V2\Files\FileUploadParams; enum ResponseField: string { diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation.php index e44f14de..bd713fa2 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadParams; +namespace Imagekit\Beta\V2\Files\FileUploadParams; -use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post; -use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs; -use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs\Protocol; -use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\GifToVideo; -use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Thumbnail; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs\Protocol; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\GifToVideo; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Thumbnail; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * Configure pre-processing (`pre`) and post-processing (`post`) transformations. @@ -25,7 +25,7 @@ * You can mix and match any combination of post-processing types. * * @phpstan-type TransformationShape = array{ - * post?: list<\ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Transformation|GifToVideo|Thumbnail|Abs>|null, + * post?: list<\Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Transformation|GifToVideo|Thumbnail|Abs>|null, * pre?: string|null, * } */ diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php index 8c8f16d7..64fddedc 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadParams\Transformation; +namespace Imagekit\Beta\V2\Files\FileUploadParams\Transformation; -use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs; -use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\GifToVideo; -use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Thumbnail; -use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Transformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\GifToVideo; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Thumbnail; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Transformation; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; final class Post implements ConverterSource { diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php index 4c803805..2454dbd0 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post; +namespace Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post; -use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs\Protocol; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs\Protocol; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type AbsShape = array{ diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php index a24c22af..a2aaa672 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs; +namespace Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs; /** * Streaming protocol to use (`hls` or `dash`). diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php index 9cbc8a9c..41a96778 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post; +namespace Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type GifToVideoShape = array{type: 'gif-to-video', value?: string|null} diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php index 8ffbc1d2..79dee1ac 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post; +namespace Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type ThumbnailShape = array{type: 'thumbnail', value?: string|null} diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php index 7f547d69..fd2db642 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post; +namespace Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type TransformationShape = array{type: 'transformation', value: string} diff --git a/src/Beta/V2/Files/FileUploadResponse.php b/src/Beta/V2/Files/FileUploadResponse.php index a3edadeb..533a12a4 100644 --- a/src/Beta/V2/Files/FileUploadResponse.php +++ b/src/Beta/V2/Files/FileUploadResponse.php @@ -2,24 +2,24 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files; - -use ImageKit\Beta\V2\Files\FileUploadResponse\AITag; -use ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; -use ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\AIAutoDescription; -use ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\AwsAutoTagging; -use ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\GoogleAutoTagging; -use ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\RemoveBg; -use ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; -use ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\Type; -use ImageKit\Beta\V2\Files\FileUploadResponse\VersionInfo; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkResponse; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Core\Conversion\Contracts\ResponseConverter; -use ImageKit\Files\Metadata; -use ImageKit\Files\Metadata\Exif; +namespace Imagekit\Beta\V2\Files; + +use Imagekit\Beta\V2\Files\FileUploadResponse\AITag; +use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; +use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\AIAutoDescription; +use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\AwsAutoTagging; +use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\GoogleAutoTagging; +use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\RemoveBg; +use Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; +use Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\Type; +use Imagekit\Beta\V2\Files\FileUploadResponse\VersionInfo; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkResponse; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\Conversion\Contracts\ResponseConverter; +use Imagekit\Files\Metadata; +use Imagekit\Files\Metadata\Exif; /** * Object containing details of a successful upload. diff --git a/src/Beta/V2/Files/FileUploadResponse/AITag.php b/src/Beta/V2/Files/FileUploadResponse/AITag.php index d5fd5f56..147cc716 100644 --- a/src/Beta/V2/Files/FileUploadResponse/AITag.php +++ b/src/Beta/V2/Files/FileUploadResponse/AITag.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadResponse; +namespace Imagekit\Beta\V2\Files\FileUploadResponse; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type AITagShape = array{ diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php index f23bdb19..1bef904f 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadResponse; - -use ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\AIAutoDescription; -use ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\AwsAutoTagging; -use ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\GoogleAutoTagging; -use ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\RemoveBg; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +namespace Imagekit\Beta\V2\Files\FileUploadResponse; + +use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\AIAutoDescription; +use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\AwsAutoTagging; +use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\GoogleAutoTagging; +use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\RemoveBg; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * Extension names with their processing status at the time of completion of the request. It could have one of the following status values: diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php index c38a0dcf..2669c27d 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; +namespace Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; enum AIAutoDescription: string { diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php index ac0ff91d..0da0e20a 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; +namespace Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; enum AwsAutoTagging: string { diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php index 740091fe..25ae68aa 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; +namespace Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; enum GoogleAutoTagging: string { diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php index 5b1468d3..44149e3b 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; +namespace Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; enum RemoveBg: string { diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php index 0b2216d7..f19dc60d 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadResponse; - -use ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue; -use ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\SelectOption; -use ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\Type; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +namespace Imagekit\Beta\V2\Files\FileUploadResponse; + +use Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue; +use Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\SelectOption; +use Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\Type; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type SelectedFieldsSchemaShape = array{ diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php index cb78e96f..bfeda0b5 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; +namespace Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; -use ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed1; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Core\Conversion\ListOf; +use Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed1; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Conversion\ListOf; /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed1.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed1.php index 90aeaf70..cf577e5c 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed1.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed1.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue; +namespace Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; final class Mixed1 implements ConverterSource { diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php index 63fe6ec3..14792174 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; +namespace Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php index 2f6f7441..36dfab6f 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; +namespace Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php index 327b7c0a..4c15c3e0 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; +namespace Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; final class SelectOption implements ConverterSource { diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/Type.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/Type.php index e41d977e..e5051b7a 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/Type.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; +namespace Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; /** * Type of the custom metadata field. diff --git a/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php b/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php index e88cb571..1f87ff6c 100644 --- a/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php +++ b/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Beta\V2\Files\FileUploadResponse; +namespace Imagekit\Beta\V2\Files\FileUploadResponse; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * An object containing the file or file version's `id` (versionId) and `name`. diff --git a/src/Cache/Invalidation/InvalidationCreateParams.php b/src/Cache/Invalidation/InvalidationCreateParams.php index 48864392..24be847d 100644 --- a/src/Cache/Invalidation/InvalidationCreateParams.php +++ b/src/Cache/Invalidation/InvalidationCreateParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace ImageKit\Cache\Invalidation; +namespace Imagekit\Cache\Invalidation; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; /** * This API will purge CDN cache and ImageKit.io's internal cache for a file. Note: Purge cache is an asynchronous process and it may take some time to reflect the changes. * - * @see ImageKit\Services\Cache\InvalidationService::create() + * @see Imagekit\Services\Cache\InvalidationService::create() * * @phpstan-type InvalidationCreateParamsShape = array{url: string} */ diff --git a/src/Cache/Invalidation/InvalidationGetResponse.php b/src/Cache/Invalidation/InvalidationGetResponse.php index 4affd876..1f7806f3 100644 --- a/src/Cache/Invalidation/InvalidationGetResponse.php +++ b/src/Cache/Invalidation/InvalidationGetResponse.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace ImageKit\Cache\Invalidation; +namespace Imagekit\Cache\Invalidation; -use ImageKit\Cache\Invalidation\InvalidationGetResponse\Status; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkResponse; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Core\Conversion\Contracts\ResponseConverter; +use Imagekit\Cache\Invalidation\InvalidationGetResponse\Status; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkResponse; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type InvalidationGetResponseShape = array{ diff --git a/src/Cache/Invalidation/InvalidationGetResponse/Status.php b/src/Cache/Invalidation/InvalidationGetResponse/Status.php index 3b72a61a..b4443bb1 100644 --- a/src/Cache/Invalidation/InvalidationGetResponse/Status.php +++ b/src/Cache/Invalidation/InvalidationGetResponse/Status.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Cache\Invalidation\InvalidationGetResponse; +namespace Imagekit\Cache\Invalidation\InvalidationGetResponse; /** * Status of the purge request. diff --git a/src/Cache/Invalidation/InvalidationNewResponse.php b/src/Cache/Invalidation/InvalidationNewResponse.php index e79fc053..9a52ff42 100644 --- a/src/Cache/Invalidation/InvalidationNewResponse.php +++ b/src/Cache/Invalidation/InvalidationNewResponse.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Cache\Invalidation; +namespace Imagekit\Cache\Invalidation; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkResponse; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Core\Conversion\Contracts\ResponseConverter; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkResponse; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type InvalidationNewResponseShape = array{requestId?: string|null} diff --git a/src/Client.php b/src/Client.php index 6bf96901..a4c6e25f 100644 --- a/src/Client.php +++ b/src/Client.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace ImageKit; +namespace Imagekit; use Http\Discovery\Psr17FactoryDiscovery; use Http\Discovery\Psr18ClientDiscovery; -use ImageKit\Core\BaseClient; -use ImageKit\Services\AccountsService; -use ImageKit\Services\AssetsService; -use ImageKit\Services\BetaService; -use ImageKit\Services\CacheService; -use ImageKit\Services\CustomMetadataFieldsService; -use ImageKit\Services\FilesService; -use ImageKit\Services\FoldersService; -use ImageKit\Services\WebhooksService; +use Imagekit\Core\BaseClient; +use Imagekit\Services\AccountsService; +use Imagekit\Services\AssetsService; +use Imagekit\Services\BetaService; +use Imagekit\Services\CacheService; +use Imagekit\Services\CustomMetadataFieldsService; +use Imagekit\Services\FilesService; +use Imagekit\Services\FoldersService; +use Imagekit\Services\WebhooksService; class Client extends BaseClient { diff --git a/src/Core.php b/src/Core.php index 46b56ff5..b3ab37f1 100644 --- a/src/Core.php +++ b/src/Core.php @@ -2,8 +2,8 @@ declare(strict_types=1); -namespace ImageKit\Core; +namespace Imagekit\Core; -use ImageKit\Core\Implementation\Omit; +use Imagekit\Core\Implementation\Omit; const OMIT = Omit::omit; diff --git a/src/Core/Attributes/Api.php b/src/Core/Attributes/Api.php index 8a1e3e0f..3ed05474 100644 --- a/src/Core/Attributes/Api.php +++ b/src/Core/Attributes/Api.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Core\Attributes; +namespace Imagekit\Core\Attributes; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Core\Conversion\EnumOf; -use ImageKit\Core\Conversion\ListOf; -use ImageKit\Core\Conversion\MapOf; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Conversion\EnumOf; +use Imagekit\Core\Conversion\ListOf; +use Imagekit\Core\Conversion\MapOf; /** * @internal diff --git a/src/Core/BaseClient.php b/src/Core/BaseClient.php index 9cc18ee2..8b5a2ea2 100644 --- a/src/Core/BaseClient.php +++ b/src/Core/BaseClient.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace ImageKit\Core; - -use ImageKit\Core\Contracts\BasePage; -use ImageKit\Core\Contracts\BaseStream; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Core\Exceptions\APIConnectionException; -use ImageKit\Core\Exceptions\APIStatusException; -use ImageKit\RequestOptions; +namespace Imagekit\Core; + +use Imagekit\Core\Contracts\BasePage; +use Imagekit\Core\Contracts\BaseStream; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Exceptions\APIConnectionException; +use Imagekit\Core\Exceptions\APIStatusException; +use Imagekit\RequestOptions; use Psr\Http\Client\ClientExceptionInterface; use Psr\Http\Client\ClientInterface; use Psr\Http\Message\RequestFactoryInterface; diff --git a/src/Core/Concerns/SdkEnum.php b/src/Core/Concerns/SdkEnum.php index cf3651aa..c34de0b7 100644 --- a/src/Core/Concerns/SdkEnum.php +++ b/src/Core/Concerns/SdkEnum.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace ImageKit\Core\Concerns; +namespace Imagekit\Core\Concerns; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\EnumOf; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\EnumOf; /** * @internal diff --git a/src/Core/Concerns/SdkModel.php b/src/Core/Concerns/SdkModel.php index b94a1f03..ed357f70 100644 --- a/src/Core/Concerns/SdkModel.php +++ b/src/Core/Concerns/SdkModel.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace ImageKit\Core\Concerns; - -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Core\Conversion; -use ImageKit\Core\Conversion\CoerceState; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\ModelOf; -use ImageKit\Core\Util; +namespace Imagekit\Core\Concerns; + +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\Conversion; +use Imagekit\Core\Conversion\CoerceState; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\ModelOf; +use Imagekit\Core\Util; /** * @internal diff --git a/src/Core/Concerns/SdkPage.php b/src/Core/Concerns/SdkPage.php index 2641b20b..954ab7e9 100644 --- a/src/Core/Concerns/SdkPage.php +++ b/src/Core/Concerns/SdkPage.php @@ -2,20 +2,20 @@ declare(strict_types=1); -namespace ImageKit\Core\Concerns; +namespace Imagekit\Core\Concerns; -use ImageKit\Client; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Core\Exceptions\APIStatusException; -use ImageKit\RequestOptions; +use Imagekit\Client; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Exceptions\APIStatusException; +use Imagekit\RequestOptions; /** * @internal * * @template Item * - * @phpstan-import-type normalized_request from \ImageKit\Core\BaseClient + * @phpstan-import-type normalized_request from \Imagekit\Core\BaseClient */ trait SdkPage { diff --git a/src/Core/Concerns/SdkParams.php b/src/Core/Concerns/SdkParams.php index f6cbd5ca..130f6de3 100644 --- a/src/Core/Concerns/SdkParams.php +++ b/src/Core/Concerns/SdkParams.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\Core\Concerns; +namespace Imagekit\Core\Concerns; -use ImageKit\Core\Conversion; -use ImageKit\Core\Conversion\DumpState; -use ImageKit\Core\Util; -use ImageKit\RequestOptions; +use Imagekit\Core\Conversion; +use Imagekit\Core\Conversion\DumpState; +use Imagekit\Core\Util; +use Imagekit\RequestOptions; /** * @internal diff --git a/src/Core/Concerns/SdkResponse.php b/src/Core/Concerns/SdkResponse.php index 18074c65..ddc05f1f 100644 --- a/src/Core/Concerns/SdkResponse.php +++ b/src/Core/Concerns/SdkResponse.php @@ -1,8 +1,8 @@ diff --git a/src/CustomMetadataFields/CustomMetadataFieldListParams.php b/src/CustomMetadataFields/CustomMetadataFieldListParams.php index 6fa40afd..4de550f5 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldListParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldListParams.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace ImageKit\CustomMetadataFields; +namespace Imagekit\CustomMetadataFields; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; /** * This API returns the array of created custom metadata field objects. By default the API returns only non deleted field objects, but you can include deleted fields in the API response. * * You can also filter results by a specific folder path to retrieve custom metadata fields applicable at that location. This path-specific filtering is useful when using the **Path policy** feature to determine which custom metadata fields are selected for a given path. * - * @see ImageKit\Services\CustomMetadataFieldsService::list() + * @see Imagekit\Services\CustomMetadataFieldsService::list() * * @phpstan-type CustomMetadataFieldListParamsShape = array{ * folderPath?: string, includeDeleted?: bool diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php index 677e560d..97cd8816 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace ImageKit\CustomMetadataFields; +namespace Imagekit\CustomMetadataFields; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema; /** * This API updates the label or schema of an existing custom metadata field. * - * @see ImageKit\Services\CustomMetadataFieldsService::update() + * @see Imagekit\Services\CustomMetadataFieldsService::update() * * @phpstan-type CustomMetadataFieldUpdateParamsShape = array{ * label?: string, diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php index 697060c3..b74f659c 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams; +namespace Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue; -use ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\SelectOption; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue; +use Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\SelectOption; /** * An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php index 3adb99ef..a54f0d06 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema; +namespace Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Core\Conversion\ListOf; -use ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue\Mixed1; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Conversion\ListOf; +use Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue\Mixed1; /** * The default value for this custom metadata field. This property is only required if `isValueRequired` property is set to `true`. The value should match the `type` of custom metadata field. diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed1.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed1.php index 668bd228..14125a34 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed1.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed1.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue; +namespace Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; final class Mixed1 implements ConverterSource { diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MaxValue.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MaxValue.php index 66a3bdd5..809b42e2 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MaxValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MaxValue.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema; +namespace Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Maximum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MinValue.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MinValue.php index 91500a80..651b66f7 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MinValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MinValue.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema; +namespace Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Minimum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/SelectOption.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/SelectOption.php index 689378ae..556c12c3 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/SelectOption.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/SelectOption.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema; +namespace Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; final class SelectOption implements ConverterSource { diff --git a/src/ExtensionItem.php b/src/ExtensionItem.php index db1b2eba..058287a1 100644 --- a/src/ExtensionItem.php +++ b/src/ExtensionItem.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace ImageKit; +namespace Imagekit; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\ExtensionItem\AIAutoDescription; -use ImageKit\ExtensionItem\AutoTaggingExtension; -use ImageKit\ExtensionItem\RemoveBg; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\ExtensionItem\AIAutoDescription; +use Imagekit\ExtensionItem\AutoTaggingExtension; +use Imagekit\ExtensionItem\RemoveBg; final class ExtensionItem implements ConverterSource { diff --git a/src/ExtensionItem/AIAutoDescription.php b/src/ExtensionItem/AIAutoDescription.php index f07380a7..756b2369 100644 --- a/src/ExtensionItem/AIAutoDescription.php +++ b/src/ExtensionItem/AIAutoDescription.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\ExtensionItem; +namespace Imagekit\ExtensionItem; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type AIAutoDescriptionShape = array{name: 'ai-auto-description'} diff --git a/src/ExtensionItem/AutoTaggingExtension.php b/src/ExtensionItem/AutoTaggingExtension.php index 761fda47..6801801a 100644 --- a/src/ExtensionItem/AutoTaggingExtension.php +++ b/src/ExtensionItem/AutoTaggingExtension.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\ExtensionItem; +namespace Imagekit\ExtensionItem; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\ExtensionItem\AutoTaggingExtension\Name; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\ExtensionItem\AutoTaggingExtension\Name; /** * @phpstan-type AutoTaggingExtensionShape = array{ diff --git a/src/ExtensionItem/AutoTaggingExtension/Name.php b/src/ExtensionItem/AutoTaggingExtension/Name.php index 853dc5ad..da677cb5 100644 --- a/src/ExtensionItem/AutoTaggingExtension/Name.php +++ b/src/ExtensionItem/AutoTaggingExtension/Name.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\ExtensionItem\AutoTaggingExtension; +namespace Imagekit\ExtensionItem\AutoTaggingExtension; /** * Specifies the auto-tagging extension used. diff --git a/src/ExtensionItem/RemoveBg.php b/src/ExtensionItem/RemoveBg.php index 262ff188..6da96a69 100644 --- a/src/ExtensionItem/RemoveBg.php +++ b/src/ExtensionItem/RemoveBg.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\ExtensionItem; +namespace Imagekit\ExtensionItem; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\ExtensionItem\RemoveBg\Options; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\ExtensionItem\RemoveBg\Options; /** * @phpstan-type RemoveBgShape = array{name: 'remove-bg', options?: Options|null} diff --git a/src/ExtensionItem/RemoveBg/Options.php b/src/ExtensionItem/RemoveBg/Options.php index b5366788..1dc6ef17 100644 --- a/src/ExtensionItem/RemoveBg/Options.php +++ b/src/ExtensionItem/RemoveBg/Options.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\ExtensionItem\RemoveBg; +namespace Imagekit\ExtensionItem\RemoveBg; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type OptionsShape = array{ diff --git a/src/Files/Bulk/BulkAddTagsParams.php b/src/Files/Bulk/BulkAddTagsParams.php index 4d8c2bd6..8a510597 100644 --- a/src/Files/Bulk/BulkAddTagsParams.php +++ b/src/Files/Bulk/BulkAddTagsParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace ImageKit\Files\Bulk; +namespace Imagekit\Files\Bulk; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; /** * This API adds tags to multiple files in bulk. A maximum of 50 files can be specified at a time. * - * @see ImageKit\Services\Files\BulkService::addTags() + * @see Imagekit\Services\Files\BulkService::addTags() * * @phpstan-type BulkAddTagsParamsShape = array{ * fileIds: list, tags: list diff --git a/src/Files/Bulk/BulkAddTagsResponse.php b/src/Files/Bulk/BulkAddTagsResponse.php index 05c9c5bc..3351e66f 100644 --- a/src/Files/Bulk/BulkAddTagsResponse.php +++ b/src/Files/Bulk/BulkAddTagsResponse.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Files\Bulk; +namespace Imagekit\Files\Bulk; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkResponse; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Core\Conversion\Contracts\ResponseConverter; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkResponse; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type BulkAddTagsResponseShape = array{ diff --git a/src/Files/Bulk/BulkDeleteParams.php b/src/Files/Bulk/BulkDeleteParams.php index d387345f..ea4c8a9a 100644 --- a/src/Files/Bulk/BulkDeleteParams.php +++ b/src/Files/Bulk/BulkDeleteParams.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\Files\Bulk; +namespace Imagekit\Files\Bulk; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; /** * This API deletes multiple files and all their file versions permanently. @@ -16,7 +16,7 @@ * * A maximum of 100 files can be deleted at a time. * - * @see ImageKit\Services\Files\BulkService::delete() + * @see Imagekit\Services\Files\BulkService::delete() * * @phpstan-type BulkDeleteParamsShape = array{fileIds: list} */ diff --git a/src/Files/Bulk/BulkDeleteResponse.php b/src/Files/Bulk/BulkDeleteResponse.php index cebbbb1e..618c3cb4 100644 --- a/src/Files/Bulk/BulkDeleteResponse.php +++ b/src/Files/Bulk/BulkDeleteResponse.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Files\Bulk; +namespace Imagekit\Files\Bulk; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkResponse; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Core\Conversion\Contracts\ResponseConverter; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkResponse; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type BulkDeleteResponseShape = array{ diff --git a/src/Files/Bulk/BulkRemoveAITagsParams.php b/src/Files/Bulk/BulkRemoveAITagsParams.php index 7a31eb45..21a4578a 100644 --- a/src/Files/Bulk/BulkRemoveAITagsParams.php +++ b/src/Files/Bulk/BulkRemoveAITagsParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace ImageKit\Files\Bulk; +namespace Imagekit\Files\Bulk; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; /** * This API removes AITags from multiple files in bulk. A maximum of 50 files can be specified at a time. * - * @see ImageKit\Services\Files\BulkService::removeAITags() + * @see Imagekit\Services\Files\BulkService::removeAITags() * * @phpstan-type BulkRemoveAITagsParamsShape = array{ * AITags: list, fileIds: list diff --git a/src/Files/Bulk/BulkRemoveAITagsResponse.php b/src/Files/Bulk/BulkRemoveAITagsResponse.php index 92c6da45..d04a2c3f 100644 --- a/src/Files/Bulk/BulkRemoveAITagsResponse.php +++ b/src/Files/Bulk/BulkRemoveAITagsResponse.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Files\Bulk; +namespace Imagekit\Files\Bulk; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkResponse; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Core\Conversion\Contracts\ResponseConverter; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkResponse; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type BulkRemoveAITagsResponseShape = array{ diff --git a/src/Files/Bulk/BulkRemoveTagsParams.php b/src/Files/Bulk/BulkRemoveTagsParams.php index fe483474..c29254e3 100644 --- a/src/Files/Bulk/BulkRemoveTagsParams.php +++ b/src/Files/Bulk/BulkRemoveTagsParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace ImageKit\Files\Bulk; +namespace Imagekit\Files\Bulk; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; /** * This API removes tags from multiple files in bulk. A maximum of 50 files can be specified at a time. * - * @see ImageKit\Services\Files\BulkService::removeTags() + * @see Imagekit\Services\Files\BulkService::removeTags() * * @phpstan-type BulkRemoveTagsParamsShape = array{ * fileIds: list, tags: list diff --git a/src/Files/Bulk/BulkRemoveTagsResponse.php b/src/Files/Bulk/BulkRemoveTagsResponse.php index c2605294..1df92588 100644 --- a/src/Files/Bulk/BulkRemoveTagsResponse.php +++ b/src/Files/Bulk/BulkRemoveTagsResponse.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Files\Bulk; +namespace Imagekit\Files\Bulk; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkResponse; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Core\Conversion\Contracts\ResponseConverter; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkResponse; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type BulkRemoveTagsResponseShape = array{ diff --git a/src/Files/File.php b/src/Files/File.php index 2032c1fd..35c93fad 100644 --- a/src/Files/File.php +++ b/src/Files/File.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace ImageKit\Files; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkResponse; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Core\Conversion\Contracts\ResponseConverter; -use ImageKit\Files\File\AITag; -use ImageKit\Files\File\SelectedFieldsSchema; -use ImageKit\Files\File\Type; -use ImageKit\Files\File\VersionInfo; +namespace Imagekit\Files; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkResponse; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\Conversion\Contracts\ResponseConverter; +use Imagekit\Files\File\AITag; +use Imagekit\Files\File\SelectedFieldsSchema; +use Imagekit\Files\File\Type; +use Imagekit\Files\File\VersionInfo; /** * Object containing details of a file or file version. diff --git a/src/Files/File/AITag.php b/src/Files/File/AITag.php index 7aa68a3d..5dfa04a4 100644 --- a/src/Files/File/AITag.php +++ b/src/Files/File/AITag.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Files\File; +namespace Imagekit\Files\File; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type AITagShape = array{ diff --git a/src/Files/File/SelectedFieldsSchema.php b/src/Files/File/SelectedFieldsSchema.php index 768dff10..046c48f0 100644 --- a/src/Files/File/SelectedFieldsSchema.php +++ b/src/Files/File/SelectedFieldsSchema.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace ImageKit\Files\File; +namespace Imagekit\Files\File; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Files\File\SelectedFieldsSchema\DefaultValue; -use ImageKit\Files\File\SelectedFieldsSchema\SelectOption; -use ImageKit\Files\File\SelectedFieldsSchema\Type; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Files\File\SelectedFieldsSchema\DefaultValue; +use Imagekit\Files\File\SelectedFieldsSchema\SelectOption; +use Imagekit\Files\File\SelectedFieldsSchema\Type; /** * @phpstan-type SelectedFieldsSchemaShape = array{ - * type: value-of<\ImageKit\Files\File\SelectedFieldsSchema\Type>, + * type: value-of<\Imagekit\Files\File\SelectedFieldsSchema\Type>, * defaultValue?: string|float|bool|null|list, * isValueRequired?: bool|null, * maxLength?: float|null, diff --git a/src/Files/File/SelectedFieldsSchema/DefaultValue.php b/src/Files/File/SelectedFieldsSchema/DefaultValue.php index 64f9cb8b..4a9e49aa 100644 --- a/src/Files/File/SelectedFieldsSchema/DefaultValue.php +++ b/src/Files/File/SelectedFieldsSchema/DefaultValue.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Files\File\SelectedFieldsSchema; +namespace Imagekit\Files\File\SelectedFieldsSchema; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Core\Conversion\ListOf; -use ImageKit\Files\File\SelectedFieldsSchema\DefaultValue\Mixed1; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Conversion\ListOf; +use Imagekit\Files\File\SelectedFieldsSchema\DefaultValue\Mixed1; /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. diff --git a/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed1.php b/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed1.php index 8e1b6335..9d9297c2 100644 --- a/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed1.php +++ b/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed1.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Files\File\SelectedFieldsSchema\DefaultValue; +namespace Imagekit\Files\File\SelectedFieldsSchema\DefaultValue; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; final class Mixed1 implements ConverterSource { diff --git a/src/Files/File/SelectedFieldsSchema/MaxValue.php b/src/Files/File/SelectedFieldsSchema/MaxValue.php index abf7b59b..95013de6 100644 --- a/src/Files/File/SelectedFieldsSchema/MaxValue.php +++ b/src/Files/File/SelectedFieldsSchema/MaxValue.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Files\File\SelectedFieldsSchema; +namespace Imagekit\Files\File\SelectedFieldsSchema; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. diff --git a/src/Files/File/SelectedFieldsSchema/MinValue.php b/src/Files/File/SelectedFieldsSchema/MinValue.php index e9601410..37423998 100644 --- a/src/Files/File/SelectedFieldsSchema/MinValue.php +++ b/src/Files/File/SelectedFieldsSchema/MinValue.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Files\File\SelectedFieldsSchema; +namespace Imagekit\Files\File\SelectedFieldsSchema; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. diff --git a/src/Files/File/SelectedFieldsSchema/SelectOption.php b/src/Files/File/SelectedFieldsSchema/SelectOption.php index 0ea2f82e..bf7be1d3 100644 --- a/src/Files/File/SelectedFieldsSchema/SelectOption.php +++ b/src/Files/File/SelectedFieldsSchema/SelectOption.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Files\File\SelectedFieldsSchema; +namespace Imagekit\Files\File\SelectedFieldsSchema; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; final class SelectOption implements ConverterSource { diff --git a/src/Files/File/SelectedFieldsSchema/Type.php b/src/Files/File/SelectedFieldsSchema/Type.php index 6d24b064..9b0648ec 100644 --- a/src/Files/File/SelectedFieldsSchema/Type.php +++ b/src/Files/File/SelectedFieldsSchema/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\File\SelectedFieldsSchema; +namespace Imagekit\Files\File\SelectedFieldsSchema; /** * Type of the custom metadata field. diff --git a/src/Files/File/Type.php b/src/Files/File/Type.php index 5c97f13f..481c0627 100644 --- a/src/Files/File/Type.php +++ b/src/Files/File/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\File; +namespace Imagekit\Files\File; /** * Type of the asset. diff --git a/src/Files/File/VersionInfo.php b/src/Files/File/VersionInfo.php index 463e3d86..ce6acf14 100644 --- a/src/Files/File/VersionInfo.php +++ b/src/Files/File/VersionInfo.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Files\File; +namespace Imagekit\Files\File; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * An object with details of the file version. diff --git a/src/Files/FileCopyParams.php b/src/Files/FileCopyParams.php index 8a4a47c5..82352cf9 100644 --- a/src/Files/FileCopyParams.php +++ b/src/Files/FileCopyParams.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace ImageKit\Files; +namespace Imagekit\Files; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; /** * This will copy a file from one folder to another. * * Note: If any file at the destination has the same name as the source file, then the source file and its versions (if `includeFileVersions` is set to true) will be appended to the destination file version history. * - * @see ImageKit\Services\FilesService::copy() + * @see Imagekit\Services\FilesService::copy() * * @phpstan-type FileCopyParamsShape = array{ * destinationPath: string, sourceFilePath: string, includeFileVersions?: bool diff --git a/src/Files/FileCopyResponse.php b/src/Files/FileCopyResponse.php index 5c17ae0b..cb63a96f 100644 --- a/src/Files/FileCopyResponse.php +++ b/src/Files/FileCopyResponse.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\Files; +namespace Imagekit\Files; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkResponse; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Core\Conversion\Contracts\ResponseConverter; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkResponse; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type FileCopyResponseShape = array diff --git a/src/Files/FileMoveParams.php b/src/Files/FileMoveParams.php index dfb22275..e2832715 100644 --- a/src/Files/FileMoveParams.php +++ b/src/Files/FileMoveParams.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace ImageKit\Files; +namespace Imagekit\Files; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; /** * This will move a file and all its versions from one folder to another. * * Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file. * - * @see ImageKit\Services\FilesService::move() + * @see Imagekit\Services\FilesService::move() * * @phpstan-type FileMoveParamsShape = array{ * destinationPath: string, sourceFilePath: string diff --git a/src/Files/FileMoveResponse.php b/src/Files/FileMoveResponse.php index 22924fc9..addc97cd 100644 --- a/src/Files/FileMoveResponse.php +++ b/src/Files/FileMoveResponse.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\Files; +namespace Imagekit\Files; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkResponse; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Core\Conversion\Contracts\ResponseConverter; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkResponse; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type FileMoveResponseShape = array diff --git a/src/Files/FileRenameParams.php b/src/Files/FileRenameParams.php index 0ade7782..68c9b707 100644 --- a/src/Files/FileRenameParams.php +++ b/src/Files/FileRenameParams.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace ImageKit\Files; +namespace Imagekit\Files; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; /** * You can rename an already existing file in the media library using rename file API. This operation would rename all file versions of the file. * * Note: The old URLs will stop working. The file/file version URLs cached on CDN will continue to work unless a purge is requested. * - * @see ImageKit\Services\FilesService::rename() + * @see Imagekit\Services\FilesService::rename() * * @phpstan-type FileRenameParamsShape = array{ * filePath: string, newFileName: string, purgeCache?: bool diff --git a/src/Files/FileRenameResponse.php b/src/Files/FileRenameResponse.php index 4ee6b9cb..766c39b5 100644 --- a/src/Files/FileRenameResponse.php +++ b/src/Files/FileRenameResponse.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Files; +namespace Imagekit\Files; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkResponse; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Core\Conversion\Contracts\ResponseConverter; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkResponse; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type FileRenameResponseShape = array{purgeRequestId?: string|null} diff --git a/src/Files/FileUpdateParams.php b/src/Files/FileUpdateParams.php index 2f33032e..a444fe93 100644 --- a/src/Files/FileUpdateParams.php +++ b/src/Files/FileUpdateParams.php @@ -2,25 +2,25 @@ declare(strict_types=1); -namespace ImageKit\Files; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\ExtensionItem; -use ImageKit\ExtensionItem\AIAutoDescription; -use ImageKit\ExtensionItem\AutoTaggingExtension; -use ImageKit\ExtensionItem\AutoTaggingExtension\Name; -use ImageKit\ExtensionItem\RemoveBg; -use ImageKit\ExtensionItem\RemoveBg\Options; -use ImageKit\Files\FileUpdateParams\Publish; -use ImageKit\Files\FileUpdateParams\RemoveAITags; +namespace Imagekit\Files; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\ExtensionItem; +use Imagekit\ExtensionItem\AIAutoDescription; +use Imagekit\ExtensionItem\AutoTaggingExtension; +use Imagekit\ExtensionItem\AutoTaggingExtension\Name; +use Imagekit\ExtensionItem\RemoveBg; +use Imagekit\ExtensionItem\RemoveBg\Options; +use Imagekit\Files\FileUpdateParams\Publish; +use Imagekit\Files\FileUpdateParams\RemoveAITags; /** * This API updates the details or attributes of the current version of the file. You can update `tags`, `customCoordinates`, `customMetadata`, publication status, remove existing `AITags` and apply extensions using this API. * - * @see ImageKit\Services\FilesService::update() + * @see Imagekit\Services\FilesService::update() * * @phpstan-type FileUpdateParamsShape = array{ * customCoordinates?: string|null, diff --git a/src/Files/FileUpdateParams/Publish.php b/src/Files/FileUpdateParams/Publish.php index d74a236b..4f128710 100644 --- a/src/Files/FileUpdateParams/Publish.php +++ b/src/Files/FileUpdateParams/Publish.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUpdateParams; +namespace Imagekit\Files\FileUpdateParams; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * Configure the publication status of a file and its versions. diff --git a/src/Files/FileUpdateParams/RemoveAITags.php b/src/Files/FileUpdateParams/RemoveAITags.php index c02f53a7..c3b98949 100644 --- a/src/Files/FileUpdateParams/RemoveAITags.php +++ b/src/Files/FileUpdateParams/RemoveAITags.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUpdateParams; +namespace Imagekit\Files\FileUpdateParams; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Core\Conversion\ListOf; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Conversion\ListOf; /** * An array of AITags associated with the file that you want to remove, e.g. `["car", "vehicle", "motorsports"]`. diff --git a/src/Files/FileUpdateResponse.php b/src/Files/FileUpdateResponse.php index ea6e0d15..f43a504e 100644 --- a/src/Files/FileUpdateResponse.php +++ b/src/Files/FileUpdateResponse.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace ImageKit\Files; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkResponse; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Core\Conversion\Contracts\ResponseConverter; -use ImageKit\Files\File\AITag; -use ImageKit\Files\File\SelectedFieldsSchema; -use ImageKit\Files\File\Type; -use ImageKit\Files\File\VersionInfo; -use ImageKit\Files\FileUpdateResponse\ExtensionStatus; -use ImageKit\Files\FileUpdateResponse\ExtensionStatus\AIAutoDescription; -use ImageKit\Files\FileUpdateResponse\ExtensionStatus\AwsAutoTagging; -use ImageKit\Files\FileUpdateResponse\ExtensionStatus\GoogleAutoTagging; -use ImageKit\Files\FileUpdateResponse\ExtensionStatus\RemoveBg; +namespace Imagekit\Files; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkResponse; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\Conversion\Contracts\ResponseConverter; +use Imagekit\Files\File\AITag; +use Imagekit\Files\File\SelectedFieldsSchema; +use Imagekit\Files\File\Type; +use Imagekit\Files\File\VersionInfo; +use Imagekit\Files\FileUpdateResponse\ExtensionStatus; +use Imagekit\Files\FileUpdateResponse\ExtensionStatus\AIAutoDescription; +use Imagekit\Files\FileUpdateResponse\ExtensionStatus\AwsAutoTagging; +use Imagekit\Files\FileUpdateResponse\ExtensionStatus\GoogleAutoTagging; +use Imagekit\Files\FileUpdateResponse\ExtensionStatus\RemoveBg; /** * Object containing details of a file or file version. diff --git a/src/Files/FileUpdateResponse/ExtensionStatus.php b/src/Files/FileUpdateResponse/ExtensionStatus.php index 6333cd69..774ebd4c 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUpdateResponse; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Files\FileUpdateResponse\ExtensionStatus\AIAutoDescription; -use ImageKit\Files\FileUpdateResponse\ExtensionStatus\AwsAutoTagging; -use ImageKit\Files\FileUpdateResponse\ExtensionStatus\GoogleAutoTagging; -use ImageKit\Files\FileUpdateResponse\ExtensionStatus\RemoveBg; +namespace Imagekit\Files\FileUpdateResponse; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Files\FileUpdateResponse\ExtensionStatus\AIAutoDescription; +use Imagekit\Files\FileUpdateResponse\ExtensionStatus\AwsAutoTagging; +use Imagekit\Files\FileUpdateResponse\ExtensionStatus\GoogleAutoTagging; +use Imagekit\Files\FileUpdateResponse\ExtensionStatus\RemoveBg; /** * @phpstan-type ExtensionStatusShape = array{ diff --git a/src/Files/FileUpdateResponse/ExtensionStatus/AIAutoDescription.php b/src/Files/FileUpdateResponse/ExtensionStatus/AIAutoDescription.php index ae67f332..a1f9d530 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus/AIAutoDescription.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus/AIAutoDescription.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUpdateResponse\ExtensionStatus; +namespace Imagekit\Files\FileUpdateResponse\ExtensionStatus; enum AIAutoDescription: string { diff --git a/src/Files/FileUpdateResponse/ExtensionStatus/AwsAutoTagging.php b/src/Files/FileUpdateResponse/ExtensionStatus/AwsAutoTagging.php index 0dba4e7e..f4de62b1 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus/AwsAutoTagging.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus/AwsAutoTagging.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUpdateResponse\ExtensionStatus; +namespace Imagekit\Files\FileUpdateResponse\ExtensionStatus; enum AwsAutoTagging: string { diff --git a/src/Files/FileUpdateResponse/ExtensionStatus/GoogleAutoTagging.php b/src/Files/FileUpdateResponse/ExtensionStatus/GoogleAutoTagging.php index 8613623f..77095aca 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus/GoogleAutoTagging.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus/GoogleAutoTagging.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUpdateResponse\ExtensionStatus; +namespace Imagekit\Files\FileUpdateResponse\ExtensionStatus; enum GoogleAutoTagging: string { diff --git a/src/Files/FileUpdateResponse/ExtensionStatus/RemoveBg.php b/src/Files/FileUpdateResponse/ExtensionStatus/RemoveBg.php index db5b4275..10aa911d 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus/RemoveBg.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus/RemoveBg.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUpdateResponse\ExtensionStatus; +namespace Imagekit\Files\FileUpdateResponse\ExtensionStatus; enum RemoveBg: string { diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index 30f342f2..bf8b4ade 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -2,23 +2,23 @@ declare(strict_types=1); -namespace ImageKit\Files; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\ExtensionItem; -use ImageKit\ExtensionItem\AIAutoDescription; -use ImageKit\ExtensionItem\AutoTaggingExtension; -use ImageKit\ExtensionItem\AutoTaggingExtension\Name; -use ImageKit\ExtensionItem\RemoveBg; -use ImageKit\ExtensionItem\RemoveBg\Options; -use ImageKit\Files\FileUploadParams\ResponseField; -use ImageKit\Files\FileUploadParams\Transformation; -use ImageKit\Files\FileUploadParams\Transformation\Post\Abs; -use ImageKit\Files\FileUploadParams\Transformation\Post\GifToVideo; -use ImageKit\Files\FileUploadParams\Transformation\Post\Thumbnail; +namespace Imagekit\Files; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\ExtensionItem; +use Imagekit\ExtensionItem\AIAutoDescription; +use Imagekit\ExtensionItem\AutoTaggingExtension; +use Imagekit\ExtensionItem\AutoTaggingExtension\Name; +use Imagekit\ExtensionItem\RemoveBg; +use Imagekit\ExtensionItem\RemoveBg\Options; +use Imagekit\Files\FileUploadParams\ResponseField; +use Imagekit\Files\FileUploadParams\Transformation; +use Imagekit\Files\FileUploadParams\Transformation\Post\Abs; +use Imagekit\Files\FileUploadParams\Transformation\Post\GifToVideo; +use Imagekit\Files\FileUploadParams\Transformation\Post\Thumbnail; /** * ImageKit.io allows you to upload files directly from both the server and client sides. For server-side uploads, private API key authentication is used. For client-side uploads, generate a one-time `token`, `signature`, and `expire` from your secure backend using private API. [Learn more](/docs/api-reference/upload-file/upload-file#how-to-implement-client-side-file-upload) about how to implement client-side file upload. @@ -36,7 +36,7 @@ * - A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more. * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. * - * @see ImageKit\Services\FilesService::upload() + * @see Imagekit\Services\FilesService::upload() * * @phpstan-type FileUploadParamsShape = array{ * file: string, @@ -64,7 +64,7 @@ * signature?: string, * tags?: list, * transformation?: Transformation|array{ - * post?: list<\ImageKit\Files\FileUploadParams\Transformation\Post\Transformation|GifToVideo|Thumbnail|Abs>|null, + * post?: list<\Imagekit\Files\FileUploadParams\Transformation\Post\Transformation|GifToVideo|Thumbnail|Abs>|null, * pre?: string|null, * }, * useUniqueFileName?: bool, diff --git a/src/Files/FileUploadParams/ResponseField.php b/src/Files/FileUploadParams/ResponseField.php index ad83a282..035f03f5 100644 --- a/src/Files/FileUploadParams/ResponseField.php +++ b/src/Files/FileUploadParams/ResponseField.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadParams; +namespace Imagekit\Files\FileUploadParams; enum ResponseField: string { diff --git a/src/Files/FileUploadParams/Transformation.php b/src/Files/FileUploadParams/Transformation.php index 05f482c9..a51f1c02 100644 --- a/src/Files/FileUploadParams/Transformation.php +++ b/src/Files/FileUploadParams/Transformation.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadParams; +namespace Imagekit\Files\FileUploadParams; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Files\FileUploadParams\Transformation\Post; -use ImageKit\Files\FileUploadParams\Transformation\Post\Abs; -use ImageKit\Files\FileUploadParams\Transformation\Post\Abs\Protocol; -use ImageKit\Files\FileUploadParams\Transformation\Post\GifToVideo; -use ImageKit\Files\FileUploadParams\Transformation\Post\Thumbnail; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Files\FileUploadParams\Transformation\Post; +use Imagekit\Files\FileUploadParams\Transformation\Post\Abs; +use Imagekit\Files\FileUploadParams\Transformation\Post\Abs\Protocol; +use Imagekit\Files\FileUploadParams\Transformation\Post\GifToVideo; +use Imagekit\Files\FileUploadParams\Transformation\Post\Thumbnail; /** * Configure pre-processing (`pre`) and post-processing (`post`) transformations. @@ -25,7 +25,7 @@ * You can mix and match any combination of post-processing types. * * @phpstan-type TransformationShape = array{ - * post?: list<\ImageKit\Files\FileUploadParams\Transformation\Post\Transformation|GifToVideo|Thumbnail|Abs>|null, + * post?: list<\Imagekit\Files\FileUploadParams\Transformation\Post\Transformation|GifToVideo|Thumbnail|Abs>|null, * pre?: string|null, * } */ diff --git a/src/Files/FileUploadParams/Transformation/Post.php b/src/Files/FileUploadParams/Transformation/Post.php index 7b7646e6..c7bba30c 100644 --- a/src/Files/FileUploadParams/Transformation/Post.php +++ b/src/Files/FileUploadParams/Transformation/Post.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadParams\Transformation; +namespace Imagekit\Files\FileUploadParams\Transformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Files\FileUploadParams\Transformation\Post\Abs; -use ImageKit\Files\FileUploadParams\Transformation\Post\GifToVideo; -use ImageKit\Files\FileUploadParams\Transformation\Post\Thumbnail; -use ImageKit\Files\FileUploadParams\Transformation\Post\Transformation; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Files\FileUploadParams\Transformation\Post\Abs; +use Imagekit\Files\FileUploadParams\Transformation\Post\GifToVideo; +use Imagekit\Files\FileUploadParams\Transformation\Post\Thumbnail; +use Imagekit\Files\FileUploadParams\Transformation\Post\Transformation; final class Post implements ConverterSource { diff --git a/src/Files/FileUploadParams/Transformation/Post/Abs.php b/src/Files/FileUploadParams/Transformation/Post/Abs.php index f2e325fa..6dd809bf 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Abs.php +++ b/src/Files/FileUploadParams/Transformation/Post/Abs.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadParams\Transformation\Post; +namespace Imagekit\Files\FileUploadParams\Transformation\Post; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Files\FileUploadParams\Transformation\Post\Abs\Protocol; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Files\FileUploadParams\Transformation\Post\Abs\Protocol; /** * @phpstan-type AbsShape = array{ diff --git a/src/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php b/src/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php index bbf2208f..3bf589b0 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php +++ b/src/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadParams\Transformation\Post\Abs; +namespace Imagekit\Files\FileUploadParams\Transformation\Post\Abs; /** * Streaming protocol to use (`hls` or `dash`). diff --git a/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php b/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php index 42df6e9c..392a7c2a 100644 --- a/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php +++ b/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadParams\Transformation\Post; +namespace Imagekit\Files\FileUploadParams\Transformation\Post; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type GifToVideoShape = array{type: 'gif-to-video', value?: string|null} diff --git a/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php b/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php index 86665fbd..6d23431d 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php +++ b/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadParams\Transformation\Post; +namespace Imagekit\Files\FileUploadParams\Transformation\Post; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type ThumbnailShape = array{type: 'thumbnail', value?: string|null} diff --git a/src/Files/FileUploadParams/Transformation/Post/Transformation.php b/src/Files/FileUploadParams/Transformation/Post/Transformation.php index 3baf5a9d..84765faa 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Transformation.php +++ b/src/Files/FileUploadParams/Transformation/Post/Transformation.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadParams\Transformation\Post; +namespace Imagekit\Files\FileUploadParams\Transformation\Post; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type TransformationShape = array{type: 'transformation', value: string} diff --git a/src/Files/FileUploadResponse.php b/src/Files/FileUploadResponse.php index e909d2d8..26f51b9d 100644 --- a/src/Files/FileUploadResponse.php +++ b/src/Files/FileUploadResponse.php @@ -2,23 +2,23 @@ declare(strict_types=1); -namespace ImageKit\Files; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkResponse; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Core\Conversion\Contracts\ResponseConverter; -use ImageKit\Files\FileUploadResponse\AITag; -use ImageKit\Files\FileUploadResponse\ExtensionStatus; -use ImageKit\Files\FileUploadResponse\ExtensionStatus\AIAutoDescription; -use ImageKit\Files\FileUploadResponse\ExtensionStatus\AwsAutoTagging; -use ImageKit\Files\FileUploadResponse\ExtensionStatus\GoogleAutoTagging; -use ImageKit\Files\FileUploadResponse\ExtensionStatus\RemoveBg; -use ImageKit\Files\FileUploadResponse\SelectedFieldsSchema; -use ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\Type; -use ImageKit\Files\FileUploadResponse\VersionInfo; -use ImageKit\Files\Metadata\Exif; +namespace Imagekit\Files; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkResponse; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\Conversion\Contracts\ResponseConverter; +use Imagekit\Files\FileUploadResponse\AITag; +use Imagekit\Files\FileUploadResponse\ExtensionStatus; +use Imagekit\Files\FileUploadResponse\ExtensionStatus\AIAutoDescription; +use Imagekit\Files\FileUploadResponse\ExtensionStatus\AwsAutoTagging; +use Imagekit\Files\FileUploadResponse\ExtensionStatus\GoogleAutoTagging; +use Imagekit\Files\FileUploadResponse\ExtensionStatus\RemoveBg; +use Imagekit\Files\FileUploadResponse\SelectedFieldsSchema; +use Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\Type; +use Imagekit\Files\FileUploadResponse\VersionInfo; +use Imagekit\Files\Metadata\Exif; /** * Object containing details of a successful upload. diff --git a/src/Files/FileUploadResponse/AITag.php b/src/Files/FileUploadResponse/AITag.php index 6e0289cf..54e0e04c 100644 --- a/src/Files/FileUploadResponse/AITag.php +++ b/src/Files/FileUploadResponse/AITag.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadResponse; +namespace Imagekit\Files\FileUploadResponse; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type AITagShape = array{ diff --git a/src/Files/FileUploadResponse/ExtensionStatus.php b/src/Files/FileUploadResponse/ExtensionStatus.php index c3611995..5c76c2ed 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Files/FileUploadResponse/ExtensionStatus.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadResponse; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Files\FileUploadResponse\ExtensionStatus\AIAutoDescription; -use ImageKit\Files\FileUploadResponse\ExtensionStatus\AwsAutoTagging; -use ImageKit\Files\FileUploadResponse\ExtensionStatus\GoogleAutoTagging; -use ImageKit\Files\FileUploadResponse\ExtensionStatus\RemoveBg; +namespace Imagekit\Files\FileUploadResponse; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Files\FileUploadResponse\ExtensionStatus\AIAutoDescription; +use Imagekit\Files\FileUploadResponse\ExtensionStatus\AwsAutoTagging; +use Imagekit\Files\FileUploadResponse\ExtensionStatus\GoogleAutoTagging; +use Imagekit\Files\FileUploadResponse\ExtensionStatus\RemoveBg; /** * Extension names with their processing status at the time of completion of the request. It could have one of the following status values: diff --git a/src/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php b/src/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php index a12ba5f1..bc0bedc7 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php +++ b/src/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadResponse\ExtensionStatus; +namespace Imagekit\Files\FileUploadResponse\ExtensionStatus; enum AIAutoDescription: string { diff --git a/src/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php b/src/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php index 06158e8a..f25d3dd4 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php +++ b/src/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadResponse\ExtensionStatus; +namespace Imagekit\Files\FileUploadResponse\ExtensionStatus; enum AwsAutoTagging: string { diff --git a/src/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php b/src/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php index 5289a3cf..7845ea15 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php +++ b/src/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadResponse\ExtensionStatus; +namespace Imagekit\Files\FileUploadResponse\ExtensionStatus; enum GoogleAutoTagging: string { diff --git a/src/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php b/src/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php index 2321fd44..6a4c44b8 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php +++ b/src/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadResponse\ExtensionStatus; +namespace Imagekit\Files\FileUploadResponse\ExtensionStatus; enum RemoveBg: string { diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema.php b/src/Files/FileUploadResponse/SelectedFieldsSchema.php index 21ccb878..c838a7f2 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadResponse; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue; -use ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\SelectOption; -use ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\Type; +namespace Imagekit\Files\FileUploadResponse; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue; +use Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\SelectOption; +use Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\Type; /** * @phpstan-type SelectedFieldsSchemaShape = array{ diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php index 9fd5afc3..a592eb4f 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadResponse\SelectedFieldsSchema; +namespace Imagekit\Files\FileUploadResponse\SelectedFieldsSchema; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Core\Conversion\ListOf; -use ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed1; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Conversion\ListOf; +use Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed1; /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed1.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed1.php index f1e7a465..93cf76b5 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed1.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed1.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue; +namespace Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; final class Mixed1 implements ConverterSource { diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php index 27861e07..e13429a6 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadResponse\SelectedFieldsSchema; +namespace Imagekit\Files\FileUploadResponse\SelectedFieldsSchema; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php index 736d9b5c..6f0a13a0 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadResponse\SelectedFieldsSchema; +namespace Imagekit\Files\FileUploadResponse\SelectedFieldsSchema; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php index 4604eb34..f7366d50 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadResponse\SelectedFieldsSchema; +namespace Imagekit\Files\FileUploadResponse\SelectedFieldsSchema; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; final class SelectOption implements ConverterSource { diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/Type.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/Type.php index d987d623..bb67b578 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/Type.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadResponse\SelectedFieldsSchema; +namespace Imagekit\Files\FileUploadResponse\SelectedFieldsSchema; /** * Type of the custom metadata field. diff --git a/src/Files/FileUploadResponse/VersionInfo.php b/src/Files/FileUploadResponse/VersionInfo.php index 6ca2b25b..f259a472 100644 --- a/src/Files/FileUploadResponse/VersionInfo.php +++ b/src/Files/FileUploadResponse/VersionInfo.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Files\FileUploadResponse; +namespace Imagekit\Files\FileUploadResponse; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * An object containing the file or file version's `id` (versionId) and `name`. diff --git a/src/Files/Folder.php b/src/Files/Folder.php index 78570d76..ba23a6a4 100644 --- a/src/Files/Folder.php +++ b/src/Files/Folder.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\Files; +namespace Imagekit\Files; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Files\Folder\Type; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Files\Folder\Type; /** * @phpstan-type FolderShape = array{ diff --git a/src/Files/Folder/Type.php b/src/Files/Folder/Type.php index 91836374..060fae8e 100644 --- a/src/Files/Folder/Type.php +++ b/src/Files/Folder/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Files\Folder; +namespace Imagekit\Files\Folder; /** * Type of the asset. diff --git a/src/Files/Metadata.php b/src/Files/Metadata.php index f9bfa73b..b578cf59 100644 --- a/src/Files/Metadata.php +++ b/src/Files/Metadata.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace ImageKit\Files; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Files\Metadata\Exif; -use ImageKit\Files\Metadata\Exif\Gps; -use ImageKit\Files\Metadata\Exif\Image; -use ImageKit\Files\Metadata\Exif\Interoperability; -use ImageKit\Files\Metadata\Exif\Thumbnail; +namespace Imagekit\Files; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Files\Metadata\Exif; +use Imagekit\Files\Metadata\Exif\Gps; +use Imagekit\Files\Metadata\Exif\Image; +use Imagekit\Files\Metadata\Exif\Interoperability; +use Imagekit\Files\Metadata\Exif\Thumbnail; /** * JSON object containing metadata. diff --git a/src/Files/Metadata/Exif.php b/src/Files/Metadata/Exif.php index 88ddd30e..0ae33392 100644 --- a/src/Files/Metadata/Exif.php +++ b/src/Files/Metadata/Exif.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace ImageKit\Files\Metadata; +namespace Imagekit\Files\Metadata; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Files\Metadata\Exif\Gps; -use ImageKit\Files\Metadata\Exif\Image; -use ImageKit\Files\Metadata\Exif\Interoperability; -use ImageKit\Files\Metadata\Exif\Thumbnail; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Files\Metadata\Exif\Gps; +use Imagekit\Files\Metadata\Exif\Image; +use Imagekit\Files\Metadata\Exif\Interoperability; +use Imagekit\Files\Metadata\Exif\Thumbnail; /** * @phpstan-type ExifShape = array{ - * exif?: \ImageKit\Files\Metadata\Exif\Exif|null, + * exif?: \Imagekit\Files\Metadata\Exif\Exif|null, * gps?: Gps|null, * image?: Image|null, * interoperability?: Interoperability|null, diff --git a/src/Files/Metadata/Exif/Exif.php b/src/Files/Metadata/Exif/Exif.php index 4e17ff97..1ddd96ee 100644 --- a/src/Files/Metadata/Exif/Exif.php +++ b/src/Files/Metadata/Exif/Exif.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Files\Metadata\Exif; +namespace Imagekit\Files\Metadata\Exif; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * Object containing Exif details. diff --git a/src/Files/Metadata/Exif/Gps.php b/src/Files/Metadata/Exif/Gps.php index b3345002..ea72a755 100644 --- a/src/Files/Metadata/Exif/Gps.php +++ b/src/Files/Metadata/Exif/Gps.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Files\Metadata\Exif; +namespace Imagekit\Files\Metadata\Exif; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * Object containing GPS information. diff --git a/src/Files/Metadata/Exif/Image.php b/src/Files/Metadata/Exif/Image.php index fe9d96f0..671dd1e1 100644 --- a/src/Files/Metadata/Exif/Image.php +++ b/src/Files/Metadata/Exif/Image.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Files\Metadata\Exif; +namespace Imagekit\Files\Metadata\Exif; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * Object containing EXIF image information. diff --git a/src/Files/Metadata/Exif/Interoperability.php b/src/Files/Metadata/Exif/Interoperability.php index 7e87290e..21704ee3 100644 --- a/src/Files/Metadata/Exif/Interoperability.php +++ b/src/Files/Metadata/Exif/Interoperability.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Files\Metadata\Exif; +namespace Imagekit\Files\Metadata\Exif; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * JSON object. diff --git a/src/Files/Metadata/Exif/Thumbnail.php b/src/Files/Metadata/Exif/Thumbnail.php index 6433b85d..23117817 100644 --- a/src/Files/Metadata/Exif/Thumbnail.php +++ b/src/Files/Metadata/Exif/Thumbnail.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Files\Metadata\Exif; +namespace Imagekit\Files\Metadata\Exif; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * Object containing Thumbnail information. diff --git a/src/Files/Metadata/MetadataGetFromURLParams.php b/src/Files/Metadata/MetadataGetFromURLParams.php index 79d9954e..f4b515cf 100644 --- a/src/Files/Metadata/MetadataGetFromURLParams.php +++ b/src/Files/Metadata/MetadataGetFromURLParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace ImageKit\Files\Metadata; +namespace Imagekit\Files\Metadata; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; /** * Get image EXIF, pHash, and other metadata from ImageKit.io powered remote URL using this API. * - * @see ImageKit\Services\Files\MetadataService::getFromURL() + * @see Imagekit\Services\Files\MetadataService::getFromURL() * * @phpstan-type MetadataGetFromURLParamsShape = array{url: string} */ diff --git a/src/Files/UpdateFileRequest.php b/src/Files/UpdateFileRequest.php index 276303a7..d3089dd3 100644 --- a/src/Files/UpdateFileRequest.php +++ b/src/Files/UpdateFileRequest.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Files; +namespace Imagekit\Files; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Files\UpdateFileRequest\ChangePublicationStatus; -use ImageKit\Files\UpdateFileRequest\UpdateFileDetails; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Files\UpdateFileRequest\ChangePublicationStatus; +use Imagekit\Files\UpdateFileRequest\UpdateFileDetails; /** * Schema for update file update request. diff --git a/src/Files/UpdateFileRequest/ChangePublicationStatus.php b/src/Files/UpdateFileRequest/ChangePublicationStatus.php index 1022e2ab..7ebfda3e 100644 --- a/src/Files/UpdateFileRequest/ChangePublicationStatus.php +++ b/src/Files/UpdateFileRequest/ChangePublicationStatus.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\Files\UpdateFileRequest; +namespace Imagekit\Files\UpdateFileRequest; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Files\UpdateFileRequest\ChangePublicationStatus\Publish; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Files\UpdateFileRequest\ChangePublicationStatus\Publish; /** * @phpstan-type ChangePublicationStatusShape = array{publish?: Publish|null} diff --git a/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php b/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php index d89a95df..0dd3cb28 100644 --- a/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php +++ b/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Files\UpdateFileRequest\ChangePublicationStatus; +namespace Imagekit\Files\UpdateFileRequest\ChangePublicationStatus; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * Configure the publication status of a file and its versions. diff --git a/src/Files/UpdateFileRequest/UpdateFileDetails.php b/src/Files/UpdateFileRequest/UpdateFileDetails.php index a4f519d8..d9e566ad 100644 --- a/src/Files/UpdateFileRequest/UpdateFileDetails.php +++ b/src/Files/UpdateFileRequest/UpdateFileDetails.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace ImageKit\Files\UpdateFileRequest; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\ExtensionItem; -use ImageKit\ExtensionItem\AIAutoDescription; -use ImageKit\ExtensionItem\AutoTaggingExtension; -use ImageKit\ExtensionItem\AutoTaggingExtension\Name; -use ImageKit\ExtensionItem\RemoveBg; -use ImageKit\ExtensionItem\RemoveBg\Options; -use ImageKit\Files\UpdateFileRequest\UpdateFileDetails\RemoveAITags; +namespace Imagekit\Files\UpdateFileRequest; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\ExtensionItem; +use Imagekit\ExtensionItem\AIAutoDescription; +use Imagekit\ExtensionItem\AutoTaggingExtension; +use Imagekit\ExtensionItem\AutoTaggingExtension\Name; +use Imagekit\ExtensionItem\RemoveBg; +use Imagekit\ExtensionItem\RemoveBg\Options; +use Imagekit\Files\UpdateFileRequest\UpdateFileDetails\RemoveAITags; /** * @phpstan-type UpdateFileDetailsShape = array{ diff --git a/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php b/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php index a049e04b..dd36d37e 100644 --- a/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php +++ b/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\Files\UpdateFileRequest\UpdateFileDetails; +namespace Imagekit\Files\UpdateFileRequest\UpdateFileDetails; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Core\Conversion\ListOf; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Conversion\ListOf; /** * An array of AITags associated with the file that you want to remove, e.g. `["car", "vehicle", "motorsports"]`. diff --git a/src/Files/Versions/VersionDeleteParams.php b/src/Files/Versions/VersionDeleteParams.php index 769db9f6..944569ce 100644 --- a/src/Files/Versions/VersionDeleteParams.php +++ b/src/Files/Versions/VersionDeleteParams.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace ImageKit\Files\Versions; +namespace Imagekit\Files\Versions; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; /** * This API deletes a non-current file version permanently. The API returns an empty response. * * Note: If you want to delete all versions of a file, use the delete file API. * - * @see ImageKit\Services\Files\VersionsService::delete() + * @see Imagekit\Services\Files\VersionsService::delete() * * @phpstan-type VersionDeleteParamsShape = array{fileId: string} */ diff --git a/src/Files/Versions/VersionDeleteResponse.php b/src/Files/Versions/VersionDeleteResponse.php index b1a08bff..b0badbe3 100644 --- a/src/Files/Versions/VersionDeleteResponse.php +++ b/src/Files/Versions/VersionDeleteResponse.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\Files\Versions; +namespace Imagekit\Files\Versions; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkResponse; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Core\Conversion\Contracts\ResponseConverter; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkResponse; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type VersionDeleteResponseShape = array diff --git a/src/Files/Versions/VersionGetParams.php b/src/Files/Versions/VersionGetParams.php index 036cc88a..84cab6bf 100644 --- a/src/Files/Versions/VersionGetParams.php +++ b/src/Files/Versions/VersionGetParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace ImageKit\Files\Versions; +namespace Imagekit\Files\Versions; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; /** * This API returns an object with details or attributes of a file version. * - * @see ImageKit\Services\Files\VersionsService::get() + * @see Imagekit\Services\Files\VersionsService::get() * * @phpstan-type VersionGetParamsShape = array{fileId: string} */ diff --git a/src/Files/Versions/VersionRestoreParams.php b/src/Files/Versions/VersionRestoreParams.php index 344f2812..d1d852f6 100644 --- a/src/Files/Versions/VersionRestoreParams.php +++ b/src/Files/Versions/VersionRestoreParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace ImageKit\Files\Versions; +namespace Imagekit\Files\Versions; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; /** * This API restores a file version as the current file version. * - * @see ImageKit\Services\Files\VersionsService::restore() + * @see Imagekit\Services\Files\VersionsService::restore() * * @phpstan-type VersionRestoreParamsShape = array{fileId: string} */ diff --git a/src/Folders/FolderCopyParams.php b/src/Folders/FolderCopyParams.php index 216fba6f..4dfb35d1 100644 --- a/src/Folders/FolderCopyParams.php +++ b/src/Folders/FolderCopyParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace ImageKit\Folders; +namespace Imagekit\Folders; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; /** * This will copy one folder into another. The selected folder, its nested folders, files, and their versions (in `includeVersions` is set to true) are copied in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history. * - * @see ImageKit\Services\FoldersService::copy() + * @see Imagekit\Services\FoldersService::copy() * * @phpstan-type FolderCopyParamsShape = array{ * destinationPath: string, sourceFolderPath: string, includeVersions?: bool diff --git a/src/Folders/FolderCopyResponse.php b/src/Folders/FolderCopyResponse.php index 8ffcee2b..adf22c3e 100644 --- a/src/Folders/FolderCopyResponse.php +++ b/src/Folders/FolderCopyResponse.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Folders; +namespace Imagekit\Folders; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkResponse; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Core\Conversion\Contracts\ResponseConverter; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkResponse; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * Job submitted successfully. A `jobId` will be returned. diff --git a/src/Folders/FolderCreateParams.php b/src/Folders/FolderCreateParams.php index f36bc1b0..dd6bb866 100644 --- a/src/Folders/FolderCreateParams.php +++ b/src/Folders/FolderCreateParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace ImageKit\Folders; +namespace Imagekit\Folders; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; /** * This will create a new folder. You can specify the folder name and location of the parent folder where this new folder should be created. * - * @see ImageKit\Services\FoldersService::create() + * @see Imagekit\Services\FoldersService::create() * * @phpstan-type FolderCreateParamsShape = array{ * folderName: string, parentFolderPath: string diff --git a/src/Folders/FolderDeleteParams.php b/src/Folders/FolderDeleteParams.php index d0f8d7b7..e52a204d 100644 --- a/src/Folders/FolderDeleteParams.php +++ b/src/Folders/FolderDeleteParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace ImageKit\Folders; +namespace Imagekit\Folders; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; /** * This will delete a folder and all its contents permanently. The API returns an empty response. * - * @see ImageKit\Services\FoldersService::delete() + * @see Imagekit\Services\FoldersService::delete() * * @phpstan-type FolderDeleteParamsShape = array{folderPath: string} */ diff --git a/src/Folders/FolderDeleteResponse.php b/src/Folders/FolderDeleteResponse.php index 86e61ceb..bcc23b19 100644 --- a/src/Folders/FolderDeleteResponse.php +++ b/src/Folders/FolderDeleteResponse.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\Folders; +namespace Imagekit\Folders; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkResponse; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Core\Conversion\Contracts\ResponseConverter; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkResponse; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type FolderDeleteResponseShape = array diff --git a/src/Folders/FolderMoveParams.php b/src/Folders/FolderMoveParams.php index c49d4221..c07ec114 100644 --- a/src/Folders/FolderMoveParams.php +++ b/src/Folders/FolderMoveParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace ImageKit\Folders; +namespace Imagekit\Folders; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; /** * This will move one folder into another. The selected folder, its nested folders, files, and their versions are moved in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history. * - * @see ImageKit\Services\FoldersService::move() + * @see Imagekit\Services\FoldersService::move() * * @phpstan-type FolderMoveParamsShape = array{ * destinationPath: string, sourceFolderPath: string diff --git a/src/Folders/FolderMoveResponse.php b/src/Folders/FolderMoveResponse.php index c71ff8c6..5022ab73 100644 --- a/src/Folders/FolderMoveResponse.php +++ b/src/Folders/FolderMoveResponse.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Folders; +namespace Imagekit\Folders; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkResponse; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Core\Conversion\Contracts\ResponseConverter; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkResponse; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * Job submitted successfully. A `jobId` will be returned. diff --git a/src/Folders/FolderNewResponse.php b/src/Folders/FolderNewResponse.php index 123d3c73..18c1e70c 100644 --- a/src/Folders/FolderNewResponse.php +++ b/src/Folders/FolderNewResponse.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\Folders; +namespace Imagekit\Folders; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkResponse; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Core\Conversion\Contracts\ResponseConverter; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkResponse; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type FolderNewResponseShape = array diff --git a/src/Folders/FolderRenameParams.php b/src/Folders/FolderRenameParams.php index ec803298..5d3d8547 100644 --- a/src/Folders/FolderRenameParams.php +++ b/src/Folders/FolderRenameParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace ImageKit\Folders; +namespace Imagekit\Folders; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkParams; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkParams; +use Imagekit\Core\Contracts\BaseModel; /** * This API allows you to rename an existing folder. The folder and all its nested assets and sub-folders will remain unchanged, but their paths will be updated to reflect the new folder name. * - * @see ImageKit\Services\FoldersService::rename() + * @see Imagekit\Services\FoldersService::rename() * * @phpstan-type FolderRenameParamsShape = array{ * folderPath: string, newFolderName: string, purgeCache?: bool diff --git a/src/Folders/FolderRenameResponse.php b/src/Folders/FolderRenameResponse.php index aeec78d7..705fd2e9 100644 --- a/src/Folders/FolderRenameResponse.php +++ b/src/Folders/FolderRenameResponse.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Folders; +namespace Imagekit\Folders; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkResponse; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Core\Conversion\Contracts\ResponseConverter; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkResponse; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * Job submitted successfully. A `jobId` will be returned. diff --git a/src/Folders/Job/JobGetResponse.php b/src/Folders/Job/JobGetResponse.php index 16c299c5..5d81a730 100644 --- a/src/Folders/Job/JobGetResponse.php +++ b/src/Folders/Job/JobGetResponse.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace ImageKit\Folders\Job; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Concerns\SdkResponse; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Core\Conversion\Contracts\ResponseConverter; -use ImageKit\Folders\Job\JobGetResponse\Status; -use ImageKit\Folders\Job\JobGetResponse\Type; +namespace Imagekit\Folders\Job; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Concerns\SdkResponse; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\Conversion\Contracts\ResponseConverter; +use Imagekit\Folders\Job\JobGetResponse\Status; +use Imagekit\Folders\Job\JobGetResponse\Type; /** * @phpstan-type JobGetResponseShape = array{ diff --git a/src/Folders/Job/JobGetResponse/Status.php b/src/Folders/Job/JobGetResponse/Status.php index 0d3bad1f..7504b1e1 100644 --- a/src/Folders/Job/JobGetResponse/Status.php +++ b/src/Folders/Job/JobGetResponse/Status.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Folders\Job\JobGetResponse; +namespace Imagekit\Folders\Job\JobGetResponse; /** * Status of the bulk job. diff --git a/src/Folders/Job/JobGetResponse/Type.php b/src/Folders/Job/JobGetResponse/Type.php index d4b1bfa0..c23fb745 100644 --- a/src/Folders/Job/JobGetResponse/Type.php +++ b/src/Folders/Job/JobGetResponse/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Folders\Job\JobGetResponse; +namespace Imagekit\Folders\Job\JobGetResponse; /** * Type of the bulk job. diff --git a/src/GetImageAttributesOptions.php b/src/GetImageAttributesOptions.php index 2335349d..4d6ee99e 100644 --- a/src/GetImageAttributesOptions.php +++ b/src/GetImageAttributesOptions.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit; +namespace Imagekit; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * Options for generating responsive image attributes including `src`, `srcSet`, and `sizes` for HTML `` elements. diff --git a/src/ImageOverlay.php b/src/ImageOverlay.php index b0971eca..97e07e6f 100644 --- a/src/ImageOverlay.php +++ b/src/ImageOverlay.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit; +namespace Imagekit; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\ImageOverlay\Encoding; -use ImageKit\OverlayPosition\Focus; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\ImageOverlay\Encoding; +use Imagekit\OverlayPosition\Focus; /** * @phpstan-type ImageOverlayShape = array{ diff --git a/src/ImageOverlay/Encoding.php b/src/ImageOverlay/Encoding.php index 5cfb190b..c3c9e781 100644 --- a/src/ImageOverlay/Encoding.php +++ b/src/ImageOverlay/Encoding.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\ImageOverlay; +namespace Imagekit\ImageOverlay; /** * The input path can be included in the layer as either `i-{input}` or `ie-{base64_encoded_input}`. diff --git a/src/Overlay.php b/src/Overlay.php index 5402883b..9cb94be8 100644 --- a/src/Overlay.php +++ b/src/Overlay.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit; +namespace Imagekit; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Specifies an overlay to be applied on the parent image or video. diff --git a/src/OverlayPosition.php b/src/OverlayPosition.php index e768f71e..4b635376 100644 --- a/src/OverlayPosition.php +++ b/src/OverlayPosition.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit; +namespace Imagekit; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\OverlayPosition\Focus; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\OverlayPosition\Focus; /** * @phpstan-type OverlayPositionShape = array{ diff --git a/src/OverlayPosition/Focus.php b/src/OverlayPosition/Focus.php index fc41d92b..82d60fe3 100644 --- a/src/OverlayPosition/Focus.php +++ b/src/OverlayPosition/Focus.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\OverlayPosition; +namespace Imagekit\OverlayPosition; /** * Specifies the position of the overlay relative to the parent image or video. diff --git a/src/OverlayPosition/X.php b/src/OverlayPosition/X.php index 1dd4d388..84bdbcc2 100644 --- a/src/OverlayPosition/X.php +++ b/src/OverlayPosition/X.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\OverlayPosition; +namespace Imagekit\OverlayPosition; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the x-coordinate of the top-left corner of the base asset where the overlay's top-left corner will be positioned. diff --git a/src/OverlayPosition/Y.php b/src/OverlayPosition/Y.php index 018dd689..de81b5eb 100644 --- a/src/OverlayPosition/Y.php +++ b/src/OverlayPosition/Y.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\OverlayPosition; +namespace Imagekit\OverlayPosition; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the y-coordinate of the top-left corner of the base asset where the overlay's top-left corner will be positioned. diff --git a/src/OverlayTiming.php b/src/OverlayTiming.php index d5d28caf..eaaa4088 100644 --- a/src/OverlayTiming.php +++ b/src/OverlayTiming.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit; +namespace Imagekit; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type OverlayTimingShape = array{ diff --git a/src/OverlayTiming/Duration.php b/src/OverlayTiming/Duration.php index 1482c2fd..1b411d64 100644 --- a/src/OverlayTiming/Duration.php +++ b/src/OverlayTiming/Duration.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\OverlayTiming; +namespace Imagekit\OverlayTiming; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the duration (in seconds) during which the overlay should appear on the base video. diff --git a/src/OverlayTiming/End.php b/src/OverlayTiming/End.php index 2b30a3cf..ac3cc087 100644 --- a/src/OverlayTiming/End.php +++ b/src/OverlayTiming/End.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\OverlayTiming; +namespace Imagekit\OverlayTiming; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the end time (in seconds) for when the overlay should disappear from the base video. diff --git a/src/OverlayTiming/Start.php b/src/OverlayTiming/Start.php index f683510c..5e7cf6e7 100644 --- a/src/OverlayTiming/Start.php +++ b/src/OverlayTiming/Start.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\OverlayTiming; +namespace Imagekit\OverlayTiming; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the start time (in seconds) for when the overlay should appear on the base video. diff --git a/src/RequestOptions.php b/src/RequestOptions.php index 6f45538e..a390b5ff 100644 --- a/src/RequestOptions.php +++ b/src/RequestOptions.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace ImageKit; +namespace Imagekit; -use ImageKit\Core\Attributes\Api as Property; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Core\Implementation\Omit; +use Imagekit\Core\Attributes\Api as Property; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\Implementation\Omit; use Psr\Http\Client\ClientInterface; use Psr\Http\Message\RequestFactoryInterface; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Message\UriFactoryInterface; -use const ImageKit\Core\OMIT as omit; +use const Imagekit\Core\OMIT as omit; /** * @phpstan-type request_options = array{ diff --git a/src/ResponsiveImageAttributes.php b/src/ResponsiveImageAttributes.php index 06ece216..1e1e85d2 100644 --- a/src/ResponsiveImageAttributes.php +++ b/src/ResponsiveImageAttributes.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit; +namespace Imagekit; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * Resulting set of attributes suitable for an HTML `` element. diff --git a/src/ServiceContracts/Accounts/OriginsContract.php b/src/ServiceContracts/Accounts/OriginsContract.php index 54c5c68f..f0ee81c3 100644 --- a/src/ServiceContracts/Accounts/OriginsContract.php +++ b/src/ServiceContracts/Accounts/OriginsContract.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace ImageKit\ServiceContracts\Accounts; +namespace Imagekit\ServiceContracts\Accounts; -use ImageKit\Accounts\Origins\OriginResponse\AkeneoPim; -use ImageKit\Accounts\Origins\OriginResponse\AzureBlob; -use ImageKit\Accounts\Origins\OriginResponse\CloudinaryBackup; -use ImageKit\Accounts\Origins\OriginResponse\Gcs; -use ImageKit\Accounts\Origins\OriginResponse\S3; -use ImageKit\Accounts\Origins\OriginResponse\S3Compatible; -use ImageKit\Accounts\Origins\OriginResponse\WebFolder; -use ImageKit\Accounts\Origins\OriginResponse\WebProxy; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\RequestOptions; +use Imagekit\Accounts\Origins\OriginResponse\AkeneoPim; +use Imagekit\Accounts\Origins\OriginResponse\AzureBlob; +use Imagekit\Accounts\Origins\OriginResponse\CloudinaryBackup; +use Imagekit\Accounts\Origins\OriginResponse\Gcs; +use Imagekit\Accounts\Origins\OriginResponse\S3; +use Imagekit\Accounts\Origins\OriginResponse\S3Compatible; +use Imagekit\Accounts\Origins\OriginResponse\WebFolder; +use Imagekit\Accounts\Origins\OriginResponse\WebProxy; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\RequestOptions; interface OriginsContract { diff --git a/src/ServiceContracts/Accounts/URLEndpointsContract.php b/src/ServiceContracts/Accounts/URLEndpointsContract.php index 6dd1cf33..4984aa86 100644 --- a/src/ServiceContracts/Accounts/URLEndpointsContract.php +++ b/src/ServiceContracts/Accounts/URLEndpointsContract.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\ServiceContracts\Accounts; +namespace Imagekit\ServiceContracts\Accounts; -use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams; -use ImageKit\Accounts\URLEndpoints\URLEndpointResponse; -use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\RequestOptions; +use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams; +use Imagekit\Accounts\URLEndpoints\URLEndpointResponse; +use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\RequestOptions; interface URLEndpointsContract { diff --git a/src/ServiceContracts/Accounts/UsageContract.php b/src/ServiceContracts/Accounts/UsageContract.php index 82a1e244..9ebd1eae 100644 --- a/src/ServiceContracts/Accounts/UsageContract.php +++ b/src/ServiceContracts/Accounts/UsageContract.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\ServiceContracts\Accounts; +namespace Imagekit\ServiceContracts\Accounts; -use ImageKit\Accounts\Usage\UsageGetParams; -use ImageKit\Accounts\Usage\UsageGetResponse; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\RequestOptions; +use Imagekit\Accounts\Usage\UsageGetParams; +use Imagekit\Accounts\Usage\UsageGetResponse; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\RequestOptions; interface UsageContract { diff --git a/src/ServiceContracts/AccountsContract.php b/src/ServiceContracts/AccountsContract.php index 593d29a6..f65e2076 100644 --- a/src/ServiceContracts/AccountsContract.php +++ b/src/ServiceContracts/AccountsContract.php @@ -2,6 +2,6 @@ declare(strict_types=1); -namespace ImageKit\ServiceContracts; +namespace Imagekit\ServiceContracts; interface AccountsContract {} diff --git a/src/ServiceContracts/AssetsContract.php b/src/ServiceContracts/AssetsContract.php index b1be74fb..f19837d0 100644 --- a/src/ServiceContracts/AssetsContract.php +++ b/src/ServiceContracts/AssetsContract.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\ServiceContracts; +namespace Imagekit\ServiceContracts; -use ImageKit\Assets\AssetListParams; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\Files\File; -use ImageKit\Files\Folder; -use ImageKit\RequestOptions; +use Imagekit\Assets\AssetListParams; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\Files\File; +use Imagekit\Files\Folder; +use Imagekit\RequestOptions; interface AssetsContract { diff --git a/src/ServiceContracts/Beta/V2/FilesContract.php b/src/ServiceContracts/Beta/V2/FilesContract.php index bdeb0cb6..bf3b7e80 100644 --- a/src/ServiceContracts/Beta/V2/FilesContract.php +++ b/src/ServiceContracts/Beta/V2/FilesContract.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\ServiceContracts\Beta\V2; +namespace Imagekit\ServiceContracts\Beta\V2; -use ImageKit\Beta\V2\Files\FileUploadParams; -use ImageKit\Beta\V2\Files\FileUploadResponse; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\RequestOptions; +use Imagekit\Beta\V2\Files\FileUploadParams; +use Imagekit\Beta\V2\Files\FileUploadResponse; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\RequestOptions; interface FilesContract { diff --git a/src/ServiceContracts/Beta/V2Contract.php b/src/ServiceContracts/Beta/V2Contract.php index c3c8cd8c..b560e528 100644 --- a/src/ServiceContracts/Beta/V2Contract.php +++ b/src/ServiceContracts/Beta/V2Contract.php @@ -2,6 +2,6 @@ declare(strict_types=1); -namespace ImageKit\ServiceContracts\Beta; +namespace Imagekit\ServiceContracts\Beta; interface V2Contract {} diff --git a/src/ServiceContracts/BetaContract.php b/src/ServiceContracts/BetaContract.php index 675430fc..98f96434 100644 --- a/src/ServiceContracts/BetaContract.php +++ b/src/ServiceContracts/BetaContract.php @@ -2,6 +2,6 @@ declare(strict_types=1); -namespace ImageKit\ServiceContracts; +namespace Imagekit\ServiceContracts; interface BetaContract {} diff --git a/src/ServiceContracts/Cache/InvalidationContract.php b/src/ServiceContracts/Cache/InvalidationContract.php index 38da2f61..f788e43c 100644 --- a/src/ServiceContracts/Cache/InvalidationContract.php +++ b/src/ServiceContracts/Cache/InvalidationContract.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\ServiceContracts\Cache; +namespace Imagekit\ServiceContracts\Cache; -use ImageKit\Cache\Invalidation\InvalidationCreateParams; -use ImageKit\Cache\Invalidation\InvalidationGetResponse; -use ImageKit\Cache\Invalidation\InvalidationNewResponse; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\RequestOptions; +use Imagekit\Cache\Invalidation\InvalidationCreateParams; +use Imagekit\Cache\Invalidation\InvalidationGetResponse; +use Imagekit\Cache\Invalidation\InvalidationNewResponse; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\RequestOptions; interface InvalidationContract { diff --git a/src/ServiceContracts/CacheContract.php b/src/ServiceContracts/CacheContract.php index aa3c07b6..e9e3c36d 100644 --- a/src/ServiceContracts/CacheContract.php +++ b/src/ServiceContracts/CacheContract.php @@ -2,6 +2,6 @@ declare(strict_types=1); -namespace ImageKit\ServiceContracts; +namespace Imagekit\ServiceContracts; interface CacheContract {} diff --git a/src/ServiceContracts/CustomMetadataFieldsContract.php b/src/ServiceContracts/CustomMetadataFieldsContract.php index aeef92fb..f595e13e 100644 --- a/src/ServiceContracts/CustomMetadataFieldsContract.php +++ b/src/ServiceContracts/CustomMetadataFieldsContract.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace ImageKit\ServiceContracts; +namespace Imagekit\ServiceContracts; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\CustomMetadataFields\CustomMetadataField; -use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams; -use ImageKit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; -use ImageKit\CustomMetadataFields\CustomMetadataFieldListParams; -use ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams; -use ImageKit\RequestOptions; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\CustomMetadataFields\CustomMetadataField; +use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams; +use Imagekit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; +use Imagekit\CustomMetadataFields\CustomMetadataFieldListParams; +use Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams; +use Imagekit\RequestOptions; interface CustomMetadataFieldsContract { diff --git a/src/ServiceContracts/Files/BulkContract.php b/src/ServiceContracts/Files/BulkContract.php index 5d1aca5a..993feb56 100644 --- a/src/ServiceContracts/Files/BulkContract.php +++ b/src/ServiceContracts/Files/BulkContract.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace ImageKit\ServiceContracts\Files; +namespace Imagekit\ServiceContracts\Files; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\Files\Bulk\BulkAddTagsParams; -use ImageKit\Files\Bulk\BulkAddTagsResponse; -use ImageKit\Files\Bulk\BulkDeleteParams; -use ImageKit\Files\Bulk\BulkDeleteResponse; -use ImageKit\Files\Bulk\BulkRemoveAITagsParams; -use ImageKit\Files\Bulk\BulkRemoveAITagsResponse; -use ImageKit\Files\Bulk\BulkRemoveTagsParams; -use ImageKit\Files\Bulk\BulkRemoveTagsResponse; -use ImageKit\RequestOptions; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\Files\Bulk\BulkAddTagsParams; +use Imagekit\Files\Bulk\BulkAddTagsResponse; +use Imagekit\Files\Bulk\BulkDeleteParams; +use Imagekit\Files\Bulk\BulkDeleteResponse; +use Imagekit\Files\Bulk\BulkRemoveAITagsParams; +use Imagekit\Files\Bulk\BulkRemoveAITagsResponse; +use Imagekit\Files\Bulk\BulkRemoveTagsParams; +use Imagekit\Files\Bulk\BulkRemoveTagsResponse; +use Imagekit\RequestOptions; interface BulkContract { diff --git a/src/ServiceContracts/Files/MetadataContract.php b/src/ServiceContracts/Files/MetadataContract.php index 71e5a168..4ad4559a 100644 --- a/src/ServiceContracts/Files/MetadataContract.php +++ b/src/ServiceContracts/Files/MetadataContract.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\ServiceContracts\Files; +namespace Imagekit\ServiceContracts\Files; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\Files\Metadata; -use ImageKit\Files\Metadata\MetadataGetFromURLParams; -use ImageKit\RequestOptions; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\Files\Metadata; +use Imagekit\Files\Metadata\MetadataGetFromURLParams; +use Imagekit\RequestOptions; interface MetadataContract { diff --git a/src/ServiceContracts/Files/VersionsContract.php b/src/ServiceContracts/Files/VersionsContract.php index c8069413..79c8dd0b 100644 --- a/src/ServiceContracts/Files/VersionsContract.php +++ b/src/ServiceContracts/Files/VersionsContract.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace ImageKit\ServiceContracts\Files; +namespace Imagekit\ServiceContracts\Files; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\Files\File; -use ImageKit\Files\Versions\VersionDeleteParams; -use ImageKit\Files\Versions\VersionDeleteResponse; -use ImageKit\Files\Versions\VersionGetParams; -use ImageKit\Files\Versions\VersionRestoreParams; -use ImageKit\RequestOptions; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\Files\File; +use Imagekit\Files\Versions\VersionDeleteParams; +use Imagekit\Files\Versions\VersionDeleteResponse; +use Imagekit\Files\Versions\VersionGetParams; +use Imagekit\Files\Versions\VersionRestoreParams; +use Imagekit\RequestOptions; interface VersionsContract { diff --git a/src/ServiceContracts/FilesContract.php b/src/ServiceContracts/FilesContract.php index 867e7101..bfbdf338 100644 --- a/src/ServiceContracts/FilesContract.php +++ b/src/ServiceContracts/FilesContract.php @@ -2,20 +2,20 @@ declare(strict_types=1); -namespace ImageKit\ServiceContracts; +namespace Imagekit\ServiceContracts; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\Files\File; -use ImageKit\Files\FileCopyParams; -use ImageKit\Files\FileCopyResponse; -use ImageKit\Files\FileMoveParams; -use ImageKit\Files\FileMoveResponse; -use ImageKit\Files\FileRenameParams; -use ImageKit\Files\FileRenameResponse; -use ImageKit\Files\FileUpdateResponse; -use ImageKit\Files\FileUploadParams; -use ImageKit\Files\FileUploadResponse; -use ImageKit\RequestOptions; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\Files\File; +use Imagekit\Files\FileCopyParams; +use Imagekit\Files\FileCopyResponse; +use Imagekit\Files\FileMoveParams; +use Imagekit\Files\FileMoveResponse; +use Imagekit\Files\FileRenameParams; +use Imagekit\Files\FileRenameResponse; +use Imagekit\Files\FileUpdateResponse; +use Imagekit\Files\FileUploadParams; +use Imagekit\Files\FileUploadResponse; +use Imagekit\RequestOptions; interface FilesContract { diff --git a/src/ServiceContracts/Folders/JobContract.php b/src/ServiceContracts/Folders/JobContract.php index c97679c9..4cab7130 100644 --- a/src/ServiceContracts/Folders/JobContract.php +++ b/src/ServiceContracts/Folders/JobContract.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\ServiceContracts\Folders; +namespace Imagekit\ServiceContracts\Folders; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\Folders\Job\JobGetResponse; -use ImageKit\RequestOptions; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\Folders\Job\JobGetResponse; +use Imagekit\RequestOptions; interface JobContract { diff --git a/src/ServiceContracts/FoldersContract.php b/src/ServiceContracts/FoldersContract.php index 7499ac24..edccd8fa 100644 --- a/src/ServiceContracts/FoldersContract.php +++ b/src/ServiceContracts/FoldersContract.php @@ -2,20 +2,20 @@ declare(strict_types=1); -namespace ImageKit\ServiceContracts; +namespace Imagekit\ServiceContracts; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\Folders\FolderCopyParams; -use ImageKit\Folders\FolderCopyResponse; -use ImageKit\Folders\FolderCreateParams; -use ImageKit\Folders\FolderDeleteParams; -use ImageKit\Folders\FolderDeleteResponse; -use ImageKit\Folders\FolderMoveParams; -use ImageKit\Folders\FolderMoveResponse; -use ImageKit\Folders\FolderNewResponse; -use ImageKit\Folders\FolderRenameParams; -use ImageKit\Folders\FolderRenameResponse; -use ImageKit\RequestOptions; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\Folders\FolderCopyParams; +use Imagekit\Folders\FolderCopyResponse; +use Imagekit\Folders\FolderCreateParams; +use Imagekit\Folders\FolderDeleteParams; +use Imagekit\Folders\FolderDeleteResponse; +use Imagekit\Folders\FolderMoveParams; +use Imagekit\Folders\FolderMoveResponse; +use Imagekit\Folders\FolderNewResponse; +use Imagekit\Folders\FolderRenameParams; +use Imagekit\Folders\FolderRenameResponse; +use Imagekit\RequestOptions; interface FoldersContract { diff --git a/src/ServiceContracts/WebhooksContract.php b/src/ServiceContracts/WebhooksContract.php index cefb28f3..4d2a7038 100644 --- a/src/ServiceContracts/WebhooksContract.php +++ b/src/ServiceContracts/WebhooksContract.php @@ -2,6 +2,6 @@ declare(strict_types=1); -namespace ImageKit\ServiceContracts; +namespace Imagekit\ServiceContracts; interface WebhooksContract {} diff --git a/src/Services/Accounts/OriginsService.php b/src/Services/Accounts/OriginsService.php index f9de6a1f..73a870e6 100644 --- a/src/Services/Accounts/OriginsService.php +++ b/src/Services/Accounts/OriginsService.php @@ -2,24 +2,24 @@ declare(strict_types=1); -namespace ImageKit\Services\Accounts; +namespace Imagekit\Services\Accounts; -use ImageKit\Accounts\Origins\OriginCreateParams; -use ImageKit\Accounts\Origins\OriginResponse; -use ImageKit\Accounts\Origins\OriginResponse\AkeneoPim; -use ImageKit\Accounts\Origins\OriginResponse\AzureBlob; -use ImageKit\Accounts\Origins\OriginResponse\CloudinaryBackup; -use ImageKit\Accounts\Origins\OriginResponse\Gcs; -use ImageKit\Accounts\Origins\OriginResponse\S3; -use ImageKit\Accounts\Origins\OriginResponse\S3Compatible; -use ImageKit\Accounts\Origins\OriginResponse\WebFolder; -use ImageKit\Accounts\Origins\OriginResponse\WebProxy; -use ImageKit\Accounts\Origins\OriginUpdateParams; -use ImageKit\Client; -use ImageKit\Core\Conversion\ListOf; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\RequestOptions; -use ImageKit\ServiceContracts\Accounts\OriginsContract; +use Imagekit\Accounts\Origins\OriginCreateParams; +use Imagekit\Accounts\Origins\OriginResponse; +use Imagekit\Accounts\Origins\OriginResponse\AkeneoPim; +use Imagekit\Accounts\Origins\OriginResponse\AzureBlob; +use Imagekit\Accounts\Origins\OriginResponse\CloudinaryBackup; +use Imagekit\Accounts\Origins\OriginResponse\Gcs; +use Imagekit\Accounts\Origins\OriginResponse\S3; +use Imagekit\Accounts\Origins\OriginResponse\S3Compatible; +use Imagekit\Accounts\Origins\OriginResponse\WebFolder; +use Imagekit\Accounts\Origins\OriginResponse\WebProxy; +use Imagekit\Accounts\Origins\OriginUpdateParams; +use Imagekit\Client; +use Imagekit\Core\Conversion\ListOf; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\RequestOptions; +use Imagekit\ServiceContracts\Accounts\OriginsContract; final class OriginsService implements OriginsContract { diff --git a/src/Services/Accounts/URLEndpointsService.php b/src/Services/Accounts/URLEndpointsService.php index 6077645b..23c45a0a 100644 --- a/src/Services/Accounts/URLEndpointsService.php +++ b/src/Services/Accounts/URLEndpointsService.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace ImageKit\Services\Accounts; +namespace Imagekit\Services\Accounts; -use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams; -use ImageKit\Accounts\URLEndpoints\URLEndpointResponse; -use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams; -use ImageKit\Client; -use ImageKit\Core\Conversion\ListOf; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\RequestOptions; -use ImageKit\ServiceContracts\Accounts\URLEndpointsContract; +use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams; +use Imagekit\Accounts\URLEndpoints\URLEndpointResponse; +use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams; +use Imagekit\Client; +use Imagekit\Core\Conversion\ListOf; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\RequestOptions; +use Imagekit\ServiceContracts\Accounts\URLEndpointsContract; final class URLEndpointsService implements URLEndpointsContract { diff --git a/src/Services/Accounts/UsageService.php b/src/Services/Accounts/UsageService.php index e60676bf..f49134b0 100644 --- a/src/Services/Accounts/UsageService.php +++ b/src/Services/Accounts/UsageService.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace ImageKit\Services\Accounts; +namespace Imagekit\Services\Accounts; -use ImageKit\Accounts\Usage\UsageGetParams; -use ImageKit\Accounts\Usage\UsageGetResponse; -use ImageKit\Client; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\RequestOptions; -use ImageKit\ServiceContracts\Accounts\UsageContract; +use Imagekit\Accounts\Usage\UsageGetParams; +use Imagekit\Accounts\Usage\UsageGetResponse; +use Imagekit\Client; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\RequestOptions; +use Imagekit\ServiceContracts\Accounts\UsageContract; final class UsageService implements UsageContract { diff --git a/src/Services/AccountsService.php b/src/Services/AccountsService.php index 28953278..3a6e5bb1 100644 --- a/src/Services/AccountsService.php +++ b/src/Services/AccountsService.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Services; +namespace Imagekit\Services; -use ImageKit\Client; -use ImageKit\ServiceContracts\AccountsContract; -use ImageKit\Services\Accounts\OriginsService; -use ImageKit\Services\Accounts\URLEndpointsService; -use ImageKit\Services\Accounts\UsageService; +use Imagekit\Client; +use Imagekit\ServiceContracts\AccountsContract; +use Imagekit\Services\Accounts\OriginsService; +use Imagekit\Services\Accounts\URLEndpointsService; +use Imagekit\Services\Accounts\UsageService; final class AccountsService implements AccountsContract { diff --git a/src/Services/AssetsService.php b/src/Services/AssetsService.php index 0487868a..e30da5fe 100644 --- a/src/Services/AssetsService.php +++ b/src/Services/AssetsService.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace ImageKit\Services; +namespace Imagekit\Services; -use ImageKit\Assets\AssetListParams; -use ImageKit\Assets\AssetListParams\Sort; -use ImageKit\Assets\AssetListResponseItem; -use ImageKit\Client; -use ImageKit\Core\Conversion\ListOf; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\Files\File; -use ImageKit\Files\Folder; -use ImageKit\RequestOptions; -use ImageKit\ServiceContracts\AssetsContract; +use Imagekit\Assets\AssetListParams; +use Imagekit\Assets\AssetListParams\Sort; +use Imagekit\Assets\AssetListResponseItem; +use Imagekit\Client; +use Imagekit\Core\Conversion\ListOf; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\Files\File; +use Imagekit\Files\Folder; +use Imagekit\RequestOptions; +use Imagekit\ServiceContracts\AssetsContract; final class AssetsService implements AssetsContract { diff --git a/src/Services/Beta/V2/FilesService.php b/src/Services/Beta/V2/FilesService.php index 6ac42f00..e937278f 100644 --- a/src/Services/Beta/V2/FilesService.php +++ b/src/Services/Beta/V2/FilesService.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace ImageKit\Services\Beta\V2; +namespace Imagekit\Services\Beta\V2; -use ImageKit\Beta\V2\Files\FileUploadParams; -use ImageKit\Beta\V2\Files\FileUploadResponse; -use ImageKit\Client; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\RequestOptions; -use ImageKit\ServiceContracts\Beta\V2\FilesContract; +use Imagekit\Beta\V2\Files\FileUploadParams; +use Imagekit\Beta\V2\Files\FileUploadResponse; +use Imagekit\Client; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\RequestOptions; +use Imagekit\ServiceContracts\Beta\V2\FilesContract; final class FilesService implements FilesContract { diff --git a/src/Services/Beta/V2Service.php b/src/Services/Beta/V2Service.php index 0e058a9b..c92aac32 100644 --- a/src/Services/Beta/V2Service.php +++ b/src/Services/Beta/V2Service.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Services\Beta; +namespace Imagekit\Services\Beta; -use ImageKit\Client; -use ImageKit\ServiceContracts\Beta\V2Contract; -use ImageKit\Services\Beta\V2\FilesService; +use Imagekit\Client; +use Imagekit\ServiceContracts\Beta\V2Contract; +use Imagekit\Services\Beta\V2\FilesService; final class V2Service implements V2Contract { diff --git a/src/Services/BetaService.php b/src/Services/BetaService.php index e81a3f0e..2fd33a5f 100644 --- a/src/Services/BetaService.php +++ b/src/Services/BetaService.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Services; +namespace Imagekit\Services; -use ImageKit\Client; -use ImageKit\ServiceContracts\BetaContract; -use ImageKit\Services\Beta\V2Service; +use Imagekit\Client; +use Imagekit\ServiceContracts\BetaContract; +use Imagekit\Services\Beta\V2Service; final class BetaService implements BetaContract { diff --git a/src/Services/Cache/InvalidationService.php b/src/Services/Cache/InvalidationService.php index 6a363259..12cf5a0b 100644 --- a/src/Services/Cache/InvalidationService.php +++ b/src/Services/Cache/InvalidationService.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace ImageKit\Services\Cache; +namespace Imagekit\Services\Cache; -use ImageKit\Cache\Invalidation\InvalidationCreateParams; -use ImageKit\Cache\Invalidation\InvalidationGetResponse; -use ImageKit\Cache\Invalidation\InvalidationNewResponse; -use ImageKit\Client; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\RequestOptions; -use ImageKit\ServiceContracts\Cache\InvalidationContract; +use Imagekit\Cache\Invalidation\InvalidationCreateParams; +use Imagekit\Cache\Invalidation\InvalidationGetResponse; +use Imagekit\Cache\Invalidation\InvalidationNewResponse; +use Imagekit\Client; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\RequestOptions; +use Imagekit\ServiceContracts\Cache\InvalidationContract; final class InvalidationService implements InvalidationContract { diff --git a/src/Services/CacheService.php b/src/Services/CacheService.php index b9315cf6..9199c120 100644 --- a/src/Services/CacheService.php +++ b/src/Services/CacheService.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Services; +namespace Imagekit\Services; -use ImageKit\Client; -use ImageKit\ServiceContracts\CacheContract; -use ImageKit\Services\Cache\InvalidationService; +use Imagekit\Client; +use Imagekit\ServiceContracts\CacheContract; +use Imagekit\Services\Cache\InvalidationService; final class CacheService implements CacheContract { diff --git a/src/Services/CustomMetadataFieldsService.php b/src/Services/CustomMetadataFieldsService.php index bb3585a4..0962794d 100644 --- a/src/Services/CustomMetadataFieldsService.php +++ b/src/Services/CustomMetadataFieldsService.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace ImageKit\Services; +namespace Imagekit\Services; -use ImageKit\Client; -use ImageKit\Core\Conversion\ListOf; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\CustomMetadataFields\CustomMetadataField; -use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams; -use ImageKit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; -use ImageKit\CustomMetadataFields\CustomMetadataFieldListParams; -use ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams; -use ImageKit\RequestOptions; -use ImageKit\ServiceContracts\CustomMetadataFieldsContract; +use Imagekit\Client; +use Imagekit\Core\Conversion\ListOf; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\CustomMetadataFields\CustomMetadataField; +use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams; +use Imagekit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; +use Imagekit\CustomMetadataFields\CustomMetadataFieldListParams; +use Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams; +use Imagekit\RequestOptions; +use Imagekit\ServiceContracts\CustomMetadataFieldsContract; final class CustomMetadataFieldsService implements CustomMetadataFieldsContract { diff --git a/src/Services/Files/BulkService.php b/src/Services/Files/BulkService.php index 65a3887d..c68ddafe 100644 --- a/src/Services/Files/BulkService.php +++ b/src/Services/Files/BulkService.php @@ -2,20 +2,20 @@ declare(strict_types=1); -namespace ImageKit\Services\Files; +namespace Imagekit\Services\Files; -use ImageKit\Client; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\Files\Bulk\BulkAddTagsParams; -use ImageKit\Files\Bulk\BulkAddTagsResponse; -use ImageKit\Files\Bulk\BulkDeleteParams; -use ImageKit\Files\Bulk\BulkDeleteResponse; -use ImageKit\Files\Bulk\BulkRemoveAITagsParams; -use ImageKit\Files\Bulk\BulkRemoveAITagsResponse; -use ImageKit\Files\Bulk\BulkRemoveTagsParams; -use ImageKit\Files\Bulk\BulkRemoveTagsResponse; -use ImageKit\RequestOptions; -use ImageKit\ServiceContracts\Files\BulkContract; +use Imagekit\Client; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\Files\Bulk\BulkAddTagsParams; +use Imagekit\Files\Bulk\BulkAddTagsResponse; +use Imagekit\Files\Bulk\BulkDeleteParams; +use Imagekit\Files\Bulk\BulkDeleteResponse; +use Imagekit\Files\Bulk\BulkRemoveAITagsParams; +use Imagekit\Files\Bulk\BulkRemoveAITagsResponse; +use Imagekit\Files\Bulk\BulkRemoveTagsParams; +use Imagekit\Files\Bulk\BulkRemoveTagsResponse; +use Imagekit\RequestOptions; +use Imagekit\ServiceContracts\Files\BulkContract; final class BulkService implements BulkContract { diff --git a/src/Services/Files/MetadataService.php b/src/Services/Files/MetadataService.php index 18eb892b..04c457c3 100644 --- a/src/Services/Files/MetadataService.php +++ b/src/Services/Files/MetadataService.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace ImageKit\Services\Files; +namespace Imagekit\Services\Files; -use ImageKit\Client; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\Files\Metadata; -use ImageKit\Files\Metadata\MetadataGetFromURLParams; -use ImageKit\RequestOptions; -use ImageKit\ServiceContracts\Files\MetadataContract; +use Imagekit\Client; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\Files\Metadata; +use Imagekit\Files\Metadata\MetadataGetFromURLParams; +use Imagekit\RequestOptions; +use Imagekit\ServiceContracts\Files\MetadataContract; final class MetadataService implements MetadataContract { diff --git a/src/Services/Files/VersionsService.php b/src/Services/Files/VersionsService.php index e9e88e43..b7857b3f 100644 --- a/src/Services/Files/VersionsService.php +++ b/src/Services/Files/VersionsService.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace ImageKit\Services\Files; +namespace Imagekit\Services\Files; -use ImageKit\Client; -use ImageKit\Core\Conversion\ListOf; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\Files\File; -use ImageKit\Files\Versions\VersionDeleteParams; -use ImageKit\Files\Versions\VersionDeleteResponse; -use ImageKit\Files\Versions\VersionGetParams; -use ImageKit\Files\Versions\VersionRestoreParams; -use ImageKit\RequestOptions; -use ImageKit\ServiceContracts\Files\VersionsContract; +use Imagekit\Client; +use Imagekit\Core\Conversion\ListOf; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\Files\File; +use Imagekit\Files\Versions\VersionDeleteParams; +use Imagekit\Files\Versions\VersionDeleteResponse; +use Imagekit\Files\Versions\VersionGetParams; +use Imagekit\Files\Versions\VersionRestoreParams; +use Imagekit\RequestOptions; +use Imagekit\ServiceContracts\Files\VersionsContract; final class VersionsService implements VersionsContract { diff --git a/src/Services/FilesService.php b/src/Services/FilesService.php index 96997fd6..132712c1 100644 --- a/src/Services/FilesService.php +++ b/src/Services/FilesService.php @@ -2,26 +2,26 @@ declare(strict_types=1); -namespace ImageKit\Services; +namespace Imagekit\Services; -use ImageKit\Client; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\Files\File; -use ImageKit\Files\FileCopyParams; -use ImageKit\Files\FileCopyResponse; -use ImageKit\Files\FileMoveParams; -use ImageKit\Files\FileMoveResponse; -use ImageKit\Files\FileRenameParams; -use ImageKit\Files\FileRenameResponse; -use ImageKit\Files\FileUpdateParams; -use ImageKit\Files\FileUpdateResponse; -use ImageKit\Files\FileUploadParams; -use ImageKit\Files\FileUploadResponse; -use ImageKit\RequestOptions; -use ImageKit\ServiceContracts\FilesContract; -use ImageKit\Services\Files\BulkService; -use ImageKit\Services\Files\MetadataService; -use ImageKit\Services\Files\VersionsService; +use Imagekit\Client; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\Files\File; +use Imagekit\Files\FileCopyParams; +use Imagekit\Files\FileCopyResponse; +use Imagekit\Files\FileMoveParams; +use Imagekit\Files\FileMoveResponse; +use Imagekit\Files\FileRenameParams; +use Imagekit\Files\FileRenameResponse; +use Imagekit\Files\FileUpdateParams; +use Imagekit\Files\FileUpdateResponse; +use Imagekit\Files\FileUploadParams; +use Imagekit\Files\FileUploadResponse; +use Imagekit\RequestOptions; +use Imagekit\ServiceContracts\FilesContract; +use Imagekit\Services\Files\BulkService; +use Imagekit\Services\Files\MetadataService; +use Imagekit\Services\Files\VersionsService; final class FilesService implements FilesContract { diff --git a/src/Services/Folders/JobService.php b/src/Services/Folders/JobService.php index b9fd0873..54a21958 100644 --- a/src/Services/Folders/JobService.php +++ b/src/Services/Folders/JobService.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Services\Folders; +namespace Imagekit\Services\Folders; -use ImageKit\Client; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\Folders\Job\JobGetResponse; -use ImageKit\RequestOptions; -use ImageKit\ServiceContracts\Folders\JobContract; +use Imagekit\Client; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\Folders\Job\JobGetResponse; +use Imagekit\RequestOptions; +use Imagekit\ServiceContracts\Folders\JobContract; final class JobService implements JobContract { diff --git a/src/Services/FoldersService.php b/src/Services/FoldersService.php index 79eee222..f2a87cb0 100644 --- a/src/Services/FoldersService.php +++ b/src/Services/FoldersService.php @@ -2,23 +2,23 @@ declare(strict_types=1); -namespace ImageKit\Services; +namespace Imagekit\Services; -use ImageKit\Client; -use ImageKit\Core\Exceptions\APIException; -use ImageKit\Folders\FolderCopyParams; -use ImageKit\Folders\FolderCopyResponse; -use ImageKit\Folders\FolderCreateParams; -use ImageKit\Folders\FolderDeleteParams; -use ImageKit\Folders\FolderDeleteResponse; -use ImageKit\Folders\FolderMoveParams; -use ImageKit\Folders\FolderMoveResponse; -use ImageKit\Folders\FolderNewResponse; -use ImageKit\Folders\FolderRenameParams; -use ImageKit\Folders\FolderRenameResponse; -use ImageKit\RequestOptions; -use ImageKit\ServiceContracts\FoldersContract; -use ImageKit\Services\Folders\JobService; +use Imagekit\Client; +use Imagekit\Core\Exceptions\APIException; +use Imagekit\Folders\FolderCopyParams; +use Imagekit\Folders\FolderCopyResponse; +use Imagekit\Folders\FolderCreateParams; +use Imagekit\Folders\FolderDeleteParams; +use Imagekit\Folders\FolderDeleteResponse; +use Imagekit\Folders\FolderMoveParams; +use Imagekit\Folders\FolderMoveResponse; +use Imagekit\Folders\FolderNewResponse; +use Imagekit\Folders\FolderRenameParams; +use Imagekit\Folders\FolderRenameResponse; +use Imagekit\RequestOptions; +use Imagekit\ServiceContracts\FoldersContract; +use Imagekit\Services\Folders\JobService; final class FoldersService implements FoldersContract { diff --git a/src/Services/WebhooksService.php b/src/Services/WebhooksService.php index 4b4150a7..e840561f 100644 --- a/src/Services/WebhooksService.php +++ b/src/Services/WebhooksService.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace ImageKit\Services; +namespace Imagekit\Services; -use ImageKit\Client; -use ImageKit\ServiceContracts\WebhooksContract; +use Imagekit\Client; +use Imagekit\ServiceContracts\WebhooksContract; final class WebhooksService implements WebhooksContract { diff --git a/src/SolidColorOverlay.php b/src/SolidColorOverlay.php index e4cc6e4e..082a40b2 100644 --- a/src/SolidColorOverlay.php +++ b/src/SolidColorOverlay.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit; +namespace Imagekit; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\OverlayPosition\Focus; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\OverlayPosition\Focus; /** * @phpstan-type SolidColorOverlayShape = array{ diff --git a/src/SolidColorOverlayTransformation.php b/src/SolidColorOverlayTransformation.php index 83fbe11e..83ba5ce2 100644 --- a/src/SolidColorOverlayTransformation.php +++ b/src/SolidColorOverlayTransformation.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit; +namespace Imagekit; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type SolidColorOverlayTransformationShape = array{ diff --git a/src/SolidColorOverlayTransformation/Gradient.php b/src/SolidColorOverlayTransformation/Gradient.php index ccd1495c..f2b02412 100644 --- a/src/SolidColorOverlayTransformation/Gradient.php +++ b/src/SolidColorOverlayTransformation/Gradient.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\SolidColorOverlayTransformation; +namespace Imagekit\SolidColorOverlayTransformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. diff --git a/src/SolidColorOverlayTransformation/Height.php b/src/SolidColorOverlayTransformation/Height.php index dfe441b3..e66bf3ec 100644 --- a/src/SolidColorOverlayTransformation/Height.php +++ b/src/SolidColorOverlayTransformation/Height.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\SolidColorOverlayTransformation; +namespace Imagekit\SolidColorOverlayTransformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Controls the height of the solid color overlay. Accepts a numeric value or an arithmetic expression. diff --git a/src/SolidColorOverlayTransformation/Radius.php b/src/SolidColorOverlayTransformation/Radius.php index c1be8d24..8582e3ad 100644 --- a/src/SolidColorOverlayTransformation/Radius.php +++ b/src/SolidColorOverlayTransformation/Radius.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\SolidColorOverlayTransformation; +namespace Imagekit\SolidColorOverlayTransformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the corner radius of the solid color overlay. Set to `max` for circular or oval shape. diff --git a/src/SolidColorOverlayTransformation/Width.php b/src/SolidColorOverlayTransformation/Width.php index f3b72449..3717af43 100644 --- a/src/SolidColorOverlayTransformation/Width.php +++ b/src/SolidColorOverlayTransformation/Width.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\SolidColorOverlayTransformation; +namespace Imagekit\SolidColorOverlayTransformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Controls the width of the solid color overlay. Accepts a numeric value or an arithmetic expression (e.g., `bw_mul_0.2` or `bh_div_2`). diff --git a/src/SrcOptions.php b/src/SrcOptions.php index 5227df84..40a7e481 100644 --- a/src/SrcOptions.php +++ b/src/SrcOptions.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit; +namespace Imagekit; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * Options for generating ImageKit URLs with transformations. See the [Transformations guide](https://imagekit.io/docs/transformations). diff --git a/src/StreamingResolution.php b/src/StreamingResolution.php index 350f8215..309db090 100644 --- a/src/StreamingResolution.php +++ b/src/StreamingResolution.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit; +namespace Imagekit; /** * Available streaming resolutions for [adaptive bitrate streaming](https://imagekit.io/docs/adaptive-bitrate-streaming). diff --git a/src/SubtitleOverlay.php b/src/SubtitleOverlay.php index b0756d26..2249092d 100644 --- a/src/SubtitleOverlay.php +++ b/src/SubtitleOverlay.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace ImageKit; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\OverlayPosition\Focus; -use ImageKit\SubtitleOverlay\Encoding; -use ImageKit\SubtitleOverlayTransformation\Typography; +namespace Imagekit; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\OverlayPosition\Focus; +use Imagekit\SubtitleOverlay\Encoding; +use Imagekit\SubtitleOverlayTransformation\Typography; /** * @phpstan-type SubtitleOverlayShape = array{ diff --git a/src/SubtitleOverlay/Encoding.php b/src/SubtitleOverlay/Encoding.php index fb012d60..0967c288 100644 --- a/src/SubtitleOverlay/Encoding.php +++ b/src/SubtitleOverlay/Encoding.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\SubtitleOverlay; +namespace Imagekit\SubtitleOverlay; /** * The input path can be included in the layer as either `i-{input}` or `ie-{base64_encoded_input}`. diff --git a/src/SubtitleOverlayTransformation.php b/src/SubtitleOverlayTransformation.php index fc35d23f..4813c602 100644 --- a/src/SubtitleOverlayTransformation.php +++ b/src/SubtitleOverlayTransformation.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit; +namespace Imagekit; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\SubtitleOverlayTransformation\Typography; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\SubtitleOverlayTransformation\Typography; /** * Subtitle styling options. [Learn more](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) from the docs. diff --git a/src/SubtitleOverlayTransformation/Typography.php b/src/SubtitleOverlayTransformation/Typography.php index da7d956d..296f8290 100644 --- a/src/SubtitleOverlayTransformation/Typography.php +++ b/src/SubtitleOverlayTransformation/Typography.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\SubtitleOverlayTransformation; +namespace Imagekit\SubtitleOverlayTransformation; /** * Sets the typography style of the subtitle text. Supports values are `b` for bold, `i` for italics, and `b_i` for bold with italics. diff --git a/src/TextOverlay.php b/src/TextOverlay.php index bdcebe56..63fe6dd6 100644 --- a/src/TextOverlay.php +++ b/src/TextOverlay.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace ImageKit; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\OverlayPosition\Focus; -use ImageKit\TextOverlay\Encoding; -use ImageKit\TextOverlayTransformation\Flip; -use ImageKit\TextOverlayTransformation\InnerAlignment; +namespace Imagekit; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\OverlayPosition\Focus; +use Imagekit\TextOverlay\Encoding; +use Imagekit\TextOverlayTransformation\Flip; +use Imagekit\TextOverlayTransformation\InnerAlignment; /** * @phpstan-type TextOverlayShape = array{ diff --git a/src/TextOverlay/Encoding.php b/src/TextOverlay/Encoding.php index 4daa16ef..daecef98 100644 --- a/src/TextOverlay/Encoding.php +++ b/src/TextOverlay/Encoding.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\TextOverlay; +namespace Imagekit\TextOverlay; /** * Text can be included in the layer as either `i-{input}` (plain text) or `ie-{base64_encoded_input}` (base64). diff --git a/src/TextOverlayTransformation.php b/src/TextOverlayTransformation.php index 621a3c16..050866e4 100644 --- a/src/TextOverlayTransformation.php +++ b/src/TextOverlayTransformation.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit; +namespace Imagekit; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\TextOverlayTransformation\Flip; -use ImageKit\TextOverlayTransformation\InnerAlignment; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\TextOverlayTransformation\Flip; +use Imagekit\TextOverlayTransformation\InnerAlignment; /** * @phpstan-type TextOverlayTransformationShape = array{ diff --git a/src/TextOverlayTransformation/Flip.php b/src/TextOverlayTransformation/Flip.php index 45d99626..7b665809 100644 --- a/src/TextOverlayTransformation/Flip.php +++ b/src/TextOverlayTransformation/Flip.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\TextOverlayTransformation; +namespace Imagekit\TextOverlayTransformation; /** * Flip the text overlay horizontally, vertically, or both. diff --git a/src/TextOverlayTransformation/FontSize.php b/src/TextOverlayTransformation/FontSize.php index 89f9c10f..6b32a4eb 100644 --- a/src/TextOverlayTransformation/FontSize.php +++ b/src/TextOverlayTransformation/FontSize.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\TextOverlayTransformation; +namespace Imagekit\TextOverlayTransformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the font size of the overlaid text. Accepts a numeric value or an arithmetic expression. diff --git a/src/TextOverlayTransformation/InnerAlignment.php b/src/TextOverlayTransformation/InnerAlignment.php index e38cc502..13619a50 100644 --- a/src/TextOverlayTransformation/InnerAlignment.php +++ b/src/TextOverlayTransformation/InnerAlignment.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\TextOverlayTransformation; +namespace Imagekit\TextOverlayTransformation; /** * Specifies the inner alignment of the text when width is more than the text length. diff --git a/src/TextOverlayTransformation/LineHeight.php b/src/TextOverlayTransformation/LineHeight.php index ab7bb004..f81fd5a1 100644 --- a/src/TextOverlayTransformation/LineHeight.php +++ b/src/TextOverlayTransformation/LineHeight.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\TextOverlayTransformation; +namespace Imagekit\TextOverlayTransformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the line height of the text overlay. diff --git a/src/TextOverlayTransformation/Padding.php b/src/TextOverlayTransformation/Padding.php index 442b0d40..f143972c 100644 --- a/src/TextOverlayTransformation/Padding.php +++ b/src/TextOverlayTransformation/Padding.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\TextOverlayTransformation; +namespace Imagekit\TextOverlayTransformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the padding around the overlaid text. diff --git a/src/TextOverlayTransformation/Radius.php b/src/TextOverlayTransformation/Radius.php index 9998abf7..578f9926 100644 --- a/src/TextOverlayTransformation/Radius.php +++ b/src/TextOverlayTransformation/Radius.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\TextOverlayTransformation; +namespace Imagekit\TextOverlayTransformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the corner radius of the text overlay. diff --git a/src/TextOverlayTransformation/Rotation.php b/src/TextOverlayTransformation/Rotation.php index 1952ed67..5e5be3c5 100644 --- a/src/TextOverlayTransformation/Rotation.php +++ b/src/TextOverlayTransformation/Rotation.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\TextOverlayTransformation; +namespace Imagekit\TextOverlayTransformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the rotation angle of the text overlay. diff --git a/src/TextOverlayTransformation/Width.php b/src/TextOverlayTransformation/Width.php index f1ae1eb5..d136c091 100644 --- a/src/TextOverlayTransformation/Width.php +++ b/src/TextOverlayTransformation/Width.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\TextOverlayTransformation; +namespace Imagekit\TextOverlayTransformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the maximum width (in pixels) of the overlaid text. The text wraps automatically, and arithmetic expressions (e.g., `bw_mul_0.2` or `bh_div_2`) are supported. Useful when used in conjunction with the `background`. diff --git a/src/Transformation.php b/src/Transformation.php index aec21b27..11744fcf 100644 --- a/src/Transformation.php +++ b/src/Transformation.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace ImageKit; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Transformation\AudioCodec; -use ImageKit\Transformation\Crop; -use ImageKit\Transformation\CropMode; -use ImageKit\Transformation\Flip; -use ImageKit\Transformation\Format; -use ImageKit\Transformation\VideoCodec; +namespace Imagekit; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Transformation\AudioCodec; +use Imagekit\Transformation\Crop; +use Imagekit\Transformation\CropMode; +use Imagekit\Transformation\Flip; +use Imagekit\Transformation\Format; +use Imagekit\Transformation\VideoCodec; /** * The SDK provides easy-to-use names for transformations. These names are converted to the corresponding transformation string before being added to the URL. diff --git a/src/Transformation/AIDropShadow.php b/src/Transformation/AIDropShadow.php index 2c1914fa..1b20141c 100644 --- a/src/Transformation/AIDropShadow.php +++ b/src/Transformation/AIDropShadow.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Adds an AI-based drop shadow around a foreground object on a transparent or removed background. diff --git a/src/Transformation/AspectRatio.php b/src/Transformation/AspectRatio.php index 391cd233..13a4f470 100644 --- a/src/Transformation/AspectRatio.php +++ b/src/Transformation/AspectRatio.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the aspect ratio for the output, e.g., "ar-4-3". Typically used with either width or height (but not both). diff --git a/src/Transformation/AudioCodec.php b/src/Transformation/AudioCodec.php index e50f6a34..c42357a9 100644 --- a/src/Transformation/AudioCodec.php +++ b/src/Transformation/AudioCodec.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; /** * Specifies the audio codec, e.g., `aac`, `opus`, or `none`. See [Audio codec](https://imagekit.io/docs/video-optimization#audio-codec---ac). diff --git a/src/Transformation/Crop.php b/src/Transformation/Crop.php index 7a18ea8b..191b0b0e 100644 --- a/src/Transformation/Crop.php +++ b/src/Transformation/Crop.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; /** * Crop modes for image resizing. See [Crop modes & focus](https://imagekit.io/docs/image-resize-and-crop#crop-crop-modes--focus). diff --git a/src/Transformation/CropMode.php b/src/Transformation/CropMode.php index e50c44b6..43d49024 100644 --- a/src/Transformation/CropMode.php +++ b/src/Transformation/CropMode.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; /** * Additional crop modes for image resizing. See [Crop modes & focus](https://imagekit.io/docs/image-resize-and-crop#crop-crop-modes--focus). diff --git a/src/Transformation/Duration.php b/src/Transformation/Duration.php index 766a9cc5..ed767f9b 100644 --- a/src/Transformation/Duration.php +++ b/src/Transformation/Duration.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the duration (in seconds) for trimming videos, e.g., `5` or `10.5`. diff --git a/src/Transformation/EndOffset.php b/src/Transformation/EndOffset.php index 9166d410..7f5be4ee 100644 --- a/src/Transformation/EndOffset.php +++ b/src/Transformation/EndOffset.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the end offset (in seconds) for trimming videos, e.g., `5` or `10.5`. diff --git a/src/Transformation/Flip.php b/src/Transformation/Flip.php index cf787781..f4d9aab7 100644 --- a/src/Transformation/Flip.php +++ b/src/Transformation/Flip.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; /** * Flips or mirrors an image either horizontally, vertically, or both. diff --git a/src/Transformation/Format.php b/src/Transformation/Format.php index ba9c998f..7bea47a2 100644 --- a/src/Transformation/Format.php +++ b/src/Transformation/Format.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; /** * Specifies the output format for images or videos, e.g., `jpg`, `png`, `webp`, `mp4`, or `auto`. diff --git a/src/Transformation/Gradient.php b/src/Transformation/Gradient.php index 94553f22..96e5db30 100644 --- a/src/Transformation/Gradient.php +++ b/src/Transformation/Gradient.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. diff --git a/src/Transformation/Height.php b/src/Transformation/Height.php index deb84fdd..e7db6d38 100644 --- a/src/Transformation/Height.php +++ b/src/Transformation/Height.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the height of the output. If a value between 0 and 1 is provided, it is treated as a percentage (e.g., `0.5` represents 50% of the original height). diff --git a/src/Transformation/Page.php b/src/Transformation/Page.php index 3fab3519..4023b17a 100644 --- a/src/Transformation/Page.php +++ b/src/Transformation/Page.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Extracts a specific page or frame from multi-page or layered files (PDF, PSD, AI). diff --git a/src/Transformation/Radius.php b/src/Transformation/Radius.php index 84778e6c..06c91982 100644 --- a/src/Transformation/Radius.php +++ b/src/Transformation/Radius.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the corner radius for rounded corners (e.g., 20) or `max` for circular or oval shape. diff --git a/src/Transformation/Rotation.php b/src/Transformation/Rotation.php index 41d73028..4e155cca 100644 --- a/src/Transformation/Rotation.php +++ b/src/Transformation/Rotation.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the rotation angle in degrees. Positive values rotate the image clockwise; you can also use, for example, `N40` for counterclockwise rotation diff --git a/src/Transformation/Shadow.php b/src/Transformation/Shadow.php index 0b85700f..d157dc6f 100644 --- a/src/Transformation/Shadow.php +++ b/src/Transformation/Shadow.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Adds a shadow beneath solid objects in an image with a transparent background. diff --git a/src/Transformation/Sharpen.php b/src/Transformation/Sharpen.php index aec64aaa..77f6f6cb 100644 --- a/src/Transformation/Sharpen.php +++ b/src/Transformation/Sharpen.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Sharpens the input image, highlighting edges and finer details. diff --git a/src/Transformation/StartOffset.php b/src/Transformation/StartOffset.php index 9a1a0008..0e783675 100644 --- a/src/Transformation/StartOffset.php +++ b/src/Transformation/StartOffset.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the start offset (in seconds) for trimming videos, e.g., `5` or `10.5`. diff --git a/src/Transformation/Trim.php b/src/Transformation/Trim.php index 9a480191..cecd55bc 100644 --- a/src/Transformation/Trim.php +++ b/src/Transformation/Trim.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Useful for images with a solid or nearly solid background and a central object. This parameter trims the background, diff --git a/src/Transformation/UnsharpMask.php b/src/Transformation/UnsharpMask.php index c634a462..f16b146d 100644 --- a/src/Transformation/UnsharpMask.php +++ b/src/Transformation/UnsharpMask.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Applies Unsharp Masking (USM), an image sharpening technique. diff --git a/src/Transformation/VideoCodec.php b/src/Transformation/VideoCodec.php index 787a91fc..dc7fa510 100644 --- a/src/Transformation/VideoCodec.php +++ b/src/Transformation/VideoCodec.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; /** * Specifies the video codec, e.g., `h264`, `vp9`, `av1`, or `none`. See [Video codec](https://imagekit.io/docs/video-optimization#video-codec---vc). diff --git a/src/Transformation/Width.php b/src/Transformation/Width.php index ff4c9e61..93022610 100644 --- a/src/Transformation/Width.php +++ b/src/Transformation/Width.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the width of the output. If a value between 0 and 1 is provided, it is treated as a percentage (e.g., `0.4` represents 40% of the original width). diff --git a/src/Transformation/X.php b/src/Transformation/X.php index d8af8a92..23561502 100644 --- a/src/Transformation/X.php +++ b/src/Transformation/X.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Focus using cropped image coordinates - X coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). diff --git a/src/Transformation/XCenter.php b/src/Transformation/XCenter.php index e49a6b00..d53728aa 100644 --- a/src/Transformation/XCenter.php +++ b/src/Transformation/XCenter.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Focus using cropped image coordinates - X center coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). diff --git a/src/Transformation/Y.php b/src/Transformation/Y.php index b1da82b8..6b27d281 100644 --- a/src/Transformation/Y.php +++ b/src/Transformation/Y.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Focus using cropped image coordinates - Y coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). diff --git a/src/Transformation/YCenter.php b/src/Transformation/YCenter.php index 601ca9d5..b91641e4 100644 --- a/src/Transformation/YCenter.php +++ b/src/Transformation/YCenter.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Transformation; +namespace Imagekit\Transformation; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Focus using cropped image coordinates - Y center coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). diff --git a/src/TransformationPosition.php b/src/TransformationPosition.php index 8e3ee23f..6935eca7 100644 --- a/src/TransformationPosition.php +++ b/src/TransformationPosition.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit; +namespace Imagekit; /** * By default, the transformation string is added as a query parameter in the URL, e.g., `?tr=w-100,h-100`. diff --git a/src/VideoOverlay.php b/src/VideoOverlay.php index 03ee74e1..71b8400a 100644 --- a/src/VideoOverlay.php +++ b/src/VideoOverlay.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit; +namespace Imagekit; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\OverlayPosition\Focus; -use ImageKit\VideoOverlay\Encoding; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\OverlayPosition\Focus; +use Imagekit\VideoOverlay\Encoding; /** * @phpstan-type VideoOverlayShape = array{ diff --git a/src/VideoOverlay/Encoding.php b/src/VideoOverlay/Encoding.php index ab03972f..395722e3 100644 --- a/src/VideoOverlay/Encoding.php +++ b/src/VideoOverlay/Encoding.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\VideoOverlay; +namespace Imagekit\VideoOverlay; /** * The input path can be included in the layer as either `i-{input}` or `ie-{base64_encoded_input}`. diff --git a/src/Webhooks/BaseWebhookEvent.php b/src/Webhooks/BaseWebhookEvent.php index 43921b82..78180f98 100644 --- a/src/Webhooks/BaseWebhookEvent.php +++ b/src/Webhooks/BaseWebhookEvent.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Webhooks; +namespace Imagekit\Webhooks; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type BaseWebhookEventShape = array{id: string, type: string} diff --git a/src/Webhooks/UnsafeUnwrapWebhookEvent.php b/src/Webhooks/UnsafeUnwrapWebhookEvent.php index 82cec1af..55621f75 100644 --- a/src/Webhooks/UnsafeUnwrapWebhookEvent.php +++ b/src/Webhooks/UnsafeUnwrapWebhookEvent.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Webhooks; +namespace Imagekit\Webhooks; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Triggered when a new video transformation request is accepted for processing. This event confirms that ImageKit has received and queued your transformation request. Use this for debugging and tracking transformation lifecycle. diff --git a/src/Webhooks/UnwrapWebhookEvent.php b/src/Webhooks/UnwrapWebhookEvent.php index 4c0cc422..5801696f 100644 --- a/src/Webhooks/UnwrapWebhookEvent.php +++ b/src/Webhooks/UnwrapWebhookEvent.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Webhooks; +namespace Imagekit\Webhooks; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Triggered when a new video transformation request is accepted for processing. This event confirms that ImageKit has received and queued your transformation request. Use this for debugging and tracking transformation lifecycle. diff --git a/src/Webhooks/UploadPostTransformErrorEvent.php b/src/Webhooks/UploadPostTransformErrorEvent.php index cc3503dd..7f368380 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent.php +++ b/src/Webhooks/UploadPostTransformErrorEvent.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace ImageKit\Webhooks; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\UploadPostTransformErrorEvent\Data; -use ImageKit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation; -use ImageKit\Webhooks\UploadPostTransformErrorEvent\Request; +namespace Imagekit\Webhooks; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\UploadPostTransformErrorEvent\Data; +use Imagekit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation; +use Imagekit\Webhooks\UploadPostTransformErrorEvent\Request; /** * Triggered when a post-transformation fails. The original file remains available, but the requested transformation could not be generated. diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data.php b/src/Webhooks/UploadPostTransformErrorEvent/Data.php index c39f11d7..ecf7044c 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Data.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPostTransformErrorEvent; +namespace Imagekit\Webhooks\UploadPostTransformErrorEvent; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation; -use ImageKit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation\Error; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation; +use Imagekit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation\Error; /** * @phpstan-type DataShape = array{ diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php index c1925b42..c14dac4f 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPostTransformErrorEvent\Data; +namespace Imagekit\Webhooks\UploadPostTransformErrorEvent\Data; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation\Error; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation\Error; /** * @phpstan-type TransformationShape = array{error: Error} diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php index e628b2db..dcbfe866 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation; +namespace Imagekit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type ErrorShape = array{reason: string} diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request.php b/src/Webhooks/UploadPostTransformErrorEvent/Request.php index 387cf479..409ad8ab 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPostTransformErrorEvent; +namespace Imagekit\Webhooks\UploadPostTransformErrorEvent; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation; -use ImageKit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation\Protocol; -use ImageKit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation\Type; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation; +use Imagekit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation\Protocol; +use Imagekit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation\Type; /** * @phpstan-type RequestShape = array{ diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php index f4852e88..5ace66c4 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPostTransformErrorEvent\Request; +namespace Imagekit\Webhooks\UploadPostTransformErrorEvent\Request; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation\Protocol; -use ImageKit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation\Type; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation\Protocol; +use Imagekit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation\Type; /** * @phpstan-type TransformationShape = array{ diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Protocol.php b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Protocol.php index f6f399cc..273e2a8a 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Protocol.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Protocol.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation; +namespace Imagekit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation; /** * Only applicable if transformation type is 'abs'. Streaming protocol used. diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Type.php b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Type.php index 5a9dbbf8..e2c2cb78 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Type.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation; +namespace Imagekit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation; /** * Type of the requested post-transformation. diff --git a/src/Webhooks/UploadPostTransformSuccessEvent.php b/src/Webhooks/UploadPostTransformSuccessEvent.php index f6f4deeb..7ba1e45b 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace ImageKit\Webhooks; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\UploadPostTransformSuccessEvent\Data; -use ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request; -use ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation; +namespace Imagekit\Webhooks; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\UploadPostTransformSuccessEvent\Data; +use Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request; +use Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation; /** * Triggered when a post-transformation completes successfully. The transformed version of the file is now ready and can be accessed via the provided URL. Note that each post-transformation generates a separate webhook event. diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Data.php b/src/Webhooks/UploadPostTransformSuccessEvent/Data.php index b3ba5cb6..d8898050 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Data.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Data.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPostTransformSuccessEvent; +namespace Imagekit\Webhooks\UploadPostTransformSuccessEvent; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type DataShape = array{fileId: string, name: string, url: string} diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request.php index bcfa762e..f661e9fc 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPostTransformSuccessEvent; +namespace Imagekit\Webhooks\UploadPostTransformSuccessEvent; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation; -use ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation\Protocol; -use ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation\Type; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation; +use Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation\Protocol; +use Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation\Type; /** * @phpstan-type RequestShape = array{ diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php index b71282f2..238316a5 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request; +namespace Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation\Protocol; -use ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation\Type; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation\Protocol; +use Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation\Type; /** * @phpstan-type TransformationShape = array{ diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Protocol.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Protocol.php index e9a8d491..c7aebb30 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Protocol.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Protocol.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation; +namespace Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation; /** * Only applicable if transformation type is 'abs'. Streaming protocol used. diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Type.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Type.php index 9b9fa624..c565a96d 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Type.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation; +namespace Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation; /** * Type of the requested post-transformation. diff --git a/src/Webhooks/UploadPreTransformErrorEvent.php b/src/Webhooks/UploadPreTransformErrorEvent.php index 8ba413a9..606d438e 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent.php +++ b/src/Webhooks/UploadPreTransformErrorEvent.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace ImageKit\Webhooks; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\UploadPreTransformErrorEvent\Data; -use ImageKit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation; -use ImageKit\Webhooks\UploadPreTransformErrorEvent\Request; +namespace Imagekit\Webhooks; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\UploadPreTransformErrorEvent\Data; +use Imagekit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation; +use Imagekit\Webhooks\UploadPreTransformErrorEvent\Request; /** * Triggered when a pre-transformation fails. The file upload may have been accepted, but the requested transformation could not be applied. diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data.php b/src/Webhooks/UploadPreTransformErrorEvent/Data.php index 52ef6fda..e017bcb5 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Data.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPreTransformErrorEvent; +namespace Imagekit\Webhooks\UploadPreTransformErrorEvent; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation; -use ImageKit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation\Error; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation; +use Imagekit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation\Error; /** * @phpstan-type DataShape = array{ diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php index c4dd55bc..93dad3f1 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPreTransformErrorEvent\Data; +namespace Imagekit\Webhooks\UploadPreTransformErrorEvent\Data; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation\Error; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation\Error; /** * @phpstan-type TransformationShape = array{error: Error} diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php index 4083d249..8f53f3f5 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation; +namespace Imagekit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type ErrorShape = array{reason: string} diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Request.php b/src/Webhooks/UploadPreTransformErrorEvent/Request.php index 4a482ebc..316ddf2a 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Request.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Request.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPreTransformErrorEvent; +namespace Imagekit\Webhooks\UploadPreTransformErrorEvent; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type RequestShape = array{transformation: string, x_request_id: string} diff --git a/src/Webhooks/UploadPreTransformSuccessEvent.php b/src/Webhooks/UploadPreTransformSuccessEvent.php index e514a6cf..fdaf18a5 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace ImageKit\Webhooks; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Files\Metadata; -use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data; -use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\AITag; -use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; -use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; -use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\VersionInfo; -use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Request; +namespace Imagekit\Webhooks; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Files\Metadata; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\AITag; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\VersionInfo; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Request; /** * Triggered when a pre-transformation completes successfully. The file has been processed with the requested transformation and is now available in the Media Library. diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php index 0de318a4..d22efaa5 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Files\Metadata; -use ImageKit\Files\Metadata\Exif; -use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\AITag; -use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; -use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\AIAutoDescription; -use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\AwsAutoTagging; -use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\GoogleAutoTagging; -use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\RemoveBg; -use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; -use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\Type; -use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\VersionInfo; +namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Files\Metadata; +use Imagekit\Files\Metadata\Exif; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\AITag; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\AIAutoDescription; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\AwsAutoTagging; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\GoogleAutoTagging; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\RemoveBg; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\Type; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\VersionInfo; /** * Object containing details of a successful upload. diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php index 0b10fa67..044f7f9e 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data; +namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type AITagShape = array{ diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php index ce98cf73..61d4bafc 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\AIAutoDescription; -use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\AwsAutoTagging; -use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\GoogleAutoTagging; -use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\RemoveBg; +namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\AIAutoDescription; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\AwsAutoTagging; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\GoogleAutoTagging; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\RemoveBg; /** * Extension names with their processing status at the time of completion of the request. It could have one of the following status values: diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AIAutoDescription.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AIAutoDescription.php index a9cc5f07..c1b7c0fb 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AIAutoDescription.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AIAutoDescription.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; +namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; enum AIAutoDescription: string { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AwsAutoTagging.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AwsAutoTagging.php index 6ff57cec..08047f44 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AwsAutoTagging.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AwsAutoTagging.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; +namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; enum AwsAutoTagging: string { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/GoogleAutoTagging.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/GoogleAutoTagging.php index 31f9d58b..c1f24075 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/GoogleAutoTagging.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/GoogleAutoTagging.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; +namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; enum GoogleAutoTagging: string { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/RemoveBg.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/RemoveBg.php index 6e389314..ced8c0ee 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/RemoveBg.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/RemoveBg.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; +namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; enum RemoveBg: string { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php index dfd4a61b..db7f2dca 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue; -use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\SelectOption; -use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\Type; +namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\SelectOption; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\Type; /** * @phpstan-type SelectedFieldsSchemaShape = array{ diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php index faaedb79..44d79dfa 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; +namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; -use ImageKit\Core\Conversion\ListOf; -use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue\Mixed1; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Conversion\ListOf; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue\Mixed1; /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed1.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed1.php index ab030054..187b1a7f 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed1.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed1.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue; +namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; final class Mixed1 implements ConverterSource { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MaxValue.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MaxValue.php index b33f49ef..bf369aac 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MaxValue.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MaxValue.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; +namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MinValue.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MinValue.php index 4e731680..ea2af27b 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MinValue.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MinValue.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; +namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/SelectOption.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/SelectOption.php index 404f3617..3c5b4970 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/SelectOption.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/SelectOption.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; +namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; -use ImageKit\Core\Concerns\SdkUnion; -use ImageKit\Core\Conversion\Contracts\Converter; -use ImageKit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\Core\Concerns\SdkUnion; +use Imagekit\Core\Conversion\Contracts\Converter; +use Imagekit\Core\Conversion\Contracts\ConverterSource; final class SelectOption implements ConverterSource { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/Type.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/Type.php index 3f000dee..f643af4e 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/Type.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; +namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; /** * Type of the custom metadata field. diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php index ec4ddd02..b9b905d7 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data; +namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * An object containing the file or file version's `id` (versionId) and `name`. diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Request.php b/src/Webhooks/UploadPreTransformSuccessEvent/Request.php index 3b60c437..4d7453f8 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Request.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Request.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent; +namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * @phpstan-type RequestShape = array{transformation: string, x_request_id: string} diff --git a/src/Webhooks/VideoTransformationAcceptedEvent.php b/src/Webhooks/VideoTransformationAcceptedEvent.php index 3ecd1e35..7b81b146 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace ImageKit\Webhooks; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data; -use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Asset; -use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation; -use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Request; +namespace Imagekit\Webhooks; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data; +use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Asset; +use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation; +use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Request; /** * Triggered when a new video transformation request is accepted for processing. This event confirms that ImageKit has received and queued your transformation request. Use this for debugging and tracking transformation lifecycle. diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data.php index 5066ab42..eb46305e 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent; +namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Asset; -use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation; -use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; -use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Type; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Asset; +use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation; +use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; +use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Type; /** * @phpstan-type DataShape = array{asset: Asset, transformation: Transformation} diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php index 66526230..ea1cba6d 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data; +namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * Information about the source video asset being transformed. diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php index 3b5be3be..90445ab6 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data; +namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; -use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\AudioCodec; -use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\Format; -use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\StreamProtocol; -use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\VideoCodec; -use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Type; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; +use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\AudioCodec; +use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\Format; +use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\StreamProtocol; +use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\VideoCodec; +use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Type; /** * Base information about a video transformation request. diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php index 8bf1d697..678c68a0 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\AudioCodec; -use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\Format; -use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\StreamProtocol; -use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\VideoCodec; +namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\AudioCodec; +use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\Format; +use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\StreamProtocol; +use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\VideoCodec; /** * Configuration options for video transformations. diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/AudioCodec.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/AudioCodec.php index e9034932..ec4fd4b4 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/AudioCodec.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/AudioCodec.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; +namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; /** * Audio codec used for encoding (aac or opus). diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/Format.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/Format.php index 46b26e0e..5b3fe80f 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/Format.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/Format.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; +namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; /** * Output format for the transformed video or thumbnail. diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/StreamProtocol.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/StreamProtocol.php index c8b11edd..94d65a6b 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/StreamProtocol.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/StreamProtocol.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; +namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; /** * Streaming protocol for adaptive bitrate streaming. diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/VideoCodec.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/VideoCodec.php index f2afe7bf..393581e3 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/VideoCodec.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/VideoCodec.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; +namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; /** * Video codec used for encoding (h264, vp9, or av1). diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Type.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Type.php index 75f61460..209a41a3 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Type.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation; +namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation; /** * Type of video transformation: diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Request.php b/src/Webhooks/VideoTransformationAcceptedEvent/Request.php index 8e6be5ae..f666665c 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Request.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Request.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent; +namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * Information about the original request that triggered the video transformation. diff --git a/src/Webhooks/VideoTransformationErrorEvent.php b/src/Webhooks/VideoTransformationErrorEvent.php index 03a4edf3..bc3821ed 100644 --- a/src/Webhooks/VideoTransformationErrorEvent.php +++ b/src/Webhooks/VideoTransformationErrorEvent.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace ImageKit\Webhooks; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\VideoTransformationErrorEvent\Data; -use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Asset; -use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; -use ImageKit\Webhooks\VideoTransformationErrorEvent\Request; +namespace Imagekit\Webhooks; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\VideoTransformationErrorEvent\Data; +use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Asset; +use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; +use Imagekit\Webhooks\VideoTransformationErrorEvent\Request; /** * Triggered when an error occurs during video encoding. Listen to this webhook to log error reasons and debug issues. Check your origin and URL endpoint settings if the reason is related to download failure. For other errors, contact ImageKit support. diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data.php b/src/Webhooks/VideoTransformationErrorEvent/Data.php index e89f365a..907ca351 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationErrorEvent; +namespace Imagekit\Webhooks\VideoTransformationErrorEvent; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Asset; -use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; -use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error; -use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; -use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Type; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Asset; +use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; +use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error; +use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; +use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Type; /** * @phpstan-type DataShape = array{asset: Asset, transformation: Transformation} diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php index 43f99467..f087ac70 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data; +namespace Imagekit\Webhooks\VideoTransformationErrorEvent\Data; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * Information about the source video asset being transformed. diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php index 0ec41fc1..631c1eea 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error; -use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error\Reason; -use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; -use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\AudioCodec; -use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\Format; -use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\StreamProtocol; -use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\VideoCodec; -use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Type; +namespace Imagekit\Webhooks\VideoTransformationErrorEvent\Data; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error; +use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error\Reason; +use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; +use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\AudioCodec; +use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\Format; +use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\StreamProtocol; +use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\VideoCodec; +use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Type; /** * @phpstan-type TransformationShape = array{ diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php index 74fd89a3..205de51e 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; +namespace Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error\Reason; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error\Reason; /** * Details about the transformation error. diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error/Reason.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error/Reason.php index 751baa9f..17893063 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error/Reason.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error/Reason.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error; +namespace Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error; /** * Specific reason for the transformation failure: diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php index 2047a83f..79e1bdab 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\AudioCodec; -use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\Format; -use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\StreamProtocol; -use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\VideoCodec; +namespace Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\AudioCodec; +use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\Format; +use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\StreamProtocol; +use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\VideoCodec; /** * Configuration options for video transformations. diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/AudioCodec.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/AudioCodec.php index c33c2fef..bc5b53d4 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/AudioCodec.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/AudioCodec.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; +namespace Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; /** * Audio codec used for encoding (aac or opus). diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/Format.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/Format.php index c37d8135..236d4d59 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/Format.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/Format.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; +namespace Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; /** * Output format for the transformed video or thumbnail. diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/StreamProtocol.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/StreamProtocol.php index 73d64235..00471a43 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/StreamProtocol.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/StreamProtocol.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; +namespace Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; /** * Streaming protocol for adaptive bitrate streaming. diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/VideoCodec.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/VideoCodec.php index 7540a5fb..d295b710 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/VideoCodec.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/VideoCodec.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; +namespace Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; /** * Video codec used for encoding (h264, vp9, or av1). diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Type.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Type.php index 38869bb0..8a1d9454 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Type.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; +namespace Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; /** * Type of video transformation: diff --git a/src/Webhooks/VideoTransformationErrorEvent/Request.php b/src/Webhooks/VideoTransformationErrorEvent/Request.php index dbe3a181..359f524e 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Request.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Request.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationErrorEvent; +namespace Imagekit\Webhooks\VideoTransformationErrorEvent; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * Information about the original request that triggered the video transformation. diff --git a/src/Webhooks/VideoTransformationReadyEvent.php b/src/Webhooks/VideoTransformationReadyEvent.php index afe1f0e1..d42d9825 100644 --- a/src/Webhooks/VideoTransformationReadyEvent.php +++ b/src/Webhooks/VideoTransformationReadyEvent.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace ImageKit\Webhooks; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\VideoTransformationReadyEvent\Data; -use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Asset; -use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; -use ImageKit\Webhooks\VideoTransformationReadyEvent\Request; -use ImageKit\Webhooks\VideoTransformationReadyEvent\Timings; +namespace Imagekit\Webhooks; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\VideoTransformationReadyEvent\Data; +use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Asset; +use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; +use Imagekit\Webhooks\VideoTransformationReadyEvent\Request; +use Imagekit\Webhooks\VideoTransformationReadyEvent\Timings; /** * Triggered when video encoding is finished and the transformed resource is ready to be served. This is the key event to listen for - update your database or CMS flags when you receive this so your application can start showing the transformed video to users. diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data.php b/src/Webhooks/VideoTransformationReadyEvent/Data.php index 72e5f807..5dfdf0ba 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationReadyEvent; +namespace Imagekit\Webhooks\VideoTransformationReadyEvent; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Asset; -use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; -use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; -use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output; -use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Type; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Asset; +use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; +use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; +use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output; +use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Type; /** * @phpstan-type DataShape = array{asset: Asset, transformation: Transformation} diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php index 06040f20..6c6f099b 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data; +namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * Information about the source video asset being transformed. diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php index e8dfc6c9..3b19a7b1 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; -use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\AudioCodec; -use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\Format; -use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\StreamProtocol; -use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\VideoCodec; -use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output; -use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output\VideoMetadata; -use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Type; +namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; +use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\AudioCodec; +use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\Format; +use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\StreamProtocol; +use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\VideoCodec; +use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output; +use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output\VideoMetadata; +use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Type; /** * @phpstan-type TransformationShape = array{ diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php index 4b89df67..1593224f 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; - -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\AudioCodec; -use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\Format; -use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\StreamProtocol; -use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\VideoCodec; +namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; + +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\AudioCodec; +use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\Format; +use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\StreamProtocol; +use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\VideoCodec; /** * Configuration options for video transformations. diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/AudioCodec.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/AudioCodec.php index 28919565..72c07068 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/AudioCodec.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/AudioCodec.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; +namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; /** * Audio codec used for encoding (aac or opus). diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/Format.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/Format.php index 8c7dfc76..7cb4ea6b 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/Format.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/Format.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; +namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; /** * Output format for the transformed video or thumbnail. diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/StreamProtocol.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/StreamProtocol.php index 604fb5cd..f57f0497 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/StreamProtocol.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/StreamProtocol.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; +namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; /** * Streaming protocol for adaptive bitrate streaming. diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/VideoCodec.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/VideoCodec.php index f8061f64..91059365 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/VideoCodec.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/VideoCodec.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; +namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; /** * Video codec used for encoding (h264, vp9, or av1). diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php index 8707c193..7346e725 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; +namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; -use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output\VideoMetadata; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output\VideoMetadata; /** * Information about the transformed output video. diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php index cf3ddf7c..66e5770b 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output; +namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * Metadata of the output video file. diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Type.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Type.php index 0dfcbeae..b305d9b0 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Type.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; +namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; /** * Type of video transformation: diff --git a/src/Webhooks/VideoTransformationReadyEvent/Request.php b/src/Webhooks/VideoTransformationReadyEvent/Request.php index 8b981105..cf228e31 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Request.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Request.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationReadyEvent; +namespace Imagekit\Webhooks\VideoTransformationReadyEvent; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * Information about the original request that triggered the video transformation. diff --git a/src/Webhooks/VideoTransformationReadyEvent/Timings.php b/src/Webhooks/VideoTransformationReadyEvent/Timings.php index cbfe486c..34e42e92 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Timings.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Timings.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace ImageKit\Webhooks\VideoTransformationReadyEvent; +namespace Imagekit\Webhooks\VideoTransformationReadyEvent; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; /** * Performance metrics for the transformation process. diff --git a/tests/Core/TestModel.php b/tests/Core/TestModel.php index 06a5ebde..e56e4891 100644 --- a/tests/Core/TestModel.php +++ b/tests/Core/TestModel.php @@ -2,9 +2,9 @@ namespace Tests\Core; -use ImageKit\Core\Attributes\Api; -use ImageKit\Core\Concerns\SdkModel; -use ImageKit\Core\Contracts\BaseModel; +use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Concerns\SdkModel; +use Imagekit\Core\Contracts\BaseModel; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/Accounts/OriginsTest.php b/tests/Services/Accounts/OriginsTest.php index 1dec703e..5847be71 100644 --- a/tests/Services/Accounts/OriginsTest.php +++ b/tests/Services/Accounts/OriginsTest.php @@ -2,7 +2,7 @@ namespace Tests\Services\Accounts; -use ImageKit\Client; +use Imagekit\Client; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/Accounts/URLEndpointsTest.php b/tests/Services/Accounts/URLEndpointsTest.php index a93ca5b4..f17ff9b9 100644 --- a/tests/Services/Accounts/URLEndpointsTest.php +++ b/tests/Services/Accounts/URLEndpointsTest.php @@ -2,8 +2,8 @@ namespace Tests\Services\Accounts; -use ImageKit\Accounts\URLEndpoints\URLEndpointResponse; -use ImageKit\Client; +use Imagekit\Accounts\URLEndpoints\URLEndpointResponse; +use Imagekit\Client; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/Accounts/UsageTest.php b/tests/Services/Accounts/UsageTest.php index 65ac225a..40b86c56 100644 --- a/tests/Services/Accounts/UsageTest.php +++ b/tests/Services/Accounts/UsageTest.php @@ -2,8 +2,8 @@ namespace Tests\Services\Accounts; -use ImageKit\Accounts\Usage\UsageGetResponse; -use ImageKit\Client; +use Imagekit\Accounts\Usage\UsageGetResponse; +use Imagekit\Client; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/AssetsTest.php b/tests/Services/AssetsTest.php index 1411c21c..16a9970b 100644 --- a/tests/Services/AssetsTest.php +++ b/tests/Services/AssetsTest.php @@ -2,7 +2,7 @@ namespace Tests\Services; -use ImageKit\Client; +use Imagekit\Client; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/Beta/V2/FilesTest.php b/tests/Services/Beta/V2/FilesTest.php index 3fe1e7b5..e7dcf877 100644 --- a/tests/Services/Beta/V2/FilesTest.php +++ b/tests/Services/Beta/V2/FilesTest.php @@ -2,8 +2,8 @@ namespace Tests\Services\Beta\V2; -use ImageKit\Beta\V2\Files\FileUploadResponse; -use ImageKit\Client; +use Imagekit\Beta\V2\Files\FileUploadResponse; +use Imagekit\Client; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/Cache/InvalidationTest.php b/tests/Services/Cache/InvalidationTest.php index 780fa380..6ec0bbd7 100644 --- a/tests/Services/Cache/InvalidationTest.php +++ b/tests/Services/Cache/InvalidationTest.php @@ -2,9 +2,9 @@ namespace Tests\Services\Cache; -use ImageKit\Cache\Invalidation\InvalidationGetResponse; -use ImageKit\Cache\Invalidation\InvalidationNewResponse; -use ImageKit\Client; +use Imagekit\Cache\Invalidation\InvalidationGetResponse; +use Imagekit\Cache\Invalidation\InvalidationNewResponse; +use Imagekit\Client; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/CustomMetadataFieldsTest.php b/tests/Services/CustomMetadataFieldsTest.php index 6087bebc..29ac0707 100644 --- a/tests/Services/CustomMetadataFieldsTest.php +++ b/tests/Services/CustomMetadataFieldsTest.php @@ -2,9 +2,9 @@ namespace Tests\Services; -use ImageKit\Client; -use ImageKit\CustomMetadataFields\CustomMetadataField; -use ImageKit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; +use Imagekit\Client; +use Imagekit\CustomMetadataFields\CustomMetadataField; +use Imagekit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/Files/BulkTest.php b/tests/Services/Files/BulkTest.php index 4a3f369c..95e0455c 100644 --- a/tests/Services/Files/BulkTest.php +++ b/tests/Services/Files/BulkTest.php @@ -2,11 +2,11 @@ namespace Tests\Services\Files; -use ImageKit\Client; -use ImageKit\Files\Bulk\BulkAddTagsResponse; -use ImageKit\Files\Bulk\BulkDeleteResponse; -use ImageKit\Files\Bulk\BulkRemoveAITagsResponse; -use ImageKit\Files\Bulk\BulkRemoveTagsResponse; +use Imagekit\Client; +use Imagekit\Files\Bulk\BulkAddTagsResponse; +use Imagekit\Files\Bulk\BulkDeleteResponse; +use Imagekit\Files\Bulk\BulkRemoveAITagsResponse; +use Imagekit\Files\Bulk\BulkRemoveTagsResponse; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/Files/MetadataTest.php b/tests/Services/Files/MetadataTest.php index 2a9cd233..5f46d31d 100644 --- a/tests/Services/Files/MetadataTest.php +++ b/tests/Services/Files/MetadataTest.php @@ -2,8 +2,8 @@ namespace Tests\Services\Files; -use ImageKit\Client; -use ImageKit\Files\Metadata; +use Imagekit\Client; +use Imagekit\Files\Metadata; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/Files/VersionsTest.php b/tests/Services/Files/VersionsTest.php index 4cb353d6..f8ec0cc7 100644 --- a/tests/Services/Files/VersionsTest.php +++ b/tests/Services/Files/VersionsTest.php @@ -2,9 +2,9 @@ namespace Tests\Services\Files; -use ImageKit\Client; -use ImageKit\Files\File; -use ImageKit\Files\Versions\VersionDeleteResponse; +use Imagekit\Client; +use Imagekit\Files\File; +use Imagekit\Files\Versions\VersionDeleteResponse; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index 557324d3..a6f960b8 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -2,13 +2,13 @@ namespace Tests\Services; -use ImageKit\Client; -use ImageKit\Files\File; -use ImageKit\Files\FileCopyResponse; -use ImageKit\Files\FileMoveResponse; -use ImageKit\Files\FileRenameResponse; -use ImageKit\Files\FileUpdateResponse; -use ImageKit\Files\FileUploadResponse; +use Imagekit\Client; +use Imagekit\Files\File; +use Imagekit\Files\FileCopyResponse; +use Imagekit\Files\FileMoveResponse; +use Imagekit\Files\FileRenameResponse; +use Imagekit\Files\FileUpdateResponse; +use Imagekit\Files\FileUploadResponse; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/Folders/JobTest.php b/tests/Services/Folders/JobTest.php index 08813d08..99acdc36 100644 --- a/tests/Services/Folders/JobTest.php +++ b/tests/Services/Folders/JobTest.php @@ -2,8 +2,8 @@ namespace Tests\Services\Folders; -use ImageKit\Client; -use ImageKit\Folders\Job\JobGetResponse; +use Imagekit\Client; +use Imagekit\Folders\Job\JobGetResponse; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/FoldersTest.php b/tests/Services/FoldersTest.php index 108b1730..3430bc72 100644 --- a/tests/Services/FoldersTest.php +++ b/tests/Services/FoldersTest.php @@ -2,12 +2,12 @@ namespace Tests\Services; -use ImageKit\Client; -use ImageKit\Folders\FolderCopyResponse; -use ImageKit\Folders\FolderDeleteResponse; -use ImageKit\Folders\FolderMoveResponse; -use ImageKit\Folders\FolderNewResponse; -use ImageKit\Folders\FolderRenameResponse; +use Imagekit\Client; +use Imagekit\Folders\FolderCopyResponse; +use Imagekit\Folders\FolderDeleteResponse; +use Imagekit\Folders\FolderMoveResponse; +use Imagekit\Folders\FolderNewResponse; +use Imagekit\Folders\FolderRenameResponse; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/WebhooksTest.php b/tests/Services/WebhooksTest.php index 737a8602..6a10e26d 100644 --- a/tests/Services/WebhooksTest.php +++ b/tests/Services/WebhooksTest.php @@ -2,7 +2,7 @@ namespace Tests\Services; -use ImageKit\Client; +use Imagekit\Client; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\TestCase; From daef0aff258757ab6830a8370bb2d5dac8fc1575 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 8 Dec 2025 12:32:10 +0000 Subject: [PATCH 085/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 8577a4cc..6dfdc12a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-9d184cb502ab32a85db2889c796cdfebe812f2a55a604df79c85dd4b5e7e2add.yml openapi_spec_hash: a9aa620376fce66532c84f9364209b0b -config_hash: 10b48f323ed534664483af1952174d52 +config_hash: fd112bd17c0c8e9f81a50d0e15ea70d6 From f7102f9b0eb254f51e210ee9a5106cdbff98b3a6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 8 Dec 2025 21:02:51 +0000 Subject: [PATCH 086/193] feat: add `BaseResponse` class for accessing raw responses --- .../URLEndpoints/URLEndpointResponse.php | 6 +- src/Accounts/Usage/UsageGetResponse.php | 6 +- src/Beta/V2/Files/FileUploadResponse.php | 6 +- .../Invalidation/InvalidationGetResponse.php | 6 +- .../Invalidation/InvalidationNewResponse.php | 6 +- src/Core/BaseClient.php | 37 ++----- src/Core/Concerns/ResponseProxy.php | 101 ++++++++++++++++++ src/Core/Concerns/SdkPage.php | 16 ++- src/Core/Concerns/SdkResponse.php | 29 ----- src/Core/Contracts/BasePage.php | 19 ---- src/Core/Contracts/BaseResponse.php | 21 ++++ src/Core/Contracts/BaseStream.php | 1 + src/Core/Conversion.php | 11 -- .../Contracts/ResponseConverter.php | 18 ---- src/Core/Implementation/RawResponse.php | 100 +++++++++++++++++ .../CustomMetadataField.php | 6 +- .../CustomMetadataFieldDeleteResponse.php | 6 +- src/Files/Bulk/BulkAddTagsResponse.php | 6 +- src/Files/Bulk/BulkDeleteResponse.php | 6 +- src/Files/Bulk/BulkRemoveAITagsResponse.php | 6 +- src/Files/Bulk/BulkRemoveTagsResponse.php | 6 +- src/Files/File.php | 6 +- src/Files/FileCopyResponse.php | 6 +- src/Files/FileMoveResponse.php | 6 +- src/Files/FileRenameResponse.php | 6 +- src/Files/FileUpdateResponse.php | 6 +- src/Files/FileUploadResponse.php | 6 +- src/Files/Versions/VersionDeleteResponse.php | 6 +- src/Folders/FolderCopyResponse.php | 6 +- src/Folders/FolderDeleteResponse.php | 6 +- src/Folders/FolderMoveResponse.php | 6 +- src/Folders/FolderNewResponse.php | 6 +- src/Folders/FolderRenameResponse.php | 6 +- src/Folders/Job/JobGetResponse.php | 6 +- src/Services/Accounts/OriginsService.php | 31 ++++-- src/Services/Accounts/URLEndpointsService.php | 31 ++++-- src/Services/Accounts/UsageService.php | 7 +- src/Services/AssetsService.php | 7 +- src/Services/Beta/V2/FilesService.php | 7 +- src/Services/Cache/InvalidationService.php | 13 ++- src/Services/CustomMetadataFieldsService.php | 25 +++-- src/Services/Files/BulkService.php | 25 +++-- src/Services/Files/MetadataService.php | 13 ++- src/Services/Files/VersionsService.php | 25 +++-- src/Services/FilesService.php | 43 +++++--- src/Services/Folders/JobService.php | 7 +- src/Services/FoldersService.php | 31 ++++-- 47 files changed, 444 insertions(+), 318 deletions(-) create mode 100644 src/Core/Concerns/ResponseProxy.php delete mode 100644 src/Core/Concerns/SdkResponse.php create mode 100644 src/Core/Contracts/BaseResponse.php delete mode 100644 src/Core/Conversion/Contracts/ResponseConverter.php create mode 100644 src/Core/Implementation/RawResponse.php diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse.php b/src/Accounts/URLEndpoints/URLEndpointResponse.php index 6f3a8ea6..3282b7a0 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse.php @@ -10,9 +10,7 @@ use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\Imgix; use Imagekit\Core\Attributes\Api; use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkResponse; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * URL‑endpoint object as returned by the API. @@ -25,13 +23,11 @@ * urlRewriter?: null|Cloudinary|Imgix|Akamai, * } */ -final class URLEndpointResponse implements BaseModel, ResponseConverter +final class URLEndpointResponse implements BaseModel { /** @use SdkModel */ use SdkModel; - use SdkResponse; - /** * Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. */ diff --git a/src/Accounts/Usage/UsageGetResponse.php b/src/Accounts/Usage/UsageGetResponse.php index b9b24b8e..ebdcc228 100644 --- a/src/Accounts/Usage/UsageGetResponse.php +++ b/src/Accounts/Usage/UsageGetResponse.php @@ -6,9 +6,7 @@ use Imagekit\Core\Attributes\Api; use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkResponse; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type UsageGetResponseShape = array{ @@ -19,13 +17,11 @@ * videoProcessingUnitsCount?: int|null, * } */ -final class UsageGetResponse implements BaseModel, ResponseConverter +final class UsageGetResponse implements BaseModel { /** @use SdkModel */ use SdkModel; - use SdkResponse; - /** * Amount of bandwidth used in bytes. */ diff --git a/src/Beta/V2/Files/FileUploadResponse.php b/src/Beta/V2/Files/FileUploadResponse.php index 533a12a4..cdf8c728 100644 --- a/src/Beta/V2/Files/FileUploadResponse.php +++ b/src/Beta/V2/Files/FileUploadResponse.php @@ -15,9 +15,7 @@ use Imagekit\Beta\V2\Files\FileUploadResponse\VersionInfo; use Imagekit\Core\Attributes\Api; use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkResponse; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion\Contracts\ResponseConverter; use Imagekit\Files\Metadata; use Imagekit\Files\Metadata\Exif; @@ -52,13 +50,11 @@ * width?: float|null, * } */ -final class FileUploadResponse implements BaseModel, ResponseConverter +final class FileUploadResponse implements BaseModel { /** @use SdkModel */ use SdkModel; - use SdkResponse; - /** * An array of tags assigned to the uploaded file by auto tagging. * diff --git a/src/Cache/Invalidation/InvalidationGetResponse.php b/src/Cache/Invalidation/InvalidationGetResponse.php index 1f7806f3..c4ce3db9 100644 --- a/src/Cache/Invalidation/InvalidationGetResponse.php +++ b/src/Cache/Invalidation/InvalidationGetResponse.php @@ -7,22 +7,18 @@ use Imagekit\Cache\Invalidation\InvalidationGetResponse\Status; use Imagekit\Core\Attributes\Api; use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkResponse; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type InvalidationGetResponseShape = array{ * status?: value-of|null * } */ -final class InvalidationGetResponse implements BaseModel, ResponseConverter +final class InvalidationGetResponse implements BaseModel { /** @use SdkModel */ use SdkModel; - use SdkResponse; - /** * Status of the purge request. * diff --git a/src/Cache/Invalidation/InvalidationNewResponse.php b/src/Cache/Invalidation/InvalidationNewResponse.php index 9a52ff42..bc6a14c5 100644 --- a/src/Cache/Invalidation/InvalidationNewResponse.php +++ b/src/Cache/Invalidation/InvalidationNewResponse.php @@ -6,20 +6,16 @@ use Imagekit\Core\Attributes\Api; use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkResponse; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type InvalidationNewResponseShape = array{requestId?: string|null} */ -final class InvalidationNewResponse implements BaseModel, ResponseConverter +final class InvalidationNewResponse implements BaseModel { /** @use SdkModel */ use SdkModel; - use SdkResponse; - /** * Unique identifier of the purge request. This can be used to check the status of the purge request. */ diff --git a/src/Core/BaseClient.php b/src/Core/BaseClient.php index 8b5a2ea2..c8258eee 100644 --- a/src/Core/BaseClient.php +++ b/src/Core/BaseClient.php @@ -5,11 +5,13 @@ namespace Imagekit\Core; use Imagekit\Core\Contracts\BasePage; +use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Contracts\BaseStream; use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; use Imagekit\Core\Exceptions\APIConnectionException; use Imagekit\Core\Exceptions\APIStatusException; +use Imagekit\Core\Implementation\RawResponse; use Imagekit\RequestOptions; use Psr\Http\Client\ClientExceptionInterface; use Psr\Http\Client\ClientInterface; @@ -51,9 +53,11 @@ public function __construct( * @param string|list $path * @param array $query * @param array $headers - * @param class-string> $page - * @param class-string> $stream + * @param class-string>|null $page + * @param class-string>|null $stream * @param RequestOptions|array|null $options + * + * @return BaseResponse */ public function request( string $method, @@ -65,7 +69,7 @@ public function request( ?string $page = null, ?string $stream = null, RequestOptions|array|null $options = [], - ): mixed { + ): BaseResponse { // @phpstan-ignore-next-line [$req, $opts] = $this->buildRequest(method: $method, path: $path, query: $query, headers: $headers, body: $body, opts: $options); ['method' => $method, 'path' => $uri, 'headers' => $headers] = $req; @@ -74,32 +78,11 @@ public function request( $request = $opts->requestFactory->createRequest($method, uri: $uri); $request = Util::withSetHeaders($request, headers: $headers); - // @phpstan-ignore-next-line + // @phpstan-ignore-next-line argument.type $rsp = $this->sendRequest($opts, req: $request, data: $body, redirectCount: 0, retryCount: 0); - if (!is_null($stream)) { - return new $stream( - convert: $convert, - request: $request, - response: $rsp - ); - } - - if (!is_null($page)) { - return new $page( - convert: $convert, - client: $this, - request: $req, - response: $rsp, - options: $opts, - ); - } - - if (!is_null($convert)) { - return Conversion::coerceResponse($convert, response: $rsp); - } - - return Util::decodeContent($rsp); + // @phpstan-ignore-next-line argument.type + return new RawResponse(client: $this, request: $request, response: $rsp, options: $opts, requestInfo: $req, stream: $stream, page: $page, convert: $convert ?? 'null'); } /** @return array */ diff --git a/src/Core/Concerns/ResponseProxy.php b/src/Core/Concerns/ResponseProxy.php new file mode 100644 index 00000000..cd8daa58 --- /dev/null +++ b/src/Core/Concerns/ResponseProxy.php @@ -0,0 +1,101 @@ +response->getProtocolVersion(); + } + + public function withProtocolVersion(string $version): static + { + $self = clone $this; + $self->response = $this->response->withProtocolVersion($version); + + return $self; + } + + public function getHeaders(): array + { + return $this->response->getHeaders(); + } + + public function hasHeader(string $name): bool + { + return $this->response->hasHeader($name); + } + + public function getHeader(string $name): array + { + return $this->response->getHeader($name); + } + + public function getHeaderLine(string $name): string + { + return $this->response->getHeaderLine($name); + } + + public function withHeader(string $name, $value): static + { + $self = clone $this; + $self->response = $this->response->withHeader($name, value: $value); + + return $self; + } + + public function withAddedHeader(string $name, $value): static + { + $self = clone $this; + $self->response = $this->response->withAddedHeader($name, value: $value); + + return $self; + } + + public function withoutHeader(string $name): static + { + $self = clone $this; + $self->response = $this->response->withoutHeader($name); + + return $self; + } + + public function getBody(): StreamInterface + { + return $this->response->getBody(); + } + + public function withBody(StreamInterface $body): static + { + $self = clone $this; + $self->response = $this->response->withBody($body); + + return $self; + } + + public function getStatusCode(): int + { + return $this->response->getStatusCode(); + } + + public function withStatus(int $code, string $reasonPhrase = ''): static + { + $self = clone $this; + $self->response = $this->response->withstatus($code, reasonPhrase: $reasonPhrase); + + return $self; + } + + public function getReasonPhrase(): string + { + return $this->response->getReasonPhrase(); + } +} diff --git a/src/Core/Concerns/SdkPage.php b/src/Core/Concerns/SdkPage.php index 954ab7e9..d6886618 100644 --- a/src/Core/Concerns/SdkPage.php +++ b/src/Core/Concerns/SdkPage.php @@ -5,6 +5,7 @@ namespace Imagekit\Core\Concerns; use Imagekit\Client; +use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; use Imagekit\Core\Exceptions\APIStatusException; @@ -14,8 +15,6 @@ * @internal * * @template Item - * - * @phpstan-import-type normalized_request from \Imagekit\Core\BaseClient */ trait SdkPage { @@ -23,13 +22,6 @@ trait SdkPage private Client $client; - /** - * normalized_request $request. - */ - private array $request; - - private RequestOptions $options; - /** * @return list */ @@ -61,7 +53,11 @@ public function getNextPage(): static [$req, $opts] = $next; // @phpstan-ignore-next-line argument.type - return $this->client->request(...$req, convert: $this->convert, page: $this::class, options: $opts); + /** @var BaseResponse */ + $response = $this->client->request(...$req, convert: $this->convert, page: $this::class, options: $opts); + + // @phpstan-ignore-next-line return.type + return $response->parse(); } /** diff --git a/src/Core/Concerns/SdkResponse.php b/src/Core/Concerns/SdkResponse.php deleted file mode 100644 index ddc05f1f..00000000 --- a/src/Core/Concerns/SdkResponse.php +++ /dev/null @@ -1,29 +0,0 @@ -_rawResponse = $response; - $instance->__unserialize(Util::decodeContent($response)); // @phpstan-ignore-line - - return $instance; - } - - public function getRawResponse(): ?ResponseInterface - { - return $this->_rawResponse; - } -} diff --git a/src/Core/Contracts/BasePage.php b/src/Core/Contracts/BasePage.php index a59de609..76ad6fb2 100644 --- a/src/Core/Contracts/BasePage.php +++ b/src/Core/Contracts/BasePage.php @@ -4,12 +4,6 @@ namespace Imagekit\Core\Contracts; -use Imagekit\Client; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\RequestOptions; -use Psr\Http\Message\ResponseInterface; - /** * @internal * @@ -21,19 +15,6 @@ */ interface BasePage extends \IteratorAggregate { - /** - * @internal - * - * @param normalized_request $request - */ - public function __construct( - Converter|ConverterSource|string $convert, - Client $client, - array $request, - RequestOptions $options, - ResponseInterface $response, - ); - public function hasNextPage(): bool; /** diff --git a/src/Core/Contracts/BaseResponse.php b/src/Core/Contracts/BaseResponse.php new file mode 100644 index 00000000..e6f682e4 --- /dev/null +++ b/src/Core/Contracts/BaseResponse.php @@ -0,0 +1,21 @@ + + * + * @phpstan-import-type normalized_request from \Imagekit\Core\BaseClient + */ +class RawResponse implements BaseResponse +{ + use ResponseProxy; + + private mixed $decodedBody; + + /** @var R */ + private mixed $coercedResponse; + + private bool $decoded = false; + private bool $coerced = false; + + /** + * @param normalized_request $requestInfo + */ + public function __construct( + private Client $client, + private RequestOptions $options, + private RequestInterface $request, + private ResponseInterface $response, + private array $requestInfo, + private Converter|ConverterSource|string $convert, + private ?string $page, + private ?string $stream, + ) {} + + public function getRequest(): RequestInterface + { + return $this->request; + } + + public function parse(): mixed + { + if (!$this->coerced) { + if (!is_null($this->stream)) { + // @phpstan-ignore-next-line assign.propertyType + $this->coercedResponse = new $this->stream( + convert: $this->convert, + request: $this->request, + response: $this->response, + parsedBody: $this->getDecoded(), + ); + } elseif (!is_null($this->page)) { + // @phpstan-ignore-next-line assign.propertyType + $this->coercedResponse = new $this->page( + convert: $this->convert, + client: $this->client, + requestInfo: $this->requestInfo, + options: $this->options, + response: $this->response, + parsedBody: $this->getDecoded(), + ); + } else { + // @phpstan-ignore-next-line assign.propertyType + $this->coercedResponse = Conversion::coerce( + $this->convert, + value: $this->getDecoded(), + ); + } + + $this->coerced = true; + } + + return $this->coercedResponse; + } + + private function getDecoded(): mixed + { + if (!$this->decoded) { + $this->decodedBody = Util::decodeContent($this->response); + $this->decoded = true; + } + + return $this->decodedBody; + } +} diff --git a/src/CustomMetadataFields/CustomMetadataField.php b/src/CustomMetadataFields/CustomMetadataField.php index f39de66e..c4b94fc5 100644 --- a/src/CustomMetadataFields/CustomMetadataField.php +++ b/src/CustomMetadataFields/CustomMetadataField.php @@ -6,9 +6,7 @@ use Imagekit\Core\Attributes\Api; use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkResponse; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion\Contracts\ResponseConverter; use Imagekit\CustomMetadataFields\CustomMetadataField\Schema; use Imagekit\CustomMetadataFields\CustomMetadataField\Schema\Type; @@ -19,13 +17,11 @@ * id: string, label: string, name: string, schema: Schema * } */ -final class CustomMetadataField implements BaseModel, ResponseConverter +final class CustomMetadataField implements BaseModel { /** @use SdkModel */ use SdkModel; - use SdkResponse; - /** * Unique identifier for the custom metadata field. Use this to update the field. */ diff --git a/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php b/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php index 2085eb71..18c7f55e 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php +++ b/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php @@ -5,20 +5,16 @@ namespace Imagekit\CustomMetadataFields; use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkResponse; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type CustomMetadataFieldDeleteResponseShape = array */ -final class CustomMetadataFieldDeleteResponse implements BaseModel, ResponseConverter +final class CustomMetadataFieldDeleteResponse implements BaseModel { /** @use SdkModel */ use SdkModel; - use SdkResponse; - public function __construct() { $this->initialize(); diff --git a/src/Files/Bulk/BulkAddTagsResponse.php b/src/Files/Bulk/BulkAddTagsResponse.php index 3351e66f..2a9458a7 100644 --- a/src/Files/Bulk/BulkAddTagsResponse.php +++ b/src/Files/Bulk/BulkAddTagsResponse.php @@ -6,22 +6,18 @@ use Imagekit\Core\Attributes\Api; use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkResponse; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type BulkAddTagsResponseShape = array{ * successfullyUpdatedFileIds?: list|null * } */ -final class BulkAddTagsResponse implements BaseModel, ResponseConverter +final class BulkAddTagsResponse implements BaseModel { /** @use SdkModel */ use SdkModel; - use SdkResponse; - /** * An array of fileIds that in which tags were successfully added. * diff --git a/src/Files/Bulk/BulkDeleteResponse.php b/src/Files/Bulk/BulkDeleteResponse.php index 618c3cb4..1d167f34 100644 --- a/src/Files/Bulk/BulkDeleteResponse.php +++ b/src/Files/Bulk/BulkDeleteResponse.php @@ -6,22 +6,18 @@ use Imagekit\Core\Attributes\Api; use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkResponse; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type BulkDeleteResponseShape = array{ * successfullyDeletedFileIds?: list|null * } */ -final class BulkDeleteResponse implements BaseModel, ResponseConverter +final class BulkDeleteResponse implements BaseModel { /** @use SdkModel */ use SdkModel; - use SdkResponse; - /** * An array of fileIds that were successfully deleted. * diff --git a/src/Files/Bulk/BulkRemoveAITagsResponse.php b/src/Files/Bulk/BulkRemoveAITagsResponse.php index d04a2c3f..5d548331 100644 --- a/src/Files/Bulk/BulkRemoveAITagsResponse.php +++ b/src/Files/Bulk/BulkRemoveAITagsResponse.php @@ -6,22 +6,18 @@ use Imagekit\Core\Attributes\Api; use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkResponse; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type BulkRemoveAITagsResponseShape = array{ * successfullyUpdatedFileIds?: list|null * } */ -final class BulkRemoveAITagsResponse implements BaseModel, ResponseConverter +final class BulkRemoveAITagsResponse implements BaseModel { /** @use SdkModel */ use SdkModel; - use SdkResponse; - /** * An array of fileIds that in which AITags were successfully removed. * diff --git a/src/Files/Bulk/BulkRemoveTagsResponse.php b/src/Files/Bulk/BulkRemoveTagsResponse.php index 1df92588..f25f58d2 100644 --- a/src/Files/Bulk/BulkRemoveTagsResponse.php +++ b/src/Files/Bulk/BulkRemoveTagsResponse.php @@ -6,22 +6,18 @@ use Imagekit\Core\Attributes\Api; use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkResponse; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type BulkRemoveTagsResponseShape = array{ * successfullyUpdatedFileIds?: list|null * } */ -final class BulkRemoveTagsResponse implements BaseModel, ResponseConverter +final class BulkRemoveTagsResponse implements BaseModel { /** @use SdkModel */ use SdkModel; - use SdkResponse; - /** * An array of fileIds that in which tags were successfully removed. * diff --git a/src/Files/File.php b/src/Files/File.php index 35c93fad..acfca5ed 100644 --- a/src/Files/File.php +++ b/src/Files/File.php @@ -6,9 +6,7 @@ use Imagekit\Core\Attributes\Api; use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkResponse; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion\Contracts\ResponseConverter; use Imagekit\Files\File\AITag; use Imagekit\Files\File\SelectedFieldsSchema; use Imagekit\Files\File\Type; @@ -43,13 +41,11 @@ * width?: float|null, * } */ -final class File implements BaseModel, ResponseConverter +final class File implements BaseModel { /** @use SdkModel */ use SdkModel; - use SdkResponse; - /** * An array of tags assigned to the file by auto tagging. * diff --git a/src/Files/FileCopyResponse.php b/src/Files/FileCopyResponse.php index cb63a96f..10a47d1e 100644 --- a/src/Files/FileCopyResponse.php +++ b/src/Files/FileCopyResponse.php @@ -5,20 +5,16 @@ namespace Imagekit\Files; use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkResponse; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type FileCopyResponseShape = array */ -final class FileCopyResponse implements BaseModel, ResponseConverter +final class FileCopyResponse implements BaseModel { /** @use SdkModel */ use SdkModel; - use SdkResponse; - public function __construct() { $this->initialize(); diff --git a/src/Files/FileMoveResponse.php b/src/Files/FileMoveResponse.php index addc97cd..905e4f53 100644 --- a/src/Files/FileMoveResponse.php +++ b/src/Files/FileMoveResponse.php @@ -5,20 +5,16 @@ namespace Imagekit\Files; use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkResponse; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type FileMoveResponseShape = array */ -final class FileMoveResponse implements BaseModel, ResponseConverter +final class FileMoveResponse implements BaseModel { /** @use SdkModel */ use SdkModel; - use SdkResponse; - public function __construct() { $this->initialize(); diff --git a/src/Files/FileRenameResponse.php b/src/Files/FileRenameResponse.php index 766c39b5..c554ebe9 100644 --- a/src/Files/FileRenameResponse.php +++ b/src/Files/FileRenameResponse.php @@ -6,20 +6,16 @@ use Imagekit\Core\Attributes\Api; use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkResponse; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type FileRenameResponseShape = array{purgeRequestId?: string|null} */ -final class FileRenameResponse implements BaseModel, ResponseConverter +final class FileRenameResponse implements BaseModel { /** @use SdkModel */ use SdkModel; - use SdkResponse; - /** * Unique identifier of the purge request. This can be used to check the status of the purge request. */ diff --git a/src/Files/FileUpdateResponse.php b/src/Files/FileUpdateResponse.php index f43a504e..dd2d7f42 100644 --- a/src/Files/FileUpdateResponse.php +++ b/src/Files/FileUpdateResponse.php @@ -6,9 +6,7 @@ use Imagekit\Core\Attributes\Api; use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkResponse; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion\Contracts\ResponseConverter; use Imagekit\Files\File\AITag; use Imagekit\Files\File\SelectedFieldsSchema; use Imagekit\Files\File\Type; @@ -49,13 +47,11 @@ * extensionStatus?: ExtensionStatus|null, * } */ -final class FileUpdateResponse implements BaseModel, ResponseConverter +final class FileUpdateResponse implements BaseModel { /** @use SdkModel */ use SdkModel; - use SdkResponse; - /** * An array of tags assigned to the file by auto tagging. * diff --git a/src/Files/FileUploadResponse.php b/src/Files/FileUploadResponse.php index 26f51b9d..30ee0722 100644 --- a/src/Files/FileUploadResponse.php +++ b/src/Files/FileUploadResponse.php @@ -6,9 +6,7 @@ use Imagekit\Core\Attributes\Api; use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkResponse; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion\Contracts\ResponseConverter; use Imagekit\Files\FileUploadResponse\AITag; use Imagekit\Files\FileUploadResponse\ExtensionStatus; use Imagekit\Files\FileUploadResponse\ExtensionStatus\AIAutoDescription; @@ -51,13 +49,11 @@ * width?: float|null, * } */ -final class FileUploadResponse implements BaseModel, ResponseConverter +final class FileUploadResponse implements BaseModel { /** @use SdkModel */ use SdkModel; - use SdkResponse; - /** * An array of tags assigned to the uploaded file by auto tagging. * diff --git a/src/Files/Versions/VersionDeleteResponse.php b/src/Files/Versions/VersionDeleteResponse.php index b0badbe3..c8bebe49 100644 --- a/src/Files/Versions/VersionDeleteResponse.php +++ b/src/Files/Versions/VersionDeleteResponse.php @@ -5,20 +5,16 @@ namespace Imagekit\Files\Versions; use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkResponse; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type VersionDeleteResponseShape = array */ -final class VersionDeleteResponse implements BaseModel, ResponseConverter +final class VersionDeleteResponse implements BaseModel { /** @use SdkModel */ use SdkModel; - use SdkResponse; - public function __construct() { $this->initialize(); diff --git a/src/Folders/FolderCopyResponse.php b/src/Folders/FolderCopyResponse.php index adf22c3e..17ccd21f 100644 --- a/src/Folders/FolderCopyResponse.php +++ b/src/Folders/FolderCopyResponse.php @@ -6,22 +6,18 @@ use Imagekit\Core\Attributes\Api; use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkResponse; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * Job submitted successfully. A `jobId` will be returned. * * @phpstan-type FolderCopyResponseShape = array{jobId: string} */ -final class FolderCopyResponse implements BaseModel, ResponseConverter +final class FolderCopyResponse implements BaseModel { /** @use SdkModel */ use SdkModel; - use SdkResponse; - /** * Unique identifier of the bulk job. This can be used to check the status of the bulk job. */ diff --git a/src/Folders/FolderDeleteResponse.php b/src/Folders/FolderDeleteResponse.php index bcc23b19..ba6a1b95 100644 --- a/src/Folders/FolderDeleteResponse.php +++ b/src/Folders/FolderDeleteResponse.php @@ -5,20 +5,16 @@ namespace Imagekit\Folders; use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkResponse; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type FolderDeleteResponseShape = array */ -final class FolderDeleteResponse implements BaseModel, ResponseConverter +final class FolderDeleteResponse implements BaseModel { /** @use SdkModel */ use SdkModel; - use SdkResponse; - public function __construct() { $this->initialize(); diff --git a/src/Folders/FolderMoveResponse.php b/src/Folders/FolderMoveResponse.php index 5022ab73..6f0ef1b7 100644 --- a/src/Folders/FolderMoveResponse.php +++ b/src/Folders/FolderMoveResponse.php @@ -6,22 +6,18 @@ use Imagekit\Core\Attributes\Api; use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkResponse; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * Job submitted successfully. A `jobId` will be returned. * * @phpstan-type FolderMoveResponseShape = array{jobId: string} */ -final class FolderMoveResponse implements BaseModel, ResponseConverter +final class FolderMoveResponse implements BaseModel { /** @use SdkModel */ use SdkModel; - use SdkResponse; - /** * Unique identifier of the bulk job. This can be used to check the status of the bulk job. */ diff --git a/src/Folders/FolderNewResponse.php b/src/Folders/FolderNewResponse.php index 18c1e70c..f7dd8e41 100644 --- a/src/Folders/FolderNewResponse.php +++ b/src/Folders/FolderNewResponse.php @@ -5,20 +5,16 @@ namespace Imagekit\Folders; use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkResponse; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * @phpstan-type FolderNewResponseShape = array */ -final class FolderNewResponse implements BaseModel, ResponseConverter +final class FolderNewResponse implements BaseModel { /** @use SdkModel */ use SdkModel; - use SdkResponse; - public function __construct() { $this->initialize(); diff --git a/src/Folders/FolderRenameResponse.php b/src/Folders/FolderRenameResponse.php index 705fd2e9..656e4e95 100644 --- a/src/Folders/FolderRenameResponse.php +++ b/src/Folders/FolderRenameResponse.php @@ -6,22 +6,18 @@ use Imagekit\Core\Attributes\Api; use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkResponse; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion\Contracts\ResponseConverter; /** * Job submitted successfully. A `jobId` will be returned. * * @phpstan-type FolderRenameResponseShape = array{jobId: string} */ -final class FolderRenameResponse implements BaseModel, ResponseConverter +final class FolderRenameResponse implements BaseModel { /** @use SdkModel */ use SdkModel; - use SdkResponse; - /** * Unique identifier of the bulk job. This can be used to check the status of the bulk job. */ diff --git a/src/Folders/Job/JobGetResponse.php b/src/Folders/Job/JobGetResponse.php index 5d81a730..8c20ff31 100644 --- a/src/Folders/Job/JobGetResponse.php +++ b/src/Folders/Job/JobGetResponse.php @@ -6,9 +6,7 @@ use Imagekit\Core\Attributes\Api; use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkResponse; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion\Contracts\ResponseConverter; use Imagekit\Folders\Job\JobGetResponse\Status; use Imagekit\Folders\Job\JobGetResponse\Type; @@ -20,13 +18,11 @@ * type?: value-of|null, * } */ -final class JobGetResponse implements BaseModel, ResponseConverter +final class JobGetResponse implements BaseModel { /** @use SdkModel */ use SdkModel; - use SdkResponse; - /** * Unique identifier of the bulk job. */ diff --git a/src/Services/Accounts/OriginsService.php b/src/Services/Accounts/OriginsService.php index 73a870e6..81df12dd 100644 --- a/src/Services/Accounts/OriginsService.php +++ b/src/Services/Accounts/OriginsService.php @@ -16,6 +16,7 @@ use Imagekit\Accounts\Origins\OriginResponse\WebProxy; use Imagekit\Accounts\Origins\OriginUpdateParams; use Imagekit\Client; +use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Conversion\ListOf; use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; @@ -45,14 +46,16 @@ public function create( $requestOptions, ); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'post', path: 'v1/accounts/origins', body: (object) $parsed, options: $options, convert: OriginResponse::class, ); + + return $response->parse(); } /** @@ -73,14 +76,16 @@ public function update( $requestOptions, ); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'put', path: ['v1/accounts/origins/%1$s', $id], body: (object) $parsed, options: $options, convert: OriginResponse::class, ); + + return $response->parse(); } /** @@ -95,13 +100,15 @@ public function update( */ public function list(?RequestOptions $requestOptions = null): array { - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse,> */ + $response = $this->client->request( method: 'get', path: 'v1/accounts/origins', options: $requestOptions, convert: new ListOf(OriginResponse::class), ); + + return $response->parse(); } /** @@ -116,13 +123,15 @@ public function delete( string $id, ?RequestOptions $requestOptions = null ): mixed { - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'delete', path: ['v1/accounts/origins/%1$s', $id], options: $requestOptions, convert: null, ); + + return $response->parse(); } /** @@ -137,12 +146,14 @@ public function get( string $id, ?RequestOptions $requestOptions = null ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'get', path: ['v1/accounts/origins/%1$s', $id], options: $requestOptions, convert: OriginResponse::class, ); + + return $response->parse(); } } diff --git a/src/Services/Accounts/URLEndpointsService.php b/src/Services/Accounts/URLEndpointsService.php index 23c45a0a..2296c3db 100644 --- a/src/Services/Accounts/URLEndpointsService.php +++ b/src/Services/Accounts/URLEndpointsService.php @@ -8,6 +8,7 @@ use Imagekit\Accounts\URLEndpoints\URLEndpointResponse; use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams; use Imagekit\Client; +use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Conversion\ListOf; use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; @@ -44,14 +45,16 @@ public function create( $requestOptions, ); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'post', path: 'v1/accounts/url-endpoints', body: (object) $parsed, options: $options, convert: URLEndpointResponse::class, ); + + return $response->parse(); } /** @@ -79,14 +82,16 @@ public function update( $requestOptions, ); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'put', path: ['v1/accounts/url-endpoints/%1$s', $id], body: (object) $parsed, options: $options, convert: URLEndpointResponse::class, ); + + return $response->parse(); } /** @@ -101,13 +106,15 @@ public function update( */ public function list(?RequestOptions $requestOptions = null): array { - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse> */ + $response = $this->client->request( method: 'get', path: 'v1/accounts/url-endpoints', options: $requestOptions, convert: new ListOf(URLEndpointResponse::class), ); + + return $response->parse(); } /** @@ -122,13 +129,15 @@ public function delete( string $id, ?RequestOptions $requestOptions = null ): mixed { - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'delete', path: ['v1/accounts/url-endpoints/%1$s', $id], options: $requestOptions, convert: null, ); + + return $response->parse(); } /** @@ -143,12 +152,14 @@ public function get( string $id, ?RequestOptions $requestOptions = null ): URLEndpointResponse { - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'get', path: ['v1/accounts/url-endpoints/%1$s', $id], options: $requestOptions, convert: URLEndpointResponse::class, ); + + return $response->parse(); } } diff --git a/src/Services/Accounts/UsageService.php b/src/Services/Accounts/UsageService.php index f49134b0..2f6143e2 100644 --- a/src/Services/Accounts/UsageService.php +++ b/src/Services/Accounts/UsageService.php @@ -7,6 +7,7 @@ use Imagekit\Accounts\Usage\UsageGetParams; use Imagekit\Accounts\Usage\UsageGetResponse; use Imagekit\Client; +use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Accounts\UsageContract; @@ -38,13 +39,15 @@ public function get( $requestOptions, ); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'get', path: 'v1/accounts/usage', query: $parsed, options: $options, convert: UsageGetResponse::class, ); + + return $response->parse(); } } diff --git a/src/Services/AssetsService.php b/src/Services/AssetsService.php index e30da5fe..9762edc9 100644 --- a/src/Services/AssetsService.php +++ b/src/Services/AssetsService.php @@ -8,6 +8,7 @@ use Imagekit\Assets\AssetListParams\Sort; use Imagekit\Assets\AssetListResponseItem; use Imagekit\Client; +use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Conversion\ListOf; use Imagekit\Core\Exceptions\APIException; use Imagekit\Files\File; @@ -50,13 +51,15 @@ public function list( $requestOptions, ); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse> */ + $response = $this->client->request( method: 'get', path: 'v1/files', query: $parsed, options: $options, convert: new ListOf(AssetListResponseItem::class), ); + + return $response->parse(); } } diff --git a/src/Services/Beta/V2/FilesService.php b/src/Services/Beta/V2/FilesService.php index e937278f..081291fe 100644 --- a/src/Services/Beta/V2/FilesService.php +++ b/src/Services/Beta/V2/FilesService.php @@ -7,6 +7,7 @@ use Imagekit\Beta\V2\Files\FileUploadParams; use Imagekit\Beta\V2\Files\FileUploadResponse; use Imagekit\Client; +use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Beta\V2\FilesContract; @@ -73,8 +74,8 @@ public function upload( ->client ->baseUrlOverridden ? 'api/v2/files/upload' : 'https://upload.imagekit.io/api/v2/files/upload'; - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'post', path: $path, headers: ['Content-Type' => 'multipart/form-data'], @@ -82,5 +83,7 @@ public function upload( options: $options, convert: FileUploadResponse::class, ); + + return $response->parse(); } } diff --git a/src/Services/Cache/InvalidationService.php b/src/Services/Cache/InvalidationService.php index 12cf5a0b..d0c7b780 100644 --- a/src/Services/Cache/InvalidationService.php +++ b/src/Services/Cache/InvalidationService.php @@ -8,6 +8,7 @@ use Imagekit\Cache\Invalidation\InvalidationGetResponse; use Imagekit\Cache\Invalidation\InvalidationNewResponse; use Imagekit\Client; +use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Cache\InvalidationContract; @@ -37,14 +38,16 @@ public function create( $requestOptions, ); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'post', path: 'v1/files/purge', body: (object) $parsed, options: $options, convert: InvalidationNewResponse::class, ); + + return $response->parse(); } /** @@ -58,12 +61,14 @@ public function get( string $requestID, ?RequestOptions $requestOptions = null ): InvalidationGetResponse { - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'get', path: ['v1/files/purge/%1$s', $requestID], options: $requestOptions, convert: InvalidationGetResponse::class, ); + + return $response->parse(); } } diff --git a/src/Services/CustomMetadataFieldsService.php b/src/Services/CustomMetadataFieldsService.php index 0962794d..381cae61 100644 --- a/src/Services/CustomMetadataFieldsService.php +++ b/src/Services/CustomMetadataFieldsService.php @@ -5,6 +5,7 @@ namespace Imagekit\Services; use Imagekit\Client; +use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Conversion\ListOf; use Imagekit\Core\Exceptions\APIException; use Imagekit\CustomMetadataFields\CustomMetadataField; @@ -53,14 +54,16 @@ public function create( $requestOptions, ); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'post', path: 'v1/customMetadataFields', body: (object) $parsed, options: $options, convert: CustomMetadataField::class, ); + + return $response->parse(); } /** @@ -93,14 +96,16 @@ public function update( $requestOptions, ); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'patch', path: ['v1/customMetadataFields/%1$s', $id], body: (object) $parsed, options: $options, convert: CustomMetadataField::class, ); + + return $response->parse(); } /** @@ -127,14 +132,16 @@ public function list( $requestOptions, ); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse> */ + $response = $this->client->request( method: 'get', path: 'v1/customMetadataFields', query: $parsed, options: $options, convert: new ListOf(CustomMetadataField::class), ); + + return $response->parse(); } /** @@ -148,12 +155,14 @@ public function delete( string $id, ?RequestOptions $requestOptions = null ): CustomMetadataFieldDeleteResponse { - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'delete', path: ['v1/customMetadataFields/%1$s', $id], options: $requestOptions, convert: CustomMetadataFieldDeleteResponse::class, ); + + return $response->parse(); } } diff --git a/src/Services/Files/BulkService.php b/src/Services/Files/BulkService.php index c68ddafe..241bb158 100644 --- a/src/Services/Files/BulkService.php +++ b/src/Services/Files/BulkService.php @@ -5,6 +5,7 @@ namespace Imagekit\Services\Files; use Imagekit\Client; +use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Exceptions\APIException; use Imagekit\Files\Bulk\BulkAddTagsParams; use Imagekit\Files\Bulk\BulkAddTagsResponse; @@ -46,14 +47,16 @@ public function delete( $requestOptions, ); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'post', path: 'v1/files/batch/deleteByFileIds', body: (object) $parsed, options: $options, convert: BulkDeleteResponse::class, ); + + return $response->parse(); } /** @@ -76,14 +79,16 @@ public function addTags( $requestOptions, ); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'post', path: 'v1/files/addTags', body: (object) $parsed, options: $options, convert: BulkAddTagsResponse::class, ); + + return $response->parse(); } /** @@ -106,14 +111,16 @@ public function removeAITags( $requestOptions, ); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'post', path: 'v1/files/removeAITags', body: (object) $parsed, options: $options, convert: BulkRemoveAITagsResponse::class, ); + + return $response->parse(); } /** @@ -136,13 +143,15 @@ public function removeTags( $requestOptions, ); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'post', path: 'v1/files/removeTags', body: (object) $parsed, options: $options, convert: BulkRemoveTagsResponse::class, ); + + return $response->parse(); } } diff --git a/src/Services/Files/MetadataService.php b/src/Services/Files/MetadataService.php index 04c457c3..b5bc6e2c 100644 --- a/src/Services/Files/MetadataService.php +++ b/src/Services/Files/MetadataService.php @@ -5,6 +5,7 @@ namespace Imagekit\Services\Files; use Imagekit\Client; +use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Exceptions\APIException; use Imagekit\Files\Metadata; use Imagekit\Files\Metadata\MetadataGetFromURLParams; @@ -31,13 +32,15 @@ public function get( string $fileID, ?RequestOptions $requestOptions = null ): Metadata { - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'get', path: ['v1/files/%1$s/metadata', $fileID], options: $requestOptions, convert: Metadata::class, ); + + return $response->parse(); } /** @@ -58,13 +61,15 @@ public function getFromURL( $requestOptions, ); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'get', path: 'v1/files/metadata', query: $parsed, options: $options, convert: Metadata::class, ); + + return $response->parse(); } } diff --git a/src/Services/Files/VersionsService.php b/src/Services/Files/VersionsService.php index b7857b3f..0d28ec12 100644 --- a/src/Services/Files/VersionsService.php +++ b/src/Services/Files/VersionsService.php @@ -5,6 +5,7 @@ namespace Imagekit\Services\Files; use Imagekit\Client; +use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Conversion\ListOf; use Imagekit\Core\Exceptions\APIException; use Imagekit\Files\File; @@ -35,13 +36,15 @@ public function list( string $fileID, ?RequestOptions $requestOptions = null ): array { - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse> */ + $response = $this->client->request( method: 'get', path: ['v1/files/%1$s/versions', $fileID], options: $requestOptions, convert: new ListOf(File::class), ); + + return $response->parse(); } /** @@ -67,13 +70,15 @@ public function delete( $fileID = $parsed['fileId']; unset($parsed['fileId']); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'delete', path: ['v1/files/%1$s/versions/%2$s', $fileID, $versionID], options: $options, convert: VersionDeleteResponse::class, ); + + return $response->parse(); } /** @@ -97,13 +102,15 @@ public function get( $fileID = $parsed['fileId']; unset($parsed['fileId']); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'get', path: ['v1/files/%1$s/versions/%2$s', $fileID, $versionID], options: $options, convert: File::class, ); + + return $response->parse(); } /** @@ -127,12 +134,14 @@ public function restore( $fileID = $parsed['fileId']; unset($parsed['fileId']); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'put', path: ['v1/files/%1$s/versions/%2$s/restore', $fileID, $versionID], options: $options, convert: File::class, ); + + return $response->parse(); } } diff --git a/src/Services/FilesService.php b/src/Services/FilesService.php index 132712c1..e2871506 100644 --- a/src/Services/FilesService.php +++ b/src/Services/FilesService.php @@ -5,6 +5,7 @@ namespace Imagekit\Services; use Imagekit\Client; +use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Exceptions\APIException; use Imagekit\Files\File; use Imagekit\Files\FileCopyParams; @@ -67,14 +68,16 @@ public function update( $requestOptions, ); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'patch', path: ['v1/files/%1$s/details', $fileID], body: (object) $parsed, options: $options, convert: FileUpdateResponse::class, ); + + return $response->parse(); } /** @@ -90,13 +93,15 @@ public function delete( string $fileID, ?RequestOptions $requestOptions = null ): mixed { - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'delete', path: ['v1/files/%1$s', $fileID], options: $requestOptions, convert: null, ); + + return $response->parse(); } /** @@ -121,14 +126,16 @@ public function copy( $requestOptions, ); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'post', path: 'v1/files/copy', body: (object) $parsed, options: $options, convert: FileCopyResponse::class, ); + + return $response->parse(); } /** @@ -142,13 +149,15 @@ public function get( string $fileID, ?RequestOptions $requestOptions = null ): File { - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'get', path: ['v1/files/%1$s/details', $fileID], options: $requestOptions, convert: File::class, ); + + return $response->parse(); } /** @@ -173,14 +182,16 @@ public function move( $requestOptions, ); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'post', path: 'v1/files/move', body: (object) $parsed, options: $options, convert: FileMoveResponse::class, ); + + return $response->parse(); } /** @@ -205,14 +216,16 @@ public function rename( $requestOptions, ); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'put', path: 'v1/files/rename', body: (object) $parsed, options: $options, convert: FileRenameResponse::class, ); + + return $response->parse(); } /** @@ -273,8 +286,8 @@ public function upload( ->client ->baseUrlOverridden ? 'api/v1/files/upload' : 'https://upload.imagekit.io/api/v1/files/upload'; - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'post', path: $path, headers: ['Content-Type' => 'multipart/form-data'], @@ -282,5 +295,7 @@ public function upload( options: $options, convert: FileUploadResponse::class, ); + + return $response->parse(); } } diff --git a/src/Services/Folders/JobService.php b/src/Services/Folders/JobService.php index 54a21958..867d35c6 100644 --- a/src/Services/Folders/JobService.php +++ b/src/Services/Folders/JobService.php @@ -5,6 +5,7 @@ namespace Imagekit\Services\Folders; use Imagekit\Client; +use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Exceptions\APIException; use Imagekit\Folders\Job\JobGetResponse; use Imagekit\RequestOptions; @@ -28,12 +29,14 @@ public function get( string $jobID, ?RequestOptions $requestOptions = null ): JobGetResponse { - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'get', path: ['v1/bulkJobs/%1$s', $jobID], options: $requestOptions, convert: JobGetResponse::class, ); + + return $response->parse(); } } diff --git a/src/Services/FoldersService.php b/src/Services/FoldersService.php index f2a87cb0..e0ed79f9 100644 --- a/src/Services/FoldersService.php +++ b/src/Services/FoldersService.php @@ -5,6 +5,7 @@ namespace Imagekit\Services; use Imagekit\Client; +use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Exceptions\APIException; use Imagekit\Folders\FolderCopyParams; use Imagekit\Folders\FolderCopyResponse; @@ -55,14 +56,16 @@ public function create( $requestOptions, ); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'post', path: 'v1/folder', body: (object) $parsed, options: $options, convert: FolderNewResponse::class, ); + + return $response->parse(); } /** @@ -83,14 +86,16 @@ public function delete( $requestOptions, ); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'delete', path: 'v1/folder', body: (object) $parsed, options: $options, convert: FolderDeleteResponse::class, ); + + return $response->parse(); } /** @@ -113,14 +118,16 @@ public function copy( $requestOptions, ); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'post', path: 'v1/bulkJobs/copyFolder', body: (object) $parsed, options: $options, convert: FolderCopyResponse::class, ); + + return $response->parse(); } /** @@ -143,14 +150,16 @@ public function move( $requestOptions, ); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'post', path: 'v1/bulkJobs/moveFolder', body: (object) $parsed, options: $options, convert: FolderMoveResponse::class, ); + + return $response->parse(); } /** @@ -173,13 +182,15 @@ public function rename( $requestOptions, ); - // @phpstan-ignore-next-line return.type - return $this->client->request( + /** @var BaseResponse */ + $response = $this->client->request( method: 'post', path: 'v1/bulkJobs/renameFolder', body: (object) $parsed, options: $options, convert: FolderRenameResponse::class, ); + + return $response->parse(); } } From 229f706c0368dbbd51cf56a683eba73c301c1b89 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 8 Dec 2025 22:05:15 +0000 Subject: [PATCH 087/193] chore: switch from `#[Api(optional: true|false)]` to `#[Required]|#[Optional]` for annotations --- src/Accounts/Origins/OriginCreateParams.php | 45 ++++---- .../Origins/OriginRequest/AkeneoPim.php | 21 ++-- .../Origins/OriginRequest/AzureBlob.php | 19 ++-- .../OriginRequest/CloudinaryBackup.php | 19 ++-- src/Accounts/Origins/OriginRequest/Gcs.php | 19 ++-- src/Accounts/Origins/OriginRequest/S3.php | 19 ++-- .../Origins/OriginRequest/S3Compatible.php | 23 ++-- .../Origins/OriginRequest/WebFolder.php | 15 +-- .../Origins/OriginRequest/WebProxy.php | 11 +- .../Origins/OriginResponse/AkeneoPim.php | 15 +-- .../Origins/OriginResponse/AzureBlob.php | 19 ++-- .../OriginResponse/CloudinaryBackup.php | 17 +-- src/Accounts/Origins/OriginResponse/Gcs.php | 19 ++-- src/Accounts/Origins/OriginResponse/S3.php | 17 +-- .../Origins/OriginResponse/S3Compatible.php | 21 ++-- .../Origins/OriginResponse/WebFolder.php | 17 +-- .../Origins/OriginResponse/WebProxy.php | 13 ++- src/Accounts/Origins/OriginUpdateParams.php | 45 ++++---- .../URLEndpoints/URLEndpointCreateParams.php | 11 +- .../URLRewriter/Akamai.php | 4 +- .../URLRewriter/Cloudinary.php | 7 +- .../URLRewriter/Imgix.php | 4 +- .../URLEndpoints/URLEndpointRequest.php | 11 +- .../URLEndpointRequest/URLRewriter/Akamai.php | 4 +- .../URLRewriter/Cloudinary.php | 7 +- .../URLEndpointRequest/URLRewriter/Imgix.php | 4 +- .../URLEndpoints/URLEndpointResponse.php | 13 ++- .../URLRewriter/Akamai.php | 4 +- .../URLRewriter/Cloudinary.php | 6 +- .../URLEndpointResponse/URLRewriter/Imgix.php | 4 +- .../URLEndpoints/URLEndpointUpdateParams.php | 11 +- .../URLRewriter/Akamai.php | 4 +- .../URLRewriter/Cloudinary.php | 7 +- .../URLRewriter/Imgix.php | 4 +- src/Accounts/Usage/UsageGetParams.php | 6 +- src/Accounts/Usage/UsageGetResponse.php | 12 +- src/Assets/AssetListParams.php | 16 +-- src/BaseOverlay.php | 6 +- src/Beta/V2/Files/FileUploadParams.php | 43 +++---- .../Files/FileUploadParams/Transformation.php | 6 +- .../Transformation/Post/Abs.php | 8 +- .../Transformation/Post/GifToVideo.php | 7 +- .../Transformation/Post/Thumbnail.php | 7 +- .../Transformation/Post/Transformation.php | 6 +- src/Beta/V2/Files/FileUploadResponse.php | 52 ++++----- .../V2/Files/FileUploadResponse/AITag.php | 8 +- .../FileUploadResponse/ExtensionStatus.php | 10 +- .../SelectedFieldsSchema.php | 23 ++-- .../Files/FileUploadResponse/VersionInfo.php | 6 +- .../Invalidation/InvalidationCreateParams.php | 4 +- .../Invalidation/InvalidationGetResponse.php | 4 +- .../Invalidation/InvalidationNewResponse.php | 4 +- src/Core/Attributes/Optional.php | 35 ++++++ src/Core/Attributes/{Api.php => Required.php} | 23 ++-- src/Core/Conversion/ModelOf.php | 10 +- src/Core/Conversion/PropertyInfo.php | 8 +- .../CustomMetadataField.php | 10 +- .../CustomMetadataField/Schema.php | 19 ++-- .../CustomMetadataFieldCreateParams.php | 8 +- .../Schema.php | 19 ++-- .../CustomMetadataFieldListParams.php | 6 +- .../CustomMetadataFieldUpdateParams.php | 6 +- .../Schema.php | 16 +-- src/ExtensionItem/AIAutoDescription.php | 4 +- src/ExtensionItem/AutoTaggingExtension.php | 8 +- src/ExtensionItem/RemoveBg.php | 7 +- src/ExtensionItem/RemoveBg/Options.php | 10 +- src/Files/Bulk/BulkAddTagsParams.php | 6 +- src/Files/Bulk/BulkAddTagsResponse.php | 4 +- src/Files/Bulk/BulkDeleteParams.php | 4 +- src/Files/Bulk/BulkDeleteResponse.php | 4 +- src/Files/Bulk/BulkRemoveAITagsParams.php | 6 +- src/Files/Bulk/BulkRemoveAITagsResponse.php | 4 +- src/Files/Bulk/BulkRemoveTagsParams.php | 6 +- src/Files/Bulk/BulkRemoveTagsResponse.php | 4 +- src/Files/File.php | 48 ++++---- src/Files/File/AITag.php | 8 +- src/Files/File/SelectedFieldsSchema.php | 23 ++-- src/Files/File/VersionInfo.php | 6 +- src/Files/FileCopyParams.php | 9 +- src/Files/FileMoveParams.php | 6 +- src/Files/FileRenameParams.php | 9 +- src/Files/FileRenameResponse.php | 4 +- src/Files/FileUpdateParams.php | 18 +-- src/Files/FileUpdateParams/Publish.php | 7 +- src/Files/FileUpdateResponse.php | 50 ++++----- .../FileUpdateResponse/ExtensionStatus.php | 10 +- src/Files/FileUploadParams.php | 49 ++++---- src/Files/FileUploadParams/Transformation.php | 6 +- .../Transformation/Post/Abs.php | 8 +- .../Transformation/Post/GifToVideo.php | 7 +- .../Transformation/Post/Thumbnail.php | 7 +- .../Transformation/Post/Transformation.php | 6 +- src/Files/FileUploadResponse.php | 52 ++++----- src/Files/FileUploadResponse/AITag.php | 8 +- .../FileUploadResponse/ExtensionStatus.php | 10 +- .../SelectedFieldsSchema.php | 23 ++-- src/Files/FileUploadResponse/VersionInfo.php | 6 +- src/Files/Folder.php | 14 +-- src/Files/Metadata.php | 30 ++--- src/Files/Metadata/Exif.php | 14 +-- src/Files/Metadata/Exif/Exif.php | 54 ++++----- src/Files/Metadata/Exif/Gps.php | 4 +- src/Files/Metadata/Exif/Image.php | 24 ++-- src/Files/Metadata/Exif/Interoperability.php | 6 +- src/Files/Metadata/Exif/Thumbnail.php | 14 +-- .../Metadata/MetadataGetFromURLParams.php | 4 +- .../ChangePublicationStatus.php | 4 +- .../ChangePublicationStatus/Publish.php | 7 +- .../UpdateFileRequest/UpdateFileDetails.php | 16 +-- src/Files/Versions/VersionDeleteParams.php | 4 +- src/Files/Versions/VersionGetParams.php | 4 +- src/Files/Versions/VersionRestoreParams.php | 4 +- src/Folders/FolderCopyParams.php | 9 +- src/Folders/FolderCopyResponse.php | 4 +- src/Folders/FolderCreateParams.php | 6 +- src/Folders/FolderDeleteParams.php | 4 +- src/Folders/FolderMoveParams.php | 6 +- src/Folders/FolderMoveResponse.php | 4 +- src/Folders/FolderRenameParams.php | 9 +- src/Folders/FolderRenameResponse.php | 4 +- src/Folders/Job/JobGetResponse.php | 10 +- src/GetImageAttributesOptions.php | 25 +++-- src/ImageOverlay.php | 15 +-- src/OverlayPosition.php | 8 +- src/OverlayTiming.php | 8 +- src/RequestOptions.php | 17 +-- src/ResponsiveImageAttributes.php | 11 +- src/SolidColorOverlay.php | 13 ++- src/SolidColorOverlayTransformation.php | 14 +-- src/SrcOptions.php | 17 +-- src/SubtitleOverlay.php | 15 +-- src/SubtitleOverlayTransformation.php | 16 +-- src/TextOverlay.php | 15 +-- src/TextOverlayTransformation.php | 28 ++--- src/Transformation.php | 106 +++++++++--------- src/VideoOverlay.php | 15 +-- src/Webhooks/BaseWebhookEvent.php | 6 +- .../UploadPostTransformErrorEvent.php | 12 +- .../UploadPostTransformErrorEvent/Data.php | 12 +- .../Data/Transformation.php | 4 +- .../Data/Transformation/Error.php | 4 +- .../UploadPostTransformErrorEvent/Request.php | 6 +- .../Request/Transformation.php | 9 +- .../UploadPostTransformSuccessEvent.php | 12 +- .../UploadPostTransformSuccessEvent/Data.php | 8 +- .../Request.php | 6 +- .../Request/Transformation.php | 9 +- src/Webhooks/UploadPreTransformErrorEvent.php | 12 +- .../UploadPreTransformErrorEvent/Data.php | 8 +- .../Data/Transformation.php | 4 +- .../Data/Transformation/Error.php | 4 +- .../UploadPreTransformErrorEvent/Request.php | 6 +- .../UploadPreTransformSuccessEvent.php | 12 +- .../UploadPreTransformSuccessEvent/Data.php | 52 ++++----- .../Data/AITag.php | 8 +- .../Data/ExtensionStatus.php | 10 +- .../Data/SelectedFieldsSchema.php | 23 ++-- .../Data/VersionInfo.php | 6 +- .../Request.php | 6 +- .../VideoTransformationAcceptedEvent.php | 12 +- .../VideoTransformationAcceptedEvent/Data.php | 6 +- .../Data/Asset.php | 4 +- .../Data/Transformation.php | 7 +- .../Data/Transformation/Options.php | 16 +-- .../Request.php | 9 +- .../VideoTransformationErrorEvent.php | 12 +- .../VideoTransformationErrorEvent/Data.php | 6 +- .../Data/Asset.php | 4 +- .../Data/Transformation.php | 9 +- .../Data/Transformation/Error.php | 4 +- .../Data/Transformation/Options.php | 16 +-- .../VideoTransformationErrorEvent/Request.php | 9 +- .../VideoTransformationReadyEvent.php | 15 +-- .../VideoTransformationReadyEvent/Data.php | 6 +- .../Data/Asset.php | 4 +- .../Data/Transformation.php | 9 +- .../Data/Transformation/Options.php | 16 +-- .../Data/Transformation/Output.php | 7 +- .../Transformation/Output/VideoMetadata.php | 10 +- .../VideoTransformationReadyEvent/Request.php | 9 +- .../VideoTransformationReadyEvent/Timings.php | 6 +- tests/Core/TestModel.php | 11 +- 183 files changed, 1228 insertions(+), 1114 deletions(-) create mode 100644 src/Core/Attributes/Optional.php rename src/Core/Attributes/{Api.php => Required.php} (77%) diff --git a/src/Accounts/Origins/OriginCreateParams.php b/src/Accounts/Origins/OriginCreateParams.php index 02a00151..f1abfa92 100644 --- a/src/Accounts/Origins/OriginCreateParams.php +++ b/src/Accounts/Origins/OriginCreateParams.php @@ -4,7 +4,8 @@ namespace Imagekit\Accounts\Origins; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -46,106 +47,106 @@ final class OriginCreateParams implements BaseModel use SdkParams; /** @var 'AKENEO_PIM' $type */ - #[Api] + #[Required] public string $type = 'AKENEO_PIM'; /** * Access key for the bucket. */ - #[Api] + #[Required] public string $accessKey; - #[Api] + #[Required] public string $bucket; /** * Display name of the origin. */ - #[Api] + #[Required] public string $name; /** * Secret key for the bucket. */ - #[Api] + #[Required] public string $secretKey; /** * URL used in the Canonical header (if enabled). */ - #[Api(optional: true)] + #[Optional] public ?string $baseUrlForCanonicalHeader; /** * Whether to send a Canonical header. */ - #[Api(optional: true)] + #[Optional] public ?bool $includeCanonicalHeader; - #[Api(optional: true)] + #[Optional] public ?string $prefix; /** * Custom S3-compatible endpoint. */ - #[Api] + #[Required] public string $endpoint; /** * Use path-style S3 URLs? */ - #[Api(optional: true)] + #[Optional] public ?bool $s3ForcePathStyle; /** * Akeneo instance base URL. */ - #[Api] + #[Required] public string $baseUrl; /** * Forward the Host header to origin? */ - #[Api(optional: true)] + #[Optional] public ?bool $forwardHostHeaderToOrigin; - #[Api] + #[Required] public string $clientEmail; - #[Api] + #[Required] public string $privateKey; - #[Api] + #[Required] public string $accountName; - #[Api] + #[Required] public string $container; - #[Api] + #[Required] public string $sasToken; /** * Akeneo API client ID. */ - #[Api] + #[Required] public string $clientId; /** * Akeneo API client secret. */ - #[Api] + #[Required] public string $clientSecret; /** * Akeneo API password. */ - #[Api] + #[Required] public string $password; /** * Akeneo API username. */ - #[Api] + #[Required] public string $username; /** diff --git a/src/Accounts/Origins/OriginRequest/AkeneoPim.php b/src/Accounts/Origins/OriginRequest/AkeneoPim.php index 1d74753c..2dca9ce8 100644 --- a/src/Accounts/Origins/OriginRequest/AkeneoPim.php +++ b/src/Accounts/Origins/OriginRequest/AkeneoPim.php @@ -4,7 +4,8 @@ namespace Imagekit\Accounts\Origins\OriginRequest; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -27,55 +28,55 @@ final class AkeneoPim implements BaseModel use SdkModel; /** @var 'AKENEO_PIM' $type */ - #[Api] + #[Required] public string $type = 'AKENEO_PIM'; /** * Akeneo instance base URL. */ - #[Api] + #[Required] public string $baseUrl; /** * Akeneo API client ID. */ - #[Api] + #[Required] public string $clientId; /** * Akeneo API client secret. */ - #[Api] + #[Required] public string $clientSecret; /** * Display name of the origin. */ - #[Api] + #[Required] public string $name; /** * Akeneo API password. */ - #[Api] + #[Required] public string $password; /** * Akeneo API username. */ - #[Api] + #[Required] public string $username; /** * URL used in the Canonical header (if enabled). */ - #[Api(optional: true)] + #[Optional] public ?string $baseUrlForCanonicalHeader; /** * Whether to send a Canonical header. */ - #[Api(optional: true)] + #[Optional] public ?bool $includeCanonicalHeader; /** diff --git a/src/Accounts/Origins/OriginRequest/AzureBlob.php b/src/Accounts/Origins/OriginRequest/AzureBlob.php index f9f10555..723cde56 100644 --- a/src/Accounts/Origins/OriginRequest/AzureBlob.php +++ b/src/Accounts/Origins/OriginRequest/AzureBlob.php @@ -4,7 +4,8 @@ namespace Imagekit\Accounts\Origins\OriginRequest; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -26,37 +27,37 @@ final class AzureBlob implements BaseModel use SdkModel; /** @var 'AZURE_BLOB' $type */ - #[Api] + #[Required] public string $type = 'AZURE_BLOB'; - #[Api] + #[Required] public string $accountName; - #[Api] + #[Required] public string $container; /** * Display name of the origin. */ - #[Api] + #[Required] public string $name; - #[Api] + #[Required] public string $sasToken; /** * URL used in the Canonical header (if enabled). */ - #[Api(optional: true)] + #[Optional] public ?string $baseUrlForCanonicalHeader; /** * Whether to send a Canonical header. */ - #[Api(optional: true)] + #[Optional] public ?bool $includeCanonicalHeader; - #[Api(optional: true)] + #[Optional] public ?string $prefix; /** diff --git a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php index 91f457d8..13892006 100644 --- a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php @@ -4,7 +4,8 @@ namespace Imagekit\Accounts\Origins\OriginRequest; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -26,49 +27,49 @@ final class CloudinaryBackup implements BaseModel use SdkModel; /** @var 'CLOUDINARY_BACKUP' $type */ - #[Api] + #[Required] public string $type = 'CLOUDINARY_BACKUP'; /** * Access key for the bucket. */ - #[Api] + #[Required] public string $accessKey; /** * S3 bucket name. */ - #[Api] + #[Required] public string $bucket; /** * Display name of the origin. */ - #[Api] + #[Required] public string $name; /** * Secret key for the bucket. */ - #[Api] + #[Required] public string $secretKey; /** * URL used in the Canonical header (if enabled). */ - #[Api(optional: true)] + #[Optional] public ?string $baseUrlForCanonicalHeader; /** * Whether to send a Canonical header. */ - #[Api(optional: true)] + #[Optional] public ?bool $includeCanonicalHeader; /** * Path prefix inside the bucket. */ - #[Api(optional: true)] + #[Optional] public ?string $prefix; /** diff --git a/src/Accounts/Origins/OriginRequest/Gcs.php b/src/Accounts/Origins/OriginRequest/Gcs.php index 7a5159d5..f1d69d27 100644 --- a/src/Accounts/Origins/OriginRequest/Gcs.php +++ b/src/Accounts/Origins/OriginRequest/Gcs.php @@ -4,7 +4,8 @@ namespace Imagekit\Accounts\Origins\OriginRequest; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -26,37 +27,37 @@ final class Gcs implements BaseModel use SdkModel; /** @var 'GCS' $type */ - #[Api] + #[Required] public string $type = 'GCS'; - #[Api] + #[Required] public string $bucket; - #[Api] + #[Required] public string $clientEmail; /** * Display name of the origin. */ - #[Api] + #[Required] public string $name; - #[Api] + #[Required] public string $privateKey; /** * URL used in the Canonical header (if enabled). */ - #[Api(optional: true)] + #[Optional] public ?string $baseUrlForCanonicalHeader; /** * Whether to send a Canonical header. */ - #[Api(optional: true)] + #[Optional] public ?bool $includeCanonicalHeader; - #[Api(optional: true)] + #[Optional] public ?string $prefix; /** diff --git a/src/Accounts/Origins/OriginRequest/S3.php b/src/Accounts/Origins/OriginRequest/S3.php index 5fbc04fd..ef28801b 100644 --- a/src/Accounts/Origins/OriginRequest/S3.php +++ b/src/Accounts/Origins/OriginRequest/S3.php @@ -4,7 +4,8 @@ namespace Imagekit\Accounts\Origins\OriginRequest; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -26,49 +27,49 @@ final class S3 implements BaseModel use SdkModel; /** @var 'S3' $type */ - #[Api] + #[Required] public string $type = 'S3'; /** * Access key for the bucket. */ - #[Api] + #[Required] public string $accessKey; /** * S3 bucket name. */ - #[Api] + #[Required] public string $bucket; /** * Display name of the origin. */ - #[Api] + #[Required] public string $name; /** * Secret key for the bucket. */ - #[Api] + #[Required] public string $secretKey; /** * URL used in the Canonical header (if enabled). */ - #[Api(optional: true)] + #[Optional] public ?string $baseUrlForCanonicalHeader; /** * Whether to send a Canonical header. */ - #[Api(optional: true)] + #[Optional] public ?bool $includeCanonicalHeader; /** * Path prefix inside the bucket. */ - #[Api(optional: true)] + #[Optional] public ?string $prefix; /** diff --git a/src/Accounts/Origins/OriginRequest/S3Compatible.php b/src/Accounts/Origins/OriginRequest/S3Compatible.php index 3eb10c85..e0ae15ae 100644 --- a/src/Accounts/Origins/OriginRequest/S3Compatible.php +++ b/src/Accounts/Origins/OriginRequest/S3Compatible.php @@ -4,7 +4,8 @@ namespace Imagekit\Accounts\Origins\OriginRequest; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -28,61 +29,61 @@ final class S3Compatible implements BaseModel use SdkModel; /** @var 'S3_COMPATIBLE' $type */ - #[Api] + #[Required] public string $type = 'S3_COMPATIBLE'; /** * Access key for the bucket. */ - #[Api] + #[Required] public string $accessKey; /** * S3 bucket name. */ - #[Api] + #[Required] public string $bucket; /** * Custom S3-compatible endpoint. */ - #[Api] + #[Required] public string $endpoint; /** * Display name of the origin. */ - #[Api] + #[Required] public string $name; /** * Secret key for the bucket. */ - #[Api] + #[Required] public string $secretKey; /** * URL used in the Canonical header (if enabled). */ - #[Api(optional: true)] + #[Optional] public ?string $baseUrlForCanonicalHeader; /** * Whether to send a Canonical header. */ - #[Api(optional: true)] + #[Optional] public ?bool $includeCanonicalHeader; /** * Path prefix inside the bucket. */ - #[Api(optional: true)] + #[Optional] public ?string $prefix; /** * Use path-style S3 URLs? */ - #[Api(optional: true)] + #[Optional] public ?bool $s3ForcePathStyle; /** diff --git a/src/Accounts/Origins/OriginRequest/WebFolder.php b/src/Accounts/Origins/OriginRequest/WebFolder.php index 0f5ce61b..a9b6eeb3 100644 --- a/src/Accounts/Origins/OriginRequest/WebFolder.php +++ b/src/Accounts/Origins/OriginRequest/WebFolder.php @@ -4,7 +4,8 @@ namespace Imagekit\Accounts\Origins\OriginRequest; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -24,37 +25,37 @@ final class WebFolder implements BaseModel use SdkModel; /** @var 'WEB_FOLDER' $type */ - #[Api] + #[Required] public string $type = 'WEB_FOLDER'; /** * Root URL for the web folder origin. */ - #[Api] + #[Required] public string $baseUrl; /** * Display name of the origin. */ - #[Api] + #[Required] public string $name; /** * URL used in the Canonical header (if enabled). */ - #[Api(optional: true)] + #[Optional] public ?string $baseUrlForCanonicalHeader; /** * Forward the Host header to origin? */ - #[Api(optional: true)] + #[Optional] public ?bool $forwardHostHeaderToOrigin; /** * Whether to send a Canonical header. */ - #[Api(optional: true)] + #[Optional] public ?bool $includeCanonicalHeader; /** diff --git a/src/Accounts/Origins/OriginRequest/WebProxy.php b/src/Accounts/Origins/OriginRequest/WebProxy.php index 5d95d5e3..94c68f0d 100644 --- a/src/Accounts/Origins/OriginRequest/WebProxy.php +++ b/src/Accounts/Origins/OriginRequest/WebProxy.php @@ -4,7 +4,8 @@ namespace Imagekit\Accounts\Origins\OriginRequest; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -22,25 +23,25 @@ final class WebProxy implements BaseModel use SdkModel; /** @var 'WEB_PROXY' $type */ - #[Api] + #[Required] public string $type = 'WEB_PROXY'; /** * Display name of the origin. */ - #[Api] + #[Required] public string $name; /** * URL used in the Canonical header (if enabled). */ - #[Api(optional: true)] + #[Optional] public ?string $baseUrlForCanonicalHeader; /** * Whether to send a Canonical header. */ - #[Api(optional: true)] + #[Optional] public ?bool $includeCanonicalHeader; /** diff --git a/src/Accounts/Origins/OriginResponse/AkeneoPim.php b/src/Accounts/Origins/OriginResponse/AkeneoPim.php index 49025821..df1211fe 100644 --- a/src/Accounts/Origins/OriginResponse/AkeneoPim.php +++ b/src/Accounts/Origins/OriginResponse/AkeneoPim.php @@ -4,7 +4,8 @@ namespace Imagekit\Accounts\Origins\OriginResponse; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -24,37 +25,37 @@ final class AkeneoPim implements BaseModel use SdkModel; /** @var 'AKENEO_PIM' $type */ - #[Api] + #[Required] public string $type = 'AKENEO_PIM'; /** * Unique identifier for the origin. This is generated by ImageKit when you create a new origin. */ - #[Api] + #[Required] public string $id; /** * Akeneo instance base URL. */ - #[Api] + #[Required] public string $baseUrl; /** * Whether to send a Canonical header. */ - #[Api] + #[Required] public bool $includeCanonicalHeader; /** * Display name of the origin. */ - #[Api] + #[Required] public string $name; /** * URL used in the Canonical header (if enabled). */ - #[Api(optional: true)] + #[Optional] public ?string $baseUrlForCanonicalHeader; /** diff --git a/src/Accounts/Origins/OriginResponse/AzureBlob.php b/src/Accounts/Origins/OriginResponse/AzureBlob.php index f96db808..d7e4a434 100644 --- a/src/Accounts/Origins/OriginResponse/AzureBlob.php +++ b/src/Accounts/Origins/OriginResponse/AzureBlob.php @@ -4,7 +4,8 @@ namespace Imagekit\Accounts\Origins\OriginResponse; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -26,40 +27,40 @@ final class AzureBlob implements BaseModel use SdkModel; /** @var 'AZURE_BLOB' $type */ - #[Api] + #[Required] public string $type = 'AZURE_BLOB'; /** * Unique identifier for the origin. This is generated by ImageKit when you create a new origin. */ - #[Api] + #[Required] public string $id; - #[Api] + #[Required] public string $accountName; - #[Api] + #[Required] public string $container; /** * Whether to send a Canonical header. */ - #[Api] + #[Required] public bool $includeCanonicalHeader; /** * Display name of the origin. */ - #[Api] + #[Required] public string $name; - #[Api] + #[Required] public string $prefix; /** * URL used in the Canonical header (if enabled). */ - #[Api(optional: true)] + #[Optional] public ?string $baseUrlForCanonicalHeader; /** diff --git a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php index 30620016..d2900eb4 100644 --- a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php @@ -4,7 +4,8 @@ namespace Imagekit\Accounts\Origins\OriginResponse; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -25,43 +26,43 @@ final class CloudinaryBackup implements BaseModel use SdkModel; /** @var 'CLOUDINARY_BACKUP' $type */ - #[Api] + #[Required] public string $type = 'CLOUDINARY_BACKUP'; /** * Unique identifier for the origin. This is generated by ImageKit when you create a new origin. */ - #[Api] + #[Required] public string $id; /** * S3 bucket name. */ - #[Api] + #[Required] public string $bucket; /** * Whether to send a Canonical header. */ - #[Api] + #[Required] public bool $includeCanonicalHeader; /** * Display name of the origin. */ - #[Api] + #[Required] public string $name; /** * Path prefix inside the bucket. */ - #[Api] + #[Required] public string $prefix; /** * URL used in the Canonical header (if enabled). */ - #[Api(optional: true)] + #[Optional] public ?string $baseUrlForCanonicalHeader; /** diff --git a/src/Accounts/Origins/OriginResponse/Gcs.php b/src/Accounts/Origins/OriginResponse/Gcs.php index 9f65d7fb..f176c075 100644 --- a/src/Accounts/Origins/OriginResponse/Gcs.php +++ b/src/Accounts/Origins/OriginResponse/Gcs.php @@ -4,7 +4,8 @@ namespace Imagekit\Accounts\Origins\OriginResponse; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -26,40 +27,40 @@ final class Gcs implements BaseModel use SdkModel; /** @var 'GCS' $type */ - #[Api] + #[Required] public string $type = 'GCS'; /** * Unique identifier for the origin. This is generated by ImageKit when you create a new origin. */ - #[Api] + #[Required] public string $id; - #[Api] + #[Required] public string $bucket; - #[Api] + #[Required] public string $clientEmail; /** * Whether to send a Canonical header. */ - #[Api] + #[Required] public bool $includeCanonicalHeader; /** * Display name of the origin. */ - #[Api] + #[Required] public string $name; - #[Api] + #[Required] public string $prefix; /** * URL used in the Canonical header (if enabled). */ - #[Api(optional: true)] + #[Optional] public ?string $baseUrlForCanonicalHeader; /** diff --git a/src/Accounts/Origins/OriginResponse/S3.php b/src/Accounts/Origins/OriginResponse/S3.php index 3b465864..c48f2a9a 100644 --- a/src/Accounts/Origins/OriginResponse/S3.php +++ b/src/Accounts/Origins/OriginResponse/S3.php @@ -4,7 +4,8 @@ namespace Imagekit\Accounts\Origins\OriginResponse; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -25,43 +26,43 @@ final class S3 implements BaseModel use SdkModel; /** @var 'S3' $type */ - #[Api] + #[Required] public string $type = 'S3'; /** * Unique identifier for the origin. This is generated by ImageKit when you create a new origin. */ - #[Api] + #[Required] public string $id; /** * S3 bucket name. */ - #[Api] + #[Required] public string $bucket; /** * Whether to send a Canonical header. */ - #[Api] + #[Required] public bool $includeCanonicalHeader; /** * Display name of the origin. */ - #[Api] + #[Required] public string $name; /** * Path prefix inside the bucket. */ - #[Api] + #[Required] public string $prefix; /** * URL used in the Canonical header (if enabled). */ - #[Api(optional: true)] + #[Optional] public ?string $baseUrlForCanonicalHeader; /** diff --git a/src/Accounts/Origins/OriginResponse/S3Compatible.php b/src/Accounts/Origins/OriginResponse/S3Compatible.php index 80389cf8..d4844398 100644 --- a/src/Accounts/Origins/OriginResponse/S3Compatible.php +++ b/src/Accounts/Origins/OriginResponse/S3Compatible.php @@ -4,7 +4,8 @@ namespace Imagekit\Accounts\Origins\OriginResponse; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -27,55 +28,55 @@ final class S3Compatible implements BaseModel use SdkModel; /** @var 'S3_COMPATIBLE' $type */ - #[Api] + #[Required] public string $type = 'S3_COMPATIBLE'; /** * Unique identifier for the origin. This is generated by ImageKit when you create a new origin. */ - #[Api] + #[Required] public string $id; /** * S3 bucket name. */ - #[Api] + #[Required] public string $bucket; /** * Custom S3-compatible endpoint. */ - #[Api] + #[Required] public string $endpoint; /** * Whether to send a Canonical header. */ - #[Api] + #[Required] public bool $includeCanonicalHeader; /** * Display name of the origin. */ - #[Api] + #[Required] public string $name; /** * Path prefix inside the bucket. */ - #[Api] + #[Required] public string $prefix; /** * Use path-style S3 URLs? */ - #[Api] + #[Required] public bool $s3ForcePathStyle; /** * URL used in the Canonical header (if enabled). */ - #[Api(optional: true)] + #[Optional] public ?string $baseUrlForCanonicalHeader; /** diff --git a/src/Accounts/Origins/OriginResponse/WebFolder.php b/src/Accounts/Origins/OriginResponse/WebFolder.php index 07f89fb2..3fe59f2d 100644 --- a/src/Accounts/Origins/OriginResponse/WebFolder.php +++ b/src/Accounts/Origins/OriginResponse/WebFolder.php @@ -4,7 +4,8 @@ namespace Imagekit\Accounts\Origins\OriginResponse; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -25,43 +26,43 @@ final class WebFolder implements BaseModel use SdkModel; /** @var 'WEB_FOLDER' $type */ - #[Api] + #[Required] public string $type = 'WEB_FOLDER'; /** * Unique identifier for the origin. This is generated by ImageKit when you create a new origin. */ - #[Api] + #[Required] public string $id; /** * Root URL for the web folder origin. */ - #[Api] + #[Required] public string $baseUrl; /** * Forward the Host header to origin? */ - #[Api] + #[Required] public bool $forwardHostHeaderToOrigin; /** * Whether to send a Canonical header. */ - #[Api] + #[Required] public bool $includeCanonicalHeader; /** * Display name of the origin. */ - #[Api] + #[Required] public string $name; /** * URL used in the Canonical header (if enabled). */ - #[Api(optional: true)] + #[Optional] public ?string $baseUrlForCanonicalHeader; /** diff --git a/src/Accounts/Origins/OriginResponse/WebProxy.php b/src/Accounts/Origins/OriginResponse/WebProxy.php index bbc5aea0..fc8cbe87 100644 --- a/src/Accounts/Origins/OriginResponse/WebProxy.php +++ b/src/Accounts/Origins/OriginResponse/WebProxy.php @@ -4,7 +4,8 @@ namespace Imagekit\Accounts\Origins\OriginResponse; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -23,31 +24,31 @@ final class WebProxy implements BaseModel use SdkModel; /** @var 'WEB_PROXY' $type */ - #[Api] + #[Required] public string $type = 'WEB_PROXY'; /** * Unique identifier for the origin. This is generated by ImageKit when you create a new origin. */ - #[Api] + #[Required] public string $id; /** * Whether to send a Canonical header. */ - #[Api] + #[Required] public bool $includeCanonicalHeader; /** * Display name of the origin. */ - #[Api] + #[Required] public string $name; /** * URL used in the Canonical header (if enabled). */ - #[Api(optional: true)] + #[Optional] public ?string $baseUrlForCanonicalHeader; /** diff --git a/src/Accounts/Origins/OriginUpdateParams.php b/src/Accounts/Origins/OriginUpdateParams.php index 0e486ecf..7173e153 100644 --- a/src/Accounts/Origins/OriginUpdateParams.php +++ b/src/Accounts/Origins/OriginUpdateParams.php @@ -4,7 +4,8 @@ namespace Imagekit\Accounts\Origins; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -46,106 +47,106 @@ final class OriginUpdateParams implements BaseModel use SdkParams; /** @var 'AKENEO_PIM' $type */ - #[Api] + #[Required] public string $type = 'AKENEO_PIM'; /** * Access key for the bucket. */ - #[Api] + #[Required] public string $accessKey; - #[Api] + #[Required] public string $bucket; /** * Display name of the origin. */ - #[Api] + #[Required] public string $name; /** * Secret key for the bucket. */ - #[Api] + #[Required] public string $secretKey; /** * URL used in the Canonical header (if enabled). */ - #[Api(optional: true)] + #[Optional] public ?string $baseUrlForCanonicalHeader; /** * Whether to send a Canonical header. */ - #[Api(optional: true)] + #[Optional] public ?bool $includeCanonicalHeader; - #[Api(optional: true)] + #[Optional] public ?string $prefix; /** * Custom S3-compatible endpoint. */ - #[Api] + #[Required] public string $endpoint; /** * Use path-style S3 URLs? */ - #[Api(optional: true)] + #[Optional] public ?bool $s3ForcePathStyle; /** * Akeneo instance base URL. */ - #[Api] + #[Required] public string $baseUrl; /** * Forward the Host header to origin? */ - #[Api(optional: true)] + #[Optional] public ?bool $forwardHostHeaderToOrigin; - #[Api] + #[Required] public string $clientEmail; - #[Api] + #[Required] public string $privateKey; - #[Api] + #[Required] public string $accountName; - #[Api] + #[Required] public string $container; - #[Api] + #[Required] public string $sasToken; /** * Akeneo API client ID. */ - #[Api] + #[Required] public string $clientId; /** * Akeneo API client secret. */ - #[Api] + #[Required] public string $clientSecret; /** * Akeneo API password. */ - #[Api] + #[Required] public string $password; /** * Akeneo API username. */ - #[Api] + #[Required] public string $username; /** diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php index 2eb86ecf..74c8113d 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php @@ -8,7 +8,8 @@ use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Akamai; use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Cloudinary; use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Imgix; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -37,7 +38,7 @@ final class URLEndpointCreateParams implements BaseModel /** * Description of the URL endpoint. */ - #[Api] + #[Required] public string $description; /** @@ -45,19 +46,19 @@ final class URLEndpointCreateParams implements BaseModel * * @var list|null $origins */ - #[Api(list: 'string', optional: true)] + #[Optional(list: 'string')] public ?array $origins; /** * Path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint). */ - #[Api(optional: true)] + #[Optional] public ?string $urlPrefix; /** * Configuration for third-party URL rewriting. */ - #[Api(union: URLRewriter::class, optional: true)] + #[Optional(union: URLRewriter::class)] public Cloudinary|Imgix|Akamai|null $urlRewriter; /** diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php index 6634161b..b141a5d2 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php @@ -4,7 +4,7 @@ namespace Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -17,7 +17,7 @@ final class Akamai implements BaseModel use SdkModel; /** @var 'AKAMAI' $type */ - #[Api] + #[Required] public string $type = 'AKAMAI'; public function __construct() diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php index b7fb169f..a623f93a 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php @@ -4,7 +4,8 @@ namespace Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -19,13 +20,13 @@ final class Cloudinary implements BaseModel use SdkModel; /** @var 'CLOUDINARY' $type */ - #[Api] + #[Required] public string $type = 'CLOUDINARY'; /** * Whether to preserve `/` in the rewritten URL. */ - #[Api(optional: true)] + #[Optional] public ?bool $preserveAssetDeliveryTypes; public function __construct() diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php index aa5455bb..705142d2 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php @@ -4,7 +4,7 @@ namespace Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -17,7 +17,7 @@ final class Imgix implements BaseModel use SdkModel; /** @var 'IMGIX' $type */ - #[Api] + #[Required] public string $type = 'IMGIX'; public function __construct() diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest.php b/src/Accounts/URLEndpoints/URLEndpointRequest.php index 308cc40e..4310bfca 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest.php @@ -8,7 +8,8 @@ use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\Akamai; use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\Cloudinary; use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\Imgix; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -30,7 +31,7 @@ final class URLEndpointRequest implements BaseModel /** * Description of the URL endpoint. */ - #[Api] + #[Required] public string $description; /** @@ -38,19 +39,19 @@ final class URLEndpointRequest implements BaseModel * * @var list|null $origins */ - #[Api(list: 'string', optional: true)] + #[Optional(list: 'string')] public ?array $origins; /** * Path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint). */ - #[Api(optional: true)] + #[Optional] public ?string $urlPrefix; /** * Configuration for third-party URL rewriting. */ - #[Api(union: URLRewriter::class, optional: true)] + #[Optional(union: URLRewriter::class)] public Cloudinary|Imgix|Akamai|null $urlRewriter; /** diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php index 687b40fd..63a2394c 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php @@ -4,7 +4,7 @@ namespace Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -17,7 +17,7 @@ final class Akamai implements BaseModel use SdkModel; /** @var 'AKAMAI' $type */ - #[Api] + #[Required] public string $type = 'AKAMAI'; public function __construct() diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php index 56361c98..fa32755c 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php @@ -4,7 +4,8 @@ namespace Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -19,13 +20,13 @@ final class Cloudinary implements BaseModel use SdkModel; /** @var 'CLOUDINARY' $type */ - #[Api] + #[Required] public string $type = 'CLOUDINARY'; /** * Whether to preserve `/` in the rewritten URL. */ - #[Api(optional: true)] + #[Optional] public ?bool $preserveAssetDeliveryTypes; public function __construct() diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php index 614765d6..f407f866 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php @@ -4,7 +4,7 @@ namespace Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -17,7 +17,7 @@ final class Imgix implements BaseModel use SdkModel; /** @var 'IMGIX' $type */ - #[Api] + #[Required] public string $type = 'IMGIX'; public function __construct() diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse.php b/src/Accounts/URLEndpoints/URLEndpointResponse.php index 3282b7a0..0fa86c01 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse.php @@ -8,7 +8,8 @@ use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\Akamai; use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\Cloudinary; use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\Imgix; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -31,13 +32,13 @@ final class URLEndpointResponse implements BaseModel /** * Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. */ - #[Api] + #[Required] public string $id; /** * Description of the URL endpoint. */ - #[Api] + #[Required] public string $description; /** @@ -45,19 +46,19 @@ final class URLEndpointResponse implements BaseModel * * @var list $origins */ - #[Api(list: 'string')] + #[Required(list: 'string')] public array $origins; /** * Path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint). */ - #[Api] + #[Required] public string $urlPrefix; /** * Configuration for third-party URL rewriting. */ - #[Api(union: URLRewriter::class, optional: true)] + #[Optional(union: URLRewriter::class)] public Cloudinary|Imgix|Akamai|null $urlRewriter; /** diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php index cff1eab3..dd6bd03f 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php @@ -4,7 +4,7 @@ namespace Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -17,7 +17,7 @@ final class Akamai implements BaseModel use SdkModel; /** @var 'AKAMAI' $type */ - #[Api] + #[Required] public string $type = 'AKAMAI'; public function __construct() diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php index 2ca69b96..9b0bdabc 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php @@ -4,7 +4,7 @@ namespace Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -19,13 +19,13 @@ final class Cloudinary implements BaseModel use SdkModel; /** @var 'CLOUDINARY' $type */ - #[Api] + #[Required] public string $type = 'CLOUDINARY'; /** * Whether to preserve `/` in the rewritten URL. */ - #[Api] + #[Required] public bool $preserveAssetDeliveryTypes; /** diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php index 36a3c3f7..0187e95d 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php @@ -4,7 +4,7 @@ namespace Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -17,7 +17,7 @@ final class Imgix implements BaseModel use SdkModel; /** @var 'IMGIX' $type */ - #[Api] + #[Required] public string $type = 'IMGIX'; public function __construct() diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php index 29050d5c..d86edc2e 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php @@ -8,7 +8,8 @@ use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Akamai; use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Cloudinary; use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Imgix; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -37,7 +38,7 @@ final class URLEndpointUpdateParams implements BaseModel /** * Description of the URL endpoint. */ - #[Api] + #[Required] public string $description; /** @@ -45,19 +46,19 @@ final class URLEndpointUpdateParams implements BaseModel * * @var list|null $origins */ - #[Api(list: 'string', optional: true)] + #[Optional(list: 'string')] public ?array $origins; /** * Path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint). */ - #[Api(optional: true)] + #[Optional] public ?string $urlPrefix; /** * Configuration for third-party URL rewriting. */ - #[Api(union: URLRewriter::class, optional: true)] + #[Optional(union: URLRewriter::class)] public Cloudinary|Imgix|Akamai|null $urlRewriter; /** diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php index f2992233..5e69b933 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php @@ -4,7 +4,7 @@ namespace Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -17,7 +17,7 @@ final class Akamai implements BaseModel use SdkModel; /** @var 'AKAMAI' $type */ - #[Api] + #[Required] public string $type = 'AKAMAI'; public function __construct() diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php index bee8d4af..c86739de 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php @@ -4,7 +4,8 @@ namespace Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -19,13 +20,13 @@ final class Cloudinary implements BaseModel use SdkModel; /** @var 'CLOUDINARY' $type */ - #[Api] + #[Required] public string $type = 'CLOUDINARY'; /** * Whether to preserve `/` in the rewritten URL. */ - #[Api(optional: true)] + #[Optional] public ?bool $preserveAssetDeliveryTypes; public function __construct() diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php index 515cf738..b630902b 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php @@ -4,7 +4,7 @@ namespace Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -17,7 +17,7 @@ final class Imgix implements BaseModel use SdkModel; /** @var 'IMGIX' $type */ - #[Api] + #[Required] public string $type = 'IMGIX'; public function __construct() diff --git a/src/Accounts/Usage/UsageGetParams.php b/src/Accounts/Usage/UsageGetParams.php index b6c8767d..cce6f28a 100644 --- a/src/Accounts/Usage/UsageGetParams.php +++ b/src/Accounts/Usage/UsageGetParams.php @@ -4,7 +4,7 @@ namespace Imagekit\Accounts\Usage; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -27,13 +27,13 @@ final class UsageGetParams implements BaseModel /** * Specify a `endDate` in `YYYY-MM-DD` format. It should be after the `startDate`. The difference between `startDate` and `endDate` should be less than 90 days. */ - #[Api] + #[Required] public \DateTimeInterface $endDate; /** * Specify a `startDate` in `YYYY-MM-DD` format. It should be before the `endDate`. The difference between `startDate` and `endDate` should be less than 90 days. */ - #[Api] + #[Required] public \DateTimeInterface $startDate; /** diff --git a/src/Accounts/Usage/UsageGetResponse.php b/src/Accounts/Usage/UsageGetResponse.php index ebdcc228..515cced2 100644 --- a/src/Accounts/Usage/UsageGetResponse.php +++ b/src/Accounts/Usage/UsageGetResponse.php @@ -4,7 +4,7 @@ namespace Imagekit\Accounts\Usage; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -25,31 +25,31 @@ final class UsageGetResponse implements BaseModel /** * Amount of bandwidth used in bytes. */ - #[Api(optional: true)] + #[Optional] public ?int $bandwidthBytes; /** * Number of extension units used. */ - #[Api(optional: true)] + #[Optional] public ?int $extensionUnitsCount; /** * Storage used by media library in bytes. */ - #[Api(optional: true)] + #[Optional] public ?int $mediaLibraryStorageBytes; /** * Storage used by the original cache in bytes. */ - #[Api(optional: true)] + #[Optional] public ?int $originalCacheStorageBytes; /** * Number of video processing units used. */ - #[Api(optional: true)] + #[Optional] public ?int $videoProcessingUnitsCount; public function __construct() diff --git a/src/Assets/AssetListParams.php b/src/Assets/AssetListParams.php index 5fa60c7e..5bd2cdef 100644 --- a/src/Assets/AssetListParams.php +++ b/src/Assets/AssetListParams.php @@ -7,7 +7,7 @@ use Imagekit\Assets\AssetListParams\FileType; use Imagekit\Assets\AssetListParams\Sort; use Imagekit\Assets\AssetListParams\Type; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -42,13 +42,13 @@ final class AssetListParams implements BaseModel * * @var value-of|null $fileType */ - #[Api(enum: FileType::class, optional: true)] + #[Optional(enum: FileType::class)] public ?string $fileType; /** * The maximum number of results to return in response. */ - #[Api(optional: true)] + #[Optional] public ?int $limit; /** @@ -57,7 +57,7 @@ final class AssetListParams implements BaseModel * Note : If your use case involves searching within a folder as well as its subfolders, you can use `path` parameter in `searchQuery` with appropriate operator. * Checkout [Supported parameters](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#supported-parameters) for more information. */ - #[Api(optional: true)] + #[Optional] public ?string $path; /** @@ -71,13 +71,13 @@ final class AssetListParams implements BaseModel * * [Learn more](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#advanced-search-queries) from examples. */ - #[Api(optional: true)] + #[Optional] public ?string $searchQuery; /** * The number of results to skip before returning results. */ - #[Api(optional: true)] + #[Optional] public ?int $skip; /** @@ -85,7 +85,7 @@ final class AssetListParams implements BaseModel * * @var value-of|null $sort */ - #[Api(enum: Sort::class, optional: true)] + #[Optional(enum: Sort::class)] public ?string $sort; /** @@ -98,7 +98,7 @@ final class AssetListParams implements BaseModel * * @var value-of|null $type */ - #[Api(enum: Type::class, optional: true)] + #[Optional(enum: Type::class)] public ?string $type; public function __construct() diff --git a/src/BaseOverlay.php b/src/BaseOverlay.php index f9509201..76de3e1f 100644 --- a/src/BaseOverlay.php +++ b/src/BaseOverlay.php @@ -4,7 +4,7 @@ namespace Imagekit; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\OverlayPosition\Focus; @@ -19,10 +19,10 @@ final class BaseOverlay implements BaseModel /** @use SdkModel */ use SdkModel; - #[Api(optional: true)] + #[Optional] public ?OverlayPosition $position; - #[Api(optional: true)] + #[Optional] public ?OverlayTiming $timing; public function __construct() diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index 1770a1f3..b6456c1d 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -9,7 +9,8 @@ use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs; use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\GifToVideo; use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Thumbnail; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -83,13 +84,13 @@ final class FileUploadParams implements BaseModel * * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. */ - #[Api] + #[Required] public string $file; /** * The name with which the file has to be uploaded. */ - #[Api] + #[Required] public string $fileName; /** @@ -100,14 +101,14 @@ final class FileUploadParams implements BaseModel * * **⚠️Warning**: JWT must be generated on the server-side because it is generated using your account's private API key. This field is required for authentication when uploading a file from the client-side. */ - #[Api(optional: true)] + #[Optional] public ?string $token; /** * Server-side checks to run on the asset. * Read more about [Upload API checks](/docs/api-reference/upload-file/upload-file-v2#upload-api-checks). */ - #[Api(optional: true)] + #[Optional] public ?string $checks; /** @@ -117,7 +118,7 @@ final class FileUploadParams implements BaseModel * - Can be used with fo-customtransformation. * - If this field is not specified and the file is overwritten, then customCoordinates will be removed. */ - #[Api(optional: true)] + #[Optional] public ?string $customCoordinates; /** @@ -125,13 +126,13 @@ final class FileUploadParams implements BaseModel * * @var array|null $customMetadata */ - #[Api(map: 'mixed', optional: true)] + #[Optional(map: 'mixed')] public ?array $customMetadata; /** * Optional text to describe the contents of the file. */ - #[Api(optional: true)] + #[Optional] public ?string $description; /** @@ -139,13 +140,13 @@ final class FileUploadParams implements BaseModel * * @var list|null $extensions */ - #[Api(list: ExtensionItem::class, optional: true)] + #[Optional(list: ExtensionItem::class)] public ?array $extensions; /** * The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. Using multiple `/` creates a nested folder. */ - #[Api(optional: true)] + #[Optional] public ?string $folder; /** @@ -153,7 +154,7 @@ final class FileUploadParams implements BaseModel * * If `true`, the file is marked as private and is accessible only using named transformation or signed URL. */ - #[Api(optional: true)] + #[Optional] public ?bool $isPrivateFile; /** @@ -163,31 +164,31 @@ final class FileUploadParams implements BaseModel * * The option to upload in draft state is only available in custom enterprise pricing plans. */ - #[Api(optional: true)] + #[Optional] public ?bool $isPublished; /** * If set to `true` and a file already exists at the exact location, its AITags will be removed. Set `overwriteAITags` to `false` to preserve AITags. */ - #[Api(optional: true)] + #[Optional] public ?bool $overwriteAITags; /** * If the request does not have `customMetadata`, and a file already exists at the exact location, existing customMetadata will be removed. */ - #[Api(optional: true)] + #[Optional] public ?bool $overwriteCustomMetadata; /** * If `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately. */ - #[Api(optional: true)] + #[Optional] public ?bool $overwriteFile; /** * If the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed. */ - #[Api(optional: true)] + #[Optional] public ?bool $overwriteTags; /** @@ -195,7 +196,7 @@ final class FileUploadParams implements BaseModel * * @var list>|null $responseFields */ - #[Api(list: ResponseField::class, optional: true)] + #[Optional(list: ResponseField::class)] public ?array $responseFields; /** @@ -205,7 +206,7 @@ final class FileUploadParams implements BaseModel * * @var list|null $tags */ - #[Api(list: 'string', optional: true)] + #[Optional(list: 'string')] public ?array $tags; /** @@ -219,7 +220,7 @@ final class FileUploadParams implements BaseModel * * You can mix and match any combination of post-processing types. */ - #[Api(optional: true)] + #[Optional] public ?Transformation $transformation; /** @@ -229,13 +230,13 @@ final class FileUploadParams implements BaseModel * * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. */ - #[Api(optional: true)] + #[Optional] public ?bool $useUniqueFileName; /** * The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. */ - #[Api(optional: true)] + #[Optional] public ?string $webhookUrl; /** diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation.php index bd713fa2..1c0f9774 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation.php @@ -9,7 +9,7 @@ use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs\Protocol; use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\GifToVideo; use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Thumbnail; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -41,13 +41,13 @@ final class Transformation implements BaseModel * * @var list|null $post */ - #[Api(list: Post::class, optional: true)] + #[Optional(list: Post::class)] public ?array $post; /** * Transformation string to apply before uploading the file to the Media Library. Useful for optimizing files at ingestion. */ - #[Api(optional: true)] + #[Optional] public ?string $pre; public function __construct() diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php index 2454dbd0..84b697c3 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php @@ -5,7 +5,7 @@ namespace Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post; use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs\Protocol; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -24,7 +24,7 @@ final class Abs implements BaseModel * * @var 'abs' $type */ - #[Api] + #[Required] public string $type = 'abs'; /** @@ -32,13 +32,13 @@ final class Abs implements BaseModel * * @var value-of $protocol */ - #[Api(enum: Protocol::class)] + #[Required(enum: Protocol::class)] public string $protocol; /** * List of different representations you want to create separated by an underscore. */ - #[Api] + #[Required] public string $value; /** diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php index 41a96778..87ff495f 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php @@ -4,7 +4,8 @@ namespace Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -21,14 +22,14 @@ final class GifToVideo implements BaseModel * * @var 'gif-to-video' $type */ - #[Api] + #[Required] public string $type = 'gif-to-video'; /** * Optional transformation string to apply to the output video. * **Example**: `q-80`. */ - #[Api(optional: true)] + #[Optional] public ?string $value; public function __construct() diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php index 79dee1ac..4505b521 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php @@ -4,7 +4,8 @@ namespace Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -21,14 +22,14 @@ final class Thumbnail implements BaseModel * * @var 'thumbnail' $type */ - #[Api] + #[Required] public string $type = 'thumbnail'; /** * Optional transformation string. * **Example**: `w-150,h-150`. */ - #[Api(optional: true)] + #[Optional] public ?string $value; public function __construct() diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php index fd2db642..8f153fdb 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php @@ -4,7 +4,7 @@ namespace Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -21,14 +21,14 @@ final class Transformation implements BaseModel * * @var 'transformation' $type */ - #[Api] + #[Required] public string $type = 'transformation'; /** * Transformation string (e.g. `w-200,h-200`). * Same syntax as ImageKit URL-based transformations. */ - #[Api] + #[Required] public string $value; /** diff --git a/src/Beta/V2/Files/FileUploadResponse.php b/src/Beta/V2/Files/FileUploadResponse.php index cdf8c728..11de1dc8 100644 --- a/src/Beta/V2/Files/FileUploadResponse.php +++ b/src/Beta/V2/Files/FileUploadResponse.php @@ -13,7 +13,7 @@ use Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; use Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\Type; use Imagekit\Beta\V2\Files\FileUploadResponse\VersionInfo; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Files\Metadata; @@ -60,25 +60,25 @@ final class FileUploadResponse implements BaseModel * * @var list|null $AITags */ - #[Api(list: AITag::class, nullable: true, optional: true)] + #[Optional(list: AITag::class, nullable: true)] public ?array $AITags; /** * The audio codec used in the video (only for video). */ - #[Api(optional: true)] + #[Optional] public ?string $audioCodec; /** * The bit rate of the video in kbps (only for video). */ - #[Api(optional: true)] + #[Optional] public ?int $bitRate; /** * Value of custom coordinates associated with the image in the format `x,y,width,height`. If `customCoordinates` are not defined, then it is `null`. Send `customCoordinates` in `responseFields` in API request to get the value of this field. */ - #[Api(nullable: true, optional: true)] + #[Optional(nullable: true)] public ?string $customCoordinates; /** @@ -86,19 +86,19 @@ final class FileUploadResponse implements BaseModel * * @var array|null $customMetadata */ - #[Api(map: 'mixed', optional: true)] + #[Optional(map: 'mixed')] public ?array $customMetadata; /** * Optional text to describe the contents of the file. Can be set by the user or the ai-auto-description extension. */ - #[Api(optional: true)] + #[Optional] public ?string $description; /** * The duration of the video in seconds (only for video). */ - #[Api(optional: true)] + #[Optional] public ?int $duration; /** @@ -106,7 +106,7 @@ final class FileUploadResponse implements BaseModel * * @var array|null $embeddedMetadata */ - #[Api(map: 'mixed', optional: true)] + #[Optional(map: 'mixed')] public ?array $embeddedMetadata; /** @@ -118,55 +118,55 @@ final class FileUploadResponse implements BaseModel * * If no extension was requested, then this parameter is not returned. */ - #[Api(optional: true)] + #[Optional] public ?ExtensionStatus $extensionStatus; /** * Unique fileId. Store this fileld in your database, as this will be used to perform update action on this file. */ - #[Api(optional: true)] + #[Optional] public ?string $fileId; /** * The relative path of the file in the media library e.g. `/marketing-assets/new-banner.jpg`. */ - #[Api(optional: true)] + #[Optional] public ?string $filePath; /** * Type of the uploaded file. Possible values are `image`, `non-image`. */ - #[Api(optional: true)] + #[Optional] public ?string $fileType; /** * Height of the image in pixels (Only for images). */ - #[Api(optional: true)] + #[Optional] public ?float $height; /** * Is the file marked as private. It can be either `true` or `false`. Send `isPrivateFile` in `responseFields` in API request to get the value of this field. */ - #[Api(optional: true)] + #[Optional] public ?bool $isPrivateFile; /** * Is the file published or in draft state. It can be either `true` or `false`. Send `isPublished` in `responseFields` in API request to get the value of this field. */ - #[Api(optional: true)] + #[Optional] public ?bool $isPublished; /** * Legacy metadata. Send `metadata` in `responseFields` in API request to get metadata in the upload API response. */ - #[Api(optional: true)] + #[Optional] public ?Metadata $metadata; /** * Name of the asset. */ - #[Api(optional: true)] + #[Optional] public ?string $name; /** @@ -178,13 +178,13 @@ final class FileUploadResponse implements BaseModel * * @var array|null $selectedFieldsSchema */ - #[Api(map: SelectedFieldsSchema::class, optional: true)] + #[Optional(map: SelectedFieldsSchema::class)] public ?array $selectedFieldsSchema; /** * Size of the image file in Bytes. */ - #[Api(optional: true)] + #[Optional] public ?float $size; /** @@ -192,37 +192,37 @@ final class FileUploadResponse implements BaseModel * * @var list|null $tags */ - #[Api(list: 'string', nullable: true, optional: true)] + #[Optional(list: 'string', nullable: true)] public ?array $tags; /** * In the case of an image, a small thumbnail URL. */ - #[Api(optional: true)] + #[Optional] public ?string $thumbnailUrl; /** * A publicly accessible URL of the file. */ - #[Api(optional: true)] + #[Optional] public ?string $url; /** * An object containing the file or file version's `id` (versionId) and `name`. */ - #[Api(optional: true)] + #[Optional] public ?VersionInfo $versionInfo; /** * The video codec used in the video (only for video). */ - #[Api(optional: true)] + #[Optional] public ?string $videoCodec; /** * Width of the image in pixels (Only for Images). */ - #[Api(optional: true)] + #[Optional] public ?float $width; public function __construct() diff --git a/src/Beta/V2/Files/FileUploadResponse/AITag.php b/src/Beta/V2/Files/FileUploadResponse/AITag.php index 147cc716..3be8dd9f 100644 --- a/src/Beta/V2/Files/FileUploadResponse/AITag.php +++ b/src/Beta/V2/Files/FileUploadResponse/AITag.php @@ -4,7 +4,7 @@ namespace Imagekit\Beta\V2\Files\FileUploadResponse; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -21,19 +21,19 @@ final class AITag implements BaseModel /** * Confidence score of the tag. */ - #[Api(optional: true)] + #[Optional] public ?float $confidence; /** * Name of the tag. */ - #[Api(optional: true)] + #[Optional] public ?string $name; /** * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. */ - #[Api(optional: true)] + #[Optional] public ?string $source; public function __construct() diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php index 1bef904f..156c3de5 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php @@ -8,7 +8,7 @@ use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\AwsAutoTagging; use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\GoogleAutoTagging; use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\RemoveBg; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -34,19 +34,19 @@ final class ExtensionStatus implements BaseModel use SdkModel; /** @var value-of|null $ai_auto_description */ - #[Api('ai-auto-description', enum: AIAutoDescription::class, optional: true)] + #[Optional('ai-auto-description', enum: AIAutoDescription::class)] public ?string $ai_auto_description; /** @var value-of|null $aws_auto_tagging */ - #[Api('aws-auto-tagging', enum: AwsAutoTagging::class, optional: true)] + #[Optional('aws-auto-tagging', enum: AwsAutoTagging::class)] public ?string $aws_auto_tagging; /** @var value-of|null $google_auto_tagging */ - #[Api('google-auto-tagging', enum: GoogleAutoTagging::class, optional: true)] + #[Optional('google-auto-tagging', enum: GoogleAutoTagging::class)] public ?string $google_auto_tagging; /** @var value-of|null $remove_bg */ - #[Api('remove-bg', enum: RemoveBg::class, optional: true)] + #[Optional('remove-bg', enum: RemoveBg::class)] public ?string $remove_bg; public function __construct() diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php index f19dc60d..a0828bdc 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php @@ -7,7 +7,8 @@ use Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue; use Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\SelectOption; use Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\Type; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -35,7 +36,7 @@ final class SelectedFieldsSchema implements BaseModel * * @var value-of $type */ - #[Api(enum: Type::class)] + #[Required(enum: Type::class)] public string $type; /** @@ -43,43 +44,43 @@ final class SelectedFieldsSchema implements BaseModel * * @var string|float|bool|list|null $defaultValue */ - #[Api(union: DefaultValue::class, optional: true)] + #[Optional(union: DefaultValue::class)] public string|float|bool|array|null $defaultValue; /** * Specifies if the custom metadata field is required or not. */ - #[Api(optional: true)] + #[Optional] public ?bool $isValueRequired; /** * Maximum length of string. Only set if `type` is set to `Text` or `Textarea`. */ - #[Api(optional: true)] + #[Optional] public ?float $maxLength; /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. */ - #[Api(optional: true)] + #[Optional] public string|float|null $maxValue; /** * Minimum length of string. Only set if `type` is set to `Text` or `Textarea`. */ - #[Api(optional: true)] + #[Optional] public ?float $minLength; /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. */ - #[Api(optional: true)] + #[Optional] public string|float|null $minValue; /** * Indicates whether the custom metadata field is read only. A read only field cannot be modified after being set. This field is configurable only via the **Path policy** feature. */ - #[Api(optional: true)] + #[Optional] public ?bool $readOnly; /** @@ -87,13 +88,13 @@ final class SelectedFieldsSchema implements BaseModel * * @var list|null $selectOptions */ - #[Api(list: SelectOption::class, optional: true)] + #[Optional(list: SelectOption::class)] public ?array $selectOptions; /** * Specifies if the selectOptions array is truncated. It is truncated when number of options are > 100. */ - #[Api(optional: true)] + #[Optional] public ?bool $selectOptionsTruncated; /** diff --git a/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php b/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php index 1f87ff6c..1b5136ac 100644 --- a/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php +++ b/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php @@ -4,7 +4,7 @@ namespace Imagekit\Beta\V2\Files\FileUploadResponse; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -21,13 +21,13 @@ final class VersionInfo implements BaseModel /** * Unique identifier of the file version. */ - #[Api(optional: true)] + #[Optional] public ?string $id; /** * Name of the file version. */ - #[Api(optional: true)] + #[Optional] public ?string $name; public function __construct() diff --git a/src/Cache/Invalidation/InvalidationCreateParams.php b/src/Cache/Invalidation/InvalidationCreateParams.php index 24be847d..e62844bc 100644 --- a/src/Cache/Invalidation/InvalidationCreateParams.php +++ b/src/Cache/Invalidation/InvalidationCreateParams.php @@ -4,7 +4,7 @@ namespace Imagekit\Cache\Invalidation; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -25,7 +25,7 @@ final class InvalidationCreateParams implements BaseModel /** * The full URL of the file to be purged. */ - #[Api] + #[Required] public string $url; /** diff --git a/src/Cache/Invalidation/InvalidationGetResponse.php b/src/Cache/Invalidation/InvalidationGetResponse.php index c4ce3db9..54ed036e 100644 --- a/src/Cache/Invalidation/InvalidationGetResponse.php +++ b/src/Cache/Invalidation/InvalidationGetResponse.php @@ -5,7 +5,7 @@ namespace Imagekit\Cache\Invalidation; use Imagekit\Cache\Invalidation\InvalidationGetResponse\Status; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -24,7 +24,7 @@ final class InvalidationGetResponse implements BaseModel * * @var value-of|null $status */ - #[Api(enum: Status::class, optional: true)] + #[Optional(enum: Status::class)] public ?string $status; public function __construct() diff --git a/src/Cache/Invalidation/InvalidationNewResponse.php b/src/Cache/Invalidation/InvalidationNewResponse.php index bc6a14c5..710165fe 100644 --- a/src/Cache/Invalidation/InvalidationNewResponse.php +++ b/src/Cache/Invalidation/InvalidationNewResponse.php @@ -4,7 +4,7 @@ namespace Imagekit\Cache\Invalidation; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -19,7 +19,7 @@ final class InvalidationNewResponse implements BaseModel /** * Unique identifier of the purge request. This can be used to check the status of the purge request. */ - #[Api(optional: true)] + #[Optional] public ?string $requestId; public function __construct() diff --git a/src/Core/Attributes/Optional.php b/src/Core/Attributes/Optional.php new file mode 100644 index 00000000..30402964 --- /dev/null +++ b/src/Core/Attributes/Optional.php @@ -0,0 +1,35 @@ +|Converter|string|null $type + * @param class-string<\BackedEnum>|Converter|null $enum + * @param class-string|Converter|null $union + * @param class-string|Converter|string|null $list + * @param class-string|Converter|string|null $map + */ + public function __construct( + ?string $apiName = null, + Converter|string|null $type = null, + Converter|string|null $enum = null, + Converter|string|null $union = null, + Converter|string|null $list = null, + Converter|string|null $map = null, + bool $nullable = false, + ) { + parent::__construct(apiName: $apiName, type: $type, enum: $enum, union: $union, list: $list, map: $map, nullable: $nullable); + $this->optional = true; + } +} diff --git a/src/Core/Attributes/Api.php b/src/Core/Attributes/Required.php similarity index 77% rename from src/Core/Attributes/Api.php rename to src/Core/Attributes/Required.php index 3ed05474..e5c1e23b 100644 --- a/src/Core/Attributes/Api.php +++ b/src/Core/Attributes/Required.php @@ -14,11 +14,17 @@ * @internal */ #[\Attribute(\Attribute::TARGET_PROPERTY)] -final class Api +class Required { /** @var class-string|Converter|string|null */ public readonly Converter|string|null $type; + public readonly ?string $apiName; + + public bool $optional; + + public readonly bool $nullable; + /** @var array */ private static array $enumConverters = []; @@ -30,14 +36,13 @@ final class Api * @param class-string|Converter|string|null $map */ public function __construct( - public readonly ?string $apiName = null, + ?string $apiName = null, Converter|string|null $type = null, Converter|string|null $enum = null, Converter|string|null $union = null, Converter|string|null $list = null, Converter|string|null $map = null, - public readonly bool $nullable = false, - public readonly bool $optional = false, + bool $nullable = false, ) { $type ??= $union; if (null !== $list) { @@ -47,17 +52,21 @@ public function __construct( $type ??= new MapOf($map); } if (null !== $enum) { - $type ??= $enum instanceof Converter ? $enum : $this->getEnumConverter($enum); + $type ??= $enum instanceof Converter ? $enum : self::enumConverter($enum); } + $this->apiName = $apiName; $this->type = $type; + $this->optional = false; + $this->nullable = $nullable; } /** @property class-string<\BackedEnum> $enum */ - private function getEnumConverter(string $enum): Converter + private static function enumConverter(string $enum): Converter { if (!isset(self::$enumConverters[$enum])) { - $converter = new EnumOf(array_column($enum::cases(), 'value')); // @phpstan-ignore-line + // @phpstan-ignore-next-line argument.type + $converter = new EnumOf(array_column($enum::cases(), column_key: 'value')); self::$enumConverters[$enum] = $converter; } diff --git a/src/Core/Conversion/ModelOf.php b/src/Core/Conversion/ModelOf.php index c72be916..8448d93b 100644 --- a/src/Core/Conversion/ModelOf.php +++ b/src/Core/Conversion/ModelOf.php @@ -4,7 +4,8 @@ namespace Imagekit\Core\Conversion; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Core\Conversion; use Imagekit\Core\Conversion\Contracts\Converter; @@ -27,7 +28,9 @@ public function __construct(public readonly \ReflectionClass $class) $properties = []; foreach ($this->class->getProperties() as $property) { - if (!empty($property->getAttributes(Api::class))) { + $attributes = [...$property->getAttributes(Required::class), ...$property->getAttributes(Optional::class)]; + + if (!empty($attributes)) { $name = $property->getName(); $properties[$name] = new PropertyInfo($property); } @@ -97,7 +100,8 @@ public function coerce(mixed $value, CoerceState $state): mixed public function from(array $data): BaseModel { $instance = $this->class->newInstanceWithoutConstructor(); - $instance->__unserialize($data); // @phpstan-ignore-line + // @phpstan-ignore-next-line + $instance->__unserialize($data); return $instance; } diff --git a/src/Core/Conversion/PropertyInfo.php b/src/Core/Conversion/PropertyInfo.php index 8cbd2f92..9722f607 100644 --- a/src/Core/Conversion/PropertyInfo.php +++ b/src/Core/Conversion/PropertyInfo.php @@ -4,7 +4,8 @@ namespace Imagekit\Core\Conversion; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; @@ -28,9 +29,10 @@ public function __construct(public readonly \ReflectionProperty $property) $apiName = $property->getName(); $type = $property->getType(); $optional = false; + $attributes = [...$property->getAttributes(Required::class), ...$property->getAttributes(Optional::class)]; - foreach ($property->getAttributes(Api::class) as $attr) { - /** @var Api $attribute */ + foreach ($attributes as $attr) { + /** @var Required $attribute */ $attribute = $attr->newInstance(); $apiName = $attribute->apiName ?? $apiName; diff --git a/src/CustomMetadataFields/CustomMetadataField.php b/src/CustomMetadataFields/CustomMetadataField.php index c4b94fc5..b58cde3c 100644 --- a/src/CustomMetadataFields/CustomMetadataField.php +++ b/src/CustomMetadataFields/CustomMetadataField.php @@ -4,7 +4,7 @@ namespace Imagekit\CustomMetadataFields; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\CustomMetadataFields\CustomMetadataField\Schema; @@ -25,25 +25,25 @@ final class CustomMetadataField implements BaseModel /** * Unique identifier for the custom metadata field. Use this to update the field. */ - #[Api] + #[Required] public string $id; /** * Human readable name of the custom metadata field. This name is displayed as form field label to the users while setting field value on the asset in the media library UI. */ - #[Api] + #[Required] public string $label; /** * API name of the custom metadata field. This becomes the key while setting `customMetadata` (key-value object) for an asset using upload or update API. */ - #[Api] + #[Required] public string $name; /** * An object that describes the rules for the custom metadata field value. */ - #[Api] + #[Required] public Schema $schema; /** diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema.php b/src/CustomMetadataFields/CustomMetadataField/Schema.php index 2e4283c0..598dbe62 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema.php @@ -4,7 +4,8 @@ namespace Imagekit\CustomMetadataFields\CustomMetadataField; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\CustomMetadataFields\CustomMetadataField\Schema\DefaultValue; @@ -35,7 +36,7 @@ final class Schema implements BaseModel * * @var value-of $type */ - #[Api(enum: Type::class)] + #[Required(enum: Type::class)] public string $type; /** @@ -43,37 +44,37 @@ final class Schema implements BaseModel * * @var string|float|bool|list|null $defaultValue */ - #[Api(union: DefaultValue::class, optional: true)] + #[Optional(union: DefaultValue::class)] public string|float|bool|array|null $defaultValue; /** * Specifies if the this custom metadata field is required or not. */ - #[Api(optional: true)] + #[Optional] public ?bool $isValueRequired; /** * Maximum length of string. Only set if `type` is set to `Text` or `Textarea`. */ - #[Api(optional: true)] + #[Optional] public ?float $maxLength; /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. */ - #[Api(optional: true)] + #[Optional] public string|float|null $maxValue; /** * Minimum length of string. Only set if `type` is set to `Text` or `Textarea`. */ - #[Api(optional: true)] + #[Optional] public ?float $minLength; /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. */ - #[Api(optional: true)] + #[Optional] public string|float|null $minValue; /** @@ -81,7 +82,7 @@ final class Schema implements BaseModel * * @var list|null $selectOptions */ - #[Api(list: SelectOption::class, optional: true)] + #[Optional(list: SelectOption::class)] public ?array $selectOptions; /** diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php index d35523ac..aade0326 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php @@ -4,7 +4,7 @@ namespace Imagekit\CustomMetadataFields; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -40,16 +40,16 @@ final class CustomMetadataFieldCreateParams implements BaseModel /** * Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. */ - #[Api] + #[Required] public string $label; /** * API name of the custom metadata field. This should be unique across all (including deleted) custom metadata fields. */ - #[Api] + #[Required] public string $name; - #[Api] + #[Required] public Schema $schema; /** diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php index 9318b716..5ebfada2 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php @@ -4,7 +4,8 @@ namespace Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\DefaultValue; @@ -33,7 +34,7 @@ final class Schema implements BaseModel * * @var value-of $type */ - #[Api(enum: Type::class)] + #[Required(enum: Type::class)] public string $type; /** @@ -41,37 +42,37 @@ final class Schema implements BaseModel * * @var string|float|bool|list|null $defaultValue */ - #[Api(union: DefaultValue::class, optional: true)] + #[Optional(union: DefaultValue::class)] public string|float|bool|array|null $defaultValue; /** * Sets this custom metadata field as required. Setting custom metadata fields on an asset will throw error if the value for all required fields are not present in upload or update asset API request body. */ - #[Api(optional: true)] + #[Optional] public ?bool $isValueRequired; /** * Maximum length of string. Only set this property if `type` is set to `Text` or `Textarea`. */ - #[Api(optional: true)] + #[Optional] public ?float $maxLength; /** * Maximum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. */ - #[Api(optional: true)] + #[Optional] public string|float|null $maxValue; /** * Minimum length of string. Only set this property if `type` is set to `Text` or `Textarea`. */ - #[Api(optional: true)] + #[Optional] public ?float $minLength; /** * Minimum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. */ - #[Api(optional: true)] + #[Optional] public string|float|null $minValue; /** @@ -79,7 +80,7 @@ final class Schema implements BaseModel * * @var list|null $selectOptions */ - #[Api(list: SelectOption::class, optional: true)] + #[Optional(list: SelectOption::class)] public ?array $selectOptions; /** diff --git a/src/CustomMetadataFields/CustomMetadataFieldListParams.php b/src/CustomMetadataFields/CustomMetadataFieldListParams.php index 4de550f5..2748ca6a 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldListParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldListParams.php @@ -4,7 +4,7 @@ namespace Imagekit\CustomMetadataFields; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -29,13 +29,13 @@ final class CustomMetadataFieldListParams implements BaseModel /** * The folder path (e.g., `/path/to/folder`) for which to retrieve applicable custom metadata fields. Useful for determining path-specific field selections when the [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in use. */ - #[Api(optional: true)] + #[Optional] public ?string $folderPath; /** * Set it to `true` to include deleted field objects in the API response. */ - #[Api(optional: true)] + #[Optional] public ?bool $includeDeleted; public function __construct() diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php index 97cd8816..5d1e97fb 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php @@ -4,7 +4,7 @@ namespace Imagekit\CustomMetadataFields; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -37,13 +37,13 @@ final class CustomMetadataFieldUpdateParams implements BaseModel /** * Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. This parameter is required if `schema` is not provided. */ - #[Api(optional: true)] + #[Optional] public ?string $label; /** * An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. */ - #[Api(optional: true)] + #[Optional] public ?Schema $schema; public function __construct() diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php index b74f659c..654b914b 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php @@ -4,7 +4,7 @@ namespace Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue; @@ -33,37 +33,37 @@ final class Schema implements BaseModel * * @var string|float|bool|list|null $defaultValue */ - #[Api(union: DefaultValue::class, optional: true)] + #[Optional(union: DefaultValue::class)] public string|float|bool|array|null $defaultValue; /** * Sets this custom metadata field as required. Setting custom metadata fields on an asset will throw error if the value for all required fields are not present in upload or update asset API request body. */ - #[Api(optional: true)] + #[Optional] public ?bool $isValueRequired; /** * Maximum length of string. Only set this property if `type` is set to `Text` or `Textarea`. */ - #[Api(optional: true)] + #[Optional] public ?float $maxLength; /** * Maximum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. */ - #[Api(optional: true)] + #[Optional] public string|float|null $maxValue; /** * Minimum length of string. Only set this property if `type` is set to `Text` or `Textarea`. */ - #[Api(optional: true)] + #[Optional] public ?float $minLength; /** * Minimum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. */ - #[Api(optional: true)] + #[Optional] public string|float|null $minValue; /** @@ -71,7 +71,7 @@ final class Schema implements BaseModel * * @var list|null $selectOptions */ - #[Api(list: SelectOption::class, optional: true)] + #[Optional(list: SelectOption::class)] public ?array $selectOptions; public function __construct() diff --git a/src/ExtensionItem/AIAutoDescription.php b/src/ExtensionItem/AIAutoDescription.php index 756b2369..c3f79df6 100644 --- a/src/ExtensionItem/AIAutoDescription.php +++ b/src/ExtensionItem/AIAutoDescription.php @@ -4,7 +4,7 @@ namespace Imagekit\ExtensionItem; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -21,7 +21,7 @@ final class AIAutoDescription implements BaseModel * * @var 'ai-auto-description' $name */ - #[Api] + #[Required] public string $name = 'ai-auto-description'; public function __construct() diff --git a/src/ExtensionItem/AutoTaggingExtension.php b/src/ExtensionItem/AutoTaggingExtension.php index 6801801a..8ed29b2d 100644 --- a/src/ExtensionItem/AutoTaggingExtension.php +++ b/src/ExtensionItem/AutoTaggingExtension.php @@ -4,7 +4,7 @@ namespace Imagekit\ExtensionItem; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\ExtensionItem\AutoTaggingExtension\Name; @@ -22,13 +22,13 @@ final class AutoTaggingExtension implements BaseModel /** * Maximum number of tags to attach to the asset. */ - #[Api] + #[Required] public int $maxTags; /** * Minimum confidence level for tags to be considered valid. */ - #[Api] + #[Required] public int $minConfidence; /** @@ -36,7 +36,7 @@ final class AutoTaggingExtension implements BaseModel * * @var value-of $name */ - #[Api(enum: Name::class)] + #[Required(enum: Name::class)] public string $name; /** diff --git a/src/ExtensionItem/RemoveBg.php b/src/ExtensionItem/RemoveBg.php index 6da96a69..f3ffc341 100644 --- a/src/ExtensionItem/RemoveBg.php +++ b/src/ExtensionItem/RemoveBg.php @@ -4,7 +4,8 @@ namespace Imagekit\ExtensionItem; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\ExtensionItem\RemoveBg\Options; @@ -22,10 +23,10 @@ final class RemoveBg implements BaseModel * * @var 'remove-bg' $name */ - #[Api] + #[Required] public string $name = 'remove-bg'; - #[Api(optional: true)] + #[Optional] public ?Options $options; public function __construct() diff --git a/src/ExtensionItem/RemoveBg/Options.php b/src/ExtensionItem/RemoveBg/Options.php index 1dc6ef17..7be2611d 100644 --- a/src/ExtensionItem/RemoveBg/Options.php +++ b/src/ExtensionItem/RemoveBg/Options.php @@ -4,7 +4,7 @@ namespace Imagekit\ExtensionItem\RemoveBg; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -24,25 +24,25 @@ final class Options implements BaseModel /** * Whether to add an artificial shadow to the result. Default is false. Note: Adding shadows is currently only supported for car photos. */ - #[Api(optional: true)] + #[Optional] public ?bool $add_shadow; /** * Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or color name (e.g., "green"). If this parameter is set, `bg_image_url` must be empty. */ - #[Api(optional: true)] + #[Optional] public ?string $bg_color; /** * Sets a background image from a URL. If this parameter is set, `bg_color` must be empty. */ - #[Api(optional: true)] + #[Optional] public ?string $bg_image_url; /** * Allows semi-transparent regions in the result. Default is true. Note: Semitransparency is currently only supported for car windows. */ - #[Api(optional: true)] + #[Optional] public ?bool $semitransparency; public function __construct() diff --git a/src/Files/Bulk/BulkAddTagsParams.php b/src/Files/Bulk/BulkAddTagsParams.php index 8a510597..a1ef1115 100644 --- a/src/Files/Bulk/BulkAddTagsParams.php +++ b/src/Files/Bulk/BulkAddTagsParams.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\Bulk; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -29,7 +29,7 @@ final class BulkAddTagsParams implements BaseModel * * @var list $fileIds */ - #[Api(list: 'string')] + #[Required(list: 'string')] public array $fileIds; /** @@ -37,7 +37,7 @@ final class BulkAddTagsParams implements BaseModel * * @var list $tags */ - #[Api(list: 'string')] + #[Required(list: 'string')] public array $tags; /** diff --git a/src/Files/Bulk/BulkAddTagsResponse.php b/src/Files/Bulk/BulkAddTagsResponse.php index 2a9458a7..59511a48 100644 --- a/src/Files/Bulk/BulkAddTagsResponse.php +++ b/src/Files/Bulk/BulkAddTagsResponse.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\Bulk; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -23,7 +23,7 @@ final class BulkAddTagsResponse implements BaseModel * * @var list|null $successfullyUpdatedFileIds */ - #[Api(list: 'string', optional: true)] + #[Optional(list: 'string')] public ?array $successfullyUpdatedFileIds; public function __construct() diff --git a/src/Files/Bulk/BulkDeleteParams.php b/src/Files/Bulk/BulkDeleteParams.php index ea4c8a9a..535ca4c0 100644 --- a/src/Files/Bulk/BulkDeleteParams.php +++ b/src/Files/Bulk/BulkDeleteParams.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\Bulk; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -31,7 +31,7 @@ final class BulkDeleteParams implements BaseModel * * @var list $fileIds */ - #[Api(list: 'string')] + #[Required(list: 'string')] public array $fileIds; /** diff --git a/src/Files/Bulk/BulkDeleteResponse.php b/src/Files/Bulk/BulkDeleteResponse.php index 1d167f34..db776972 100644 --- a/src/Files/Bulk/BulkDeleteResponse.php +++ b/src/Files/Bulk/BulkDeleteResponse.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\Bulk; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -23,7 +23,7 @@ final class BulkDeleteResponse implements BaseModel * * @var list|null $successfullyDeletedFileIds */ - #[Api(list: 'string', optional: true)] + #[Optional(list: 'string')] public ?array $successfullyDeletedFileIds; public function __construct() diff --git a/src/Files/Bulk/BulkRemoveAITagsParams.php b/src/Files/Bulk/BulkRemoveAITagsParams.php index 21a4578a..53be90a7 100644 --- a/src/Files/Bulk/BulkRemoveAITagsParams.php +++ b/src/Files/Bulk/BulkRemoveAITagsParams.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\Bulk; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -29,7 +29,7 @@ final class BulkRemoveAITagsParams implements BaseModel * * @var list $AITags */ - #[Api(list: 'string')] + #[Required(list: 'string')] public array $AITags; /** @@ -37,7 +37,7 @@ final class BulkRemoveAITagsParams implements BaseModel * * @var list $fileIds */ - #[Api(list: 'string')] + #[Required(list: 'string')] public array $fileIds; /** diff --git a/src/Files/Bulk/BulkRemoveAITagsResponse.php b/src/Files/Bulk/BulkRemoveAITagsResponse.php index 5d548331..a0b8f928 100644 --- a/src/Files/Bulk/BulkRemoveAITagsResponse.php +++ b/src/Files/Bulk/BulkRemoveAITagsResponse.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\Bulk; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -23,7 +23,7 @@ final class BulkRemoveAITagsResponse implements BaseModel * * @var list|null $successfullyUpdatedFileIds */ - #[Api(list: 'string', optional: true)] + #[Optional(list: 'string')] public ?array $successfullyUpdatedFileIds; public function __construct() diff --git a/src/Files/Bulk/BulkRemoveTagsParams.php b/src/Files/Bulk/BulkRemoveTagsParams.php index c29254e3..70f01316 100644 --- a/src/Files/Bulk/BulkRemoveTagsParams.php +++ b/src/Files/Bulk/BulkRemoveTagsParams.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\Bulk; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -29,7 +29,7 @@ final class BulkRemoveTagsParams implements BaseModel * * @var list $fileIds */ - #[Api(list: 'string')] + #[Required(list: 'string')] public array $fileIds; /** @@ -37,7 +37,7 @@ final class BulkRemoveTagsParams implements BaseModel * * @var list $tags */ - #[Api(list: 'string')] + #[Required(list: 'string')] public array $tags; /** diff --git a/src/Files/Bulk/BulkRemoveTagsResponse.php b/src/Files/Bulk/BulkRemoveTagsResponse.php index f25f58d2..a24f1079 100644 --- a/src/Files/Bulk/BulkRemoveTagsResponse.php +++ b/src/Files/Bulk/BulkRemoveTagsResponse.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\Bulk; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -23,7 +23,7 @@ final class BulkRemoveTagsResponse implements BaseModel * * @var list|null $successfullyUpdatedFileIds */ - #[Api(list: 'string', optional: true)] + #[Optional(list: 'string')] public ?array $successfullyUpdatedFileIds; public function __construct() diff --git a/src/Files/File.php b/src/Files/File.php index acfca5ed..11893e3c 100644 --- a/src/Files/File.php +++ b/src/Files/File.php @@ -4,7 +4,7 @@ namespace Imagekit\Files; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Files\File\AITag; @@ -51,19 +51,19 @@ final class File implements BaseModel * * @var list|null $AITags */ - #[Api(list: AITag::class, nullable: true, optional: true)] + #[Optional(list: AITag::class, nullable: true)] public ?array $AITags; /** * Date and time when the file was uploaded. The date and time is in ISO8601 format. */ - #[Api(optional: true)] + #[Optional] public ?\DateTimeInterface $createdAt; /** * An string with custom coordinates of the file. */ - #[Api(nullable: true, optional: true)] + #[Optional(nullable: true)] public ?string $customCoordinates; /** @@ -71,67 +71,67 @@ final class File implements BaseModel * * @var array|null $customMetadata */ - #[Api(map: 'mixed', optional: true)] + #[Optional(map: 'mixed')] public ?array $customMetadata; /** * Optional text to describe the contents of the file. Can be set by the user or the ai-auto-description extension. */ - #[Api(optional: true)] + #[Optional] public ?string $description; /** * Unique identifier of the asset. */ - #[Api(optional: true)] + #[Optional] public ?string $fileId; /** * Path of the file. This is the path you would use in the URL to access the file. For example, if the file is at the root of the media library, the path will be `/file.jpg`. If the file is inside a folder named `images`, the path will be `/images/file.jpg`. */ - #[Api(optional: true)] + #[Optional] public ?string $filePath; /** * Type of the file. Possible values are `image`, `non-image`. */ - #[Api(optional: true)] + #[Optional] public ?string $fileType; /** * Specifies if the image has an alpha channel. */ - #[Api(optional: true)] + #[Optional] public ?bool $hasAlpha; /** * Height of the file. */ - #[Api(optional: true)] + #[Optional] public ?float $height; /** * Specifies if the file is private or not. */ - #[Api(optional: true)] + #[Optional] public ?bool $isPrivateFile; /** * Specifies if the file is published or not. */ - #[Api(optional: true)] + #[Optional] public ?bool $isPublished; /** * MIME type of the file. */ - #[Api(optional: true)] + #[Optional] public ?string $mime; /** * Name of the asset. */ - #[Api(optional: true)] + #[Optional] public ?string $name; /** @@ -143,13 +143,13 @@ final class File implements BaseModel * * @var array|null $selectedFieldsSchema */ - #[Api(map: SelectedFieldsSchema::class, optional: true)] + #[Optional(map: SelectedFieldsSchema::class)] public ?array $selectedFieldsSchema; /** * Size of the file in bytes. */ - #[Api(optional: true)] + #[Optional] public ?float $size; /** @@ -157,13 +157,13 @@ final class File implements BaseModel * * @var list|null $tags */ - #[Api(list: 'string', nullable: true, optional: true)] + #[Optional(list: 'string', nullable: true)] public ?array $tags; /** * URL of the thumbnail image. This URL is used to access the thumbnail image of the file in the media library. */ - #[Api(optional: true)] + #[Optional] public ?string $thumbnail; /** @@ -171,31 +171,31 @@ final class File implements BaseModel * * @var value-of|null $type */ - #[Api(enum: Type::class, optional: true)] + #[Optional(enum: Type::class)] public ?string $type; /** * Date and time when the file was last updated. The date and time is in ISO8601 format. */ - #[Api(optional: true)] + #[Optional] public ?\DateTimeInterface $updatedAt; /** * URL of the file. */ - #[Api(optional: true)] + #[Optional] public ?string $url; /** * An object with details of the file version. */ - #[Api(optional: true)] + #[Optional] public ?VersionInfo $versionInfo; /** * Width of the file. */ - #[Api(optional: true)] + #[Optional] public ?float $width; public function __construct() diff --git a/src/Files/File/AITag.php b/src/Files/File/AITag.php index 5dfa04a4..4c975e96 100644 --- a/src/Files/File/AITag.php +++ b/src/Files/File/AITag.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\File; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -21,19 +21,19 @@ final class AITag implements BaseModel /** * Confidence score of the tag. */ - #[Api(optional: true)] + #[Optional] public ?float $confidence; /** * Name of the tag. */ - #[Api(optional: true)] + #[Optional] public ?string $name; /** * Source of the tag. Possible values are `google-auto-tagging` and `aws-auto-tagging`. */ - #[Api(optional: true)] + #[Optional] public ?string $source; public function __construct() diff --git a/src/Files/File/SelectedFieldsSchema.php b/src/Files/File/SelectedFieldsSchema.php index 046c48f0..8b05b851 100644 --- a/src/Files/File/SelectedFieldsSchema.php +++ b/src/Files/File/SelectedFieldsSchema.php @@ -4,7 +4,8 @@ namespace Imagekit\Files\File; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Files\File\SelectedFieldsSchema\DefaultValue; @@ -35,7 +36,7 @@ final class SelectedFieldsSchema implements BaseModel * * @var value-of $type */ - #[Api(enum: Type::class)] + #[Required(enum: Type::class)] public string $type; /** @@ -43,43 +44,43 @@ final class SelectedFieldsSchema implements BaseModel * * @var string|float|bool|list|null $defaultValue */ - #[Api(union: DefaultValue::class, optional: true)] + #[Optional(union: DefaultValue::class)] public string|float|bool|array|null $defaultValue; /** * Specifies if the custom metadata field is required or not. */ - #[Api(optional: true)] + #[Optional] public ?bool $isValueRequired; /** * Maximum length of string. Only set if `type` is set to `Text` or `Textarea`. */ - #[Api(optional: true)] + #[Optional] public ?float $maxLength; /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. */ - #[Api(optional: true)] + #[Optional] public string|float|null $maxValue; /** * Minimum length of string. Only set if `type` is set to `Text` or `Textarea`. */ - #[Api(optional: true)] + #[Optional] public ?float $minLength; /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. */ - #[Api(optional: true)] + #[Optional] public string|float|null $minValue; /** * Indicates whether the custom metadata field is read only. A read only field cannot be modified after being set. This field is configurable only via the **Path policy** feature. */ - #[Api(optional: true)] + #[Optional] public ?bool $readOnly; /** @@ -87,13 +88,13 @@ final class SelectedFieldsSchema implements BaseModel * * @var list|null $selectOptions */ - #[Api(list: SelectOption::class, optional: true)] + #[Optional(list: SelectOption::class)] public ?array $selectOptions; /** * Specifies if the selectOptions array is truncated. It is truncated when number of options are > 100. */ - #[Api(optional: true)] + #[Optional] public ?bool $selectOptionsTruncated; /** diff --git a/src/Files/File/VersionInfo.php b/src/Files/File/VersionInfo.php index ce6acf14..0a2239e6 100644 --- a/src/Files/File/VersionInfo.php +++ b/src/Files/File/VersionInfo.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\File; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -21,13 +21,13 @@ final class VersionInfo implements BaseModel /** * Unique identifier of the file version. */ - #[Api(optional: true)] + #[Optional] public ?string $id; /** * Name of the file version. */ - #[Api(optional: true)] + #[Optional] public ?string $name; public function __construct() diff --git a/src/Files/FileCopyParams.php b/src/Files/FileCopyParams.php index 82352cf9..b779ad41 100644 --- a/src/Files/FileCopyParams.php +++ b/src/Files/FileCopyParams.php @@ -4,7 +4,8 @@ namespace Imagekit\Files; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -29,19 +30,19 @@ final class FileCopyParams implements BaseModel /** * Full path to the folder you want to copy the above file into. */ - #[Api] + #[Required] public string $destinationPath; /** * The full path of the file you want to copy. */ - #[Api] + #[Required] public string $sourceFilePath; /** * Option to copy all versions of a file. By default, only the current version of the file is copied. When set to true, all versions of the file will be copied. Default value - `false`. */ - #[Api(optional: true)] + #[Optional] public ?bool $includeFileVersions; /** diff --git a/src/Files/FileMoveParams.php b/src/Files/FileMoveParams.php index e2832715..28a2b923 100644 --- a/src/Files/FileMoveParams.php +++ b/src/Files/FileMoveParams.php @@ -4,7 +4,7 @@ namespace Imagekit\Files; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -29,13 +29,13 @@ final class FileMoveParams implements BaseModel /** * Full path to the folder you want to move the above file into. */ - #[Api] + #[Required] public string $destinationPath; /** * The full path of the file you want to move. */ - #[Api] + #[Required] public string $sourceFilePath; /** diff --git a/src/Files/FileRenameParams.php b/src/Files/FileRenameParams.php index 68c9b707..81e10ba4 100644 --- a/src/Files/FileRenameParams.php +++ b/src/Files/FileRenameParams.php @@ -4,7 +4,8 @@ namespace Imagekit\Files; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -29,7 +30,7 @@ final class FileRenameParams implements BaseModel /** * The full path of the file you want to rename. */ - #[Api] + #[Required] public string $filePath; /** @@ -40,7 +41,7 @@ final class FileRenameParams implements BaseModel * * Any other character, including space, will be replaced by `_`. */ - #[Api] + #[Required] public string $newFileName; /** @@ -54,7 +55,7 @@ final class FileRenameParams implements BaseModel * * Default value - `false` */ - #[Api(optional: true)] + #[Optional] public ?bool $purgeCache; /** diff --git a/src/Files/FileRenameResponse.php b/src/Files/FileRenameResponse.php index c554ebe9..41713ba2 100644 --- a/src/Files/FileRenameResponse.php +++ b/src/Files/FileRenameResponse.php @@ -4,7 +4,7 @@ namespace Imagekit\Files; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -19,7 +19,7 @@ final class FileRenameResponse implements BaseModel /** * Unique identifier of the purge request. This can be used to check the status of the purge request. */ - #[Api(optional: true)] + #[Optional] public ?string $purgeRequestId; public function __construct() diff --git a/src/Files/FileUpdateParams.php b/src/Files/FileUpdateParams.php index a444fe93..f8b22a43 100644 --- a/src/Files/FileUpdateParams.php +++ b/src/Files/FileUpdateParams.php @@ -4,7 +4,7 @@ namespace Imagekit\Files; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -46,7 +46,7 @@ final class FileUpdateParams implements BaseModel /** * Define an important area in the image in the format `x,y,width,height` e.g. `10,10,100,100`. Send `null` to unset this value. */ - #[Api(nullable: true, optional: true)] + #[Optional(nullable: true)] public ?string $customCoordinates; /** @@ -54,13 +54,13 @@ final class FileUpdateParams implements BaseModel * * @var array|null $customMetadata */ - #[Api(map: 'mixed', optional: true)] + #[Optional(map: 'mixed')] public ?array $customMetadata; /** * Optional text to describe the contents of the file. */ - #[Api(optional: true)] + #[Optional] public ?string $description; /** @@ -68,7 +68,7 @@ final class FileUpdateParams implements BaseModel * * @var list|null $extensions */ - #[Api(list: ExtensionItem::class, optional: true)] + #[Optional(list: ExtensionItem::class)] public ?array $extensions; /** @@ -80,7 +80,7 @@ final class FileUpdateParams implements BaseModel * * @var 'all'|list|null $removeAITags */ - #[Api(union: RemoveAITags::class, optional: true)] + #[Optional(union: RemoveAITags::class)] public string|array|null $removeAITags; /** @@ -88,19 +88,19 @@ final class FileUpdateParams implements BaseModel * * @var list|null $tags */ - #[Api(list: 'string', nullable: true, optional: true)] + #[Optional(list: 'string', nullable: true)] public ?array $tags; /** * The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. */ - #[Api(optional: true)] + #[Optional] public ?string $webhookUrl; /** * Configure the publication status of a file and its versions. */ - #[Api(optional: true)] + #[Optional] public ?Publish $publish; public function __construct() diff --git a/src/Files/FileUpdateParams/Publish.php b/src/Files/FileUpdateParams/Publish.php index 4f128710..74cbd21b 100644 --- a/src/Files/FileUpdateParams/Publish.php +++ b/src/Files/FileUpdateParams/Publish.php @@ -4,7 +4,8 @@ namespace Imagekit\Files\FileUpdateParams; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -23,13 +24,13 @@ final class Publish implements BaseModel /** * Set to `true` to publish the file. Set to `false` to unpublish the file. */ - #[Api] + #[Required] public bool $isPublished; /** * Set to `true` to publish/unpublish all versions of the file. Set to `false` to publish/unpublish only the current version of the file. */ - #[Api(optional: true)] + #[Optional] public ?bool $includeFileVersions; /** diff --git a/src/Files/FileUpdateResponse.php b/src/Files/FileUpdateResponse.php index dd2d7f42..a6b54e81 100644 --- a/src/Files/FileUpdateResponse.php +++ b/src/Files/FileUpdateResponse.php @@ -4,7 +4,7 @@ namespace Imagekit\Files; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Files\File\AITag; @@ -57,19 +57,19 @@ final class FileUpdateResponse implements BaseModel * * @var list|null $AITags */ - #[Api(list: AITag::class, nullable: true, optional: true)] + #[Optional(list: AITag::class, nullable: true)] public ?array $AITags; /** * Date and time when the file was uploaded. The date and time is in ISO8601 format. */ - #[Api(optional: true)] + #[Optional] public ?\DateTimeInterface $createdAt; /** * An string with custom coordinates of the file. */ - #[Api(nullable: true, optional: true)] + #[Optional(nullable: true)] public ?string $customCoordinates; /** @@ -77,67 +77,67 @@ final class FileUpdateResponse implements BaseModel * * @var array|null $customMetadata */ - #[Api(map: 'mixed', optional: true)] + #[Optional(map: 'mixed')] public ?array $customMetadata; /** * Optional text to describe the contents of the file. Can be set by the user or the ai-auto-description extension. */ - #[Api(optional: true)] + #[Optional] public ?string $description; /** * Unique identifier of the asset. */ - #[Api(optional: true)] + #[Optional] public ?string $fileId; /** * Path of the file. This is the path you would use in the URL to access the file. For example, if the file is at the root of the media library, the path will be `/file.jpg`. If the file is inside a folder named `images`, the path will be `/images/file.jpg`. */ - #[Api(optional: true)] + #[Optional] public ?string $filePath; /** * Type of the file. Possible values are `image`, `non-image`. */ - #[Api(optional: true)] + #[Optional] public ?string $fileType; /** * Specifies if the image has an alpha channel. */ - #[Api(optional: true)] + #[Optional] public ?bool $hasAlpha; /** * Height of the file. */ - #[Api(optional: true)] + #[Optional] public ?float $height; /** * Specifies if the file is private or not. */ - #[Api(optional: true)] + #[Optional] public ?bool $isPrivateFile; /** * Specifies if the file is published or not. */ - #[Api(optional: true)] + #[Optional] public ?bool $isPublished; /** * MIME type of the file. */ - #[Api(optional: true)] + #[Optional] public ?string $mime; /** * Name of the asset. */ - #[Api(optional: true)] + #[Optional] public ?string $name; /** @@ -149,13 +149,13 @@ final class FileUpdateResponse implements BaseModel * * @var array|null $selectedFieldsSchema */ - #[Api(map: SelectedFieldsSchema::class, optional: true)] + #[Optional(map: SelectedFieldsSchema::class)] public ?array $selectedFieldsSchema; /** * Size of the file in bytes. */ - #[Api(optional: true)] + #[Optional] public ?float $size; /** @@ -163,13 +163,13 @@ final class FileUpdateResponse implements BaseModel * * @var list|null $tags */ - #[Api(list: 'string', nullable: true, optional: true)] + #[Optional(list: 'string', nullable: true)] public ?array $tags; /** * URL of the thumbnail image. This URL is used to access the thumbnail image of the file in the media library. */ - #[Api(optional: true)] + #[Optional] public ?string $thumbnail; /** @@ -177,34 +177,34 @@ final class FileUpdateResponse implements BaseModel * * @var value-of|null $type */ - #[Api(enum: Type::class, optional: true)] + #[Optional(enum: Type::class)] public ?string $type; /** * Date and time when the file was last updated. The date and time is in ISO8601 format. */ - #[Api(optional: true)] + #[Optional] public ?\DateTimeInterface $updatedAt; /** * URL of the file. */ - #[Api(optional: true)] + #[Optional] public ?string $url; /** * An object with details of the file version. */ - #[Api(optional: true)] + #[Optional] public ?VersionInfo $versionInfo; /** * Width of the file. */ - #[Api(optional: true)] + #[Optional] public ?float $width; - #[Api(optional: true)] + #[Optional] public ?ExtensionStatus $extensionStatus; public function __construct() diff --git a/src/Files/FileUpdateResponse/ExtensionStatus.php b/src/Files/FileUpdateResponse/ExtensionStatus.php index 774ebd4c..29aeb53b 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\FileUpdateResponse; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Files\FileUpdateResponse\ExtensionStatus\AIAutoDescription; @@ -26,19 +26,19 @@ final class ExtensionStatus implements BaseModel use SdkModel; /** @var value-of|null $ai_auto_description */ - #[Api('ai-auto-description', enum: AIAutoDescription::class, optional: true)] + #[Optional('ai-auto-description', enum: AIAutoDescription::class)] public ?string $ai_auto_description; /** @var value-of|null $aws_auto_tagging */ - #[Api('aws-auto-tagging', enum: AwsAutoTagging::class, optional: true)] + #[Optional('aws-auto-tagging', enum: AwsAutoTagging::class)] public ?string $aws_auto_tagging; /** @var value-of|null $google_auto_tagging */ - #[Api('google-auto-tagging', enum: GoogleAutoTagging::class, optional: true)] + #[Optional('google-auto-tagging', enum: GoogleAutoTagging::class)] public ?string $google_auto_tagging; /** @var value-of|null $remove_bg */ - #[Api('remove-bg', enum: RemoveBg::class, optional: true)] + #[Optional('remove-bg', enum: RemoveBg::class)] public ?string $remove_bg; public function __construct() diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index bf8b4ade..b486d973 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -4,7 +4,8 @@ namespace Imagekit\Files; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -86,7 +87,7 @@ final class FileUploadParams implements BaseModel * * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. */ - #[Api] + #[Required] public string $file; /** @@ -98,7 +99,7 @@ final class FileUploadParams implements BaseModel * * Any other character including space will be replaced by `_` */ - #[Api] + #[Required] public string $fileName; /** @@ -106,14 +107,14 @@ final class FileUploadParams implements BaseModel * * **Note**: Sending a value that has been used in the past will result in a validation error. Even if your previous request resulted in an error, you should always send a new value for this field. */ - #[Api(optional: true)] + #[Optional] public ?string $token; /** * Server-side checks to run on the asset. * Read more about [Upload API checks](/docs/api-reference/upload-file/upload-file#upload-api-checks). */ - #[Api(optional: true)] + #[Optional] public ?string $checks; /** @@ -123,7 +124,7 @@ final class FileUploadParams implements BaseModel * - Can be used with fo-customtransformation. * - If this field is not specified and the file is overwritten, then customCoordinates will be removed. */ - #[Api(optional: true)] + #[Optional] public ?string $customCoordinates; /** @@ -131,19 +132,19 @@ final class FileUploadParams implements BaseModel * * @var array|null $customMetadata */ - #[Api(map: 'mixed', optional: true)] + #[Optional(map: 'mixed')] public ?array $customMetadata; /** * Optional text to describe the contents of the file. */ - #[Api(optional: true)] + #[Optional] public ?string $description; /** * The time until your signature is valid. It must be a [Unix time](https://en.wikipedia.org/wiki/Unix_time) in less than 1 hour into the future. It should be in seconds. This field is only required for authentication when uploading a file from the client side. */ - #[Api(optional: true)] + #[Optional] public ?int $expire; /** @@ -151,7 +152,7 @@ final class FileUploadParams implements BaseModel * * @var list|null $extensions */ - #[Api(list: ExtensionItem::class, optional: true)] + #[Optional(list: ExtensionItem::class)] public ?array $extensions; /** @@ -164,7 +165,7 @@ final class FileUploadParams implements BaseModel * * Using multiple `/` creates a nested folder. */ - #[Api(optional: true)] + #[Optional] public ?string $folder; /** @@ -172,7 +173,7 @@ final class FileUploadParams implements BaseModel * * If `true`, the file is marked as private and is accessible only using named transformation or signed URL. */ - #[Api(optional: true)] + #[Optional] public ?bool $isPrivateFile; /** @@ -182,37 +183,37 @@ final class FileUploadParams implements BaseModel * * The option to upload in draft state is only available in custom enterprise pricing plans. */ - #[Api(optional: true)] + #[Optional] public ?bool $isPublished; /** * If set to `true` and a file already exists at the exact location, its AITags will be removed. Set `overwriteAITags` to `false` to preserve AITags. */ - #[Api(optional: true)] + #[Optional] public ?bool $overwriteAITags; /** * If the request does not have `customMetadata`, and a file already exists at the exact location, existing customMetadata will be removed. */ - #[Api(optional: true)] + #[Optional] public ?bool $overwriteCustomMetadata; /** * If `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately. */ - #[Api(optional: true)] + #[Optional] public ?bool $overwriteFile; /** * If the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed. */ - #[Api(optional: true)] + #[Optional] public ?bool $overwriteTags; /** * Your ImageKit.io public key. This field is only required for authentication when uploading a file from the client side. */ - #[Api(optional: true)] + #[Optional] public ?string $publicKey; /** @@ -220,7 +221,7 @@ final class FileUploadParams implements BaseModel * * @var list>|null $responseFields */ - #[Api(list: ResponseField::class, optional: true)] + #[Optional(list: ResponseField::class)] public ?array $responseFields; /** @@ -228,7 +229,7 @@ final class FileUploadParams implements BaseModel * * Signature must be calculated on the server-side. This field is only required for authentication when uploading a file from the client side. */ - #[Api(optional: true)] + #[Optional] public ?string $signature; /** @@ -238,7 +239,7 @@ final class FileUploadParams implements BaseModel * * @var list|null $tags */ - #[Api(list: 'string', optional: true)] + #[Optional(list: 'string')] public ?array $tags; /** @@ -252,7 +253,7 @@ final class FileUploadParams implements BaseModel * * You can mix and match any combination of post-processing types. */ - #[Api(optional: true)] + #[Optional] public ?Transformation $transformation; /** @@ -262,13 +263,13 @@ final class FileUploadParams implements BaseModel * * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. */ - #[Api(optional: true)] + #[Optional] public ?bool $useUniqueFileName; /** * The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. */ - #[Api(optional: true)] + #[Optional] public ?string $webhookUrl; /** diff --git a/src/Files/FileUploadParams/Transformation.php b/src/Files/FileUploadParams/Transformation.php index a51f1c02..f525222c 100644 --- a/src/Files/FileUploadParams/Transformation.php +++ b/src/Files/FileUploadParams/Transformation.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\FileUploadParams; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Files\FileUploadParams\Transformation\Post; @@ -41,13 +41,13 @@ final class Transformation implements BaseModel * * @var list|null $post */ - #[Api(list: Post::class, optional: true)] + #[Optional(list: Post::class)] public ?array $post; /** * Transformation string to apply before uploading the file to the Media Library. Useful for optimizing files at ingestion. */ - #[Api(optional: true)] + #[Optional] public ?string $pre; public function __construct() diff --git a/src/Files/FileUploadParams/Transformation/Post/Abs.php b/src/Files/FileUploadParams/Transformation/Post/Abs.php index 6dd809bf..0b2e9f16 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Abs.php +++ b/src/Files/FileUploadParams/Transformation/Post/Abs.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\FileUploadParams\Transformation\Post; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Files\FileUploadParams\Transformation\Post\Abs\Protocol; @@ -24,7 +24,7 @@ final class Abs implements BaseModel * * @var 'abs' $type */ - #[Api] + #[Required] public string $type = 'abs'; /** @@ -32,13 +32,13 @@ final class Abs implements BaseModel * * @var value-of $protocol */ - #[Api(enum: Protocol::class)] + #[Required(enum: Protocol::class)] public string $protocol; /** * List of different representations you want to create separated by an underscore. */ - #[Api] + #[Required] public string $value; /** diff --git a/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php b/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php index 392a7c2a..90b98cd3 100644 --- a/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php +++ b/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php @@ -4,7 +4,8 @@ namespace Imagekit\Files\FileUploadParams\Transformation\Post; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -21,14 +22,14 @@ final class GifToVideo implements BaseModel * * @var 'gif-to-video' $type */ - #[Api] + #[Required] public string $type = 'gif-to-video'; /** * Optional transformation string to apply to the output video. * **Example**: `q-80`. */ - #[Api(optional: true)] + #[Optional] public ?string $value; public function __construct() diff --git a/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php b/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php index 6d23431d..7a9d3b88 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php +++ b/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php @@ -4,7 +4,8 @@ namespace Imagekit\Files\FileUploadParams\Transformation\Post; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -21,14 +22,14 @@ final class Thumbnail implements BaseModel * * @var 'thumbnail' $type */ - #[Api] + #[Required] public string $type = 'thumbnail'; /** * Optional transformation string. * **Example**: `w-150,h-150`. */ - #[Api(optional: true)] + #[Optional] public ?string $value; public function __construct() diff --git a/src/Files/FileUploadParams/Transformation/Post/Transformation.php b/src/Files/FileUploadParams/Transformation/Post/Transformation.php index 84765faa..6c3aa47a 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Transformation.php +++ b/src/Files/FileUploadParams/Transformation/Post/Transformation.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\FileUploadParams\Transformation\Post; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -21,14 +21,14 @@ final class Transformation implements BaseModel * * @var 'transformation' $type */ - #[Api] + #[Required] public string $type = 'transformation'; /** * Transformation string (e.g. `w-200,h-200`). * Same syntax as ImageKit URL-based transformations. */ - #[Api] + #[Required] public string $value; /** diff --git a/src/Files/FileUploadResponse.php b/src/Files/FileUploadResponse.php index 30ee0722..5a34d4ab 100644 --- a/src/Files/FileUploadResponse.php +++ b/src/Files/FileUploadResponse.php @@ -4,7 +4,7 @@ namespace Imagekit\Files; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Files\FileUploadResponse\AITag; @@ -59,25 +59,25 @@ final class FileUploadResponse implements BaseModel * * @var list|null $AITags */ - #[Api(list: AITag::class, nullable: true, optional: true)] + #[Optional(list: AITag::class, nullable: true)] public ?array $AITags; /** * The audio codec used in the video (only for video). */ - #[Api(optional: true)] + #[Optional] public ?string $audioCodec; /** * The bit rate of the video in kbps (only for video). */ - #[Api(optional: true)] + #[Optional] public ?int $bitRate; /** * Value of custom coordinates associated with the image in the format `x,y,width,height`. If `customCoordinates` are not defined, then it is `null`. Send `customCoordinates` in `responseFields` in API request to get the value of this field. */ - #[Api(nullable: true, optional: true)] + #[Optional(nullable: true)] public ?string $customCoordinates; /** @@ -85,19 +85,19 @@ final class FileUploadResponse implements BaseModel * * @var array|null $customMetadata */ - #[Api(map: 'mixed', optional: true)] + #[Optional(map: 'mixed')] public ?array $customMetadata; /** * Optional text to describe the contents of the file. Can be set by the user or the ai-auto-description extension. */ - #[Api(optional: true)] + #[Optional] public ?string $description; /** * The duration of the video in seconds (only for video). */ - #[Api(optional: true)] + #[Optional] public ?int $duration; /** @@ -105,7 +105,7 @@ final class FileUploadResponse implements BaseModel * * @var array|null $embeddedMetadata */ - #[Api(map: 'mixed', optional: true)] + #[Optional(map: 'mixed')] public ?array $embeddedMetadata; /** @@ -117,55 +117,55 @@ final class FileUploadResponse implements BaseModel * * If no extension was requested, then this parameter is not returned. */ - #[Api(optional: true)] + #[Optional] public ?ExtensionStatus $extensionStatus; /** * Unique fileId. Store this fileld in your database, as this will be used to perform update action on this file. */ - #[Api(optional: true)] + #[Optional] public ?string $fileId; /** * The relative path of the file in the media library e.g. `/marketing-assets/new-banner.jpg`. */ - #[Api(optional: true)] + #[Optional] public ?string $filePath; /** * Type of the uploaded file. Possible values are `image`, `non-image`. */ - #[Api(optional: true)] + #[Optional] public ?string $fileType; /** * Height of the image in pixels (Only for images). */ - #[Api(optional: true)] + #[Optional] public ?float $height; /** * Is the file marked as private. It can be either `true` or `false`. Send `isPrivateFile` in `responseFields` in API request to get the value of this field. */ - #[Api(optional: true)] + #[Optional] public ?bool $isPrivateFile; /** * Is the file published or in draft state. It can be either `true` or `false`. Send `isPublished` in `responseFields` in API request to get the value of this field. */ - #[Api(optional: true)] + #[Optional] public ?bool $isPublished; /** * Legacy metadata. Send `metadata` in `responseFields` in API request to get metadata in the upload API response. */ - #[Api(optional: true)] + #[Optional] public ?Metadata $metadata; /** * Name of the asset. */ - #[Api(optional: true)] + #[Optional] public ?string $name; /** @@ -177,13 +177,13 @@ final class FileUploadResponse implements BaseModel * * @var array|null $selectedFieldsSchema */ - #[Api(map: SelectedFieldsSchema::class, optional: true)] + #[Optional(map: SelectedFieldsSchema::class)] public ?array $selectedFieldsSchema; /** * Size of the image file in Bytes. */ - #[Api(optional: true)] + #[Optional] public ?float $size; /** @@ -191,37 +191,37 @@ final class FileUploadResponse implements BaseModel * * @var list|null $tags */ - #[Api(list: 'string', nullable: true, optional: true)] + #[Optional(list: 'string', nullable: true)] public ?array $tags; /** * In the case of an image, a small thumbnail URL. */ - #[Api(optional: true)] + #[Optional] public ?string $thumbnailUrl; /** * A publicly accessible URL of the file. */ - #[Api(optional: true)] + #[Optional] public ?string $url; /** * An object containing the file or file version's `id` (versionId) and `name`. */ - #[Api(optional: true)] + #[Optional] public ?VersionInfo $versionInfo; /** * The video codec used in the video (only for video). */ - #[Api(optional: true)] + #[Optional] public ?string $videoCodec; /** * Width of the image in pixels (Only for Images). */ - #[Api(optional: true)] + #[Optional] public ?float $width; public function __construct() diff --git a/src/Files/FileUploadResponse/AITag.php b/src/Files/FileUploadResponse/AITag.php index 54e0e04c..8ec551e8 100644 --- a/src/Files/FileUploadResponse/AITag.php +++ b/src/Files/FileUploadResponse/AITag.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\FileUploadResponse; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -21,19 +21,19 @@ final class AITag implements BaseModel /** * Confidence score of the tag. */ - #[Api(optional: true)] + #[Optional] public ?float $confidence; /** * Name of the tag. */ - #[Api(optional: true)] + #[Optional] public ?string $name; /** * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. */ - #[Api(optional: true)] + #[Optional] public ?string $source; public function __construct() diff --git a/src/Files/FileUploadResponse/ExtensionStatus.php b/src/Files/FileUploadResponse/ExtensionStatus.php index 5c76c2ed..66a5cc45 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Files/FileUploadResponse/ExtensionStatus.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\FileUploadResponse; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Files\FileUploadResponse\ExtensionStatus\AIAutoDescription; @@ -34,19 +34,19 @@ final class ExtensionStatus implements BaseModel use SdkModel; /** @var value-of|null $ai_auto_description */ - #[Api('ai-auto-description', enum: AIAutoDescription::class, optional: true)] + #[Optional('ai-auto-description', enum: AIAutoDescription::class)] public ?string $ai_auto_description; /** @var value-of|null $aws_auto_tagging */ - #[Api('aws-auto-tagging', enum: AwsAutoTagging::class, optional: true)] + #[Optional('aws-auto-tagging', enum: AwsAutoTagging::class)] public ?string $aws_auto_tagging; /** @var value-of|null $google_auto_tagging */ - #[Api('google-auto-tagging', enum: GoogleAutoTagging::class, optional: true)] + #[Optional('google-auto-tagging', enum: GoogleAutoTagging::class)] public ?string $google_auto_tagging; /** @var value-of|null $remove_bg */ - #[Api('remove-bg', enum: RemoveBg::class, optional: true)] + #[Optional('remove-bg', enum: RemoveBg::class)] public ?string $remove_bg; public function __construct() diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema.php b/src/Files/FileUploadResponse/SelectedFieldsSchema.php index c838a7f2..3b2a31fd 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema.php @@ -4,7 +4,8 @@ namespace Imagekit\Files\FileUploadResponse; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue; @@ -35,7 +36,7 @@ final class SelectedFieldsSchema implements BaseModel * * @var value-of $type */ - #[Api(enum: Type::class)] + #[Required(enum: Type::class)] public string $type; /** @@ -43,43 +44,43 @@ final class SelectedFieldsSchema implements BaseModel * * @var string|float|bool|list|null $defaultValue */ - #[Api(union: DefaultValue::class, optional: true)] + #[Optional(union: DefaultValue::class)] public string|float|bool|array|null $defaultValue; /** * Specifies if the custom metadata field is required or not. */ - #[Api(optional: true)] + #[Optional] public ?bool $isValueRequired; /** * Maximum length of string. Only set if `type` is set to `Text` or `Textarea`. */ - #[Api(optional: true)] + #[Optional] public ?float $maxLength; /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. */ - #[Api(optional: true)] + #[Optional] public string|float|null $maxValue; /** * Minimum length of string. Only set if `type` is set to `Text` or `Textarea`. */ - #[Api(optional: true)] + #[Optional] public ?float $minLength; /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. */ - #[Api(optional: true)] + #[Optional] public string|float|null $minValue; /** * Indicates whether the custom metadata field is read only. A read only field cannot be modified after being set. This field is configurable only via the **Path policy** feature. */ - #[Api(optional: true)] + #[Optional] public ?bool $readOnly; /** @@ -87,13 +88,13 @@ final class SelectedFieldsSchema implements BaseModel * * @var list|null $selectOptions */ - #[Api(list: SelectOption::class, optional: true)] + #[Optional(list: SelectOption::class)] public ?array $selectOptions; /** * Specifies if the selectOptions array is truncated. It is truncated when number of options are > 100. */ - #[Api(optional: true)] + #[Optional] public ?bool $selectOptionsTruncated; /** diff --git a/src/Files/FileUploadResponse/VersionInfo.php b/src/Files/FileUploadResponse/VersionInfo.php index f259a472..2f97b876 100644 --- a/src/Files/FileUploadResponse/VersionInfo.php +++ b/src/Files/FileUploadResponse/VersionInfo.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\FileUploadResponse; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -21,13 +21,13 @@ final class VersionInfo implements BaseModel /** * Unique identifier of the file version. */ - #[Api(optional: true)] + #[Optional] public ?string $id; /** * Name of the file version. */ - #[Api(optional: true)] + #[Optional] public ?string $name; public function __construct() diff --git a/src/Files/Folder.php b/src/Files/Folder.php index ba23a6a4..66cd51ac 100644 --- a/src/Files/Folder.php +++ b/src/Files/Folder.php @@ -4,7 +4,7 @@ namespace Imagekit\Files; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Files\Folder\Type; @@ -27,25 +27,25 @@ final class Folder implements BaseModel /** * Date and time when the folder was created. The date and time is in ISO8601 format. */ - #[Api(optional: true)] + #[Optional] public ?\DateTimeInterface $createdAt; /** * Unique identifier of the asset. */ - #[Api(optional: true)] + #[Optional] public ?string $folderId; /** * Path of the folder. This is the path you would use in the URL to access the folder. For example, if the folder is at the root of the media library, the path will be /folder. If the folder is inside another folder named images, the path will be /images/folder. */ - #[Api(optional: true)] + #[Optional] public ?string $folderPath; /** * Name of the asset. */ - #[Api(optional: true)] + #[Optional] public ?string $name; /** @@ -53,13 +53,13 @@ final class Folder implements BaseModel * * @var value-of|null $type */ - #[Api(enum: Type::class, optional: true)] + #[Optional(enum: Type::class)] public ?string $type; /** * Date and time when the folder was last updated. The date and time is in ISO8601 format. */ - #[Api(optional: true)] + #[Optional] public ?\DateTimeInterface $updatedAt; public function __construct() diff --git a/src/Files/Metadata.php b/src/Files/Metadata.php index b578cf59..fb622405 100644 --- a/src/Files/Metadata.php +++ b/src/Files/Metadata.php @@ -4,7 +4,7 @@ namespace Imagekit\Files; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Files\Metadata\Exif; @@ -41,82 +41,82 @@ final class Metadata implements BaseModel /** * The audio codec used in the video (only for video). */ - #[Api(optional: true)] + #[Optional] public ?string $audioCodec; /** * The bit rate of the video in kbps (only for video). */ - #[Api(optional: true)] + #[Optional] public ?int $bitRate; /** * The density of the image in DPI. */ - #[Api(optional: true)] + #[Optional] public ?int $density; /** * The duration of the video in seconds (only for video). */ - #[Api(optional: true)] + #[Optional] public ?int $duration; - #[Api(optional: true)] + #[Optional] public ?Exif $exif; /** * The format of the file (e.g., 'jpg', 'mp4'). */ - #[Api(optional: true)] + #[Optional] public ?string $format; /** * Indicates if the image has a color profile. */ - #[Api(optional: true)] + #[Optional] public ?bool $hasColorProfile; /** * Indicates if the image contains transparent areas. */ - #[Api(optional: true)] + #[Optional] public ?bool $hasTransparency; /** * The height of the image or video in pixels. */ - #[Api(optional: true)] + #[Optional] public ?int $height; /** * Perceptual hash of the image. */ - #[Api(optional: true)] + #[Optional] public ?string $pHash; /** * The quality indicator of the image. */ - #[Api(optional: true)] + #[Optional] public ?int $quality; /** * The file size in bytes. */ - #[Api(optional: true)] + #[Optional] public ?int $size; /** * The video codec used in the video (only for video). */ - #[Api(optional: true)] + #[Optional] public ?string $videoCodec; /** * The width of the image or video in pixels. */ - #[Api(optional: true)] + #[Optional] public ?int $width; public function __construct() diff --git a/src/Files/Metadata/Exif.php b/src/Files/Metadata/Exif.php index 0ae33392..dcdda828 100644 --- a/src/Files/Metadata/Exif.php +++ b/src/Files/Metadata/Exif.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\Metadata; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Files\Metadata\Exif\Gps; @@ -30,35 +30,35 @@ final class Exif implements BaseModel /** * Object containing Exif details. */ - #[Api(optional: true)] + #[Optional] public ?Exif\Exif $exif; /** * Object containing GPS information. */ - #[Api(optional: true)] + #[Optional] public ?Gps $gps; /** * Object containing EXIF image information. */ - #[Api(optional: true)] + #[Optional] public ?Image $image; /** * JSON object. */ - #[Api(optional: true)] + #[Optional] public ?Interoperability $interoperability; /** @var array|null $makernote */ - #[Api(map: 'mixed', optional: true)] + #[Optional(map: 'mixed')] public ?array $makernote; /** * Object containing Thumbnail information. */ - #[Api(optional: true)] + #[Optional] public ?Thumbnail $thumbnail; public function __construct() diff --git a/src/Files/Metadata/Exif/Exif.php b/src/Files/Metadata/Exif/Exif.php index 1ddd96ee..758a94bf 100644 --- a/src/Files/Metadata/Exif/Exif.php +++ b/src/Files/Metadata/Exif/Exif.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\Metadata\Exif; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -45,82 +45,82 @@ final class Exif implements BaseModel /** @use SdkModel */ use SdkModel; - #[Api(optional: true)] + #[Optional] public ?float $ApertureValue; - #[Api(optional: true)] + #[Optional] public ?int $ColorSpace; - #[Api(optional: true)] + #[Optional] public ?string $CreateDate; - #[Api(optional: true)] + #[Optional] public ?int $CustomRendered; - #[Api(optional: true)] + #[Optional] public ?string $DateTimeOriginal; - #[Api(optional: true)] + #[Optional] public ?int $ExifImageHeight; - #[Api(optional: true)] + #[Optional] public ?int $ExifImageWidth; - #[Api(optional: true)] + #[Optional] public ?string $ExifVersion; - #[Api(optional: true)] + #[Optional] public ?float $ExposureCompensation; - #[Api(optional: true)] + #[Optional] public ?int $ExposureMode; - #[Api(optional: true)] + #[Optional] public ?int $ExposureProgram; - #[Api(optional: true)] + #[Optional] public ?float $ExposureTime; - #[Api(optional: true)] + #[Optional] public ?int $Flash; - #[Api(optional: true)] + #[Optional] public ?string $FlashpixVersion; - #[Api(optional: true)] + #[Optional] public ?float $FNumber; - #[Api(optional: true)] + #[Optional] public ?int $FocalLength; - #[Api(optional: true)] + #[Optional] public ?int $FocalPlaneResolutionUnit; - #[Api(optional: true)] + #[Optional] public ?float $FocalPlaneXResolution; - #[Api(optional: true)] + #[Optional] public ?float $FocalPlaneYResolution; - #[Api(optional: true)] + #[Optional] public ?int $InteropOffset; - #[Api(optional: true)] + #[Optional] public ?int $ISO; - #[Api(optional: true)] + #[Optional] public ?int $MeteringMode; - #[Api(optional: true)] + #[Optional] public ?int $SceneCaptureType; - #[Api(optional: true)] + #[Optional] public ?float $ShutterSpeedValue; - #[Api(optional: true)] + #[Optional] public ?string $SubSecTime; - #[Api(optional: true)] + #[Optional] public ?int $WhiteBalance; public function __construct() diff --git a/src/Files/Metadata/Exif/Gps.php b/src/Files/Metadata/Exif/Gps.php index ea72a755..f4e25c01 100644 --- a/src/Files/Metadata/Exif/Gps.php +++ b/src/Files/Metadata/Exif/Gps.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\Metadata\Exif; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -19,7 +19,7 @@ final class Gps implements BaseModel use SdkModel; /** @var list|null $GPSVersionID */ - #[Api(list: 'int', optional: true)] + #[Optional(list: 'int')] public ?array $GPSVersionID; public function __construct() diff --git a/src/Files/Metadata/Exif/Image.php b/src/Files/Metadata/Exif/Image.php index 671dd1e1..882ec17f 100644 --- a/src/Files/Metadata/Exif/Image.php +++ b/src/Files/Metadata/Exif/Image.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\Metadata\Exif; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -30,37 +30,37 @@ final class Image implements BaseModel /** @use SdkModel */ use SdkModel; - #[Api(optional: true)] + #[Optional] public ?int $ExifOffset; - #[Api(optional: true)] + #[Optional] public ?int $GPSInfo; - #[Api(optional: true)] + #[Optional] public ?string $Make; - #[Api(optional: true)] + #[Optional] public ?string $Model; - #[Api(optional: true)] + #[Optional] public ?string $ModifyDate; - #[Api(optional: true)] + #[Optional] public ?int $Orientation; - #[Api(optional: true)] + #[Optional] public ?int $ResolutionUnit; - #[Api(optional: true)] + #[Optional] public ?string $Software; - #[Api(optional: true)] + #[Optional] public ?int $XResolution; - #[Api(optional: true)] + #[Optional] public ?int $YCbCrPositioning; - #[Api(optional: true)] + #[Optional] public ?int $YResolution; public function __construct() diff --git a/src/Files/Metadata/Exif/Interoperability.php b/src/Files/Metadata/Exif/Interoperability.php index 21704ee3..f9fd29c5 100644 --- a/src/Files/Metadata/Exif/Interoperability.php +++ b/src/Files/Metadata/Exif/Interoperability.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\Metadata\Exif; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -20,10 +20,10 @@ final class Interoperability implements BaseModel /** @use SdkModel */ use SdkModel; - #[Api(optional: true)] + #[Optional] public ?string $InteropIndex; - #[Api(optional: true)] + #[Optional] public ?string $InteropVersion; public function __construct() diff --git a/src/Files/Metadata/Exif/Thumbnail.php b/src/Files/Metadata/Exif/Thumbnail.php index 23117817..d72c4b39 100644 --- a/src/Files/Metadata/Exif/Thumbnail.php +++ b/src/Files/Metadata/Exif/Thumbnail.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\Metadata\Exif; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -25,22 +25,22 @@ final class Thumbnail implements BaseModel /** @use SdkModel */ use SdkModel; - #[Api(optional: true)] + #[Optional] public ?int $Compression; - #[Api(optional: true)] + #[Optional] public ?int $ResolutionUnit; - #[Api(optional: true)] + #[Optional] public ?int $ThumbnailLength; - #[Api(optional: true)] + #[Optional] public ?int $ThumbnailOffset; - #[Api(optional: true)] + #[Optional] public ?int $XResolution; - #[Api(optional: true)] + #[Optional] public ?int $YResolution; public function __construct() diff --git a/src/Files/Metadata/MetadataGetFromURLParams.php b/src/Files/Metadata/MetadataGetFromURLParams.php index f4b515cf..09cc152e 100644 --- a/src/Files/Metadata/MetadataGetFromURLParams.php +++ b/src/Files/Metadata/MetadataGetFromURLParams.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\Metadata; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -25,7 +25,7 @@ final class MetadataGetFromURLParams implements BaseModel /** * Should be a valid file URL. It should be accessible using your ImageKit.io account. */ - #[Api] + #[Required] public string $url; /** diff --git a/src/Files/UpdateFileRequest/ChangePublicationStatus.php b/src/Files/UpdateFileRequest/ChangePublicationStatus.php index 7ebfda3e..1e872743 100644 --- a/src/Files/UpdateFileRequest/ChangePublicationStatus.php +++ b/src/Files/UpdateFileRequest/ChangePublicationStatus.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\UpdateFileRequest; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Files\UpdateFileRequest\ChangePublicationStatus\Publish; @@ -20,7 +20,7 @@ final class ChangePublicationStatus implements BaseModel /** * Configure the publication status of a file and its versions. */ - #[Api(optional: true)] + #[Optional] public ?Publish $publish; public function __construct() diff --git a/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php b/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php index 0dd3cb28..faaf2c10 100644 --- a/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php +++ b/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php @@ -4,7 +4,8 @@ namespace Imagekit\Files\UpdateFileRequest\ChangePublicationStatus; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -23,13 +24,13 @@ final class Publish implements BaseModel /** * Set to `true` to publish the file. Set to `false` to unpublish the file. */ - #[Api] + #[Required] public bool $isPublished; /** * Set to `true` to publish/unpublish all versions of the file. Set to `false` to publish/unpublish only the current version of the file. */ - #[Api(optional: true)] + #[Optional] public ?bool $includeFileVersions; /** diff --git a/src/Files/UpdateFileRequest/UpdateFileDetails.php b/src/Files/UpdateFileRequest/UpdateFileDetails.php index d9e566ad..4753a266 100644 --- a/src/Files/UpdateFileRequest/UpdateFileDetails.php +++ b/src/Files/UpdateFileRequest/UpdateFileDetails.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\UpdateFileRequest; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\ExtensionItem; @@ -34,7 +34,7 @@ final class UpdateFileDetails implements BaseModel /** * Define an important area in the image in the format `x,y,width,height` e.g. `10,10,100,100`. Send `null` to unset this value. */ - #[Api(nullable: true, optional: true)] + #[Optional(nullable: true)] public ?string $customCoordinates; /** @@ -42,13 +42,13 @@ final class UpdateFileDetails implements BaseModel * * @var array|null $customMetadata */ - #[Api(map: 'mixed', optional: true)] + #[Optional(map: 'mixed')] public ?array $customMetadata; /** * Optional text to describe the contents of the file. */ - #[Api(optional: true)] + #[Optional] public ?string $description; /** @@ -56,7 +56,7 @@ final class UpdateFileDetails implements BaseModel * * @var list|null $extensions */ - #[Api(list: ExtensionItem::class, optional: true)] + #[Optional(list: ExtensionItem::class)] public ?array $extensions; /** @@ -68,7 +68,7 @@ final class UpdateFileDetails implements BaseModel * * @var 'all'|list|null $removeAITags */ - #[Api(union: RemoveAITags::class, optional: true)] + #[Optional(union: RemoveAITags::class)] public string|array|null $removeAITags; /** @@ -76,13 +76,13 @@ final class UpdateFileDetails implements BaseModel * * @var list|null $tags */ - #[Api(list: 'string', nullable: true, optional: true)] + #[Optional(list: 'string', nullable: true)] public ?array $tags; /** * The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. */ - #[Api(optional: true)] + #[Optional] public ?string $webhookUrl; public function __construct() diff --git a/src/Files/Versions/VersionDeleteParams.php b/src/Files/Versions/VersionDeleteParams.php index 944569ce..dfeb9f96 100644 --- a/src/Files/Versions/VersionDeleteParams.php +++ b/src/Files/Versions/VersionDeleteParams.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\Versions; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -24,7 +24,7 @@ final class VersionDeleteParams implements BaseModel use SdkModel; use SdkParams; - #[Api] + #[Required] public string $fileId; /** diff --git a/src/Files/Versions/VersionGetParams.php b/src/Files/Versions/VersionGetParams.php index 84cab6bf..f0c9360f 100644 --- a/src/Files/Versions/VersionGetParams.php +++ b/src/Files/Versions/VersionGetParams.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\Versions; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -22,7 +22,7 @@ final class VersionGetParams implements BaseModel use SdkModel; use SdkParams; - #[Api] + #[Required] public string $fileId; /** diff --git a/src/Files/Versions/VersionRestoreParams.php b/src/Files/Versions/VersionRestoreParams.php index d1d852f6..879e9aa1 100644 --- a/src/Files/Versions/VersionRestoreParams.php +++ b/src/Files/Versions/VersionRestoreParams.php @@ -4,7 +4,7 @@ namespace Imagekit\Files\Versions; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -22,7 +22,7 @@ final class VersionRestoreParams implements BaseModel use SdkModel; use SdkParams; - #[Api] + #[Required] public string $fileId; /** diff --git a/src/Folders/FolderCopyParams.php b/src/Folders/FolderCopyParams.php index 4dfb35d1..bf78e3d1 100644 --- a/src/Folders/FolderCopyParams.php +++ b/src/Folders/FolderCopyParams.php @@ -4,7 +4,8 @@ namespace Imagekit\Folders; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -27,19 +28,19 @@ final class FolderCopyParams implements BaseModel /** * Full path to the destination folder where you want to copy the source folder into. */ - #[Api] + #[Required] public string $destinationPath; /** * The full path to the source folder you want to copy. */ - #[Api] + #[Required] public string $sourceFolderPath; /** * Option to copy all versions of files that are nested inside the selected folder. By default, only the current version of each file will be copied. When set to true, all versions of each file will be copied. Default value - `false`. */ - #[Api(optional: true)] + #[Optional] public ?bool $includeVersions; /** diff --git a/src/Folders/FolderCopyResponse.php b/src/Folders/FolderCopyResponse.php index 17ccd21f..981f7c3c 100644 --- a/src/Folders/FolderCopyResponse.php +++ b/src/Folders/FolderCopyResponse.php @@ -4,7 +4,7 @@ namespace Imagekit\Folders; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -21,7 +21,7 @@ final class FolderCopyResponse implements BaseModel /** * Unique identifier of the bulk job. This can be used to check the status of the bulk job. */ - #[Api] + #[Required] public string $jobId; /** diff --git a/src/Folders/FolderCreateParams.php b/src/Folders/FolderCreateParams.php index dd6bb866..c779ee99 100644 --- a/src/Folders/FolderCreateParams.php +++ b/src/Folders/FolderCreateParams.php @@ -4,7 +4,7 @@ namespace Imagekit\Folders; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -29,7 +29,7 @@ final class FolderCreateParams implements BaseModel * * All characters except alphabets and numbers (inclusive of unicode letters, marks, and numerals in other languages) will be replaced by an underscore i.e. `_`. */ - #[Api] + #[Required] public string $folderName; /** @@ -37,7 +37,7 @@ final class FolderCreateParams implements BaseModel * * Note: If any folder(s) is not present in the parentFolderPath parameter, it will be automatically created. For example, if you pass `/product/images/summer`, then `product`, `images`, and `summer` folders will be created if they don't already exist. */ - #[Api] + #[Required] public string $parentFolderPath; /** diff --git a/src/Folders/FolderDeleteParams.php b/src/Folders/FolderDeleteParams.php index e52a204d..5e49e0eb 100644 --- a/src/Folders/FolderDeleteParams.php +++ b/src/Folders/FolderDeleteParams.php @@ -4,7 +4,7 @@ namespace Imagekit\Folders; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -25,7 +25,7 @@ final class FolderDeleteParams implements BaseModel /** * Full path to the folder you want to delete. For example `/folder/to/delete/`. */ - #[Api] + #[Required] public string $folderPath; /** diff --git a/src/Folders/FolderMoveParams.php b/src/Folders/FolderMoveParams.php index c07ec114..99801ff5 100644 --- a/src/Folders/FolderMoveParams.php +++ b/src/Folders/FolderMoveParams.php @@ -4,7 +4,7 @@ namespace Imagekit\Folders; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -27,13 +27,13 @@ final class FolderMoveParams implements BaseModel /** * Full path to the destination folder where you want to move the source folder into. */ - #[Api] + #[Required] public string $destinationPath; /** * The full path to the source folder you want to move. */ - #[Api] + #[Required] public string $sourceFolderPath; /** diff --git a/src/Folders/FolderMoveResponse.php b/src/Folders/FolderMoveResponse.php index 6f0ef1b7..70542ca0 100644 --- a/src/Folders/FolderMoveResponse.php +++ b/src/Folders/FolderMoveResponse.php @@ -4,7 +4,7 @@ namespace Imagekit\Folders; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -21,7 +21,7 @@ final class FolderMoveResponse implements BaseModel /** * Unique identifier of the bulk job. This can be used to check the status of the bulk job. */ - #[Api] + #[Required] public string $jobId; /** diff --git a/src/Folders/FolderRenameParams.php b/src/Folders/FolderRenameParams.php index 5d3d8547..d731154e 100644 --- a/src/Folders/FolderRenameParams.php +++ b/src/Folders/FolderRenameParams.php @@ -4,7 +4,8 @@ namespace Imagekit\Folders; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; @@ -27,7 +28,7 @@ final class FolderRenameParams implements BaseModel /** * The full path to the folder you want to rename. */ - #[Api] + #[Required] public string $folderPath; /** @@ -35,7 +36,7 @@ final class FolderRenameParams implements BaseModel * * All characters except alphabets and numbers (inclusive of unicode letters, marks, and numerals in other languages) and `-` will be replaced by an underscore i.e. `_`. */ - #[Api] + #[Required] public string $newFolderName; /** @@ -47,7 +48,7 @@ final class FolderRenameParams implements BaseModel * * Default value - `false` */ - #[Api(optional: true)] + #[Optional] public ?bool $purgeCache; /** diff --git a/src/Folders/FolderRenameResponse.php b/src/Folders/FolderRenameResponse.php index 656e4e95..97ee8ee1 100644 --- a/src/Folders/FolderRenameResponse.php +++ b/src/Folders/FolderRenameResponse.php @@ -4,7 +4,7 @@ namespace Imagekit\Folders; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -21,7 +21,7 @@ final class FolderRenameResponse implements BaseModel /** * Unique identifier of the bulk job. This can be used to check the status of the bulk job. */ - #[Api] + #[Required] public string $jobId; /** diff --git a/src/Folders/Job/JobGetResponse.php b/src/Folders/Job/JobGetResponse.php index 8c20ff31..4609e000 100644 --- a/src/Folders/Job/JobGetResponse.php +++ b/src/Folders/Job/JobGetResponse.php @@ -4,7 +4,7 @@ namespace Imagekit\Folders\Job; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Folders\Job\JobGetResponse\Status; @@ -26,13 +26,13 @@ final class JobGetResponse implements BaseModel /** * Unique identifier of the bulk job. */ - #[Api(optional: true)] + #[Optional] public ?string $jobId; /** * Unique identifier of the purge request. This will be present only if `purgeCache` is set to `true` in the rename folder API request. */ - #[Api(optional: true)] + #[Optional] public ?string $purgeRequestId; /** @@ -40,7 +40,7 @@ final class JobGetResponse implements BaseModel * * @var value-of|null $status */ - #[Api(enum: Status::class, optional: true)] + #[Optional(enum: Status::class)] public ?string $status; /** @@ -48,7 +48,7 @@ final class JobGetResponse implements BaseModel * * @var value-of|null $type */ - #[Api(enum: Type::class, optional: true)] + #[Optional(enum: Type::class)] public ?string $type; public function __construct() diff --git a/src/GetImageAttributesOptions.php b/src/GetImageAttributesOptions.php index 4d6ee99e..cba62811 100644 --- a/src/GetImageAttributesOptions.php +++ b/src/GetImageAttributesOptions.php @@ -4,7 +4,8 @@ namespace Imagekit; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -35,13 +36,13 @@ final class GetImageAttributesOptions implements BaseModel * Accepts a relative or absolute path of the resource. If a relative path is provided, it is appended to the `urlEndpoint`. * If an absolute path is provided, `urlEndpoint` is ignored. */ - #[Api] + #[Required] public string $src; /** * Get your urlEndpoint from the [ImageKit dashboard](https://imagekit.io/dashboard/url-endpoints). */ - #[Api] + #[Required] public string $urlEndpoint; /** @@ -54,7 +55,7 @@ final class GetImageAttributesOptions implements BaseModel * * [Learn more](https://imagekit.io/docs/media-delivery-basic-security#how-to-generate-signed-urls). */ - #[Api(optional: true)] + #[Optional] public ?float $expiresIn; /** @@ -64,7 +65,7 @@ final class GetImageAttributesOptions implements BaseModel * * @var array|null $queryParameters */ - #[Api(map: 'string', optional: true)] + #[Optional(map: 'string')] public ?array $queryParameters; /** @@ -73,7 +74,7 @@ final class GetImageAttributesOptions implements BaseModel * Note: If `expiresIn` is set to any value above 0, the URL will always be signed regardless of this setting. * [Learn more](https://imagekit.io/docs/media-delivery-basic-security#how-to-generate-signed-urls). */ - #[Api(optional: true)] + #[Optional] public ?bool $signed; /** @@ -82,7 +83,7 @@ final class GetImageAttributesOptions implements BaseModel * * @var list|null $transformation */ - #[Api(list: Transformation::class, optional: true)] + #[Optional(list: Transformation::class)] public ?array $transformation; /** @@ -92,7 +93,7 @@ final class GetImageAttributesOptions implements BaseModel * * @var value-of|null $transformationPosition */ - #[Api(enum: TransformationPosition::class, optional: true)] + #[Optional(enum: TransformationPosition::class)] public ?string $transformationPosition; /** @@ -104,7 +105,7 @@ final class GetImageAttributesOptions implements BaseModel * * @var list|null $deviceBreakpoints */ - #[Api(list: 'float', optional: true)] + #[Optional(list: 'float')] public ?array $deviceBreakpoints; /** @@ -117,7 +118,7 @@ final class GetImageAttributesOptions implements BaseModel * * @var list|null $imageBreakpoints */ - #[Api(list: 'float', optional: true)] + #[Optional(list: 'float')] public ?array $imageBreakpoints; /** @@ -129,7 +130,7 @@ final class GetImageAttributesOptions implements BaseModel * * Enables a width-based strategy and generates `w` descriptors in `srcSet`. */ - #[Api(optional: true)] + #[Optional] public ?string $sizes; /** @@ -140,7 +141,7 @@ final class GetImageAttributesOptions implements BaseModel * * Ignored if `sizes` is present. */ - #[Api(optional: true)] + #[Optional] public ?float $width; /** diff --git a/src/ImageOverlay.php b/src/ImageOverlay.php index 97e07e6f..9dfd452f 100644 --- a/src/ImageOverlay.php +++ b/src/ImageOverlay.php @@ -4,7 +4,8 @@ namespace Imagekit; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\ImageOverlay\Encoding; @@ -26,19 +27,19 @@ final class ImageOverlay implements BaseModel use SdkModel; /** @var 'image' $type */ - #[Api] + #[Required] public string $type = 'image'; - #[Api(optional: true)] + #[Optional] public ?OverlayPosition $position; - #[Api(optional: true)] + #[Optional] public ?OverlayTiming $timing; /** * Specifies the relative path to the image used as an overlay. */ - #[Api] + #[Required] public string $input; /** @@ -49,7 +50,7 @@ final class ImageOverlay implements BaseModel * * @var value-of|null $encoding */ - #[Api(enum: Encoding::class, optional: true)] + #[Optional(enum: Encoding::class)] public ?string $encoding; /** @@ -58,7 +59,7 @@ final class ImageOverlay implements BaseModel * * @var list|null $transformation */ - #[Api(list: Transformation::class, optional: true)] + #[Optional(list: Transformation::class)] public ?array $transformation; /** diff --git a/src/OverlayPosition.php b/src/OverlayPosition.php index 4b635376..2cfb49f2 100644 --- a/src/OverlayPosition.php +++ b/src/OverlayPosition.php @@ -4,7 +4,7 @@ namespace Imagekit; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\OverlayPosition\Focus; @@ -25,7 +25,7 @@ final class OverlayPosition implements BaseModel * * @var value-of|null $focus */ - #[Api(enum: Focus::class, optional: true)] + #[Optional(enum: Focus::class)] public ?string $focus; /** @@ -34,7 +34,7 @@ final class OverlayPosition implements BaseModel * Maps to `lx` in the URL. * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). */ - #[Api(optional: true)] + #[Optional] public float|string|null $x; /** @@ -43,7 +43,7 @@ final class OverlayPosition implements BaseModel * Maps to `ly` in the URL. * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). */ - #[Api(optional: true)] + #[Optional] public float|string|null $y; public function __construct() diff --git a/src/OverlayTiming.php b/src/OverlayTiming.php index eaaa4088..d7cb2826 100644 --- a/src/OverlayTiming.php +++ b/src/OverlayTiming.php @@ -4,7 +4,7 @@ namespace Imagekit; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -26,7 +26,7 @@ final class OverlayTiming implements BaseModel * Applies only if the base asset is a video. * Maps to `ldu` in the URL. */ - #[Api(optional: true)] + #[Optional] public float|string|null $duration; /** @@ -36,7 +36,7 @@ final class OverlayTiming implements BaseModel * Applies only if the base asset is a video. * Maps to `leo` in the URL. */ - #[Api(optional: true)] + #[Optional] public float|string|null $end; /** @@ -45,7 +45,7 @@ final class OverlayTiming implements BaseModel * Applies only if the base asset is a video. * Maps to `lso` in the URL. */ - #[Api(optional: true)] + #[Optional] public float|string|null $start; public function __construct() diff --git a/src/RequestOptions.php b/src/RequestOptions.php index a390b5ff..d865195f 100644 --- a/src/RequestOptions.php +++ b/src/RequestOptions.php @@ -4,7 +4,8 @@ namespace Imagekit; -use Imagekit\Core\Attributes\Api as Property; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required as Property; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Core\Implementation\Omit; @@ -49,26 +50,26 @@ final class RequestOptions implements BaseModel public float $maxRetryDelay = 8.0; /** @var array|null>|null $extraHeaders */ - #[Property(optional: true)] + #[Optional] public ?array $extraHeaders; /** @var array|null $extraQueryParams */ - #[Property(optional: true)] + #[Optional] public ?array $extraQueryParams; - #[Property(optional: true)] + #[Optional] public mixed $extraBodyParams; - #[Property(optional: true)] + #[Optional] public ?ClientInterface $transporter; - #[Property(optional: true)] + #[Optional] public ?UriFactoryInterface $uriFactory; - #[Property(optional: true)] + #[Optional] public ?StreamFactoryInterface $streamFactory; - #[Property(optional: true)] + #[Optional] public ?RequestFactoryInterface $requestFactory; public function __construct() diff --git a/src/ResponsiveImageAttributes.php b/src/ResponsiveImageAttributes.php index 1e1e85d2..9e9983c7 100644 --- a/src/ResponsiveImageAttributes.php +++ b/src/ResponsiveImageAttributes.php @@ -4,7 +4,8 @@ namespace Imagekit; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -24,27 +25,27 @@ final class ResponsiveImageAttributes implements BaseModel /** * URL for the *largest* candidate (assigned to plain `src`). */ - #[Api] + #[Required] public string $src; /** * `sizes` returned (or synthesised as `100vw`). * The value for the HTML `sizes` attribute. */ - #[Api(optional: true)] + #[Optional] public ?string $sizes; /** * Candidate set with `w` or `x` descriptors. * Multiple image URLs separated by commas, each with a descriptor. */ - #[Api(optional: true)] + #[Optional] public ?string $srcSet; /** * Width as a number (if `width` was provided in the input options). */ - #[Api(optional: true)] + #[Optional] public ?float $width; /** diff --git a/src/SolidColorOverlay.php b/src/SolidColorOverlay.php index 082a40b2..d9b85fc5 100644 --- a/src/SolidColorOverlay.php +++ b/src/SolidColorOverlay.php @@ -4,7 +4,8 @@ namespace Imagekit; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\OverlayPosition\Focus; @@ -24,20 +25,20 @@ final class SolidColorOverlay implements BaseModel use SdkModel; /** @var 'solidColor' $type */ - #[Api] + #[Required] public string $type = 'solidColor'; - #[Api(optional: true)] + #[Optional] public ?OverlayPosition $position; - #[Api(optional: true)] + #[Optional] public ?OverlayTiming $timing; /** * Specifies the color of the block using an RGB hex code (e.g., `FF0000`), an RGBA code (e.g., `FFAABB50`), or a color name (e.g., `red`). * If an 8-character value is provided, the last two characters represent the opacity level (from `00` for 0.00 to `99` for 0.99). */ - #[Api] + #[Required] public string $color; /** @@ -46,7 +47,7 @@ final class SolidColorOverlay implements BaseModel * * @var list|null $transformation */ - #[Api(list: SolidColorOverlayTransformation::class, optional: true)] + #[Optional(list: SolidColorOverlayTransformation::class)] public ?array $transformation; /** diff --git a/src/SolidColorOverlayTransformation.php b/src/SolidColorOverlayTransformation.php index 83ba5ce2..ab3c2ba8 100644 --- a/src/SolidColorOverlayTransformation.php +++ b/src/SolidColorOverlayTransformation.php @@ -4,7 +4,7 @@ namespace Imagekit; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -26,27 +26,27 @@ final class SolidColorOverlayTransformation implements BaseModel /** * Specifies the transparency level of the solid color overlay. Accepts integers from `1` to `9`. */ - #[Api(optional: true)] + #[Optional] public ?float $alpha; /** * Specifies the background color of the solid color overlay. Accepts an RGB hex code (e.g., `FF0000`), an RGBA code (e.g., `FFAABB50`), or a color name. */ - #[Api(optional: true)] + #[Optional] public ?string $background; /** * Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. * Only works if the base asset is an image. See [gradient](https://imagekit.io/docs/effects-and-enhancements#gradient---e-gradient). */ - #[Api(optional: true)] + #[Optional] public string|bool|null $gradient; /** * Controls the height of the solid color overlay. Accepts a numeric value or an arithmetic expression. * Learn about [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). */ - #[Api(optional: true)] + #[Optional] public float|string|null $height; /** @@ -55,14 +55,14 @@ final class SolidColorOverlayTransformation implements BaseModel * * @var float|'max'|null $radius */ - #[Api(optional: true)] + #[Optional] public float|string|null $radius; /** * Controls the width of the solid color overlay. Accepts a numeric value or an arithmetic expression (e.g., `bw_mul_0.2` or `bh_div_2`). * Learn about [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). */ - #[Api(optional: true)] + #[Optional] public float|string|null $width; public function __construct() diff --git a/src/SrcOptions.php b/src/SrcOptions.php index 40a7e481..b89bbff9 100644 --- a/src/SrcOptions.php +++ b/src/SrcOptions.php @@ -4,7 +4,8 @@ namespace Imagekit; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -30,13 +31,13 @@ final class SrcOptions implements BaseModel * Accepts a relative or absolute path of the resource. If a relative path is provided, it is appended to the `urlEndpoint`. * If an absolute path is provided, `urlEndpoint` is ignored. */ - #[Api] + #[Required] public string $src; /** * Get your urlEndpoint from the [ImageKit dashboard](https://imagekit.io/dashboard/url-endpoints). */ - #[Api] + #[Required] public string $urlEndpoint; /** @@ -49,7 +50,7 @@ final class SrcOptions implements BaseModel * * [Learn more](https://imagekit.io/docs/media-delivery-basic-security#how-to-generate-signed-urls). */ - #[Api(optional: true)] + #[Optional] public ?float $expiresIn; /** @@ -59,7 +60,7 @@ final class SrcOptions implements BaseModel * * @var array|null $queryParameters */ - #[Api(map: 'string', optional: true)] + #[Optional(map: 'string')] public ?array $queryParameters; /** @@ -68,7 +69,7 @@ final class SrcOptions implements BaseModel * Note: If `expiresIn` is set to any value above 0, the URL will always be signed regardless of this setting. * [Learn more](https://imagekit.io/docs/media-delivery-basic-security#how-to-generate-signed-urls). */ - #[Api(optional: true)] + #[Optional] public ?bool $signed; /** @@ -77,7 +78,7 @@ final class SrcOptions implements BaseModel * * @var list|null $transformation */ - #[Api(list: Transformation::class, optional: true)] + #[Optional(list: Transformation::class)] public ?array $transformation; /** @@ -87,7 +88,7 @@ final class SrcOptions implements BaseModel * * @var value-of|null $transformationPosition */ - #[Api(enum: TransformationPosition::class, optional: true)] + #[Optional(enum: TransformationPosition::class)] public ?string $transformationPosition; /** diff --git a/src/SubtitleOverlay.php b/src/SubtitleOverlay.php index 2249092d..5e5bb12d 100644 --- a/src/SubtitleOverlay.php +++ b/src/SubtitleOverlay.php @@ -4,7 +4,8 @@ namespace Imagekit; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\OverlayPosition\Focus; @@ -27,19 +28,19 @@ final class SubtitleOverlay implements BaseModel use SdkModel; /** @var 'subtitle' $type */ - #[Api] + #[Required] public string $type = 'subtitle'; - #[Api(optional: true)] + #[Optional] public ?OverlayPosition $position; - #[Api(optional: true)] + #[Optional] public ?OverlayTiming $timing; /** * Specifies the relative path to the subtitle file used as an overlay. */ - #[Api] + #[Required] public string $input; /** @@ -50,7 +51,7 @@ final class SubtitleOverlay implements BaseModel * * @var value-of|null $encoding */ - #[Api(enum: Encoding::class, optional: true)] + #[Optional(enum: Encoding::class)] public ?string $encoding; /** @@ -58,7 +59,7 @@ final class SubtitleOverlay implements BaseModel * * @var list|null $transformation */ - #[Api(list: SubtitleOverlayTransformation::class, optional: true)] + #[Optional(list: SubtitleOverlayTransformation::class)] public ?array $transformation; /** diff --git a/src/SubtitleOverlayTransformation.php b/src/SubtitleOverlayTransformation.php index 4813c602..fad66615 100644 --- a/src/SubtitleOverlayTransformation.php +++ b/src/SubtitleOverlayTransformation.php @@ -4,7 +4,7 @@ namespace Imagekit; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\SubtitleOverlayTransformation\Typography; @@ -32,7 +32,7 @@ final class SubtitleOverlayTransformation implements BaseModel * * [Subtitle styling options](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) */ - #[Api(optional: true)] + #[Optional] public ?string $background; /** @@ -40,13 +40,13 @@ final class SubtitleOverlayTransformation implements BaseModel * * [Subtitle styling options](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) */ - #[Api(optional: true)] + #[Optional] public ?string $color; /** * Font family for subtitles. Refer to the [supported fonts](https://imagekit.io/docs/add-overlays-on-images#supported-text-font-list). */ - #[Api(optional: true)] + #[Optional] public ?string $fontFamily; /** @@ -56,7 +56,7 @@ final class SubtitleOverlayTransformation implements BaseModel * * [Subtitle styling options](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) */ - #[Api(optional: true)] + #[Optional] public ?string $fontOutline; /** @@ -66,7 +66,7 @@ final class SubtitleOverlayTransformation implements BaseModel * * [Subtitle styling options](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) */ - #[Api(optional: true)] + #[Optional] public ?string $fontShadow; /** @@ -74,7 +74,7 @@ final class SubtitleOverlayTransformation implements BaseModel * * [Subtitle styling options](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) */ - #[Api(optional: true)] + #[Optional] public ?float $fontSize; /** @@ -84,7 +84,7 @@ final class SubtitleOverlayTransformation implements BaseModel * * @var value-of|null $typography */ - #[Api(enum: Typography::class, optional: true)] + #[Optional(enum: Typography::class)] public ?string $typography; public function __construct() diff --git a/src/TextOverlay.php b/src/TextOverlay.php index 63fe6dd6..e163918a 100644 --- a/src/TextOverlay.php +++ b/src/TextOverlay.php @@ -4,7 +4,8 @@ namespace Imagekit; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\OverlayPosition\Focus; @@ -28,19 +29,19 @@ final class TextOverlay implements BaseModel use SdkModel; /** @var 'text' $type */ - #[Api] + #[Required] public string $type = 'text'; - #[Api(optional: true)] + #[Optional] public ?OverlayPosition $position; - #[Api(optional: true)] + #[Optional] public ?OverlayTiming $timing; /** * Specifies the text to be displayed in the overlay. The SDK automatically handles special characters and encoding. */ - #[Api] + #[Required] public string $text; /** @@ -51,7 +52,7 @@ final class TextOverlay implements BaseModel * * @var value-of|null $encoding */ - #[Api(enum: Encoding::class, optional: true)] + #[Optional(enum: Encoding::class)] public ?string $encoding; /** @@ -59,7 +60,7 @@ final class TextOverlay implements BaseModel * * @var list|null $transformation */ - #[Api(list: TextOverlayTransformation::class, optional: true)] + #[Optional(list: TextOverlayTransformation::class)] public ?array $transformation; /** diff --git a/src/TextOverlayTransformation.php b/src/TextOverlayTransformation.php index 050866e4..df155335 100644 --- a/src/TextOverlayTransformation.php +++ b/src/TextOverlayTransformation.php @@ -4,7 +4,7 @@ namespace Imagekit; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\TextOverlayTransformation\Flip; @@ -35,14 +35,14 @@ final class TextOverlayTransformation implements BaseModel /** * Specifies the transparency level of the text overlay. Accepts integers from `1` to `9`. */ - #[Api(optional: true)] + #[Optional] public ?float $alpha; /** * Specifies the background color of the text overlay. * Accepts an RGB hex code, an RGBA code, or a color name. */ - #[Api(optional: true)] + #[Optional] public ?string $background; /** @@ -50,26 +50,26 @@ final class TextOverlayTransformation implements BaseModel * * @var value-of|null $flip */ - #[Api(enum: Flip::class, optional: true)] + #[Optional(enum: Flip::class)] public ?string $flip; /** * Specifies the font color of the overlaid text. Accepts an RGB hex code (e.g., `FF0000`), an RGBA code (e.g., `FFAABB50`), or a color name. */ - #[Api(optional: true)] + #[Optional] public ?string $fontColor; /** * Specifies the font family of the overlaid text. Choose from the supported fonts list or use a custom font. * See [Supported fonts](https://imagekit.io/docs/add-overlays-on-images#supported-text-font-list) and [Custom font](https://imagekit.io/docs/add-overlays-on-images#change-font-family-in-text-overlay). */ - #[Api(optional: true)] + #[Optional] public ?string $fontFamily; /** * Specifies the font size of the overlaid text. Accepts a numeric value or an arithmetic expression. */ - #[Api(optional: true)] + #[Optional] public float|string|null $fontSize; /** @@ -77,14 +77,14 @@ final class TextOverlayTransformation implements BaseModel * * @var value-of|null $innerAlignment */ - #[Api(enum: InnerAlignment::class, optional: true)] + #[Optional(enum: InnerAlignment::class)] public ?string $innerAlignment; /** * Specifies the line height of the text overlay. * Accepts integer values representing line height in points. It can also accept [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations) such as `bw_mul_0.2`, or `bh_div_20`. */ - #[Api(optional: true)] + #[Optional] public float|string|null $lineHeight; /** @@ -92,7 +92,7 @@ final class TextOverlayTransformation implements BaseModel * Can be provided as a single positive integer or multiple values separated by underscores (following CSS shorthand order). * Arithmetic expressions are also accepted. */ - #[Api(optional: true)] + #[Optional] public float|string|null $padding; /** @@ -101,14 +101,14 @@ final class TextOverlayTransformation implements BaseModel * * @var float|'max'|null $radius */ - #[Api(optional: true)] + #[Optional] public float|string|null $radius; /** * Specifies the rotation angle of the text overlay. * Accepts a numeric value for clockwise rotation or a string prefixed with "N" for counter-clockwise rotation. */ - #[Api(optional: true)] + #[Optional] public float|string|null $rotation; /** @@ -117,14 +117,14 @@ final class TextOverlayTransformation implements BaseModel * - Single styles: `b` (bold), `i` (italic), `strikethrough`. * - Combinations: Any combination separated by underscores, e.g., `b_i`, `b_i_strikethrough`. */ - #[Api(optional: true)] + #[Optional] public ?string $typography; /** * Specifies the maximum width (in pixels) of the overlaid text. The text wraps automatically, and arithmetic expressions (e.g., `bw_mul_0.2` or `bh_div_2`) are supported. Useful when used in conjunction with the `background`. * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). */ - #[Api(optional: true)] + #[Optional] public float|string|null $width; public function __construct() diff --git a/src/Transformation.php b/src/Transformation.php index 11744fcf..a8252b3f 100644 --- a/src/Transformation.php +++ b/src/Transformation.php @@ -4,7 +4,7 @@ namespace Imagekit; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Transformation\AudioCodec; @@ -86,7 +86,7 @@ final class Transformation implements BaseModel * Not supported inside overlay. * See [AI Change Background](https://imagekit.io/docs/ai-transformations#change-background-e-changebg). */ - #[Api(optional: true)] + #[Optional] public ?string $aiChangeBackground; /** @@ -96,7 +96,7 @@ final class Transformation implements BaseModel * Supported inside overlay. * See [AI Drop Shadow](https://imagekit.io/docs/ai-transformations#ai-drop-shadow-e-dropshadow). */ - #[Api(optional: true)] + #[Optional] public string|bool|null $aiDropShadow; /** @@ -105,7 +105,7 @@ final class Transformation implements BaseModel * Not supported inside overlay. * See [AI Edit](https://imagekit.io/docs/ai-transformations#edit-image-e-edit). */ - #[Api(optional: true)] + #[Optional] public ?string $aiEdit; /** @@ -113,7 +113,7 @@ final class Transformation implements BaseModel * Supported inside overlay. * See [AI Background Removal](https://imagekit.io/docs/ai-transformations#imagekit-background-removal-e-bgremove). */ - #[Api(optional: true)] + #[Optional] public ?bool $aiRemoveBackground; /** @@ -122,21 +122,21 @@ final class Transformation implements BaseModel * Supported inside overlay. * See [External Background Removal](https://imagekit.io/docs/ai-transformations#background-removal-e-removedotbg). */ - #[Api(optional: true)] + #[Optional] public ?bool $aiRemoveBackgroundExternal; /** * Performs AI-based retouching to improve faces or product shots. Not supported inside overlay. * See [AI Retouch](https://imagekit.io/docs/ai-transformations#retouch-e-retouch). */ - #[Api(optional: true)] + #[Optional] public ?bool $aiRetouch; /** * Upscales images beyond their original dimensions using AI. Not supported inside overlay. * See [AI Upscale](https://imagekit.io/docs/ai-transformations#upscale-e-upscale). */ - #[Api(optional: true)] + #[Optional] public ?bool $aiUpscale; /** @@ -144,7 +144,7 @@ final class Transformation implements BaseModel * such as changes in color, texture, and other visual elements, while preserving the structure and essence of the original image. Not supported inside overlay. * See [AI Generate Variations](https://imagekit.io/docs/ai-transformations#generate-variations-of-an-image-e-genvar). */ - #[Api(optional: true)] + #[Optional] public ?bool $aiVariation; /** @@ -152,7 +152,7 @@ final class Transformation implements BaseModel * For example: aspectRatio = `4:3`, `4_3`, or an expression like `iar_div_2`. * See [Image resize and crop – Aspect ratio](https://imagekit.io/docs/image-resize-and-crop#aspect-ratio---ar). */ - #[Api(optional: true)] + #[Optional] public float|string|null $aspectRatio; /** @@ -160,7 +160,7 @@ final class Transformation implements BaseModel * * @var value-of|null $audioCodec */ - #[Api(enum: AudioCodec::class, optional: true)] + #[Optional(enum: AudioCodec::class)] public ?string $audioCodec; /** @@ -170,14 +170,14 @@ final class Transformation implements BaseModel * - Expand the image boundaries using generative fill: `genfill`. Not supported inside overlay. Optionally, control the background scene by passing a text prompt: * `genfill[:-prompt-${text}]` or `genfill[:-prompte-${urlencoded_base64_encoded_text}]`. See [Generative fill background](https://imagekit.io/docs/ai-transformations#generative-fill-bg-genfill). */ - #[Api(optional: true)] + #[Optional] public ?string $background; /** * Specifies the Gaussian blur level. Accepts an integer value between 1 and 100, or an expression like `bl-10`. * See [Blur](https://imagekit.io/docs/effects-and-enhancements#blur---bl). */ - #[Api(optional: true)] + #[Optional] public ?float $blur; /** @@ -185,21 +185,21 @@ final class Transformation implements BaseModel * (e.g., `5_FFF000` for a 5px yellow border), or an expression like `ih_div_20_FF00FF`. * See [Border](https://imagekit.io/docs/effects-and-enhancements#border---b). */ - #[Api(optional: true)] + #[Optional] public ?string $border; /** * Indicates whether the output image should retain the original color profile. * See [Color profile](https://imagekit.io/docs/image-optimization#color-profile---cp). */ - #[Api(optional: true)] + #[Optional] public ?bool $colorProfile; /** * Automatically enhances the contrast of an image (contrast stretch). * See [Contrast Stretch](https://imagekit.io/docs/effects-and-enhancements#contrast-stretch---e-contrast). */ - #[Api(optional: true)] + #[Optional] public ?bool $contrastStretch; /** @@ -207,7 +207,7 @@ final class Transformation implements BaseModel * * @var value-of|null $crop */ - #[Api(enum: Crop::class, optional: true)] + #[Optional(enum: Crop::class)] public ?string $crop; /** @@ -215,21 +215,21 @@ final class Transformation implements BaseModel * * @var value-of|null $cropMode */ - #[Api(enum: CropMode::class, optional: true)] + #[Optional(enum: CropMode::class)] public ?string $cropMode; /** * Specifies a fallback image if the resource is not found, e.g., a URL or file path. * See [Default image](https://imagekit.io/docs/image-transformation#default-image---di). */ - #[Api(optional: true)] + #[Optional] public ?string $defaultImage; /** * Accepts values between 0.1 and 5, or `auto` for automatic device pixel ratio (DPR) calculation. * See [DPR](https://imagekit.io/docs/image-resize-and-crop#dpr---dpr). */ - #[Api(optional: true)] + #[Optional] public ?float $dpr; /** @@ -237,7 +237,7 @@ final class Transformation implements BaseModel * Typically used with startOffset to indicate the length from the start offset. Arithmetic expressions are supported. * See [Trim videos – Duration](https://imagekit.io/docs/trim-videos#duration---du). */ - #[Api(optional: true)] + #[Optional] public float|string|null $duration; /** @@ -245,7 +245,7 @@ final class Transformation implements BaseModel * Typically used with startOffset to define a time window. Arithmetic expressions are supported. * See [Trim videos – End offset](https://imagekit.io/docs/trim-videos#end-offset---eo). */ - #[Api(optional: true)] + #[Optional] public float|string|null $endOffset; /** @@ -255,7 +255,7 @@ final class Transformation implements BaseModel * * @var value-of|null $flip */ - #[Api(enum: Flip::class, optional: true)] + #[Optional(enum: Flip::class)] public ?string $flip; /** @@ -266,7 +266,7 @@ final class Transformation implements BaseModel * - See [Focus](https://imagekit.io/docs/image-resize-and-crop#focus---fo). * - [Object aware cropping](https://imagekit.io/docs/image-resize-and-crop#object-aware-cropping---fo-object-name). */ - #[Api(optional: true)] + #[Optional] public ?string $focus; /** @@ -277,20 +277,20 @@ final class Transformation implements BaseModel * * @var value-of|null $format */ - #[Api(enum: Format::class, optional: true)] + #[Optional(enum: Format::class)] public ?string $format; /** * Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. * See [Gradient](https://imagekit.io/docs/effects-and-enhancements#gradient---e-gradient). */ - #[Api(optional: true)] + #[Optional] public string|bool|null $gradient; /** * Enables a grayscale effect for images. See [Grayscale](https://imagekit.io/docs/effects-and-enhancements#grayscale---e-grayscale). */ - #[Api(optional: true)] + #[Optional] public ?bool $grayscale; /** @@ -298,14 +298,14 @@ final class Transformation implements BaseModel * You can also supply arithmetic expressions (e.g., `ih_mul_0.5`). * Height transformation – [Images](https://imagekit.io/docs/image-resize-and-crop#height---h) · [Videos](https://imagekit.io/docs/video-resize-and-crop#height---h). */ - #[Api(optional: true)] + #[Optional] public float|string|null $height; /** * Specifies whether the output image (in JPEG or PNG) should be compressed losslessly. * See [Lossless compression](https://imagekit.io/docs/image-optimization#lossless-webp-and-png---lo). */ - #[Api(optional: true)] + #[Optional] public ?bool $lossless; /** @@ -313,26 +313,26 @@ final class Transformation implements BaseModel * Set this to true to preserve metadata. * See [Image metadata](https://imagekit.io/docs/image-optimization#image-metadata---md). */ - #[Api(optional: true)] + #[Optional] public ?bool $metadata; /** * Named transformation reference. See [Named transformations](https://imagekit.io/docs/transformations#named-transformations). */ - #[Api(optional: true)] + #[Optional] public ?string $named; /** * Specifies the opacity level of the output image. See [Opacity](https://imagekit.io/docs/effects-and-enhancements#opacity---o). */ - #[Api(optional: true)] + #[Optional] public ?float $opacity; /** * If set to true, serves the original file without applying any transformations. * See [Deliver original file as-is](https://imagekit.io/docs/core-delivery-features#deliver-original-file-as-is---orig-true). */ - #[Api(optional: true)] + #[Optional] public ?bool $original; /** @@ -340,7 +340,7 @@ final class Transformation implements BaseModel * ImageKit supports overlays including images, text, videos, subtitles, and solid colors. * See [Overlay using layers](https://imagekit.io/docs/transformations#overlay-using-layers). */ - #[Api(union: Overlay::class, optional: true)] + #[Optional(union: Overlay::class)] public ?Overlay $overlay; /** @@ -349,7 +349,7 @@ final class Transformation implements BaseModel * or by name (e.g., `name-layer-4` for a PSD layer). * See [Thumbnail extraction](https://imagekit.io/docs/vector-and-animated-images#get-thumbnail-from-psd-pdf-ai-eps-and-animated-files). */ - #[Api(optional: true)] + #[Optional] public float|string|null $page; /** @@ -357,7 +357,7 @@ final class Transformation implements BaseModel * pixelated version of the full image, which gradually improves to provide a faster perceived load time. * See [Progressive images](https://imagekit.io/docs/image-optimization#progressive-image---pr). */ - #[Api(optional: true)] + #[Optional] public ?bool $progressive; /** @@ -365,7 +365,7 @@ final class Transformation implements BaseModel * A higher quality value results in a larger file size with better quality, while a lower value produces a smaller file size with reduced quality. * See [Quality](https://imagekit.io/docs/image-optimization#quality---q). */ - #[Api(optional: true)] + #[Optional] public ?float $quality; /** @@ -374,14 +374,14 @@ final class Transformation implements BaseModel * * @var float|'max'|null $radius */ - #[Api(optional: true)] + #[Optional] public float|string|null $radius; /** * Pass any transformation not directly supported by the SDK. * This transformation string is appended to the URL as provided. */ - #[Api(optional: true)] + #[Optional] public ?string $raw; /** @@ -390,7 +390,7 @@ final class Transformation implements BaseModel * For videos, only the following values are supported: 0, 90, 180, 270, or 360. * See [Rotate](https://imagekit.io/docs/effects-and-enhancements#rotate---rt). */ - #[Api(optional: true)] + #[Optional] public float|string|null $rotation; /** @@ -399,7 +399,7 @@ final class Transformation implements BaseModel * Pass `true` for a default shadow, or provide a string for a custom shadow. * See [Shadow](https://imagekit.io/docs/effects-and-enhancements#shadow---e-shadow). */ - #[Api(optional: true)] + #[Optional] public string|bool|null $shadow; /** @@ -407,7 +407,7 @@ final class Transformation implements BaseModel * Pass `true` for default sharpening, or provide a numeric value for custom sharpening. * See [Sharpen](https://imagekit.io/docs/effects-and-enhancements#sharpen---e-sharpen). */ - #[Api(optional: true)] + #[Optional] public float|bool|null $sharpen; /** @@ -415,7 +415,7 @@ final class Transformation implements BaseModel * Arithmetic expressions are also supported. * See [Trim videos – Start offset](https://imagekit.io/docs/trim-videos#start-offset---so). */ - #[Api(optional: true)] + #[Optional] public float|string|null $startOffset; /** @@ -424,7 +424,7 @@ final class Transformation implements BaseModel * * @var list>|null $streamingResolutions */ - #[Api(list: StreamingResolution::class, optional: true)] + #[Optional(list: StreamingResolution::class)] public ?array $streamingResolutions; /** @@ -432,7 +432,7 @@ final class Transformation implements BaseModel * leaving only the central object in the output image. * See [Trim edges](https://imagekit.io/docs/effects-and-enhancements#trim-edges---t). */ - #[Api(optional: true)] + #[Optional] public float|bool|null $trim; /** @@ -440,7 +440,7 @@ final class Transformation implements BaseModel * Pass `true` for a default unsharp mask, or provide a string for a custom unsharp mask. * See [Unsharp Mask](https://imagekit.io/docs/effects-and-enhancements#unsharp-mask---e-usm). */ - #[Api(optional: true)] + #[Optional] public string|bool|null $unsharpMask; /** @@ -448,7 +448,7 @@ final class Transformation implements BaseModel * * @var value-of|null $videoCodec */ - #[Api(enum: VideoCodec::class, optional: true)] + #[Optional(enum: VideoCodec::class)] public ?string $videoCodec; /** @@ -456,31 +456,31 @@ final class Transformation implements BaseModel * You can also supply arithmetic expressions (e.g., `iw_div_2`). * Width transformation – [Images](https://imagekit.io/docs/image-resize-and-crop#width---w) · [Videos](https://imagekit.io/docs/video-resize-and-crop#width---w). */ - #[Api(optional: true)] + #[Optional] public float|string|null $width; /** * Focus using cropped image coordinates - X coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). */ - #[Api(optional: true)] + #[Optional] public float|string|null $x; /** * Focus using cropped image coordinates - X center coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). */ - #[Api(optional: true)] + #[Optional] public float|string|null $xCenter; /** * Focus using cropped image coordinates - Y coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). */ - #[Api(optional: true)] + #[Optional] public float|string|null $y; /** * Focus using cropped image coordinates - Y center coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). */ - #[Api(optional: true)] + #[Optional] public float|string|null $yCenter; /** @@ -488,7 +488,7 @@ final class Transformation implements BaseModel * It should be used in conjunction with fo-face or fo-. * See [Zoom](https://imagekit.io/docs/image-resize-and-crop#zoom---z). */ - #[Api(optional: true)] + #[Optional] public ?float $zoom; public function __construct() diff --git a/src/VideoOverlay.php b/src/VideoOverlay.php index 71b8400a..67f3fb69 100644 --- a/src/VideoOverlay.php +++ b/src/VideoOverlay.php @@ -4,7 +4,8 @@ namespace Imagekit; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\OverlayPosition\Focus; @@ -26,19 +27,19 @@ final class VideoOverlay implements BaseModel use SdkModel; /** @var 'video' $type */ - #[Api] + #[Required] public string $type = 'video'; - #[Api(optional: true)] + #[Optional] public ?OverlayPosition $position; - #[Api(optional: true)] + #[Optional] public ?OverlayTiming $timing; /** * Specifies the relative path to the video used as an overlay. */ - #[Api] + #[Required] public string $input; /** @@ -49,7 +50,7 @@ final class VideoOverlay implements BaseModel * * @var value-of|null $encoding */ - #[Api(enum: Encoding::class, optional: true)] + #[Optional(enum: Encoding::class)] public ?string $encoding; /** @@ -58,7 +59,7 @@ final class VideoOverlay implements BaseModel * * @var list|null $transformation */ - #[Api(list: Transformation::class, optional: true)] + #[Optional(list: Transformation::class)] public ?array $transformation; /** diff --git a/src/Webhooks/BaseWebhookEvent.php b/src/Webhooks/BaseWebhookEvent.php index 78180f98..c5b1cafa 100644 --- a/src/Webhooks/BaseWebhookEvent.php +++ b/src/Webhooks/BaseWebhookEvent.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -19,13 +19,13 @@ final class BaseWebhookEvent implements BaseModel /** * Unique identifier for the event. */ - #[Api] + #[Required] public string $id; /** * The type of webhook event. */ - #[Api] + #[Required] public string $type; /** diff --git a/src/Webhooks/UploadPostTransformErrorEvent.php b/src/Webhooks/UploadPostTransformErrorEvent.php index 7f368380..2a4637b5 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent.php +++ b/src/Webhooks/UploadPostTransformErrorEvent.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\UploadPostTransformErrorEvent\Data; @@ -30,25 +30,25 @@ final class UploadPostTransformErrorEvent implements BaseModel /** * Unique identifier for the event. */ - #[Api] + #[Required] public string $id; /** * The type of webhook event. */ - #[Api] + #[Required] public string $type; /** * Timestamp of when the event occurred in ISO8601 format. */ - #[Api] + #[Required] public \DateTimeInterface $created_at; - #[Api] + #[Required] public Data $data; - #[Api] + #[Required] public Request $request; /** diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data.php b/src/Webhooks/UploadPostTransformErrorEvent/Data.php index ecf7044c..7be98b40 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Data.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\UploadPostTransformErrorEvent; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation; @@ -27,28 +27,28 @@ final class Data implements BaseModel /** * Unique identifier of the originally uploaded file. */ - #[Api] + #[Required] public string $fileId; /** * Name of the file. */ - #[Api] + #[Required] public string $name; /** * Path of the file. */ - #[Api] + #[Required] public string $path; - #[Api] + #[Required] public Transformation $transformation; /** * URL of the attempted post-transformation. */ - #[Api] + #[Required] public string $url; /** diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php index c14dac4f..2f9c5dc2 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\UploadPostTransformErrorEvent\Data; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation\Error; @@ -17,7 +17,7 @@ final class Transformation implements BaseModel /** @use SdkModel */ use SdkModel; - #[Api] + #[Required] public Error $error; /** diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php index dcbfe866..322726f9 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -19,7 +19,7 @@ final class Error implements BaseModel /** * Reason for the post-transformation failure. */ - #[Api] + #[Required] public string $reason; /** diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request.php b/src/Webhooks/UploadPostTransformErrorEvent/Request.php index 409ad8ab..419fc240 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\UploadPostTransformErrorEvent; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation; @@ -21,13 +21,13 @@ final class Request implements BaseModel /** @use SdkModel */ use SdkModel; - #[Api] + #[Required] public Transformation $transformation; /** * Unique identifier for the originating request. */ - #[Api] + #[Required] public string $x_request_id; /** diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php index 5ace66c4..7e2b9ecd 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php @@ -4,7 +4,8 @@ namespace Imagekit\Webhooks\UploadPostTransformErrorEvent\Request; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation\Protocol; @@ -25,7 +26,7 @@ final class Transformation implements BaseModel * * @var value-of $type */ - #[Api(enum: Type::class)] + #[Required(enum: Type::class)] public string $type; /** @@ -33,13 +34,13 @@ final class Transformation implements BaseModel * * @var value-of|null $protocol */ - #[Api(enum: Protocol::class, optional: true)] + #[Optional(enum: Protocol::class)] public ?string $protocol; /** * Value for the requested transformation type. */ - #[Api(optional: true)] + #[Optional] public ?string $value; /** diff --git a/src/Webhooks/UploadPostTransformSuccessEvent.php b/src/Webhooks/UploadPostTransformSuccessEvent.php index 7ba1e45b..339cdc62 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\UploadPostTransformSuccessEvent\Data; @@ -30,25 +30,25 @@ final class UploadPostTransformSuccessEvent implements BaseModel /** * Unique identifier for the event. */ - #[Api] + #[Required] public string $id; /** * The type of webhook event. */ - #[Api] + #[Required] public string $type; /** * Timestamp of when the event occurred in ISO8601 format. */ - #[Api] + #[Required] public \DateTimeInterface $created_at; - #[Api] + #[Required] public Data $data; - #[Api] + #[Required] public Request $request; /** diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Data.php b/src/Webhooks/UploadPostTransformSuccessEvent/Data.php index d8898050..4ef6717e 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Data.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Data.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\UploadPostTransformSuccessEvent; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -19,19 +19,19 @@ final class Data implements BaseModel /** * Unique identifier of the originally uploaded file. */ - #[Api] + #[Required] public string $fileId; /** * Name of the file. */ - #[Api] + #[Required] public string $name; /** * URL of the generated post-transformation. */ - #[Api] + #[Required] public string $url; /** diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request.php index f661e9fc..33ad81e9 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\UploadPostTransformSuccessEvent; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation; @@ -21,13 +21,13 @@ final class Request implements BaseModel /** @use SdkModel */ use SdkModel; - #[Api] + #[Required] public Transformation $transformation; /** * Unique identifier for the originating request. */ - #[Api] + #[Required] public string $x_request_id; /** diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php index 238316a5..5318565d 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php @@ -4,7 +4,8 @@ namespace Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation\Protocol; @@ -25,7 +26,7 @@ final class Transformation implements BaseModel * * @var value-of $type */ - #[Api(enum: Type::class)] + #[Required(enum: Type::class)] public string $type; /** @@ -33,13 +34,13 @@ final class Transformation implements BaseModel * * @var value-of|null $protocol */ - #[Api(enum: Protocol::class, optional: true)] + #[Optional(enum: Protocol::class)] public ?string $protocol; /** * Value for the requested transformation type. */ - #[Api(optional: true)] + #[Optional] public ?string $value; /** diff --git a/src/Webhooks/UploadPreTransformErrorEvent.php b/src/Webhooks/UploadPreTransformErrorEvent.php index 606d438e..3c71fdaf 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent.php +++ b/src/Webhooks/UploadPreTransformErrorEvent.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\UploadPreTransformErrorEvent\Data; @@ -30,25 +30,25 @@ final class UploadPreTransformErrorEvent implements BaseModel /** * Unique identifier for the event. */ - #[Api] + #[Required] public string $id; /** * The type of webhook event. */ - #[Api] + #[Required] public string $type; /** * Timestamp of when the event occurred in ISO8601 format. */ - #[Api] + #[Required] public \DateTimeInterface $created_at; - #[Api] + #[Required] public Data $data; - #[Api] + #[Required] public Request $request; /** diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data.php b/src/Webhooks/UploadPreTransformErrorEvent/Data.php index e017bcb5..1cec48dd 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Data.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\UploadPreTransformErrorEvent; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation; @@ -23,16 +23,16 @@ final class Data implements BaseModel /** * Name of the file. */ - #[Api] + #[Required] public string $name; /** * Path of the file. */ - #[Api] + #[Required] public string $path; - #[Api] + #[Required] public Transformation $transformation; /** diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php index 93dad3f1..2748faff 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\UploadPreTransformErrorEvent\Data; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation\Error; @@ -17,7 +17,7 @@ final class Transformation implements BaseModel /** @use SdkModel */ use SdkModel; - #[Api] + #[Required] public Error $error; /** diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php index 8f53f3f5..18d37e74 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -19,7 +19,7 @@ final class Error implements BaseModel /** * Reason for the pre-transformation failure. */ - #[Api] + #[Required] public string $reason; /** diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Request.php b/src/Webhooks/UploadPreTransformErrorEvent/Request.php index 316ddf2a..26ca2132 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Request.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Request.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\UploadPreTransformErrorEvent; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -19,13 +19,13 @@ final class Request implements BaseModel /** * The requested pre-transformation string. */ - #[Api] + #[Required] public string $transformation; /** * Unique identifier for the originating request. */ - #[Api] + #[Required] public string $x_request_id; /** diff --git a/src/Webhooks/UploadPreTransformSuccessEvent.php b/src/Webhooks/UploadPreTransformSuccessEvent.php index fdaf18a5..bc5d1643 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Files\Metadata; @@ -34,28 +34,28 @@ final class UploadPreTransformSuccessEvent implements BaseModel /** * Unique identifier for the event. */ - #[Api] + #[Required] public string $id; /** * The type of webhook event. */ - #[Api] + #[Required] public string $type; /** * Timestamp of when the event occurred in ISO8601 format. */ - #[Api] + #[Required] public \DateTimeInterface $created_at; /** * Object containing details of a successful upload. */ - #[Api] + #[Required] public Data $data; - #[Api] + #[Required] public Request $request; /** diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php index d22efaa5..88285b38 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Files\Metadata; @@ -60,25 +60,25 @@ final class Data implements BaseModel * * @var list|null $AITags */ - #[Api(list: AITag::class, nullable: true, optional: true)] + #[Optional(list: AITag::class, nullable: true)] public ?array $AITags; /** * The audio codec used in the video (only for video). */ - #[Api(optional: true)] + #[Optional] public ?string $audioCodec; /** * The bit rate of the video in kbps (only for video). */ - #[Api(optional: true)] + #[Optional] public ?int $bitRate; /** * Value of custom coordinates associated with the image in the format `x,y,width,height`. If `customCoordinates` are not defined, then it is `null`. Send `customCoordinates` in `responseFields` in API request to get the value of this field. */ - #[Api(nullable: true, optional: true)] + #[Optional(nullable: true)] public ?string $customCoordinates; /** @@ -86,19 +86,19 @@ final class Data implements BaseModel * * @var array|null $customMetadata */ - #[Api(map: 'mixed', optional: true)] + #[Optional(map: 'mixed')] public ?array $customMetadata; /** * Optional text to describe the contents of the file. Can be set by the user or the ai-auto-description extension. */ - #[Api(optional: true)] + #[Optional] public ?string $description; /** * The duration of the video in seconds (only for video). */ - #[Api(optional: true)] + #[Optional] public ?int $duration; /** @@ -106,7 +106,7 @@ final class Data implements BaseModel * * @var array|null $embeddedMetadata */ - #[Api(map: 'mixed', optional: true)] + #[Optional(map: 'mixed')] public ?array $embeddedMetadata; /** @@ -118,55 +118,55 @@ final class Data implements BaseModel * * If no extension was requested, then this parameter is not returned. */ - #[Api(optional: true)] + #[Optional] public ?ExtensionStatus $extensionStatus; /** * Unique fileId. Store this fileld in your database, as this will be used to perform update action on this file. */ - #[Api(optional: true)] + #[Optional] public ?string $fileId; /** * The relative path of the file in the media library e.g. `/marketing-assets/new-banner.jpg`. */ - #[Api(optional: true)] + #[Optional] public ?string $filePath; /** * Type of the uploaded file. Possible values are `image`, `non-image`. */ - #[Api(optional: true)] + #[Optional] public ?string $fileType; /** * Height of the image in pixels (Only for images). */ - #[Api(optional: true)] + #[Optional] public ?float $height; /** * Is the file marked as private. It can be either `true` or `false`. Send `isPrivateFile` in `responseFields` in API request to get the value of this field. */ - #[Api(optional: true)] + #[Optional] public ?bool $isPrivateFile; /** * Is the file published or in draft state. It can be either `true` or `false`. Send `isPublished` in `responseFields` in API request to get the value of this field. */ - #[Api(optional: true)] + #[Optional] public ?bool $isPublished; /** * Legacy metadata. Send `metadata` in `responseFields` in API request to get metadata in the upload API response. */ - #[Api(optional: true)] + #[Optional] public ?Metadata $metadata; /** * Name of the asset. */ - #[Api(optional: true)] + #[Optional] public ?string $name; /** @@ -178,13 +178,13 @@ final class Data implements BaseModel * * @var array|null $selectedFieldsSchema */ - #[Api(map: SelectedFieldsSchema::class, optional: true)] + #[Optional(map: SelectedFieldsSchema::class)] public ?array $selectedFieldsSchema; /** * Size of the image file in Bytes. */ - #[Api(optional: true)] + #[Optional] public ?float $size; /** @@ -192,37 +192,37 @@ final class Data implements BaseModel * * @var list|null $tags */ - #[Api(list: 'string', nullable: true, optional: true)] + #[Optional(list: 'string', nullable: true)] public ?array $tags; /** * In the case of an image, a small thumbnail URL. */ - #[Api(optional: true)] + #[Optional] public ?string $thumbnailUrl; /** * A publicly accessible URL of the file. */ - #[Api(optional: true)] + #[Optional] public ?string $url; /** * An object containing the file or file version's `id` (versionId) and `name`. */ - #[Api(optional: true)] + #[Optional] public ?VersionInfo $versionInfo; /** * The video codec used in the video (only for video). */ - #[Api(optional: true)] + #[Optional] public ?string $videoCodec; /** * Width of the image in pixels (Only for Images). */ - #[Api(optional: true)] + #[Optional] public ?float $width; public function __construct() diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php index 044f7f9e..062e84a8 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -21,19 +21,19 @@ final class AITag implements BaseModel /** * Confidence score of the tag. */ - #[Api(optional: true)] + #[Optional] public ?float $confidence; /** * Name of the tag. */ - #[Api(optional: true)] + #[Optional] public ?string $name; /** * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. */ - #[Api(optional: true)] + #[Optional] public ?string $source; public function __construct() diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php index 61d4bafc..31ead371 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\AIAutoDescription; @@ -34,19 +34,19 @@ final class ExtensionStatus implements BaseModel use SdkModel; /** @var value-of|null $ai_auto_description */ - #[Api('ai-auto-description', enum: AIAutoDescription::class, optional: true)] + #[Optional('ai-auto-description', enum: AIAutoDescription::class)] public ?string $ai_auto_description; /** @var value-of|null $aws_auto_tagging */ - #[Api('aws-auto-tagging', enum: AwsAutoTagging::class, optional: true)] + #[Optional('aws-auto-tagging', enum: AwsAutoTagging::class)] public ?string $aws_auto_tagging; /** @var value-of|null $google_auto_tagging */ - #[Api('google-auto-tagging', enum: GoogleAutoTagging::class, optional: true)] + #[Optional('google-auto-tagging', enum: GoogleAutoTagging::class)] public ?string $google_auto_tagging; /** @var value-of|null $remove_bg */ - #[Api('remove-bg', enum: RemoveBg::class, optional: true)] + #[Optional('remove-bg', enum: RemoveBg::class)] public ?string $remove_bg; public function __construct() diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php index db7f2dca..fa333553 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php @@ -4,7 +4,8 @@ namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue; @@ -35,7 +36,7 @@ final class SelectedFieldsSchema implements BaseModel * * @var value-of $type */ - #[Api(enum: Type::class)] + #[Required(enum: Type::class)] public string $type; /** @@ -43,43 +44,43 @@ final class SelectedFieldsSchema implements BaseModel * * @var string|float|bool|list|null $defaultValue */ - #[Api(union: DefaultValue::class, optional: true)] + #[Optional(union: DefaultValue::class)] public string|float|bool|array|null $defaultValue; /** * Specifies if the custom metadata field is required or not. */ - #[Api(optional: true)] + #[Optional] public ?bool $isValueRequired; /** * Maximum length of string. Only set if `type` is set to `Text` or `Textarea`. */ - #[Api(optional: true)] + #[Optional] public ?float $maxLength; /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. */ - #[Api(optional: true)] + #[Optional] public string|float|null $maxValue; /** * Minimum length of string. Only set if `type` is set to `Text` or `Textarea`. */ - #[Api(optional: true)] + #[Optional] public ?float $minLength; /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. */ - #[Api(optional: true)] + #[Optional] public string|float|null $minValue; /** * Indicates whether the custom metadata field is read only. A read only field cannot be modified after being set. This field is configurable only via the **Path policy** feature. */ - #[Api(optional: true)] + #[Optional] public ?bool $readOnly; /** @@ -87,13 +88,13 @@ final class SelectedFieldsSchema implements BaseModel * * @var list|null $selectOptions */ - #[Api(list: SelectOption::class, optional: true)] + #[Optional(list: SelectOption::class)] public ?array $selectOptions; /** * Specifies if the selectOptions array is truncated. It is truncated when number of options are > 100. */ - #[Api(optional: true)] + #[Optional] public ?bool $selectOptionsTruncated; /** diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php index b9b905d7..edf972aa 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -21,13 +21,13 @@ final class VersionInfo implements BaseModel /** * Unique identifier of the file version. */ - #[Api(optional: true)] + #[Optional] public ?string $id; /** * Name of the file version. */ - #[Api(optional: true)] + #[Optional] public ?string $name; public function __construct() diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Request.php b/src/Webhooks/UploadPreTransformSuccessEvent/Request.php index 4d7453f8..5e0ad3ba 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Request.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Request.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -19,13 +19,13 @@ final class Request implements BaseModel /** * The requested pre-transformation string. */ - #[Api] + #[Required] public string $transformation; /** * Unique identifier for the originating request. */ - #[Api] + #[Required] public string $x_request_id; /** diff --git a/src/Webhooks/VideoTransformationAcceptedEvent.php b/src/Webhooks/VideoTransformationAcceptedEvent.php index 7b81b146..140523ac 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data; @@ -31,28 +31,28 @@ final class VideoTransformationAcceptedEvent implements BaseModel /** * Unique identifier for the event. */ - #[Api] + #[Required] public string $id; /** * The type of webhook event. */ - #[Api] + #[Required] public string $type; /** * Timestamp when the event was created in ISO8601 format. */ - #[Api] + #[Required] public \DateTimeInterface $created_at; - #[Api] + #[Required] public Data $data; /** * Information about the original request that triggered the video transformation. */ - #[Api] + #[Required] public Request $request; /** diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data.php index eb46305e..36a7d4c6 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Asset; @@ -23,13 +23,13 @@ final class Data implements BaseModel /** * Information about the source video asset being transformed. */ - #[Api] + #[Required] public Asset $asset; /** * Base information about a video transformation request. */ - #[Api] + #[Required] public Transformation $transformation; /** diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php index ea1cba6d..7c050028 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -21,7 +21,7 @@ final class Asset implements BaseModel /** * URL to download or access the source video file. */ - #[Api] + #[Required] public string $url; /** diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php index 90445ab6..89b47c1a 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php @@ -4,7 +4,8 @@ namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; @@ -34,13 +35,13 @@ final class Transformation implements BaseModel * * @var value-of $type */ - #[Api(enum: Type::class)] + #[Required(enum: Type::class)] public string $type; /** * Configuration options for video transformations. */ - #[Api(optional: true)] + #[Optional] public ?Options $options; /** diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php index 678c68a0..dd58a52e 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\AudioCodec; @@ -35,13 +35,13 @@ final class Options implements BaseModel * * @var value-of|null $audio_codec */ - #[Api(enum: AudioCodec::class, optional: true)] + #[Optional(enum: AudioCodec::class)] public ?string $audio_codec; /** * Whether to automatically rotate the video based on metadata. */ - #[Api(optional: true)] + #[Optional] public ?bool $auto_rotate; /** @@ -49,13 +49,13 @@ final class Options implements BaseModel * * @var value-of|null $format */ - #[Api(enum: Format::class, optional: true)] + #[Optional(enum: Format::class)] public ?string $format; /** * Quality setting for the output video. */ - #[Api(optional: true)] + #[Optional] public ?int $quality; /** @@ -63,7 +63,7 @@ final class Options implements BaseModel * * @var value-of|null $stream_protocol */ - #[Api(enum: StreamProtocol::class, optional: true)] + #[Optional(enum: StreamProtocol::class)] public ?string $stream_protocol; /** @@ -71,7 +71,7 @@ final class Options implements BaseModel * * @var list|null $variants */ - #[Api(list: 'string', optional: true)] + #[Optional(list: 'string')] public ?array $variants; /** @@ -79,7 +79,7 @@ final class Options implements BaseModel * * @var value-of|null $video_codec */ - #[Api(enum: VideoCodec::class, optional: true)] + #[Optional(enum: VideoCodec::class)] public ?string $video_codec; public function __construct() diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Request.php b/src/Webhooks/VideoTransformationAcceptedEvent/Request.php index f666665c..d8e85adc 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Request.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Request.php @@ -4,7 +4,8 @@ namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -23,19 +24,19 @@ final class Request implements BaseModel /** * Full URL of the transformation request that was submitted. */ - #[Api] + #[Required] public string $url; /** * Unique identifier for the originating transformation request. */ - #[Api] + #[Required] public string $x_request_id; /** * User-Agent header from the original request that triggered the transformation. */ - #[Api(optional: true)] + #[Optional] public ?string $user_agent; /** diff --git a/src/Webhooks/VideoTransformationErrorEvent.php b/src/Webhooks/VideoTransformationErrorEvent.php index bc3821ed..6694dda7 100644 --- a/src/Webhooks/VideoTransformationErrorEvent.php +++ b/src/Webhooks/VideoTransformationErrorEvent.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\VideoTransformationErrorEvent\Data; @@ -31,28 +31,28 @@ final class VideoTransformationErrorEvent implements BaseModel /** * Unique identifier for the event. */ - #[Api] + #[Required] public string $id; /** * The type of webhook event. */ - #[Api] + #[Required] public string $type; /** * Timestamp when the event was created in ISO8601 format. */ - #[Api] + #[Required] public \DateTimeInterface $created_at; - #[Api] + #[Required] public Data $data; /** * Information about the original request that triggered the video transformation. */ - #[Api] + #[Required] public Request $request; /** diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data.php b/src/Webhooks/VideoTransformationErrorEvent/Data.php index 907ca351..18ccae52 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\VideoTransformationErrorEvent; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Asset; @@ -24,10 +24,10 @@ final class Data implements BaseModel /** * Information about the source video asset being transformed. */ - #[Api] + #[Required] public Asset $asset; - #[Api] + #[Required] public Transformation $transformation; /** diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php index f087ac70..b7edac3f 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\VideoTransformationErrorEvent\Data; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -21,7 +21,7 @@ final class Asset implements BaseModel /** * URL to download or access the source video file. */ - #[Api] + #[Required] public string $url; /** diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php index 631c1eea..435557d2 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php @@ -4,7 +4,8 @@ namespace Imagekit\Webhooks\VideoTransformationErrorEvent\Data; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error; @@ -34,19 +35,19 @@ final class Transformation implements BaseModel * * @var value-of $type */ - #[Api(enum: Type::class)] + #[Required(enum: Type::class)] public string $type; /** * Details about the transformation error. */ - #[Api(optional: true)] + #[Optional] public ?Error $error; /** * Configuration options for video transformations. */ - #[Api(optional: true)] + #[Optional] public ?Options $options; /** diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php index 205de51e..bdd021c0 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error\Reason; @@ -27,7 +27,7 @@ final class Error implements BaseModel * * @var value-of $reason */ - #[Api(enum: Reason::class)] + #[Required(enum: Reason::class)] public string $reason; /** diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php index 79e1bdab..10f68383 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\AudioCodec; @@ -35,13 +35,13 @@ final class Options implements BaseModel * * @var value-of|null $audio_codec */ - #[Api(enum: AudioCodec::class, optional: true)] + #[Optional(enum: AudioCodec::class)] public ?string $audio_codec; /** * Whether to automatically rotate the video based on metadata. */ - #[Api(optional: true)] + #[Optional] public ?bool $auto_rotate; /** @@ -49,13 +49,13 @@ final class Options implements BaseModel * * @var value-of|null $format */ - #[Api(enum: Format::class, optional: true)] + #[Optional(enum: Format::class)] public ?string $format; /** * Quality setting for the output video. */ - #[Api(optional: true)] + #[Optional] public ?int $quality; /** @@ -63,7 +63,7 @@ final class Options implements BaseModel * * @var value-of|null $stream_protocol */ - #[Api(enum: StreamProtocol::class, optional: true)] + #[Optional(enum: StreamProtocol::class)] public ?string $stream_protocol; /** @@ -71,7 +71,7 @@ final class Options implements BaseModel * * @var list|null $variants */ - #[Api(list: 'string', optional: true)] + #[Optional(list: 'string')] public ?array $variants; /** @@ -79,7 +79,7 @@ final class Options implements BaseModel * * @var value-of|null $video_codec */ - #[Api(enum: VideoCodec::class, optional: true)] + #[Optional(enum: VideoCodec::class)] public ?string $video_codec; public function __construct() diff --git a/src/Webhooks/VideoTransformationErrorEvent/Request.php b/src/Webhooks/VideoTransformationErrorEvent/Request.php index 359f524e..8837ee54 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Request.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Request.php @@ -4,7 +4,8 @@ namespace Imagekit\Webhooks\VideoTransformationErrorEvent; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -23,19 +24,19 @@ final class Request implements BaseModel /** * Full URL of the transformation request that was submitted. */ - #[Api] + #[Required] public string $url; /** * Unique identifier for the originating transformation request. */ - #[Api] + #[Required] public string $x_request_id; /** * User-Agent header from the original request that triggered the transformation. */ - #[Api(optional: true)] + #[Optional] public ?string $user_agent; /** diff --git a/src/Webhooks/VideoTransformationReadyEvent.php b/src/Webhooks/VideoTransformationReadyEvent.php index d42d9825..eeef5b5e 100644 --- a/src/Webhooks/VideoTransformationReadyEvent.php +++ b/src/Webhooks/VideoTransformationReadyEvent.php @@ -4,7 +4,8 @@ namespace Imagekit\Webhooks; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\VideoTransformationReadyEvent\Data; @@ -33,34 +34,34 @@ final class VideoTransformationReadyEvent implements BaseModel /** * Unique identifier for the event. */ - #[Api] + #[Required] public string $id; /** * The type of webhook event. */ - #[Api] + #[Required] public string $type; /** * Timestamp when the event was created in ISO8601 format. */ - #[Api] + #[Required] public \DateTimeInterface $created_at; - #[Api] + #[Required] public Data $data; /** * Information about the original request that triggered the video transformation. */ - #[Api] + #[Required] public Request $request; /** * Performance metrics for the transformation process. */ - #[Api(optional: true)] + #[Optional] public ?Timings $timings; /** diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data.php b/src/Webhooks/VideoTransformationReadyEvent/Data.php index 5dfdf0ba..d8ad3d4f 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\VideoTransformationReadyEvent; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Asset; @@ -24,10 +24,10 @@ final class Data implements BaseModel /** * Information about the source video asset being transformed. */ - #[Api] + #[Required] public Asset $asset; - #[Api] + #[Required] public Transformation $transformation; /** diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php index 6c6f099b..7700a7ee 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -21,7 +21,7 @@ final class Asset implements BaseModel /** * URL to download or access the source video file. */ - #[Api] + #[Required] public string $url; /** diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php index 3b19a7b1..bb9fdeaf 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php @@ -4,7 +4,8 @@ namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; @@ -34,19 +35,19 @@ final class Transformation implements BaseModel * * @var value-of $type */ - #[Api(enum: Type::class)] + #[Required(enum: Type::class)] public string $type; /** * Configuration options for video transformations. */ - #[Api(optional: true)] + #[Optional] public ?Options $options; /** * Information about the transformed output video. */ - #[Api(optional: true)] + #[Optional] public ?Output $output; /** diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php index 1593224f..948bfcf5 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\AudioCodec; @@ -35,13 +35,13 @@ final class Options implements BaseModel * * @var value-of|null $audio_codec */ - #[Api(enum: AudioCodec::class, optional: true)] + #[Optional(enum: AudioCodec::class)] public ?string $audio_codec; /** * Whether to automatically rotate the video based on metadata. */ - #[Api(optional: true)] + #[Optional] public ?bool $auto_rotate; /** @@ -49,13 +49,13 @@ final class Options implements BaseModel * * @var value-of|null $format */ - #[Api(enum: Format::class, optional: true)] + #[Optional(enum: Format::class)] public ?string $format; /** * Quality setting for the output video. */ - #[Api(optional: true)] + #[Optional] public ?int $quality; /** @@ -63,7 +63,7 @@ final class Options implements BaseModel * * @var value-of|null $stream_protocol */ - #[Api(enum: StreamProtocol::class, optional: true)] + #[Optional(enum: StreamProtocol::class)] public ?string $stream_protocol; /** @@ -71,7 +71,7 @@ final class Options implements BaseModel * * @var list|null $variants */ - #[Api(list: 'string', optional: true)] + #[Optional(list: 'string')] public ?array $variants; /** @@ -79,7 +79,7 @@ final class Options implements BaseModel * * @var value-of|null $video_codec */ - #[Api(enum: VideoCodec::class, optional: true)] + #[Optional(enum: VideoCodec::class)] public ?string $video_codec; public function __construct() diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php index 7346e725..d4637019 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php @@ -4,7 +4,8 @@ namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output\VideoMetadata; @@ -24,13 +25,13 @@ final class Output implements BaseModel /** * URL to access the transformed video. */ - #[Api] + #[Required] public string $url; /** * Metadata of the output video file. */ - #[Api(optional: true)] + #[Optional] public ?VideoMetadata $video_metadata; /** diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php index 66e5770b..707a4f17 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -23,25 +23,25 @@ final class VideoMetadata implements BaseModel /** * Bitrate of the output video in bits per second. */ - #[Api] + #[Required] public int $bitrate; /** * Duration of the output video in seconds. */ - #[Api] + #[Required] public float $duration; /** * Height of the output video in pixels. */ - #[Api] + #[Required] public int $height; /** * Width of the output video in pixels. */ - #[Api] + #[Required] public int $width; /** diff --git a/src/Webhooks/VideoTransformationReadyEvent/Request.php b/src/Webhooks/VideoTransformationReadyEvent/Request.php index cf228e31..8b1de802 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Request.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Request.php @@ -4,7 +4,8 @@ namespace Imagekit\Webhooks\VideoTransformationReadyEvent; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -23,19 +24,19 @@ final class Request implements BaseModel /** * Full URL of the transformation request that was submitted. */ - #[Api] + #[Required] public string $url; /** * Unique identifier for the originating transformation request. */ - #[Api] + #[Required] public string $x_request_id; /** * User-Agent header from the original request that triggered the transformation. */ - #[Api(optional: true)] + #[Optional] public ?string $user_agent; /** diff --git a/src/Webhooks/VideoTransformationReadyEvent/Timings.php b/src/Webhooks/VideoTransformationReadyEvent/Timings.php index 34e42e92..a84dd2db 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Timings.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Timings.php @@ -4,7 +4,7 @@ namespace Imagekit\Webhooks\VideoTransformationReadyEvent; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -23,13 +23,13 @@ final class Timings implements BaseModel /** * Time spent downloading the source video from your origin or media library, in milliseconds. */ - #[Api(optional: true)] + #[Optional] public ?int $download_duration; /** * Time spent encoding the video, in milliseconds. */ - #[Api(optional: true)] + #[Optional] public ?int $encoding_duration; public function __construct() diff --git a/tests/Core/TestModel.php b/tests/Core/TestModel.php index e56e4891..0d9cc520 100644 --- a/tests/Core/TestModel.php +++ b/tests/Core/TestModel.php @@ -2,7 +2,8 @@ namespace Tests\Core; -use Imagekit\Core\Attributes\Api; +use Imagekit\Core\Attributes\Optional; +use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use PHPUnit\Framework\Attributes\CoversNothing; @@ -14,17 +15,17 @@ class TestModel implements BaseModel /** @use SdkModel> */ use SdkModel; - #[Api] + #[Required] public string $name; - #[Api('age_years')] + #[Required('age_years')] public int $ageYears; /** @var list|null */ - #[Api(optional: true)] + #[Optional] public ?array $friends; - #[Api] + #[Required] public ?string $owner; /** From 59bab215c6165b2290ca08bb3aee44d16721a308 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 00:15:17 +0000 Subject: [PATCH 088/193] chore: ensure constant values are marked as optional in array types --- README.md | 16 ++++------------ src/Accounts/Origins/OriginRequest/AkeneoPim.php | 2 +- src/Accounts/Origins/OriginRequest/AzureBlob.php | 2 +- .../Origins/OriginRequest/CloudinaryBackup.php | 2 +- src/Accounts/Origins/OriginRequest/Gcs.php | 2 +- src/Accounts/Origins/OriginRequest/S3.php | 2 +- .../Origins/OriginRequest/S3Compatible.php | 2 +- src/Accounts/Origins/OriginRequest/WebFolder.php | 2 +- src/Accounts/Origins/OriginRequest/WebProxy.php | 2 +- .../Origins/OriginResponse/AkeneoPim.php | 2 +- .../Origins/OriginResponse/AzureBlob.php | 2 +- .../Origins/OriginResponse/CloudinaryBackup.php | 2 +- src/Accounts/Origins/OriginResponse/Gcs.php | 2 +- src/Accounts/Origins/OriginResponse/S3.php | 2 +- .../Origins/OriginResponse/S3Compatible.php | 2 +- .../Origins/OriginResponse/WebFolder.php | 2 +- src/Accounts/Origins/OriginResponse/WebProxy.php | 2 +- .../URLEndpoints/URLEndpointCreateParams.php | 12 ++++++------ .../URLRewriter/Akamai.php | 2 +- .../URLRewriter/Cloudinary.php | 2 +- .../URLRewriter/Imgix.php | 2 +- src/Accounts/URLEndpoints/URLEndpointRequest.php | 8 ++++---- .../URLEndpointRequest/URLRewriter/Akamai.php | 2 +- .../URLRewriter/Cloudinary.php | 2 +- .../URLEndpointRequest/URLRewriter/Imgix.php | 2 +- .../URLEndpoints/URLEndpointResponse.php | 8 ++++---- .../URLEndpointResponse/URLRewriter/Akamai.php | 2 +- .../URLRewriter/Cloudinary.php | 2 +- .../URLEndpointResponse/URLRewriter/Imgix.php | 2 +- .../URLEndpoints/URLEndpointUpdateParams.php | 12 ++++++------ .../URLRewriter/Akamai.php | 2 +- .../URLRewriter/Cloudinary.php | 2 +- .../URLRewriter/Imgix.php | 2 +- src/Beta/V2/Files/FileUploadParams.php | 12 ++++++------ .../V2/Files/FileUploadParams/Transformation.php | 16 ++++++++-------- .../FileUploadParams/Transformation/Post/Abs.php | 2 +- .../Transformation/Post/GifToVideo.php | 4 +++- .../Transformation/Post/Thumbnail.php | 2 +- .../Transformation/Post/Transformation.php | 4 +++- src/ExtensionItem/AIAutoDescription.php | 2 +- src/ExtensionItem/RemoveBg.php | 2 +- src/Files/FileUpdateParams.php | 12 ++++++------ src/Files/FileUploadParams.php | 12 ++++++------ src/Files/FileUploadParams/Transformation.php | 16 ++++++++-------- .../FileUploadParams/Transformation/Post/Abs.php | 2 +- .../Transformation/Post/GifToVideo.php | 4 +++- .../Transformation/Post/Thumbnail.php | 2 +- .../Transformation/Post/Transformation.php | 4 +++- .../UpdateFileRequest/UpdateFileDetails.php | 8 ++++---- src/ImageOverlay.php | 2 +- src/Services/AssetsService.php | 6 ++++-- src/Services/Beta/V2/FilesService.php | 3 ++- src/Services/CustomMetadataFieldsService.php | 3 ++- src/Services/FilesService.php | 3 ++- src/SolidColorOverlay.php | 2 +- src/SubtitleOverlay.php | 2 +- src/TextOverlay.php | 2 +- src/VideoOverlay.php | 2 +- tests/Services/Accounts/OriginsTest.php | 4 ++++ tests/Services/Accounts/UsageTest.php | 6 ++++-- tests/Services/Beta/V2/FilesTest.php | 4 ++-- tests/Services/FilesTest.php | 4 ++-- 62 files changed, 135 insertions(+), 124 deletions(-) diff --git a/README.md b/README.md index edc408f5..05d76b54 100644 --- a/README.md +++ b/README.md @@ -47,8 +47,7 @@ $client = new Client( ); $response = $client->files->upload([ - 'file' => 'https://www.example.com/public-url.jpg', - 'fileName' => 'file-name.jpg', + 'file' => 'file', 'fileName' => 'file-name.jpg' ]); var_dump($response->videoCodec); @@ -72,8 +71,7 @@ use Imagekit\Core\Exceptions\APIConnectionException; try { $response = $client->files->upload([ - 'file' => 'https://www.example.com/public-url.jpg', - 'fileName' => 'file-name.jpg', + 'file' => 'file', 'fileName' => 'file-name.jpg' ]); } catch (APIConnectionException $e) { echo "The server could not be reached", PHP_EOL; @@ -121,10 +119,7 @@ $client = new Client(maxRetries: 0); // Or, configure per-request: $result = $client->files->upload( - [ - 'file' => 'https://www.example.com/public-url.jpg', - 'fileName' => 'file-name.jpg', - ], + ['file' => 'file', 'fileName' => 'file-name.jpg'], RequestOptions::with(maxRetries: 5), ); ``` @@ -145,10 +140,7 @@ Note: the `extra*` parameters of the same name overrides the documented paramete use Imagekit\RequestOptions; $response = $client->files->upload( - [ - 'file' => 'https://www.example.com/public-url.jpg', - 'fileName' => 'file-name.jpg', - ], + ['file' => 'file', 'fileName' => 'file-name.jpg'], RequestOptions::with( extraQueryParams: ['my_query_parameter' => 'value'], extraBodyParams: ['my_body_parameter' => 'value'], diff --git a/src/Accounts/Origins/OriginRequest/AkeneoPim.php b/src/Accounts/Origins/OriginRequest/AkeneoPim.php index 2dca9ce8..dcf7b0bd 100644 --- a/src/Accounts/Origins/OriginRequest/AkeneoPim.php +++ b/src/Accounts/Origins/OriginRequest/AkeneoPim.php @@ -16,7 +16,7 @@ * clientSecret: string, * name: string, * password: string, - * type: 'AKENEO_PIM', + * type?: 'AKENEO_PIM', * username: string, * baseUrlForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, diff --git a/src/Accounts/Origins/OriginRequest/AzureBlob.php b/src/Accounts/Origins/OriginRequest/AzureBlob.php index 723cde56..1bdca305 100644 --- a/src/Accounts/Origins/OriginRequest/AzureBlob.php +++ b/src/Accounts/Origins/OriginRequest/AzureBlob.php @@ -15,7 +15,7 @@ * container: string, * name: string, * sasToken: string, - * type: 'AZURE_BLOB', + * type?: 'AZURE_BLOB', * baseUrlForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * prefix?: string|null, diff --git a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php index 13892006..7f30ca73 100644 --- a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php @@ -15,7 +15,7 @@ * bucket: string, * name: string, * secretKey: string, - * type: 'CLOUDINARY_BACKUP', + * type?: 'CLOUDINARY_BACKUP', * baseUrlForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * prefix?: string|null, diff --git a/src/Accounts/Origins/OriginRequest/Gcs.php b/src/Accounts/Origins/OriginRequest/Gcs.php index f1d69d27..7d80440f 100644 --- a/src/Accounts/Origins/OriginRequest/Gcs.php +++ b/src/Accounts/Origins/OriginRequest/Gcs.php @@ -15,7 +15,7 @@ * clientEmail: string, * name: string, * privateKey: string, - * type: 'GCS', + * type?: 'GCS', * baseUrlForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * prefix?: string|null, diff --git a/src/Accounts/Origins/OriginRequest/S3.php b/src/Accounts/Origins/OriginRequest/S3.php index ef28801b..56c6c102 100644 --- a/src/Accounts/Origins/OriginRequest/S3.php +++ b/src/Accounts/Origins/OriginRequest/S3.php @@ -15,7 +15,7 @@ * bucket: string, * name: string, * secretKey: string, - * type: 'S3', + * type?: 'S3', * baseUrlForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * prefix?: string|null, diff --git a/src/Accounts/Origins/OriginRequest/S3Compatible.php b/src/Accounts/Origins/OriginRequest/S3Compatible.php index e0ae15ae..249e0f8b 100644 --- a/src/Accounts/Origins/OriginRequest/S3Compatible.php +++ b/src/Accounts/Origins/OriginRequest/S3Compatible.php @@ -16,7 +16,7 @@ * endpoint: string, * name: string, * secretKey: string, - * type: 'S3_COMPATIBLE', + * type?: 'S3_COMPATIBLE', * baseUrlForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * prefix?: string|null, diff --git a/src/Accounts/Origins/OriginRequest/WebFolder.php b/src/Accounts/Origins/OriginRequest/WebFolder.php index a9b6eeb3..da7333b6 100644 --- a/src/Accounts/Origins/OriginRequest/WebFolder.php +++ b/src/Accounts/Origins/OriginRequest/WebFolder.php @@ -13,7 +13,7 @@ * @phpstan-type WebFolderShape = array{ * baseUrl: string, * name: string, - * type: 'WEB_FOLDER', + * type?: 'WEB_FOLDER', * baseUrlForCanonicalHeader?: string|null, * forwardHostHeaderToOrigin?: bool|null, * includeCanonicalHeader?: bool|null, diff --git a/src/Accounts/Origins/OriginRequest/WebProxy.php b/src/Accounts/Origins/OriginRequest/WebProxy.php index 94c68f0d..aa6e747c 100644 --- a/src/Accounts/Origins/OriginRequest/WebProxy.php +++ b/src/Accounts/Origins/OriginRequest/WebProxy.php @@ -12,7 +12,7 @@ /** * @phpstan-type WebProxyShape = array{ * name: string, - * type: 'WEB_PROXY', + * type?: 'WEB_PROXY', * baseUrlForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * } diff --git a/src/Accounts/Origins/OriginResponse/AkeneoPim.php b/src/Accounts/Origins/OriginResponse/AkeneoPim.php index df1211fe..7cce7237 100644 --- a/src/Accounts/Origins/OriginResponse/AkeneoPim.php +++ b/src/Accounts/Origins/OriginResponse/AkeneoPim.php @@ -15,7 +15,7 @@ * baseUrl: string, * includeCanonicalHeader: bool, * name: string, - * type: 'AKENEO_PIM', + * type?: 'AKENEO_PIM', * baseUrlForCanonicalHeader?: string|null, * } */ diff --git a/src/Accounts/Origins/OriginResponse/AzureBlob.php b/src/Accounts/Origins/OriginResponse/AzureBlob.php index d7e4a434..5a5097b0 100644 --- a/src/Accounts/Origins/OriginResponse/AzureBlob.php +++ b/src/Accounts/Origins/OriginResponse/AzureBlob.php @@ -17,7 +17,7 @@ * includeCanonicalHeader: bool, * name: string, * prefix: string, - * type: 'AZURE_BLOB', + * type?: 'AZURE_BLOB', * baseUrlForCanonicalHeader?: string|null, * } */ diff --git a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php index d2900eb4..ff8db89a 100644 --- a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php @@ -16,7 +16,7 @@ * includeCanonicalHeader: bool, * name: string, * prefix: string, - * type: 'CLOUDINARY_BACKUP', + * type?: 'CLOUDINARY_BACKUP', * baseUrlForCanonicalHeader?: string|null, * } */ diff --git a/src/Accounts/Origins/OriginResponse/Gcs.php b/src/Accounts/Origins/OriginResponse/Gcs.php index f176c075..3944a34a 100644 --- a/src/Accounts/Origins/OriginResponse/Gcs.php +++ b/src/Accounts/Origins/OriginResponse/Gcs.php @@ -17,7 +17,7 @@ * includeCanonicalHeader: bool, * name: string, * prefix: string, - * type: 'GCS', + * type?: 'GCS', * baseUrlForCanonicalHeader?: string|null, * } */ diff --git a/src/Accounts/Origins/OriginResponse/S3.php b/src/Accounts/Origins/OriginResponse/S3.php index c48f2a9a..ea3bded8 100644 --- a/src/Accounts/Origins/OriginResponse/S3.php +++ b/src/Accounts/Origins/OriginResponse/S3.php @@ -16,7 +16,7 @@ * includeCanonicalHeader: bool, * name: string, * prefix: string, - * type: 'S3', + * type?: 'S3', * baseUrlForCanonicalHeader?: string|null, * } */ diff --git a/src/Accounts/Origins/OriginResponse/S3Compatible.php b/src/Accounts/Origins/OriginResponse/S3Compatible.php index d4844398..34e09403 100644 --- a/src/Accounts/Origins/OriginResponse/S3Compatible.php +++ b/src/Accounts/Origins/OriginResponse/S3Compatible.php @@ -18,7 +18,7 @@ * name: string, * prefix: string, * s3ForcePathStyle: bool, - * type: 'S3_COMPATIBLE', + * type?: 'S3_COMPATIBLE', * baseUrlForCanonicalHeader?: string|null, * } */ diff --git a/src/Accounts/Origins/OriginResponse/WebFolder.php b/src/Accounts/Origins/OriginResponse/WebFolder.php index 3fe59f2d..d181ed24 100644 --- a/src/Accounts/Origins/OriginResponse/WebFolder.php +++ b/src/Accounts/Origins/OriginResponse/WebFolder.php @@ -16,7 +16,7 @@ * forwardHostHeaderToOrigin: bool, * includeCanonicalHeader: bool, * name: string, - * type: 'WEB_FOLDER', + * type?: 'WEB_FOLDER', * baseUrlForCanonicalHeader?: string|null, * } */ diff --git a/src/Accounts/Origins/OriginResponse/WebProxy.php b/src/Accounts/Origins/OriginResponse/WebProxy.php index fc8cbe87..6bb1a426 100644 --- a/src/Accounts/Origins/OriginResponse/WebProxy.php +++ b/src/Accounts/Origins/OriginResponse/WebProxy.php @@ -14,7 +14,7 @@ * id: string, * includeCanonicalHeader: bool, * name: string, - * type: 'WEB_PROXY', + * type?: 'WEB_PROXY', * baseUrlForCanonicalHeader?: string|null, * } */ diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php index 74c8113d..d76964bd 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php @@ -25,8 +25,8 @@ * origins?: list, * urlPrefix?: string, * urlRewriter?: Cloudinary|array{ - * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null - * }|Imgix|array{type: 'IMGIX'}|Akamai|array{type: 'AKAMAI'}, + * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null + * }|Imgix|array{type?: 'IMGIX'}|Akamai|array{type?: 'AKAMAI'}, * } */ final class URLEndpointCreateParams implements BaseModel @@ -87,8 +87,8 @@ public function __construct() * * @param list $origins * @param Cloudinary|array{ - * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null - * }|Imgix|array{type: 'IMGIX'}|Akamai|array{type: 'AKAMAI'} $urlRewriter + * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null + * }|Imgix|array{type?: 'IMGIX'}|Akamai|array{type?: 'AKAMAI'} $urlRewriter */ public static function with( string $description, @@ -146,8 +146,8 @@ public function withURLPrefix(string $urlPrefix): self * Configuration for third-party URL rewriting. * * @param Cloudinary|array{ - * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null - * }|Imgix|array{type: 'IMGIX'}|Akamai|array{type: 'AKAMAI'} $urlRewriter + * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null + * }|Imgix|array{type?: 'IMGIX'}|Akamai|array{type?: 'AKAMAI'} $urlRewriter */ public function withURLRewriter( Cloudinary|array|Imgix|Akamai $urlRewriter diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php index b141a5d2..b2cb0c21 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php @@ -9,7 +9,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type AkamaiShape = array{type: 'AKAMAI'} + * @phpstan-type AkamaiShape = array{type?: 'AKAMAI'} */ final class Akamai implements BaseModel { diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php index a623f93a..f79da17b 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php @@ -11,7 +11,7 @@ /** * @phpstan-type CloudinaryShape = array{ - * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null + * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null * } */ final class Cloudinary implements BaseModel diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php index 705142d2..ff5cdaf7 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php @@ -9,7 +9,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type ImgixShape = array{type: 'IMGIX'} + * @phpstan-type ImgixShape = array{type?: 'IMGIX'} */ final class Imgix implements BaseModel { diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest.php b/src/Accounts/URLEndpoints/URLEndpointRequest.php index 4310bfca..43740bc7 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest.php @@ -80,8 +80,8 @@ public function __construct() * * @param list $origins * @param Cloudinary|array{ - * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null - * }|Imgix|array{type: 'IMGIX'}|Akamai|array{type: 'AKAMAI'} $urlRewriter + * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null + * }|Imgix|array{type?: 'IMGIX'}|Akamai|array{type?: 'AKAMAI'} $urlRewriter */ public static function with( string $description, @@ -139,8 +139,8 @@ public function withURLPrefix(string $urlPrefix): self * Configuration for third-party URL rewriting. * * @param Cloudinary|array{ - * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null - * }|Imgix|array{type: 'IMGIX'}|Akamai|array{type: 'AKAMAI'} $urlRewriter + * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null + * }|Imgix|array{type?: 'IMGIX'}|Akamai|array{type?: 'AKAMAI'} $urlRewriter */ public function withURLRewriter( Cloudinary|array|Imgix|Akamai $urlRewriter diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php index 63a2394c..1e0bec69 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php @@ -9,7 +9,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type AkamaiShape = array{type: 'AKAMAI'} + * @phpstan-type AkamaiShape = array{type?: 'AKAMAI'} */ final class Akamai implements BaseModel { diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php index fa32755c..65107809 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php @@ -11,7 +11,7 @@ /** * @phpstan-type CloudinaryShape = array{ - * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null + * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null * } */ final class Cloudinary implements BaseModel diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php index f407f866..0a676082 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php @@ -9,7 +9,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type ImgixShape = array{type: 'IMGIX'} + * @phpstan-type ImgixShape = array{type?: 'IMGIX'} */ final class Imgix implements BaseModel { diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse.php b/src/Accounts/URLEndpoints/URLEndpointResponse.php index 0fa86c01..1d9069b2 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse.php @@ -93,8 +93,8 @@ public function __construct() * * @param list $origins * @param Cloudinary|array{ - * preserveAssetDeliveryTypes: bool, type: 'CLOUDINARY' - * }|Imgix|array{type: 'IMGIX'}|Akamai|array{type: 'AKAMAI'} $urlRewriter + * preserveAssetDeliveryTypes: bool, type?: 'CLOUDINARY' + * }|Imgix|array{type?: 'IMGIX'}|Akamai|array{type?: 'AKAMAI'} $urlRewriter */ public static function with( string $id, @@ -165,8 +165,8 @@ public function withURLPrefix(string $urlPrefix): self * Configuration for third-party URL rewriting. * * @param Cloudinary|array{ - * preserveAssetDeliveryTypes: bool, type: 'CLOUDINARY' - * }|Imgix|array{type: 'IMGIX'}|Akamai|array{type: 'AKAMAI'} $urlRewriter + * preserveAssetDeliveryTypes: bool, type?: 'CLOUDINARY' + * }|Imgix|array{type?: 'IMGIX'}|Akamai|array{type?: 'AKAMAI'} $urlRewriter */ public function withURLRewriter( Cloudinary|array|Imgix|Akamai $urlRewriter diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php index dd6bd03f..2b4608bb 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php @@ -9,7 +9,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type AkamaiShape = array{type: 'AKAMAI'} + * @phpstan-type AkamaiShape = array{type?: 'AKAMAI'} */ final class Akamai implements BaseModel { diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php index 9b0bdabc..1fcc2fc1 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php @@ -10,7 +10,7 @@ /** * @phpstan-type CloudinaryShape = array{ - * preserveAssetDeliveryTypes: bool, type: 'CLOUDINARY' + * preserveAssetDeliveryTypes: bool, type?: 'CLOUDINARY' * } */ final class Cloudinary implements BaseModel diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php index 0187e95d..31383d9d 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php @@ -9,7 +9,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type ImgixShape = array{type: 'IMGIX'} + * @phpstan-type ImgixShape = array{type?: 'IMGIX'} */ final class Imgix implements BaseModel { diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php index d86edc2e..4ff97e13 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php @@ -25,8 +25,8 @@ * origins?: list, * urlPrefix?: string, * urlRewriter?: Cloudinary|array{ - * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null - * }|Imgix|array{type: 'IMGIX'}|Akamai|array{type: 'AKAMAI'}, + * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null + * }|Imgix|array{type?: 'IMGIX'}|Akamai|array{type?: 'AKAMAI'}, * } */ final class URLEndpointUpdateParams implements BaseModel @@ -87,8 +87,8 @@ public function __construct() * * @param list $origins * @param Cloudinary|array{ - * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null - * }|Imgix|array{type: 'IMGIX'}|Akamai|array{type: 'AKAMAI'} $urlRewriter + * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null + * }|Imgix|array{type?: 'IMGIX'}|Akamai|array{type?: 'AKAMAI'} $urlRewriter */ public static function with( string $description, @@ -146,8 +146,8 @@ public function withURLPrefix(string $urlPrefix): self * Configuration for third-party URL rewriting. * * @param Cloudinary|array{ - * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null - * }|Imgix|array{type: 'IMGIX'}|Akamai|array{type: 'AKAMAI'} $urlRewriter + * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null + * }|Imgix|array{type?: 'IMGIX'}|Akamai|array{type?: 'AKAMAI'} $urlRewriter */ public function withURLRewriter( Cloudinary|array|Imgix|Akamai $urlRewriter diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php index 5e69b933..27a12490 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php @@ -9,7 +9,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type AkamaiShape = array{type: 'AKAMAI'} + * @phpstan-type AkamaiShape = array{type?: 'AKAMAI'} */ final class Akamai implements BaseModel { diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php index c86739de..37e56264 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php @@ -11,7 +11,7 @@ /** * @phpstan-type CloudinaryShape = array{ - * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null + * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null * } */ final class Cloudinary implements BaseModel diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php index b630902b..90e481f4 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php @@ -9,7 +9,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type ImgixShape = array{type: 'IMGIX'} + * @phpstan-type ImgixShape = array{type?: 'IMGIX'} */ final class Imgix implements BaseModel { diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index b6456c1d..d2bd0db0 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -48,10 +48,10 @@ * customMetadata?: array, * description?: string, * extensions?: list - * }|AIAutoDescription|array{name: 'ai-auto-description'}>, + * }|AIAutoDescription|array{name?: 'ai-auto-description'}>, * folder?: string, * isPrivateFile?: bool, * isPublished?: bool, @@ -265,10 +265,10 @@ public function __construct() * * @param array $customMetadata * @param list - * }|AIAutoDescription|array{name: 'ai-auto-description'}> $extensions + * }|AIAutoDescription|array{name?: 'ai-auto-description'}> $extensions * @param list> $responseFields * @param list $tags * @param Transformation|array{ @@ -424,10 +424,10 @@ public function withDescription(string $description): self * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * * @param list - * }|AIAutoDescription|array{name: 'ai-auto-description'}> $extensions + * }|AIAutoDescription|array{name?: 'ai-auto-description'}> $extensions */ public function withExtensions(array $extensions): self { diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation.php index 1c0f9774..5bf7e3a5 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation.php @@ -61,10 +61,10 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param list, type: 'abs', value: string}> $post + * type?: 'transformation', value: string + * }|GifToVideo|array{type?: 'gif-to-video', value?: string|null}|Thumbnail|array{ + * type?: 'thumbnail', value?: string|null + * }|Abs|array{protocol: value-of, type?: 'abs', value: string}> $post */ public static function with(?array $post = null, ?string $pre = null): self { @@ -82,10 +82,10 @@ public static function with(?array $post = null, ?string $pre = null): self * `transformation`, `gif-to-video`, `thumbnail`, `abs`. * * @param list, type: 'abs', value: string}> $post + * type?: 'transformation', value: string + * }|GifToVideo|array{type?: 'gif-to-video', value?: string|null}|Thumbnail|array{ + * type?: 'thumbnail', value?: string|null + * }|Abs|array{protocol: value-of, type?: 'abs', value: string}> $post */ public function withPost(array $post): self { diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php index 84b697c3..2a379a23 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php @@ -11,7 +11,7 @@ /** * @phpstan-type AbsShape = array{ - * protocol: value-of, type: 'abs', value: string + * protocol: value-of, type?: 'abs', value: string * } */ final class Abs implements BaseModel diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php index 87ff495f..766542c8 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php @@ -10,7 +10,9 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type GifToVideoShape = array{type: 'gif-to-video', value?: string|null} + * @phpstan-type GifToVideoShape = array{ + * type?: 'gif-to-video', value?: string|null + * } */ final class GifToVideo implements BaseModel { diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php index 4505b521..7a9605bb 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php @@ -10,7 +10,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type ThumbnailShape = array{type: 'thumbnail', value?: string|null} + * @phpstan-type ThumbnailShape = array{type?: 'thumbnail', value?: string|null} */ final class Thumbnail implements BaseModel { diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php index 8f153fdb..a9e790f4 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php @@ -9,7 +9,9 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type TransformationShape = array{type: 'transformation', value: string} + * @phpstan-type TransformationShape = array{ + * type?: 'transformation', value: string + * } */ final class Transformation implements BaseModel { diff --git a/src/ExtensionItem/AIAutoDescription.php b/src/ExtensionItem/AIAutoDescription.php index c3f79df6..8ae68f21 100644 --- a/src/ExtensionItem/AIAutoDescription.php +++ b/src/ExtensionItem/AIAutoDescription.php @@ -9,7 +9,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type AIAutoDescriptionShape = array{name: 'ai-auto-description'} + * @phpstan-type AIAutoDescriptionShape = array{name?: 'ai-auto-description'} */ final class AIAutoDescription implements BaseModel { diff --git a/src/ExtensionItem/RemoveBg.php b/src/ExtensionItem/RemoveBg.php index f3ffc341..9f4674e7 100644 --- a/src/ExtensionItem/RemoveBg.php +++ b/src/ExtensionItem/RemoveBg.php @@ -11,7 +11,7 @@ use Imagekit\ExtensionItem\RemoveBg\Options; /** - * @phpstan-type RemoveBgShape = array{name: 'remove-bg', options?: Options|null} + * @phpstan-type RemoveBgShape = array{name?: 'remove-bg', options?: Options|null} */ final class RemoveBg implements BaseModel { diff --git a/src/Files/FileUpdateParams.php b/src/Files/FileUpdateParams.php index f8b22a43..4ccea12e 100644 --- a/src/Files/FileUpdateParams.php +++ b/src/Files/FileUpdateParams.php @@ -27,10 +27,10 @@ * customMetadata?: array, * description?: string, * extensions?: list - * }|AIAutoDescription|array{name: 'ai-auto-description'}>, + * }|AIAutoDescription|array{name?: 'ai-auto-description'}>, * removeAITags?: 'all'|list, * tags?: list|null, * webhookUrl?: string, @@ -115,10 +115,10 @@ public function __construct() * * @param array $customMetadata * @param list - * }|AIAutoDescription|array{name: 'ai-auto-description'}> $extensions + * }|AIAutoDescription|array{name?: 'ai-auto-description'}> $extensions * @param 'all'|list $removeAITags * @param list|null $tags * @param Publish|array{ @@ -188,10 +188,10 @@ public function withDescription(string $description): self * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * * @param list - * }|AIAutoDescription|array{name: 'ai-auto-description'}> $extensions + * }|AIAutoDescription|array{name?: 'ai-auto-description'}> $extensions */ public function withExtensions(array $extensions): self { diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index b486d973..37c87ac1 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -49,10 +49,10 @@ * description?: string, * expire?: int, * extensions?: list - * }|AIAutoDescription|array{name: 'ai-auto-description'}>, + * }|AIAutoDescription|array{name?: 'ai-auto-description'}>, * folder?: string, * isPrivateFile?: bool, * isPublished?: bool, @@ -298,10 +298,10 @@ public function __construct() * * @param array $customMetadata * @param list - * }|AIAutoDescription|array{name: 'ai-auto-description'}> $extensions + * }|AIAutoDescription|array{name?: 'ai-auto-description'}> $extensions * @param list> $responseFields * @param list $tags * @param Transformation|array{ @@ -477,10 +477,10 @@ public function withExpire(int $expire): self * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * * @param list - * }|AIAutoDescription|array{name: 'ai-auto-description'}> $extensions + * }|AIAutoDescription|array{name?: 'ai-auto-description'}> $extensions */ public function withExtensions(array $extensions): self { diff --git a/src/Files/FileUploadParams/Transformation.php b/src/Files/FileUploadParams/Transformation.php index f525222c..8794c5f6 100644 --- a/src/Files/FileUploadParams/Transformation.php +++ b/src/Files/FileUploadParams/Transformation.php @@ -61,10 +61,10 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param list, type: 'abs', value: string}> $post + * type?: 'transformation', value: string + * }|GifToVideo|array{type?: 'gif-to-video', value?: string|null}|Thumbnail|array{ + * type?: 'thumbnail', value?: string|null + * }|Abs|array{protocol: value-of, type?: 'abs', value: string}> $post */ public static function with(?array $post = null, ?string $pre = null): self { @@ -82,10 +82,10 @@ public static function with(?array $post = null, ?string $pre = null): self * `transformation`, `gif-to-video`, `thumbnail`, `abs`. * * @param list, type: 'abs', value: string}> $post + * type?: 'transformation', value: string + * }|GifToVideo|array{type?: 'gif-to-video', value?: string|null}|Thumbnail|array{ + * type?: 'thumbnail', value?: string|null + * }|Abs|array{protocol: value-of, type?: 'abs', value: string}> $post */ public function withPost(array $post): self { diff --git a/src/Files/FileUploadParams/Transformation/Post/Abs.php b/src/Files/FileUploadParams/Transformation/Post/Abs.php index 0b2e9f16..bf5ff4f4 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Abs.php +++ b/src/Files/FileUploadParams/Transformation/Post/Abs.php @@ -11,7 +11,7 @@ /** * @phpstan-type AbsShape = array{ - * protocol: value-of, type: 'abs', value: string + * protocol: value-of, type?: 'abs', value: string * } */ final class Abs implements BaseModel diff --git a/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php b/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php index 90b98cd3..618d5ce0 100644 --- a/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php +++ b/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php @@ -10,7 +10,9 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type GifToVideoShape = array{type: 'gif-to-video', value?: string|null} + * @phpstan-type GifToVideoShape = array{ + * type?: 'gif-to-video', value?: string|null + * } */ final class GifToVideo implements BaseModel { diff --git a/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php b/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php index 7a9d3b88..6e84fe81 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php +++ b/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php @@ -10,7 +10,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type ThumbnailShape = array{type: 'thumbnail', value?: string|null} + * @phpstan-type ThumbnailShape = array{type?: 'thumbnail', value?: string|null} */ final class Thumbnail implements BaseModel { diff --git a/src/Files/FileUploadParams/Transformation/Post/Transformation.php b/src/Files/FileUploadParams/Transformation/Post/Transformation.php index 6c3aa47a..bf7b592d 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Transformation.php +++ b/src/Files/FileUploadParams/Transformation/Post/Transformation.php @@ -9,7 +9,9 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type TransformationShape = array{type: 'transformation', value: string} + * @phpstan-type TransformationShape = array{ + * type?: 'transformation', value: string + * } */ final class Transformation implements BaseModel { diff --git a/src/Files/UpdateFileRequest/UpdateFileDetails.php b/src/Files/UpdateFileRequest/UpdateFileDetails.php index 4753a266..5311775d 100644 --- a/src/Files/UpdateFileRequest/UpdateFileDetails.php +++ b/src/Files/UpdateFileRequest/UpdateFileDetails.php @@ -97,10 +97,10 @@ public function __construct() * * @param array $customMetadata * @param list - * }|AIAutoDescription|array{name: 'ai-auto-description'}> $extensions + * }|AIAutoDescription|array{name?: 'ai-auto-description'}> $extensions * @param 'all'|list $removeAITags * @param list|null $tags */ @@ -165,10 +165,10 @@ public function withDescription(string $description): self * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * * @param list - * }|AIAutoDescription|array{name: 'ai-auto-description'}> $extensions + * }|AIAutoDescription|array{name?: 'ai-auto-description'}> $extensions */ public function withExtensions(array $extensions): self { diff --git a/src/ImageOverlay.php b/src/ImageOverlay.php index 9dfd452f..9736ed94 100644 --- a/src/ImageOverlay.php +++ b/src/ImageOverlay.php @@ -16,7 +16,7 @@ * position?: OverlayPosition|null, * timing?: OverlayTiming|null, * input: string, - * type: 'image', + * type?: 'image', * encoding?: value-of|null, * transformation?: list|null, * } diff --git a/src/Services/AssetsService.php b/src/Services/AssetsService.php index 9762edc9..817670c4 100644 --- a/src/Services/AssetsService.php +++ b/src/Services/AssetsService.php @@ -5,7 +5,9 @@ namespace Imagekit\Services; use Imagekit\Assets\AssetListParams; +use Imagekit\Assets\AssetListParams\FileType; use Imagekit\Assets\AssetListParams\Sort; +use Imagekit\Assets\AssetListParams\Type; use Imagekit\Assets\AssetListResponseItem; use Imagekit\Client; use Imagekit\Core\Contracts\BaseResponse; @@ -29,13 +31,13 @@ public function __construct(private Client $client) {} * This API can list all the uploaded files and folders in your ImageKit.io media library. In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and provide this generated string as the value of the `searchQuery`. * * @param array{ - * fileType?: 'all'|'image'|'non-image', + * fileType?: 'all'|'image'|'non-image'|FileType, * limit?: int, * path?: string, * searchQuery?: string, * skip?: int, * sort?: value-of, - * type?: 'file'|'file-version'|'folder'|'all', + * type?: 'file'|'file-version'|'folder'|'all'|Type, * }|AssetListParams $params * * @return list diff --git a/src/Services/Beta/V2/FilesService.php b/src/Services/Beta/V2/FilesService.php index 081291fe..ff6ef791 100644 --- a/src/Services/Beta/V2/FilesService.php +++ b/src/Services/Beta/V2/FilesService.php @@ -5,6 +5,7 @@ namespace Imagekit\Services\Beta\V2; use Imagekit\Beta\V2\Files\FileUploadParams; +use Imagekit\Beta\V2\Files\FileUploadParams\ResponseField; use Imagekit\Beta\V2\Files\FileUploadResponse; use Imagekit\Client; use Imagekit\Core\Contracts\BaseResponse; @@ -53,7 +54,7 @@ public function __construct(private Client $client) {} * overwriteCustomMetadata?: bool, * overwriteFile?: bool, * overwriteTags?: bool, - * responseFields?: list<'tags'|'customCoordinates'|'isPrivateFile'|'embeddedMetadata'|'isPublished'|'customMetadata'|'metadata'|'selectedFieldsSchema'>, + * responseFields?: list<'tags'|'customCoordinates'|'isPrivateFile'|'embeddedMetadata'|'isPublished'|'customMetadata'|'metadata'|'selectedFieldsSchema'|ResponseField>, * tags?: list, * transformation?: array{post?: list>, pre?: string}, * useUniqueFileName?: bool, diff --git a/src/Services/CustomMetadataFieldsService.php b/src/Services/CustomMetadataFieldsService.php index 381cae61..610f84f1 100644 --- a/src/Services/CustomMetadataFieldsService.php +++ b/src/Services/CustomMetadataFieldsService.php @@ -10,6 +10,7 @@ use Imagekit\Core\Exceptions\APIException; use Imagekit\CustomMetadataFields\CustomMetadataField; use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams; +use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\Type; use Imagekit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; use Imagekit\CustomMetadataFields\CustomMetadataFieldListParams; use Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams; @@ -32,7 +33,7 @@ public function __construct(private Client $client) {} * label: string, * name: string, * schema: array{ - * type: 'Text'|'Textarea'|'Number'|'Date'|'Boolean'|'SingleSelect'|'MultiSelect', + * type: 'Text'|'Textarea'|'Number'|'Date'|'Boolean'|'SingleSelect'|'MultiSelect'|Type, * defaultValue?: mixed, * isValueRequired?: bool, * maxLength?: float, diff --git a/src/Services/FilesService.php b/src/Services/FilesService.php index e2871506..b038bdf7 100644 --- a/src/Services/FilesService.php +++ b/src/Services/FilesService.php @@ -17,6 +17,7 @@ use Imagekit\Files\FileUpdateParams; use Imagekit\Files\FileUpdateResponse; use Imagekit\Files\FileUploadParams; +use Imagekit\Files\FileUploadParams\ResponseField; use Imagekit\Files\FileUploadResponse; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\FilesContract; @@ -264,7 +265,7 @@ public function rename( * overwriteFile?: bool, * overwriteTags?: bool, * publicKey?: string, - * responseFields?: list<'tags'|'customCoordinates'|'isPrivateFile'|'embeddedMetadata'|'isPublished'|'customMetadata'|'metadata'|'selectedFieldsSchema'>, + * responseFields?: list<'tags'|'customCoordinates'|'isPrivateFile'|'embeddedMetadata'|'isPublished'|'customMetadata'|'metadata'|'selectedFieldsSchema'|ResponseField>, * signature?: string, * tags?: list, * transformation?: array{post?: list>, pre?: string}, diff --git a/src/SolidColorOverlay.php b/src/SolidColorOverlay.php index d9b85fc5..59de1cf0 100644 --- a/src/SolidColorOverlay.php +++ b/src/SolidColorOverlay.php @@ -15,7 +15,7 @@ * position?: OverlayPosition|null, * timing?: OverlayTiming|null, * color: string, - * type: 'solidColor', + * type?: 'solidColor', * transformation?: list|null, * } */ diff --git a/src/SubtitleOverlay.php b/src/SubtitleOverlay.php index 5e5bb12d..b9854d69 100644 --- a/src/SubtitleOverlay.php +++ b/src/SubtitleOverlay.php @@ -17,7 +17,7 @@ * position?: OverlayPosition|null, * timing?: OverlayTiming|null, * input: string, - * type: 'subtitle', + * type?: 'subtitle', * encoding?: value-of|null, * transformation?: list|null, * } diff --git a/src/TextOverlay.php b/src/TextOverlay.php index e163918a..e0b25cc3 100644 --- a/src/TextOverlay.php +++ b/src/TextOverlay.php @@ -18,7 +18,7 @@ * position?: OverlayPosition|null, * timing?: OverlayTiming|null, * text: string, - * type: 'text', + * type?: 'text', * encoding?: value-of|null, * transformation?: list|null, * } diff --git a/src/VideoOverlay.php b/src/VideoOverlay.php index 67f3fb69..f363e2ad 100644 --- a/src/VideoOverlay.php +++ b/src/VideoOverlay.php @@ -16,7 +16,7 @@ * position?: OverlayPosition|null, * timing?: OverlayTiming|null, * input: string, - * type: 'video', + * type?: 'video', * encoding?: value-of|null, * transformation?: list|null, * } diff --git a/tests/Services/Accounts/OriginsTest.php b/tests/Services/Accounts/OriginsTest.php index 5847be71..be1a6bcd 100644 --- a/tests/Services/Accounts/OriginsTest.php +++ b/tests/Services/Accounts/OriginsTest.php @@ -42,6 +42,7 @@ public function testCreate(): void 'bucket' => 'test-bucket', 'name' => 'My S3 Origin', 'secretKey' => 'secrettest123', + 'type' => 'S3', ]); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -60,6 +61,7 @@ public function testCreateWithOptionalParams(): void 'bucket' => 'test-bucket', 'name' => 'My S3 Origin', 'secretKey' => 'secrettest123', + 'type' => 'S3', 'baseUrlForCanonicalHeader' => 'https://cdn.example.com', 'includeCanonicalHeader' => false, 'prefix' => 'images', @@ -83,6 +85,7 @@ public function testUpdate(): void 'bucket' => 'test-bucket', 'name' => 'My S3 Origin', 'secretKey' => 'secrettest123', + 'type' => 'S3', ], ); @@ -104,6 +107,7 @@ public function testUpdateWithOptionalParams(): void 'bucket' => 'test-bucket', 'name' => 'My S3 Origin', 'secretKey' => 'secrettest123', + 'type' => 'S3', 'baseUrlForCanonicalHeader' => 'https://cdn.example.com', 'includeCanonicalHeader' => false, 'prefix' => 'images', diff --git a/tests/Services/Accounts/UsageTest.php b/tests/Services/Accounts/UsageTest.php index 40b86c56..0449d16b 100644 --- a/tests/Services/Accounts/UsageTest.php +++ b/tests/Services/Accounts/UsageTest.php @@ -39,7 +39,8 @@ public function testGet(): void } $result = $this->client->accounts->usage->get([ - 'endDate' => '2019-12-27', 'startDate' => '2019-12-27', + 'endDate' => new \DateTimeImmutable('2019-12-27'), + 'startDate' => new \DateTimeImmutable('2019-12-27'), ]); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -54,7 +55,8 @@ public function testGetWithOptionalParams(): void } $result = $this->client->accounts->usage->get([ - 'endDate' => '2019-12-27', 'startDate' => '2019-12-27', + 'endDate' => new \DateTimeImmutable('2019-12-27'), + 'startDate' => new \DateTimeImmutable('2019-12-27'), ]); // @phpstan-ignore-next-line method.alreadyNarrowedType diff --git a/tests/Services/Beta/V2/FilesTest.php b/tests/Services/Beta/V2/FilesTest.php index e7dcf877..e2acfc23 100644 --- a/tests/Services/Beta/V2/FilesTest.php +++ b/tests/Services/Beta/V2/FilesTest.php @@ -39,7 +39,7 @@ public function testUpload(): void } $result = $this->client->beta->v2->files->upload([ - 'file' => file_get_contents(__FILE__) ?: '', 'fileName' => 'fileName', + 'file' => 'file', 'fileName' => 'fileName', ]); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -54,7 +54,7 @@ public function testUploadWithOptionalParams(): void } $result = $this->client->beta->v2->files->upload([ - 'file' => file_get_contents(__FILE__) ?: '', + 'file' => 'file', 'fileName' => 'fileName', 'token' => 'token', 'checks' => '"request.folder" : "marketing/"\n', diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index a6f960b8..834aedfc 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -180,7 +180,7 @@ public function testUpload(): void } $result = $this->client->files->upload([ - 'file' => file_get_contents(__FILE__) ?: '', 'fileName' => 'fileName', + 'file' => 'file', 'fileName' => 'fileName', ]); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -195,7 +195,7 @@ public function testUploadWithOptionalParams(): void } $result = $this->client->files->upload([ - 'file' => file_get_contents(__FILE__) ?: '', + 'file' => 'file', 'fileName' => 'fileName', 'token' => 'token', 'checks' => '"request.folder" : "marketing/"\n', From 64f685c64536578e988e610150d2b85a7d28529d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 02:36:20 +0000 Subject: [PATCH 089/193] feat!: use camel casing for all class properties --- src/Accounts/Origins/OriginCreateParams.php | 40 +-- .../Origins/OriginRequest/AkeneoPim.php | 40 +-- .../Origins/OriginRequest/AzureBlob.php | 12 +- .../OriginRequest/CloudinaryBackup.php | 12 +- src/Accounts/Origins/OriginRequest/Gcs.php | 12 +- src/Accounts/Origins/OriginRequest/S3.php | 12 +- .../Origins/OriginRequest/S3Compatible.php | 12 +- .../Origins/OriginRequest/WebFolder.php | 26 +- .../Origins/OriginRequest/WebProxy.php | 12 +- .../Origins/OriginResponse/AkeneoPim.php | 26 +- .../Origins/OriginResponse/AzureBlob.php | 12 +- .../OriginResponse/CloudinaryBackup.php | 12 +- src/Accounts/Origins/OriginResponse/Gcs.php | 12 +- src/Accounts/Origins/OriginResponse/S3.php | 12 +- .../Origins/OriginResponse/S3Compatible.php | 12 +- .../Origins/OriginResponse/WebFolder.php | 26 +- .../Origins/OriginResponse/WebProxy.php | 12 +- src/Accounts/Origins/OriginUpdateParams.php | 40 +-- src/Beta/V2/Files/FileUploadParams.php | 12 +- src/Beta/V2/Files/FileUploadResponse.php | 56 ++-- .../FileUploadResponse/ExtensionStatus.php | 56 ++-- .../Invalidation/InvalidationNewResponse.php | 12 +- src/Core/Conversion.php | 37 ++- src/Core/Conversion/Concerns/ArrayOf.php | 19 +- src/Core/Conversion/DumpState.php | 5 + src/Core/Conversion/EnumOf.php | 21 +- src/Core/Conversion/ModelOf.php | 30 +- src/Core/Conversion/UnionOf.php | 35 +- src/ExtensionItem/RemoveBg.php | 12 +- src/ExtensionItem/RemoveBg/Options.php | 36 +- src/Files/Bulk/BulkAddTagsParams.php | 18 +- src/Files/Bulk/BulkAddTagsResponse.php | 16 +- src/Files/Bulk/BulkDeleteParams.php | 18 +- src/Files/Bulk/BulkDeleteResponse.php | 16 +- src/Files/Bulk/BulkRemoveAITagsParams.php | 30 +- src/Files/Bulk/BulkRemoveAITagsResponse.php | 16 +- src/Files/Bulk/BulkRemoveTagsParams.php | 18 +- src/Files/Bulk/BulkRemoveTagsResponse.php | 16 +- src/Files/File.php | 28 +- src/Files/FileRenameResponse.php | 12 +- src/Files/FileUpdateParams.php | 12 +- src/Files/FileUpdateResponse.php | 44 +-- .../FileUpdateResponse/ExtensionStatus.php | 56 ++-- src/Files/FileUploadParams.php | 12 +- src/Files/FileUploadResponse.php | 56 ++-- .../FileUploadResponse/ExtensionStatus.php | 56 ++-- src/Files/Folder.php | 12 +- src/Files/Metadata/Exif.php | 180 +++++----- src/Files/Metadata/Exif/Exif.php | 312 +++++++++--------- src/Files/Metadata/Exif/Gps.php | 16 +- src/Files/Metadata/Exif/Image.php | 132 ++++---- src/Files/Metadata/Exif/Interoperability.php | 22 +- src/Files/Metadata/Exif/Thumbnail.php | 72 ++-- .../UpdateFileRequest/UpdateFileDetails.php | 12 +- src/Files/Versions/VersionDeleteParams.php | 12 +- src/Files/Versions/VersionGetParams.php | 12 +- src/Files/Versions/VersionRestoreParams.php | 12 +- src/Folders/FolderCopyResponse.php | 14 +- src/Folders/FolderMoveResponse.php | 14 +- src/Folders/FolderRenameResponse.php | 14 +- src/Folders/Job/JobGetResponse.php | 24 +- .../Accounts/OriginsContract.php | 12 +- src/ServiceContracts/FilesContract.php | 7 +- src/Services/Accounts/OriginsService.php | 54 ++- src/Services/Beta/V2/FilesService.php | 2 +- src/Services/Files/BulkService.php | 8 +- src/Services/Files/VersionsService.php | 18 +- src/Services/FilesService.php | 17 +- .../UploadPostTransformErrorEvent.php | 22 +- .../UploadPostTransformErrorEvent/Data.php | 14 +- .../UploadPostTransformErrorEvent/Request.php | 14 +- .../UploadPostTransformSuccessEvent.php | 22 +- .../UploadPostTransformSuccessEvent/Data.php | 14 +- .../Request.php | 14 +- src/Webhooks/UploadPreTransformErrorEvent.php | 18 +- .../UploadPreTransformErrorEvent/Request.php | 14 +- .../UploadPreTransformSuccessEvent.php | 30 +- .../UploadPreTransformSuccessEvent/Data.php | 56 ++-- .../Data/ExtensionStatus.php | 56 ++-- .../Request.php | 14 +- .../VideoTransformationAcceptedEvent.php | 18 +- .../Data/Transformation.php | 16 +- .../Data/Transformation/Options.php | 60 ++-- .../Request.php | 24 +- .../VideoTransformationErrorEvent.php | 18 +- .../Data/Transformation.php | 16 +- .../Data/Transformation/Options.php | 60 ++-- .../VideoTransformationErrorEvent/Request.php | 24 +- .../VideoTransformationReadyEvent.php | 22 +- .../Data/Transformation.php | 20 +- .../Data/Transformation/Options.php | 60 ++-- .../Data/Transformation/Output.php | 14 +- .../VideoTransformationReadyEvent/Request.php | 24 +- .../VideoTransformationReadyEvent/Timings.php | 22 +- tests/Services/Accounts/OriginsTest.php | 94 ++++-- tests/Services/Beta/V2/FilesTest.php | 8 +- tests/Services/Files/BulkTest.php | 20 +- tests/Services/Files/VersionsTest.php | 12 +- tests/Services/FilesTest.php | 8 +- 99 files changed, 1543 insertions(+), 1360 deletions(-) diff --git a/src/Accounts/Origins/OriginCreateParams.php b/src/Accounts/Origins/OriginCreateParams.php index f1abfa92..2db2c292 100644 --- a/src/Accounts/Origins/OriginCreateParams.php +++ b/src/Accounts/Origins/OriginCreateParams.php @@ -22,19 +22,19 @@ * name: string, * secretKey: string, * type: 'AKENEO_PIM', - * baseUrlForCanonicalHeader?: string, + * baseURLForCanonicalHeader?: string, * includeCanonicalHeader?: bool, * prefix?: string, * endpoint: string, * s3ForcePathStyle?: bool, - * baseUrl: string, + * baseURL: string, * forwardHostHeaderToOrigin?: bool, * clientEmail: string, * privateKey: string, * accountName: string, * container: string, * sasToken: string, - * clientId: string, + * clientID: string, * clientSecret: string, * password: string, * username: string, @@ -74,8 +74,8 @@ final class OriginCreateParams implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Optional] - public ?string $baseUrlForCanonicalHeader; + #[Optional('baseUrlForCanonicalHeader')] + public ?string $baseURLForCanonicalHeader; /** * Whether to send a Canonical header. @@ -101,8 +101,8 @@ final class OriginCreateParams implements BaseModel /** * Akeneo instance base URL. */ - #[Required] - public string $baseUrl; + #[Required('baseUrl')] + public string $baseURL; /** * Forward the Host header to origin? @@ -128,8 +128,8 @@ final class OriginCreateParams implements BaseModel /** * Akeneo API client ID. */ - #[Required] - public string $clientId; + #[Required('clientId')] + public string $clientID; /** * Akeneo API client secret. @@ -160,13 +160,13 @@ final class OriginCreateParams implements BaseModel * name: ..., * secretKey: ..., * endpoint: ..., - * baseUrl: ..., + * baseURL: ..., * clientEmail: ..., * privateKey: ..., * accountName: ..., * container: ..., * sasToken: ..., - * clientId: ..., + * clientID: ..., * clientSecret: ..., * password: ..., * username: ..., @@ -210,17 +210,17 @@ public static function with( string $name, string $secretKey, string $endpoint, - string $baseUrl, + string $baseURL, string $clientEmail, string $privateKey, string $accountName, string $container, string $sasToken, - string $clientId, + string $clientID, string $clientSecret, string $password, string $username, - ?string $baseUrlForCanonicalHeader = null, + ?string $baseURLForCanonicalHeader = null, ?bool $includeCanonicalHeader = null, ?string $prefix = null, ?bool $s3ForcePathStyle = null, @@ -233,18 +233,18 @@ public static function with( $obj['name'] = $name; $obj['secretKey'] = $secretKey; $obj['endpoint'] = $endpoint; - $obj['baseUrl'] = $baseUrl; + $obj['baseURL'] = $baseURL; $obj['clientEmail'] = $clientEmail; $obj['privateKey'] = $privateKey; $obj['accountName'] = $accountName; $obj['container'] = $container; $obj['sasToken'] = $sasToken; - $obj['clientId'] = $clientId; + $obj['clientID'] = $clientID; $obj['clientSecret'] = $clientSecret; $obj['password'] = $password; $obj['username'] = $username; - null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; null !== $prefix && $obj['prefix'] = $prefix; null !== $s3ForcePathStyle && $obj['s3ForcePathStyle'] = $s3ForcePathStyle; @@ -301,7 +301,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; + $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } @@ -354,7 +354,7 @@ public function withS3ForcePathStyle(bool $s3ForcePathStyle): self public function withBaseURL(string $baseURL): self { $obj = clone $this; - $obj['baseUrl'] = $baseURL; + $obj['baseURL'] = $baseURL; return $obj; } @@ -417,7 +417,7 @@ public function withSasToken(string $sasToken): self public function withClientID(string $clientID): self { $obj = clone $this; - $obj['clientId'] = $clientID; + $obj['clientID'] = $clientID; return $obj; } diff --git a/src/Accounts/Origins/OriginRequest/AkeneoPim.php b/src/Accounts/Origins/OriginRequest/AkeneoPim.php index dcf7b0bd..b271c85f 100644 --- a/src/Accounts/Origins/OriginRequest/AkeneoPim.php +++ b/src/Accounts/Origins/OriginRequest/AkeneoPim.php @@ -11,14 +11,14 @@ /** * @phpstan-type AkeneoPimShape = array{ - * baseUrl: string, - * clientId: string, + * baseURL: string, + * clientID: string, * clientSecret: string, * name: string, * password: string, * type?: 'AKENEO_PIM', * username: string, - * baseUrlForCanonicalHeader?: string|null, + * baseURLForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * } */ @@ -34,14 +34,14 @@ final class AkeneoPim implements BaseModel /** * Akeneo instance base URL. */ - #[Required] - public string $baseUrl; + #[Required('baseUrl')] + public string $baseURL; /** * Akeneo API client ID. */ - #[Required] - public string $clientId; + #[Required('clientId')] + public string $clientID; /** * Akeneo API client secret. @@ -70,8 +70,8 @@ final class AkeneoPim implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Optional] - public ?string $baseUrlForCanonicalHeader; + #[Optional('baseUrlForCanonicalHeader')] + public ?string $baseURLForCanonicalHeader; /** * Whether to send a Canonical header. @@ -85,8 +85,8 @@ final class AkeneoPim implements BaseModel * To enforce required parameters use * ``` * AkeneoPim::with( - * baseUrl: ..., - * clientId: ..., + * baseURL: ..., + * clientID: ..., * clientSecret: ..., * name: ..., * password: ..., @@ -117,25 +117,25 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - string $baseUrl, - string $clientId, + string $baseURL, + string $clientID, string $clientSecret, string $name, string $password, string $username, - ?string $baseUrlForCanonicalHeader = null, + ?string $baseURLForCanonicalHeader = null, ?bool $includeCanonicalHeader = null, ): self { $obj = new self; - $obj['baseUrl'] = $baseUrl; - $obj['clientId'] = $clientId; + $obj['baseURL'] = $baseURL; + $obj['clientID'] = $clientID; $obj['clientSecret'] = $clientSecret; $obj['name'] = $name; $obj['password'] = $password; $obj['username'] = $username; - null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; return $obj; @@ -147,7 +147,7 @@ public static function with( public function withBaseURL(string $baseURL): self { $obj = clone $this; - $obj['baseUrl'] = $baseURL; + $obj['baseURL'] = $baseURL; return $obj; } @@ -158,7 +158,7 @@ public function withBaseURL(string $baseURL): self public function withClientID(string $clientID): self { $obj = clone $this; - $obj['clientId'] = $clientID; + $obj['clientID'] = $clientID; return $obj; } @@ -214,7 +214,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; + $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginRequest/AzureBlob.php b/src/Accounts/Origins/OriginRequest/AzureBlob.php index 1bdca305..c8c943b5 100644 --- a/src/Accounts/Origins/OriginRequest/AzureBlob.php +++ b/src/Accounts/Origins/OriginRequest/AzureBlob.php @@ -16,7 +16,7 @@ * name: string, * sasToken: string, * type?: 'AZURE_BLOB', - * baseUrlForCanonicalHeader?: string|null, + * baseURLForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * prefix?: string|null, * } @@ -48,8 +48,8 @@ final class AzureBlob implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Optional] - public ?string $baseUrlForCanonicalHeader; + #[Optional('baseUrlForCanonicalHeader')] + public ?string $baseURLForCanonicalHeader; /** * Whether to send a Canonical header. @@ -93,7 +93,7 @@ public static function with( string $container, string $name, string $sasToken, - ?string $baseUrlForCanonicalHeader = null, + ?string $baseURLForCanonicalHeader = null, ?bool $includeCanonicalHeader = null, ?string $prefix = null, ): self { @@ -104,7 +104,7 @@ public static function with( $obj['name'] = $name; $obj['sasToken'] = $sasToken; - null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; null !== $prefix && $obj['prefix'] = $prefix; @@ -153,7 +153,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; + $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php index 7f30ca73..a228af4e 100644 --- a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php @@ -16,7 +16,7 @@ * name: string, * secretKey: string, * type?: 'CLOUDINARY_BACKUP', - * baseUrlForCanonicalHeader?: string|null, + * baseURLForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * prefix?: string|null, * } @@ -57,8 +57,8 @@ final class CloudinaryBackup implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Optional] - public ?string $baseUrlForCanonicalHeader; + #[Optional('baseUrlForCanonicalHeader')] + public ?string $baseURLForCanonicalHeader; /** * Whether to send a Canonical header. @@ -105,7 +105,7 @@ public static function with( string $bucket, string $name, string $secretKey, - ?string $baseUrlForCanonicalHeader = null, + ?string $baseURLForCanonicalHeader = null, ?bool $includeCanonicalHeader = null, ?string $prefix = null, ): self { @@ -116,7 +116,7 @@ public static function with( $obj['name'] = $name; $obj['secretKey'] = $secretKey; - null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; null !== $prefix && $obj['prefix'] = $prefix; @@ -174,7 +174,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; + $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginRequest/Gcs.php b/src/Accounts/Origins/OriginRequest/Gcs.php index 7d80440f..347200d0 100644 --- a/src/Accounts/Origins/OriginRequest/Gcs.php +++ b/src/Accounts/Origins/OriginRequest/Gcs.php @@ -16,7 +16,7 @@ * name: string, * privateKey: string, * type?: 'GCS', - * baseUrlForCanonicalHeader?: string|null, + * baseURLForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * prefix?: string|null, * } @@ -48,8 +48,8 @@ final class Gcs implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Optional] - public ?string $baseUrlForCanonicalHeader; + #[Optional('baseUrlForCanonicalHeader')] + public ?string $baseURLForCanonicalHeader; /** * Whether to send a Canonical header. @@ -93,7 +93,7 @@ public static function with( string $clientEmail, string $name, string $privateKey, - ?string $baseUrlForCanonicalHeader = null, + ?string $baseURLForCanonicalHeader = null, ?bool $includeCanonicalHeader = null, ?string $prefix = null, ): self { @@ -104,7 +104,7 @@ public static function with( $obj['name'] = $name; $obj['privateKey'] = $privateKey; - null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; null !== $prefix && $obj['prefix'] = $prefix; @@ -153,7 +153,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; + $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginRequest/S3.php b/src/Accounts/Origins/OriginRequest/S3.php index 56c6c102..19b65e77 100644 --- a/src/Accounts/Origins/OriginRequest/S3.php +++ b/src/Accounts/Origins/OriginRequest/S3.php @@ -16,7 +16,7 @@ * name: string, * secretKey: string, * type?: 'S3', - * baseUrlForCanonicalHeader?: string|null, + * baseURLForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * prefix?: string|null, * } @@ -57,8 +57,8 @@ final class S3 implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Optional] - public ?string $baseUrlForCanonicalHeader; + #[Optional('baseUrlForCanonicalHeader')] + public ?string $baseURLForCanonicalHeader; /** * Whether to send a Canonical header. @@ -101,7 +101,7 @@ public static function with( string $bucket, string $name, string $secretKey, - ?string $baseUrlForCanonicalHeader = null, + ?string $baseURLForCanonicalHeader = null, ?bool $includeCanonicalHeader = null, ?string $prefix = null, ): self { @@ -112,7 +112,7 @@ public static function with( $obj['name'] = $name; $obj['secretKey'] = $secretKey; - null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; null !== $prefix && $obj['prefix'] = $prefix; @@ -170,7 +170,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; + $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginRequest/S3Compatible.php b/src/Accounts/Origins/OriginRequest/S3Compatible.php index 249e0f8b..a13799fd 100644 --- a/src/Accounts/Origins/OriginRequest/S3Compatible.php +++ b/src/Accounts/Origins/OriginRequest/S3Compatible.php @@ -17,7 +17,7 @@ * name: string, * secretKey: string, * type?: 'S3_COMPATIBLE', - * baseUrlForCanonicalHeader?: string|null, + * baseURLForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * prefix?: string|null, * s3ForcePathStyle?: bool|null, @@ -65,8 +65,8 @@ final class S3Compatible implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Optional] - public ?string $baseUrlForCanonicalHeader; + #[Optional('baseUrlForCanonicalHeader')] + public ?string $baseURLForCanonicalHeader; /** * Whether to send a Canonical header. @@ -123,7 +123,7 @@ public static function with( string $endpoint, string $name, string $secretKey, - ?string $baseUrlForCanonicalHeader = null, + ?string $baseURLForCanonicalHeader = null, ?bool $includeCanonicalHeader = null, ?string $prefix = null, ?bool $s3ForcePathStyle = null, @@ -136,7 +136,7 @@ public static function with( $obj['name'] = $name; $obj['secretKey'] = $secretKey; - null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; null !== $prefix && $obj['prefix'] = $prefix; null !== $s3ForcePathStyle && $obj['s3ForcePathStyle'] = $s3ForcePathStyle; @@ -206,7 +206,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; + $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginRequest/WebFolder.php b/src/Accounts/Origins/OriginRequest/WebFolder.php index da7333b6..b53bc0b0 100644 --- a/src/Accounts/Origins/OriginRequest/WebFolder.php +++ b/src/Accounts/Origins/OriginRequest/WebFolder.php @@ -11,10 +11,10 @@ /** * @phpstan-type WebFolderShape = array{ - * baseUrl: string, + * baseURL: string, * name: string, * type?: 'WEB_FOLDER', - * baseUrlForCanonicalHeader?: string|null, + * baseURLForCanonicalHeader?: string|null, * forwardHostHeaderToOrigin?: bool|null, * includeCanonicalHeader?: bool|null, * } @@ -31,8 +31,8 @@ final class WebFolder implements BaseModel /** * Root URL for the web folder origin. */ - #[Required] - public string $baseUrl; + #[Required('baseUrl')] + public string $baseURL; /** * Display name of the origin. @@ -43,8 +43,8 @@ final class WebFolder implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Optional] - public ?string $baseUrlForCanonicalHeader; + #[Optional('baseUrlForCanonicalHeader')] + public ?string $baseURLForCanonicalHeader; /** * Forward the Host header to origin? @@ -63,7 +63,7 @@ final class WebFolder implements BaseModel * * To enforce required parameters use * ``` - * WebFolder::with(baseUrl: ..., name: ...) + * WebFolder::with(baseURL: ..., name: ...) * ``` * * Otherwise ensure the following setters are called @@ -83,18 +83,18 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - string $baseUrl, + string $baseURL, string $name, - ?string $baseUrlForCanonicalHeader = null, + ?string $baseURLForCanonicalHeader = null, ?bool $forwardHostHeaderToOrigin = null, ?bool $includeCanonicalHeader = null, ): self { $obj = new self; - $obj['baseUrl'] = $baseUrl; + $obj['baseURL'] = $baseURL; $obj['name'] = $name; - null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; null !== $forwardHostHeaderToOrigin && $obj['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; @@ -107,7 +107,7 @@ public static function with( public function withBaseURL(string $baseURL): self { $obj = clone $this; - $obj['baseUrl'] = $baseURL; + $obj['baseURL'] = $baseURL; return $obj; } @@ -130,7 +130,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; + $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginRequest/WebProxy.php b/src/Accounts/Origins/OriginRequest/WebProxy.php index aa6e747c..8453e19e 100644 --- a/src/Accounts/Origins/OriginRequest/WebProxy.php +++ b/src/Accounts/Origins/OriginRequest/WebProxy.php @@ -13,7 +13,7 @@ * @phpstan-type WebProxyShape = array{ * name: string, * type?: 'WEB_PROXY', - * baseUrlForCanonicalHeader?: string|null, + * baseURLForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * } */ @@ -35,8 +35,8 @@ final class WebProxy implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Optional] - public ?string $baseUrlForCanonicalHeader; + #[Optional('baseUrlForCanonicalHeader')] + public ?string $baseURLForCanonicalHeader; /** * Whether to send a Canonical header. @@ -70,14 +70,14 @@ public function __construct() */ public static function with( string $name, - ?string $baseUrlForCanonicalHeader = null, + ?string $baseURLForCanonicalHeader = null, ?bool $includeCanonicalHeader = null, ): self { $obj = new self; $obj['name'] = $name; - null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; return $obj; @@ -101,7 +101,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; + $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginResponse/AkeneoPim.php b/src/Accounts/Origins/OriginResponse/AkeneoPim.php index 7cce7237..5a05eacd 100644 --- a/src/Accounts/Origins/OriginResponse/AkeneoPim.php +++ b/src/Accounts/Origins/OriginResponse/AkeneoPim.php @@ -12,11 +12,11 @@ /** * @phpstan-type AkeneoPimShape = array{ * id: string, - * baseUrl: string, + * baseURL: string, * includeCanonicalHeader: bool, * name: string, * type?: 'AKENEO_PIM', - * baseUrlForCanonicalHeader?: string|null, + * baseURLForCanonicalHeader?: string|null, * } */ final class AkeneoPim implements BaseModel @@ -37,8 +37,8 @@ final class AkeneoPim implements BaseModel /** * Akeneo instance base URL. */ - #[Required] - public string $baseUrl; + #[Required('baseUrl')] + public string $baseURL; /** * Whether to send a Canonical header. @@ -55,15 +55,15 @@ final class AkeneoPim implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Optional] - public ?string $baseUrlForCanonicalHeader; + #[Optional('baseUrlForCanonicalHeader')] + public ?string $baseURLForCanonicalHeader; /** * `new AkeneoPim()` is missing required properties by the API. * * To enforce required parameters use * ``` - * AkeneoPim::with(id: ..., baseUrl: ..., includeCanonicalHeader: ..., name: ...) + * AkeneoPim::with(id: ..., baseURL: ..., includeCanonicalHeader: ..., name: ...) * ``` * * Otherwise ensure the following setters are called @@ -88,19 +88,19 @@ public function __construct() */ public static function with( string $id, - string $baseUrl, + string $baseURL, string $name, bool $includeCanonicalHeader = false, - ?string $baseUrlForCanonicalHeader = null, + ?string $baseURLForCanonicalHeader = null, ): self { $obj = new self; $obj['id'] = $id; - $obj['baseUrl'] = $baseUrl; + $obj['baseURL'] = $baseURL; $obj['includeCanonicalHeader'] = $includeCanonicalHeader; $obj['name'] = $name; - null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } @@ -122,7 +122,7 @@ public function withID(string $id): self public function withBaseURL(string $baseURL): self { $obj = clone $this; - $obj['baseUrl'] = $baseURL; + $obj['baseURL'] = $baseURL; return $obj; } @@ -157,7 +157,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; + $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginResponse/AzureBlob.php b/src/Accounts/Origins/OriginResponse/AzureBlob.php index 5a5097b0..1dbbc5ee 100644 --- a/src/Accounts/Origins/OriginResponse/AzureBlob.php +++ b/src/Accounts/Origins/OriginResponse/AzureBlob.php @@ -18,7 +18,7 @@ * name: string, * prefix: string, * type?: 'AZURE_BLOB', - * baseUrlForCanonicalHeader?: string|null, + * baseURLForCanonicalHeader?: string|null, * } */ final class AzureBlob implements BaseModel @@ -60,8 +60,8 @@ final class AzureBlob implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Optional] - public ?string $baseUrlForCanonicalHeader; + #[Optional('baseUrlForCanonicalHeader')] + public ?string $baseURLForCanonicalHeader; /** * `new AzureBlob()` is missing required properties by the API. @@ -107,7 +107,7 @@ public static function with( string $name, string $prefix, bool $includeCanonicalHeader = false, - ?string $baseUrlForCanonicalHeader = null, + ?string $baseURLForCanonicalHeader = null, ): self { $obj = new self; @@ -118,7 +118,7 @@ public static function with( $obj['name'] = $name; $obj['prefix'] = $prefix; - null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } @@ -188,7 +188,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; + $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php index ff8db89a..2df579c8 100644 --- a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php @@ -17,7 +17,7 @@ * name: string, * prefix: string, * type?: 'CLOUDINARY_BACKUP', - * baseUrlForCanonicalHeader?: string|null, + * baseURLForCanonicalHeader?: string|null, * } */ final class CloudinaryBackup implements BaseModel @@ -62,8 +62,8 @@ final class CloudinaryBackup implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Optional] - public ?string $baseUrlForCanonicalHeader; + #[Optional('baseUrlForCanonicalHeader')] + public ?string $baseURLForCanonicalHeader; /** * `new CloudinaryBackup()` is missing required properties by the API. @@ -102,7 +102,7 @@ public static function with( string $name, string $prefix, bool $includeCanonicalHeader = false, - ?string $baseUrlForCanonicalHeader = null, + ?string $baseURLForCanonicalHeader = null, ): self { $obj = new self; @@ -112,7 +112,7 @@ public static function with( $obj['name'] = $name; $obj['prefix'] = $prefix; - null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } @@ -180,7 +180,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; + $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginResponse/Gcs.php b/src/Accounts/Origins/OriginResponse/Gcs.php index 3944a34a..e875625b 100644 --- a/src/Accounts/Origins/OriginResponse/Gcs.php +++ b/src/Accounts/Origins/OriginResponse/Gcs.php @@ -18,7 +18,7 @@ * name: string, * prefix: string, * type?: 'GCS', - * baseUrlForCanonicalHeader?: string|null, + * baseURLForCanonicalHeader?: string|null, * } */ final class Gcs implements BaseModel @@ -60,8 +60,8 @@ final class Gcs implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Optional] - public ?string $baseUrlForCanonicalHeader; + #[Optional('baseUrlForCanonicalHeader')] + public ?string $baseURLForCanonicalHeader; /** * `new Gcs()` is missing required properties by the API. @@ -107,7 +107,7 @@ public static function with( string $name, string $prefix, bool $includeCanonicalHeader = false, - ?string $baseUrlForCanonicalHeader = null, + ?string $baseURLForCanonicalHeader = null, ): self { $obj = new self; @@ -118,7 +118,7 @@ public static function with( $obj['name'] = $name; $obj['prefix'] = $prefix; - null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } @@ -188,7 +188,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; + $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginResponse/S3.php b/src/Accounts/Origins/OriginResponse/S3.php index ea3bded8..854570c8 100644 --- a/src/Accounts/Origins/OriginResponse/S3.php +++ b/src/Accounts/Origins/OriginResponse/S3.php @@ -17,7 +17,7 @@ * name: string, * prefix: string, * type?: 'S3', - * baseUrlForCanonicalHeader?: string|null, + * baseURLForCanonicalHeader?: string|null, * } */ final class S3 implements BaseModel @@ -62,8 +62,8 @@ final class S3 implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Optional] - public ?string $baseUrlForCanonicalHeader; + #[Optional('baseUrlForCanonicalHeader')] + public ?string $baseURLForCanonicalHeader; /** * `new S3()` is missing required properties by the API. @@ -102,7 +102,7 @@ public static function with( string $name, string $prefix, bool $includeCanonicalHeader = false, - ?string $baseUrlForCanonicalHeader = null, + ?string $baseURLForCanonicalHeader = null, ): self { $obj = new self; @@ -112,7 +112,7 @@ public static function with( $obj['name'] = $name; $obj['prefix'] = $prefix; - null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } @@ -180,7 +180,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; + $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginResponse/S3Compatible.php b/src/Accounts/Origins/OriginResponse/S3Compatible.php index 34e09403..4ea3cfe7 100644 --- a/src/Accounts/Origins/OriginResponse/S3Compatible.php +++ b/src/Accounts/Origins/OriginResponse/S3Compatible.php @@ -19,7 +19,7 @@ * prefix: string, * s3ForcePathStyle: bool, * type?: 'S3_COMPATIBLE', - * baseUrlForCanonicalHeader?: string|null, + * baseURLForCanonicalHeader?: string|null, * } */ final class S3Compatible implements BaseModel @@ -76,8 +76,8 @@ final class S3Compatible implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Optional] - public ?string $baseUrlForCanonicalHeader; + #[Optional('baseUrlForCanonicalHeader')] + public ?string $baseURLForCanonicalHeader; /** * `new S3Compatible()` is missing required properties by the API. @@ -126,7 +126,7 @@ public static function with( string $prefix, bool $includeCanonicalHeader = false, bool $s3ForcePathStyle = false, - ?string $baseUrlForCanonicalHeader = null, + ?string $baseURLForCanonicalHeader = null, ): self { $obj = new self; @@ -138,7 +138,7 @@ public static function with( $obj['prefix'] = $prefix; $obj['s3ForcePathStyle'] = $s3ForcePathStyle; - null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } @@ -228,7 +228,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; + $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginResponse/WebFolder.php b/src/Accounts/Origins/OriginResponse/WebFolder.php index d181ed24..61c9534e 100644 --- a/src/Accounts/Origins/OriginResponse/WebFolder.php +++ b/src/Accounts/Origins/OriginResponse/WebFolder.php @@ -12,12 +12,12 @@ /** * @phpstan-type WebFolderShape = array{ * id: string, - * baseUrl: string, + * baseURL: string, * forwardHostHeaderToOrigin: bool, * includeCanonicalHeader: bool, * name: string, * type?: 'WEB_FOLDER', - * baseUrlForCanonicalHeader?: string|null, + * baseURLForCanonicalHeader?: string|null, * } */ final class WebFolder implements BaseModel @@ -38,8 +38,8 @@ final class WebFolder implements BaseModel /** * Root URL for the web folder origin. */ - #[Required] - public string $baseUrl; + #[Required('baseUrl')] + public string $baseURL; /** * Forward the Host header to origin? @@ -62,8 +62,8 @@ final class WebFolder implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Optional] - public ?string $baseUrlForCanonicalHeader; + #[Optional('baseUrlForCanonicalHeader')] + public ?string $baseURLForCanonicalHeader; /** * `new WebFolder()` is missing required properties by the API. @@ -72,7 +72,7 @@ final class WebFolder implements BaseModel * ``` * WebFolder::with( * id: ..., - * baseUrl: ..., + * baseURL: ..., * forwardHostHeaderToOrigin: ..., * includeCanonicalHeader: ..., * name: ..., @@ -102,21 +102,21 @@ public function __construct() */ public static function with( string $id, - string $baseUrl, + string $baseURL, string $name, bool $forwardHostHeaderToOrigin = false, bool $includeCanonicalHeader = false, - ?string $baseUrlForCanonicalHeader = null, + ?string $baseURLForCanonicalHeader = null, ): self { $obj = new self; $obj['id'] = $id; - $obj['baseUrl'] = $baseUrl; + $obj['baseURL'] = $baseURL; $obj['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; $obj['includeCanonicalHeader'] = $includeCanonicalHeader; $obj['name'] = $name; - null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } @@ -138,7 +138,7 @@ public function withID(string $id): self public function withBaseURL(string $baseURL): self { $obj = clone $this; - $obj['baseUrl'] = $baseURL; + $obj['baseURL'] = $baseURL; return $obj; } @@ -185,7 +185,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; + $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginResponse/WebProxy.php b/src/Accounts/Origins/OriginResponse/WebProxy.php index 6bb1a426..6c5474be 100644 --- a/src/Accounts/Origins/OriginResponse/WebProxy.php +++ b/src/Accounts/Origins/OriginResponse/WebProxy.php @@ -15,7 +15,7 @@ * includeCanonicalHeader: bool, * name: string, * type?: 'WEB_PROXY', - * baseUrlForCanonicalHeader?: string|null, + * baseURLForCanonicalHeader?: string|null, * } */ final class WebProxy implements BaseModel @@ -48,8 +48,8 @@ final class WebProxy implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Optional] - public ?string $baseUrlForCanonicalHeader; + #[Optional('baseUrlForCanonicalHeader')] + public ?string $baseURLForCanonicalHeader; /** * `new WebProxy()` is missing required properties by the API. @@ -79,7 +79,7 @@ public static function with( string $id, string $name, bool $includeCanonicalHeader = false, - ?string $baseUrlForCanonicalHeader = null, + ?string $baseURLForCanonicalHeader = null, ): self { $obj = new self; @@ -87,7 +87,7 @@ public static function with( $obj['includeCanonicalHeader'] = $includeCanonicalHeader; $obj['name'] = $name; - null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } @@ -133,7 +133,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; + $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } diff --git a/src/Accounts/Origins/OriginUpdateParams.php b/src/Accounts/Origins/OriginUpdateParams.php index 7173e153..df9bd0ce 100644 --- a/src/Accounts/Origins/OriginUpdateParams.php +++ b/src/Accounts/Origins/OriginUpdateParams.php @@ -22,19 +22,19 @@ * name: string, * secretKey: string, * type: 'AKENEO_PIM', - * baseUrlForCanonicalHeader?: string, + * baseURLForCanonicalHeader?: string, * includeCanonicalHeader?: bool, * prefix?: string, * endpoint: string, * s3ForcePathStyle?: bool, - * baseUrl: string, + * baseURL: string, * forwardHostHeaderToOrigin?: bool, * clientEmail: string, * privateKey: string, * accountName: string, * container: string, * sasToken: string, - * clientId: string, + * clientID: string, * clientSecret: string, * password: string, * username: string, @@ -74,8 +74,8 @@ final class OriginUpdateParams implements BaseModel /** * URL used in the Canonical header (if enabled). */ - #[Optional] - public ?string $baseUrlForCanonicalHeader; + #[Optional('baseUrlForCanonicalHeader')] + public ?string $baseURLForCanonicalHeader; /** * Whether to send a Canonical header. @@ -101,8 +101,8 @@ final class OriginUpdateParams implements BaseModel /** * Akeneo instance base URL. */ - #[Required] - public string $baseUrl; + #[Required('baseUrl')] + public string $baseURL; /** * Forward the Host header to origin? @@ -128,8 +128,8 @@ final class OriginUpdateParams implements BaseModel /** * Akeneo API client ID. */ - #[Required] - public string $clientId; + #[Required('clientId')] + public string $clientID; /** * Akeneo API client secret. @@ -160,13 +160,13 @@ final class OriginUpdateParams implements BaseModel * name: ..., * secretKey: ..., * endpoint: ..., - * baseUrl: ..., + * baseURL: ..., * clientEmail: ..., * privateKey: ..., * accountName: ..., * container: ..., * sasToken: ..., - * clientId: ..., + * clientID: ..., * clientSecret: ..., * password: ..., * username: ..., @@ -210,17 +210,17 @@ public static function with( string $name, string $secretKey, string $endpoint, - string $baseUrl, + string $baseURL, string $clientEmail, string $privateKey, string $accountName, string $container, string $sasToken, - string $clientId, + string $clientID, string $clientSecret, string $password, string $username, - ?string $baseUrlForCanonicalHeader = null, + ?string $baseURLForCanonicalHeader = null, ?bool $includeCanonicalHeader = null, ?string $prefix = null, ?bool $s3ForcePathStyle = null, @@ -233,18 +233,18 @@ public static function with( $obj['name'] = $name; $obj['secretKey'] = $secretKey; $obj['endpoint'] = $endpoint; - $obj['baseUrl'] = $baseUrl; + $obj['baseURL'] = $baseURL; $obj['clientEmail'] = $clientEmail; $obj['privateKey'] = $privateKey; $obj['accountName'] = $accountName; $obj['container'] = $container; $obj['sasToken'] = $sasToken; - $obj['clientId'] = $clientId; + $obj['clientID'] = $clientID; $obj['clientSecret'] = $clientSecret; $obj['password'] = $password; $obj['username'] = $username; - null !== $baseUrlForCanonicalHeader && $obj['baseUrlForCanonicalHeader'] = $baseUrlForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; null !== $prefix && $obj['prefix'] = $prefix; null !== $s3ForcePathStyle && $obj['s3ForcePathStyle'] = $s3ForcePathStyle; @@ -301,7 +301,7 @@ public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { $obj = clone $this; - $obj['baseUrlForCanonicalHeader'] = $baseURLForCanonicalHeader; + $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; return $obj; } @@ -354,7 +354,7 @@ public function withS3ForcePathStyle(bool $s3ForcePathStyle): self public function withBaseURL(string $baseURL): self { $obj = clone $this; - $obj['baseUrl'] = $baseURL; + $obj['baseURL'] = $baseURL; return $obj; } @@ -417,7 +417,7 @@ public function withSasToken(string $sasToken): self public function withClientID(string $clientID): self { $obj = clone $this; - $obj['clientId'] = $clientID; + $obj['clientID'] = $clientID; return $obj; } diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index d2bd0db0..c894150e 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -66,7 +66,7 @@ * pre?: string|null, * }, * useUniqueFileName?: bool, - * webhookUrl?: string, + * webhookURL?: string, * } */ final class FileUploadParams implements BaseModel @@ -236,8 +236,8 @@ final class FileUploadParams implements BaseModel /** * The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. */ - #[Optional] - public ?string $webhookUrl; + #[Optional('webhookUrl')] + public ?string $webhookURL; /** * `new FileUploadParams()` is missing required properties by the API. @@ -296,7 +296,7 @@ public static function with( ?array $tags = null, Transformation|array|null $transformation = null, ?bool $useUniqueFileName = null, - ?string $webhookUrl = null, + ?string $webhookURL = null, ): self { $obj = new self; @@ -320,7 +320,7 @@ public static function with( null !== $tags && $obj['tags'] = $tags; null !== $transformation && $obj['transformation'] = $transformation; null !== $useUniqueFileName && $obj['useUniqueFileName'] = $useUniqueFileName; - null !== $webhookUrl && $obj['webhookUrl'] = $webhookUrl; + null !== $webhookURL && $obj['webhookURL'] = $webhookURL; return $obj; } @@ -595,7 +595,7 @@ public function withUseUniqueFileName(bool $useUniqueFileName): self public function withWebhookURL(string $webhookURL): self { $obj = clone $this; - $obj['webhookUrl'] = $webhookURL; + $obj['webhookURL'] = $webhookURL; return $obj; } diff --git a/src/Beta/V2/Files/FileUploadResponse.php b/src/Beta/V2/Files/FileUploadResponse.php index 11de1dc8..0579ac38 100644 --- a/src/Beta/V2/Files/FileUploadResponse.php +++ b/src/Beta/V2/Files/FileUploadResponse.php @@ -23,7 +23,7 @@ * Object containing details of a successful upload. * * @phpstan-type FileUploadResponseShape = array{ - * AITags?: list|null, + * aiTags?: list|null, * audioCodec?: string|null, * bitRate?: int|null, * customCoordinates?: string|null, @@ -32,7 +32,7 @@ * duration?: int|null, * embeddedMetadata?: array|null, * extensionStatus?: ExtensionStatus|null, - * fileId?: string|null, + * fileID?: string|null, * filePath?: string|null, * fileType?: string|null, * height?: float|null, @@ -43,7 +43,7 @@ * selectedFieldsSchema?: array|null, * size?: float|null, * tags?: list|null, - * thumbnailUrl?: string|null, + * thumbnailURL?: string|null, * url?: string|null, * versionInfo?: VersionInfo|null, * videoCodec?: string|null, @@ -58,10 +58,10 @@ final class FileUploadResponse implements BaseModel /** * An array of tags assigned to the uploaded file by auto tagging. * - * @var list|null $AITags + * @var list|null $aiTags */ - #[Optional(list: AITag::class, nullable: true)] - public ?array $AITags; + #[Optional('AITags', list: AITag::class, nullable: true)] + public ?array $aiTags; /** * The audio codec used in the video (only for video). @@ -124,8 +124,8 @@ final class FileUploadResponse implements BaseModel /** * Unique fileId. Store this fileld in your database, as this will be used to perform update action on this file. */ - #[Optional] - public ?string $fileId; + #[Optional('fileId')] + public ?string $fileID; /** * The relative path of the file in the media library e.g. `/marketing-assets/new-banner.jpg`. @@ -198,8 +198,8 @@ final class FileUploadResponse implements BaseModel /** * In the case of an image, a small thumbnail URL. */ - #[Optional] - public ?string $thumbnailUrl; + #[Optional('thumbnailUrl')] + public ?string $thumbnailURL; /** * A publicly accessible URL of the file. @@ -237,14 +237,14 @@ public function __construct() * * @param list|null $AITags + * }>|null $aiTags * @param array $customMetadata * @param array $embeddedMetadata * @param ExtensionStatus|array{ - * ai_auto_description?: value-of|null, - * aws_auto_tagging?: value-of|null, - * google_auto_tagging?: value-of|null, - * remove_bg?: value-of|null, + * aiAutoDescription?: value-of|null, + * awsAutoTagging?: value-of|null, + * googleAutoTagging?: value-of|null, + * removeBg?: value-of|null, * } $extensionStatus * @param Metadata|array{ * audioCodec?: string|null, @@ -278,7 +278,7 @@ public function __construct() * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo */ public static function with( - ?array $AITags = null, + ?array $aiTags = null, ?string $audioCodec = null, ?int $bitRate = null, ?string $customCoordinates = null, @@ -287,7 +287,7 @@ public static function with( ?int $duration = null, ?array $embeddedMetadata = null, ExtensionStatus|array|null $extensionStatus = null, - ?string $fileId = null, + ?string $fileID = null, ?string $filePath = null, ?string $fileType = null, ?float $height = null, @@ -298,7 +298,7 @@ public static function with( ?array $selectedFieldsSchema = null, ?float $size = null, ?array $tags = null, - ?string $thumbnailUrl = null, + ?string $thumbnailURL = null, ?string $url = null, VersionInfo|array|null $versionInfo = null, ?string $videoCodec = null, @@ -306,7 +306,7 @@ public static function with( ): self { $obj = new self; - null !== $AITags && $obj['AITags'] = $AITags; + null !== $aiTags && $obj['aiTags'] = $aiTags; null !== $audioCodec && $obj['audioCodec'] = $audioCodec; null !== $bitRate && $obj['bitRate'] = $bitRate; null !== $customCoordinates && $obj['customCoordinates'] = $customCoordinates; @@ -315,7 +315,7 @@ public static function with( null !== $duration && $obj['duration'] = $duration; null !== $embeddedMetadata && $obj['embeddedMetadata'] = $embeddedMetadata; null !== $extensionStatus && $obj['extensionStatus'] = $extensionStatus; - null !== $fileId && $obj['fileId'] = $fileId; + null !== $fileID && $obj['fileID'] = $fileID; null !== $filePath && $obj['filePath'] = $filePath; null !== $fileType && $obj['fileType'] = $fileType; null !== $height && $obj['height'] = $height; @@ -326,7 +326,7 @@ public static function with( null !== $selectedFieldsSchema && $obj['selectedFieldsSchema'] = $selectedFieldsSchema; null !== $size && $obj['size'] = $size; null !== $tags && $obj['tags'] = $tags; - null !== $thumbnailUrl && $obj['thumbnailUrl'] = $thumbnailUrl; + null !== $thumbnailURL && $obj['thumbnailURL'] = $thumbnailURL; null !== $url && $obj['url'] = $url; null !== $versionInfo && $obj['versionInfo'] = $versionInfo; null !== $videoCodec && $obj['videoCodec'] = $videoCodec; @@ -345,7 +345,7 @@ public static function with( public function withAITags(?array $aiTags): self { $obj = clone $this; - $obj['AITags'] = $aiTags; + $obj['aiTags'] = $aiTags; return $obj; } @@ -441,10 +441,10 @@ public function withEmbeddedMetadata(array $embeddedMetadata): self * If no extension was requested, then this parameter is not returned. * * @param ExtensionStatus|array{ - * ai_auto_description?: value-of|null, - * aws_auto_tagging?: value-of|null, - * google_auto_tagging?: value-of|null, - * remove_bg?: value-of|null, + * aiAutoDescription?: value-of|null, + * awsAutoTagging?: value-of|null, + * googleAutoTagging?: value-of|null, + * removeBg?: value-of|null, * } $extensionStatus */ public function withExtensionStatus( @@ -462,7 +462,7 @@ public function withExtensionStatus( public function withFileID(string $fileID): self { $obj = clone $this; - $obj['fileId'] = $fileID; + $obj['fileID'] = $fileID; return $obj; } @@ -619,7 +619,7 @@ public function withTags(?array $tags): self public function withThumbnailURL(string $thumbnailURL): self { $obj = clone $this; - $obj['thumbnailUrl'] = $thumbnailURL; + $obj['thumbnailURL'] = $thumbnailURL; return $obj; } diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php index 156c3de5..6706d157 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php @@ -22,10 +22,10 @@ * If no extension was requested, then this parameter is not returned. * * @phpstan-type ExtensionStatusShape = array{ - * ai_auto_description?: value-of|null, - * aws_auto_tagging?: value-of|null, - * google_auto_tagging?: value-of|null, - * remove_bg?: value-of|null, + * aiAutoDescription?: value-of|null, + * awsAutoTagging?: value-of|null, + * googleAutoTagging?: value-of|null, + * removeBg?: value-of|null, * } */ final class ExtensionStatus implements BaseModel @@ -33,21 +33,21 @@ final class ExtensionStatus implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var value-of|null $ai_auto_description */ + /** @var value-of|null $aiAutoDescription */ #[Optional('ai-auto-description', enum: AIAutoDescription::class)] - public ?string $ai_auto_description; + public ?string $aiAutoDescription; - /** @var value-of|null $aws_auto_tagging */ + /** @var value-of|null $awsAutoTagging */ #[Optional('aws-auto-tagging', enum: AwsAutoTagging::class)] - public ?string $aws_auto_tagging; + public ?string $awsAutoTagging; - /** @var value-of|null $google_auto_tagging */ + /** @var value-of|null $googleAutoTagging */ #[Optional('google-auto-tagging', enum: GoogleAutoTagging::class)] - public ?string $google_auto_tagging; + public ?string $googleAutoTagging; - /** @var value-of|null $remove_bg */ + /** @var value-of|null $removeBg */ #[Optional('remove-bg', enum: RemoveBg::class)] - public ?string $remove_bg; + public ?string $removeBg; public function __construct() { @@ -59,23 +59,23 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AIAutoDescription|value-of $ai_auto_description - * @param AwsAutoTagging|value-of $aws_auto_tagging - * @param GoogleAutoTagging|value-of $google_auto_tagging - * @param RemoveBg|value-of $remove_bg + * @param AIAutoDescription|value-of $aiAutoDescription + * @param AwsAutoTagging|value-of $awsAutoTagging + * @param GoogleAutoTagging|value-of $googleAutoTagging + * @param RemoveBg|value-of $removeBg */ public static function with( - AIAutoDescription|string|null $ai_auto_description = null, - AwsAutoTagging|string|null $aws_auto_tagging = null, - GoogleAutoTagging|string|null $google_auto_tagging = null, - RemoveBg|string|null $remove_bg = null, + AIAutoDescription|string|null $aiAutoDescription = null, + AwsAutoTagging|string|null $awsAutoTagging = null, + GoogleAutoTagging|string|null $googleAutoTagging = null, + RemoveBg|string|null $removeBg = null, ): self { $obj = new self; - null !== $ai_auto_description && $obj['ai_auto_description'] = $ai_auto_description; - null !== $aws_auto_tagging && $obj['aws_auto_tagging'] = $aws_auto_tagging; - null !== $google_auto_tagging && $obj['google_auto_tagging'] = $google_auto_tagging; - null !== $remove_bg && $obj['remove_bg'] = $remove_bg; + null !== $aiAutoDescription && $obj['aiAutoDescription'] = $aiAutoDescription; + null !== $awsAutoTagging && $obj['awsAutoTagging'] = $awsAutoTagging; + null !== $googleAutoTagging && $obj['googleAutoTagging'] = $googleAutoTagging; + null !== $removeBg && $obj['removeBg'] = $removeBg; return $obj; } @@ -87,7 +87,7 @@ public function withAIAutoDescription( AIAutoDescription|string $aiAutoDescription ): self { $obj = clone $this; - $obj['ai_auto_description'] = $aiAutoDescription; + $obj['aiAutoDescription'] = $aiAutoDescription; return $obj; } @@ -99,7 +99,7 @@ public function withAwsAutoTagging( AwsAutoTagging|string $awsAutoTagging ): self { $obj = clone $this; - $obj['aws_auto_tagging'] = $awsAutoTagging; + $obj['awsAutoTagging'] = $awsAutoTagging; return $obj; } @@ -111,7 +111,7 @@ public function withGoogleAutoTagging( GoogleAutoTagging|string $googleAutoTagging ): self { $obj = clone $this; - $obj['google_auto_tagging'] = $googleAutoTagging; + $obj['googleAutoTagging'] = $googleAutoTagging; return $obj; } @@ -122,7 +122,7 @@ public function withGoogleAutoTagging( public function withRemoveBg(RemoveBg|string $removeBg): self { $obj = clone $this; - $obj['remove_bg'] = $removeBg; + $obj['removeBg'] = $removeBg; return $obj; } diff --git a/src/Cache/Invalidation/InvalidationNewResponse.php b/src/Cache/Invalidation/InvalidationNewResponse.php index 710165fe..d95c7b32 100644 --- a/src/Cache/Invalidation/InvalidationNewResponse.php +++ b/src/Cache/Invalidation/InvalidationNewResponse.php @@ -9,7 +9,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type InvalidationNewResponseShape = array{requestId?: string|null} + * @phpstan-type InvalidationNewResponseShape = array{requestID?: string|null} */ final class InvalidationNewResponse implements BaseModel { @@ -19,8 +19,8 @@ final class InvalidationNewResponse implements BaseModel /** * Unique identifier of the purge request. This can be used to check the status of the purge request. */ - #[Optional] - public ?string $requestId; + #[Optional('requestId')] + public ?string $requestID; public function __construct() { @@ -32,11 +32,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. */ - public static function with(?string $requestId = null): self + public static function with(?string $requestID = null): self { $obj = new self; - null !== $requestId && $obj['requestId'] = $requestId; + null !== $requestID && $obj['requestID'] = $requestID; return $obj; } @@ -47,7 +47,7 @@ public static function with(?string $requestId = null): self public function withRequestID(string $requestID): self { $obj = clone $this; - $obj['requestId'] = $requestID; + $obj['requestID'] = $requestID; return $obj; } diff --git a/src/Core/Conversion.php b/src/Core/Conversion.php index b0fed584..822c71bd 100644 --- a/src/Core/Conversion.php +++ b/src/Core/Conversion.php @@ -25,6 +25,10 @@ public static function dump_unknown(mixed $value, DumpState $state): mixed return $value::converter()->dump($value, state: $state); } + if (is_a($value, class: \BackedEnum::class)) { + return $value->value; + } + if (is_a($value, class: \DateTimeInterface::class)) { return $value->format(format: \DateTimeInterface::RFC3339); } @@ -57,6 +61,26 @@ public static function coerce(Converter|ConverterSource|string $target, mixed $v return $target->coerce($value, state: $state); } + return self::tryConvert($target, value: $value, state: $state); + } + + public static function dump(Converter|ConverterSource|string $target, mixed $value, DumpState $state = new DumpState): mixed + { + if ($target instanceof Converter) { + return $target->dump($value, state: $state); + } + + if (is_a($target, class: ConverterSource::class, allow_string: true)) { + return $target::converter()->dump($value, state: $state); + } + + self::tryConvert($target, value: $value, state: $state); + + return self::dump_unknown($value, state: $state); + } + + private static function tryConvert(Converter|ConverterSource|string $target, mixed $value, CoerceState|DumpState $state): mixed + { switch ($target) { case 'mixed': ++$state->yes; @@ -152,17 +176,4 @@ public static function coerce(Converter|ConverterSource|string $target, mixed $v return $value; } } - - public static function dump(Converter|ConverterSource|string $target, mixed $value, DumpState $state = new DumpState): mixed - { - if ($target instanceof Converter) { - return $target->dump($value, state: $state); - } - - if (is_a($target, class: ConverterSource::class, allow_string: true)) { - return $target::converter()->dump($value, state: $state); - } - - return self::dump_unknown($value, state: $state); - } } diff --git a/src/Core/Conversion/Concerns/ArrayOf.php b/src/Core/Conversion/Concerns/ArrayOf.php index 38bd36ac..5b0e9c67 100644 --- a/src/Core/Conversion/Concerns/ArrayOf.php +++ b/src/Core/Conversion/Concerns/ArrayOf.php @@ -32,10 +32,11 @@ public function coerce(mixed $value, CoerceState $state): mixed if (!is_array($value)) { return $value; } + ++$state->yes; $acc = []; foreach ($value as $k => $v) { - if ($this->nullable && null === $v) { + if ($this->nullable && is_null($v)) { ++$state->yes; $acc[$k] = null; } else { @@ -51,15 +52,27 @@ public function dump(mixed $value, DumpState $state): mixed if (!is_array($value)) { return Conversion::dump_unknown($value, state: $state); } + ++$state->yes; if (empty($value)) { return $this->empty(); } - return array_map(fn ($v) => Conversion::dump($this->type, value: $v, state: $state), array: $value); + $acc = []; + foreach ($value as $k => $v) { + if ($this->nullable && is_null($v)) { + ++$state->yes; + $acc[$k] = null; + } else { + $acc[$k] = Conversion::dump($this->type, value: $v, state: $state); + } + } + + return $acc; } - private function empty(): array|object // @phpstan-ignore-line + // @phpstan-ignore-next-line missingType.iterableValue + private function empty(): array|object { return (object) []; } diff --git a/src/Core/Conversion/DumpState.php b/src/Core/Conversion/DumpState.php index c282c940..904887f2 100644 --- a/src/Core/Conversion/DumpState.php +++ b/src/Core/Conversion/DumpState.php @@ -10,6 +10,11 @@ final class DumpState { public function __construct( + public bool $translateNames = true, + public int $yes = 0, + public int $no = 0, + public int $maybe = 0, + public int $branched = 0, public bool $canRetry = true ) {} } diff --git a/src/Core/Conversion/EnumOf.php b/src/Core/Conversion/EnumOf.php index e1e93269..7a22876d 100644 --- a/src/Core/Conversion/EnumOf.php +++ b/src/Core/Conversion/EnumOf.php @@ -28,19 +28,26 @@ public function __construct(private readonly array $members) public function coerce(mixed $value, CoerceState $state): mixed { - if (in_array($value, haystack: $this->members, strict: true)) { - ++$state->yes; - } elseif ($this->type === gettype($value)) { - ++$state->maybe; - } else { - ++$state->no; - } + $this->tally($value, state: $state); return $value; } public function dump(mixed $value, DumpState $state): mixed { + $this->tally($value, state: $state); + return Conversion::dump_unknown($value, state: $state); } + + private function tally(mixed $value, CoerceState|DumpState $state): void + { + if (in_array($value, haystack: $this->members, strict: true)) { + ++$state->yes; + } elseif ($this->type === gettype($value)) { + ++$state->maybe; + } else { + ++$state->no; + } + } } diff --git a/src/Core/Conversion/ModelOf.php b/src/Core/Conversion/ModelOf.php index 8448d93b..38dd2267 100644 --- a/src/Core/Conversion/ModelOf.php +++ b/src/Core/Conversion/ModelOf.php @@ -94,18 +94,6 @@ public function coerce(mixed $value, CoerceState $state): mixed return $this->from($acc); // @phpstan-ignore-line } - /** - * @param array $data - */ - public function from(array $data): BaseModel - { - $instance = $this->class->newInstanceWithoutConstructor(); - // @phpstan-ignore-next-line - $instance->__unserialize($data); - - return $instance; - } - public function dump(mixed $value, DumpState $state): mixed { if ($value instanceof BaseModel) { @@ -113,10 +101,12 @@ public function dump(mixed $value, DumpState $state): mixed } if (is_array($value)) { + ++$state->yes; $acc = []; foreach ($value as $name => $item) { if (array_key_exists($name, array: $this->properties)) { + ++$state->yes; $info = $this->properties[$name]; $acc[$info->apiName] = Conversion::dump($info->type, value: $item, state: $state); } else { @@ -124,9 +114,23 @@ public function dump(mixed $value, DumpState $state): mixed } } - return empty($acc) ? ((object) []) : $acc; + return empty($acc) ? ((object) $acc) : $acc; } + ++$state->no; + return Conversion::dump_unknown($value, state: $state); } + + /** + * @param array $data + */ + public function from(array $data): BaseModel + { + $instance = $this->class->newInstanceWithoutConstructor(); + // @phpstan-ignore-next-line + $instance->__unserialize($data); + + return $instance; + } } diff --git a/src/Core/Conversion/UnionOf.php b/src/Core/Conversion/UnionOf.php index 35880f67..d6709f35 100644 --- a/src/Core/Conversion/UnionOf.php +++ b/src/Core/Conversion/UnionOf.php @@ -65,17 +65,46 @@ public function coerce(mixed $value, CoerceState $state): mixed public function dump(mixed $value, DumpState $state): mixed { - if (null !== ($target = $this->resolveVariant(value: $value))) { + if (!is_null($target = $this->resolveVariant(value: $value))) { return Conversion::dump($target, value: $value, state: $state); } - foreach ($this->variants as $variant) { + $alternatives = []; + foreach ($this->variants as $_ => $variant) { + ++$state->branched; if ($value instanceof $variant) { return Conversion::dump($variant, value: $value, state: $state); } + + $newState = new DumpState; + $dumped = Conversion::dump($variant, value: $value, state: $newState); + if (($newState->no + $newState->maybe) === 0) { + $state->yes += $newState->yes; + + return $dumped; + } + if ($newState->maybe > 0) { + $alternatives[] = [[-$newState->yes, -$newState->maybe, $newState->no], $newState, $dumped]; + } } - return Conversion::dump_unknown($value, state: $state); + usort( + $alternatives, + static fn (array $a, array $b): int => $a[0][0] <=> $b[0][0] ?: $a[0][1] <=> $b[0][1] ?: $a[0][2] <=> $b[0][2] + ); + + if (empty($alternatives)) { + ++$state->no; + + return Conversion::dump_unknown($value, state: $state); + } + + [[,$newState, $best]] = $alternatives; + $state->yes += $newState->yes; + $state->maybe += $newState->maybe; + $state->no += $newState->no; + + return $best; } private function resolveVariant( diff --git a/src/ExtensionItem/RemoveBg.php b/src/ExtensionItem/RemoveBg.php index 9f4674e7..c7b8707f 100644 --- a/src/ExtensionItem/RemoveBg.php +++ b/src/ExtensionItem/RemoveBg.php @@ -40,9 +40,9 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Options|array{ - * add_shadow?: bool|null, - * bg_color?: string|null, - * bg_image_url?: string|null, + * addShadow?: bool|null, + * bgColor?: string|null, + * bgImageURL?: string|null, * semitransparency?: bool|null, * } $options */ @@ -57,9 +57,9 @@ public static function with(Options|array|null $options = null): self /** * @param Options|array{ - * add_shadow?: bool|null, - * bg_color?: string|null, - * bg_image_url?: string|null, + * addShadow?: bool|null, + * bgColor?: string|null, + * bgImageURL?: string|null, * semitransparency?: bool|null, * } $options */ diff --git a/src/ExtensionItem/RemoveBg/Options.php b/src/ExtensionItem/RemoveBg/Options.php index 7be2611d..520e637f 100644 --- a/src/ExtensionItem/RemoveBg/Options.php +++ b/src/ExtensionItem/RemoveBg/Options.php @@ -10,9 +10,9 @@ /** * @phpstan-type OptionsShape = array{ - * add_shadow?: bool|null, - * bg_color?: string|null, - * bg_image_url?: string|null, + * addShadow?: bool|null, + * bgColor?: string|null, + * bgImageURL?: string|null, * semitransparency?: bool|null, * } */ @@ -24,20 +24,20 @@ final class Options implements BaseModel /** * Whether to add an artificial shadow to the result. Default is false. Note: Adding shadows is currently only supported for car photos. */ - #[Optional] - public ?bool $add_shadow; + #[Optional('add_shadow')] + public ?bool $addShadow; /** * Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or color name (e.g., "green"). If this parameter is set, `bg_image_url` must be empty. */ - #[Optional] - public ?string $bg_color; + #[Optional('bg_color')] + public ?string $bgColor; /** * Sets a background image from a URL. If this parameter is set, `bg_color` must be empty. */ - #[Optional] - public ?string $bg_image_url; + #[Optional('bg_image_url')] + public ?string $bgImageURL; /** * Allows semi-transparent regions in the result. Default is true. Note: Semitransparency is currently only supported for car windows. @@ -56,16 +56,16 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - ?bool $add_shadow = null, - ?string $bg_color = null, - ?string $bg_image_url = null, + ?bool $addShadow = null, + ?string $bgColor = null, + ?string $bgImageURL = null, ?bool $semitransparency = null, ): self { $obj = new self; - null !== $add_shadow && $obj['add_shadow'] = $add_shadow; - null !== $bg_color && $obj['bg_color'] = $bg_color; - null !== $bg_image_url && $obj['bg_image_url'] = $bg_image_url; + null !== $addShadow && $obj['addShadow'] = $addShadow; + null !== $bgColor && $obj['bgColor'] = $bgColor; + null !== $bgImageURL && $obj['bgImageURL'] = $bgImageURL; null !== $semitransparency && $obj['semitransparency'] = $semitransparency; return $obj; @@ -77,7 +77,7 @@ public static function with( public function withAddShadow(bool $addShadow): self { $obj = clone $this; - $obj['add_shadow'] = $addShadow; + $obj['addShadow'] = $addShadow; return $obj; } @@ -88,7 +88,7 @@ public function withAddShadow(bool $addShadow): self public function withBgColor(string $bgColor): self { $obj = clone $this; - $obj['bg_color'] = $bgColor; + $obj['bgColor'] = $bgColor; return $obj; } @@ -99,7 +99,7 @@ public function withBgColor(string $bgColor): self public function withBgImageURL(string $bgImageURL): self { $obj = clone $this; - $obj['bg_image_url'] = $bgImageURL; + $obj['bgImageURL'] = $bgImageURL; return $obj; } diff --git a/src/Files/Bulk/BulkAddTagsParams.php b/src/Files/Bulk/BulkAddTagsParams.php index a1ef1115..472be0f6 100644 --- a/src/Files/Bulk/BulkAddTagsParams.php +++ b/src/Files/Bulk/BulkAddTagsParams.php @@ -15,7 +15,7 @@ * @see Imagekit\Services\Files\BulkService::addTags() * * @phpstan-type BulkAddTagsParamsShape = array{ - * fileIds: list, tags: list + * fileIDs: list, tags: list * } */ final class BulkAddTagsParams implements BaseModel @@ -27,10 +27,10 @@ final class BulkAddTagsParams implements BaseModel /** * An array of fileIds to which you want to add tags. * - * @var list $fileIds + * @var list $fileIDs */ - #[Required(list: 'string')] - public array $fileIds; + #[Required('fileIds', list: 'string')] + public array $fileIDs; /** * An array of tags that you want to add to the files. @@ -45,7 +45,7 @@ final class BulkAddTagsParams implements BaseModel * * To enforce required parameters use * ``` - * BulkAddTagsParams::with(fileIds: ..., tags: ...) + * BulkAddTagsParams::with(fileIDs: ..., tags: ...) * ``` * * Otherwise ensure the following setters are called @@ -64,14 +64,14 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $fileIds + * @param list $fileIDs * @param list $tags */ - public static function with(array $fileIds, array $tags): self + public static function with(array $fileIDs, array $tags): self { $obj = new self; - $obj['fileIds'] = $fileIds; + $obj['fileIDs'] = $fileIDs; $obj['tags'] = $tags; return $obj; @@ -85,7 +85,7 @@ public static function with(array $fileIds, array $tags): self public function withFileIDs(array $fileIDs): self { $obj = clone $this; - $obj['fileIds'] = $fileIDs; + $obj['fileIDs'] = $fileIDs; return $obj; } diff --git a/src/Files/Bulk/BulkAddTagsResponse.php b/src/Files/Bulk/BulkAddTagsResponse.php index 59511a48..9a1b478e 100644 --- a/src/Files/Bulk/BulkAddTagsResponse.php +++ b/src/Files/Bulk/BulkAddTagsResponse.php @@ -10,7 +10,7 @@ /** * @phpstan-type BulkAddTagsResponseShape = array{ - * successfullyUpdatedFileIds?: list|null + * successfullyUpdatedFileIDs?: list|null * } */ final class BulkAddTagsResponse implements BaseModel @@ -21,10 +21,10 @@ final class BulkAddTagsResponse implements BaseModel /** * An array of fileIds that in which tags were successfully added. * - * @var list|null $successfullyUpdatedFileIds + * @var list|null $successfullyUpdatedFileIDs */ - #[Optional(list: 'string')] - public ?array $successfullyUpdatedFileIds; + #[Optional('successfullyUpdatedFileIds', list: 'string')] + public ?array $successfullyUpdatedFileIDs; public function __construct() { @@ -36,13 +36,13 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $successfullyUpdatedFileIds + * @param list $successfullyUpdatedFileIDs */ - public static function with(?array $successfullyUpdatedFileIds = null): self + public static function with(?array $successfullyUpdatedFileIDs = null): self { $obj = new self; - null !== $successfullyUpdatedFileIds && $obj['successfullyUpdatedFileIds'] = $successfullyUpdatedFileIds; + null !== $successfullyUpdatedFileIDs && $obj['successfullyUpdatedFileIDs'] = $successfullyUpdatedFileIDs; return $obj; } @@ -56,7 +56,7 @@ public function withSuccessfullyUpdatedFileIDs( array $successfullyUpdatedFileIDs ): self { $obj = clone $this; - $obj['successfullyUpdatedFileIds'] = $successfullyUpdatedFileIDs; + $obj['successfullyUpdatedFileIDs'] = $successfullyUpdatedFileIDs; return $obj; } diff --git a/src/Files/Bulk/BulkDeleteParams.php b/src/Files/Bulk/BulkDeleteParams.php index 535ca4c0..4d4fc8c4 100644 --- a/src/Files/Bulk/BulkDeleteParams.php +++ b/src/Files/Bulk/BulkDeleteParams.php @@ -18,7 +18,7 @@ * * @see Imagekit\Services\Files\BulkService::delete() * - * @phpstan-type BulkDeleteParamsShape = array{fileIds: list} + * @phpstan-type BulkDeleteParamsShape = array{fileIDs: list} */ final class BulkDeleteParams implements BaseModel { @@ -29,17 +29,17 @@ final class BulkDeleteParams implements BaseModel /** * An array of fileIds which you want to delete. * - * @var list $fileIds + * @var list $fileIDs */ - #[Required(list: 'string')] - public array $fileIds; + #[Required('fileIds', list: 'string')] + public array $fileIDs; /** * `new BulkDeleteParams()` is missing required properties by the API. * * To enforce required parameters use * ``` - * BulkDeleteParams::with(fileIds: ...) + * BulkDeleteParams::with(fileIDs: ...) * ``` * * Otherwise ensure the following setters are called @@ -58,13 +58,13 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $fileIds + * @param list $fileIDs */ - public static function with(array $fileIds): self + public static function with(array $fileIDs): self { $obj = new self; - $obj['fileIds'] = $fileIds; + $obj['fileIDs'] = $fileIDs; return $obj; } @@ -77,7 +77,7 @@ public static function with(array $fileIds): self public function withFileIDs(array $fileIDs): self { $obj = clone $this; - $obj['fileIds'] = $fileIDs; + $obj['fileIDs'] = $fileIDs; return $obj; } diff --git a/src/Files/Bulk/BulkDeleteResponse.php b/src/Files/Bulk/BulkDeleteResponse.php index db776972..c543fa95 100644 --- a/src/Files/Bulk/BulkDeleteResponse.php +++ b/src/Files/Bulk/BulkDeleteResponse.php @@ -10,7 +10,7 @@ /** * @phpstan-type BulkDeleteResponseShape = array{ - * successfullyDeletedFileIds?: list|null + * successfullyDeletedFileIDs?: list|null * } */ final class BulkDeleteResponse implements BaseModel @@ -21,10 +21,10 @@ final class BulkDeleteResponse implements BaseModel /** * An array of fileIds that were successfully deleted. * - * @var list|null $successfullyDeletedFileIds + * @var list|null $successfullyDeletedFileIDs */ - #[Optional(list: 'string')] - public ?array $successfullyDeletedFileIds; + #[Optional('successfullyDeletedFileIds', list: 'string')] + public ?array $successfullyDeletedFileIDs; public function __construct() { @@ -36,13 +36,13 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $successfullyDeletedFileIds + * @param list $successfullyDeletedFileIDs */ - public static function with(?array $successfullyDeletedFileIds = null): self + public static function with(?array $successfullyDeletedFileIDs = null): self { $obj = new self; - null !== $successfullyDeletedFileIds && $obj['successfullyDeletedFileIds'] = $successfullyDeletedFileIds; + null !== $successfullyDeletedFileIDs && $obj['successfullyDeletedFileIDs'] = $successfullyDeletedFileIDs; return $obj; } @@ -56,7 +56,7 @@ public function withSuccessfullyDeletedFileIDs( array $successfullyDeletedFileIDs ): self { $obj = clone $this; - $obj['successfullyDeletedFileIds'] = $successfullyDeletedFileIDs; + $obj['successfullyDeletedFileIDs'] = $successfullyDeletedFileIDs; return $obj; } diff --git a/src/Files/Bulk/BulkRemoveAITagsParams.php b/src/Files/Bulk/BulkRemoveAITagsParams.php index 53be90a7..5441eca6 100644 --- a/src/Files/Bulk/BulkRemoveAITagsParams.php +++ b/src/Files/Bulk/BulkRemoveAITagsParams.php @@ -15,7 +15,7 @@ * @see Imagekit\Services\Files\BulkService::removeAITags() * * @phpstan-type BulkRemoveAITagsParamsShape = array{ - * AITags: list, fileIds: list + * aiTags: list, fileIDs: list * } */ final class BulkRemoveAITagsParams implements BaseModel @@ -27,25 +27,25 @@ final class BulkRemoveAITagsParams implements BaseModel /** * An array of AITags that you want to remove from the files. * - * @var list $AITags + * @var list $aiTags */ - #[Required(list: 'string')] - public array $AITags; + #[Required('AITags', list: 'string')] + public array $aiTags; /** * An array of fileIds from which you want to remove AITags. * - * @var list $fileIds + * @var list $fileIDs */ - #[Required(list: 'string')] - public array $fileIds; + #[Required('fileIds', list: 'string')] + public array $fileIDs; /** * `new BulkRemoveAITagsParams()` is missing required properties by the API. * * To enforce required parameters use * ``` - * BulkRemoveAITagsParams::with(AITags: ..., fileIds: ...) + * BulkRemoveAITagsParams::with(aiTags: ..., fileIDs: ...) * ``` * * Otherwise ensure the following setters are called @@ -64,15 +64,15 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $AITags - * @param list $fileIds + * @param list $aiTags + * @param list $fileIDs */ - public static function with(array $AITags, array $fileIds): self + public static function with(array $aiTags, array $fileIDs): self { $obj = new self; - $obj['AITags'] = $AITags; - $obj['fileIds'] = $fileIds; + $obj['aiTags'] = $aiTags; + $obj['fileIDs'] = $fileIDs; return $obj; } @@ -85,7 +85,7 @@ public static function with(array $AITags, array $fileIds): self public function withAITags(array $aiTags): self { $obj = clone $this; - $obj['AITags'] = $aiTags; + $obj['aiTags'] = $aiTags; return $obj; } @@ -98,7 +98,7 @@ public function withAITags(array $aiTags): self public function withFileIDs(array $fileIDs): self { $obj = clone $this; - $obj['fileIds'] = $fileIDs; + $obj['fileIDs'] = $fileIDs; return $obj; } diff --git a/src/Files/Bulk/BulkRemoveAITagsResponse.php b/src/Files/Bulk/BulkRemoveAITagsResponse.php index a0b8f928..fc80d45b 100644 --- a/src/Files/Bulk/BulkRemoveAITagsResponse.php +++ b/src/Files/Bulk/BulkRemoveAITagsResponse.php @@ -10,7 +10,7 @@ /** * @phpstan-type BulkRemoveAITagsResponseShape = array{ - * successfullyUpdatedFileIds?: list|null + * successfullyUpdatedFileIDs?: list|null * } */ final class BulkRemoveAITagsResponse implements BaseModel @@ -21,10 +21,10 @@ final class BulkRemoveAITagsResponse implements BaseModel /** * An array of fileIds that in which AITags were successfully removed. * - * @var list|null $successfullyUpdatedFileIds + * @var list|null $successfullyUpdatedFileIDs */ - #[Optional(list: 'string')] - public ?array $successfullyUpdatedFileIds; + #[Optional('successfullyUpdatedFileIds', list: 'string')] + public ?array $successfullyUpdatedFileIDs; public function __construct() { @@ -36,13 +36,13 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $successfullyUpdatedFileIds + * @param list $successfullyUpdatedFileIDs */ - public static function with(?array $successfullyUpdatedFileIds = null): self + public static function with(?array $successfullyUpdatedFileIDs = null): self { $obj = new self; - null !== $successfullyUpdatedFileIds && $obj['successfullyUpdatedFileIds'] = $successfullyUpdatedFileIds; + null !== $successfullyUpdatedFileIDs && $obj['successfullyUpdatedFileIDs'] = $successfullyUpdatedFileIDs; return $obj; } @@ -56,7 +56,7 @@ public function withSuccessfullyUpdatedFileIDs( array $successfullyUpdatedFileIDs ): self { $obj = clone $this; - $obj['successfullyUpdatedFileIds'] = $successfullyUpdatedFileIDs; + $obj['successfullyUpdatedFileIDs'] = $successfullyUpdatedFileIDs; return $obj; } diff --git a/src/Files/Bulk/BulkRemoveTagsParams.php b/src/Files/Bulk/BulkRemoveTagsParams.php index 70f01316..0cc941df 100644 --- a/src/Files/Bulk/BulkRemoveTagsParams.php +++ b/src/Files/Bulk/BulkRemoveTagsParams.php @@ -15,7 +15,7 @@ * @see Imagekit\Services\Files\BulkService::removeTags() * * @phpstan-type BulkRemoveTagsParamsShape = array{ - * fileIds: list, tags: list + * fileIDs: list, tags: list * } */ final class BulkRemoveTagsParams implements BaseModel @@ -27,10 +27,10 @@ final class BulkRemoveTagsParams implements BaseModel /** * An array of fileIds from which you want to remove tags. * - * @var list $fileIds + * @var list $fileIDs */ - #[Required(list: 'string')] - public array $fileIds; + #[Required('fileIds', list: 'string')] + public array $fileIDs; /** * An array of tags that you want to remove from the files. @@ -45,7 +45,7 @@ final class BulkRemoveTagsParams implements BaseModel * * To enforce required parameters use * ``` - * BulkRemoveTagsParams::with(fileIds: ..., tags: ...) + * BulkRemoveTagsParams::with(fileIDs: ..., tags: ...) * ``` * * Otherwise ensure the following setters are called @@ -64,14 +64,14 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $fileIds + * @param list $fileIDs * @param list $tags */ - public static function with(array $fileIds, array $tags): self + public static function with(array $fileIDs, array $tags): self { $obj = new self; - $obj['fileIds'] = $fileIds; + $obj['fileIDs'] = $fileIDs; $obj['tags'] = $tags; return $obj; @@ -85,7 +85,7 @@ public static function with(array $fileIds, array $tags): self public function withFileIDs(array $fileIDs): self { $obj = clone $this; - $obj['fileIds'] = $fileIDs; + $obj['fileIDs'] = $fileIDs; return $obj; } diff --git a/src/Files/Bulk/BulkRemoveTagsResponse.php b/src/Files/Bulk/BulkRemoveTagsResponse.php index a24f1079..6722d771 100644 --- a/src/Files/Bulk/BulkRemoveTagsResponse.php +++ b/src/Files/Bulk/BulkRemoveTagsResponse.php @@ -10,7 +10,7 @@ /** * @phpstan-type BulkRemoveTagsResponseShape = array{ - * successfullyUpdatedFileIds?: list|null + * successfullyUpdatedFileIDs?: list|null * } */ final class BulkRemoveTagsResponse implements BaseModel @@ -21,10 +21,10 @@ final class BulkRemoveTagsResponse implements BaseModel /** * An array of fileIds that in which tags were successfully removed. * - * @var list|null $successfullyUpdatedFileIds + * @var list|null $successfullyUpdatedFileIDs */ - #[Optional(list: 'string')] - public ?array $successfullyUpdatedFileIds; + #[Optional('successfullyUpdatedFileIds', list: 'string')] + public ?array $successfullyUpdatedFileIDs; public function __construct() { @@ -36,13 +36,13 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $successfullyUpdatedFileIds + * @param list $successfullyUpdatedFileIDs */ - public static function with(?array $successfullyUpdatedFileIds = null): self + public static function with(?array $successfullyUpdatedFileIDs = null): self { $obj = new self; - null !== $successfullyUpdatedFileIds && $obj['successfullyUpdatedFileIds'] = $successfullyUpdatedFileIds; + null !== $successfullyUpdatedFileIDs && $obj['successfullyUpdatedFileIDs'] = $successfullyUpdatedFileIDs; return $obj; } @@ -56,7 +56,7 @@ public function withSuccessfullyUpdatedFileIDs( array $successfullyUpdatedFileIDs ): self { $obj = clone $this; - $obj['successfullyUpdatedFileIds'] = $successfullyUpdatedFileIDs; + $obj['successfullyUpdatedFileIDs'] = $successfullyUpdatedFileIDs; return $obj; } diff --git a/src/Files/File.php b/src/Files/File.php index 11893e3c..f908867b 100644 --- a/src/Files/File.php +++ b/src/Files/File.php @@ -16,12 +16,12 @@ * Object containing details of a file or file version. * * @phpstan-type FileShape = array{ - * AITags?: list|null, + * aiTags?: list|null, * createdAt?: \DateTimeInterface|null, * customCoordinates?: string|null, * customMetadata?: array|null, * description?: string|null, - * fileId?: string|null, + * fileID?: string|null, * filePath?: string|null, * fileType?: string|null, * hasAlpha?: bool|null, @@ -49,10 +49,10 @@ final class File implements BaseModel /** * An array of tags assigned to the file by auto tagging. * - * @var list|null $AITags + * @var list|null $aiTags */ - #[Optional(list: AITag::class, nullable: true)] - public ?array $AITags; + #[Optional('AITags', list: AITag::class, nullable: true)] + public ?array $aiTags; /** * Date and time when the file was uploaded. The date and time is in ISO8601 format. @@ -83,8 +83,8 @@ final class File implements BaseModel /** * Unique identifier of the asset. */ - #[Optional] - public ?string $fileId; + #[Optional('fileId')] + public ?string $fileID; /** * Path of the file. This is the path you would use in the URL to access the file. For example, if the file is at the root of the media library, the path will be `/file.jpg`. If the file is inside a folder named `images`, the path will be `/images/file.jpg`. @@ -210,7 +210,7 @@ public function __construct() * * @param list|null $AITags + * }>|null $aiTags * @param array $customMetadata * @param array, @@ -229,12 +229,12 @@ public function __construct() * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo */ public static function with( - ?array $AITags = null, + ?array $aiTags = null, ?\DateTimeInterface $createdAt = null, ?string $customCoordinates = null, ?array $customMetadata = null, ?string $description = null, - ?string $fileId = null, + ?string $fileID = null, ?string $filePath = null, ?string $fileType = null, ?bool $hasAlpha = null, @@ -255,12 +255,12 @@ public static function with( ): self { $obj = new self; - null !== $AITags && $obj['AITags'] = $AITags; + null !== $aiTags && $obj['aiTags'] = $aiTags; null !== $createdAt && $obj['createdAt'] = $createdAt; null !== $customCoordinates && $obj['customCoordinates'] = $customCoordinates; null !== $customMetadata && $obj['customMetadata'] = $customMetadata; null !== $description && $obj['description'] = $description; - null !== $fileId && $obj['fileId'] = $fileId; + null !== $fileID && $obj['fileID'] = $fileID; null !== $filePath && $obj['filePath'] = $filePath; null !== $fileType && $obj['fileType'] = $fileType; null !== $hasAlpha && $obj['hasAlpha'] = $hasAlpha; @@ -292,7 +292,7 @@ public static function with( public function withAITags(?array $aiTags): self { $obj = clone $this; - $obj['AITags'] = $aiTags; + $obj['aiTags'] = $aiTags; return $obj; } @@ -349,7 +349,7 @@ public function withDescription(string $description): self public function withFileID(string $fileID): self { $obj = clone $this; - $obj['fileId'] = $fileID; + $obj['fileID'] = $fileID; return $obj; } diff --git a/src/Files/FileRenameResponse.php b/src/Files/FileRenameResponse.php index 41713ba2..28ed10e9 100644 --- a/src/Files/FileRenameResponse.php +++ b/src/Files/FileRenameResponse.php @@ -9,7 +9,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type FileRenameResponseShape = array{purgeRequestId?: string|null} + * @phpstan-type FileRenameResponseShape = array{purgeRequestID?: string|null} */ final class FileRenameResponse implements BaseModel { @@ -19,8 +19,8 @@ final class FileRenameResponse implements BaseModel /** * Unique identifier of the purge request. This can be used to check the status of the purge request. */ - #[Optional] - public ?string $purgeRequestId; + #[Optional('purgeRequestId')] + public ?string $purgeRequestID; public function __construct() { @@ -32,11 +32,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. */ - public static function with(?string $purgeRequestId = null): self + public static function with(?string $purgeRequestID = null): self { $obj = new self; - null !== $purgeRequestId && $obj['purgeRequestId'] = $purgeRequestId; + null !== $purgeRequestID && $obj['purgeRequestID'] = $purgeRequestID; return $obj; } @@ -47,7 +47,7 @@ public static function with(?string $purgeRequestId = null): self public function withPurgeRequestID(string $purgeRequestID): self { $obj = clone $this; - $obj['purgeRequestId'] = $purgeRequestID; + $obj['purgeRequestID'] = $purgeRequestID; return $obj; } diff --git a/src/Files/FileUpdateParams.php b/src/Files/FileUpdateParams.php index 4ccea12e..997ac9d9 100644 --- a/src/Files/FileUpdateParams.php +++ b/src/Files/FileUpdateParams.php @@ -33,7 +33,7 @@ * }|AIAutoDescription|array{name?: 'ai-auto-description'}>, * removeAITags?: 'all'|list, * tags?: list|null, - * webhookUrl?: string, + * webhookURL?: string, * publish?: Publish|array{isPublished: bool, includeFileVersions?: bool|null}, * } */ @@ -94,8 +94,8 @@ final class FileUpdateParams implements BaseModel /** * The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. */ - #[Optional] - public ?string $webhookUrl; + #[Optional('webhookUrl')] + public ?string $webhookURL; /** * Configure the publication status of a file and its versions. @@ -132,7 +132,7 @@ public static function with( ?array $extensions = null, string|array|null $removeAITags = null, ?array $tags = null, - ?string $webhookUrl = null, + ?string $webhookURL = null, Publish|array|null $publish = null, ): self { $obj = new self; @@ -143,7 +143,7 @@ public static function with( null !== $extensions && $obj['extensions'] = $extensions; null !== $removeAITags && $obj['removeAITags'] = $removeAITags; null !== $tags && $obj['tags'] = $tags; - null !== $webhookUrl && $obj['webhookUrl'] = $webhookUrl; + null !== $webhookURL && $obj['webhookURL'] = $webhookURL; null !== $publish && $obj['publish'] = $publish; return $obj; @@ -237,7 +237,7 @@ public function withTags(?array $tags): self public function withWebhookURL(string $webhookURL): self { $obj = clone $this; - $obj['webhookUrl'] = $webhookURL; + $obj['webhookURL'] = $webhookURL; return $obj; } diff --git a/src/Files/FileUpdateResponse.php b/src/Files/FileUpdateResponse.php index a6b54e81..98535459 100644 --- a/src/Files/FileUpdateResponse.php +++ b/src/Files/FileUpdateResponse.php @@ -21,12 +21,12 @@ * Object containing details of a file or file version. * * @phpstan-type FileUpdateResponseShape = array{ - * AITags?: list|null, + * aiTags?: list|null, * createdAt?: \DateTimeInterface|null, * customCoordinates?: string|null, * customMetadata?: array|null, * description?: string|null, - * fileId?: string|null, + * fileID?: string|null, * filePath?: string|null, * fileType?: string|null, * hasAlpha?: bool|null, @@ -55,10 +55,10 @@ final class FileUpdateResponse implements BaseModel /** * An array of tags assigned to the file by auto tagging. * - * @var list|null $AITags + * @var list|null $aiTags */ - #[Optional(list: AITag::class, nullable: true)] - public ?array $AITags; + #[Optional('AITags', list: AITag::class, nullable: true)] + public ?array $aiTags; /** * Date and time when the file was uploaded. The date and time is in ISO8601 format. @@ -89,8 +89,8 @@ final class FileUpdateResponse implements BaseModel /** * Unique identifier of the asset. */ - #[Optional] - public ?string $fileId; + #[Optional('fileId')] + public ?string $fileID; /** * Path of the file. This is the path you would use in the URL to access the file. For example, if the file is at the root of the media library, the path will be `/file.jpg`. If the file is inside a folder named `images`, the path will be `/images/file.jpg`. @@ -219,7 +219,7 @@ public function __construct() * * @param list|null $AITags + * }>|null $aiTags * @param array $customMetadata * @param array, @@ -237,19 +237,19 @@ public function __construct() * @param Type|value-of $type * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo * @param ExtensionStatus|array{ - * ai_auto_description?: value-of|null, - * aws_auto_tagging?: value-of|null, - * google_auto_tagging?: value-of|null, - * remove_bg?: value-of|null, + * aiAutoDescription?: value-of|null, + * awsAutoTagging?: value-of|null, + * googleAutoTagging?: value-of|null, + * removeBg?: value-of|null, * } $extensionStatus */ public static function with( - ?array $AITags = null, + ?array $aiTags = null, ?\DateTimeInterface $createdAt = null, ?string $customCoordinates = null, ?array $customMetadata = null, ?string $description = null, - ?string $fileId = null, + ?string $fileID = null, ?string $filePath = null, ?string $fileType = null, ?bool $hasAlpha = null, @@ -271,12 +271,12 @@ public static function with( ): self { $obj = new self; - null !== $AITags && $obj['AITags'] = $AITags; + null !== $aiTags && $obj['aiTags'] = $aiTags; null !== $createdAt && $obj['createdAt'] = $createdAt; null !== $customCoordinates && $obj['customCoordinates'] = $customCoordinates; null !== $customMetadata && $obj['customMetadata'] = $customMetadata; null !== $description && $obj['description'] = $description; - null !== $fileId && $obj['fileId'] = $fileId; + null !== $fileID && $obj['fileID'] = $fileID; null !== $filePath && $obj['filePath'] = $filePath; null !== $fileType && $obj['fileType'] = $fileType; null !== $hasAlpha && $obj['hasAlpha'] = $hasAlpha; @@ -309,7 +309,7 @@ public static function with( public function withAITags(?array $aiTags): self { $obj = clone $this; - $obj['AITags'] = $aiTags; + $obj['aiTags'] = $aiTags; return $obj; } @@ -366,7 +366,7 @@ public function withDescription(string $description): self public function withFileID(string $fileID): self { $obj = clone $this; - $obj['fileId'] = $fileID; + $obj['fileID'] = $fileID; return $obj; } @@ -583,10 +583,10 @@ public function withWidth(float $width): self /** * @param ExtensionStatus|array{ - * ai_auto_description?: value-of|null, - * aws_auto_tagging?: value-of|null, - * google_auto_tagging?: value-of|null, - * remove_bg?: value-of|null, + * aiAutoDescription?: value-of|null, + * awsAutoTagging?: value-of|null, + * googleAutoTagging?: value-of|null, + * removeBg?: value-of|null, * } $extensionStatus */ public function withExtensionStatus( diff --git a/src/Files/FileUpdateResponse/ExtensionStatus.php b/src/Files/FileUpdateResponse/ExtensionStatus.php index 29aeb53b..7fcced98 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus.php @@ -14,10 +14,10 @@ /** * @phpstan-type ExtensionStatusShape = array{ - * ai_auto_description?: value-of|null, - * aws_auto_tagging?: value-of|null, - * google_auto_tagging?: value-of|null, - * remove_bg?: value-of|null, + * aiAutoDescription?: value-of|null, + * awsAutoTagging?: value-of|null, + * googleAutoTagging?: value-of|null, + * removeBg?: value-of|null, * } */ final class ExtensionStatus implements BaseModel @@ -25,21 +25,21 @@ final class ExtensionStatus implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var value-of|null $ai_auto_description */ + /** @var value-of|null $aiAutoDescription */ #[Optional('ai-auto-description', enum: AIAutoDescription::class)] - public ?string $ai_auto_description; + public ?string $aiAutoDescription; - /** @var value-of|null $aws_auto_tagging */ + /** @var value-of|null $awsAutoTagging */ #[Optional('aws-auto-tagging', enum: AwsAutoTagging::class)] - public ?string $aws_auto_tagging; + public ?string $awsAutoTagging; - /** @var value-of|null $google_auto_tagging */ + /** @var value-of|null $googleAutoTagging */ #[Optional('google-auto-tagging', enum: GoogleAutoTagging::class)] - public ?string $google_auto_tagging; + public ?string $googleAutoTagging; - /** @var value-of|null $remove_bg */ + /** @var value-of|null $removeBg */ #[Optional('remove-bg', enum: RemoveBg::class)] - public ?string $remove_bg; + public ?string $removeBg; public function __construct() { @@ -51,23 +51,23 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AIAutoDescription|value-of $ai_auto_description - * @param AwsAutoTagging|value-of $aws_auto_tagging - * @param GoogleAutoTagging|value-of $google_auto_tagging - * @param RemoveBg|value-of $remove_bg + * @param AIAutoDescription|value-of $aiAutoDescription + * @param AwsAutoTagging|value-of $awsAutoTagging + * @param GoogleAutoTagging|value-of $googleAutoTagging + * @param RemoveBg|value-of $removeBg */ public static function with( - AIAutoDescription|string|null $ai_auto_description = null, - AwsAutoTagging|string|null $aws_auto_tagging = null, - GoogleAutoTagging|string|null $google_auto_tagging = null, - RemoveBg|string|null $remove_bg = null, + AIAutoDescription|string|null $aiAutoDescription = null, + AwsAutoTagging|string|null $awsAutoTagging = null, + GoogleAutoTagging|string|null $googleAutoTagging = null, + RemoveBg|string|null $removeBg = null, ): self { $obj = new self; - null !== $ai_auto_description && $obj['ai_auto_description'] = $ai_auto_description; - null !== $aws_auto_tagging && $obj['aws_auto_tagging'] = $aws_auto_tagging; - null !== $google_auto_tagging && $obj['google_auto_tagging'] = $google_auto_tagging; - null !== $remove_bg && $obj['remove_bg'] = $remove_bg; + null !== $aiAutoDescription && $obj['aiAutoDescription'] = $aiAutoDescription; + null !== $awsAutoTagging && $obj['awsAutoTagging'] = $awsAutoTagging; + null !== $googleAutoTagging && $obj['googleAutoTagging'] = $googleAutoTagging; + null !== $removeBg && $obj['removeBg'] = $removeBg; return $obj; } @@ -79,7 +79,7 @@ public function withAIAutoDescription( AIAutoDescription|string $aiAutoDescription ): self { $obj = clone $this; - $obj['ai_auto_description'] = $aiAutoDescription; + $obj['aiAutoDescription'] = $aiAutoDescription; return $obj; } @@ -91,7 +91,7 @@ public function withAwsAutoTagging( AwsAutoTagging|string $awsAutoTagging ): self { $obj = clone $this; - $obj['aws_auto_tagging'] = $awsAutoTagging; + $obj['awsAutoTagging'] = $awsAutoTagging; return $obj; } @@ -103,7 +103,7 @@ public function withGoogleAutoTagging( GoogleAutoTagging|string $googleAutoTagging ): self { $obj = clone $this; - $obj['google_auto_tagging'] = $googleAutoTagging; + $obj['googleAutoTagging'] = $googleAutoTagging; return $obj; } @@ -114,7 +114,7 @@ public function withGoogleAutoTagging( public function withRemoveBg(RemoveBg|string $removeBg): self { $obj = clone $this; - $obj['remove_bg'] = $removeBg; + $obj['removeBg'] = $removeBg; return $obj; } diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index 37c87ac1..bbe5c7f3 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -69,7 +69,7 @@ * pre?: string|null, * }, * useUniqueFileName?: bool, - * webhookUrl?: string, + * webhookURL?: string, * } */ final class FileUploadParams implements BaseModel @@ -269,8 +269,8 @@ final class FileUploadParams implements BaseModel /** * The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. */ - #[Optional] - public ?string $webhookUrl; + #[Optional('webhookUrl')] + public ?string $webhookURL; /** * `new FileUploadParams()` is missing required properties by the API. @@ -332,7 +332,7 @@ public static function with( ?array $tags = null, Transformation|array|null $transformation = null, ?bool $useUniqueFileName = null, - ?string $webhookUrl = null, + ?string $webhookURL = null, ): self { $obj = new self; @@ -359,7 +359,7 @@ public static function with( null !== $tags && $obj['tags'] = $tags; null !== $transformation && $obj['transformation'] = $transformation; null !== $useUniqueFileName && $obj['useUniqueFileName'] = $useUniqueFileName; - null !== $webhookUrl && $obj['webhookUrl'] = $webhookUrl; + null !== $webhookURL && $obj['webhookURL'] = $webhookURL; return $obj; } @@ -679,7 +679,7 @@ public function withUseUniqueFileName(bool $useUniqueFileName): self public function withWebhookURL(string $webhookURL): self { $obj = clone $this; - $obj['webhookUrl'] = $webhookURL; + $obj['webhookURL'] = $webhookURL; return $obj; } diff --git a/src/Files/FileUploadResponse.php b/src/Files/FileUploadResponse.php index 5a34d4ab..91efd8bc 100644 --- a/src/Files/FileUploadResponse.php +++ b/src/Files/FileUploadResponse.php @@ -22,7 +22,7 @@ * Object containing details of a successful upload. * * @phpstan-type FileUploadResponseShape = array{ - * AITags?: list|null, + * aiTags?: list|null, * audioCodec?: string|null, * bitRate?: int|null, * customCoordinates?: string|null, @@ -31,7 +31,7 @@ * duration?: int|null, * embeddedMetadata?: array|null, * extensionStatus?: ExtensionStatus|null, - * fileId?: string|null, + * fileID?: string|null, * filePath?: string|null, * fileType?: string|null, * height?: float|null, @@ -42,7 +42,7 @@ * selectedFieldsSchema?: array|null, * size?: float|null, * tags?: list|null, - * thumbnailUrl?: string|null, + * thumbnailURL?: string|null, * url?: string|null, * versionInfo?: VersionInfo|null, * videoCodec?: string|null, @@ -57,10 +57,10 @@ final class FileUploadResponse implements BaseModel /** * An array of tags assigned to the uploaded file by auto tagging. * - * @var list|null $AITags + * @var list|null $aiTags */ - #[Optional(list: AITag::class, nullable: true)] - public ?array $AITags; + #[Optional('AITags', list: AITag::class, nullable: true)] + public ?array $aiTags; /** * The audio codec used in the video (only for video). @@ -123,8 +123,8 @@ final class FileUploadResponse implements BaseModel /** * Unique fileId. Store this fileld in your database, as this will be used to perform update action on this file. */ - #[Optional] - public ?string $fileId; + #[Optional('fileId')] + public ?string $fileID; /** * The relative path of the file in the media library e.g. `/marketing-assets/new-banner.jpg`. @@ -197,8 +197,8 @@ final class FileUploadResponse implements BaseModel /** * In the case of an image, a small thumbnail URL. */ - #[Optional] - public ?string $thumbnailUrl; + #[Optional('thumbnailUrl')] + public ?string $thumbnailURL; /** * A publicly accessible URL of the file. @@ -236,14 +236,14 @@ public function __construct() * * @param list|null $AITags + * }>|null $aiTags * @param array $customMetadata * @param array $embeddedMetadata * @param ExtensionStatus|array{ - * ai_auto_description?: value-of|null, - * aws_auto_tagging?: value-of|null, - * google_auto_tagging?: value-of|null, - * remove_bg?: value-of|null, + * aiAutoDescription?: value-of|null, + * awsAutoTagging?: value-of|null, + * googleAutoTagging?: value-of|null, + * removeBg?: value-of|null, * } $extensionStatus * @param Metadata|array{ * audioCodec?: string|null, @@ -277,7 +277,7 @@ public function __construct() * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo */ public static function with( - ?array $AITags = null, + ?array $aiTags = null, ?string $audioCodec = null, ?int $bitRate = null, ?string $customCoordinates = null, @@ -286,7 +286,7 @@ public static function with( ?int $duration = null, ?array $embeddedMetadata = null, ExtensionStatus|array|null $extensionStatus = null, - ?string $fileId = null, + ?string $fileID = null, ?string $filePath = null, ?string $fileType = null, ?float $height = null, @@ -297,7 +297,7 @@ public static function with( ?array $selectedFieldsSchema = null, ?float $size = null, ?array $tags = null, - ?string $thumbnailUrl = null, + ?string $thumbnailURL = null, ?string $url = null, VersionInfo|array|null $versionInfo = null, ?string $videoCodec = null, @@ -305,7 +305,7 @@ public static function with( ): self { $obj = new self; - null !== $AITags && $obj['AITags'] = $AITags; + null !== $aiTags && $obj['aiTags'] = $aiTags; null !== $audioCodec && $obj['audioCodec'] = $audioCodec; null !== $bitRate && $obj['bitRate'] = $bitRate; null !== $customCoordinates && $obj['customCoordinates'] = $customCoordinates; @@ -314,7 +314,7 @@ public static function with( null !== $duration && $obj['duration'] = $duration; null !== $embeddedMetadata && $obj['embeddedMetadata'] = $embeddedMetadata; null !== $extensionStatus && $obj['extensionStatus'] = $extensionStatus; - null !== $fileId && $obj['fileId'] = $fileId; + null !== $fileID && $obj['fileID'] = $fileID; null !== $filePath && $obj['filePath'] = $filePath; null !== $fileType && $obj['fileType'] = $fileType; null !== $height && $obj['height'] = $height; @@ -325,7 +325,7 @@ public static function with( null !== $selectedFieldsSchema && $obj['selectedFieldsSchema'] = $selectedFieldsSchema; null !== $size && $obj['size'] = $size; null !== $tags && $obj['tags'] = $tags; - null !== $thumbnailUrl && $obj['thumbnailUrl'] = $thumbnailUrl; + null !== $thumbnailURL && $obj['thumbnailURL'] = $thumbnailURL; null !== $url && $obj['url'] = $url; null !== $versionInfo && $obj['versionInfo'] = $versionInfo; null !== $videoCodec && $obj['videoCodec'] = $videoCodec; @@ -344,7 +344,7 @@ public static function with( public function withAITags(?array $aiTags): self { $obj = clone $this; - $obj['AITags'] = $aiTags; + $obj['aiTags'] = $aiTags; return $obj; } @@ -440,10 +440,10 @@ public function withEmbeddedMetadata(array $embeddedMetadata): self * If no extension was requested, then this parameter is not returned. * * @param ExtensionStatus|array{ - * ai_auto_description?: value-of|null, - * aws_auto_tagging?: value-of|null, - * google_auto_tagging?: value-of|null, - * remove_bg?: value-of|null, + * aiAutoDescription?: value-of|null, + * awsAutoTagging?: value-of|null, + * googleAutoTagging?: value-of|null, + * removeBg?: value-of|null, * } $extensionStatus */ public function withExtensionStatus( @@ -461,7 +461,7 @@ public function withExtensionStatus( public function withFileID(string $fileID): self { $obj = clone $this; - $obj['fileId'] = $fileID; + $obj['fileID'] = $fileID; return $obj; } @@ -618,7 +618,7 @@ public function withTags(?array $tags): self public function withThumbnailURL(string $thumbnailURL): self { $obj = clone $this; - $obj['thumbnailUrl'] = $thumbnailURL; + $obj['thumbnailURL'] = $thumbnailURL; return $obj; } diff --git a/src/Files/FileUploadResponse/ExtensionStatus.php b/src/Files/FileUploadResponse/ExtensionStatus.php index 66a5cc45..b33f98ae 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Files/FileUploadResponse/ExtensionStatus.php @@ -22,10 +22,10 @@ * If no extension was requested, then this parameter is not returned. * * @phpstan-type ExtensionStatusShape = array{ - * ai_auto_description?: value-of|null, - * aws_auto_tagging?: value-of|null, - * google_auto_tagging?: value-of|null, - * remove_bg?: value-of|null, + * aiAutoDescription?: value-of|null, + * awsAutoTagging?: value-of|null, + * googleAutoTagging?: value-of|null, + * removeBg?: value-of|null, * } */ final class ExtensionStatus implements BaseModel @@ -33,21 +33,21 @@ final class ExtensionStatus implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var value-of|null $ai_auto_description */ + /** @var value-of|null $aiAutoDescription */ #[Optional('ai-auto-description', enum: AIAutoDescription::class)] - public ?string $ai_auto_description; + public ?string $aiAutoDescription; - /** @var value-of|null $aws_auto_tagging */ + /** @var value-of|null $awsAutoTagging */ #[Optional('aws-auto-tagging', enum: AwsAutoTagging::class)] - public ?string $aws_auto_tagging; + public ?string $awsAutoTagging; - /** @var value-of|null $google_auto_tagging */ + /** @var value-of|null $googleAutoTagging */ #[Optional('google-auto-tagging', enum: GoogleAutoTagging::class)] - public ?string $google_auto_tagging; + public ?string $googleAutoTagging; - /** @var value-of|null $remove_bg */ + /** @var value-of|null $removeBg */ #[Optional('remove-bg', enum: RemoveBg::class)] - public ?string $remove_bg; + public ?string $removeBg; public function __construct() { @@ -59,23 +59,23 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AIAutoDescription|value-of $ai_auto_description - * @param AwsAutoTagging|value-of $aws_auto_tagging - * @param GoogleAutoTagging|value-of $google_auto_tagging - * @param RemoveBg|value-of $remove_bg + * @param AIAutoDescription|value-of $aiAutoDescription + * @param AwsAutoTagging|value-of $awsAutoTagging + * @param GoogleAutoTagging|value-of $googleAutoTagging + * @param RemoveBg|value-of $removeBg */ public static function with( - AIAutoDescription|string|null $ai_auto_description = null, - AwsAutoTagging|string|null $aws_auto_tagging = null, - GoogleAutoTagging|string|null $google_auto_tagging = null, - RemoveBg|string|null $remove_bg = null, + AIAutoDescription|string|null $aiAutoDescription = null, + AwsAutoTagging|string|null $awsAutoTagging = null, + GoogleAutoTagging|string|null $googleAutoTagging = null, + RemoveBg|string|null $removeBg = null, ): self { $obj = new self; - null !== $ai_auto_description && $obj['ai_auto_description'] = $ai_auto_description; - null !== $aws_auto_tagging && $obj['aws_auto_tagging'] = $aws_auto_tagging; - null !== $google_auto_tagging && $obj['google_auto_tagging'] = $google_auto_tagging; - null !== $remove_bg && $obj['remove_bg'] = $remove_bg; + null !== $aiAutoDescription && $obj['aiAutoDescription'] = $aiAutoDescription; + null !== $awsAutoTagging && $obj['awsAutoTagging'] = $awsAutoTagging; + null !== $googleAutoTagging && $obj['googleAutoTagging'] = $googleAutoTagging; + null !== $removeBg && $obj['removeBg'] = $removeBg; return $obj; } @@ -87,7 +87,7 @@ public function withAIAutoDescription( AIAutoDescription|string $aiAutoDescription ): self { $obj = clone $this; - $obj['ai_auto_description'] = $aiAutoDescription; + $obj['aiAutoDescription'] = $aiAutoDescription; return $obj; } @@ -99,7 +99,7 @@ public function withAwsAutoTagging( AwsAutoTagging|string $awsAutoTagging ): self { $obj = clone $this; - $obj['aws_auto_tagging'] = $awsAutoTagging; + $obj['awsAutoTagging'] = $awsAutoTagging; return $obj; } @@ -111,7 +111,7 @@ public function withGoogleAutoTagging( GoogleAutoTagging|string $googleAutoTagging ): self { $obj = clone $this; - $obj['google_auto_tagging'] = $googleAutoTagging; + $obj['googleAutoTagging'] = $googleAutoTagging; return $obj; } @@ -122,7 +122,7 @@ public function withGoogleAutoTagging( public function withRemoveBg(RemoveBg|string $removeBg): self { $obj = clone $this; - $obj['remove_bg'] = $removeBg; + $obj['removeBg'] = $removeBg; return $obj; } diff --git a/src/Files/Folder.php b/src/Files/Folder.php index 66cd51ac..beccf343 100644 --- a/src/Files/Folder.php +++ b/src/Files/Folder.php @@ -12,7 +12,7 @@ /** * @phpstan-type FolderShape = array{ * createdAt?: \DateTimeInterface|null, - * folderId?: string|null, + * folderID?: string|null, * folderPath?: string|null, * name?: string|null, * type?: value-of|null, @@ -33,8 +33,8 @@ final class Folder implements BaseModel /** * Unique identifier of the asset. */ - #[Optional] - public ?string $folderId; + #[Optional('folderId')] + public ?string $folderID; /** * Path of the folder. This is the path you would use in the URL to access the folder. For example, if the folder is at the root of the media library, the path will be /folder. If the folder is inside another folder named images, the path will be /images/folder. @@ -76,7 +76,7 @@ public function __construct() */ public static function with( ?\DateTimeInterface $createdAt = null, - ?string $folderId = null, + ?string $folderID = null, ?string $folderPath = null, ?string $name = null, Type|string|null $type = null, @@ -85,7 +85,7 @@ public static function with( $obj = new self; null !== $createdAt && $obj['createdAt'] = $createdAt; - null !== $folderId && $obj['folderId'] = $folderId; + null !== $folderID && $obj['folderID'] = $folderID; null !== $folderPath && $obj['folderPath'] = $folderPath; null !== $name && $obj['name'] = $name; null !== $type && $obj['type'] = $type; @@ -111,7 +111,7 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self public function withFolderID(string $folderID): self { $obj = clone $this; - $obj['folderId'] = $folderID; + $obj['folderID'] = $folderID; return $obj; } diff --git a/src/Files/Metadata/Exif.php b/src/Files/Metadata/Exif.php index dcdda828..f96f1473 100644 --- a/src/Files/Metadata/Exif.php +++ b/src/Files/Metadata/Exif.php @@ -72,58 +72,58 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Exif\Exif|array{ - * ApertureValue?: float|null, - * ColorSpace?: int|null, - * CreateDate?: string|null, - * CustomRendered?: int|null, - * DateTimeOriginal?: string|null, - * ExifImageHeight?: int|null, - * ExifImageWidth?: int|null, - * ExifVersion?: string|null, - * ExposureCompensation?: float|null, - * ExposureMode?: int|null, - * ExposureProgram?: int|null, - * ExposureTime?: float|null, - * Flash?: int|null, - * FlashpixVersion?: string|null, - * FNumber?: float|null, - * FocalLength?: int|null, - * FocalPlaneResolutionUnit?: int|null, - * FocalPlaneXResolution?: float|null, - * FocalPlaneYResolution?: float|null, - * InteropOffset?: int|null, - * ISO?: int|null, - * MeteringMode?: int|null, - * SceneCaptureType?: int|null, - * ShutterSpeedValue?: float|null, - * SubSecTime?: string|null, - * WhiteBalance?: int|null, + * apertureValue?: float|null, + * colorSpace?: int|null, + * createDate?: string|null, + * customRendered?: int|null, + * dateTimeOriginal?: string|null, + * exifImageHeight?: int|null, + * exifImageWidth?: int|null, + * exifVersion?: string|null, + * exposureCompensation?: float|null, + * exposureMode?: int|null, + * exposureProgram?: int|null, + * exposureTime?: float|null, + * flash?: int|null, + * flashpixVersion?: string|null, + * fNumber?: float|null, + * focalLength?: int|null, + * focalPlaneResolutionUnit?: int|null, + * focalPlaneXResolution?: float|null, + * focalPlaneYResolution?: float|null, + * interopOffset?: int|null, + * iso?: int|null, + * meteringMode?: int|null, + * sceneCaptureType?: int|null, + * shutterSpeedValue?: float|null, + * subSecTime?: string|null, + * whiteBalance?: int|null, * } $exif - * @param Gps|array{GPSVersionID?: list|null} $gps + * @param Gps|array{gpsVersionID?: list|null} $gps * @param Image|array{ - * ExifOffset?: int|null, - * GPSInfo?: int|null, - * Make?: string|null, - * Model?: string|null, - * ModifyDate?: string|null, - * Orientation?: int|null, - * ResolutionUnit?: int|null, - * Software?: string|null, - * XResolution?: int|null, - * YCbCrPositioning?: int|null, - * YResolution?: int|null, + * exifOffset?: int|null, + * gpsInfo?: int|null, + * make?: string|null, + * model?: string|null, + * modifyDate?: string|null, + * orientation?: int|null, + * resolutionUnit?: int|null, + * software?: string|null, + * xResolution?: int|null, + * yCbCrPositioning?: int|null, + * yResolution?: int|null, * } $image * @param Interoperability|array{ - * InteropIndex?: string|null, InteropVersion?: string|null + * interopIndex?: string|null, interopVersion?: string|null * } $interoperability * @param array $makernote * @param Thumbnail|array{ - * Compression?: int|null, - * ResolutionUnit?: int|null, - * ThumbnailLength?: int|null, - * ThumbnailOffset?: int|null, - * XResolution?: int|null, - * YResolution?: int|null, + * compression?: int|null, + * resolutionUnit?: int|null, + * thumbnailLength?: int|null, + * thumbnailOffset?: int|null, + * xResolution?: int|null, + * yResolution?: int|null, * } $thumbnail */ public static function with( @@ -150,32 +150,32 @@ public static function with( * Object containing Exif details. * * @param Exif\Exif|array{ - * ApertureValue?: float|null, - * ColorSpace?: int|null, - * CreateDate?: string|null, - * CustomRendered?: int|null, - * DateTimeOriginal?: string|null, - * ExifImageHeight?: int|null, - * ExifImageWidth?: int|null, - * ExifVersion?: string|null, - * ExposureCompensation?: float|null, - * ExposureMode?: int|null, - * ExposureProgram?: int|null, - * ExposureTime?: float|null, - * Flash?: int|null, - * FlashpixVersion?: string|null, - * FNumber?: float|null, - * FocalLength?: int|null, - * FocalPlaneResolutionUnit?: int|null, - * FocalPlaneXResolution?: float|null, - * FocalPlaneYResolution?: float|null, - * InteropOffset?: int|null, - * ISO?: int|null, - * MeteringMode?: int|null, - * SceneCaptureType?: int|null, - * ShutterSpeedValue?: float|null, - * SubSecTime?: string|null, - * WhiteBalance?: int|null, + * apertureValue?: float|null, + * colorSpace?: int|null, + * createDate?: string|null, + * customRendered?: int|null, + * dateTimeOriginal?: string|null, + * exifImageHeight?: int|null, + * exifImageWidth?: int|null, + * exifVersion?: string|null, + * exposureCompensation?: float|null, + * exposureMode?: int|null, + * exposureProgram?: int|null, + * exposureTime?: float|null, + * flash?: int|null, + * flashpixVersion?: string|null, + * fNumber?: float|null, + * focalLength?: int|null, + * focalPlaneResolutionUnit?: int|null, + * focalPlaneXResolution?: float|null, + * focalPlaneYResolution?: float|null, + * interopOffset?: int|null, + * iso?: int|null, + * meteringMode?: int|null, + * sceneCaptureType?: int|null, + * shutterSpeedValue?: float|null, + * subSecTime?: string|null, + * whiteBalance?: int|null, * } $exif */ public function withExif( @@ -190,7 +190,7 @@ public function withExif( /** * Object containing GPS information. * - * @param Gps|array{GPSVersionID?: list|null} $gps + * @param Gps|array{gpsVersionID?: list|null} $gps */ public function withGps(Gps|array $gps): self { @@ -204,17 +204,17 @@ public function withGps(Gps|array $gps): self * Object containing EXIF image information. * * @param Image|array{ - * ExifOffset?: int|null, - * GPSInfo?: int|null, - * Make?: string|null, - * Model?: string|null, - * ModifyDate?: string|null, - * Orientation?: int|null, - * ResolutionUnit?: int|null, - * Software?: string|null, - * XResolution?: int|null, - * YCbCrPositioning?: int|null, - * YResolution?: int|null, + * exifOffset?: int|null, + * gpsInfo?: int|null, + * make?: string|null, + * model?: string|null, + * modifyDate?: string|null, + * orientation?: int|null, + * resolutionUnit?: int|null, + * software?: string|null, + * xResolution?: int|null, + * yCbCrPositioning?: int|null, + * yResolution?: int|null, * } $image */ public function withImage(Image|array $image): self @@ -229,7 +229,7 @@ public function withImage(Image|array $image): self * JSON object. * * @param Interoperability|array{ - * InteropIndex?: string|null, InteropVersion?: string|null + * interopIndex?: string|null, interopVersion?: string|null * } $interoperability */ public function withInteroperability( @@ -256,12 +256,12 @@ public function withMakernote(array $makernote): self * Object containing Thumbnail information. * * @param Thumbnail|array{ - * Compression?: int|null, - * ResolutionUnit?: int|null, - * ThumbnailLength?: int|null, - * ThumbnailOffset?: int|null, - * XResolution?: int|null, - * YResolution?: int|null, + * compression?: int|null, + * resolutionUnit?: int|null, + * thumbnailLength?: int|null, + * thumbnailOffset?: int|null, + * xResolution?: int|null, + * yResolution?: int|null, * } $thumbnail */ public function withThumbnail(Thumbnail|array $thumbnail): self diff --git a/src/Files/Metadata/Exif/Exif.php b/src/Files/Metadata/Exif/Exif.php index 758a94bf..d332f322 100644 --- a/src/Files/Metadata/Exif/Exif.php +++ b/src/Files/Metadata/Exif/Exif.php @@ -12,32 +12,32 @@ * Object containing Exif details. * * @phpstan-type ExifShape = array{ - * ApertureValue?: float|null, - * ColorSpace?: int|null, - * CreateDate?: string|null, - * CustomRendered?: int|null, - * DateTimeOriginal?: string|null, - * ExifImageHeight?: int|null, - * ExifImageWidth?: int|null, - * ExifVersion?: string|null, - * ExposureCompensation?: float|null, - * ExposureMode?: int|null, - * ExposureProgram?: int|null, - * ExposureTime?: float|null, - * Flash?: int|null, - * FlashpixVersion?: string|null, - * FNumber?: float|null, - * FocalLength?: int|null, - * FocalPlaneResolutionUnit?: int|null, - * FocalPlaneXResolution?: float|null, - * FocalPlaneYResolution?: float|null, - * InteropOffset?: int|null, - * ISO?: int|null, - * MeteringMode?: int|null, - * SceneCaptureType?: int|null, - * ShutterSpeedValue?: float|null, - * SubSecTime?: string|null, - * WhiteBalance?: int|null, + * apertureValue?: float|null, + * colorSpace?: int|null, + * createDate?: string|null, + * customRendered?: int|null, + * dateTimeOriginal?: string|null, + * exifImageHeight?: int|null, + * exifImageWidth?: int|null, + * exifVersion?: string|null, + * exposureCompensation?: float|null, + * exposureMode?: int|null, + * exposureProgram?: int|null, + * exposureTime?: float|null, + * flash?: int|null, + * flashpixVersion?: string|null, + * fNumber?: float|null, + * focalLength?: int|null, + * focalPlaneResolutionUnit?: int|null, + * focalPlaneXResolution?: float|null, + * focalPlaneYResolution?: float|null, + * interopOffset?: int|null, + * iso?: int|null, + * meteringMode?: int|null, + * sceneCaptureType?: int|null, + * shutterSpeedValue?: float|null, + * subSecTime?: string|null, + * whiteBalance?: int|null, * } */ final class Exif implements BaseModel @@ -45,83 +45,83 @@ final class Exif implements BaseModel /** @use SdkModel */ use SdkModel; - #[Optional] - public ?float $ApertureValue; + #[Optional('ApertureValue')] + public ?float $apertureValue; - #[Optional] - public ?int $ColorSpace; + #[Optional('ColorSpace')] + public ?int $colorSpace; - #[Optional] - public ?string $CreateDate; + #[Optional('CreateDate')] + public ?string $createDate; - #[Optional] - public ?int $CustomRendered; + #[Optional('CustomRendered')] + public ?int $customRendered; - #[Optional] - public ?string $DateTimeOriginal; + #[Optional('DateTimeOriginal')] + public ?string $dateTimeOriginal; - #[Optional] - public ?int $ExifImageHeight; + #[Optional('ExifImageHeight')] + public ?int $exifImageHeight; - #[Optional] - public ?int $ExifImageWidth; + #[Optional('ExifImageWidth')] + public ?int $exifImageWidth; - #[Optional] - public ?string $ExifVersion; + #[Optional('ExifVersion')] + public ?string $exifVersion; - #[Optional] - public ?float $ExposureCompensation; + #[Optional('ExposureCompensation')] + public ?float $exposureCompensation; - #[Optional] - public ?int $ExposureMode; + #[Optional('ExposureMode')] + public ?int $exposureMode; - #[Optional] - public ?int $ExposureProgram; + #[Optional('ExposureProgram')] + public ?int $exposureProgram; - #[Optional] - public ?float $ExposureTime; + #[Optional('ExposureTime')] + public ?float $exposureTime; - #[Optional] - public ?int $Flash; + #[Optional('Flash')] + public ?int $flash; - #[Optional] - public ?string $FlashpixVersion; + #[Optional('FlashpixVersion')] + public ?string $flashpixVersion; - #[Optional] - public ?float $FNumber; + #[Optional('FNumber')] + public ?float $fNumber; - #[Optional] - public ?int $FocalLength; + #[Optional('FocalLength')] + public ?int $focalLength; - #[Optional] - public ?int $FocalPlaneResolutionUnit; + #[Optional('FocalPlaneResolutionUnit')] + public ?int $focalPlaneResolutionUnit; - #[Optional] - public ?float $FocalPlaneXResolution; + #[Optional('FocalPlaneXResolution')] + public ?float $focalPlaneXResolution; - #[Optional] - public ?float $FocalPlaneYResolution; + #[Optional('FocalPlaneYResolution')] + public ?float $focalPlaneYResolution; - #[Optional] - public ?int $InteropOffset; + #[Optional('InteropOffset')] + public ?int $interopOffset; - #[Optional] - public ?int $ISO; + #[Optional('ISO')] + public ?int $iso; - #[Optional] - public ?int $MeteringMode; + #[Optional('MeteringMode')] + public ?int $meteringMode; - #[Optional] - public ?int $SceneCaptureType; + #[Optional('SceneCaptureType')] + public ?int $sceneCaptureType; - #[Optional] - public ?float $ShutterSpeedValue; + #[Optional('ShutterSpeedValue')] + public ?float $shutterSpeedValue; - #[Optional] - public ?string $SubSecTime; + #[Optional('SubSecTime')] + public ?string $subSecTime; - #[Optional] - public ?int $WhiteBalance; + #[Optional('WhiteBalance')] + public ?int $whiteBalance; public function __construct() { @@ -134,61 +134,61 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - ?float $ApertureValue = null, - ?int $ColorSpace = null, - ?string $CreateDate = null, - ?int $CustomRendered = null, - ?string $DateTimeOriginal = null, - ?int $ExifImageHeight = null, - ?int $ExifImageWidth = null, - ?string $ExifVersion = null, - ?float $ExposureCompensation = null, - ?int $ExposureMode = null, - ?int $ExposureProgram = null, - ?float $ExposureTime = null, - ?int $Flash = null, - ?string $FlashpixVersion = null, - ?float $FNumber = null, - ?int $FocalLength = null, - ?int $FocalPlaneResolutionUnit = null, - ?float $FocalPlaneXResolution = null, - ?float $FocalPlaneYResolution = null, - ?int $InteropOffset = null, - ?int $ISO = null, - ?int $MeteringMode = null, - ?int $SceneCaptureType = null, - ?float $ShutterSpeedValue = null, - ?string $SubSecTime = null, - ?int $WhiteBalance = null, + ?float $apertureValue = null, + ?int $colorSpace = null, + ?string $createDate = null, + ?int $customRendered = null, + ?string $dateTimeOriginal = null, + ?int $exifImageHeight = null, + ?int $exifImageWidth = null, + ?string $exifVersion = null, + ?float $exposureCompensation = null, + ?int $exposureMode = null, + ?int $exposureProgram = null, + ?float $exposureTime = null, + ?int $flash = null, + ?string $flashpixVersion = null, + ?float $fNumber = null, + ?int $focalLength = null, + ?int $focalPlaneResolutionUnit = null, + ?float $focalPlaneXResolution = null, + ?float $focalPlaneYResolution = null, + ?int $interopOffset = null, + ?int $iso = null, + ?int $meteringMode = null, + ?int $sceneCaptureType = null, + ?float $shutterSpeedValue = null, + ?string $subSecTime = null, + ?int $whiteBalance = null, ): self { $obj = new self; - null !== $ApertureValue && $obj['ApertureValue'] = $ApertureValue; - null !== $ColorSpace && $obj['ColorSpace'] = $ColorSpace; - null !== $CreateDate && $obj['CreateDate'] = $CreateDate; - null !== $CustomRendered && $obj['CustomRendered'] = $CustomRendered; - null !== $DateTimeOriginal && $obj['DateTimeOriginal'] = $DateTimeOriginal; - null !== $ExifImageHeight && $obj['ExifImageHeight'] = $ExifImageHeight; - null !== $ExifImageWidth && $obj['ExifImageWidth'] = $ExifImageWidth; - null !== $ExifVersion && $obj['ExifVersion'] = $ExifVersion; - null !== $ExposureCompensation && $obj['ExposureCompensation'] = $ExposureCompensation; - null !== $ExposureMode && $obj['ExposureMode'] = $ExposureMode; - null !== $ExposureProgram && $obj['ExposureProgram'] = $ExposureProgram; - null !== $ExposureTime && $obj['ExposureTime'] = $ExposureTime; - null !== $Flash && $obj['Flash'] = $Flash; - null !== $FlashpixVersion && $obj['FlashpixVersion'] = $FlashpixVersion; - null !== $FNumber && $obj['FNumber'] = $FNumber; - null !== $FocalLength && $obj['FocalLength'] = $FocalLength; - null !== $FocalPlaneResolutionUnit && $obj['FocalPlaneResolutionUnit'] = $FocalPlaneResolutionUnit; - null !== $FocalPlaneXResolution && $obj['FocalPlaneXResolution'] = $FocalPlaneXResolution; - null !== $FocalPlaneYResolution && $obj['FocalPlaneYResolution'] = $FocalPlaneYResolution; - null !== $InteropOffset && $obj['InteropOffset'] = $InteropOffset; - null !== $ISO && $obj['ISO'] = $ISO; - null !== $MeteringMode && $obj['MeteringMode'] = $MeteringMode; - null !== $SceneCaptureType && $obj['SceneCaptureType'] = $SceneCaptureType; - null !== $ShutterSpeedValue && $obj['ShutterSpeedValue'] = $ShutterSpeedValue; - null !== $SubSecTime && $obj['SubSecTime'] = $SubSecTime; - null !== $WhiteBalance && $obj['WhiteBalance'] = $WhiteBalance; + null !== $apertureValue && $obj['apertureValue'] = $apertureValue; + null !== $colorSpace && $obj['colorSpace'] = $colorSpace; + null !== $createDate && $obj['createDate'] = $createDate; + null !== $customRendered && $obj['customRendered'] = $customRendered; + null !== $dateTimeOriginal && $obj['dateTimeOriginal'] = $dateTimeOriginal; + null !== $exifImageHeight && $obj['exifImageHeight'] = $exifImageHeight; + null !== $exifImageWidth && $obj['exifImageWidth'] = $exifImageWidth; + null !== $exifVersion && $obj['exifVersion'] = $exifVersion; + null !== $exposureCompensation && $obj['exposureCompensation'] = $exposureCompensation; + null !== $exposureMode && $obj['exposureMode'] = $exposureMode; + null !== $exposureProgram && $obj['exposureProgram'] = $exposureProgram; + null !== $exposureTime && $obj['exposureTime'] = $exposureTime; + null !== $flash && $obj['flash'] = $flash; + null !== $flashpixVersion && $obj['flashpixVersion'] = $flashpixVersion; + null !== $fNumber && $obj['fNumber'] = $fNumber; + null !== $focalLength && $obj['focalLength'] = $focalLength; + null !== $focalPlaneResolutionUnit && $obj['focalPlaneResolutionUnit'] = $focalPlaneResolutionUnit; + null !== $focalPlaneXResolution && $obj['focalPlaneXResolution'] = $focalPlaneXResolution; + null !== $focalPlaneYResolution && $obj['focalPlaneYResolution'] = $focalPlaneYResolution; + null !== $interopOffset && $obj['interopOffset'] = $interopOffset; + null !== $iso && $obj['iso'] = $iso; + null !== $meteringMode && $obj['meteringMode'] = $meteringMode; + null !== $sceneCaptureType && $obj['sceneCaptureType'] = $sceneCaptureType; + null !== $shutterSpeedValue && $obj['shutterSpeedValue'] = $shutterSpeedValue; + null !== $subSecTime && $obj['subSecTime'] = $subSecTime; + null !== $whiteBalance && $obj['whiteBalance'] = $whiteBalance; return $obj; } @@ -196,7 +196,7 @@ public static function with( public function withApertureValue(float $apertureValue): self { $obj = clone $this; - $obj['ApertureValue'] = $apertureValue; + $obj['apertureValue'] = $apertureValue; return $obj; } @@ -204,7 +204,7 @@ public function withApertureValue(float $apertureValue): self public function withColorSpace(int $colorSpace): self { $obj = clone $this; - $obj['ColorSpace'] = $colorSpace; + $obj['colorSpace'] = $colorSpace; return $obj; } @@ -212,7 +212,7 @@ public function withColorSpace(int $colorSpace): self public function withCreateDate(string $createDate): self { $obj = clone $this; - $obj['CreateDate'] = $createDate; + $obj['createDate'] = $createDate; return $obj; } @@ -220,7 +220,7 @@ public function withCreateDate(string $createDate): self public function withCustomRendered(int $customRendered): self { $obj = clone $this; - $obj['CustomRendered'] = $customRendered; + $obj['customRendered'] = $customRendered; return $obj; } @@ -228,7 +228,7 @@ public function withCustomRendered(int $customRendered): self public function withDateTimeOriginal(string $dateTimeOriginal): self { $obj = clone $this; - $obj['DateTimeOriginal'] = $dateTimeOriginal; + $obj['dateTimeOriginal'] = $dateTimeOriginal; return $obj; } @@ -236,7 +236,7 @@ public function withDateTimeOriginal(string $dateTimeOriginal): self public function withExifImageHeight(int $exifImageHeight): self { $obj = clone $this; - $obj['ExifImageHeight'] = $exifImageHeight; + $obj['exifImageHeight'] = $exifImageHeight; return $obj; } @@ -244,7 +244,7 @@ public function withExifImageHeight(int $exifImageHeight): self public function withExifImageWidth(int $exifImageWidth): self { $obj = clone $this; - $obj['ExifImageWidth'] = $exifImageWidth; + $obj['exifImageWidth'] = $exifImageWidth; return $obj; } @@ -252,7 +252,7 @@ public function withExifImageWidth(int $exifImageWidth): self public function withExifVersion(string $exifVersion): self { $obj = clone $this; - $obj['ExifVersion'] = $exifVersion; + $obj['exifVersion'] = $exifVersion; return $obj; } @@ -260,7 +260,7 @@ public function withExifVersion(string $exifVersion): self public function withExposureCompensation(float $exposureCompensation): self { $obj = clone $this; - $obj['ExposureCompensation'] = $exposureCompensation; + $obj['exposureCompensation'] = $exposureCompensation; return $obj; } @@ -268,7 +268,7 @@ public function withExposureCompensation(float $exposureCompensation): self public function withExposureMode(int $exposureMode): self { $obj = clone $this; - $obj['ExposureMode'] = $exposureMode; + $obj['exposureMode'] = $exposureMode; return $obj; } @@ -276,7 +276,7 @@ public function withExposureMode(int $exposureMode): self public function withExposureProgram(int $exposureProgram): self { $obj = clone $this; - $obj['ExposureProgram'] = $exposureProgram; + $obj['exposureProgram'] = $exposureProgram; return $obj; } @@ -284,7 +284,7 @@ public function withExposureProgram(int $exposureProgram): self public function withExposureTime(float $exposureTime): self { $obj = clone $this; - $obj['ExposureTime'] = $exposureTime; + $obj['exposureTime'] = $exposureTime; return $obj; } @@ -292,7 +292,7 @@ public function withExposureTime(float $exposureTime): self public function withFlash(int $flash): self { $obj = clone $this; - $obj['Flash'] = $flash; + $obj['flash'] = $flash; return $obj; } @@ -300,7 +300,7 @@ public function withFlash(int $flash): self public function withFlashpixVersion(string $flashpixVersion): self { $obj = clone $this; - $obj['FlashpixVersion'] = $flashpixVersion; + $obj['flashpixVersion'] = $flashpixVersion; return $obj; } @@ -308,7 +308,7 @@ public function withFlashpixVersion(string $flashpixVersion): self public function withFNumber(float $fNumber): self { $obj = clone $this; - $obj['FNumber'] = $fNumber; + $obj['fNumber'] = $fNumber; return $obj; } @@ -316,7 +316,7 @@ public function withFNumber(float $fNumber): self public function withFocalLength(int $focalLength): self { $obj = clone $this; - $obj['FocalLength'] = $focalLength; + $obj['focalLength'] = $focalLength; return $obj; } @@ -325,7 +325,7 @@ public function withFocalPlaneResolutionUnit( int $focalPlaneResolutionUnit ): self { $obj = clone $this; - $obj['FocalPlaneResolutionUnit'] = $focalPlaneResolutionUnit; + $obj['focalPlaneResolutionUnit'] = $focalPlaneResolutionUnit; return $obj; } @@ -334,7 +334,7 @@ public function withFocalPlaneXResolution( float $focalPlaneXResolution ): self { $obj = clone $this; - $obj['FocalPlaneXResolution'] = $focalPlaneXResolution; + $obj['focalPlaneXResolution'] = $focalPlaneXResolution; return $obj; } @@ -343,7 +343,7 @@ public function withFocalPlaneYResolution( float $focalPlaneYResolution ): self { $obj = clone $this; - $obj['FocalPlaneYResolution'] = $focalPlaneYResolution; + $obj['focalPlaneYResolution'] = $focalPlaneYResolution; return $obj; } @@ -351,7 +351,7 @@ public function withFocalPlaneYResolution( public function withInteropOffset(int $interopOffset): self { $obj = clone $this; - $obj['InteropOffset'] = $interopOffset; + $obj['interopOffset'] = $interopOffset; return $obj; } @@ -359,7 +359,7 @@ public function withInteropOffset(int $interopOffset): self public function withISO(int $iso): self { $obj = clone $this; - $obj['ISO'] = $iso; + $obj['iso'] = $iso; return $obj; } @@ -367,7 +367,7 @@ public function withISO(int $iso): self public function withMeteringMode(int $meteringMode): self { $obj = clone $this; - $obj['MeteringMode'] = $meteringMode; + $obj['meteringMode'] = $meteringMode; return $obj; } @@ -375,7 +375,7 @@ public function withMeteringMode(int $meteringMode): self public function withSceneCaptureType(int $sceneCaptureType): self { $obj = clone $this; - $obj['SceneCaptureType'] = $sceneCaptureType; + $obj['sceneCaptureType'] = $sceneCaptureType; return $obj; } @@ -383,7 +383,7 @@ public function withSceneCaptureType(int $sceneCaptureType): self public function withShutterSpeedValue(float $shutterSpeedValue): self { $obj = clone $this; - $obj['ShutterSpeedValue'] = $shutterSpeedValue; + $obj['shutterSpeedValue'] = $shutterSpeedValue; return $obj; } @@ -391,7 +391,7 @@ public function withShutterSpeedValue(float $shutterSpeedValue): self public function withSubSecTime(string $subSecTime): self { $obj = clone $this; - $obj['SubSecTime'] = $subSecTime; + $obj['subSecTime'] = $subSecTime; return $obj; } @@ -399,7 +399,7 @@ public function withSubSecTime(string $subSecTime): self public function withWhiteBalance(int $whiteBalance): self { $obj = clone $this; - $obj['WhiteBalance'] = $whiteBalance; + $obj['whiteBalance'] = $whiteBalance; return $obj; } diff --git a/src/Files/Metadata/Exif/Gps.php b/src/Files/Metadata/Exif/Gps.php index f4e25c01..e3565801 100644 --- a/src/Files/Metadata/Exif/Gps.php +++ b/src/Files/Metadata/Exif/Gps.php @@ -11,16 +11,16 @@ /** * Object containing GPS information. * - * @phpstan-type GpsShape = array{GPSVersionID?: list|null} + * @phpstan-type GpsShape = array{gpsVersionID?: list|null} */ final class Gps implements BaseModel { /** @use SdkModel */ use SdkModel; - /** @var list|null $GPSVersionID */ - #[Optional(list: 'int')] - public ?array $GPSVersionID; + /** @var list|null $gpsVersionID */ + #[Optional('GPSVersionID', list: 'int')] + public ?array $gpsVersionID; public function __construct() { @@ -32,13 +32,13 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $GPSVersionID + * @param list $gpsVersionID */ - public static function with(?array $GPSVersionID = null): self + public static function with(?array $gpsVersionID = null): self { $obj = new self; - null !== $GPSVersionID && $obj['GPSVersionID'] = $GPSVersionID; + null !== $gpsVersionID && $obj['gpsVersionID'] = $gpsVersionID; return $obj; } @@ -49,7 +49,7 @@ public static function with(?array $GPSVersionID = null): self public function withGpsVersionID(array $gpsVersionID): self { $obj = clone $this; - $obj['GPSVersionID'] = $gpsVersionID; + $obj['gpsVersionID'] = $gpsVersionID; return $obj; } diff --git a/src/Files/Metadata/Exif/Image.php b/src/Files/Metadata/Exif/Image.php index 882ec17f..8c298152 100644 --- a/src/Files/Metadata/Exif/Image.php +++ b/src/Files/Metadata/Exif/Image.php @@ -12,17 +12,17 @@ * Object containing EXIF image information. * * @phpstan-type ImageShape = array{ - * ExifOffset?: int|null, - * GPSInfo?: int|null, - * Make?: string|null, - * Model?: string|null, - * ModifyDate?: string|null, - * Orientation?: int|null, - * ResolutionUnit?: int|null, - * Software?: string|null, - * XResolution?: int|null, - * YCbCrPositioning?: int|null, - * YResolution?: int|null, + * exifOffset?: int|null, + * gpsInfo?: int|null, + * make?: string|null, + * model?: string|null, + * modifyDate?: string|null, + * orientation?: int|null, + * resolutionUnit?: int|null, + * software?: string|null, + * xResolution?: int|null, + * yCbCrPositioning?: int|null, + * yResolution?: int|null, * } */ final class Image implements BaseModel @@ -30,38 +30,38 @@ final class Image implements BaseModel /** @use SdkModel */ use SdkModel; - #[Optional] - public ?int $ExifOffset; + #[Optional('ExifOffset')] + public ?int $exifOffset; - #[Optional] - public ?int $GPSInfo; + #[Optional('GPSInfo')] + public ?int $gpsInfo; - #[Optional] - public ?string $Make; + #[Optional('Make')] + public ?string $make; - #[Optional] - public ?string $Model; + #[Optional('Model')] + public ?string $model; - #[Optional] - public ?string $ModifyDate; + #[Optional('ModifyDate')] + public ?string $modifyDate; - #[Optional] - public ?int $Orientation; + #[Optional('Orientation')] + public ?int $orientation; - #[Optional] - public ?int $ResolutionUnit; + #[Optional('ResolutionUnit')] + public ?int $resolutionUnit; - #[Optional] - public ?string $Software; + #[Optional('Software')] + public ?string $software; - #[Optional] - public ?int $XResolution; + #[Optional('XResolution')] + public ?int $xResolution; - #[Optional] - public ?int $YCbCrPositioning; + #[Optional('YCbCrPositioning')] + public ?int $yCbCrPositioning; - #[Optional] - public ?int $YResolution; + #[Optional('YResolution')] + public ?int $yResolution; public function __construct() { @@ -74,31 +74,31 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - ?int $ExifOffset = null, - ?int $GPSInfo = null, - ?string $Make = null, - ?string $Model = null, - ?string $ModifyDate = null, - ?int $Orientation = null, - ?int $ResolutionUnit = null, - ?string $Software = null, - ?int $XResolution = null, - ?int $YCbCrPositioning = null, - ?int $YResolution = null, + ?int $exifOffset = null, + ?int $gpsInfo = null, + ?string $make = null, + ?string $model = null, + ?string $modifyDate = null, + ?int $orientation = null, + ?int $resolutionUnit = null, + ?string $software = null, + ?int $xResolution = null, + ?int $yCbCrPositioning = null, + ?int $yResolution = null, ): self { $obj = new self; - null !== $ExifOffset && $obj['ExifOffset'] = $ExifOffset; - null !== $GPSInfo && $obj['GPSInfo'] = $GPSInfo; - null !== $Make && $obj['Make'] = $Make; - null !== $Model && $obj['Model'] = $Model; - null !== $ModifyDate && $obj['ModifyDate'] = $ModifyDate; - null !== $Orientation && $obj['Orientation'] = $Orientation; - null !== $ResolutionUnit && $obj['ResolutionUnit'] = $ResolutionUnit; - null !== $Software && $obj['Software'] = $Software; - null !== $XResolution && $obj['XResolution'] = $XResolution; - null !== $YCbCrPositioning && $obj['YCbCrPositioning'] = $YCbCrPositioning; - null !== $YResolution && $obj['YResolution'] = $YResolution; + null !== $exifOffset && $obj['exifOffset'] = $exifOffset; + null !== $gpsInfo && $obj['gpsInfo'] = $gpsInfo; + null !== $make && $obj['make'] = $make; + null !== $model && $obj['model'] = $model; + null !== $modifyDate && $obj['modifyDate'] = $modifyDate; + null !== $orientation && $obj['orientation'] = $orientation; + null !== $resolutionUnit && $obj['resolutionUnit'] = $resolutionUnit; + null !== $software && $obj['software'] = $software; + null !== $xResolution && $obj['xResolution'] = $xResolution; + null !== $yCbCrPositioning && $obj['yCbCrPositioning'] = $yCbCrPositioning; + null !== $yResolution && $obj['yResolution'] = $yResolution; return $obj; } @@ -106,7 +106,7 @@ public static function with( public function withExifOffset(int $exifOffset): self { $obj = clone $this; - $obj['ExifOffset'] = $exifOffset; + $obj['exifOffset'] = $exifOffset; return $obj; } @@ -114,7 +114,7 @@ public function withExifOffset(int $exifOffset): self public function withGpsInfo(int $gpsInfo): self { $obj = clone $this; - $obj['GPSInfo'] = $gpsInfo; + $obj['gpsInfo'] = $gpsInfo; return $obj; } @@ -122,7 +122,7 @@ public function withGpsInfo(int $gpsInfo): self public function withMake(string $make): self { $obj = clone $this; - $obj['Make'] = $make; + $obj['make'] = $make; return $obj; } @@ -130,7 +130,7 @@ public function withMake(string $make): self public function withModel(string $model): self { $obj = clone $this; - $obj['Model'] = $model; + $obj['model'] = $model; return $obj; } @@ -138,7 +138,7 @@ public function withModel(string $model): self public function withModifyDate(string $modifyDate): self { $obj = clone $this; - $obj['ModifyDate'] = $modifyDate; + $obj['modifyDate'] = $modifyDate; return $obj; } @@ -146,7 +146,7 @@ public function withModifyDate(string $modifyDate): self public function withOrientation(int $orientation): self { $obj = clone $this; - $obj['Orientation'] = $orientation; + $obj['orientation'] = $orientation; return $obj; } @@ -154,7 +154,7 @@ public function withOrientation(int $orientation): self public function withResolutionUnit(int $resolutionUnit): self { $obj = clone $this; - $obj['ResolutionUnit'] = $resolutionUnit; + $obj['resolutionUnit'] = $resolutionUnit; return $obj; } @@ -162,7 +162,7 @@ public function withResolutionUnit(int $resolutionUnit): self public function withSoftware(string $software): self { $obj = clone $this; - $obj['Software'] = $software; + $obj['software'] = $software; return $obj; } @@ -170,7 +170,7 @@ public function withSoftware(string $software): self public function withXResolution(int $xResolution): self { $obj = clone $this; - $obj['XResolution'] = $xResolution; + $obj['xResolution'] = $xResolution; return $obj; } @@ -178,7 +178,7 @@ public function withXResolution(int $xResolution): self public function withYCbCrPositioning(int $yCbCrPositioning): self { $obj = clone $this; - $obj['YCbCrPositioning'] = $yCbCrPositioning; + $obj['yCbCrPositioning'] = $yCbCrPositioning; return $obj; } @@ -186,7 +186,7 @@ public function withYCbCrPositioning(int $yCbCrPositioning): self public function withYResolution(int $yResolution): self { $obj = clone $this; - $obj['YResolution'] = $yResolution; + $obj['yResolution'] = $yResolution; return $obj; } diff --git a/src/Files/Metadata/Exif/Interoperability.php b/src/Files/Metadata/Exif/Interoperability.php index f9fd29c5..baa352c7 100644 --- a/src/Files/Metadata/Exif/Interoperability.php +++ b/src/Files/Metadata/Exif/Interoperability.php @@ -12,7 +12,7 @@ * JSON object. * * @phpstan-type InteroperabilityShape = array{ - * InteropIndex?: string|null, InteropVersion?: string|null + * interopIndex?: string|null, interopVersion?: string|null * } */ final class Interoperability implements BaseModel @@ -20,11 +20,11 @@ final class Interoperability implements BaseModel /** @use SdkModel */ use SdkModel; - #[Optional] - public ?string $InteropIndex; + #[Optional('InteropIndex')] + public ?string $interopIndex; - #[Optional] - public ?string $InteropVersion; + #[Optional('InteropVersion')] + public ?string $interopVersion; public function __construct() { @@ -37,13 +37,13 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - ?string $InteropIndex = null, - ?string $InteropVersion = null + ?string $interopIndex = null, + ?string $interopVersion = null ): self { $obj = new self; - null !== $InteropIndex && $obj['InteropIndex'] = $InteropIndex; - null !== $InteropVersion && $obj['InteropVersion'] = $InteropVersion; + null !== $interopIndex && $obj['interopIndex'] = $interopIndex; + null !== $interopVersion && $obj['interopVersion'] = $interopVersion; return $obj; } @@ -51,7 +51,7 @@ public static function with( public function withInteropIndex(string $interopIndex): self { $obj = clone $this; - $obj['InteropIndex'] = $interopIndex; + $obj['interopIndex'] = $interopIndex; return $obj; } @@ -59,7 +59,7 @@ public function withInteropIndex(string $interopIndex): self public function withInteropVersion(string $interopVersion): self { $obj = clone $this; - $obj['InteropVersion'] = $interopVersion; + $obj['interopVersion'] = $interopVersion; return $obj; } diff --git a/src/Files/Metadata/Exif/Thumbnail.php b/src/Files/Metadata/Exif/Thumbnail.php index d72c4b39..ef75e3a7 100644 --- a/src/Files/Metadata/Exif/Thumbnail.php +++ b/src/Files/Metadata/Exif/Thumbnail.php @@ -12,12 +12,12 @@ * Object containing Thumbnail information. * * @phpstan-type ThumbnailShape = array{ - * Compression?: int|null, - * ResolutionUnit?: int|null, - * ThumbnailLength?: int|null, - * ThumbnailOffset?: int|null, - * XResolution?: int|null, - * YResolution?: int|null, + * compression?: int|null, + * resolutionUnit?: int|null, + * thumbnailLength?: int|null, + * thumbnailOffset?: int|null, + * xResolution?: int|null, + * yResolution?: int|null, * } */ final class Thumbnail implements BaseModel @@ -25,23 +25,23 @@ final class Thumbnail implements BaseModel /** @use SdkModel */ use SdkModel; - #[Optional] - public ?int $Compression; + #[Optional('Compression')] + public ?int $compression; - #[Optional] - public ?int $ResolutionUnit; + #[Optional('ResolutionUnit')] + public ?int $resolutionUnit; - #[Optional] - public ?int $ThumbnailLength; + #[Optional('ThumbnailLength')] + public ?int $thumbnailLength; - #[Optional] - public ?int $ThumbnailOffset; + #[Optional('ThumbnailOffset')] + public ?int $thumbnailOffset; - #[Optional] - public ?int $XResolution; + #[Optional('XResolution')] + public ?int $xResolution; - #[Optional] - public ?int $YResolution; + #[Optional('YResolution')] + public ?int $yResolution; public function __construct() { @@ -54,21 +54,21 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - ?int $Compression = null, - ?int $ResolutionUnit = null, - ?int $ThumbnailLength = null, - ?int $ThumbnailOffset = null, - ?int $XResolution = null, - ?int $YResolution = null, + ?int $compression = null, + ?int $resolutionUnit = null, + ?int $thumbnailLength = null, + ?int $thumbnailOffset = null, + ?int $xResolution = null, + ?int $yResolution = null, ): self { $obj = new self; - null !== $Compression && $obj['Compression'] = $Compression; - null !== $ResolutionUnit && $obj['ResolutionUnit'] = $ResolutionUnit; - null !== $ThumbnailLength && $obj['ThumbnailLength'] = $ThumbnailLength; - null !== $ThumbnailOffset && $obj['ThumbnailOffset'] = $ThumbnailOffset; - null !== $XResolution && $obj['XResolution'] = $XResolution; - null !== $YResolution && $obj['YResolution'] = $YResolution; + null !== $compression && $obj['compression'] = $compression; + null !== $resolutionUnit && $obj['resolutionUnit'] = $resolutionUnit; + null !== $thumbnailLength && $obj['thumbnailLength'] = $thumbnailLength; + null !== $thumbnailOffset && $obj['thumbnailOffset'] = $thumbnailOffset; + null !== $xResolution && $obj['xResolution'] = $xResolution; + null !== $yResolution && $obj['yResolution'] = $yResolution; return $obj; } @@ -76,7 +76,7 @@ public static function with( public function withCompression(int $compression): self { $obj = clone $this; - $obj['Compression'] = $compression; + $obj['compression'] = $compression; return $obj; } @@ -84,7 +84,7 @@ public function withCompression(int $compression): self public function withResolutionUnit(int $resolutionUnit): self { $obj = clone $this; - $obj['ResolutionUnit'] = $resolutionUnit; + $obj['resolutionUnit'] = $resolutionUnit; return $obj; } @@ -92,7 +92,7 @@ public function withResolutionUnit(int $resolutionUnit): self public function withThumbnailLength(int $thumbnailLength): self { $obj = clone $this; - $obj['ThumbnailLength'] = $thumbnailLength; + $obj['thumbnailLength'] = $thumbnailLength; return $obj; } @@ -100,7 +100,7 @@ public function withThumbnailLength(int $thumbnailLength): self public function withThumbnailOffset(int $thumbnailOffset): self { $obj = clone $this; - $obj['ThumbnailOffset'] = $thumbnailOffset; + $obj['thumbnailOffset'] = $thumbnailOffset; return $obj; } @@ -108,7 +108,7 @@ public function withThumbnailOffset(int $thumbnailOffset): self public function withXResolution(int $xResolution): self { $obj = clone $this; - $obj['XResolution'] = $xResolution; + $obj['xResolution'] = $xResolution; return $obj; } @@ -116,7 +116,7 @@ public function withXResolution(int $xResolution): self public function withYResolution(int $yResolution): self { $obj = clone $this; - $obj['YResolution'] = $yResolution; + $obj['yResolution'] = $yResolution; return $obj; } diff --git a/src/Files/UpdateFileRequest/UpdateFileDetails.php b/src/Files/UpdateFileRequest/UpdateFileDetails.php index 5311775d..727b6648 100644 --- a/src/Files/UpdateFileRequest/UpdateFileDetails.php +++ b/src/Files/UpdateFileRequest/UpdateFileDetails.php @@ -23,7 +23,7 @@ * extensions?: list|null, * removeAITags?: null|'all'|list, * tags?: list|null, - * webhookUrl?: string|null, + * webhookURL?: string|null, * } */ final class UpdateFileDetails implements BaseModel @@ -82,8 +82,8 @@ final class UpdateFileDetails implements BaseModel /** * The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. */ - #[Optional] - public ?string $webhookUrl; + #[Optional('webhookUrl')] + public ?string $webhookURL; public function __construct() { @@ -111,7 +111,7 @@ public static function with( ?array $extensions = null, string|array|null $removeAITags = null, ?array $tags = null, - ?string $webhookUrl = null, + ?string $webhookURL = null, ): self { $obj = new self; @@ -121,7 +121,7 @@ public static function with( null !== $extensions && $obj['extensions'] = $extensions; null !== $removeAITags && $obj['removeAITags'] = $removeAITags; null !== $tags && $obj['tags'] = $tags; - null !== $webhookUrl && $obj['webhookUrl'] = $webhookUrl; + null !== $webhookURL && $obj['webhookURL'] = $webhookURL; return $obj; } @@ -214,7 +214,7 @@ public function withTags(?array $tags): self public function withWebhookURL(string $webhookURL): self { $obj = clone $this; - $obj['webhookUrl'] = $webhookURL; + $obj['webhookURL'] = $webhookURL; return $obj; } diff --git a/src/Files/Versions/VersionDeleteParams.php b/src/Files/Versions/VersionDeleteParams.php index dfeb9f96..32d80f34 100644 --- a/src/Files/Versions/VersionDeleteParams.php +++ b/src/Files/Versions/VersionDeleteParams.php @@ -16,7 +16,7 @@ * * @see Imagekit\Services\Files\VersionsService::delete() * - * @phpstan-type VersionDeleteParamsShape = array{fileId: string} + * @phpstan-type VersionDeleteParamsShape = array{fileID: string} */ final class VersionDeleteParams implements BaseModel { @@ -25,14 +25,14 @@ final class VersionDeleteParams implements BaseModel use SdkParams; #[Required] - public string $fileId; + public string $fileID; /** * `new VersionDeleteParams()` is missing required properties by the API. * * To enforce required parameters use * ``` - * VersionDeleteParams::with(fileId: ...) + * VersionDeleteParams::with(fileID: ...) * ``` * * Otherwise ensure the following setters are called @@ -51,11 +51,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. */ - public static function with(string $fileId): self + public static function with(string $fileID): self { $obj = new self; - $obj['fileId'] = $fileId; + $obj['fileID'] = $fileID; return $obj; } @@ -63,7 +63,7 @@ public static function with(string $fileId): self public function withFileID(string $fileID): self { $obj = clone $this; - $obj['fileId'] = $fileID; + $obj['fileID'] = $fileID; return $obj; } diff --git a/src/Files/Versions/VersionGetParams.php b/src/Files/Versions/VersionGetParams.php index f0c9360f..3061e29b 100644 --- a/src/Files/Versions/VersionGetParams.php +++ b/src/Files/Versions/VersionGetParams.php @@ -14,7 +14,7 @@ * * @see Imagekit\Services\Files\VersionsService::get() * - * @phpstan-type VersionGetParamsShape = array{fileId: string} + * @phpstan-type VersionGetParamsShape = array{fileID: string} */ final class VersionGetParams implements BaseModel { @@ -23,14 +23,14 @@ final class VersionGetParams implements BaseModel use SdkParams; #[Required] - public string $fileId; + public string $fileID; /** * `new VersionGetParams()` is missing required properties by the API. * * To enforce required parameters use * ``` - * VersionGetParams::with(fileId: ...) + * VersionGetParams::with(fileID: ...) * ``` * * Otherwise ensure the following setters are called @@ -49,11 +49,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. */ - public static function with(string $fileId): self + public static function with(string $fileID): self { $obj = new self; - $obj['fileId'] = $fileId; + $obj['fileID'] = $fileID; return $obj; } @@ -61,7 +61,7 @@ public static function with(string $fileId): self public function withFileID(string $fileID): self { $obj = clone $this; - $obj['fileId'] = $fileID; + $obj['fileID'] = $fileID; return $obj; } diff --git a/src/Files/Versions/VersionRestoreParams.php b/src/Files/Versions/VersionRestoreParams.php index 879e9aa1..28e46b91 100644 --- a/src/Files/Versions/VersionRestoreParams.php +++ b/src/Files/Versions/VersionRestoreParams.php @@ -14,7 +14,7 @@ * * @see Imagekit\Services\Files\VersionsService::restore() * - * @phpstan-type VersionRestoreParamsShape = array{fileId: string} + * @phpstan-type VersionRestoreParamsShape = array{fileID: string} */ final class VersionRestoreParams implements BaseModel { @@ -23,14 +23,14 @@ final class VersionRestoreParams implements BaseModel use SdkParams; #[Required] - public string $fileId; + public string $fileID; /** * `new VersionRestoreParams()` is missing required properties by the API. * * To enforce required parameters use * ``` - * VersionRestoreParams::with(fileId: ...) + * VersionRestoreParams::with(fileID: ...) * ``` * * Otherwise ensure the following setters are called @@ -49,11 +49,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. */ - public static function with(string $fileId): self + public static function with(string $fileID): self { $obj = new self; - $obj['fileId'] = $fileId; + $obj['fileID'] = $fileID; return $obj; } @@ -61,7 +61,7 @@ public static function with(string $fileId): self public function withFileID(string $fileID): self { $obj = clone $this; - $obj['fileId'] = $fileID; + $obj['fileID'] = $fileID; return $obj; } diff --git a/src/Folders/FolderCopyResponse.php b/src/Folders/FolderCopyResponse.php index 981f7c3c..16a453bc 100644 --- a/src/Folders/FolderCopyResponse.php +++ b/src/Folders/FolderCopyResponse.php @@ -11,7 +11,7 @@ /** * Job submitted successfully. A `jobId` will be returned. * - * @phpstan-type FolderCopyResponseShape = array{jobId: string} + * @phpstan-type FolderCopyResponseShape = array{jobID: string} */ final class FolderCopyResponse implements BaseModel { @@ -21,15 +21,15 @@ final class FolderCopyResponse implements BaseModel /** * Unique identifier of the bulk job. This can be used to check the status of the bulk job. */ - #[Required] - public string $jobId; + #[Required('jobId')] + public string $jobID; /** * `new FolderCopyResponse()` is missing required properties by the API. * * To enforce required parameters use * ``` - * FolderCopyResponse::with(jobId: ...) + * FolderCopyResponse::with(jobID: ...) * ``` * * Otherwise ensure the following setters are called @@ -48,11 +48,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. */ - public static function with(string $jobId): self + public static function with(string $jobID): self { $obj = new self; - $obj['jobId'] = $jobId; + $obj['jobID'] = $jobID; return $obj; } @@ -63,7 +63,7 @@ public static function with(string $jobId): self public function withJobID(string $jobID): self { $obj = clone $this; - $obj['jobId'] = $jobID; + $obj['jobID'] = $jobID; return $obj; } diff --git a/src/Folders/FolderMoveResponse.php b/src/Folders/FolderMoveResponse.php index 70542ca0..8d149c42 100644 --- a/src/Folders/FolderMoveResponse.php +++ b/src/Folders/FolderMoveResponse.php @@ -11,7 +11,7 @@ /** * Job submitted successfully. A `jobId` will be returned. * - * @phpstan-type FolderMoveResponseShape = array{jobId: string} + * @phpstan-type FolderMoveResponseShape = array{jobID: string} */ final class FolderMoveResponse implements BaseModel { @@ -21,15 +21,15 @@ final class FolderMoveResponse implements BaseModel /** * Unique identifier of the bulk job. This can be used to check the status of the bulk job. */ - #[Required] - public string $jobId; + #[Required('jobId')] + public string $jobID; /** * `new FolderMoveResponse()` is missing required properties by the API. * * To enforce required parameters use * ``` - * FolderMoveResponse::with(jobId: ...) + * FolderMoveResponse::with(jobID: ...) * ``` * * Otherwise ensure the following setters are called @@ -48,11 +48,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. */ - public static function with(string $jobId): self + public static function with(string $jobID): self { $obj = new self; - $obj['jobId'] = $jobId; + $obj['jobID'] = $jobID; return $obj; } @@ -63,7 +63,7 @@ public static function with(string $jobId): self public function withJobID(string $jobID): self { $obj = clone $this; - $obj['jobId'] = $jobID; + $obj['jobID'] = $jobID; return $obj; } diff --git a/src/Folders/FolderRenameResponse.php b/src/Folders/FolderRenameResponse.php index 97ee8ee1..dd9eede6 100644 --- a/src/Folders/FolderRenameResponse.php +++ b/src/Folders/FolderRenameResponse.php @@ -11,7 +11,7 @@ /** * Job submitted successfully. A `jobId` will be returned. * - * @phpstan-type FolderRenameResponseShape = array{jobId: string} + * @phpstan-type FolderRenameResponseShape = array{jobID: string} */ final class FolderRenameResponse implements BaseModel { @@ -21,15 +21,15 @@ final class FolderRenameResponse implements BaseModel /** * Unique identifier of the bulk job. This can be used to check the status of the bulk job. */ - #[Required] - public string $jobId; + #[Required('jobId')] + public string $jobID; /** * `new FolderRenameResponse()` is missing required properties by the API. * * To enforce required parameters use * ``` - * FolderRenameResponse::with(jobId: ...) + * FolderRenameResponse::with(jobID: ...) * ``` * * Otherwise ensure the following setters are called @@ -48,11 +48,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. */ - public static function with(string $jobId): self + public static function with(string $jobID): self { $obj = new self; - $obj['jobId'] = $jobId; + $obj['jobID'] = $jobID; return $obj; } @@ -63,7 +63,7 @@ public static function with(string $jobId): self public function withJobID(string $jobID): self { $obj = clone $this; - $obj['jobId'] = $jobID; + $obj['jobID'] = $jobID; return $obj; } diff --git a/src/Folders/Job/JobGetResponse.php b/src/Folders/Job/JobGetResponse.php index 4609e000..5b526d04 100644 --- a/src/Folders/Job/JobGetResponse.php +++ b/src/Folders/Job/JobGetResponse.php @@ -12,8 +12,8 @@ /** * @phpstan-type JobGetResponseShape = array{ - * jobId?: string|null, - * purgeRequestId?: string|null, + * jobID?: string|null, + * purgeRequestID?: string|null, * status?: value-of|null, * type?: value-of|null, * } @@ -26,14 +26,14 @@ final class JobGetResponse implements BaseModel /** * Unique identifier of the bulk job. */ - #[Optional] - public ?string $jobId; + #[Optional('jobId')] + public ?string $jobID; /** * Unique identifier of the purge request. This will be present only if `purgeCache` is set to `true` in the rename folder API request. */ - #[Optional] - public ?string $purgeRequestId; + #[Optional('purgeRequestId')] + public ?string $purgeRequestID; /** * Status of the bulk job. @@ -65,15 +65,15 @@ public function __construct() * @param Type|value-of $type */ public static function with( - ?string $jobId = null, - ?string $purgeRequestId = null, + ?string $jobID = null, + ?string $purgeRequestID = null, Status|string|null $status = null, Type|string|null $type = null, ): self { $obj = new self; - null !== $jobId && $obj['jobId'] = $jobId; - null !== $purgeRequestId && $obj['purgeRequestId'] = $purgeRequestId; + null !== $jobID && $obj['jobID'] = $jobID; + null !== $purgeRequestID && $obj['purgeRequestID'] = $purgeRequestID; null !== $status && $obj['status'] = $status; null !== $type && $obj['type'] = $type; @@ -86,7 +86,7 @@ public static function with( public function withJobID(string $jobID): self { $obj = clone $this; - $obj['jobId'] = $jobID; + $obj['jobID'] = $jobID; return $obj; } @@ -97,7 +97,7 @@ public function withJobID(string $jobID): self public function withPurgeRequestID(string $purgeRequestID): self { $obj = clone $this; - $obj['purgeRequestId'] = $purgeRequestID; + $obj['purgeRequestID'] = $purgeRequestID; return $obj; } diff --git a/src/ServiceContracts/Accounts/OriginsContract.php b/src/ServiceContracts/Accounts/OriginsContract.php index f0ee81c3..5d91c41b 100644 --- a/src/ServiceContracts/Accounts/OriginsContract.php +++ b/src/ServiceContracts/Accounts/OriginsContract.php @@ -4,6 +4,7 @@ namespace Imagekit\ServiceContracts\Accounts; +use Imagekit\Accounts\Origins\OriginCreateParams; use Imagekit\Accounts\Origins\OriginResponse\AkeneoPim; use Imagekit\Accounts\Origins\OriginResponse\AzureBlob; use Imagekit\Accounts\Origins\OriginResponse\CloudinaryBackup; @@ -12,6 +13,7 @@ use Imagekit\Accounts\Origins\OriginResponse\S3Compatible; use Imagekit\Accounts\Origins\OriginResponse\WebFolder; use Imagekit\Accounts\Origins\OriginResponse\WebProxy; +use Imagekit\Accounts\Origins\OriginUpdateParams; use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; @@ -20,22 +22,26 @@ interface OriginsContract /** * @api * + * @param array|OriginCreateParams $params + * * @throws APIException */ public function create( - mixed $params, + array|OriginCreateParams $params, ?RequestOptions $requestOptions = null ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim; /** * @api * + * @param array|OriginUpdateParams $params + * * @throws APIException */ public function update( string $id, - mixed $params, - ?RequestOptions $requestOptions = null + array|OriginUpdateParams $params, + ?RequestOptions $requestOptions = null, ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim; /** diff --git a/src/ServiceContracts/FilesContract.php b/src/ServiceContracts/FilesContract.php index bfbdf338..352285d1 100644 --- a/src/ServiceContracts/FilesContract.php +++ b/src/ServiceContracts/FilesContract.php @@ -12,6 +12,7 @@ use Imagekit\Files\FileMoveResponse; use Imagekit\Files\FileRenameParams; use Imagekit\Files\FileRenameResponse; +use Imagekit\Files\FileUpdateParams; use Imagekit\Files\FileUpdateResponse; use Imagekit\Files\FileUploadParams; use Imagekit\Files\FileUploadResponse; @@ -22,12 +23,14 @@ interface FilesContract /** * @api * + * @param array|FileUpdateParams $params + * * @throws APIException */ public function update( string $fileID, - mixed $params, - ?RequestOptions $requestOptions = null + array|FileUpdateParams $params, + ?RequestOptions $requestOptions = null, ): FileUpdateResponse; /** diff --git a/src/Services/Accounts/OriginsService.php b/src/Services/Accounts/OriginsService.php index 81df12dd..9d02de86 100644 --- a/src/Services/Accounts/OriginsService.php +++ b/src/Services/Accounts/OriginsService.php @@ -35,10 +35,34 @@ public function __construct(private Client $client) {} * **Note:** This API is currently in beta. * Creates a new origin and returns the origin object. * + * @param array{ + * accessKey: string, + * bucket: string, + * name: string, + * secretKey: string, + * type?: 'AKENEO_PIM', + * baseURLForCanonicalHeader?: string, + * includeCanonicalHeader?: bool, + * prefix?: string, + * endpoint: string, + * s3ForcePathStyle?: bool, + * baseURL: string, + * forwardHostHeaderToOrigin?: bool, + * clientEmail: string, + * privateKey: string, + * accountName: string, + * container: string, + * sasToken: string, + * clientID: string, + * clientSecret: string, + * password: string, + * username: string, + * }|OriginCreateParams $params + * * @throws APIException */ public function create( - mixed $params, + array|OriginCreateParams $params, ?RequestOptions $requestOptions = null ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { [$parsed, $options] = OriginCreateParams::parseRequest( @@ -64,12 +88,36 @@ public function create( * **Note:** This API is currently in beta. * Updates the origin identified by `id` and returns the updated origin object. * + * @param array{ + * accessKey: string, + * bucket: string, + * name: string, + * secretKey: string, + * type?: 'AKENEO_PIM', + * baseURLForCanonicalHeader?: string, + * includeCanonicalHeader?: bool, + * prefix?: string, + * endpoint: string, + * s3ForcePathStyle?: bool, + * baseURL: string, + * forwardHostHeaderToOrigin?: bool, + * clientEmail: string, + * privateKey: string, + * accountName: string, + * container: string, + * sasToken: string, + * clientID: string, + * clientSecret: string, + * password: string, + * username: string, + * }|OriginUpdateParams $params + * * @throws APIException */ public function update( string $id, - mixed $params, - ?RequestOptions $requestOptions = null + array|OriginUpdateParams $params, + ?RequestOptions $requestOptions = null, ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { [$parsed, $options] = OriginUpdateParams::parseRequest( $params, diff --git a/src/Services/Beta/V2/FilesService.php b/src/Services/Beta/V2/FilesService.php index ff6ef791..74335188 100644 --- a/src/Services/Beta/V2/FilesService.php +++ b/src/Services/Beta/V2/FilesService.php @@ -58,7 +58,7 @@ public function __construct(private Client $client) {} * tags?: list, * transformation?: array{post?: list>, pre?: string}, * useUniqueFileName?: bool, - * webhookUrl?: string, + * webhookURL?: string, * }|FileUploadParams $params * * @throws APIException diff --git a/src/Services/Files/BulkService.php b/src/Services/Files/BulkService.php index 241bb158..61833f1f 100644 --- a/src/Services/Files/BulkService.php +++ b/src/Services/Files/BulkService.php @@ -34,7 +34,7 @@ public function __construct(private Client $client) {} * * A maximum of 100 files can be deleted at a time. * - * @param array{fileIds: list}|BulkDeleteParams $params + * @param array{fileIDs: list}|BulkDeleteParams $params * * @throws APIException */ @@ -65,7 +65,7 @@ public function delete( * This API adds tags to multiple files in bulk. A maximum of 50 files can be specified at a time. * * @param array{ - * fileIds: list, tags: list + * fileIDs: list, tags: list * }|BulkAddTagsParams $params * * @throws APIException @@ -97,7 +97,7 @@ public function addTags( * This API removes AITags from multiple files in bulk. A maximum of 50 files can be specified at a time. * * @param array{ - * AITags: list, fileIds: list + * aiTags: list, fileIDs: list * }|BulkRemoveAITagsParams $params * * @throws APIException @@ -129,7 +129,7 @@ public function removeAITags( * This API removes tags from multiple files in bulk. A maximum of 50 files can be specified at a time. * * @param array{ - * fileIds: list, tags: list + * fileIDs: list, tags: list * }|BulkRemoveTagsParams $params * * @throws APIException diff --git a/src/Services/Files/VersionsService.php b/src/Services/Files/VersionsService.php index 0d28ec12..83512ac1 100644 --- a/src/Services/Files/VersionsService.php +++ b/src/Services/Files/VersionsService.php @@ -54,7 +54,7 @@ public function list( * * Note: If you want to delete all versions of a file, use the delete file API. * - * @param array{fileId: string}|VersionDeleteParams $params + * @param array{fileID: string}|VersionDeleteParams $params * * @throws APIException */ @@ -67,8 +67,8 @@ public function delete( $params, $requestOptions, ); - $fileID = $parsed['fileId']; - unset($parsed['fileId']); + $fileID = $parsed['fileID']; + unset($parsed['fileID']); /** @var BaseResponse */ $response = $this->client->request( @@ -86,7 +86,7 @@ public function delete( * * This API returns an object with details or attributes of a file version. * - * @param array{fileId: string}|VersionGetParams $params + * @param array{fileID: string}|VersionGetParams $params * * @throws APIException */ @@ -99,8 +99,8 @@ public function get( $params, $requestOptions, ); - $fileID = $parsed['fileId']; - unset($parsed['fileId']); + $fileID = $parsed['fileID']; + unset($parsed['fileID']); /** @var BaseResponse */ $response = $this->client->request( @@ -118,7 +118,7 @@ public function get( * * This API restores a file version as the current file version. * - * @param array{fileId: string}|VersionRestoreParams $params + * @param array{fileID: string}|VersionRestoreParams $params * * @throws APIException */ @@ -131,8 +131,8 @@ public function restore( $params, $requestOptions, ); - $fileID = $parsed['fileId']; - unset($parsed['fileId']); + $fileID = $parsed['fileID']; + unset($parsed['fileID']); /** @var BaseResponse */ $response = $this->client->request( diff --git a/src/Services/FilesService.php b/src/Services/FilesService.php index b038bdf7..c1a03878 100644 --- a/src/Services/FilesService.php +++ b/src/Services/FilesService.php @@ -57,12 +57,23 @@ public function __construct(private Client $client) * * This API updates the details or attributes of the current version of the file. You can update `tags`, `customCoordinates`, `customMetadata`, publication status, remove existing `AITags` and apply extensions using this API. * + * @param array{ + * customCoordinates?: string|null, + * customMetadata?: array, + * description?: string, + * extensions?: list>, + * removeAITags?: 'all'|list, + * tags?: list|null, + * webhookURL?: string, + * publish?: array{isPublished: bool, includeFileVersions?: bool}, + * }|FileUpdateParams $params + * * @throws APIException */ public function update( string $fileID, - mixed $params, - ?RequestOptions $requestOptions = null + array|FileUpdateParams $params, + ?RequestOptions $requestOptions = null, ): FileUpdateResponse { [$parsed, $options] = FileUpdateParams::parseRequest( $params, @@ -270,7 +281,7 @@ public function rename( * tags?: list, * transformation?: array{post?: list>, pre?: string}, * useUniqueFileName?: bool, - * webhookUrl?: string, + * webhookURL?: string, * }|FileUploadParams $params * * @throws APIException diff --git a/src/Webhooks/UploadPostTransformErrorEvent.php b/src/Webhooks/UploadPostTransformErrorEvent.php index 2a4637b5..fc9788ba 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent.php +++ b/src/Webhooks/UploadPostTransformErrorEvent.php @@ -17,7 +17,7 @@ * @phpstan-type UploadPostTransformErrorEventShape = array{ * id: string, * type: string, - * created_at: \DateTimeInterface, + * createdAt: \DateTimeInterface, * data: Data, * request: Request, * } @@ -42,8 +42,8 @@ final class UploadPostTransformErrorEvent implements BaseModel /** * Timestamp of when the event occurred in ISO8601 format. */ - #[Required] - public \DateTimeInterface $created_at; + #[Required('created_at')] + public \DateTimeInterface $createdAt; #[Required] public Data $data; @@ -57,7 +57,7 @@ final class UploadPostTransformErrorEvent implements BaseModel * To enforce required parameters use * ``` * UploadPostTransformErrorEvent::with( - * id: ..., type: ..., created_at: ..., data: ..., request: ... + * id: ..., type: ..., createdAt: ..., data: ..., request: ... * ) * ``` * @@ -83,7 +83,7 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Data|array{ - * fileId: string, + * fileID: string, * name: string, * path: string, * transformation: Transformation, @@ -91,13 +91,13 @@ public function __construct() * } $data * @param Request|array{ * transformation: Request\Transformation, - * x_request_id: string, + * xRequestID: string, * } $request */ public static function with( string $id, string $type, - \DateTimeInterface $created_at, + \DateTimeInterface $createdAt, Data|array $data, Request|array $request, ): self { @@ -105,7 +105,7 @@ public static function with( $obj['id'] = $id; $obj['type'] = $type; - $obj['created_at'] = $created_at; + $obj['createdAt'] = $createdAt; $obj['data'] = $data; $obj['request'] = $request; @@ -140,14 +140,14 @@ public function withType(string $type): self public function withCreatedAt(\DateTimeInterface $createdAt): self { $obj = clone $this; - $obj['created_at'] = $createdAt; + $obj['createdAt'] = $createdAt; return $obj; } /** * @param Data|array{ - * fileId: string, + * fileID: string, * name: string, * path: string, * transformation: Transformation, @@ -165,7 +165,7 @@ public function withData(Data|array $data): self /** * @param Request|array{ * transformation: Request\Transformation, - * x_request_id: string, + * xRequestID: string, * } $request */ public function withRequest(Request|array $request): self diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data.php b/src/Webhooks/UploadPostTransformErrorEvent/Data.php index 7be98b40..fb728438 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Data.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data.php @@ -12,7 +12,7 @@ /** * @phpstan-type DataShape = array{ - * fileId: string, + * fileID: string, * name: string, * path: string, * transformation: Transformation, @@ -27,8 +27,8 @@ final class Data implements BaseModel /** * Unique identifier of the originally uploaded file. */ - #[Required] - public string $fileId; + #[Required('fileId')] + public string $fileID; /** * Name of the file. @@ -56,7 +56,7 @@ final class Data implements BaseModel * * To enforce required parameters use * ``` - * Data::with(fileId: ..., name: ..., path: ..., transformation: ..., url: ...) + * Data::with(fileID: ..., name: ..., path: ..., transformation: ..., url: ...) * ``` * * Otherwise ensure the following setters are called @@ -83,7 +83,7 @@ public function __construct() * @param Transformation|array{error: Error} $transformation */ public static function with( - string $fileId, + string $fileID, string $name, string $path, Transformation|array $transformation, @@ -91,7 +91,7 @@ public static function with( ): self { $obj = new self; - $obj['fileId'] = $fileId; + $obj['fileID'] = $fileID; $obj['name'] = $name; $obj['path'] = $path; $obj['transformation'] = $transformation; @@ -106,7 +106,7 @@ public static function with( public function withFileID(string $fileID): self { $obj = clone $this; - $obj['fileId'] = $fileID; + $obj['fileID'] = $fileID; return $obj; } diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request.php b/src/Webhooks/UploadPostTransformErrorEvent/Request.php index 419fc240..5b7441ce 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request.php @@ -13,7 +13,7 @@ /** * @phpstan-type RequestShape = array{ - * transformation: Transformation, x_request_id: string + * transformation: Transformation, xRequestID: string * } */ final class Request implements BaseModel @@ -27,15 +27,15 @@ final class Request implements BaseModel /** * Unique identifier for the originating request. */ - #[Required] - public string $x_request_id; + #[Required('x_request_id')] + public string $xRequestID; /** * `new Request()` is missing required properties by the API. * * To enforce required parameters use * ``` - * Request::with(transformation: ..., x_request_id: ...) + * Request::with(transformation: ..., xRequestID: ...) * ``` * * Otherwise ensure the following setters are called @@ -60,12 +60,12 @@ public function __construct() */ public static function with( Transformation|array $transformation, - string $x_request_id + string $xRequestID ): self { $obj = new self; $obj['transformation'] = $transformation; - $obj['x_request_id'] = $x_request_id; + $obj['xRequestID'] = $xRequestID; return $obj; } @@ -90,7 +90,7 @@ public function withTransformation( public function withXRequestID(string $xRequestID): self { $obj = clone $this; - $obj['x_request_id'] = $xRequestID; + $obj['xRequestID'] = $xRequestID; return $obj; } diff --git a/src/Webhooks/UploadPostTransformSuccessEvent.php b/src/Webhooks/UploadPostTransformSuccessEvent.php index 339cdc62..29902e4d 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent.php @@ -17,7 +17,7 @@ * @phpstan-type UploadPostTransformSuccessEventShape = array{ * id: string, * type: string, - * created_at: \DateTimeInterface, + * createdAt: \DateTimeInterface, * data: Data, * request: Request, * } @@ -42,8 +42,8 @@ final class UploadPostTransformSuccessEvent implements BaseModel /** * Timestamp of when the event occurred in ISO8601 format. */ - #[Required] - public \DateTimeInterface $created_at; + #[Required('created_at')] + public \DateTimeInterface $createdAt; #[Required] public Data $data; @@ -57,7 +57,7 @@ final class UploadPostTransformSuccessEvent implements BaseModel * To enforce required parameters use * ``` * UploadPostTransformSuccessEvent::with( - * id: ..., type: ..., created_at: ..., data: ..., request: ... + * id: ..., type: ..., createdAt: ..., data: ..., request: ... * ) * ``` * @@ -82,15 +82,15 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Data|array{fileId: string, name: string, url: string} $data + * @param Data|array{fileID: string, name: string, url: string} $data * @param Request|array{ - * transformation: Transformation, x_request_id: string + * transformation: Transformation, xRequestID: string * } $request */ public static function with( string $id, string $type, - \DateTimeInterface $created_at, + \DateTimeInterface $createdAt, Data|array $data, Request|array $request, ): self { @@ -98,7 +98,7 @@ public static function with( $obj['id'] = $id; $obj['type'] = $type; - $obj['created_at'] = $created_at; + $obj['createdAt'] = $createdAt; $obj['data'] = $data; $obj['request'] = $request; @@ -133,13 +133,13 @@ public function withType(string $type): self public function withCreatedAt(\DateTimeInterface $createdAt): self { $obj = clone $this; - $obj['created_at'] = $createdAt; + $obj['createdAt'] = $createdAt; return $obj; } /** - * @param Data|array{fileId: string, name: string, url: string} $data + * @param Data|array{fileID: string, name: string, url: string} $data */ public function withData(Data|array $data): self { @@ -151,7 +151,7 @@ public function withData(Data|array $data): self /** * @param Request|array{ - * transformation: Transformation, x_request_id: string + * transformation: Transformation, xRequestID: string * } $request */ public function withRequest(Request|array $request): self diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Data.php b/src/Webhooks/UploadPostTransformSuccessEvent/Data.php index 4ef6717e..43a1721c 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Data.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Data.php @@ -9,7 +9,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type DataShape = array{fileId: string, name: string, url: string} + * @phpstan-type DataShape = array{fileID: string, name: string, url: string} */ final class Data implements BaseModel { @@ -19,8 +19,8 @@ final class Data implements BaseModel /** * Unique identifier of the originally uploaded file. */ - #[Required] - public string $fileId; + #[Required('fileId')] + public string $fileID; /** * Name of the file. @@ -39,7 +39,7 @@ final class Data implements BaseModel * * To enforce required parameters use * ``` - * Data::with(fileId: ..., name: ..., url: ...) + * Data::with(fileID: ..., name: ..., url: ...) * ``` * * Otherwise ensure the following setters are called @@ -58,11 +58,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. */ - public static function with(string $fileId, string $name, string $url): self + public static function with(string $fileID, string $name, string $url): self { $obj = new self; - $obj['fileId'] = $fileId; + $obj['fileID'] = $fileID; $obj['name'] = $name; $obj['url'] = $url; @@ -75,7 +75,7 @@ public static function with(string $fileId, string $name, string $url): self public function withFileID(string $fileID): self { $obj = clone $this; - $obj['fileId'] = $fileID; + $obj['fileID'] = $fileID; return $obj; } diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request.php index 33ad81e9..161f26b8 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request.php @@ -13,7 +13,7 @@ /** * @phpstan-type RequestShape = array{ - * transformation: Transformation, x_request_id: string + * transformation: Transformation, xRequestID: string * } */ final class Request implements BaseModel @@ -27,15 +27,15 @@ final class Request implements BaseModel /** * Unique identifier for the originating request. */ - #[Required] - public string $x_request_id; + #[Required('x_request_id')] + public string $xRequestID; /** * `new Request()` is missing required properties by the API. * * To enforce required parameters use * ``` - * Request::with(transformation: ..., x_request_id: ...) + * Request::with(transformation: ..., xRequestID: ...) * ``` * * Otherwise ensure the following setters are called @@ -60,12 +60,12 @@ public function __construct() */ public static function with( Transformation|array $transformation, - string $x_request_id + string $xRequestID ): self { $obj = new self; $obj['transformation'] = $transformation; - $obj['x_request_id'] = $x_request_id; + $obj['xRequestID'] = $xRequestID; return $obj; } @@ -90,7 +90,7 @@ public function withTransformation( public function withXRequestID(string $xRequestID): self { $obj = clone $this; - $obj['x_request_id'] = $xRequestID; + $obj['xRequestID'] = $xRequestID; return $obj; } diff --git a/src/Webhooks/UploadPreTransformErrorEvent.php b/src/Webhooks/UploadPreTransformErrorEvent.php index 3c71fdaf..650803b3 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent.php +++ b/src/Webhooks/UploadPreTransformErrorEvent.php @@ -17,7 +17,7 @@ * @phpstan-type UploadPreTransformErrorEventShape = array{ * id: string, * type: string, - * created_at: \DateTimeInterface, + * createdAt: \DateTimeInterface, * data: Data, * request: Request, * } @@ -42,8 +42,8 @@ final class UploadPreTransformErrorEvent implements BaseModel /** * Timestamp of when the event occurred in ISO8601 format. */ - #[Required] - public \DateTimeInterface $created_at; + #[Required('created_at')] + public \DateTimeInterface $createdAt; #[Required] public Data $data; @@ -57,7 +57,7 @@ final class UploadPreTransformErrorEvent implements BaseModel * To enforce required parameters use * ``` * UploadPreTransformErrorEvent::with( - * id: ..., type: ..., created_at: ..., data: ..., request: ... + * id: ..., type: ..., createdAt: ..., data: ..., request: ... * ) * ``` * @@ -85,12 +85,12 @@ public function __construct() * @param Data|array{ * name: string, path: string, transformation: Transformation * } $data - * @param Request|array{transformation: string, x_request_id: string} $request + * @param Request|array{transformation: string, xRequestID: string} $request */ public static function with( string $id, string $type, - \DateTimeInterface $created_at, + \DateTimeInterface $createdAt, Data|array $data, Request|array $request, ): self { @@ -98,7 +98,7 @@ public static function with( $obj['id'] = $id; $obj['type'] = $type; - $obj['created_at'] = $created_at; + $obj['createdAt'] = $createdAt; $obj['data'] = $data; $obj['request'] = $request; @@ -133,7 +133,7 @@ public function withType(string $type): self public function withCreatedAt(\DateTimeInterface $createdAt): self { $obj = clone $this; - $obj['created_at'] = $createdAt; + $obj['createdAt'] = $createdAt; return $obj; } @@ -152,7 +152,7 @@ public function withData(Data|array $data): self } /** - * @param Request|array{transformation: string, x_request_id: string} $request + * @param Request|array{transformation: string, xRequestID: string} $request */ public function withRequest(Request|array $request): self { diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Request.php b/src/Webhooks/UploadPreTransformErrorEvent/Request.php index 26ca2132..2730c0d9 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Request.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Request.php @@ -9,7 +9,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type RequestShape = array{transformation: string, x_request_id: string} + * @phpstan-type RequestShape = array{transformation: string, xRequestID: string} */ final class Request implements BaseModel { @@ -25,15 +25,15 @@ final class Request implements BaseModel /** * Unique identifier for the originating request. */ - #[Required] - public string $x_request_id; + #[Required('x_request_id')] + public string $xRequestID; /** * `new Request()` is missing required properties by the API. * * To enforce required parameters use * ``` - * Request::with(transformation: ..., x_request_id: ...) + * Request::with(transformation: ..., xRequestID: ...) * ``` * * Otherwise ensure the following setters are called @@ -54,12 +54,12 @@ public function __construct() */ public static function with( string $transformation, - string $x_request_id + string $xRequestID ): self { $obj = new self; $obj['transformation'] = $transformation; - $obj['x_request_id'] = $x_request_id; + $obj['xRequestID'] = $xRequestID; return $obj; } @@ -81,7 +81,7 @@ public function withTransformation(string $transformation): self public function withXRequestID(string $xRequestID): self { $obj = clone $this; - $obj['x_request_id'] = $xRequestID; + $obj['xRequestID'] = $xRequestID; return $obj; } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent.php b/src/Webhooks/UploadPreTransformSuccessEvent.php index bc5d1643..937b8ca2 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent.php @@ -21,7 +21,7 @@ * @phpstan-type UploadPreTransformSuccessEventShape = array{ * id: string, * type: string, - * created_at: \DateTimeInterface, + * createdAt: \DateTimeInterface, * data: Data, * request: Request, * } @@ -46,8 +46,8 @@ final class UploadPreTransformSuccessEvent implements BaseModel /** * Timestamp of when the event occurred in ISO8601 format. */ - #[Required] - public \DateTimeInterface $created_at; + #[Required('created_at')] + public \DateTimeInterface $createdAt; /** * Object containing details of a successful upload. @@ -64,7 +64,7 @@ final class UploadPreTransformSuccessEvent implements BaseModel * To enforce required parameters use * ``` * UploadPreTransformSuccessEvent::with( - * id: ..., type: ..., created_at: ..., data: ..., request: ... + * id: ..., type: ..., createdAt: ..., data: ..., request: ... * ) * ``` * @@ -90,7 +90,7 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Data|array{ - * AITags?: list|null, + * aiTags?: list|null, * audioCodec?: string|null, * bitRate?: int|null, * customCoordinates?: string|null, @@ -99,7 +99,7 @@ public function __construct() * duration?: int|null, * embeddedMetadata?: array|null, * extensionStatus?: ExtensionStatus|null, - * fileId?: string|null, + * fileID?: string|null, * filePath?: string|null, * fileType?: string|null, * height?: float|null, @@ -110,18 +110,18 @@ public function __construct() * selectedFieldsSchema?: array|null, * size?: float|null, * tags?: list|null, - * thumbnailUrl?: string|null, + * thumbnailURL?: string|null, * url?: string|null, * versionInfo?: VersionInfo|null, * videoCodec?: string|null, * width?: float|null, * } $data - * @param Request|array{transformation: string, x_request_id: string} $request + * @param Request|array{transformation: string, xRequestID: string} $request */ public static function with( string $id, string $type, - \DateTimeInterface $created_at, + \DateTimeInterface $createdAt, Data|array $data, Request|array $request, ): self { @@ -129,7 +129,7 @@ public static function with( $obj['id'] = $id; $obj['type'] = $type; - $obj['created_at'] = $created_at; + $obj['createdAt'] = $createdAt; $obj['data'] = $data; $obj['request'] = $request; @@ -164,7 +164,7 @@ public function withType(string $type): self public function withCreatedAt(\DateTimeInterface $createdAt): self { $obj = clone $this; - $obj['created_at'] = $createdAt; + $obj['createdAt'] = $createdAt; return $obj; } @@ -173,7 +173,7 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self * Object containing details of a successful upload. * * @param Data|array{ - * AITags?: list|null, + * aiTags?: list|null, * audioCodec?: string|null, * bitRate?: int|null, * customCoordinates?: string|null, @@ -182,7 +182,7 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self * duration?: int|null, * embeddedMetadata?: array|null, * extensionStatus?: ExtensionStatus|null, - * fileId?: string|null, + * fileID?: string|null, * filePath?: string|null, * fileType?: string|null, * height?: float|null, @@ -193,7 +193,7 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self * selectedFieldsSchema?: array|null, * size?: float|null, * tags?: list|null, - * thumbnailUrl?: string|null, + * thumbnailURL?: string|null, * url?: string|null, * versionInfo?: VersionInfo|null, * videoCodec?: string|null, @@ -209,7 +209,7 @@ public function withData(Data|array $data): self } /** - * @param Request|array{transformation: string, x_request_id: string} $request + * @param Request|array{transformation: string, xRequestID: string} $request */ public function withRequest(Request|array $request): self { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php index 88285b38..e10ed1f6 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php @@ -23,7 +23,7 @@ * Object containing details of a successful upload. * * @phpstan-type DataShape = array{ - * AITags?: list|null, + * aiTags?: list|null, * audioCodec?: string|null, * bitRate?: int|null, * customCoordinates?: string|null, @@ -32,7 +32,7 @@ * duration?: int|null, * embeddedMetadata?: array|null, * extensionStatus?: ExtensionStatus|null, - * fileId?: string|null, + * fileID?: string|null, * filePath?: string|null, * fileType?: string|null, * height?: float|null, @@ -43,7 +43,7 @@ * selectedFieldsSchema?: array|null, * size?: float|null, * tags?: list|null, - * thumbnailUrl?: string|null, + * thumbnailURL?: string|null, * url?: string|null, * versionInfo?: VersionInfo|null, * videoCodec?: string|null, @@ -58,10 +58,10 @@ final class Data implements BaseModel /** * An array of tags assigned to the uploaded file by auto tagging. * - * @var list|null $AITags + * @var list|null $aiTags */ - #[Optional(list: AITag::class, nullable: true)] - public ?array $AITags; + #[Optional('AITags', list: AITag::class, nullable: true)] + public ?array $aiTags; /** * The audio codec used in the video (only for video). @@ -124,8 +124,8 @@ final class Data implements BaseModel /** * Unique fileId. Store this fileld in your database, as this will be used to perform update action on this file. */ - #[Optional] - public ?string $fileId; + #[Optional('fileId')] + public ?string $fileID; /** * The relative path of the file in the media library e.g. `/marketing-assets/new-banner.jpg`. @@ -198,8 +198,8 @@ final class Data implements BaseModel /** * In the case of an image, a small thumbnail URL. */ - #[Optional] - public ?string $thumbnailUrl; + #[Optional('thumbnailUrl')] + public ?string $thumbnailURL; /** * A publicly accessible URL of the file. @@ -237,14 +237,14 @@ public function __construct() * * @param list|null $AITags + * }>|null $aiTags * @param array $customMetadata * @param array $embeddedMetadata * @param ExtensionStatus|array{ - * ai_auto_description?: value-of|null, - * aws_auto_tagging?: value-of|null, - * google_auto_tagging?: value-of|null, - * remove_bg?: value-of|null, + * aiAutoDescription?: value-of|null, + * awsAutoTagging?: value-of|null, + * googleAutoTagging?: value-of|null, + * removeBg?: value-of|null, * } $extensionStatus * @param Metadata|array{ * audioCodec?: string|null, @@ -278,7 +278,7 @@ public function __construct() * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo */ public static function with( - ?array $AITags = null, + ?array $aiTags = null, ?string $audioCodec = null, ?int $bitRate = null, ?string $customCoordinates = null, @@ -287,7 +287,7 @@ public static function with( ?int $duration = null, ?array $embeddedMetadata = null, ExtensionStatus|array|null $extensionStatus = null, - ?string $fileId = null, + ?string $fileID = null, ?string $filePath = null, ?string $fileType = null, ?float $height = null, @@ -298,7 +298,7 @@ public static function with( ?array $selectedFieldsSchema = null, ?float $size = null, ?array $tags = null, - ?string $thumbnailUrl = null, + ?string $thumbnailURL = null, ?string $url = null, VersionInfo|array|null $versionInfo = null, ?string $videoCodec = null, @@ -306,7 +306,7 @@ public static function with( ): self { $obj = new self; - null !== $AITags && $obj['AITags'] = $AITags; + null !== $aiTags && $obj['aiTags'] = $aiTags; null !== $audioCodec && $obj['audioCodec'] = $audioCodec; null !== $bitRate && $obj['bitRate'] = $bitRate; null !== $customCoordinates && $obj['customCoordinates'] = $customCoordinates; @@ -315,7 +315,7 @@ public static function with( null !== $duration && $obj['duration'] = $duration; null !== $embeddedMetadata && $obj['embeddedMetadata'] = $embeddedMetadata; null !== $extensionStatus && $obj['extensionStatus'] = $extensionStatus; - null !== $fileId && $obj['fileId'] = $fileId; + null !== $fileID && $obj['fileID'] = $fileID; null !== $filePath && $obj['filePath'] = $filePath; null !== $fileType && $obj['fileType'] = $fileType; null !== $height && $obj['height'] = $height; @@ -326,7 +326,7 @@ public static function with( null !== $selectedFieldsSchema && $obj['selectedFieldsSchema'] = $selectedFieldsSchema; null !== $size && $obj['size'] = $size; null !== $tags && $obj['tags'] = $tags; - null !== $thumbnailUrl && $obj['thumbnailUrl'] = $thumbnailUrl; + null !== $thumbnailURL && $obj['thumbnailURL'] = $thumbnailURL; null !== $url && $obj['url'] = $url; null !== $versionInfo && $obj['versionInfo'] = $versionInfo; null !== $videoCodec && $obj['videoCodec'] = $videoCodec; @@ -345,7 +345,7 @@ public static function with( public function withAITags(?array $aiTags): self { $obj = clone $this; - $obj['AITags'] = $aiTags; + $obj['aiTags'] = $aiTags; return $obj; } @@ -441,10 +441,10 @@ public function withEmbeddedMetadata(array $embeddedMetadata): self * If no extension was requested, then this parameter is not returned. * * @param ExtensionStatus|array{ - * ai_auto_description?: value-of|null, - * aws_auto_tagging?: value-of|null, - * google_auto_tagging?: value-of|null, - * remove_bg?: value-of|null, + * aiAutoDescription?: value-of|null, + * awsAutoTagging?: value-of|null, + * googleAutoTagging?: value-of|null, + * removeBg?: value-of|null, * } $extensionStatus */ public function withExtensionStatus( @@ -462,7 +462,7 @@ public function withExtensionStatus( public function withFileID(string $fileID): self { $obj = clone $this; - $obj['fileId'] = $fileID; + $obj['fileID'] = $fileID; return $obj; } @@ -619,7 +619,7 @@ public function withTags(?array $tags): self public function withThumbnailURL(string $thumbnailURL): self { $obj = clone $this; - $obj['thumbnailUrl'] = $thumbnailURL; + $obj['thumbnailURL'] = $thumbnailURL; return $obj; } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php index 31ead371..83d18636 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php @@ -22,10 +22,10 @@ * If no extension was requested, then this parameter is not returned. * * @phpstan-type ExtensionStatusShape = array{ - * ai_auto_description?: value-of|null, - * aws_auto_tagging?: value-of|null, - * google_auto_tagging?: value-of|null, - * remove_bg?: value-of|null, + * aiAutoDescription?: value-of|null, + * awsAutoTagging?: value-of|null, + * googleAutoTagging?: value-of|null, + * removeBg?: value-of|null, * } */ final class ExtensionStatus implements BaseModel @@ -33,21 +33,21 @@ final class ExtensionStatus implements BaseModel /** @use SdkModel */ use SdkModel; - /** @var value-of|null $ai_auto_description */ + /** @var value-of|null $aiAutoDescription */ #[Optional('ai-auto-description', enum: AIAutoDescription::class)] - public ?string $ai_auto_description; + public ?string $aiAutoDescription; - /** @var value-of|null $aws_auto_tagging */ + /** @var value-of|null $awsAutoTagging */ #[Optional('aws-auto-tagging', enum: AwsAutoTagging::class)] - public ?string $aws_auto_tagging; + public ?string $awsAutoTagging; - /** @var value-of|null $google_auto_tagging */ + /** @var value-of|null $googleAutoTagging */ #[Optional('google-auto-tagging', enum: GoogleAutoTagging::class)] - public ?string $google_auto_tagging; + public ?string $googleAutoTagging; - /** @var value-of|null $remove_bg */ + /** @var value-of|null $removeBg */ #[Optional('remove-bg', enum: RemoveBg::class)] - public ?string $remove_bg; + public ?string $removeBg; public function __construct() { @@ -59,23 +59,23 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AIAutoDescription|value-of $ai_auto_description - * @param AwsAutoTagging|value-of $aws_auto_tagging - * @param GoogleAutoTagging|value-of $google_auto_tagging - * @param RemoveBg|value-of $remove_bg + * @param AIAutoDescription|value-of $aiAutoDescription + * @param AwsAutoTagging|value-of $awsAutoTagging + * @param GoogleAutoTagging|value-of $googleAutoTagging + * @param RemoveBg|value-of $removeBg */ public static function with( - AIAutoDescription|string|null $ai_auto_description = null, - AwsAutoTagging|string|null $aws_auto_tagging = null, - GoogleAutoTagging|string|null $google_auto_tagging = null, - RemoveBg|string|null $remove_bg = null, + AIAutoDescription|string|null $aiAutoDescription = null, + AwsAutoTagging|string|null $awsAutoTagging = null, + GoogleAutoTagging|string|null $googleAutoTagging = null, + RemoveBg|string|null $removeBg = null, ): self { $obj = new self; - null !== $ai_auto_description && $obj['ai_auto_description'] = $ai_auto_description; - null !== $aws_auto_tagging && $obj['aws_auto_tagging'] = $aws_auto_tagging; - null !== $google_auto_tagging && $obj['google_auto_tagging'] = $google_auto_tagging; - null !== $remove_bg && $obj['remove_bg'] = $remove_bg; + null !== $aiAutoDescription && $obj['aiAutoDescription'] = $aiAutoDescription; + null !== $awsAutoTagging && $obj['awsAutoTagging'] = $awsAutoTagging; + null !== $googleAutoTagging && $obj['googleAutoTagging'] = $googleAutoTagging; + null !== $removeBg && $obj['removeBg'] = $removeBg; return $obj; } @@ -87,7 +87,7 @@ public function withAIAutoDescription( AIAutoDescription|string $aiAutoDescription ): self { $obj = clone $this; - $obj['ai_auto_description'] = $aiAutoDescription; + $obj['aiAutoDescription'] = $aiAutoDescription; return $obj; } @@ -99,7 +99,7 @@ public function withAwsAutoTagging( AwsAutoTagging|string $awsAutoTagging ): self { $obj = clone $this; - $obj['aws_auto_tagging'] = $awsAutoTagging; + $obj['awsAutoTagging'] = $awsAutoTagging; return $obj; } @@ -111,7 +111,7 @@ public function withGoogleAutoTagging( GoogleAutoTagging|string $googleAutoTagging ): self { $obj = clone $this; - $obj['google_auto_tagging'] = $googleAutoTagging; + $obj['googleAutoTagging'] = $googleAutoTagging; return $obj; } @@ -122,7 +122,7 @@ public function withGoogleAutoTagging( public function withRemoveBg(RemoveBg|string $removeBg): self { $obj = clone $this; - $obj['remove_bg'] = $removeBg; + $obj['removeBg'] = $removeBg; return $obj; } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Request.php b/src/Webhooks/UploadPreTransformSuccessEvent/Request.php index 5e0ad3ba..7486c472 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Request.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Request.php @@ -9,7 +9,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type RequestShape = array{transformation: string, x_request_id: string} + * @phpstan-type RequestShape = array{transformation: string, xRequestID: string} */ final class Request implements BaseModel { @@ -25,15 +25,15 @@ final class Request implements BaseModel /** * Unique identifier for the originating request. */ - #[Required] - public string $x_request_id; + #[Required('x_request_id')] + public string $xRequestID; /** * `new Request()` is missing required properties by the API. * * To enforce required parameters use * ``` - * Request::with(transformation: ..., x_request_id: ...) + * Request::with(transformation: ..., xRequestID: ...) * ``` * * Otherwise ensure the following setters are called @@ -54,12 +54,12 @@ public function __construct() */ public static function with( string $transformation, - string $x_request_id + string $xRequestID ): self { $obj = new self; $obj['transformation'] = $transformation; - $obj['x_request_id'] = $x_request_id; + $obj['xRequestID'] = $xRequestID; return $obj; } @@ -81,7 +81,7 @@ public function withTransformation(string $transformation): self public function withXRequestID(string $xRequestID): self { $obj = clone $this; - $obj['x_request_id'] = $xRequestID; + $obj['xRequestID'] = $xRequestID; return $obj; } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent.php b/src/Webhooks/VideoTransformationAcceptedEvent.php index 140523ac..99ac46c8 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent.php @@ -18,7 +18,7 @@ * @phpstan-type VideoTransformationAcceptedEventShape = array{ * id: string, * type: string, - * created_at: \DateTimeInterface, + * createdAt: \DateTimeInterface, * data: Data, * request: Request, * } @@ -43,8 +43,8 @@ final class VideoTransformationAcceptedEvent implements BaseModel /** * Timestamp when the event was created in ISO8601 format. */ - #[Required] - public \DateTimeInterface $created_at; + #[Required('created_at')] + public \DateTimeInterface $createdAt; #[Required] public Data $data; @@ -61,7 +61,7 @@ final class VideoTransformationAcceptedEvent implements BaseModel * To enforce required parameters use * ``` * VideoTransformationAcceptedEvent::with( - * id: ..., type: ..., created_at: ..., data: ..., request: ... + * id: ..., type: ..., createdAt: ..., data: ..., request: ... * ) * ``` * @@ -88,13 +88,13 @@ public function __construct() * * @param Data|array{asset: Asset, transformation: Transformation} $data * @param Request|array{ - * url: string, x_request_id: string, user_agent?: string|null + * url: string, xRequestID: string, userAgent?: string|null * } $request */ public static function with( string $id, string $type, - \DateTimeInterface $created_at, + \DateTimeInterface $createdAt, Data|array $data, Request|array $request, ): self { @@ -102,7 +102,7 @@ public static function with( $obj['id'] = $id; $obj['type'] = $type; - $obj['created_at'] = $created_at; + $obj['createdAt'] = $createdAt; $obj['data'] = $data; $obj['request'] = $request; @@ -137,7 +137,7 @@ public function withType(string $type): self public function withCreatedAt(\DateTimeInterface $createdAt): self { $obj = clone $this; - $obj['created_at'] = $createdAt; + $obj['createdAt'] = $createdAt; return $obj; } @@ -157,7 +157,7 @@ public function withData(Data|array $data): self * Information about the original request that triggered the video transformation. * * @param Request|array{ - * url: string, x_request_id: string, user_agent?: string|null + * url: string, xRequestID: string, userAgent?: string|null * } $request */ public function withRequest(Request|array $request): self diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php index 89b47c1a..ad10d4be 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php @@ -70,13 +70,13 @@ public function __construct() * * @param Type|value-of $type * @param Options|array{ - * audio_codec?: value-of|null, - * auto_rotate?: bool|null, + * audioCodec?: value-of|null, + * autoRotate?: bool|null, * format?: value-of|null, * quality?: int|null, - * stream_protocol?: value-of|null, + * streamProtocol?: value-of|null, * variants?: list|null, - * video_codec?: value-of|null, + * videoCodec?: value-of|null, * } $options */ public static function with( @@ -112,13 +112,13 @@ public function withType(Type|string $type): self * Configuration options for video transformations. * * @param Options|array{ - * audio_codec?: value-of|null, - * auto_rotate?: bool|null, + * audioCodec?: value-of|null, + * autoRotate?: bool|null, * format?: value-of|null, * quality?: int|null, - * stream_protocol?: value-of|null, + * streamProtocol?: value-of|null, * variants?: list|null, - * video_codec?: value-of|null, + * videoCodec?: value-of|null, * } $options */ public function withOptions(Options|array $options): self diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php index dd58a52e..bcbbc039 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php @@ -16,13 +16,13 @@ * Configuration options for video transformations. * * @phpstan-type OptionsShape = array{ - * audio_codec?: value-of|null, - * auto_rotate?: bool|null, + * audioCodec?: value-of|null, + * autoRotate?: bool|null, * format?: value-of|null, * quality?: int|null, - * stream_protocol?: value-of|null, + * streamProtocol?: value-of|null, * variants?: list|null, - * video_codec?: value-of|null, + * videoCodec?: value-of|null, * } */ final class Options implements BaseModel @@ -33,16 +33,16 @@ final class Options implements BaseModel /** * Audio codec used for encoding (aac or opus). * - * @var value-of|null $audio_codec + * @var value-of|null $audioCodec */ - #[Optional(enum: AudioCodec::class)] - public ?string $audio_codec; + #[Optional('audio_codec', enum: AudioCodec::class)] + public ?string $audioCodec; /** * Whether to automatically rotate the video based on metadata. */ - #[Optional] - public ?bool $auto_rotate; + #[Optional('auto_rotate')] + public ?bool $autoRotate; /** * Output format for the transformed video or thumbnail. @@ -61,10 +61,10 @@ final class Options implements BaseModel /** * Streaming protocol for adaptive bitrate streaming. * - * @var value-of|null $stream_protocol + * @var value-of|null $streamProtocol */ - #[Optional(enum: StreamProtocol::class)] - public ?string $stream_protocol; + #[Optional('stream_protocol', enum: StreamProtocol::class)] + public ?string $streamProtocol; /** * Array of quality representations for adaptive bitrate streaming. @@ -77,10 +77,10 @@ final class Options implements BaseModel /** * Video codec used for encoding (h264, vp9, or av1). * - * @var value-of|null $video_codec + * @var value-of|null $videoCodec */ - #[Optional(enum: VideoCodec::class)] - public ?string $video_codec; + #[Optional('video_codec', enum: VideoCodec::class)] + public ?string $videoCodec; public function __construct() { @@ -92,30 +92,30 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AudioCodec|value-of $audio_codec + * @param AudioCodec|value-of $audioCodec * @param Format|value-of $format - * @param StreamProtocol|value-of $stream_protocol + * @param StreamProtocol|value-of $streamProtocol * @param list $variants - * @param VideoCodec|value-of $video_codec + * @param VideoCodec|value-of $videoCodec */ public static function with( - AudioCodec|string|null $audio_codec = null, - ?bool $auto_rotate = null, + AudioCodec|string|null $audioCodec = null, + ?bool $autoRotate = null, Format|string|null $format = null, ?int $quality = null, - StreamProtocol|string|null $stream_protocol = null, + StreamProtocol|string|null $streamProtocol = null, ?array $variants = null, - VideoCodec|string|null $video_codec = null, + VideoCodec|string|null $videoCodec = null, ): self { $obj = new self; - null !== $audio_codec && $obj['audio_codec'] = $audio_codec; - null !== $auto_rotate && $obj['auto_rotate'] = $auto_rotate; + null !== $audioCodec && $obj['audioCodec'] = $audioCodec; + null !== $autoRotate && $obj['autoRotate'] = $autoRotate; null !== $format && $obj['format'] = $format; null !== $quality && $obj['quality'] = $quality; - null !== $stream_protocol && $obj['stream_protocol'] = $stream_protocol; + null !== $streamProtocol && $obj['streamProtocol'] = $streamProtocol; null !== $variants && $obj['variants'] = $variants; - null !== $video_codec && $obj['video_codec'] = $video_codec; + null !== $videoCodec && $obj['videoCodec'] = $videoCodec; return $obj; } @@ -128,7 +128,7 @@ public static function with( public function withAudioCodec(AudioCodec|string $audioCodec): self { $obj = clone $this; - $obj['audio_codec'] = $audioCodec; + $obj['audioCodec'] = $audioCodec; return $obj; } @@ -139,7 +139,7 @@ public function withAudioCodec(AudioCodec|string $audioCodec): self public function withAutoRotate(bool $autoRotate): self { $obj = clone $this; - $obj['auto_rotate'] = $autoRotate; + $obj['autoRotate'] = $autoRotate; return $obj; } @@ -177,7 +177,7 @@ public function withStreamProtocol( StreamProtocol|string $streamProtocol ): self { $obj = clone $this; - $obj['stream_protocol'] = $streamProtocol; + $obj['streamProtocol'] = $streamProtocol; return $obj; } @@ -203,7 +203,7 @@ public function withVariants(array $variants): self public function withVideoCodec(VideoCodec|string $videoCodec): self { $obj = clone $this; - $obj['video_codec'] = $videoCodec; + $obj['videoCodec'] = $videoCodec; return $obj; } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Request.php b/src/Webhooks/VideoTransformationAcceptedEvent/Request.php index d8e85adc..364b7938 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Request.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Request.php @@ -13,7 +13,7 @@ * Information about the original request that triggered the video transformation. * * @phpstan-type RequestShape = array{ - * url: string, x_request_id: string, user_agent?: string|null + * url: string, xRequestID: string, userAgent?: string|null * } */ final class Request implements BaseModel @@ -30,21 +30,21 @@ final class Request implements BaseModel /** * Unique identifier for the originating transformation request. */ - #[Required] - public string $x_request_id; + #[Required('x_request_id')] + public string $xRequestID; /** * User-Agent header from the original request that triggered the transformation. */ - #[Optional] - public ?string $user_agent; + #[Optional('user_agent')] + public ?string $userAgent; /** * `new Request()` is missing required properties by the API. * * To enforce required parameters use * ``` - * Request::with(url: ..., x_request_id: ...) + * Request::with(url: ..., xRequestID: ...) * ``` * * Otherwise ensure the following setters are called @@ -65,15 +65,15 @@ public function __construct() */ public static function with( string $url, - string $x_request_id, - ?string $user_agent = null + string $xRequestID, + ?string $userAgent = null ): self { $obj = new self; $obj['url'] = $url; - $obj['x_request_id'] = $x_request_id; + $obj['xRequestID'] = $xRequestID; - null !== $user_agent && $obj['user_agent'] = $user_agent; + null !== $userAgent && $obj['userAgent'] = $userAgent; return $obj; } @@ -95,7 +95,7 @@ public function withURL(string $url): self public function withXRequestID(string $xRequestID): self { $obj = clone $this; - $obj['x_request_id'] = $xRequestID; + $obj['xRequestID'] = $xRequestID; return $obj; } @@ -106,7 +106,7 @@ public function withXRequestID(string $xRequestID): self public function withUserAgent(string $userAgent): self { $obj = clone $this; - $obj['user_agent'] = $userAgent; + $obj['userAgent'] = $userAgent; return $obj; } diff --git a/src/Webhooks/VideoTransformationErrorEvent.php b/src/Webhooks/VideoTransformationErrorEvent.php index 6694dda7..5e29a102 100644 --- a/src/Webhooks/VideoTransformationErrorEvent.php +++ b/src/Webhooks/VideoTransformationErrorEvent.php @@ -18,7 +18,7 @@ * @phpstan-type VideoTransformationErrorEventShape = array{ * id: string, * type: string, - * created_at: \DateTimeInterface, + * createdAt: \DateTimeInterface, * data: Data, * request: Request, * } @@ -43,8 +43,8 @@ final class VideoTransformationErrorEvent implements BaseModel /** * Timestamp when the event was created in ISO8601 format. */ - #[Required] - public \DateTimeInterface $created_at; + #[Required('created_at')] + public \DateTimeInterface $createdAt; #[Required] public Data $data; @@ -61,7 +61,7 @@ final class VideoTransformationErrorEvent implements BaseModel * To enforce required parameters use * ``` * VideoTransformationErrorEvent::with( - * id: ..., type: ..., created_at: ..., data: ..., request: ... + * id: ..., type: ..., createdAt: ..., data: ..., request: ... * ) * ``` * @@ -88,13 +88,13 @@ public function __construct() * * @param Data|array{asset: Asset, transformation: Transformation} $data * @param Request|array{ - * url: string, x_request_id: string, user_agent?: string|null + * url: string, xRequestID: string, userAgent?: string|null * } $request */ public static function with( string $id, string $type, - \DateTimeInterface $created_at, + \DateTimeInterface $createdAt, Data|array $data, Request|array $request, ): self { @@ -102,7 +102,7 @@ public static function with( $obj['id'] = $id; $obj['type'] = $type; - $obj['created_at'] = $created_at; + $obj['createdAt'] = $createdAt; $obj['data'] = $data; $obj['request'] = $request; @@ -137,7 +137,7 @@ public function withType(string $type): self public function withCreatedAt(\DateTimeInterface $createdAt): self { $obj = clone $this; - $obj['created_at'] = $createdAt; + $obj['createdAt'] = $createdAt; return $obj; } @@ -157,7 +157,7 @@ public function withData(Data|array $data): self * Information about the original request that triggered the video transformation. * * @param Request|array{ - * url: string, x_request_id: string, user_agent?: string|null + * url: string, xRequestID: string, userAgent?: string|null * } $request */ public function withRequest(Request|array $request): self diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php index 435557d2..51297625 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php @@ -77,13 +77,13 @@ public function __construct() * @param Type|value-of $type * @param Error|array{reason: value-of} $error * @param Options|array{ - * audio_codec?: value-of|null, - * auto_rotate?: bool|null, + * audioCodec?: value-of|null, + * autoRotate?: bool|null, * format?: value-of|null, * quality?: int|null, - * stream_protocol?: value-of|null, + * streamProtocol?: value-of|null, * variants?: list|null, - * video_codec?: value-of|null, + * videoCodec?: value-of|null, * } $options */ public static function with( @@ -134,13 +134,13 @@ public function withError(Error|array $error): self * Configuration options for video transformations. * * @param Options|array{ - * audio_codec?: value-of|null, - * auto_rotate?: bool|null, + * audioCodec?: value-of|null, + * autoRotate?: bool|null, * format?: value-of|null, * quality?: int|null, - * stream_protocol?: value-of|null, + * streamProtocol?: value-of|null, * variants?: list|null, - * video_codec?: value-of|null, + * videoCodec?: value-of|null, * } $options */ public function withOptions(Options|array $options): self diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php index 10f68383..4a1c6e1c 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php @@ -16,13 +16,13 @@ * Configuration options for video transformations. * * @phpstan-type OptionsShape = array{ - * audio_codec?: value-of|null, - * auto_rotate?: bool|null, + * audioCodec?: value-of|null, + * autoRotate?: bool|null, * format?: value-of|null, * quality?: int|null, - * stream_protocol?: value-of|null, + * streamProtocol?: value-of|null, * variants?: list|null, - * video_codec?: value-of|null, + * videoCodec?: value-of|null, * } */ final class Options implements BaseModel @@ -33,16 +33,16 @@ final class Options implements BaseModel /** * Audio codec used for encoding (aac or opus). * - * @var value-of|null $audio_codec + * @var value-of|null $audioCodec */ - #[Optional(enum: AudioCodec::class)] - public ?string $audio_codec; + #[Optional('audio_codec', enum: AudioCodec::class)] + public ?string $audioCodec; /** * Whether to automatically rotate the video based on metadata. */ - #[Optional] - public ?bool $auto_rotate; + #[Optional('auto_rotate')] + public ?bool $autoRotate; /** * Output format for the transformed video or thumbnail. @@ -61,10 +61,10 @@ final class Options implements BaseModel /** * Streaming protocol for adaptive bitrate streaming. * - * @var value-of|null $stream_protocol + * @var value-of|null $streamProtocol */ - #[Optional(enum: StreamProtocol::class)] - public ?string $stream_protocol; + #[Optional('stream_protocol', enum: StreamProtocol::class)] + public ?string $streamProtocol; /** * Array of quality representations for adaptive bitrate streaming. @@ -77,10 +77,10 @@ final class Options implements BaseModel /** * Video codec used for encoding (h264, vp9, or av1). * - * @var value-of|null $video_codec + * @var value-of|null $videoCodec */ - #[Optional(enum: VideoCodec::class)] - public ?string $video_codec; + #[Optional('video_codec', enum: VideoCodec::class)] + public ?string $videoCodec; public function __construct() { @@ -92,30 +92,30 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AudioCodec|value-of $audio_codec + * @param AudioCodec|value-of $audioCodec * @param Format|value-of $format - * @param StreamProtocol|value-of $stream_protocol + * @param StreamProtocol|value-of $streamProtocol * @param list $variants - * @param VideoCodec|value-of $video_codec + * @param VideoCodec|value-of $videoCodec */ public static function with( - AudioCodec|string|null $audio_codec = null, - ?bool $auto_rotate = null, + AudioCodec|string|null $audioCodec = null, + ?bool $autoRotate = null, Format|string|null $format = null, ?int $quality = null, - StreamProtocol|string|null $stream_protocol = null, + StreamProtocol|string|null $streamProtocol = null, ?array $variants = null, - VideoCodec|string|null $video_codec = null, + VideoCodec|string|null $videoCodec = null, ): self { $obj = new self; - null !== $audio_codec && $obj['audio_codec'] = $audio_codec; - null !== $auto_rotate && $obj['auto_rotate'] = $auto_rotate; + null !== $audioCodec && $obj['audioCodec'] = $audioCodec; + null !== $autoRotate && $obj['autoRotate'] = $autoRotate; null !== $format && $obj['format'] = $format; null !== $quality && $obj['quality'] = $quality; - null !== $stream_protocol && $obj['stream_protocol'] = $stream_protocol; + null !== $streamProtocol && $obj['streamProtocol'] = $streamProtocol; null !== $variants && $obj['variants'] = $variants; - null !== $video_codec && $obj['video_codec'] = $video_codec; + null !== $videoCodec && $obj['videoCodec'] = $videoCodec; return $obj; } @@ -128,7 +128,7 @@ public static function with( public function withAudioCodec(AudioCodec|string $audioCodec): self { $obj = clone $this; - $obj['audio_codec'] = $audioCodec; + $obj['audioCodec'] = $audioCodec; return $obj; } @@ -139,7 +139,7 @@ public function withAudioCodec(AudioCodec|string $audioCodec): self public function withAutoRotate(bool $autoRotate): self { $obj = clone $this; - $obj['auto_rotate'] = $autoRotate; + $obj['autoRotate'] = $autoRotate; return $obj; } @@ -177,7 +177,7 @@ public function withStreamProtocol( StreamProtocol|string $streamProtocol ): self { $obj = clone $this; - $obj['stream_protocol'] = $streamProtocol; + $obj['streamProtocol'] = $streamProtocol; return $obj; } @@ -203,7 +203,7 @@ public function withVariants(array $variants): self public function withVideoCodec(VideoCodec|string $videoCodec): self { $obj = clone $this; - $obj['video_codec'] = $videoCodec; + $obj['videoCodec'] = $videoCodec; return $obj; } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Request.php b/src/Webhooks/VideoTransformationErrorEvent/Request.php index 8837ee54..748eeb9a 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Request.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Request.php @@ -13,7 +13,7 @@ * Information about the original request that triggered the video transformation. * * @phpstan-type RequestShape = array{ - * url: string, x_request_id: string, user_agent?: string|null + * url: string, xRequestID: string, userAgent?: string|null * } */ final class Request implements BaseModel @@ -30,21 +30,21 @@ final class Request implements BaseModel /** * Unique identifier for the originating transformation request. */ - #[Required] - public string $x_request_id; + #[Required('x_request_id')] + public string $xRequestID; /** * User-Agent header from the original request that triggered the transformation. */ - #[Optional] - public ?string $user_agent; + #[Optional('user_agent')] + public ?string $userAgent; /** * `new Request()` is missing required properties by the API. * * To enforce required parameters use * ``` - * Request::with(url: ..., x_request_id: ...) + * Request::with(url: ..., xRequestID: ...) * ``` * * Otherwise ensure the following setters are called @@ -65,15 +65,15 @@ public function __construct() */ public static function with( string $url, - string $x_request_id, - ?string $user_agent = null + string $xRequestID, + ?string $userAgent = null ): self { $obj = new self; $obj['url'] = $url; - $obj['x_request_id'] = $x_request_id; + $obj['xRequestID'] = $xRequestID; - null !== $user_agent && $obj['user_agent'] = $user_agent; + null !== $userAgent && $obj['userAgent'] = $userAgent; return $obj; } @@ -95,7 +95,7 @@ public function withURL(string $url): self public function withXRequestID(string $xRequestID): self { $obj = clone $this; - $obj['x_request_id'] = $xRequestID; + $obj['xRequestID'] = $xRequestID; return $obj; } @@ -106,7 +106,7 @@ public function withXRequestID(string $xRequestID): self public function withUserAgent(string $userAgent): self { $obj = clone $this; - $obj['user_agent'] = $userAgent; + $obj['userAgent'] = $userAgent; return $obj; } diff --git a/src/Webhooks/VideoTransformationReadyEvent.php b/src/Webhooks/VideoTransformationReadyEvent.php index eeef5b5e..cb3f6722 100644 --- a/src/Webhooks/VideoTransformationReadyEvent.php +++ b/src/Webhooks/VideoTransformationReadyEvent.php @@ -20,7 +20,7 @@ * @phpstan-type VideoTransformationReadyEventShape = array{ * id: string, * type: string, - * created_at: \DateTimeInterface, + * createdAt: \DateTimeInterface, * data: Data, * request: Request, * timings?: Timings|null, @@ -46,8 +46,8 @@ final class VideoTransformationReadyEvent implements BaseModel /** * Timestamp when the event was created in ISO8601 format. */ - #[Required] - public \DateTimeInterface $created_at; + #[Required('created_at')] + public \DateTimeInterface $createdAt; #[Required] public Data $data; @@ -70,7 +70,7 @@ final class VideoTransformationReadyEvent implements BaseModel * To enforce required parameters use * ``` * VideoTransformationReadyEvent::with( - * id: ..., type: ..., created_at: ..., data: ..., request: ... + * id: ..., type: ..., createdAt: ..., data: ..., request: ... * ) * ``` * @@ -97,16 +97,16 @@ public function __construct() * * @param Data|array{asset: Asset, transformation: Transformation} $data * @param Request|array{ - * url: string, x_request_id: string, user_agent?: string|null + * url: string, xRequestID: string, userAgent?: string|null * } $request * @param Timings|array{ - * download_duration?: int|null, encoding_duration?: int|null + * downloadDuration?: int|null, encodingDuration?: int|null * } $timings */ public static function with( string $id, string $type, - \DateTimeInterface $created_at, + \DateTimeInterface $createdAt, Data|array $data, Request|array $request, Timings|array|null $timings = null, @@ -115,7 +115,7 @@ public static function with( $obj['id'] = $id; $obj['type'] = $type; - $obj['created_at'] = $created_at; + $obj['createdAt'] = $createdAt; $obj['data'] = $data; $obj['request'] = $request; @@ -152,7 +152,7 @@ public function withType(string $type): self public function withCreatedAt(\DateTimeInterface $createdAt): self { $obj = clone $this; - $obj['created_at'] = $createdAt; + $obj['createdAt'] = $createdAt; return $obj; } @@ -172,7 +172,7 @@ public function withData(Data|array $data): self * Information about the original request that triggered the video transformation. * * @param Request|array{ - * url: string, x_request_id: string, user_agent?: string|null + * url: string, xRequestID: string, userAgent?: string|null * } $request */ public function withRequest(Request|array $request): self @@ -187,7 +187,7 @@ public function withRequest(Request|array $request): self * Performance metrics for the transformation process. * * @param Timings|array{ - * download_duration?: int|null, encoding_duration?: int|null + * downloadDuration?: int|null, encodingDuration?: int|null * } $timings */ public function withTimings(Timings|array $timings): self diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php index bb9fdeaf..024b6b03 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php @@ -76,15 +76,15 @@ public function __construct() * * @param Type|value-of $type * @param Options|array{ - * audio_codec?: value-of|null, - * auto_rotate?: bool|null, + * audioCodec?: value-of|null, + * autoRotate?: bool|null, * format?: value-of|null, * quality?: int|null, - * stream_protocol?: value-of|null, + * streamProtocol?: value-of|null, * variants?: list|null, - * video_codec?: value-of|null, + * videoCodec?: value-of|null, * } $options - * @param Output|array{url: string, video_metadata?: VideoMetadata|null} $output + * @param Output|array{url: string, videoMetadata?: VideoMetadata|null} $output */ public static function with( Type|string $type, @@ -121,13 +121,13 @@ public function withType(Type|string $type): self * Configuration options for video transformations. * * @param Options|array{ - * audio_codec?: value-of|null, - * auto_rotate?: bool|null, + * audioCodec?: value-of|null, + * autoRotate?: bool|null, * format?: value-of|null, * quality?: int|null, - * stream_protocol?: value-of|null, + * streamProtocol?: value-of|null, * variants?: list|null, - * video_codec?: value-of|null, + * videoCodec?: value-of|null, * } $options */ public function withOptions(Options|array $options): self @@ -141,7 +141,7 @@ public function withOptions(Options|array $options): self /** * Information about the transformed output video. * - * @param Output|array{url: string, video_metadata?: VideoMetadata|null} $output + * @param Output|array{url: string, videoMetadata?: VideoMetadata|null} $output */ public function withOutput(Output|array $output): self { diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php index 948bfcf5..eb95c208 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php @@ -16,13 +16,13 @@ * Configuration options for video transformations. * * @phpstan-type OptionsShape = array{ - * audio_codec?: value-of|null, - * auto_rotate?: bool|null, + * audioCodec?: value-of|null, + * autoRotate?: bool|null, * format?: value-of|null, * quality?: int|null, - * stream_protocol?: value-of|null, + * streamProtocol?: value-of|null, * variants?: list|null, - * video_codec?: value-of|null, + * videoCodec?: value-of|null, * } */ final class Options implements BaseModel @@ -33,16 +33,16 @@ final class Options implements BaseModel /** * Audio codec used for encoding (aac or opus). * - * @var value-of|null $audio_codec + * @var value-of|null $audioCodec */ - #[Optional(enum: AudioCodec::class)] - public ?string $audio_codec; + #[Optional('audio_codec', enum: AudioCodec::class)] + public ?string $audioCodec; /** * Whether to automatically rotate the video based on metadata. */ - #[Optional] - public ?bool $auto_rotate; + #[Optional('auto_rotate')] + public ?bool $autoRotate; /** * Output format for the transformed video or thumbnail. @@ -61,10 +61,10 @@ final class Options implements BaseModel /** * Streaming protocol for adaptive bitrate streaming. * - * @var value-of|null $stream_protocol + * @var value-of|null $streamProtocol */ - #[Optional(enum: StreamProtocol::class)] - public ?string $stream_protocol; + #[Optional('stream_protocol', enum: StreamProtocol::class)] + public ?string $streamProtocol; /** * Array of quality representations for adaptive bitrate streaming. @@ -77,10 +77,10 @@ final class Options implements BaseModel /** * Video codec used for encoding (h264, vp9, or av1). * - * @var value-of|null $video_codec + * @var value-of|null $videoCodec */ - #[Optional(enum: VideoCodec::class)] - public ?string $video_codec; + #[Optional('video_codec', enum: VideoCodec::class)] + public ?string $videoCodec; public function __construct() { @@ -92,30 +92,30 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AudioCodec|value-of $audio_codec + * @param AudioCodec|value-of $audioCodec * @param Format|value-of $format - * @param StreamProtocol|value-of $stream_protocol + * @param StreamProtocol|value-of $streamProtocol * @param list $variants - * @param VideoCodec|value-of $video_codec + * @param VideoCodec|value-of $videoCodec */ public static function with( - AudioCodec|string|null $audio_codec = null, - ?bool $auto_rotate = null, + AudioCodec|string|null $audioCodec = null, + ?bool $autoRotate = null, Format|string|null $format = null, ?int $quality = null, - StreamProtocol|string|null $stream_protocol = null, + StreamProtocol|string|null $streamProtocol = null, ?array $variants = null, - VideoCodec|string|null $video_codec = null, + VideoCodec|string|null $videoCodec = null, ): self { $obj = new self; - null !== $audio_codec && $obj['audio_codec'] = $audio_codec; - null !== $auto_rotate && $obj['auto_rotate'] = $auto_rotate; + null !== $audioCodec && $obj['audioCodec'] = $audioCodec; + null !== $autoRotate && $obj['autoRotate'] = $autoRotate; null !== $format && $obj['format'] = $format; null !== $quality && $obj['quality'] = $quality; - null !== $stream_protocol && $obj['stream_protocol'] = $stream_protocol; + null !== $streamProtocol && $obj['streamProtocol'] = $streamProtocol; null !== $variants && $obj['variants'] = $variants; - null !== $video_codec && $obj['video_codec'] = $video_codec; + null !== $videoCodec && $obj['videoCodec'] = $videoCodec; return $obj; } @@ -128,7 +128,7 @@ public static function with( public function withAudioCodec(AudioCodec|string $audioCodec): self { $obj = clone $this; - $obj['audio_codec'] = $audioCodec; + $obj['audioCodec'] = $audioCodec; return $obj; } @@ -139,7 +139,7 @@ public function withAudioCodec(AudioCodec|string $audioCodec): self public function withAutoRotate(bool $autoRotate): self { $obj = clone $this; - $obj['auto_rotate'] = $autoRotate; + $obj['autoRotate'] = $autoRotate; return $obj; } @@ -177,7 +177,7 @@ public function withStreamProtocol( StreamProtocol|string $streamProtocol ): self { $obj = clone $this; - $obj['stream_protocol'] = $streamProtocol; + $obj['streamProtocol'] = $streamProtocol; return $obj; } @@ -203,7 +203,7 @@ public function withVariants(array $variants): self public function withVideoCodec(VideoCodec|string $videoCodec): self { $obj = clone $this; - $obj['video_codec'] = $videoCodec; + $obj['videoCodec'] = $videoCodec; return $obj; } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php index d4637019..0403f669 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php @@ -14,7 +14,7 @@ * Information about the transformed output video. * * @phpstan-type OutputShape = array{ - * url: string, video_metadata?: VideoMetadata|null + * url: string, videoMetadata?: VideoMetadata|null * } */ final class Output implements BaseModel @@ -31,8 +31,8 @@ final class Output implements BaseModel /** * Metadata of the output video file. */ - #[Optional] - public ?VideoMetadata $video_metadata; + #[Optional('video_metadata')] + public ?VideoMetadata $videoMetadata; /** * `new Output()` is missing required properties by the API. @@ -60,17 +60,17 @@ public function __construct() * * @param VideoMetadata|array{ * bitrate: int, duration: float, height: int, width: int - * } $video_metadata + * } $videoMetadata */ public static function with( string $url, - VideoMetadata|array|null $video_metadata = null + VideoMetadata|array|null $videoMetadata = null ): self { $obj = new self; $obj['url'] = $url; - null !== $video_metadata && $obj['video_metadata'] = $video_metadata; + null !== $videoMetadata && $obj['videoMetadata'] = $videoMetadata; return $obj; } @@ -96,7 +96,7 @@ public function withURL(string $url): self public function withVideoMetadata(VideoMetadata|array $videoMetadata): self { $obj = clone $this; - $obj['video_metadata'] = $videoMetadata; + $obj['videoMetadata'] = $videoMetadata; return $obj; } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Request.php b/src/Webhooks/VideoTransformationReadyEvent/Request.php index 8b1de802..68203d5c 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Request.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Request.php @@ -13,7 +13,7 @@ * Information about the original request that triggered the video transformation. * * @phpstan-type RequestShape = array{ - * url: string, x_request_id: string, user_agent?: string|null + * url: string, xRequestID: string, userAgent?: string|null * } */ final class Request implements BaseModel @@ -30,21 +30,21 @@ final class Request implements BaseModel /** * Unique identifier for the originating transformation request. */ - #[Required] - public string $x_request_id; + #[Required('x_request_id')] + public string $xRequestID; /** * User-Agent header from the original request that triggered the transformation. */ - #[Optional] - public ?string $user_agent; + #[Optional('user_agent')] + public ?string $userAgent; /** * `new Request()` is missing required properties by the API. * * To enforce required parameters use * ``` - * Request::with(url: ..., x_request_id: ...) + * Request::with(url: ..., xRequestID: ...) * ``` * * Otherwise ensure the following setters are called @@ -65,15 +65,15 @@ public function __construct() */ public static function with( string $url, - string $x_request_id, - ?string $user_agent = null + string $xRequestID, + ?string $userAgent = null ): self { $obj = new self; $obj['url'] = $url; - $obj['x_request_id'] = $x_request_id; + $obj['xRequestID'] = $xRequestID; - null !== $user_agent && $obj['user_agent'] = $user_agent; + null !== $userAgent && $obj['userAgent'] = $userAgent; return $obj; } @@ -95,7 +95,7 @@ public function withURL(string $url): self public function withXRequestID(string $xRequestID): self { $obj = clone $this; - $obj['x_request_id'] = $xRequestID; + $obj['xRequestID'] = $xRequestID; return $obj; } @@ -106,7 +106,7 @@ public function withXRequestID(string $xRequestID): self public function withUserAgent(string $userAgent): self { $obj = clone $this; - $obj['user_agent'] = $userAgent; + $obj['userAgent'] = $userAgent; return $obj; } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Timings.php b/src/Webhooks/VideoTransformationReadyEvent/Timings.php index a84dd2db..8bcddfd7 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Timings.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Timings.php @@ -12,7 +12,7 @@ * Performance metrics for the transformation process. * * @phpstan-type TimingsShape = array{ - * download_duration?: int|null, encoding_duration?: int|null + * downloadDuration?: int|null, encodingDuration?: int|null * } */ final class Timings implements BaseModel @@ -23,14 +23,14 @@ final class Timings implements BaseModel /** * Time spent downloading the source video from your origin or media library, in milliseconds. */ - #[Optional] - public ?int $download_duration; + #[Optional('download_duration')] + public ?int $downloadDuration; /** * Time spent encoding the video, in milliseconds. */ - #[Optional] - public ?int $encoding_duration; + #[Optional('encoding_duration')] + public ?int $encodingDuration; public function __construct() { @@ -43,13 +43,13 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. */ public static function with( - ?int $download_duration = null, - ?int $encoding_duration = null + ?int $downloadDuration = null, + ?int $encodingDuration = null ): self { $obj = new self; - null !== $download_duration && $obj['download_duration'] = $download_duration; - null !== $encoding_duration && $obj['encoding_duration'] = $encoding_duration; + null !== $downloadDuration && $obj['downloadDuration'] = $downloadDuration; + null !== $encodingDuration && $obj['encodingDuration'] = $encodingDuration; return $obj; } @@ -60,7 +60,7 @@ public static function with( public function withDownloadDuration(int $downloadDuration): self { $obj = clone $this; - $obj['download_duration'] = $downloadDuration; + $obj['downloadDuration'] = $downloadDuration; return $obj; } @@ -71,7 +71,7 @@ public function withDownloadDuration(int $downloadDuration): self public function withEncodingDuration(int $encodingDuration): self { $obj = clone $this; - $obj['encoding_duration'] = $encodingDuration; + $obj['encodingDuration'] = $encodingDuration; return $obj; } diff --git a/tests/Services/Accounts/OriginsTest.php b/tests/Services/Accounts/OriginsTest.php index be1a6bcd..14a5d01b 100644 --- a/tests/Services/Accounts/OriginsTest.php +++ b/tests/Services/Accounts/OriginsTest.php @@ -38,11 +38,21 @@ public function testCreate(): void } $result = $this->client->accounts->origins->create([ - 'accessKey' => 'AKIATEST123', - 'bucket' => 'test-bucket', - 'name' => 'My S3 Origin', - 'secretKey' => 'secrettest123', - 'type' => 'S3', + 'accessKey' => 'AKIAIOSFODNN7EXAMPLE', + 'bucket' => 'gcs-media', + 'name' => 'US S3 Storage', + 'secretKey' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', + 'endpoint' => 'https://s3.eu-central-1.wasabisys.com', + 'baseURL' => 'https://akeneo.company.com', + 'clientEmail' => 'service-account@project.iam.gserviceaccount.com', + 'privateKey' => '-----BEGIN PRIVATE KEY-----\nMIIEv...', + 'accountName' => 'account123', + 'container' => 'images', + 'sasToken' => '?sv=2023-01-03&sr=c&sig=abc123', + 'clientID' => 'akeneo-client-id', + 'clientSecret' => 'akeneo-client-secret', + 'password' => 'strongpassword123', + 'username' => 'integration-user', ]); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -57,14 +67,27 @@ public function testCreateWithOptionalParams(): void } $result = $this->client->accounts->origins->create([ - 'accessKey' => 'AKIATEST123', - 'bucket' => 'test-bucket', - 'name' => 'My S3 Origin', - 'secretKey' => 'secrettest123', - 'type' => 'S3', - 'baseUrlForCanonicalHeader' => 'https://cdn.example.com', + 'accessKey' => 'AKIAIOSFODNN7EXAMPLE', + 'bucket' => 'gcs-media', + 'name' => 'US S3 Storage', + 'secretKey' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', + 'type' => 'AKENEO_PIM', + 'baseURLForCanonicalHeader' => 'https://cdn.example.com', 'includeCanonicalHeader' => false, - 'prefix' => 'images', + 'prefix' => 'uploads', + 'endpoint' => 'https://s3.eu-central-1.wasabisys.com', + 's3ForcePathStyle' => true, + 'baseURL' => 'https://akeneo.company.com', + 'forwardHostHeaderToOrigin' => false, + 'clientEmail' => 'service-account@project.iam.gserviceaccount.com', + 'privateKey' => '-----BEGIN PRIVATE KEY-----\nMIIEv...', + 'accountName' => 'account123', + 'container' => 'images', + 'sasToken' => '?sv=2023-01-03&sr=c&sig=abc123', + 'clientID' => 'akeneo-client-id', + 'clientSecret' => 'akeneo-client-secret', + 'password' => 'strongpassword123', + 'username' => 'integration-user', ]); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -81,11 +104,21 @@ public function testUpdate(): void $result = $this->client->accounts->origins->update( 'id', [ - 'accessKey' => 'AKIATEST123', - 'bucket' => 'test-bucket', - 'name' => 'My S3 Origin', - 'secretKey' => 'secrettest123', - 'type' => 'S3', + 'accessKey' => 'AKIAIOSFODNN7EXAMPLE', + 'bucket' => 'gcs-media', + 'name' => 'US S3 Storage', + 'secretKey' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', + 'endpoint' => 'https://s3.eu-central-1.wasabisys.com', + 'baseURL' => 'https://akeneo.company.com', + 'clientEmail' => 'service-account@project.iam.gserviceaccount.com', + 'privateKey' => '-----BEGIN PRIVATE KEY-----\nMIIEv...', + 'accountName' => 'account123', + 'container' => 'images', + 'sasToken' => '?sv=2023-01-03&sr=c&sig=abc123', + 'clientID' => 'akeneo-client-id', + 'clientSecret' => 'akeneo-client-secret', + 'password' => 'strongpassword123', + 'username' => 'integration-user', ], ); @@ -103,14 +136,27 @@ public function testUpdateWithOptionalParams(): void $result = $this->client->accounts->origins->update( 'id', [ - 'accessKey' => 'AKIATEST123', - 'bucket' => 'test-bucket', - 'name' => 'My S3 Origin', - 'secretKey' => 'secrettest123', - 'type' => 'S3', - 'baseUrlForCanonicalHeader' => 'https://cdn.example.com', + 'accessKey' => 'AKIAIOSFODNN7EXAMPLE', + 'bucket' => 'gcs-media', + 'name' => 'US S3 Storage', + 'secretKey' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', + 'type' => 'AKENEO_PIM', + 'baseURLForCanonicalHeader' => 'https://cdn.example.com', 'includeCanonicalHeader' => false, - 'prefix' => 'images', + 'prefix' => 'uploads', + 'endpoint' => 'https://s3.eu-central-1.wasabisys.com', + 's3ForcePathStyle' => true, + 'baseURL' => 'https://akeneo.company.com', + 'forwardHostHeaderToOrigin' => false, + 'clientEmail' => 'service-account@project.iam.gserviceaccount.com', + 'privateKey' => '-----BEGIN PRIVATE KEY-----\nMIIEv...', + 'accountName' => 'account123', + 'container' => 'images', + 'sasToken' => '?sv=2023-01-03&sr=c&sig=abc123', + 'clientID' => 'akeneo-client-id', + 'clientSecret' => 'akeneo-client-secret', + 'password' => 'strongpassword123', + 'username' => 'integration-user', ], ); diff --git a/tests/Services/Beta/V2/FilesTest.php b/tests/Services/Beta/V2/FilesTest.php index e2acfc23..ae962243 100644 --- a/tests/Services/Beta/V2/FilesTest.php +++ b/tests/Services/Beta/V2/FilesTest.php @@ -65,9 +65,9 @@ public function testUploadWithOptionalParams(): void [ 'name' => 'remove-bg', 'options' => [ - 'add_shadow' => true, - 'bg_color' => 'bg_color', - 'bg_image_url' => 'bg_image_url', + 'addShadow' => true, + 'bgColor' => 'bg_color', + 'bgImageURL' => 'bg_image_url', 'semitransparency' => true, ], ], @@ -97,7 +97,7 @@ public function testUploadWithOptionalParams(): void 'pre' => 'w-300,h-300,q-80', ], 'useUniqueFileName' => true, - 'webhookUrl' => 'https://example.com', + 'webhookURL' => 'https://example.com', ]); // @phpstan-ignore-next-line method.alreadyNarrowedType diff --git a/tests/Services/Files/BulkTest.php b/tests/Services/Files/BulkTest.php index 95e0455c..1a22fb4f 100644 --- a/tests/Services/Files/BulkTest.php +++ b/tests/Services/Files/BulkTest.php @@ -42,7 +42,7 @@ public function testDelete(): void } $result = $this->client->files->bulk->delete([ - 'fileIds' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + 'fileIDs' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], ]); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -57,7 +57,7 @@ public function testDeleteWithOptionalParams(): void } $result = $this->client->files->bulk->delete([ - 'fileIds' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + 'fileIDs' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], ]); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -72,7 +72,7 @@ public function testAddTags(): void } $result = $this->client->files->bulk->addTags([ - 'fileIds' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + 'fileIDs' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], 'tags' => ['t-shirt', 'round-neck', 'sale2019'], ]); @@ -88,7 +88,7 @@ public function testAddTagsWithOptionalParams(): void } $result = $this->client->files->bulk->addTags([ - 'fileIds' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + 'fileIDs' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], 'tags' => ['t-shirt', 'round-neck', 'sale2019'], ]); @@ -104,8 +104,8 @@ public function testRemoveAITags(): void } $result = $this->client->files->bulk->removeAITags([ - 'AITags' => ['t-shirt', 'round-neck', 'sale2019'], - 'fileIds' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + 'aiTags' => ['t-shirt', 'round-neck', 'sale2019'], + 'fileIDs' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], ]); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -120,8 +120,8 @@ public function testRemoveAITagsWithOptionalParams(): void } $result = $this->client->files->bulk->removeAITags([ - 'AITags' => ['t-shirt', 'round-neck', 'sale2019'], - 'fileIds' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + 'aiTags' => ['t-shirt', 'round-neck', 'sale2019'], + 'fileIDs' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], ]); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -136,7 +136,7 @@ public function testRemoveTags(): void } $result = $this->client->files->bulk->removeTags([ - 'fileIds' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + 'fileIDs' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], 'tags' => ['t-shirt', 'round-neck', 'sale2019'], ]); @@ -152,7 +152,7 @@ public function testRemoveTagsWithOptionalParams(): void } $result = $this->client->files->bulk->removeTags([ - 'fileIds' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + 'fileIDs' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], 'tags' => ['t-shirt', 'round-neck', 'sale2019'], ]); diff --git a/tests/Services/Files/VersionsTest.php b/tests/Services/Files/VersionsTest.php index f8ec0cc7..0c75ffd8 100644 --- a/tests/Services/Files/VersionsTest.php +++ b/tests/Services/Files/VersionsTest.php @@ -54,7 +54,7 @@ public function testDelete(): void $result = $this->client->files->versions->delete( 'versionId', - ['fileId' => 'fileId'] + ['fileID' => 'fileId'] ); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -70,7 +70,7 @@ public function testDeleteWithOptionalParams(): void $result = $this->client->files->versions->delete( 'versionId', - ['fileId' => 'fileId'] + ['fileID' => 'fileId'] ); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -86,7 +86,7 @@ public function testGet(): void $result = $this->client->files->versions->get( 'versionId', - ['fileId' => 'fileId'] + ['fileID' => 'fileId'] ); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -102,7 +102,7 @@ public function testGetWithOptionalParams(): void $result = $this->client->files->versions->get( 'versionId', - ['fileId' => 'fileId'] + ['fileID' => 'fileId'] ); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -118,7 +118,7 @@ public function testRestore(): void $result = $this->client->files->versions->restore( 'versionId', - ['fileId' => 'fileId'] + ['fileID' => 'fileId'] ); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -134,7 +134,7 @@ public function testRestoreWithOptionalParams(): void $result = $this->client->files->versions->restore( 'versionId', - ['fileId' => 'fileId'] + ['fileID' => 'fileId'] ); // @phpstan-ignore-next-line method.alreadyNarrowedType diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index 834aedfc..4944de70 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -207,9 +207,9 @@ public function testUploadWithOptionalParams(): void [ 'name' => 'remove-bg', 'options' => [ - 'add_shadow' => true, - 'bg_color' => 'bg_color', - 'bg_image_url' => 'bg_image_url', + 'addShadow' => true, + 'bgColor' => 'bg_color', + 'bgImageURL' => 'bg_image_url', 'semitransparency' => true, ], ], @@ -241,7 +241,7 @@ public function testUploadWithOptionalParams(): void 'pre' => 'w-300,h-300,q-80', ], 'useUniqueFileName' => true, - 'webhookUrl' => 'https://example.com', + 'webhookURL' => 'https://example.com', ]); // @phpstan-ignore-next-line method.alreadyNarrowedType From 1baa8c086edb663887b7a8ffe7975e5c1e96b203 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 06:09:42 +0000 Subject: [PATCH 090/193] chore: use `$self = clone $this;` instead of `$obj = clone $this;` --- src/Accounts/Origins/OriginCreateParams.php | 170 +++---- .../Origins/OriginRequest/AkeneoPim.php | 68 +-- .../Origins/OriginRequest/AzureBlob.php | 60 +-- .../OriginRequest/CloudinaryBackup.php | 60 +-- src/Accounts/Origins/OriginRequest/Gcs.php | 60 +-- src/Accounts/Origins/OriginRequest/S3.php | 60 +-- .../Origins/OriginRequest/S3Compatible.php | 76 ++-- .../Origins/OriginRequest/WebFolder.php | 44 +- .../Origins/OriginRequest/WebProxy.php | 28 +- .../Origins/OriginResponse/AkeneoPim.php | 44 +- .../Origins/OriginResponse/AzureBlob.php | 60 +-- .../OriginResponse/CloudinaryBackup.php | 52 +-- src/Accounts/Origins/OriginResponse/Gcs.php | 60 +-- src/Accounts/Origins/OriginResponse/S3.php | 52 +-- .../Origins/OriginResponse/S3Compatible.php | 68 +-- .../Origins/OriginResponse/WebFolder.php | 52 +-- .../Origins/OriginResponse/WebProxy.php | 36 +- src/Accounts/Origins/OriginUpdateParams.php | 170 +++---- .../URLEndpoints/URLEndpointCreateParams.php | 36 +- .../URLRewriter/Cloudinary.php | 12 +- .../URLEndpoints/URLEndpointRequest.php | 36 +- .../URLRewriter/Cloudinary.php | 12 +- .../URLEndpoints/URLEndpointResponse.php | 44 +- .../URLRewriter/Cloudinary.php | 12 +- .../URLEndpoints/URLEndpointUpdateParams.php | 36 +- .../URLRewriter/Cloudinary.php | 12 +- src/Accounts/Usage/UsageGetParams.php | 20 +- src/Accounts/Usage/UsageGetResponse.php | 44 +- src/Assets/AssetListParams.php | 60 +-- src/BaseOverlay.php | 20 +- src/Beta/V2/Files/FileUploadParams.php | 170 +++---- .../Files/FileUploadParams/Transformation.php | 20 +- .../Transformation/Post/Abs.php | 20 +- .../Transformation/Post/GifToVideo.php | 12 +- .../Transformation/Post/Thumbnail.php | 12 +- .../Transformation/Post/Transformation.php | 12 +- src/Beta/V2/Files/FileUploadResponse.php | 208 ++++----- .../V2/Files/FileUploadResponse/AITag.php | 28 +- .../FileUploadResponse/ExtensionStatus.php | 36 +- .../SelectedFieldsSchema.php | 84 ++-- .../Files/FileUploadResponse/VersionInfo.php | 20 +- .../Invalidation/InvalidationCreateParams.php | 12 +- .../Invalidation/InvalidationGetResponse.php | 12 +- .../Invalidation/InvalidationNewResponse.php | 12 +- .../CustomMetadataField.php | 36 +- .../CustomMetadataField/Schema.php | 68 +-- .../CustomMetadataFieldCreateParams.php | 28 +- .../Schema.php | 68 +-- .../CustomMetadataFieldListParams.php | 20 +- .../CustomMetadataFieldUpdateParams.php | 20 +- .../Schema.php | 60 +-- src/ExtensionItem/AutoTaggingExtension.php | 28 +- src/ExtensionItem/RemoveBg.php | 12 +- src/ExtensionItem/RemoveBg/Options.php | 36 +- src/Files/Bulk/BulkAddTagsParams.php | 20 +- src/Files/Bulk/BulkAddTagsResponse.php | 12 +- src/Files/Bulk/BulkDeleteParams.php | 12 +- src/Files/Bulk/BulkDeleteResponse.php | 12 +- src/Files/Bulk/BulkRemoveAITagsParams.php | 20 +- src/Files/Bulk/BulkRemoveAITagsResponse.php | 12 +- src/Files/Bulk/BulkRemoveTagsParams.php | 20 +- src/Files/Bulk/BulkRemoveTagsResponse.php | 12 +- src/Files/File.php | 192 ++++---- src/Files/File/AITag.php | 28 +- src/Files/File/SelectedFieldsSchema.php | 84 ++-- src/Files/File/VersionInfo.php | 20 +- src/Files/FileCopyParams.php | 28 +- src/Files/FileMoveParams.php | 20 +- src/Files/FileRenameParams.php | 28 +- src/Files/FileRenameResponse.php | 12 +- src/Files/FileUpdateParams.php | 72 +-- src/Files/FileUpdateParams/Publish.php | 20 +- src/Files/FileUpdateResponse.php | 200 ++++----- .../FileUpdateResponse/ExtensionStatus.php | 36 +- src/Files/FileUploadParams.php | 194 ++++---- src/Files/FileUploadParams/Transformation.php | 20 +- .../Transformation/Post/Abs.php | 20 +- .../Transformation/Post/GifToVideo.php | 12 +- .../Transformation/Post/Thumbnail.php | 12 +- .../Transformation/Post/Transformation.php | 12 +- src/Files/FileUploadResponse.php | 208 ++++----- src/Files/FileUploadResponse/AITag.php | 28 +- .../FileUploadResponse/ExtensionStatus.php | 36 +- .../SelectedFieldsSchema.php | 84 ++-- src/Files/FileUploadResponse/VersionInfo.php | 20 +- src/Files/Folder.php | 52 +-- src/Files/Metadata.php | 120 ++--- src/Files/Metadata/Exif.php | 52 +-- src/Files/Metadata/Exif/Exif.php | 216 ++++----- src/Files/Metadata/Exif/Gps.php | 12 +- src/Files/Metadata/Exif/Image.php | 96 ++-- src/Files/Metadata/Exif/Interoperability.php | 20 +- src/Files/Metadata/Exif/Thumbnail.php | 52 +-- .../Metadata/MetadataGetFromURLParams.php | 12 +- .../ChangePublicationStatus.php | 12 +- .../ChangePublicationStatus/Publish.php | 20 +- .../UpdateFileRequest/UpdateFileDetails.php | 60 +-- src/Files/Versions/VersionDeleteParams.php | 12 +- src/Files/Versions/VersionGetParams.php | 12 +- src/Files/Versions/VersionRestoreParams.php | 12 +- src/Folders/FolderCopyParams.php | 28 +- src/Folders/FolderCopyResponse.php | 12 +- src/Folders/FolderCreateParams.php | 20 +- src/Folders/FolderDeleteParams.php | 12 +- src/Folders/FolderMoveParams.php | 20 +- src/Folders/FolderMoveResponse.php | 12 +- src/Folders/FolderRenameParams.php | 28 +- src/Folders/FolderRenameResponse.php | 12 +- src/Folders/Job/JobGetResponse.php | 36 +- src/GetImageAttributesOptions.php | 98 ++-- src/ImageOverlay.php | 44 +- src/OverlayPosition.php | 28 +- src/OverlayTiming.php | 28 +- src/RequestOptions.php | 98 ++-- src/ResponsiveImageAttributes.php | 36 +- src/SolidColorOverlay.php | 36 +- src/SolidColorOverlayTransformation.php | 52 +-- src/SrcOptions.php | 60 +-- src/SubtitleOverlay.php | 44 +- src/SubtitleOverlayTransformation.php | 60 +-- src/TextOverlay.php | 44 +- src/TextOverlayTransformation.php | 112 ++--- src/Transformation.php | 424 +++++++++--------- src/VideoOverlay.php | 44 +- src/Webhooks/BaseWebhookEvent.php | 20 +- .../UploadPostTransformErrorEvent.php | 44 +- .../UploadPostTransformErrorEvent/Data.php | 44 +- .../Data/Transformation.php | 12 +- .../Data/Transformation/Error.php | 12 +- .../UploadPostTransformErrorEvent/Request.php | 20 +- .../Request/Transformation.php | 28 +- .../UploadPostTransformSuccessEvent.php | 44 +- .../UploadPostTransformSuccessEvent/Data.php | 28 +- .../Request.php | 20 +- .../Request/Transformation.php | 28 +- src/Webhooks/UploadPreTransformErrorEvent.php | 44 +- .../UploadPreTransformErrorEvent/Data.php | 28 +- .../Data/Transformation.php | 12 +- .../Data/Transformation/Error.php | 12 +- .../UploadPreTransformErrorEvent/Request.php | 20 +- .../UploadPreTransformSuccessEvent.php | 44 +- .../UploadPreTransformSuccessEvent/Data.php | 208 ++++----- .../Data/AITag.php | 28 +- .../Data/ExtensionStatus.php | 36 +- .../Data/SelectedFieldsSchema.php | 84 ++-- .../Data/VersionInfo.php | 20 +- .../Request.php | 20 +- .../VideoTransformationAcceptedEvent.php | 44 +- .../VideoTransformationAcceptedEvent/Data.php | 20 +- .../Data/Asset.php | 12 +- .../Data/Transformation.php | 20 +- .../Data/Transformation/Options.php | 60 +-- .../Request.php | 28 +- .../VideoTransformationErrorEvent.php | 44 +- .../VideoTransformationErrorEvent/Data.php | 20 +- .../Data/Asset.php | 12 +- .../Data/Transformation.php | 28 +- .../Data/Transformation/Error.php | 12 +- .../Data/Transformation/Options.php | 60 +-- .../VideoTransformationErrorEvent/Request.php | 28 +- .../VideoTransformationReadyEvent.php | 52 +-- .../VideoTransformationReadyEvent/Data.php | 20 +- .../Data/Asset.php | 12 +- .../Data/Transformation.php | 28 +- .../Data/Transformation/Options.php | 60 +-- .../Data/Transformation/Output.php | 20 +- .../Transformation/Output/VideoMetadata.php | 36 +- .../VideoTransformationReadyEvent/Request.php | 28 +- .../VideoTransformationReadyEvent/Timings.php | 20 +- 169 files changed, 3887 insertions(+), 3885 deletions(-) diff --git a/src/Accounts/Origins/OriginCreateParams.php b/src/Accounts/Origins/OriginCreateParams.php index 2db2c292..42d541ae 100644 --- a/src/Accounts/Origins/OriginCreateParams.php +++ b/src/Accounts/Origins/OriginCreateParams.php @@ -226,31 +226,31 @@ public static function with( ?bool $s3ForcePathStyle = null, ?bool $forwardHostHeaderToOrigin = null, ): self { - $obj = new self; - - $obj['accessKey'] = $accessKey; - $obj['bucket'] = $bucket; - $obj['name'] = $name; - $obj['secretKey'] = $secretKey; - $obj['endpoint'] = $endpoint; - $obj['baseURL'] = $baseURL; - $obj['clientEmail'] = $clientEmail; - $obj['privateKey'] = $privateKey; - $obj['accountName'] = $accountName; - $obj['container'] = $container; - $obj['sasToken'] = $sasToken; - $obj['clientID'] = $clientID; - $obj['clientSecret'] = $clientSecret; - $obj['password'] = $password; - $obj['username'] = $username; - - null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; - null !== $prefix && $obj['prefix'] = $prefix; - null !== $s3ForcePathStyle && $obj['s3ForcePathStyle'] = $s3ForcePathStyle; - null !== $forwardHostHeaderToOrigin && $obj['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; - - return $obj; + $self = new self; + + $self['accessKey'] = $accessKey; + $self['bucket'] = $bucket; + $self['name'] = $name; + $self['secretKey'] = $secretKey; + $self['endpoint'] = $endpoint; + $self['baseURL'] = $baseURL; + $self['clientEmail'] = $clientEmail; + $self['privateKey'] = $privateKey; + $self['accountName'] = $accountName; + $self['container'] = $container; + $self['sasToken'] = $sasToken; + $self['clientID'] = $clientID; + $self['clientSecret'] = $clientSecret; + $self['password'] = $password; + $self['username'] = $username; + + null !== $baseURLForCanonicalHeader && $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + null !== $includeCanonicalHeader && $self['includeCanonicalHeader'] = $includeCanonicalHeader; + null !== $prefix && $self['prefix'] = $prefix; + null !== $s3ForcePathStyle && $self['s3ForcePathStyle'] = $s3ForcePathStyle; + null !== $forwardHostHeaderToOrigin && $self['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; + + return $self; } /** @@ -258,18 +258,18 @@ public static function with( */ public function withAccessKey(string $accessKey): self { - $obj = clone $this; - $obj['accessKey'] = $accessKey; + $self = clone $this; + $self['accessKey'] = $accessKey; - return $obj; + return $self; } public function withBucket(string $bucket): self { - $obj = clone $this; - $obj['bucket'] = $bucket; + $self = clone $this; + $self['bucket'] = $bucket; - return $obj; + return $self; } /** @@ -277,10 +277,10 @@ public function withBucket(string $bucket): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -288,10 +288,10 @@ public function withName(string $name): self */ public function withSecretKey(string $secretKey): self { - $obj = clone $this; - $obj['secretKey'] = $secretKey; + $self = clone $this; + $self['secretKey'] = $secretKey; - return $obj; + return $self; } /** @@ -300,10 +300,10 @@ public function withSecretKey(string $secretKey): self public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { - $obj = clone $this; - $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + $self = clone $this; + $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } /** @@ -312,18 +312,18 @@ public function withBaseURLForCanonicalHeader( public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { - $obj = clone $this; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $self = clone $this; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; - return $obj; + return $self; } public function withPrefix(string $prefix): self { - $obj = clone $this; - $obj['prefix'] = $prefix; + $self = clone $this; + $self['prefix'] = $prefix; - return $obj; + return $self; } /** @@ -331,10 +331,10 @@ public function withPrefix(string $prefix): self */ public function withEndpoint(string $endpoint): self { - $obj = clone $this; - $obj['endpoint'] = $endpoint; + $self = clone $this; + $self['endpoint'] = $endpoint; - return $obj; + return $self; } /** @@ -342,10 +342,10 @@ public function withEndpoint(string $endpoint): self */ public function withS3ForcePathStyle(bool $s3ForcePathStyle): self { - $obj = clone $this; - $obj['s3ForcePathStyle'] = $s3ForcePathStyle; + $self = clone $this; + $self['s3ForcePathStyle'] = $s3ForcePathStyle; - return $obj; + return $self; } /** @@ -353,10 +353,10 @@ public function withS3ForcePathStyle(bool $s3ForcePathStyle): self */ public function withBaseURL(string $baseURL): self { - $obj = clone $this; - $obj['baseURL'] = $baseURL; + $self = clone $this; + $self['baseURL'] = $baseURL; - return $obj; + return $self; } /** @@ -365,50 +365,50 @@ public function withBaseURL(string $baseURL): self public function withForwardHostHeaderToOrigin( bool $forwardHostHeaderToOrigin ): self { - $obj = clone $this; - $obj['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; + $self = clone $this; + $self['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; - return $obj; + return $self; } public function withClientEmail(string $clientEmail): self { - $obj = clone $this; - $obj['clientEmail'] = $clientEmail; + $self = clone $this; + $self['clientEmail'] = $clientEmail; - return $obj; + return $self; } public function withPrivateKey(string $privateKey): self { - $obj = clone $this; - $obj['privateKey'] = $privateKey; + $self = clone $this; + $self['privateKey'] = $privateKey; - return $obj; + return $self; } public function withAccountName(string $accountName): self { - $obj = clone $this; - $obj['accountName'] = $accountName; + $self = clone $this; + $self['accountName'] = $accountName; - return $obj; + return $self; } public function withContainer(string $container): self { - $obj = clone $this; - $obj['container'] = $container; + $self = clone $this; + $self['container'] = $container; - return $obj; + return $self; } public function withSasToken(string $sasToken): self { - $obj = clone $this; - $obj['sasToken'] = $sasToken; + $self = clone $this; + $self['sasToken'] = $sasToken; - return $obj; + return $self; } /** @@ -416,10 +416,10 @@ public function withSasToken(string $sasToken): self */ public function withClientID(string $clientID): self { - $obj = clone $this; - $obj['clientID'] = $clientID; + $self = clone $this; + $self['clientID'] = $clientID; - return $obj; + return $self; } /** @@ -427,10 +427,10 @@ public function withClientID(string $clientID): self */ public function withClientSecret(string $clientSecret): self { - $obj = clone $this; - $obj['clientSecret'] = $clientSecret; + $self = clone $this; + $self['clientSecret'] = $clientSecret; - return $obj; + return $self; } /** @@ -438,10 +438,10 @@ public function withClientSecret(string $clientSecret): self */ public function withPassword(string $password): self { - $obj = clone $this; - $obj['password'] = $password; + $self = clone $this; + $self['password'] = $password; - return $obj; + return $self; } /** @@ -449,9 +449,9 @@ public function withPassword(string $password): self */ public function withUsername(string $username): self { - $obj = clone $this; - $obj['username'] = $username; + $self = clone $this; + $self['username'] = $username; - return $obj; + return $self; } } diff --git a/src/Accounts/Origins/OriginRequest/AkeneoPim.php b/src/Accounts/Origins/OriginRequest/AkeneoPim.php index b271c85f..e3bbef38 100644 --- a/src/Accounts/Origins/OriginRequest/AkeneoPim.php +++ b/src/Accounts/Origins/OriginRequest/AkeneoPim.php @@ -126,19 +126,19 @@ public static function with( ?string $baseURLForCanonicalHeader = null, ?bool $includeCanonicalHeader = null, ): self { - $obj = new self; + $self = new self; - $obj['baseURL'] = $baseURL; - $obj['clientID'] = $clientID; - $obj['clientSecret'] = $clientSecret; - $obj['name'] = $name; - $obj['password'] = $password; - $obj['username'] = $username; + $self['baseURL'] = $baseURL; + $self['clientID'] = $clientID; + $self['clientSecret'] = $clientSecret; + $self['name'] = $name; + $self['password'] = $password; + $self['username'] = $username; - null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + null !== $baseURLForCanonicalHeader && $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + null !== $includeCanonicalHeader && $self['includeCanonicalHeader'] = $includeCanonicalHeader; - return $obj; + return $self; } /** @@ -146,10 +146,10 @@ public static function with( */ public function withBaseURL(string $baseURL): self { - $obj = clone $this; - $obj['baseURL'] = $baseURL; + $self = clone $this; + $self['baseURL'] = $baseURL; - return $obj; + return $self; } /** @@ -157,10 +157,10 @@ public function withBaseURL(string $baseURL): self */ public function withClientID(string $clientID): self { - $obj = clone $this; - $obj['clientID'] = $clientID; + $self = clone $this; + $self['clientID'] = $clientID; - return $obj; + return $self; } /** @@ -168,10 +168,10 @@ public function withClientID(string $clientID): self */ public function withClientSecret(string $clientSecret): self { - $obj = clone $this; - $obj['clientSecret'] = $clientSecret; + $self = clone $this; + $self['clientSecret'] = $clientSecret; - return $obj; + return $self; } /** @@ -179,10 +179,10 @@ public function withClientSecret(string $clientSecret): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -190,10 +190,10 @@ public function withName(string $name): self */ public function withPassword(string $password): self { - $obj = clone $this; - $obj['password'] = $password; + $self = clone $this; + $self['password'] = $password; - return $obj; + return $self; } /** @@ -201,10 +201,10 @@ public function withPassword(string $password): self */ public function withUsername(string $username): self { - $obj = clone $this; - $obj['username'] = $username; + $self = clone $this; + $self['username'] = $username; - return $obj; + return $self; } /** @@ -213,10 +213,10 @@ public function withUsername(string $username): self public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { - $obj = clone $this; - $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + $self = clone $this; + $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } /** @@ -225,9 +225,9 @@ public function withBaseURLForCanonicalHeader( public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { - $obj = clone $this; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $self = clone $this; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; - return $obj; + return $self; } } diff --git a/src/Accounts/Origins/OriginRequest/AzureBlob.php b/src/Accounts/Origins/OriginRequest/AzureBlob.php index c8c943b5..c20498b3 100644 --- a/src/Accounts/Origins/OriginRequest/AzureBlob.php +++ b/src/Accounts/Origins/OriginRequest/AzureBlob.php @@ -97,34 +97,34 @@ public static function with( ?bool $includeCanonicalHeader = null, ?string $prefix = null, ): self { - $obj = new self; + $self = new self; - $obj['accountName'] = $accountName; - $obj['container'] = $container; - $obj['name'] = $name; - $obj['sasToken'] = $sasToken; + $self['accountName'] = $accountName; + $self['container'] = $container; + $self['name'] = $name; + $self['sasToken'] = $sasToken; - null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; - null !== $prefix && $obj['prefix'] = $prefix; + null !== $baseURLForCanonicalHeader && $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + null !== $includeCanonicalHeader && $self['includeCanonicalHeader'] = $includeCanonicalHeader; + null !== $prefix && $self['prefix'] = $prefix; - return $obj; + return $self; } public function withAccountName(string $accountName): self { - $obj = clone $this; - $obj['accountName'] = $accountName; + $self = clone $this; + $self['accountName'] = $accountName; - return $obj; + return $self; } public function withContainer(string $container): self { - $obj = clone $this; - $obj['container'] = $container; + $self = clone $this; + $self['container'] = $container; - return $obj; + return $self; } /** @@ -132,18 +132,18 @@ public function withContainer(string $container): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } public function withSasToken(string $sasToken): self { - $obj = clone $this; - $obj['sasToken'] = $sasToken; + $self = clone $this; + $self['sasToken'] = $sasToken; - return $obj; + return $self; } /** @@ -152,10 +152,10 @@ public function withSasToken(string $sasToken): self public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { - $obj = clone $this; - $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + $self = clone $this; + $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } /** @@ -164,17 +164,17 @@ public function withBaseURLForCanonicalHeader( public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { - $obj = clone $this; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $self = clone $this; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; - return $obj; + return $self; } public function withPrefix(string $prefix): self { - $obj = clone $this; - $obj['prefix'] = $prefix; + $self = clone $this; + $self['prefix'] = $prefix; - return $obj; + return $self; } } diff --git a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php index a228af4e..f018f6b3 100644 --- a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php @@ -109,18 +109,18 @@ public static function with( ?bool $includeCanonicalHeader = null, ?string $prefix = null, ): self { - $obj = new self; + $self = new self; - $obj['accessKey'] = $accessKey; - $obj['bucket'] = $bucket; - $obj['name'] = $name; - $obj['secretKey'] = $secretKey; + $self['accessKey'] = $accessKey; + $self['bucket'] = $bucket; + $self['name'] = $name; + $self['secretKey'] = $secretKey; - null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; - null !== $prefix && $obj['prefix'] = $prefix; + null !== $baseURLForCanonicalHeader && $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + null !== $includeCanonicalHeader && $self['includeCanonicalHeader'] = $includeCanonicalHeader; + null !== $prefix && $self['prefix'] = $prefix; - return $obj; + return $self; } /** @@ -128,10 +128,10 @@ public static function with( */ public function withAccessKey(string $accessKey): self { - $obj = clone $this; - $obj['accessKey'] = $accessKey; + $self = clone $this; + $self['accessKey'] = $accessKey; - return $obj; + return $self; } /** @@ -139,10 +139,10 @@ public function withAccessKey(string $accessKey): self */ public function withBucket(string $bucket): self { - $obj = clone $this; - $obj['bucket'] = $bucket; + $self = clone $this; + $self['bucket'] = $bucket; - return $obj; + return $self; } /** @@ -150,10 +150,10 @@ public function withBucket(string $bucket): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -161,10 +161,10 @@ public function withName(string $name): self */ public function withSecretKey(string $secretKey): self { - $obj = clone $this; - $obj['secretKey'] = $secretKey; + $self = clone $this; + $self['secretKey'] = $secretKey; - return $obj; + return $self; } /** @@ -173,10 +173,10 @@ public function withSecretKey(string $secretKey): self public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { - $obj = clone $this; - $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + $self = clone $this; + $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } /** @@ -185,10 +185,10 @@ public function withBaseURLForCanonicalHeader( public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { - $obj = clone $this; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $self = clone $this; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; - return $obj; + return $self; } /** @@ -196,9 +196,9 @@ public function withIncludeCanonicalHeader( */ public function withPrefix(string $prefix): self { - $obj = clone $this; - $obj['prefix'] = $prefix; + $self = clone $this; + $self['prefix'] = $prefix; - return $obj; + return $self; } } diff --git a/src/Accounts/Origins/OriginRequest/Gcs.php b/src/Accounts/Origins/OriginRequest/Gcs.php index 347200d0..5e7f2728 100644 --- a/src/Accounts/Origins/OriginRequest/Gcs.php +++ b/src/Accounts/Origins/OriginRequest/Gcs.php @@ -97,34 +97,34 @@ public static function with( ?bool $includeCanonicalHeader = null, ?string $prefix = null, ): self { - $obj = new self; + $self = new self; - $obj['bucket'] = $bucket; - $obj['clientEmail'] = $clientEmail; - $obj['name'] = $name; - $obj['privateKey'] = $privateKey; + $self['bucket'] = $bucket; + $self['clientEmail'] = $clientEmail; + $self['name'] = $name; + $self['privateKey'] = $privateKey; - null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; - null !== $prefix && $obj['prefix'] = $prefix; + null !== $baseURLForCanonicalHeader && $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + null !== $includeCanonicalHeader && $self['includeCanonicalHeader'] = $includeCanonicalHeader; + null !== $prefix && $self['prefix'] = $prefix; - return $obj; + return $self; } public function withBucket(string $bucket): self { - $obj = clone $this; - $obj['bucket'] = $bucket; + $self = clone $this; + $self['bucket'] = $bucket; - return $obj; + return $self; } public function withClientEmail(string $clientEmail): self { - $obj = clone $this; - $obj['clientEmail'] = $clientEmail; + $self = clone $this; + $self['clientEmail'] = $clientEmail; - return $obj; + return $self; } /** @@ -132,18 +132,18 @@ public function withClientEmail(string $clientEmail): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } public function withPrivateKey(string $privateKey): self { - $obj = clone $this; - $obj['privateKey'] = $privateKey; + $self = clone $this; + $self['privateKey'] = $privateKey; - return $obj; + return $self; } /** @@ -152,10 +152,10 @@ public function withPrivateKey(string $privateKey): self public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { - $obj = clone $this; - $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + $self = clone $this; + $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } /** @@ -164,17 +164,17 @@ public function withBaseURLForCanonicalHeader( public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { - $obj = clone $this; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $self = clone $this; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; - return $obj; + return $self; } public function withPrefix(string $prefix): self { - $obj = clone $this; - $obj['prefix'] = $prefix; + $self = clone $this; + $self['prefix'] = $prefix; - return $obj; + return $self; } } diff --git a/src/Accounts/Origins/OriginRequest/S3.php b/src/Accounts/Origins/OriginRequest/S3.php index 19b65e77..ad6cefea 100644 --- a/src/Accounts/Origins/OriginRequest/S3.php +++ b/src/Accounts/Origins/OriginRequest/S3.php @@ -105,18 +105,18 @@ public static function with( ?bool $includeCanonicalHeader = null, ?string $prefix = null, ): self { - $obj = new self; + $self = new self; - $obj['accessKey'] = $accessKey; - $obj['bucket'] = $bucket; - $obj['name'] = $name; - $obj['secretKey'] = $secretKey; + $self['accessKey'] = $accessKey; + $self['bucket'] = $bucket; + $self['name'] = $name; + $self['secretKey'] = $secretKey; - null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; - null !== $prefix && $obj['prefix'] = $prefix; + null !== $baseURLForCanonicalHeader && $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + null !== $includeCanonicalHeader && $self['includeCanonicalHeader'] = $includeCanonicalHeader; + null !== $prefix && $self['prefix'] = $prefix; - return $obj; + return $self; } /** @@ -124,10 +124,10 @@ public static function with( */ public function withAccessKey(string $accessKey): self { - $obj = clone $this; - $obj['accessKey'] = $accessKey; + $self = clone $this; + $self['accessKey'] = $accessKey; - return $obj; + return $self; } /** @@ -135,10 +135,10 @@ public function withAccessKey(string $accessKey): self */ public function withBucket(string $bucket): self { - $obj = clone $this; - $obj['bucket'] = $bucket; + $self = clone $this; + $self['bucket'] = $bucket; - return $obj; + return $self; } /** @@ -146,10 +146,10 @@ public function withBucket(string $bucket): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -157,10 +157,10 @@ public function withName(string $name): self */ public function withSecretKey(string $secretKey): self { - $obj = clone $this; - $obj['secretKey'] = $secretKey; + $self = clone $this; + $self['secretKey'] = $secretKey; - return $obj; + return $self; } /** @@ -169,10 +169,10 @@ public function withSecretKey(string $secretKey): self public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { - $obj = clone $this; - $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + $self = clone $this; + $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } /** @@ -181,10 +181,10 @@ public function withBaseURLForCanonicalHeader( public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { - $obj = clone $this; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $self = clone $this; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; - return $obj; + return $self; } /** @@ -192,9 +192,9 @@ public function withIncludeCanonicalHeader( */ public function withPrefix(string $prefix): self { - $obj = clone $this; - $obj['prefix'] = $prefix; + $self = clone $this; + $self['prefix'] = $prefix; - return $obj; + return $self; } } diff --git a/src/Accounts/Origins/OriginRequest/S3Compatible.php b/src/Accounts/Origins/OriginRequest/S3Compatible.php index a13799fd..b1e3d28f 100644 --- a/src/Accounts/Origins/OriginRequest/S3Compatible.php +++ b/src/Accounts/Origins/OriginRequest/S3Compatible.php @@ -128,20 +128,20 @@ public static function with( ?string $prefix = null, ?bool $s3ForcePathStyle = null, ): self { - $obj = new self; + $self = new self; - $obj['accessKey'] = $accessKey; - $obj['bucket'] = $bucket; - $obj['endpoint'] = $endpoint; - $obj['name'] = $name; - $obj['secretKey'] = $secretKey; + $self['accessKey'] = $accessKey; + $self['bucket'] = $bucket; + $self['endpoint'] = $endpoint; + $self['name'] = $name; + $self['secretKey'] = $secretKey; - null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; - null !== $prefix && $obj['prefix'] = $prefix; - null !== $s3ForcePathStyle && $obj['s3ForcePathStyle'] = $s3ForcePathStyle; + null !== $baseURLForCanonicalHeader && $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + null !== $includeCanonicalHeader && $self['includeCanonicalHeader'] = $includeCanonicalHeader; + null !== $prefix && $self['prefix'] = $prefix; + null !== $s3ForcePathStyle && $self['s3ForcePathStyle'] = $s3ForcePathStyle; - return $obj; + return $self; } /** @@ -149,10 +149,10 @@ public static function with( */ public function withAccessKey(string $accessKey): self { - $obj = clone $this; - $obj['accessKey'] = $accessKey; + $self = clone $this; + $self['accessKey'] = $accessKey; - return $obj; + return $self; } /** @@ -160,10 +160,10 @@ public function withAccessKey(string $accessKey): self */ public function withBucket(string $bucket): self { - $obj = clone $this; - $obj['bucket'] = $bucket; + $self = clone $this; + $self['bucket'] = $bucket; - return $obj; + return $self; } /** @@ -171,10 +171,10 @@ public function withBucket(string $bucket): self */ public function withEndpoint(string $endpoint): self { - $obj = clone $this; - $obj['endpoint'] = $endpoint; + $self = clone $this; + $self['endpoint'] = $endpoint; - return $obj; + return $self; } /** @@ -182,10 +182,10 @@ public function withEndpoint(string $endpoint): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -193,10 +193,10 @@ public function withName(string $name): self */ public function withSecretKey(string $secretKey): self { - $obj = clone $this; - $obj['secretKey'] = $secretKey; + $self = clone $this; + $self['secretKey'] = $secretKey; - return $obj; + return $self; } /** @@ -205,10 +205,10 @@ public function withSecretKey(string $secretKey): self public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { - $obj = clone $this; - $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + $self = clone $this; + $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } /** @@ -217,10 +217,10 @@ public function withBaseURLForCanonicalHeader( public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { - $obj = clone $this; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $self = clone $this; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; - return $obj; + return $self; } /** @@ -228,10 +228,10 @@ public function withIncludeCanonicalHeader( */ public function withPrefix(string $prefix): self { - $obj = clone $this; - $obj['prefix'] = $prefix; + $self = clone $this; + $self['prefix'] = $prefix; - return $obj; + return $self; } /** @@ -239,9 +239,9 @@ public function withPrefix(string $prefix): self */ public function withS3ForcePathStyle(bool $s3ForcePathStyle): self { - $obj = clone $this; - $obj['s3ForcePathStyle'] = $s3ForcePathStyle; + $self = clone $this; + $self['s3ForcePathStyle'] = $s3ForcePathStyle; - return $obj; + return $self; } } diff --git a/src/Accounts/Origins/OriginRequest/WebFolder.php b/src/Accounts/Origins/OriginRequest/WebFolder.php index b53bc0b0..3592f024 100644 --- a/src/Accounts/Origins/OriginRequest/WebFolder.php +++ b/src/Accounts/Origins/OriginRequest/WebFolder.php @@ -89,16 +89,16 @@ public static function with( ?bool $forwardHostHeaderToOrigin = null, ?bool $includeCanonicalHeader = null, ): self { - $obj = new self; + $self = new self; - $obj['baseURL'] = $baseURL; - $obj['name'] = $name; + $self['baseURL'] = $baseURL; + $self['name'] = $name; - null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - null !== $forwardHostHeaderToOrigin && $obj['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; - null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + null !== $baseURLForCanonicalHeader && $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + null !== $forwardHostHeaderToOrigin && $self['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; + null !== $includeCanonicalHeader && $self['includeCanonicalHeader'] = $includeCanonicalHeader; - return $obj; + return $self; } /** @@ -106,10 +106,10 @@ public static function with( */ public function withBaseURL(string $baseURL): self { - $obj = clone $this; - $obj['baseURL'] = $baseURL; + $self = clone $this; + $self['baseURL'] = $baseURL; - return $obj; + return $self; } /** @@ -117,10 +117,10 @@ public function withBaseURL(string $baseURL): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -129,10 +129,10 @@ public function withName(string $name): self public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { - $obj = clone $this; - $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + $self = clone $this; + $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } /** @@ -141,10 +141,10 @@ public function withBaseURLForCanonicalHeader( public function withForwardHostHeaderToOrigin( bool $forwardHostHeaderToOrigin ): self { - $obj = clone $this; - $obj['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; + $self = clone $this; + $self['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; - return $obj; + return $self; } /** @@ -153,9 +153,9 @@ public function withForwardHostHeaderToOrigin( public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { - $obj = clone $this; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $self = clone $this; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; - return $obj; + return $self; } } diff --git a/src/Accounts/Origins/OriginRequest/WebProxy.php b/src/Accounts/Origins/OriginRequest/WebProxy.php index 8453e19e..80733ff0 100644 --- a/src/Accounts/Origins/OriginRequest/WebProxy.php +++ b/src/Accounts/Origins/OriginRequest/WebProxy.php @@ -73,14 +73,14 @@ public static function with( ?string $baseURLForCanonicalHeader = null, ?bool $includeCanonicalHeader = null, ): self { - $obj = new self; + $self = new self; - $obj['name'] = $name; + $self['name'] = $name; - null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + null !== $baseURLForCanonicalHeader && $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + null !== $includeCanonicalHeader && $self['includeCanonicalHeader'] = $includeCanonicalHeader; - return $obj; + return $self; } /** @@ -88,10 +88,10 @@ public static function with( */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -100,10 +100,10 @@ public function withName(string $name): self public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { - $obj = clone $this; - $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + $self = clone $this; + $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } /** @@ -112,9 +112,9 @@ public function withBaseURLForCanonicalHeader( public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { - $obj = clone $this; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $self = clone $this; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; - return $obj; + return $self; } } diff --git a/src/Accounts/Origins/OriginResponse/AkeneoPim.php b/src/Accounts/Origins/OriginResponse/AkeneoPim.php index 5a05eacd..c78f4f42 100644 --- a/src/Accounts/Origins/OriginResponse/AkeneoPim.php +++ b/src/Accounts/Origins/OriginResponse/AkeneoPim.php @@ -93,16 +93,16 @@ public static function with( bool $includeCanonicalHeader = false, ?string $baseURLForCanonicalHeader = null, ): self { - $obj = new self; + $self = new self; - $obj['id'] = $id; - $obj['baseURL'] = $baseURL; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; - $obj['name'] = $name; + $self['id'] = $id; + $self['baseURL'] = $baseURL; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; + $self['name'] = $name; - null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } /** @@ -110,10 +110,10 @@ public static function with( */ public function withID(string $id): self { - $obj = clone $this; - $obj['id'] = $id; + $self = clone $this; + $self['id'] = $id; - return $obj; + return $self; } /** @@ -121,10 +121,10 @@ public function withID(string $id): self */ public function withBaseURL(string $baseURL): self { - $obj = clone $this; - $obj['baseURL'] = $baseURL; + $self = clone $this; + $self['baseURL'] = $baseURL; - return $obj; + return $self; } /** @@ -133,10 +133,10 @@ public function withBaseURL(string $baseURL): self public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { - $obj = clone $this; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $self = clone $this; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; - return $obj; + return $self; } /** @@ -144,10 +144,10 @@ public function withIncludeCanonicalHeader( */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -156,9 +156,9 @@ public function withName(string $name): self public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { - $obj = clone $this; - $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + $self = clone $this; + $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } } diff --git a/src/Accounts/Origins/OriginResponse/AzureBlob.php b/src/Accounts/Origins/OriginResponse/AzureBlob.php index 1dbbc5ee..81f80431 100644 --- a/src/Accounts/Origins/OriginResponse/AzureBlob.php +++ b/src/Accounts/Origins/OriginResponse/AzureBlob.php @@ -109,18 +109,18 @@ public static function with( bool $includeCanonicalHeader = false, ?string $baseURLForCanonicalHeader = null, ): self { - $obj = new self; + $self = new self; - $obj['id'] = $id; - $obj['accountName'] = $accountName; - $obj['container'] = $container; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; - $obj['name'] = $name; - $obj['prefix'] = $prefix; + $self['id'] = $id; + $self['accountName'] = $accountName; + $self['container'] = $container; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; + $self['name'] = $name; + $self['prefix'] = $prefix; - null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } /** @@ -128,26 +128,26 @@ public static function with( */ public function withID(string $id): self { - $obj = clone $this; - $obj['id'] = $id; + $self = clone $this; + $self['id'] = $id; - return $obj; + return $self; } public function withAccountName(string $accountName): self { - $obj = clone $this; - $obj['accountName'] = $accountName; + $self = clone $this; + $self['accountName'] = $accountName; - return $obj; + return $self; } public function withContainer(string $container): self { - $obj = clone $this; - $obj['container'] = $container; + $self = clone $this; + $self['container'] = $container; - return $obj; + return $self; } /** @@ -156,10 +156,10 @@ public function withContainer(string $container): self public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { - $obj = clone $this; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $self = clone $this; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; - return $obj; + return $self; } /** @@ -167,18 +167,18 @@ public function withIncludeCanonicalHeader( */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } public function withPrefix(string $prefix): self { - $obj = clone $this; - $obj['prefix'] = $prefix; + $self = clone $this; + $self['prefix'] = $prefix; - return $obj; + return $self; } /** @@ -187,9 +187,9 @@ public function withPrefix(string $prefix): self public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { - $obj = clone $this; - $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + $self = clone $this; + $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } } diff --git a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php index 2df579c8..174759c6 100644 --- a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php @@ -104,17 +104,17 @@ public static function with( bool $includeCanonicalHeader = false, ?string $baseURLForCanonicalHeader = null, ): self { - $obj = new self; + $self = new self; - $obj['id'] = $id; - $obj['bucket'] = $bucket; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; - $obj['name'] = $name; - $obj['prefix'] = $prefix; + $self['id'] = $id; + $self['bucket'] = $bucket; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; + $self['name'] = $name; + $self['prefix'] = $prefix; - null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } /** @@ -122,10 +122,10 @@ public static function with( */ public function withID(string $id): self { - $obj = clone $this; - $obj['id'] = $id; + $self = clone $this; + $self['id'] = $id; - return $obj; + return $self; } /** @@ -133,10 +133,10 @@ public function withID(string $id): self */ public function withBucket(string $bucket): self { - $obj = clone $this; - $obj['bucket'] = $bucket; + $self = clone $this; + $self['bucket'] = $bucket; - return $obj; + return $self; } /** @@ -145,10 +145,10 @@ public function withBucket(string $bucket): self public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { - $obj = clone $this; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $self = clone $this; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; - return $obj; + return $self; } /** @@ -156,10 +156,10 @@ public function withIncludeCanonicalHeader( */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -167,10 +167,10 @@ public function withName(string $name): self */ public function withPrefix(string $prefix): self { - $obj = clone $this; - $obj['prefix'] = $prefix; + $self = clone $this; + $self['prefix'] = $prefix; - return $obj; + return $self; } /** @@ -179,9 +179,9 @@ public function withPrefix(string $prefix): self public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { - $obj = clone $this; - $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + $self = clone $this; + $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } } diff --git a/src/Accounts/Origins/OriginResponse/Gcs.php b/src/Accounts/Origins/OriginResponse/Gcs.php index e875625b..276c4b40 100644 --- a/src/Accounts/Origins/OriginResponse/Gcs.php +++ b/src/Accounts/Origins/OriginResponse/Gcs.php @@ -109,18 +109,18 @@ public static function with( bool $includeCanonicalHeader = false, ?string $baseURLForCanonicalHeader = null, ): self { - $obj = new self; + $self = new self; - $obj['id'] = $id; - $obj['bucket'] = $bucket; - $obj['clientEmail'] = $clientEmail; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; - $obj['name'] = $name; - $obj['prefix'] = $prefix; + $self['id'] = $id; + $self['bucket'] = $bucket; + $self['clientEmail'] = $clientEmail; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; + $self['name'] = $name; + $self['prefix'] = $prefix; - null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } /** @@ -128,26 +128,26 @@ public static function with( */ public function withID(string $id): self { - $obj = clone $this; - $obj['id'] = $id; + $self = clone $this; + $self['id'] = $id; - return $obj; + return $self; } public function withBucket(string $bucket): self { - $obj = clone $this; - $obj['bucket'] = $bucket; + $self = clone $this; + $self['bucket'] = $bucket; - return $obj; + return $self; } public function withClientEmail(string $clientEmail): self { - $obj = clone $this; - $obj['clientEmail'] = $clientEmail; + $self = clone $this; + $self['clientEmail'] = $clientEmail; - return $obj; + return $self; } /** @@ -156,10 +156,10 @@ public function withClientEmail(string $clientEmail): self public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { - $obj = clone $this; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $self = clone $this; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; - return $obj; + return $self; } /** @@ -167,18 +167,18 @@ public function withIncludeCanonicalHeader( */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } public function withPrefix(string $prefix): self { - $obj = clone $this; - $obj['prefix'] = $prefix; + $self = clone $this; + $self['prefix'] = $prefix; - return $obj; + return $self; } /** @@ -187,9 +187,9 @@ public function withPrefix(string $prefix): self public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { - $obj = clone $this; - $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + $self = clone $this; + $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } } diff --git a/src/Accounts/Origins/OriginResponse/S3.php b/src/Accounts/Origins/OriginResponse/S3.php index 854570c8..021c64fb 100644 --- a/src/Accounts/Origins/OriginResponse/S3.php +++ b/src/Accounts/Origins/OriginResponse/S3.php @@ -104,17 +104,17 @@ public static function with( bool $includeCanonicalHeader = false, ?string $baseURLForCanonicalHeader = null, ): self { - $obj = new self; + $self = new self; - $obj['id'] = $id; - $obj['bucket'] = $bucket; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; - $obj['name'] = $name; - $obj['prefix'] = $prefix; + $self['id'] = $id; + $self['bucket'] = $bucket; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; + $self['name'] = $name; + $self['prefix'] = $prefix; - null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } /** @@ -122,10 +122,10 @@ public static function with( */ public function withID(string $id): self { - $obj = clone $this; - $obj['id'] = $id; + $self = clone $this; + $self['id'] = $id; - return $obj; + return $self; } /** @@ -133,10 +133,10 @@ public function withID(string $id): self */ public function withBucket(string $bucket): self { - $obj = clone $this; - $obj['bucket'] = $bucket; + $self = clone $this; + $self['bucket'] = $bucket; - return $obj; + return $self; } /** @@ -145,10 +145,10 @@ public function withBucket(string $bucket): self public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { - $obj = clone $this; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $self = clone $this; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; - return $obj; + return $self; } /** @@ -156,10 +156,10 @@ public function withIncludeCanonicalHeader( */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -167,10 +167,10 @@ public function withName(string $name): self */ public function withPrefix(string $prefix): self { - $obj = clone $this; - $obj['prefix'] = $prefix; + $self = clone $this; + $self['prefix'] = $prefix; - return $obj; + return $self; } /** @@ -179,9 +179,9 @@ public function withPrefix(string $prefix): self public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { - $obj = clone $this; - $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + $self = clone $this; + $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } } diff --git a/src/Accounts/Origins/OriginResponse/S3Compatible.php b/src/Accounts/Origins/OriginResponse/S3Compatible.php index 4ea3cfe7..1574dcd5 100644 --- a/src/Accounts/Origins/OriginResponse/S3Compatible.php +++ b/src/Accounts/Origins/OriginResponse/S3Compatible.php @@ -128,19 +128,19 @@ public static function with( bool $s3ForcePathStyle = false, ?string $baseURLForCanonicalHeader = null, ): self { - $obj = new self; + $self = new self; - $obj['id'] = $id; - $obj['bucket'] = $bucket; - $obj['endpoint'] = $endpoint; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; - $obj['name'] = $name; - $obj['prefix'] = $prefix; - $obj['s3ForcePathStyle'] = $s3ForcePathStyle; + $self['id'] = $id; + $self['bucket'] = $bucket; + $self['endpoint'] = $endpoint; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; + $self['name'] = $name; + $self['prefix'] = $prefix; + $self['s3ForcePathStyle'] = $s3ForcePathStyle; - null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } /** @@ -148,10 +148,10 @@ public static function with( */ public function withID(string $id): self { - $obj = clone $this; - $obj['id'] = $id; + $self = clone $this; + $self['id'] = $id; - return $obj; + return $self; } /** @@ -159,10 +159,10 @@ public function withID(string $id): self */ public function withBucket(string $bucket): self { - $obj = clone $this; - $obj['bucket'] = $bucket; + $self = clone $this; + $self['bucket'] = $bucket; - return $obj; + return $self; } /** @@ -170,10 +170,10 @@ public function withBucket(string $bucket): self */ public function withEndpoint(string $endpoint): self { - $obj = clone $this; - $obj['endpoint'] = $endpoint; + $self = clone $this; + $self['endpoint'] = $endpoint; - return $obj; + return $self; } /** @@ -182,10 +182,10 @@ public function withEndpoint(string $endpoint): self public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { - $obj = clone $this; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $self = clone $this; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; - return $obj; + return $self; } /** @@ -193,10 +193,10 @@ public function withIncludeCanonicalHeader( */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -204,10 +204,10 @@ public function withName(string $name): self */ public function withPrefix(string $prefix): self { - $obj = clone $this; - $obj['prefix'] = $prefix; + $self = clone $this; + $self['prefix'] = $prefix; - return $obj; + return $self; } /** @@ -215,10 +215,10 @@ public function withPrefix(string $prefix): self */ public function withS3ForcePathStyle(bool $s3ForcePathStyle): self { - $obj = clone $this; - $obj['s3ForcePathStyle'] = $s3ForcePathStyle; + $self = clone $this; + $self['s3ForcePathStyle'] = $s3ForcePathStyle; - return $obj; + return $self; } /** @@ -227,9 +227,9 @@ public function withS3ForcePathStyle(bool $s3ForcePathStyle): self public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { - $obj = clone $this; - $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + $self = clone $this; + $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } } diff --git a/src/Accounts/Origins/OriginResponse/WebFolder.php b/src/Accounts/Origins/OriginResponse/WebFolder.php index 61c9534e..f248e130 100644 --- a/src/Accounts/Origins/OriginResponse/WebFolder.php +++ b/src/Accounts/Origins/OriginResponse/WebFolder.php @@ -108,17 +108,17 @@ public static function with( bool $includeCanonicalHeader = false, ?string $baseURLForCanonicalHeader = null, ): self { - $obj = new self; + $self = new self; - $obj['id'] = $id; - $obj['baseURL'] = $baseURL; - $obj['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; - $obj['name'] = $name; + $self['id'] = $id; + $self['baseURL'] = $baseURL; + $self['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; + $self['name'] = $name; - null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } /** @@ -126,10 +126,10 @@ public static function with( */ public function withID(string $id): self { - $obj = clone $this; - $obj['id'] = $id; + $self = clone $this; + $self['id'] = $id; - return $obj; + return $self; } /** @@ -137,10 +137,10 @@ public function withID(string $id): self */ public function withBaseURL(string $baseURL): self { - $obj = clone $this; - $obj['baseURL'] = $baseURL; + $self = clone $this; + $self['baseURL'] = $baseURL; - return $obj; + return $self; } /** @@ -149,10 +149,10 @@ public function withBaseURL(string $baseURL): self public function withForwardHostHeaderToOrigin( bool $forwardHostHeaderToOrigin ): self { - $obj = clone $this; - $obj['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; + $self = clone $this; + $self['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; - return $obj; + return $self; } /** @@ -161,10 +161,10 @@ public function withForwardHostHeaderToOrigin( public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { - $obj = clone $this; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $self = clone $this; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; - return $obj; + return $self; } /** @@ -172,10 +172,10 @@ public function withIncludeCanonicalHeader( */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -184,9 +184,9 @@ public function withName(string $name): self public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { - $obj = clone $this; - $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + $self = clone $this; + $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } } diff --git a/src/Accounts/Origins/OriginResponse/WebProxy.php b/src/Accounts/Origins/OriginResponse/WebProxy.php index 6c5474be..67386360 100644 --- a/src/Accounts/Origins/OriginResponse/WebProxy.php +++ b/src/Accounts/Origins/OriginResponse/WebProxy.php @@ -81,15 +81,15 @@ public static function with( bool $includeCanonicalHeader = false, ?string $baseURLForCanonicalHeader = null, ): self { - $obj = new self; + $self = new self; - $obj['id'] = $id; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; - $obj['name'] = $name; + $self['id'] = $id; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; + $self['name'] = $name; - null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + null !== $baseURLForCanonicalHeader && $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } /** @@ -97,10 +97,10 @@ public static function with( */ public function withID(string $id): self { - $obj = clone $this; - $obj['id'] = $id; + $self = clone $this; + $self['id'] = $id; - return $obj; + return $self; } /** @@ -109,10 +109,10 @@ public function withID(string $id): self public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { - $obj = clone $this; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $self = clone $this; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; - return $obj; + return $self; } /** @@ -120,10 +120,10 @@ public function withIncludeCanonicalHeader( */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -132,9 +132,9 @@ public function withName(string $name): self public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { - $obj = clone $this; - $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + $self = clone $this; + $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } } diff --git a/src/Accounts/Origins/OriginUpdateParams.php b/src/Accounts/Origins/OriginUpdateParams.php index df9bd0ce..b1b26633 100644 --- a/src/Accounts/Origins/OriginUpdateParams.php +++ b/src/Accounts/Origins/OriginUpdateParams.php @@ -226,31 +226,31 @@ public static function with( ?bool $s3ForcePathStyle = null, ?bool $forwardHostHeaderToOrigin = null, ): self { - $obj = new self; - - $obj['accessKey'] = $accessKey; - $obj['bucket'] = $bucket; - $obj['name'] = $name; - $obj['secretKey'] = $secretKey; - $obj['endpoint'] = $endpoint; - $obj['baseURL'] = $baseURL; - $obj['clientEmail'] = $clientEmail; - $obj['privateKey'] = $privateKey; - $obj['accountName'] = $accountName; - $obj['container'] = $container; - $obj['sasToken'] = $sasToken; - $obj['clientID'] = $clientID; - $obj['clientSecret'] = $clientSecret; - $obj['password'] = $password; - $obj['username'] = $username; - - null !== $baseURLForCanonicalHeader && $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - null !== $includeCanonicalHeader && $obj['includeCanonicalHeader'] = $includeCanonicalHeader; - null !== $prefix && $obj['prefix'] = $prefix; - null !== $s3ForcePathStyle && $obj['s3ForcePathStyle'] = $s3ForcePathStyle; - null !== $forwardHostHeaderToOrigin && $obj['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; - - return $obj; + $self = new self; + + $self['accessKey'] = $accessKey; + $self['bucket'] = $bucket; + $self['name'] = $name; + $self['secretKey'] = $secretKey; + $self['endpoint'] = $endpoint; + $self['baseURL'] = $baseURL; + $self['clientEmail'] = $clientEmail; + $self['privateKey'] = $privateKey; + $self['accountName'] = $accountName; + $self['container'] = $container; + $self['sasToken'] = $sasToken; + $self['clientID'] = $clientID; + $self['clientSecret'] = $clientSecret; + $self['password'] = $password; + $self['username'] = $username; + + null !== $baseURLForCanonicalHeader && $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + null !== $includeCanonicalHeader && $self['includeCanonicalHeader'] = $includeCanonicalHeader; + null !== $prefix && $self['prefix'] = $prefix; + null !== $s3ForcePathStyle && $self['s3ForcePathStyle'] = $s3ForcePathStyle; + null !== $forwardHostHeaderToOrigin && $self['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; + + return $self; } /** @@ -258,18 +258,18 @@ public static function with( */ public function withAccessKey(string $accessKey): self { - $obj = clone $this; - $obj['accessKey'] = $accessKey; + $self = clone $this; + $self['accessKey'] = $accessKey; - return $obj; + return $self; } public function withBucket(string $bucket): self { - $obj = clone $this; - $obj['bucket'] = $bucket; + $self = clone $this; + $self['bucket'] = $bucket; - return $obj; + return $self; } /** @@ -277,10 +277,10 @@ public function withBucket(string $bucket): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -288,10 +288,10 @@ public function withName(string $name): self */ public function withSecretKey(string $secretKey): self { - $obj = clone $this; - $obj['secretKey'] = $secretKey; + $self = clone $this; + $self['secretKey'] = $secretKey; - return $obj; + return $self; } /** @@ -300,10 +300,10 @@ public function withSecretKey(string $secretKey): self public function withBaseURLForCanonicalHeader( string $baseURLForCanonicalHeader ): self { - $obj = clone $this; - $obj['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; + $self = clone $this; + $self['baseURLForCanonicalHeader'] = $baseURLForCanonicalHeader; - return $obj; + return $self; } /** @@ -312,18 +312,18 @@ public function withBaseURLForCanonicalHeader( public function withIncludeCanonicalHeader( bool $includeCanonicalHeader ): self { - $obj = clone $this; - $obj['includeCanonicalHeader'] = $includeCanonicalHeader; + $self = clone $this; + $self['includeCanonicalHeader'] = $includeCanonicalHeader; - return $obj; + return $self; } public function withPrefix(string $prefix): self { - $obj = clone $this; - $obj['prefix'] = $prefix; + $self = clone $this; + $self['prefix'] = $prefix; - return $obj; + return $self; } /** @@ -331,10 +331,10 @@ public function withPrefix(string $prefix): self */ public function withEndpoint(string $endpoint): self { - $obj = clone $this; - $obj['endpoint'] = $endpoint; + $self = clone $this; + $self['endpoint'] = $endpoint; - return $obj; + return $self; } /** @@ -342,10 +342,10 @@ public function withEndpoint(string $endpoint): self */ public function withS3ForcePathStyle(bool $s3ForcePathStyle): self { - $obj = clone $this; - $obj['s3ForcePathStyle'] = $s3ForcePathStyle; + $self = clone $this; + $self['s3ForcePathStyle'] = $s3ForcePathStyle; - return $obj; + return $self; } /** @@ -353,10 +353,10 @@ public function withS3ForcePathStyle(bool $s3ForcePathStyle): self */ public function withBaseURL(string $baseURL): self { - $obj = clone $this; - $obj['baseURL'] = $baseURL; + $self = clone $this; + $self['baseURL'] = $baseURL; - return $obj; + return $self; } /** @@ -365,50 +365,50 @@ public function withBaseURL(string $baseURL): self public function withForwardHostHeaderToOrigin( bool $forwardHostHeaderToOrigin ): self { - $obj = clone $this; - $obj['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; + $self = clone $this; + $self['forwardHostHeaderToOrigin'] = $forwardHostHeaderToOrigin; - return $obj; + return $self; } public function withClientEmail(string $clientEmail): self { - $obj = clone $this; - $obj['clientEmail'] = $clientEmail; + $self = clone $this; + $self['clientEmail'] = $clientEmail; - return $obj; + return $self; } public function withPrivateKey(string $privateKey): self { - $obj = clone $this; - $obj['privateKey'] = $privateKey; + $self = clone $this; + $self['privateKey'] = $privateKey; - return $obj; + return $self; } public function withAccountName(string $accountName): self { - $obj = clone $this; - $obj['accountName'] = $accountName; + $self = clone $this; + $self['accountName'] = $accountName; - return $obj; + return $self; } public function withContainer(string $container): self { - $obj = clone $this; - $obj['container'] = $container; + $self = clone $this; + $self['container'] = $container; - return $obj; + return $self; } public function withSasToken(string $sasToken): self { - $obj = clone $this; - $obj['sasToken'] = $sasToken; + $self = clone $this; + $self['sasToken'] = $sasToken; - return $obj; + return $self; } /** @@ -416,10 +416,10 @@ public function withSasToken(string $sasToken): self */ public function withClientID(string $clientID): self { - $obj = clone $this; - $obj['clientID'] = $clientID; + $self = clone $this; + $self['clientID'] = $clientID; - return $obj; + return $self; } /** @@ -427,10 +427,10 @@ public function withClientID(string $clientID): self */ public function withClientSecret(string $clientSecret): self { - $obj = clone $this; - $obj['clientSecret'] = $clientSecret; + $self = clone $this; + $self['clientSecret'] = $clientSecret; - return $obj; + return $self; } /** @@ -438,10 +438,10 @@ public function withClientSecret(string $clientSecret): self */ public function withPassword(string $password): self { - $obj = clone $this; - $obj['password'] = $password; + $self = clone $this; + $self['password'] = $password; - return $obj; + return $self; } /** @@ -449,9 +449,9 @@ public function withPassword(string $password): self */ public function withUsername(string $username): self { - $obj = clone $this; - $obj['username'] = $username; + $self = clone $this; + $self['username'] = $username; - return $obj; + return $self; } } diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php index d76964bd..f2a4a13f 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php @@ -96,15 +96,15 @@ public static function with( ?string $urlPrefix = null, Cloudinary|array|Imgix|Akamai|null $urlRewriter = null, ): self { - $obj = new self; + $self = new self; - $obj['description'] = $description; + $self['description'] = $description; - null !== $origins && $obj['origins'] = $origins; - null !== $urlPrefix && $obj['urlPrefix'] = $urlPrefix; - null !== $urlRewriter && $obj['urlRewriter'] = $urlRewriter; + null !== $origins && $self['origins'] = $origins; + null !== $urlPrefix && $self['urlPrefix'] = $urlPrefix; + null !== $urlRewriter && $self['urlRewriter'] = $urlRewriter; - return $obj; + return $self; } /** @@ -112,10 +112,10 @@ public static function with( */ public function withDescription(string $description): self { - $obj = clone $this; - $obj['description'] = $description; + $self = clone $this; + $self['description'] = $description; - return $obj; + return $self; } /** @@ -125,10 +125,10 @@ public function withDescription(string $description): self */ public function withOrigins(array $origins): self { - $obj = clone $this; - $obj['origins'] = $origins; + $self = clone $this; + $self['origins'] = $origins; - return $obj; + return $self; } /** @@ -136,10 +136,10 @@ public function withOrigins(array $origins): self */ public function withURLPrefix(string $urlPrefix): self { - $obj = clone $this; - $obj['urlPrefix'] = $urlPrefix; + $self = clone $this; + $self['urlPrefix'] = $urlPrefix; - return $obj; + return $self; } /** @@ -152,9 +152,9 @@ public function withURLPrefix(string $urlPrefix): self public function withURLRewriter( Cloudinary|array|Imgix|Akamai $urlRewriter ): self { - $obj = clone $this; - $obj['urlRewriter'] = $urlRewriter; + $self = clone $this; + $self['urlRewriter'] = $urlRewriter; - return $obj; + return $self; } } diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php index f79da17b..31f60f9c 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php @@ -41,11 +41,11 @@ public function __construct() */ public static function with(?bool $preserveAssetDeliveryTypes = null): self { - $obj = new self; + $self = new self; - null !== $preserveAssetDeliveryTypes && $obj['preserveAssetDeliveryTypes'] = $preserveAssetDeliveryTypes; + null !== $preserveAssetDeliveryTypes && $self['preserveAssetDeliveryTypes'] = $preserveAssetDeliveryTypes; - return $obj; + return $self; } /** @@ -54,9 +54,9 @@ public static function with(?bool $preserveAssetDeliveryTypes = null): self public function withPreserveAssetDeliveryTypes( bool $preserveAssetDeliveryTypes ): self { - $obj = clone $this; - $obj['preserveAssetDeliveryTypes'] = $preserveAssetDeliveryTypes; + $self = clone $this; + $self['preserveAssetDeliveryTypes'] = $preserveAssetDeliveryTypes; - return $obj; + return $self; } } diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest.php b/src/Accounts/URLEndpoints/URLEndpointRequest.php index 43740bc7..b0a9463b 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest.php @@ -89,15 +89,15 @@ public static function with( ?string $urlPrefix = null, Cloudinary|array|Imgix|Akamai|null $urlRewriter = null, ): self { - $obj = new self; + $self = new self; - $obj['description'] = $description; + $self['description'] = $description; - null !== $origins && $obj['origins'] = $origins; - null !== $urlPrefix && $obj['urlPrefix'] = $urlPrefix; - null !== $urlRewriter && $obj['urlRewriter'] = $urlRewriter; + null !== $origins && $self['origins'] = $origins; + null !== $urlPrefix && $self['urlPrefix'] = $urlPrefix; + null !== $urlRewriter && $self['urlRewriter'] = $urlRewriter; - return $obj; + return $self; } /** @@ -105,10 +105,10 @@ public static function with( */ public function withDescription(string $description): self { - $obj = clone $this; - $obj['description'] = $description; + $self = clone $this; + $self['description'] = $description; - return $obj; + return $self; } /** @@ -118,10 +118,10 @@ public function withDescription(string $description): self */ public function withOrigins(array $origins): self { - $obj = clone $this; - $obj['origins'] = $origins; + $self = clone $this; + $self['origins'] = $origins; - return $obj; + return $self; } /** @@ -129,10 +129,10 @@ public function withOrigins(array $origins): self */ public function withURLPrefix(string $urlPrefix): self { - $obj = clone $this; - $obj['urlPrefix'] = $urlPrefix; + $self = clone $this; + $self['urlPrefix'] = $urlPrefix; - return $obj; + return $self; } /** @@ -145,9 +145,9 @@ public function withURLPrefix(string $urlPrefix): self public function withURLRewriter( Cloudinary|array|Imgix|Akamai $urlRewriter ): self { - $obj = clone $this; - $obj['urlRewriter'] = $urlRewriter; + $self = clone $this; + $self['urlRewriter'] = $urlRewriter; - return $obj; + return $self; } } diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php index 65107809..34113a26 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php @@ -41,11 +41,11 @@ public function __construct() */ public static function with(?bool $preserveAssetDeliveryTypes = null): self { - $obj = new self; + $self = new self; - null !== $preserveAssetDeliveryTypes && $obj['preserveAssetDeliveryTypes'] = $preserveAssetDeliveryTypes; + null !== $preserveAssetDeliveryTypes && $self['preserveAssetDeliveryTypes'] = $preserveAssetDeliveryTypes; - return $obj; + return $self; } /** @@ -54,9 +54,9 @@ public static function with(?bool $preserveAssetDeliveryTypes = null): self public function withPreserveAssetDeliveryTypes( bool $preserveAssetDeliveryTypes ): self { - $obj = clone $this; - $obj['preserveAssetDeliveryTypes'] = $preserveAssetDeliveryTypes; + $self = clone $this; + $self['preserveAssetDeliveryTypes'] = $preserveAssetDeliveryTypes; - return $obj; + return $self; } } diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse.php b/src/Accounts/URLEndpoints/URLEndpointResponse.php index 1d9069b2..9610863f 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse.php @@ -103,16 +103,16 @@ public static function with( string $urlPrefix = '', Cloudinary|array|Imgix|Akamai|null $urlRewriter = null, ): self { - $obj = new self; + $self = new self; - $obj['id'] = $id; - $obj['description'] = $description; - $obj['origins'] = $origins; - $obj['urlPrefix'] = $urlPrefix; + $self['id'] = $id; + $self['description'] = $description; + $self['origins'] = $origins; + $self['urlPrefix'] = $urlPrefix; - null !== $urlRewriter && $obj['urlRewriter'] = $urlRewriter; + null !== $urlRewriter && $self['urlRewriter'] = $urlRewriter; - return $obj; + return $self; } /** @@ -120,10 +120,10 @@ public static function with( */ public function withID(string $id): self { - $obj = clone $this; - $obj['id'] = $id; + $self = clone $this; + $self['id'] = $id; - return $obj; + return $self; } /** @@ -131,10 +131,10 @@ public function withID(string $id): self */ public function withDescription(string $description): self { - $obj = clone $this; - $obj['description'] = $description; + $self = clone $this; + $self['description'] = $description; - return $obj; + return $self; } /** @@ -144,10 +144,10 @@ public function withDescription(string $description): self */ public function withOrigins(array $origins): self { - $obj = clone $this; - $obj['origins'] = $origins; + $self = clone $this; + $self['origins'] = $origins; - return $obj; + return $self; } /** @@ -155,10 +155,10 @@ public function withOrigins(array $origins): self */ public function withURLPrefix(string $urlPrefix): self { - $obj = clone $this; - $obj['urlPrefix'] = $urlPrefix; + $self = clone $this; + $self['urlPrefix'] = $urlPrefix; - return $obj; + return $self; } /** @@ -171,9 +171,9 @@ public function withURLPrefix(string $urlPrefix): self public function withURLRewriter( Cloudinary|array|Imgix|Akamai $urlRewriter ): self { - $obj = clone $this; - $obj['urlRewriter'] = $urlRewriter; + $self = clone $this; + $self['urlRewriter'] = $urlRewriter; - return $obj; + return $self; } } diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php index 1fcc2fc1..c4239206 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php @@ -54,11 +54,11 @@ public function __construct() */ public static function with(bool $preserveAssetDeliveryTypes = false): self { - $obj = new self; + $self = new self; - $obj['preserveAssetDeliveryTypes'] = $preserveAssetDeliveryTypes; + $self['preserveAssetDeliveryTypes'] = $preserveAssetDeliveryTypes; - return $obj; + return $self; } /** @@ -67,9 +67,9 @@ public static function with(bool $preserveAssetDeliveryTypes = false): self public function withPreserveAssetDeliveryTypes( bool $preserveAssetDeliveryTypes ): self { - $obj = clone $this; - $obj['preserveAssetDeliveryTypes'] = $preserveAssetDeliveryTypes; + $self = clone $this; + $self['preserveAssetDeliveryTypes'] = $preserveAssetDeliveryTypes; - return $obj; + return $self; } } diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php index 4ff97e13..102d0ef8 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php @@ -96,15 +96,15 @@ public static function with( ?string $urlPrefix = null, Cloudinary|array|Imgix|Akamai|null $urlRewriter = null, ): self { - $obj = new self; + $self = new self; - $obj['description'] = $description; + $self['description'] = $description; - null !== $origins && $obj['origins'] = $origins; - null !== $urlPrefix && $obj['urlPrefix'] = $urlPrefix; - null !== $urlRewriter && $obj['urlRewriter'] = $urlRewriter; + null !== $origins && $self['origins'] = $origins; + null !== $urlPrefix && $self['urlPrefix'] = $urlPrefix; + null !== $urlRewriter && $self['urlRewriter'] = $urlRewriter; - return $obj; + return $self; } /** @@ -112,10 +112,10 @@ public static function with( */ public function withDescription(string $description): self { - $obj = clone $this; - $obj['description'] = $description; + $self = clone $this; + $self['description'] = $description; - return $obj; + return $self; } /** @@ -125,10 +125,10 @@ public function withDescription(string $description): self */ public function withOrigins(array $origins): self { - $obj = clone $this; - $obj['origins'] = $origins; + $self = clone $this; + $self['origins'] = $origins; - return $obj; + return $self; } /** @@ -136,10 +136,10 @@ public function withOrigins(array $origins): self */ public function withURLPrefix(string $urlPrefix): self { - $obj = clone $this; - $obj['urlPrefix'] = $urlPrefix; + $self = clone $this; + $self['urlPrefix'] = $urlPrefix; - return $obj; + return $self; } /** @@ -152,9 +152,9 @@ public function withURLPrefix(string $urlPrefix): self public function withURLRewriter( Cloudinary|array|Imgix|Akamai $urlRewriter ): self { - $obj = clone $this; - $obj['urlRewriter'] = $urlRewriter; + $self = clone $this; + $self['urlRewriter'] = $urlRewriter; - return $obj; + return $self; } } diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php index 37e56264..18f80cd3 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php @@ -41,11 +41,11 @@ public function __construct() */ public static function with(?bool $preserveAssetDeliveryTypes = null): self { - $obj = new self; + $self = new self; - null !== $preserveAssetDeliveryTypes && $obj['preserveAssetDeliveryTypes'] = $preserveAssetDeliveryTypes; + null !== $preserveAssetDeliveryTypes && $self['preserveAssetDeliveryTypes'] = $preserveAssetDeliveryTypes; - return $obj; + return $self; } /** @@ -54,9 +54,9 @@ public static function with(?bool $preserveAssetDeliveryTypes = null): self public function withPreserveAssetDeliveryTypes( bool $preserveAssetDeliveryTypes ): self { - $obj = clone $this; - $obj['preserveAssetDeliveryTypes'] = $preserveAssetDeliveryTypes; + $self = clone $this; + $self['preserveAssetDeliveryTypes'] = $preserveAssetDeliveryTypes; - return $obj; + return $self; } } diff --git a/src/Accounts/Usage/UsageGetParams.php b/src/Accounts/Usage/UsageGetParams.php index cce6f28a..bd9ca144 100644 --- a/src/Accounts/Usage/UsageGetParams.php +++ b/src/Accounts/Usage/UsageGetParams.php @@ -64,12 +64,12 @@ public static function with( \DateTimeInterface $endDate, \DateTimeInterface $startDate ): self { - $obj = new self; + $self = new self; - $obj['endDate'] = $endDate; - $obj['startDate'] = $startDate; + $self['endDate'] = $endDate; + $self['startDate'] = $startDate; - return $obj; + return $self; } /** @@ -77,10 +77,10 @@ public static function with( */ public function withEndDate(\DateTimeInterface $endDate): self { - $obj = clone $this; - $obj['endDate'] = $endDate; + $self = clone $this; + $self['endDate'] = $endDate; - return $obj; + return $self; } /** @@ -88,9 +88,9 @@ public function withEndDate(\DateTimeInterface $endDate): self */ public function withStartDate(\DateTimeInterface $startDate): self { - $obj = clone $this; - $obj['startDate'] = $startDate; + $self = clone $this; + $self['startDate'] = $startDate; - return $obj; + return $self; } } diff --git a/src/Accounts/Usage/UsageGetResponse.php b/src/Accounts/Usage/UsageGetResponse.php index 515cced2..a5c24d50 100644 --- a/src/Accounts/Usage/UsageGetResponse.php +++ b/src/Accounts/Usage/UsageGetResponse.php @@ -69,15 +69,15 @@ public static function with( ?int $originalCacheStorageBytes = null, ?int $videoProcessingUnitsCount = null, ): self { - $obj = new self; + $self = new self; - null !== $bandwidthBytes && $obj['bandwidthBytes'] = $bandwidthBytes; - null !== $extensionUnitsCount && $obj['extensionUnitsCount'] = $extensionUnitsCount; - null !== $mediaLibraryStorageBytes && $obj['mediaLibraryStorageBytes'] = $mediaLibraryStorageBytes; - null !== $originalCacheStorageBytes && $obj['originalCacheStorageBytes'] = $originalCacheStorageBytes; - null !== $videoProcessingUnitsCount && $obj['videoProcessingUnitsCount'] = $videoProcessingUnitsCount; + null !== $bandwidthBytes && $self['bandwidthBytes'] = $bandwidthBytes; + null !== $extensionUnitsCount && $self['extensionUnitsCount'] = $extensionUnitsCount; + null !== $mediaLibraryStorageBytes && $self['mediaLibraryStorageBytes'] = $mediaLibraryStorageBytes; + null !== $originalCacheStorageBytes && $self['originalCacheStorageBytes'] = $originalCacheStorageBytes; + null !== $videoProcessingUnitsCount && $self['videoProcessingUnitsCount'] = $videoProcessingUnitsCount; - return $obj; + return $self; } /** @@ -85,10 +85,10 @@ public static function with( */ public function withBandwidthBytes(int $bandwidthBytes): self { - $obj = clone $this; - $obj['bandwidthBytes'] = $bandwidthBytes; + $self = clone $this; + $self['bandwidthBytes'] = $bandwidthBytes; - return $obj; + return $self; } /** @@ -96,10 +96,10 @@ public function withBandwidthBytes(int $bandwidthBytes): self */ public function withExtensionUnitsCount(int $extensionUnitsCount): self { - $obj = clone $this; - $obj['extensionUnitsCount'] = $extensionUnitsCount; + $self = clone $this; + $self['extensionUnitsCount'] = $extensionUnitsCount; - return $obj; + return $self; } /** @@ -108,10 +108,10 @@ public function withExtensionUnitsCount(int $extensionUnitsCount): self public function withMediaLibraryStorageBytes( int $mediaLibraryStorageBytes ): self { - $obj = clone $this; - $obj['mediaLibraryStorageBytes'] = $mediaLibraryStorageBytes; + $self = clone $this; + $self['mediaLibraryStorageBytes'] = $mediaLibraryStorageBytes; - return $obj; + return $self; } /** @@ -120,10 +120,10 @@ public function withMediaLibraryStorageBytes( public function withOriginalCacheStorageBytes( int $originalCacheStorageBytes ): self { - $obj = clone $this; - $obj['originalCacheStorageBytes'] = $originalCacheStorageBytes; + $self = clone $this; + $self['originalCacheStorageBytes'] = $originalCacheStorageBytes; - return $obj; + return $self; } /** @@ -132,9 +132,9 @@ public function withOriginalCacheStorageBytes( public function withVideoProcessingUnitsCount( int $videoProcessingUnitsCount ): self { - $obj = clone $this; - $obj['videoProcessingUnitsCount'] = $videoProcessingUnitsCount; + $self = clone $this; + $self['videoProcessingUnitsCount'] = $videoProcessingUnitsCount; - return $obj; + return $self; } } diff --git a/src/Assets/AssetListParams.php b/src/Assets/AssetListParams.php index 5bd2cdef..487e23c6 100644 --- a/src/Assets/AssetListParams.php +++ b/src/Assets/AssetListParams.php @@ -124,17 +124,17 @@ public static function with( Sort|string|null $sort = null, Type|string|null $type = null, ): self { - $obj = new self; + $self = new self; - null !== $fileType && $obj['fileType'] = $fileType; - null !== $limit && $obj['limit'] = $limit; - null !== $path && $obj['path'] = $path; - null !== $searchQuery && $obj['searchQuery'] = $searchQuery; - null !== $skip && $obj['skip'] = $skip; - null !== $sort && $obj['sort'] = $sort; - null !== $type && $obj['type'] = $type; + null !== $fileType && $self['fileType'] = $fileType; + null !== $limit && $self['limit'] = $limit; + null !== $path && $self['path'] = $path; + null !== $searchQuery && $self['searchQuery'] = $searchQuery; + null !== $skip && $self['skip'] = $skip; + null !== $sort && $self['sort'] = $sort; + null !== $type && $self['type'] = $type; - return $obj; + return $self; } /** @@ -148,10 +148,10 @@ public static function with( */ public function withFileType(FileType|string $fileType): self { - $obj = clone $this; - $obj['fileType'] = $fileType; + $self = clone $this; + $self['fileType'] = $fileType; - return $obj; + return $self; } /** @@ -159,10 +159,10 @@ public function withFileType(FileType|string $fileType): self */ public function withLimit(int $limit): self { - $obj = clone $this; - $obj['limit'] = $limit; + $self = clone $this; + $self['limit'] = $limit; - return $obj; + return $self; } /** @@ -173,10 +173,10 @@ public function withLimit(int $limit): self */ public function withPath(string $path): self { - $obj = clone $this; - $obj['path'] = $path; + $self = clone $this; + $self['path'] = $path; - return $obj; + return $self; } /** @@ -192,10 +192,10 @@ public function withPath(string $path): self */ public function withSearchQuery(string $searchQuery): self { - $obj = clone $this; - $obj['searchQuery'] = $searchQuery; + $self = clone $this; + $self['searchQuery'] = $searchQuery; - return $obj; + return $self; } /** @@ -203,10 +203,10 @@ public function withSearchQuery(string $searchQuery): self */ public function withSkip(int $skip): self { - $obj = clone $this; - $obj['skip'] = $skip; + $self = clone $this; + $self['skip'] = $skip; - return $obj; + return $self; } /** @@ -216,10 +216,10 @@ public function withSkip(int $skip): self */ public function withSort(Sort|string $sort): self { - $obj = clone $this; - $obj['sort'] = $sort; + $self = clone $this; + $self['sort'] = $sort; - return $obj; + return $self; } /** @@ -234,9 +234,9 @@ public function withSort(Sort|string $sort): self */ public function withType(Type|string $type): self { - $obj = clone $this; - $obj['type'] = $type; + $self = clone $this; + $self['type'] = $type; - return $obj; + return $self; } } diff --git a/src/BaseOverlay.php b/src/BaseOverlay.php index 76de3e1f..261a28c6 100644 --- a/src/BaseOverlay.php +++ b/src/BaseOverlay.php @@ -48,12 +48,12 @@ public static function with( OverlayPosition|array|null $position = null, OverlayTiming|array|null $timing = null ): self { - $obj = new self; + $self = new self; - null !== $position && $obj['position'] = $position; - null !== $timing && $obj['timing'] = $timing; + null !== $position && $self['position'] = $position; + null !== $timing && $self['timing'] = $timing; - return $obj; + return $self; } /** @@ -63,10 +63,10 @@ public static function with( */ public function withPosition(OverlayPosition|array $position): self { - $obj = clone $this; - $obj['position'] = $position; + $self = clone $this; + $self['position'] = $position; - return $obj; + return $self; } /** @@ -78,9 +78,9 @@ public function withPosition(OverlayPosition|array $position): self */ public function withTiming(OverlayTiming|array $timing): self { - $obj = clone $this; - $obj['timing'] = $timing; + $self = clone $this; + $self['timing'] = $timing; - return $obj; + return $self; } } diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index c894150e..0d6b86f1 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -298,31 +298,31 @@ public static function with( ?bool $useUniqueFileName = null, ?string $webhookURL = null, ): self { - $obj = new self; - - $obj['file'] = $file; - $obj['fileName'] = $fileName; - - null !== $token && $obj['token'] = $token; - null !== $checks && $obj['checks'] = $checks; - null !== $customCoordinates && $obj['customCoordinates'] = $customCoordinates; - null !== $customMetadata && $obj['customMetadata'] = $customMetadata; - null !== $description && $obj['description'] = $description; - null !== $extensions && $obj['extensions'] = $extensions; - null !== $folder && $obj['folder'] = $folder; - null !== $isPrivateFile && $obj['isPrivateFile'] = $isPrivateFile; - null !== $isPublished && $obj['isPublished'] = $isPublished; - null !== $overwriteAITags && $obj['overwriteAITags'] = $overwriteAITags; - null !== $overwriteCustomMetadata && $obj['overwriteCustomMetadata'] = $overwriteCustomMetadata; - null !== $overwriteFile && $obj['overwriteFile'] = $overwriteFile; - null !== $overwriteTags && $obj['overwriteTags'] = $overwriteTags; - null !== $responseFields && $obj['responseFields'] = $responseFields; - null !== $tags && $obj['tags'] = $tags; - null !== $transformation && $obj['transformation'] = $transformation; - null !== $useUniqueFileName && $obj['useUniqueFileName'] = $useUniqueFileName; - null !== $webhookURL && $obj['webhookURL'] = $webhookURL; - - return $obj; + $self = new self; + + $self['file'] = $file; + $self['fileName'] = $fileName; + + null !== $token && $self['token'] = $token; + null !== $checks && $self['checks'] = $checks; + null !== $customCoordinates && $self['customCoordinates'] = $customCoordinates; + null !== $customMetadata && $self['customMetadata'] = $customMetadata; + null !== $description && $self['description'] = $description; + null !== $extensions && $self['extensions'] = $extensions; + null !== $folder && $self['folder'] = $folder; + null !== $isPrivateFile && $self['isPrivateFile'] = $isPrivateFile; + null !== $isPublished && $self['isPublished'] = $isPublished; + null !== $overwriteAITags && $self['overwriteAITags'] = $overwriteAITags; + null !== $overwriteCustomMetadata && $self['overwriteCustomMetadata'] = $overwriteCustomMetadata; + null !== $overwriteFile && $self['overwriteFile'] = $overwriteFile; + null !== $overwriteTags && $self['overwriteTags'] = $overwriteTags; + null !== $responseFields && $self['responseFields'] = $responseFields; + null !== $tags && $self['tags'] = $tags; + null !== $transformation && $self['transformation'] = $transformation; + null !== $useUniqueFileName && $self['useUniqueFileName'] = $useUniqueFileName; + null !== $webhookURL && $self['webhookURL'] = $webhookURL; + + return $self; } /** @@ -336,10 +336,10 @@ public static function with( */ public function withFile(string $file): self { - $obj = clone $this; - $obj['file'] = $file; + $self = clone $this; + $self['file'] = $file; - return $obj; + return $self; } /** @@ -347,10 +347,10 @@ public function withFile(string $file): self */ public function withFileName(string $fileName): self { - $obj = clone $this; - $obj['fileName'] = $fileName; + $self = clone $this; + $self['fileName'] = $fileName; - return $obj; + return $self; } /** @@ -363,10 +363,10 @@ public function withFileName(string $fileName): self */ public function withToken(string $token): self { - $obj = clone $this; - $obj['token'] = $token; + $self = clone $this; + $self['token'] = $token; - return $obj; + return $self; } /** @@ -375,10 +375,10 @@ public function withToken(string $token): self */ public function withChecks(string $checks): self { - $obj = clone $this; - $obj['checks'] = $checks; + $self = clone $this; + $self['checks'] = $checks; - return $obj; + return $self; } /** @@ -390,10 +390,10 @@ public function withChecks(string $checks): self */ public function withCustomCoordinates(string $customCoordinates): self { - $obj = clone $this; - $obj['customCoordinates'] = $customCoordinates; + $self = clone $this; + $self['customCoordinates'] = $customCoordinates; - return $obj; + return $self; } /** @@ -403,10 +403,10 @@ public function withCustomCoordinates(string $customCoordinates): self */ public function withCustomMetadata(array $customMetadata): self { - $obj = clone $this; - $obj['customMetadata'] = $customMetadata; + $self = clone $this; + $self['customMetadata'] = $customMetadata; - return $obj; + return $self; } /** @@ -414,10 +414,10 @@ public function withCustomMetadata(array $customMetadata): self */ public function withDescription(string $description): self { - $obj = clone $this; - $obj['description'] = $description; + $self = clone $this; + $self['description'] = $description; - return $obj; + return $self; } /** @@ -431,10 +431,10 @@ public function withDescription(string $description): self */ public function withExtensions(array $extensions): self { - $obj = clone $this; - $obj['extensions'] = $extensions; + $self = clone $this; + $self['extensions'] = $extensions; - return $obj; + return $self; } /** @@ -442,10 +442,10 @@ public function withExtensions(array $extensions): self */ public function withFolder(string $folder): self { - $obj = clone $this; - $obj['folder'] = $folder; + $self = clone $this; + $self['folder'] = $folder; - return $obj; + return $self; } /** @@ -455,10 +455,10 @@ public function withFolder(string $folder): self */ public function withIsPrivateFile(bool $isPrivateFile): self { - $obj = clone $this; - $obj['isPrivateFile'] = $isPrivateFile; + $self = clone $this; + $self['isPrivateFile'] = $isPrivateFile; - return $obj; + return $self; } /** @@ -470,10 +470,10 @@ public function withIsPrivateFile(bool $isPrivateFile): self */ public function withIsPublished(bool $isPublished): self { - $obj = clone $this; - $obj['isPublished'] = $isPublished; + $self = clone $this; + $self['isPublished'] = $isPublished; - return $obj; + return $self; } /** @@ -481,10 +481,10 @@ public function withIsPublished(bool $isPublished): self */ public function withOverwriteAITags(bool $overwriteAITags): self { - $obj = clone $this; - $obj['overwriteAITags'] = $overwriteAITags; + $self = clone $this; + $self['overwriteAITags'] = $overwriteAITags; - return $obj; + return $self; } /** @@ -493,10 +493,10 @@ public function withOverwriteAITags(bool $overwriteAITags): self public function withOverwriteCustomMetadata( bool $overwriteCustomMetadata ): self { - $obj = clone $this; - $obj['overwriteCustomMetadata'] = $overwriteCustomMetadata; + $self = clone $this; + $self['overwriteCustomMetadata'] = $overwriteCustomMetadata; - return $obj; + return $self; } /** @@ -504,10 +504,10 @@ public function withOverwriteCustomMetadata( */ public function withOverwriteFile(bool $overwriteFile): self { - $obj = clone $this; - $obj['overwriteFile'] = $overwriteFile; + $self = clone $this; + $self['overwriteFile'] = $overwriteFile; - return $obj; + return $self; } /** @@ -515,10 +515,10 @@ public function withOverwriteFile(bool $overwriteFile): self */ public function withOverwriteTags(bool $overwriteTags): self { - $obj = clone $this; - $obj['overwriteTags'] = $overwriteTags; + $self = clone $this; + $self['overwriteTags'] = $overwriteTags; - return $obj; + return $self; } /** @@ -528,10 +528,10 @@ public function withOverwriteTags(bool $overwriteTags): self */ public function withResponseFields(array $responseFields): self { - $obj = clone $this; - $obj['responseFields'] = $responseFields; + $self = clone $this; + $self['responseFields'] = $responseFields; - return $obj; + return $self; } /** @@ -543,10 +543,10 @@ public function withResponseFields(array $responseFields): self */ public function withTags(array $tags): self { - $obj = clone $this; - $obj['tags'] = $tags; + $self = clone $this; + $self['tags'] = $tags; - return $obj; + return $self; } /** @@ -568,10 +568,10 @@ public function withTags(array $tags): self public function withTransformation( Transformation|array $transformation ): self { - $obj = clone $this; - $obj['transformation'] = $transformation; + $self = clone $this; + $self['transformation'] = $transformation; - return $obj; + return $self; } /** @@ -583,10 +583,10 @@ public function withTransformation( */ public function withUseUniqueFileName(bool $useUniqueFileName): self { - $obj = clone $this; - $obj['useUniqueFileName'] = $useUniqueFileName; + $self = clone $this; + $self['useUniqueFileName'] = $useUniqueFileName; - return $obj; + return $self; } /** @@ -594,9 +594,9 @@ public function withUseUniqueFileName(bool $useUniqueFileName): self */ public function withWebhookURL(string $webhookURL): self { - $obj = clone $this; - $obj['webhookURL'] = $webhookURL; + $self = clone $this; + $self['webhookURL'] = $webhookURL; - return $obj; + return $self; } } diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation.php index 5bf7e3a5..c5abfd84 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation.php @@ -68,12 +68,12 @@ public function __construct() */ public static function with(?array $post = null, ?string $pre = null): self { - $obj = new self; + $self = new self; - null !== $post && $obj['post'] = $post; - null !== $pre && $obj['pre'] = $pre; + null !== $post && $self['post'] = $post; + null !== $pre && $self['pre'] = $pre; - return $obj; + return $self; } /** @@ -89,10 +89,10 @@ public static function with(?array $post = null, ?string $pre = null): self */ public function withPost(array $post): self { - $obj = clone $this; - $obj['post'] = $post; + $self = clone $this; + $self['post'] = $post; - return $obj; + return $self; } /** @@ -100,9 +100,9 @@ public function withPost(array $post): self */ public function withPre(string $pre): self { - $obj = clone $this; - $obj['pre'] = $pre; + $self = clone $this; + $self['pre'] = $pre; - return $obj; + return $self; } } diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php index 2a379a23..39fdcd2a 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php @@ -69,12 +69,12 @@ public function __construct() */ public static function with(Protocol|string $protocol, string $value): self { - $obj = new self; + $self = new self; - $obj['protocol'] = $protocol; - $obj['value'] = $value; + $self['protocol'] = $protocol; + $self['value'] = $value; - return $obj; + return $self; } /** @@ -84,10 +84,10 @@ public static function with(Protocol|string $protocol, string $value): self */ public function withProtocol(Protocol|string $protocol): self { - $obj = clone $this; - $obj['protocol'] = $protocol; + $self = clone $this; + $self['protocol'] = $protocol; - return $obj; + return $self; } /** @@ -95,9 +95,9 @@ public function withProtocol(Protocol|string $protocol): self */ public function withValue(string $value): self { - $obj = clone $this; - $obj['value'] = $value; + $self = clone $this; + $self['value'] = $value; - return $obj; + return $self; } } diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php index 766542c8..9d4d09da 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php @@ -46,11 +46,11 @@ public function __construct() */ public static function with(?string $value = null): self { - $obj = new self; + $self = new self; - null !== $value && $obj['value'] = $value; + null !== $value && $self['value'] = $value; - return $obj; + return $self; } /** @@ -59,9 +59,9 @@ public static function with(?string $value = null): self */ public function withValue(string $value): self { - $obj = clone $this; - $obj['value'] = $value; + $self = clone $this; + $self['value'] = $value; - return $obj; + return $self; } } diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php index 7a9605bb..d100c216 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php @@ -44,11 +44,11 @@ public function __construct() */ public static function with(?string $value = null): self { - $obj = new self; + $self = new self; - null !== $value && $obj['value'] = $value; + null !== $value && $self['value'] = $value; - return $obj; + return $self; } /** @@ -57,9 +57,9 @@ public static function with(?string $value = null): self */ public function withValue(string $value): self { - $obj = clone $this; - $obj['value'] = $value; + $self = clone $this; + $self['value'] = $value; - return $obj; + return $self; } } diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php index a9e790f4..fc1082c8 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php @@ -59,11 +59,11 @@ public function __construct() */ public static function with(string $value): self { - $obj = new self; + $self = new self; - $obj['value'] = $value; + $self['value'] = $value; - return $obj; + return $self; } /** @@ -72,9 +72,9 @@ public static function with(string $value): self */ public function withValue(string $value): self { - $obj = clone $this; - $obj['value'] = $value; + $self = clone $this; + $self['value'] = $value; - return $obj; + return $self; } } diff --git a/src/Beta/V2/Files/FileUploadResponse.php b/src/Beta/V2/Files/FileUploadResponse.php index 0579ac38..42309f3e 100644 --- a/src/Beta/V2/Files/FileUploadResponse.php +++ b/src/Beta/V2/Files/FileUploadResponse.php @@ -304,35 +304,35 @@ public static function with( ?string $videoCodec = null, ?float $width = null, ): self { - $obj = new self; - - null !== $aiTags && $obj['aiTags'] = $aiTags; - null !== $audioCodec && $obj['audioCodec'] = $audioCodec; - null !== $bitRate && $obj['bitRate'] = $bitRate; - null !== $customCoordinates && $obj['customCoordinates'] = $customCoordinates; - null !== $customMetadata && $obj['customMetadata'] = $customMetadata; - null !== $description && $obj['description'] = $description; - null !== $duration && $obj['duration'] = $duration; - null !== $embeddedMetadata && $obj['embeddedMetadata'] = $embeddedMetadata; - null !== $extensionStatus && $obj['extensionStatus'] = $extensionStatus; - null !== $fileID && $obj['fileID'] = $fileID; - null !== $filePath && $obj['filePath'] = $filePath; - null !== $fileType && $obj['fileType'] = $fileType; - null !== $height && $obj['height'] = $height; - null !== $isPrivateFile && $obj['isPrivateFile'] = $isPrivateFile; - null !== $isPublished && $obj['isPublished'] = $isPublished; - null !== $metadata && $obj['metadata'] = $metadata; - null !== $name && $obj['name'] = $name; - null !== $selectedFieldsSchema && $obj['selectedFieldsSchema'] = $selectedFieldsSchema; - null !== $size && $obj['size'] = $size; - null !== $tags && $obj['tags'] = $tags; - null !== $thumbnailURL && $obj['thumbnailURL'] = $thumbnailURL; - null !== $url && $obj['url'] = $url; - null !== $versionInfo && $obj['versionInfo'] = $versionInfo; - null !== $videoCodec && $obj['videoCodec'] = $videoCodec; - null !== $width && $obj['width'] = $width; - - return $obj; + $self = new self; + + null !== $aiTags && $self['aiTags'] = $aiTags; + null !== $audioCodec && $self['audioCodec'] = $audioCodec; + null !== $bitRate && $self['bitRate'] = $bitRate; + null !== $customCoordinates && $self['customCoordinates'] = $customCoordinates; + null !== $customMetadata && $self['customMetadata'] = $customMetadata; + null !== $description && $self['description'] = $description; + null !== $duration && $self['duration'] = $duration; + null !== $embeddedMetadata && $self['embeddedMetadata'] = $embeddedMetadata; + null !== $extensionStatus && $self['extensionStatus'] = $extensionStatus; + null !== $fileID && $self['fileID'] = $fileID; + null !== $filePath && $self['filePath'] = $filePath; + null !== $fileType && $self['fileType'] = $fileType; + null !== $height && $self['height'] = $height; + null !== $isPrivateFile && $self['isPrivateFile'] = $isPrivateFile; + null !== $isPublished && $self['isPublished'] = $isPublished; + null !== $metadata && $self['metadata'] = $metadata; + null !== $name && $self['name'] = $name; + null !== $selectedFieldsSchema && $self['selectedFieldsSchema'] = $selectedFieldsSchema; + null !== $size && $self['size'] = $size; + null !== $tags && $self['tags'] = $tags; + null !== $thumbnailURL && $self['thumbnailURL'] = $thumbnailURL; + null !== $url && $self['url'] = $url; + null !== $versionInfo && $self['versionInfo'] = $versionInfo; + null !== $videoCodec && $self['videoCodec'] = $videoCodec; + null !== $width && $self['width'] = $width; + + return $self; } /** @@ -344,10 +344,10 @@ public static function with( */ public function withAITags(?array $aiTags): self { - $obj = clone $this; - $obj['aiTags'] = $aiTags; + $self = clone $this; + $self['aiTags'] = $aiTags; - return $obj; + return $self; } /** @@ -355,10 +355,10 @@ public function withAITags(?array $aiTags): self */ public function withAudioCodec(string $audioCodec): self { - $obj = clone $this; - $obj['audioCodec'] = $audioCodec; + $self = clone $this; + $self['audioCodec'] = $audioCodec; - return $obj; + return $self; } /** @@ -366,10 +366,10 @@ public function withAudioCodec(string $audioCodec): self */ public function withBitRate(int $bitRate): self { - $obj = clone $this; - $obj['bitRate'] = $bitRate; + $self = clone $this; + $self['bitRate'] = $bitRate; - return $obj; + return $self; } /** @@ -377,10 +377,10 @@ public function withBitRate(int $bitRate): self */ public function withCustomCoordinates(?string $customCoordinates): self { - $obj = clone $this; - $obj['customCoordinates'] = $customCoordinates; + $self = clone $this; + $self['customCoordinates'] = $customCoordinates; - return $obj; + return $self; } /** @@ -390,10 +390,10 @@ public function withCustomCoordinates(?string $customCoordinates): self */ public function withCustomMetadata(array $customMetadata): self { - $obj = clone $this; - $obj['customMetadata'] = $customMetadata; + $self = clone $this; + $self['customMetadata'] = $customMetadata; - return $obj; + return $self; } /** @@ -401,10 +401,10 @@ public function withCustomMetadata(array $customMetadata): self */ public function withDescription(string $description): self { - $obj = clone $this; - $obj['description'] = $description; + $self = clone $this; + $self['description'] = $description; - return $obj; + return $self; } /** @@ -412,10 +412,10 @@ public function withDescription(string $description): self */ public function withDuration(int $duration): self { - $obj = clone $this; - $obj['duration'] = $duration; + $self = clone $this; + $self['duration'] = $duration; - return $obj; + return $self; } /** @@ -425,10 +425,10 @@ public function withDuration(int $duration): self */ public function withEmbeddedMetadata(array $embeddedMetadata): self { - $obj = clone $this; - $obj['embeddedMetadata'] = $embeddedMetadata; + $self = clone $this; + $self['embeddedMetadata'] = $embeddedMetadata; - return $obj; + return $self; } /** @@ -450,10 +450,10 @@ public function withEmbeddedMetadata(array $embeddedMetadata): self public function withExtensionStatus( ExtensionStatus|array $extensionStatus ): self { - $obj = clone $this; - $obj['extensionStatus'] = $extensionStatus; + $self = clone $this; + $self['extensionStatus'] = $extensionStatus; - return $obj; + return $self; } /** @@ -461,10 +461,10 @@ public function withExtensionStatus( */ public function withFileID(string $fileID): self { - $obj = clone $this; - $obj['fileID'] = $fileID; + $self = clone $this; + $self['fileID'] = $fileID; - return $obj; + return $self; } /** @@ -472,10 +472,10 @@ public function withFileID(string $fileID): self */ public function withFilePath(string $filePath): self { - $obj = clone $this; - $obj['filePath'] = $filePath; + $self = clone $this; + $self['filePath'] = $filePath; - return $obj; + return $self; } /** @@ -483,10 +483,10 @@ public function withFilePath(string $filePath): self */ public function withFileType(string $fileType): self { - $obj = clone $this; - $obj['fileType'] = $fileType; + $self = clone $this; + $self['fileType'] = $fileType; - return $obj; + return $self; } /** @@ -494,10 +494,10 @@ public function withFileType(string $fileType): self */ public function withHeight(float $height): self { - $obj = clone $this; - $obj['height'] = $height; + $self = clone $this; + $self['height'] = $height; - return $obj; + return $self; } /** @@ -505,10 +505,10 @@ public function withHeight(float $height): self */ public function withIsPrivateFile(bool $isPrivateFile): self { - $obj = clone $this; - $obj['isPrivateFile'] = $isPrivateFile; + $self = clone $this; + $self['isPrivateFile'] = $isPrivateFile; - return $obj; + return $self; } /** @@ -516,10 +516,10 @@ public function withIsPrivateFile(bool $isPrivateFile): self */ public function withIsPublished(bool $isPublished): self { - $obj = clone $this; - $obj['isPublished'] = $isPublished; + $self = clone $this; + $self['isPublished'] = $isPublished; - return $obj; + return $self; } /** @@ -544,10 +544,10 @@ public function withIsPublished(bool $isPublished): self */ public function withMetadata(Metadata|array $metadata): self { - $obj = clone $this; - $obj['metadata'] = $metadata; + $self = clone $this; + $self['metadata'] = $metadata; - return $obj; + return $self; } /** @@ -555,10 +555,10 @@ public function withMetadata(Metadata|array $metadata): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -583,10 +583,10 @@ public function withName(string $name): self */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { - $obj = clone $this; - $obj['selectedFieldsSchema'] = $selectedFieldsSchema; + $self = clone $this; + $self['selectedFieldsSchema'] = $selectedFieldsSchema; - return $obj; + return $self; } /** @@ -594,10 +594,10 @@ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self */ public function withSize(float $size): self { - $obj = clone $this; - $obj['size'] = $size; + $self = clone $this; + $self['size'] = $size; - return $obj; + return $self; } /** @@ -607,10 +607,10 @@ public function withSize(float $size): self */ public function withTags(?array $tags): self { - $obj = clone $this; - $obj['tags'] = $tags; + $self = clone $this; + $self['tags'] = $tags; - return $obj; + return $self; } /** @@ -618,10 +618,10 @@ public function withTags(?array $tags): self */ public function withThumbnailURL(string $thumbnailURL): self { - $obj = clone $this; - $obj['thumbnailURL'] = $thumbnailURL; + $self = clone $this; + $self['thumbnailURL'] = $thumbnailURL; - return $obj; + return $self; } /** @@ -629,10 +629,10 @@ public function withThumbnailURL(string $thumbnailURL): self */ public function withURL(string $url): self { - $obj = clone $this; - $obj['url'] = $url; + $self = clone $this; + $self['url'] = $url; - return $obj; + return $self; } /** @@ -642,10 +642,10 @@ public function withURL(string $url): self */ public function withVersionInfo(VersionInfo|array $versionInfo): self { - $obj = clone $this; - $obj['versionInfo'] = $versionInfo; + $self = clone $this; + $self['versionInfo'] = $versionInfo; - return $obj; + return $self; } /** @@ -653,10 +653,10 @@ public function withVersionInfo(VersionInfo|array $versionInfo): self */ public function withVideoCodec(string $videoCodec): self { - $obj = clone $this; - $obj['videoCodec'] = $videoCodec; + $self = clone $this; + $self['videoCodec'] = $videoCodec; - return $obj; + return $self; } /** @@ -664,9 +664,9 @@ public function withVideoCodec(string $videoCodec): self */ public function withWidth(float $width): self { - $obj = clone $this; - $obj['width'] = $width; + $self = clone $this; + $self['width'] = $width; - return $obj; + return $self; } } diff --git a/src/Beta/V2/Files/FileUploadResponse/AITag.php b/src/Beta/V2/Files/FileUploadResponse/AITag.php index 3be8dd9f..f5ff05b8 100644 --- a/src/Beta/V2/Files/FileUploadResponse/AITag.php +++ b/src/Beta/V2/Files/FileUploadResponse/AITag.php @@ -51,13 +51,13 @@ public static function with( ?string $name = null, ?string $source = null ): self { - $obj = new self; + $self = new self; - null !== $confidence && $obj['confidence'] = $confidence; - null !== $name && $obj['name'] = $name; - null !== $source && $obj['source'] = $source; + null !== $confidence && $self['confidence'] = $confidence; + null !== $name && $self['name'] = $name; + null !== $source && $self['source'] = $source; - return $obj; + return $self; } /** @@ -65,10 +65,10 @@ public static function with( */ public function withConfidence(float $confidence): self { - $obj = clone $this; - $obj['confidence'] = $confidence; + $self = clone $this; + $self['confidence'] = $confidence; - return $obj; + return $self; } /** @@ -76,10 +76,10 @@ public function withConfidence(float $confidence): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -87,9 +87,9 @@ public function withName(string $name): self */ public function withSource(string $source): self { - $obj = clone $this; - $obj['source'] = $source; + $self = clone $this; + $self['source'] = $source; - return $obj; + return $self; } } diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php index 6706d157..bacaf4b7 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php @@ -70,14 +70,14 @@ public static function with( GoogleAutoTagging|string|null $googleAutoTagging = null, RemoveBg|string|null $removeBg = null, ): self { - $obj = new self; + $self = new self; - null !== $aiAutoDescription && $obj['aiAutoDescription'] = $aiAutoDescription; - null !== $awsAutoTagging && $obj['awsAutoTagging'] = $awsAutoTagging; - null !== $googleAutoTagging && $obj['googleAutoTagging'] = $googleAutoTagging; - null !== $removeBg && $obj['removeBg'] = $removeBg; + null !== $aiAutoDescription && $self['aiAutoDescription'] = $aiAutoDescription; + null !== $awsAutoTagging && $self['awsAutoTagging'] = $awsAutoTagging; + null !== $googleAutoTagging && $self['googleAutoTagging'] = $googleAutoTagging; + null !== $removeBg && $self['removeBg'] = $removeBg; - return $obj; + return $self; } /** @@ -86,10 +86,10 @@ public static function with( public function withAIAutoDescription( AIAutoDescription|string $aiAutoDescription ): self { - $obj = clone $this; - $obj['aiAutoDescription'] = $aiAutoDescription; + $self = clone $this; + $self['aiAutoDescription'] = $aiAutoDescription; - return $obj; + return $self; } /** @@ -98,10 +98,10 @@ public function withAIAutoDescription( public function withAwsAutoTagging( AwsAutoTagging|string $awsAutoTagging ): self { - $obj = clone $this; - $obj['awsAutoTagging'] = $awsAutoTagging; + $self = clone $this; + $self['awsAutoTagging'] = $awsAutoTagging; - return $obj; + return $self; } /** @@ -110,10 +110,10 @@ public function withAwsAutoTagging( public function withGoogleAutoTagging( GoogleAutoTagging|string $googleAutoTagging ): self { - $obj = clone $this; - $obj['googleAutoTagging'] = $googleAutoTagging; + $self = clone $this; + $self['googleAutoTagging'] = $googleAutoTagging; - return $obj; + return $self; } /** @@ -121,9 +121,9 @@ public function withGoogleAutoTagging( */ public function withRemoveBg(RemoveBg|string $removeBg): self { - $obj = clone $this; - $obj['removeBg'] = $removeBg; + $self = clone $this; + $self['removeBg'] = $removeBg; - return $obj; + return $self; } } diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php index a0828bdc..04788c71 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php @@ -137,21 +137,21 @@ public static function with( ?array $selectOptions = null, ?bool $selectOptionsTruncated = null, ): self { - $obj = new self; + $self = new self; - $obj['type'] = $type; + $self['type'] = $type; - null !== $defaultValue && $obj['defaultValue'] = $defaultValue; - null !== $isValueRequired && $obj['isValueRequired'] = $isValueRequired; - null !== $maxLength && $obj['maxLength'] = $maxLength; - null !== $maxValue && $obj['maxValue'] = $maxValue; - null !== $minLength && $obj['minLength'] = $minLength; - null !== $minValue && $obj['minValue'] = $minValue; - null !== $readOnly && $obj['readOnly'] = $readOnly; - null !== $selectOptions && $obj['selectOptions'] = $selectOptions; - null !== $selectOptionsTruncated && $obj['selectOptionsTruncated'] = $selectOptionsTruncated; + null !== $defaultValue && $self['defaultValue'] = $defaultValue; + null !== $isValueRequired && $self['isValueRequired'] = $isValueRequired; + null !== $maxLength && $self['maxLength'] = $maxLength; + null !== $maxValue && $self['maxValue'] = $maxValue; + null !== $minLength && $self['minLength'] = $minLength; + null !== $minValue && $self['minValue'] = $minValue; + null !== $readOnly && $self['readOnly'] = $readOnly; + null !== $selectOptions && $self['selectOptions'] = $selectOptions; + null !== $selectOptionsTruncated && $self['selectOptionsTruncated'] = $selectOptionsTruncated; - return $obj; + return $self; } /** @@ -161,10 +161,10 @@ public static function with( */ public function withType(Type|string $type): self { - $obj = clone $this; - $obj['type'] = $type; + $self = clone $this; + $self['type'] = $type; - return $obj; + return $self; } /** @@ -175,10 +175,10 @@ public function withType(Type|string $type): self public function withDefaultValue( string|float|bool|array $defaultValue ): self { - $obj = clone $this; - $obj['defaultValue'] = $defaultValue; + $self = clone $this; + $self['defaultValue'] = $defaultValue; - return $obj; + return $self; } /** @@ -186,10 +186,10 @@ public function withDefaultValue( */ public function withIsValueRequired(bool $isValueRequired): self { - $obj = clone $this; - $obj['isValueRequired'] = $isValueRequired; + $self = clone $this; + $self['isValueRequired'] = $isValueRequired; - return $obj; + return $self; } /** @@ -197,10 +197,10 @@ public function withIsValueRequired(bool $isValueRequired): self */ public function withMaxLength(float $maxLength): self { - $obj = clone $this; - $obj['maxLength'] = $maxLength; + $self = clone $this; + $self['maxLength'] = $maxLength; - return $obj; + return $self; } /** @@ -208,10 +208,10 @@ public function withMaxLength(float $maxLength): self */ public function withMaxValue(string|float $maxValue): self { - $obj = clone $this; - $obj['maxValue'] = $maxValue; + $self = clone $this; + $self['maxValue'] = $maxValue; - return $obj; + return $self; } /** @@ -219,10 +219,10 @@ public function withMaxValue(string|float $maxValue): self */ public function withMinLength(float $minLength): self { - $obj = clone $this; - $obj['minLength'] = $minLength; + $self = clone $this; + $self['minLength'] = $minLength; - return $obj; + return $self; } /** @@ -230,10 +230,10 @@ public function withMinLength(float $minLength): self */ public function withMinValue(string|float $minValue): self { - $obj = clone $this; - $obj['minValue'] = $minValue; + $self = clone $this; + $self['minValue'] = $minValue; - return $obj; + return $self; } /** @@ -241,10 +241,10 @@ public function withMinValue(string|float $minValue): self */ public function withReadOnly(bool $readOnly): self { - $obj = clone $this; - $obj['readOnly'] = $readOnly; + $self = clone $this; + $self['readOnly'] = $readOnly; - return $obj; + return $self; } /** @@ -254,10 +254,10 @@ public function withReadOnly(bool $readOnly): self */ public function withSelectOptions(array $selectOptions): self { - $obj = clone $this; - $obj['selectOptions'] = $selectOptions; + $self = clone $this; + $self['selectOptions'] = $selectOptions; - return $obj; + return $self; } /** @@ -266,9 +266,9 @@ public function withSelectOptions(array $selectOptions): self public function withSelectOptionsTruncated( bool $selectOptionsTruncated ): self { - $obj = clone $this; - $obj['selectOptionsTruncated'] = $selectOptionsTruncated; + $self = clone $this; + $self['selectOptionsTruncated'] = $selectOptionsTruncated; - return $obj; + return $self; } } diff --git a/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php b/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php index 1b5136ac..00e786ff 100644 --- a/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php +++ b/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php @@ -42,12 +42,12 @@ public function __construct() */ public static function with(?string $id = null, ?string $name = null): self { - $obj = new self; + $self = new self; - null !== $id && $obj['id'] = $id; - null !== $name && $obj['name'] = $name; + null !== $id && $self['id'] = $id; + null !== $name && $self['name'] = $name; - return $obj; + return $self; } /** @@ -55,10 +55,10 @@ public static function with(?string $id = null, ?string $name = null): self */ public function withID(string $id): self { - $obj = clone $this; - $obj['id'] = $id; + $self = clone $this; + $self['id'] = $id; - return $obj; + return $self; } /** @@ -66,9 +66,9 @@ public function withID(string $id): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } } diff --git a/src/Cache/Invalidation/InvalidationCreateParams.php b/src/Cache/Invalidation/InvalidationCreateParams.php index e62844bc..e65b2376 100644 --- a/src/Cache/Invalidation/InvalidationCreateParams.php +++ b/src/Cache/Invalidation/InvalidationCreateParams.php @@ -54,11 +54,11 @@ public function __construct() */ public static function with(string $url): self { - $obj = new self; + $self = new self; - $obj['url'] = $url; + $self['url'] = $url; - return $obj; + return $self; } /** @@ -66,9 +66,9 @@ public static function with(string $url): self */ public function withURL(string $url): self { - $obj = clone $this; - $obj['url'] = $url; + $self = clone $this; + $self['url'] = $url; - return $obj; + return $self; } } diff --git a/src/Cache/Invalidation/InvalidationGetResponse.php b/src/Cache/Invalidation/InvalidationGetResponse.php index 54ed036e..e68359b4 100644 --- a/src/Cache/Invalidation/InvalidationGetResponse.php +++ b/src/Cache/Invalidation/InvalidationGetResponse.php @@ -41,11 +41,11 @@ public function __construct() */ public static function with(Status|string|null $status = null): self { - $obj = new self; + $self = new self; - null !== $status && $obj['status'] = $status; + null !== $status && $self['status'] = $status; - return $obj; + return $self; } /** @@ -55,9 +55,9 @@ public static function with(Status|string|null $status = null): self */ public function withStatus(Status|string $status): self { - $obj = clone $this; - $obj['status'] = $status; + $self = clone $this; + $self['status'] = $status; - return $obj; + return $self; } } diff --git a/src/Cache/Invalidation/InvalidationNewResponse.php b/src/Cache/Invalidation/InvalidationNewResponse.php index d95c7b32..55ad149f 100644 --- a/src/Cache/Invalidation/InvalidationNewResponse.php +++ b/src/Cache/Invalidation/InvalidationNewResponse.php @@ -34,11 +34,11 @@ public function __construct() */ public static function with(?string $requestID = null): self { - $obj = new self; + $self = new self; - null !== $requestID && $obj['requestID'] = $requestID; + null !== $requestID && $self['requestID'] = $requestID; - return $obj; + return $self; } /** @@ -46,9 +46,9 @@ public static function with(?string $requestID = null): self */ public function withRequestID(string $requestID): self { - $obj = clone $this; - $obj['requestID'] = $requestID; + $self = clone $this; + $self['requestID'] = $requestID; - return $obj; + return $self; } } diff --git a/src/CustomMetadataFields/CustomMetadataField.php b/src/CustomMetadataFields/CustomMetadataField.php index b58cde3c..09b77980 100644 --- a/src/CustomMetadataFields/CustomMetadataField.php +++ b/src/CustomMetadataFields/CustomMetadataField.php @@ -91,14 +91,14 @@ public static function with( string $name, Schema|array $schema ): self { - $obj = new self; + $self = new self; - $obj['id'] = $id; - $obj['label'] = $label; - $obj['name'] = $name; - $obj['schema'] = $schema; + $self['id'] = $id; + $self['label'] = $label; + $self['name'] = $name; + $self['schema'] = $schema; - return $obj; + return $self; } /** @@ -106,10 +106,10 @@ public static function with( */ public function withID(string $id): self { - $obj = clone $this; - $obj['id'] = $id; + $self = clone $this; + $self['id'] = $id; - return $obj; + return $self; } /** @@ -117,10 +117,10 @@ public function withID(string $id): self */ public function withLabel(string $label): self { - $obj = clone $this; - $obj['label'] = $label; + $self = clone $this; + $self['label'] = $label; - return $obj; + return $self; } /** @@ -128,10 +128,10 @@ public function withLabel(string $label): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -150,9 +150,9 @@ public function withName(string $name): self */ public function withSchema(Schema|array $schema): self { - $obj = clone $this; - $obj['schema'] = $schema; + $self = clone $this; + $self['schema'] = $schema; - return $obj; + return $self; } } diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema.php b/src/CustomMetadataFields/CustomMetadataField/Schema.php index 598dbe62..11934c1b 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema.php @@ -123,19 +123,19 @@ public static function with( string|float|null $minValue = null, ?array $selectOptions = null, ): self { - $obj = new self; + $self = new self; - $obj['type'] = $type; + $self['type'] = $type; - null !== $defaultValue && $obj['defaultValue'] = $defaultValue; - null !== $isValueRequired && $obj['isValueRequired'] = $isValueRequired; - null !== $maxLength && $obj['maxLength'] = $maxLength; - null !== $maxValue && $obj['maxValue'] = $maxValue; - null !== $minLength && $obj['minLength'] = $minLength; - null !== $minValue && $obj['minValue'] = $minValue; - null !== $selectOptions && $obj['selectOptions'] = $selectOptions; + null !== $defaultValue && $self['defaultValue'] = $defaultValue; + null !== $isValueRequired && $self['isValueRequired'] = $isValueRequired; + null !== $maxLength && $self['maxLength'] = $maxLength; + null !== $maxValue && $self['maxValue'] = $maxValue; + null !== $minLength && $self['minLength'] = $minLength; + null !== $minValue && $self['minValue'] = $minValue; + null !== $selectOptions && $self['selectOptions'] = $selectOptions; - return $obj; + return $self; } /** @@ -145,10 +145,10 @@ public static function with( */ public function withType(Type|string $type): self { - $obj = clone $this; - $obj['type'] = $type; + $self = clone $this; + $self['type'] = $type; - return $obj; + return $self; } /** @@ -159,10 +159,10 @@ public function withType(Type|string $type): self public function withDefaultValue( string|float|bool|array $defaultValue ): self { - $obj = clone $this; - $obj['defaultValue'] = $defaultValue; + $self = clone $this; + $self['defaultValue'] = $defaultValue; - return $obj; + return $self; } /** @@ -170,10 +170,10 @@ public function withDefaultValue( */ public function withIsValueRequired(bool $isValueRequired): self { - $obj = clone $this; - $obj['isValueRequired'] = $isValueRequired; + $self = clone $this; + $self['isValueRequired'] = $isValueRequired; - return $obj; + return $self; } /** @@ -181,10 +181,10 @@ public function withIsValueRequired(bool $isValueRequired): self */ public function withMaxLength(float $maxLength): self { - $obj = clone $this; - $obj['maxLength'] = $maxLength; + $self = clone $this; + $self['maxLength'] = $maxLength; - return $obj; + return $self; } /** @@ -192,10 +192,10 @@ public function withMaxLength(float $maxLength): self */ public function withMaxValue(string|float $maxValue): self { - $obj = clone $this; - $obj['maxValue'] = $maxValue; + $self = clone $this; + $self['maxValue'] = $maxValue; - return $obj; + return $self; } /** @@ -203,10 +203,10 @@ public function withMaxValue(string|float $maxValue): self */ public function withMinLength(float $minLength): self { - $obj = clone $this; - $obj['minLength'] = $minLength; + $self = clone $this; + $self['minLength'] = $minLength; - return $obj; + return $self; } /** @@ -214,10 +214,10 @@ public function withMinLength(float $minLength): self */ public function withMinValue(string|float $minValue): self { - $obj = clone $this; - $obj['minValue'] = $minValue; + $self = clone $this; + $self['minValue'] = $minValue; - return $obj; + return $self; } /** @@ -227,9 +227,9 @@ public function withMinValue(string|float $minValue): self */ public function withSelectOptions(array $selectOptions): self { - $obj = clone $this; - $obj['selectOptions'] = $selectOptions; + $self = clone $this; + $self['selectOptions'] = $selectOptions; - return $obj; + return $self; } } diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php index aade0326..a0fa66d4 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php @@ -95,13 +95,13 @@ public static function with( string $name, Schema|array $schema ): self { - $obj = new self; + $self = new self; - $obj['label'] = $label; - $obj['name'] = $name; - $obj['schema'] = $schema; + $self['label'] = $label; + $self['name'] = $name; + $self['schema'] = $schema; - return $obj; + return $self; } /** @@ -109,10 +109,10 @@ public static function with( */ public function withLabel(string $label): self { - $obj = clone $this; - $obj['label'] = $label; + $self = clone $this; + $self['label'] = $label; - return $obj; + return $self; } /** @@ -120,10 +120,10 @@ public function withLabel(string $label): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -140,9 +140,9 @@ public function withName(string $name): self */ public function withSchema(Schema|array $schema): self { - $obj = clone $this; - $obj['schema'] = $schema; + $self = clone $this; + $self['schema'] = $schema; - return $obj; + return $self; } } diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php index 5ebfada2..971a3d0e 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php @@ -121,19 +121,19 @@ public static function with( string|float|null $minValue = null, ?array $selectOptions = null, ): self { - $obj = new self; + $self = new self; - $obj['type'] = $type; + $self['type'] = $type; - null !== $defaultValue && $obj['defaultValue'] = $defaultValue; - null !== $isValueRequired && $obj['isValueRequired'] = $isValueRequired; - null !== $maxLength && $obj['maxLength'] = $maxLength; - null !== $maxValue && $obj['maxValue'] = $maxValue; - null !== $minLength && $obj['minLength'] = $minLength; - null !== $minValue && $obj['minValue'] = $minValue; - null !== $selectOptions && $obj['selectOptions'] = $selectOptions; + null !== $defaultValue && $self['defaultValue'] = $defaultValue; + null !== $isValueRequired && $self['isValueRequired'] = $isValueRequired; + null !== $maxLength && $self['maxLength'] = $maxLength; + null !== $maxValue && $self['maxValue'] = $maxValue; + null !== $minLength && $self['minLength'] = $minLength; + null !== $minValue && $self['minValue'] = $minValue; + null !== $selectOptions && $self['selectOptions'] = $selectOptions; - return $obj; + return $self; } /** @@ -143,10 +143,10 @@ public static function with( */ public function withType(Type|string $type): self { - $obj = clone $this; - $obj['type'] = $type; + $self = clone $this; + $self['type'] = $type; - return $obj; + return $self; } /** @@ -157,10 +157,10 @@ public function withType(Type|string $type): self public function withDefaultValue( string|float|bool|array $defaultValue ): self { - $obj = clone $this; - $obj['defaultValue'] = $defaultValue; + $self = clone $this; + $self['defaultValue'] = $defaultValue; - return $obj; + return $self; } /** @@ -168,10 +168,10 @@ public function withDefaultValue( */ public function withIsValueRequired(bool $isValueRequired): self { - $obj = clone $this; - $obj['isValueRequired'] = $isValueRequired; + $self = clone $this; + $self['isValueRequired'] = $isValueRequired; - return $obj; + return $self; } /** @@ -179,10 +179,10 @@ public function withIsValueRequired(bool $isValueRequired): self */ public function withMaxLength(float $maxLength): self { - $obj = clone $this; - $obj['maxLength'] = $maxLength; + $self = clone $this; + $self['maxLength'] = $maxLength; - return $obj; + return $self; } /** @@ -190,10 +190,10 @@ public function withMaxLength(float $maxLength): self */ public function withMaxValue(string|float $maxValue): self { - $obj = clone $this; - $obj['maxValue'] = $maxValue; + $self = clone $this; + $self['maxValue'] = $maxValue; - return $obj; + return $self; } /** @@ -201,10 +201,10 @@ public function withMaxValue(string|float $maxValue): self */ public function withMinLength(float $minLength): self { - $obj = clone $this; - $obj['minLength'] = $minLength; + $self = clone $this; + $self['minLength'] = $minLength; - return $obj; + return $self; } /** @@ -212,10 +212,10 @@ public function withMinLength(float $minLength): self */ public function withMinValue(string|float $minValue): self { - $obj = clone $this; - $obj['minValue'] = $minValue; + $self = clone $this; + $self['minValue'] = $minValue; - return $obj; + return $self; } /** @@ -225,9 +225,9 @@ public function withMinValue(string|float $minValue): self */ public function withSelectOptions(array $selectOptions): self { - $obj = clone $this; - $obj['selectOptions'] = $selectOptions; + $self = clone $this; + $self['selectOptions'] = $selectOptions; - return $obj; + return $self; } } diff --git a/src/CustomMetadataFields/CustomMetadataFieldListParams.php b/src/CustomMetadataFields/CustomMetadataFieldListParams.php index 2748ca6a..8e1fbd99 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldListParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldListParams.php @@ -52,12 +52,12 @@ public static function with( ?string $folderPath = null, ?bool $includeDeleted = null ): self { - $obj = new self; + $self = new self; - null !== $folderPath && $obj['folderPath'] = $folderPath; - null !== $includeDeleted && $obj['includeDeleted'] = $includeDeleted; + null !== $folderPath && $self['folderPath'] = $folderPath; + null !== $includeDeleted && $self['includeDeleted'] = $includeDeleted; - return $obj; + return $self; } /** @@ -65,10 +65,10 @@ public static function with( */ public function withFolderPath(string $folderPath): self { - $obj = clone $this; - $obj['folderPath'] = $folderPath; + $self = clone $this; + $self['folderPath'] = $folderPath; - return $obj; + return $self; } /** @@ -76,9 +76,9 @@ public function withFolderPath(string $folderPath): self */ public function withIncludeDeleted(bool $includeDeleted): self { - $obj = clone $this; - $obj['includeDeleted'] = $includeDeleted; + $self = clone $this; + $self['includeDeleted'] = $includeDeleted; - return $obj; + return $self; } } diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php index 5d1e97fb..058c50c4 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php @@ -70,12 +70,12 @@ public static function with( ?string $label = null, Schema|array|null $schema = null ): self { - $obj = new self; + $self = new self; - null !== $label && $obj['label'] = $label; - null !== $schema && $obj['schema'] = $schema; + null !== $label && $self['label'] = $label; + null !== $schema && $self['schema'] = $schema; - return $obj; + return $self; } /** @@ -83,10 +83,10 @@ public static function with( */ public function withLabel(string $label): self { - $obj = clone $this; - $obj['label'] = $label; + $self = clone $this; + $self['label'] = $label; - return $obj; + return $self; } /** @@ -104,9 +104,9 @@ public function withLabel(string $label): self */ public function withSchema(Schema|array $schema): self { - $obj = clone $this; - $obj['schema'] = $schema; + $self = clone $this; + $self['schema'] = $schema; - return $obj; + return $self; } } diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php index 654b914b..17de0182 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php @@ -96,17 +96,17 @@ public static function with( string|float|null $minValue = null, ?array $selectOptions = null, ): self { - $obj = new self; + $self = new self; - null !== $defaultValue && $obj['defaultValue'] = $defaultValue; - null !== $isValueRequired && $obj['isValueRequired'] = $isValueRequired; - null !== $maxLength && $obj['maxLength'] = $maxLength; - null !== $maxValue && $obj['maxValue'] = $maxValue; - null !== $minLength && $obj['minLength'] = $minLength; - null !== $minValue && $obj['minValue'] = $minValue; - null !== $selectOptions && $obj['selectOptions'] = $selectOptions; + null !== $defaultValue && $self['defaultValue'] = $defaultValue; + null !== $isValueRequired && $self['isValueRequired'] = $isValueRequired; + null !== $maxLength && $self['maxLength'] = $maxLength; + null !== $maxValue && $self['maxValue'] = $maxValue; + null !== $minLength && $self['minLength'] = $minLength; + null !== $minValue && $self['minValue'] = $minValue; + null !== $selectOptions && $self['selectOptions'] = $selectOptions; - return $obj; + return $self; } /** @@ -117,10 +117,10 @@ public static function with( public function withDefaultValue( string|float|bool|array $defaultValue ): self { - $obj = clone $this; - $obj['defaultValue'] = $defaultValue; + $self = clone $this; + $self['defaultValue'] = $defaultValue; - return $obj; + return $self; } /** @@ -128,10 +128,10 @@ public function withDefaultValue( */ public function withIsValueRequired(bool $isValueRequired): self { - $obj = clone $this; - $obj['isValueRequired'] = $isValueRequired; + $self = clone $this; + $self['isValueRequired'] = $isValueRequired; - return $obj; + return $self; } /** @@ -139,10 +139,10 @@ public function withIsValueRequired(bool $isValueRequired): self */ public function withMaxLength(float $maxLength): self { - $obj = clone $this; - $obj['maxLength'] = $maxLength; + $self = clone $this; + $self['maxLength'] = $maxLength; - return $obj; + return $self; } /** @@ -150,10 +150,10 @@ public function withMaxLength(float $maxLength): self */ public function withMaxValue(string|float $maxValue): self { - $obj = clone $this; - $obj['maxValue'] = $maxValue; + $self = clone $this; + $self['maxValue'] = $maxValue; - return $obj; + return $self; } /** @@ -161,10 +161,10 @@ public function withMaxValue(string|float $maxValue): self */ public function withMinLength(float $minLength): self { - $obj = clone $this; - $obj['minLength'] = $minLength; + $self = clone $this; + $self['minLength'] = $minLength; - return $obj; + return $self; } /** @@ -172,10 +172,10 @@ public function withMinLength(float $minLength): self */ public function withMinValue(string|float $minValue): self { - $obj = clone $this; - $obj['minValue'] = $minValue; + $self = clone $this; + $self['minValue'] = $minValue; - return $obj; + return $self; } /** @@ -185,9 +185,9 @@ public function withMinValue(string|float $minValue): self */ public function withSelectOptions(array $selectOptions): self { - $obj = clone $this; - $obj['selectOptions'] = $selectOptions; + $self = clone $this; + $self['selectOptions'] = $selectOptions; - return $obj; + return $self; } } diff --git a/src/ExtensionItem/AutoTaggingExtension.php b/src/ExtensionItem/AutoTaggingExtension.php index 8ed29b2d..f057cb4f 100644 --- a/src/ExtensionItem/AutoTaggingExtension.php +++ b/src/ExtensionItem/AutoTaggingExtension.php @@ -73,13 +73,13 @@ public static function with( int $minConfidence, Name|string $name ): self { - $obj = new self; + $self = new self; - $obj['maxTags'] = $maxTags; - $obj['minConfidence'] = $minConfidence; - $obj['name'] = $name; + $self['maxTags'] = $maxTags; + $self['minConfidence'] = $minConfidence; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -87,10 +87,10 @@ public static function with( */ public function withMaxTags(int $maxTags): self { - $obj = clone $this; - $obj['maxTags'] = $maxTags; + $self = clone $this; + $self['maxTags'] = $maxTags; - return $obj; + return $self; } /** @@ -98,10 +98,10 @@ public function withMaxTags(int $maxTags): self */ public function withMinConfidence(int $minConfidence): self { - $obj = clone $this; - $obj['minConfidence'] = $minConfidence; + $self = clone $this; + $self['minConfidence'] = $minConfidence; - return $obj; + return $self; } /** @@ -111,9 +111,9 @@ public function withMinConfidence(int $minConfidence): self */ public function withName(Name|string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } } diff --git a/src/ExtensionItem/RemoveBg.php b/src/ExtensionItem/RemoveBg.php index c7b8707f..9eec3ffe 100644 --- a/src/ExtensionItem/RemoveBg.php +++ b/src/ExtensionItem/RemoveBg.php @@ -48,11 +48,11 @@ public function __construct() */ public static function with(Options|array|null $options = null): self { - $obj = new self; + $self = new self; - null !== $options && $obj['options'] = $options; + null !== $options && $self['options'] = $options; - return $obj; + return $self; } /** @@ -65,9 +65,9 @@ public static function with(Options|array|null $options = null): self */ public function withOptions(Options|array $options): self { - $obj = clone $this; - $obj['options'] = $options; + $self = clone $this; + $self['options'] = $options; - return $obj; + return $self; } } diff --git a/src/ExtensionItem/RemoveBg/Options.php b/src/ExtensionItem/RemoveBg/Options.php index 520e637f..5a1df346 100644 --- a/src/ExtensionItem/RemoveBg/Options.php +++ b/src/ExtensionItem/RemoveBg/Options.php @@ -61,14 +61,14 @@ public static function with( ?string $bgImageURL = null, ?bool $semitransparency = null, ): self { - $obj = new self; + $self = new self; - null !== $addShadow && $obj['addShadow'] = $addShadow; - null !== $bgColor && $obj['bgColor'] = $bgColor; - null !== $bgImageURL && $obj['bgImageURL'] = $bgImageURL; - null !== $semitransparency && $obj['semitransparency'] = $semitransparency; + null !== $addShadow && $self['addShadow'] = $addShadow; + null !== $bgColor && $self['bgColor'] = $bgColor; + null !== $bgImageURL && $self['bgImageURL'] = $bgImageURL; + null !== $semitransparency && $self['semitransparency'] = $semitransparency; - return $obj; + return $self; } /** @@ -76,10 +76,10 @@ public static function with( */ public function withAddShadow(bool $addShadow): self { - $obj = clone $this; - $obj['addShadow'] = $addShadow; + $self = clone $this; + $self['addShadow'] = $addShadow; - return $obj; + return $self; } /** @@ -87,10 +87,10 @@ public function withAddShadow(bool $addShadow): self */ public function withBgColor(string $bgColor): self { - $obj = clone $this; - $obj['bgColor'] = $bgColor; + $self = clone $this; + $self['bgColor'] = $bgColor; - return $obj; + return $self; } /** @@ -98,10 +98,10 @@ public function withBgColor(string $bgColor): self */ public function withBgImageURL(string $bgImageURL): self { - $obj = clone $this; - $obj['bgImageURL'] = $bgImageURL; + $self = clone $this; + $self['bgImageURL'] = $bgImageURL; - return $obj; + return $self; } /** @@ -109,9 +109,9 @@ public function withBgImageURL(string $bgImageURL): self */ public function withSemitransparency(bool $semitransparency): self { - $obj = clone $this; - $obj['semitransparency'] = $semitransparency; + $self = clone $this; + $self['semitransparency'] = $semitransparency; - return $obj; + return $self; } } diff --git a/src/Files/Bulk/BulkAddTagsParams.php b/src/Files/Bulk/BulkAddTagsParams.php index 472be0f6..afb3a686 100644 --- a/src/Files/Bulk/BulkAddTagsParams.php +++ b/src/Files/Bulk/BulkAddTagsParams.php @@ -69,12 +69,12 @@ public function __construct() */ public static function with(array $fileIDs, array $tags): self { - $obj = new self; + $self = new self; - $obj['fileIDs'] = $fileIDs; - $obj['tags'] = $tags; + $self['fileIDs'] = $fileIDs; + $self['tags'] = $tags; - return $obj; + return $self; } /** @@ -84,10 +84,10 @@ public static function with(array $fileIDs, array $tags): self */ public function withFileIDs(array $fileIDs): self { - $obj = clone $this; - $obj['fileIDs'] = $fileIDs; + $self = clone $this; + $self['fileIDs'] = $fileIDs; - return $obj; + return $self; } /** @@ -97,9 +97,9 @@ public function withFileIDs(array $fileIDs): self */ public function withTags(array $tags): self { - $obj = clone $this; - $obj['tags'] = $tags; + $self = clone $this; + $self['tags'] = $tags; - return $obj; + return $self; } } diff --git a/src/Files/Bulk/BulkAddTagsResponse.php b/src/Files/Bulk/BulkAddTagsResponse.php index 9a1b478e..f9391c23 100644 --- a/src/Files/Bulk/BulkAddTagsResponse.php +++ b/src/Files/Bulk/BulkAddTagsResponse.php @@ -40,11 +40,11 @@ public function __construct() */ public static function with(?array $successfullyUpdatedFileIDs = null): self { - $obj = new self; + $self = new self; - null !== $successfullyUpdatedFileIDs && $obj['successfullyUpdatedFileIDs'] = $successfullyUpdatedFileIDs; + null !== $successfullyUpdatedFileIDs && $self['successfullyUpdatedFileIDs'] = $successfullyUpdatedFileIDs; - return $obj; + return $self; } /** @@ -55,9 +55,9 @@ public static function with(?array $successfullyUpdatedFileIDs = null): self public function withSuccessfullyUpdatedFileIDs( array $successfullyUpdatedFileIDs ): self { - $obj = clone $this; - $obj['successfullyUpdatedFileIDs'] = $successfullyUpdatedFileIDs; + $self = clone $this; + $self['successfullyUpdatedFileIDs'] = $successfullyUpdatedFileIDs; - return $obj; + return $self; } } diff --git a/src/Files/Bulk/BulkDeleteParams.php b/src/Files/Bulk/BulkDeleteParams.php index 4d4fc8c4..de31521e 100644 --- a/src/Files/Bulk/BulkDeleteParams.php +++ b/src/Files/Bulk/BulkDeleteParams.php @@ -62,11 +62,11 @@ public function __construct() */ public static function with(array $fileIDs): self { - $obj = new self; + $self = new self; - $obj['fileIDs'] = $fileIDs; + $self['fileIDs'] = $fileIDs; - return $obj; + return $self; } /** @@ -76,9 +76,9 @@ public static function with(array $fileIDs): self */ public function withFileIDs(array $fileIDs): self { - $obj = clone $this; - $obj['fileIDs'] = $fileIDs; + $self = clone $this; + $self['fileIDs'] = $fileIDs; - return $obj; + return $self; } } diff --git a/src/Files/Bulk/BulkDeleteResponse.php b/src/Files/Bulk/BulkDeleteResponse.php index c543fa95..cfc8be84 100644 --- a/src/Files/Bulk/BulkDeleteResponse.php +++ b/src/Files/Bulk/BulkDeleteResponse.php @@ -40,11 +40,11 @@ public function __construct() */ public static function with(?array $successfullyDeletedFileIDs = null): self { - $obj = new self; + $self = new self; - null !== $successfullyDeletedFileIDs && $obj['successfullyDeletedFileIDs'] = $successfullyDeletedFileIDs; + null !== $successfullyDeletedFileIDs && $self['successfullyDeletedFileIDs'] = $successfullyDeletedFileIDs; - return $obj; + return $self; } /** @@ -55,9 +55,9 @@ public static function with(?array $successfullyDeletedFileIDs = null): self public function withSuccessfullyDeletedFileIDs( array $successfullyDeletedFileIDs ): self { - $obj = clone $this; - $obj['successfullyDeletedFileIDs'] = $successfullyDeletedFileIDs; + $self = clone $this; + $self['successfullyDeletedFileIDs'] = $successfullyDeletedFileIDs; - return $obj; + return $self; } } diff --git a/src/Files/Bulk/BulkRemoveAITagsParams.php b/src/Files/Bulk/BulkRemoveAITagsParams.php index 5441eca6..312ad978 100644 --- a/src/Files/Bulk/BulkRemoveAITagsParams.php +++ b/src/Files/Bulk/BulkRemoveAITagsParams.php @@ -69,12 +69,12 @@ public function __construct() */ public static function with(array $aiTags, array $fileIDs): self { - $obj = new self; + $self = new self; - $obj['aiTags'] = $aiTags; - $obj['fileIDs'] = $fileIDs; + $self['aiTags'] = $aiTags; + $self['fileIDs'] = $fileIDs; - return $obj; + return $self; } /** @@ -84,10 +84,10 @@ public static function with(array $aiTags, array $fileIDs): self */ public function withAITags(array $aiTags): self { - $obj = clone $this; - $obj['aiTags'] = $aiTags; + $self = clone $this; + $self['aiTags'] = $aiTags; - return $obj; + return $self; } /** @@ -97,9 +97,9 @@ public function withAITags(array $aiTags): self */ public function withFileIDs(array $fileIDs): self { - $obj = clone $this; - $obj['fileIDs'] = $fileIDs; + $self = clone $this; + $self['fileIDs'] = $fileIDs; - return $obj; + return $self; } } diff --git a/src/Files/Bulk/BulkRemoveAITagsResponse.php b/src/Files/Bulk/BulkRemoveAITagsResponse.php index fc80d45b..ced66543 100644 --- a/src/Files/Bulk/BulkRemoveAITagsResponse.php +++ b/src/Files/Bulk/BulkRemoveAITagsResponse.php @@ -40,11 +40,11 @@ public function __construct() */ public static function with(?array $successfullyUpdatedFileIDs = null): self { - $obj = new self; + $self = new self; - null !== $successfullyUpdatedFileIDs && $obj['successfullyUpdatedFileIDs'] = $successfullyUpdatedFileIDs; + null !== $successfullyUpdatedFileIDs && $self['successfullyUpdatedFileIDs'] = $successfullyUpdatedFileIDs; - return $obj; + return $self; } /** @@ -55,9 +55,9 @@ public static function with(?array $successfullyUpdatedFileIDs = null): self public function withSuccessfullyUpdatedFileIDs( array $successfullyUpdatedFileIDs ): self { - $obj = clone $this; - $obj['successfullyUpdatedFileIDs'] = $successfullyUpdatedFileIDs; + $self = clone $this; + $self['successfullyUpdatedFileIDs'] = $successfullyUpdatedFileIDs; - return $obj; + return $self; } } diff --git a/src/Files/Bulk/BulkRemoveTagsParams.php b/src/Files/Bulk/BulkRemoveTagsParams.php index 0cc941df..3dcfcde9 100644 --- a/src/Files/Bulk/BulkRemoveTagsParams.php +++ b/src/Files/Bulk/BulkRemoveTagsParams.php @@ -69,12 +69,12 @@ public function __construct() */ public static function with(array $fileIDs, array $tags): self { - $obj = new self; + $self = new self; - $obj['fileIDs'] = $fileIDs; - $obj['tags'] = $tags; + $self['fileIDs'] = $fileIDs; + $self['tags'] = $tags; - return $obj; + return $self; } /** @@ -84,10 +84,10 @@ public static function with(array $fileIDs, array $tags): self */ public function withFileIDs(array $fileIDs): self { - $obj = clone $this; - $obj['fileIDs'] = $fileIDs; + $self = clone $this; + $self['fileIDs'] = $fileIDs; - return $obj; + return $self; } /** @@ -97,9 +97,9 @@ public function withFileIDs(array $fileIDs): self */ public function withTags(array $tags): self { - $obj = clone $this; - $obj['tags'] = $tags; + $self = clone $this; + $self['tags'] = $tags; - return $obj; + return $self; } } diff --git a/src/Files/Bulk/BulkRemoveTagsResponse.php b/src/Files/Bulk/BulkRemoveTagsResponse.php index 6722d771..97e3561f 100644 --- a/src/Files/Bulk/BulkRemoveTagsResponse.php +++ b/src/Files/Bulk/BulkRemoveTagsResponse.php @@ -40,11 +40,11 @@ public function __construct() */ public static function with(?array $successfullyUpdatedFileIDs = null): self { - $obj = new self; + $self = new self; - null !== $successfullyUpdatedFileIDs && $obj['successfullyUpdatedFileIDs'] = $successfullyUpdatedFileIDs; + null !== $successfullyUpdatedFileIDs && $self['successfullyUpdatedFileIDs'] = $successfullyUpdatedFileIDs; - return $obj; + return $self; } /** @@ -55,9 +55,9 @@ public static function with(?array $successfullyUpdatedFileIDs = null): self public function withSuccessfullyUpdatedFileIDs( array $successfullyUpdatedFileIDs ): self { - $obj = clone $this; - $obj['successfullyUpdatedFileIDs'] = $successfullyUpdatedFileIDs; + $self = clone $this; + $self['successfullyUpdatedFileIDs'] = $successfullyUpdatedFileIDs; - return $obj; + return $self; } } diff --git a/src/Files/File.php b/src/Files/File.php index f908867b..d5787b97 100644 --- a/src/Files/File.php +++ b/src/Files/File.php @@ -253,33 +253,33 @@ public static function with( VersionInfo|array|null $versionInfo = null, ?float $width = null, ): self { - $obj = new self; - - null !== $aiTags && $obj['aiTags'] = $aiTags; - null !== $createdAt && $obj['createdAt'] = $createdAt; - null !== $customCoordinates && $obj['customCoordinates'] = $customCoordinates; - null !== $customMetadata && $obj['customMetadata'] = $customMetadata; - null !== $description && $obj['description'] = $description; - null !== $fileID && $obj['fileID'] = $fileID; - null !== $filePath && $obj['filePath'] = $filePath; - null !== $fileType && $obj['fileType'] = $fileType; - null !== $hasAlpha && $obj['hasAlpha'] = $hasAlpha; - null !== $height && $obj['height'] = $height; - null !== $isPrivateFile && $obj['isPrivateFile'] = $isPrivateFile; - null !== $isPublished && $obj['isPublished'] = $isPublished; - null !== $mime && $obj['mime'] = $mime; - null !== $name && $obj['name'] = $name; - null !== $selectedFieldsSchema && $obj['selectedFieldsSchema'] = $selectedFieldsSchema; - null !== $size && $obj['size'] = $size; - null !== $tags && $obj['tags'] = $tags; - null !== $thumbnail && $obj['thumbnail'] = $thumbnail; - null !== $type && $obj['type'] = $type; - null !== $updatedAt && $obj['updatedAt'] = $updatedAt; - null !== $url && $obj['url'] = $url; - null !== $versionInfo && $obj['versionInfo'] = $versionInfo; - null !== $width && $obj['width'] = $width; - - return $obj; + $self = new self; + + null !== $aiTags && $self['aiTags'] = $aiTags; + null !== $createdAt && $self['createdAt'] = $createdAt; + null !== $customCoordinates && $self['customCoordinates'] = $customCoordinates; + null !== $customMetadata && $self['customMetadata'] = $customMetadata; + null !== $description && $self['description'] = $description; + null !== $fileID && $self['fileID'] = $fileID; + null !== $filePath && $self['filePath'] = $filePath; + null !== $fileType && $self['fileType'] = $fileType; + null !== $hasAlpha && $self['hasAlpha'] = $hasAlpha; + null !== $height && $self['height'] = $height; + null !== $isPrivateFile && $self['isPrivateFile'] = $isPrivateFile; + null !== $isPublished && $self['isPublished'] = $isPublished; + null !== $mime && $self['mime'] = $mime; + null !== $name && $self['name'] = $name; + null !== $selectedFieldsSchema && $self['selectedFieldsSchema'] = $selectedFieldsSchema; + null !== $size && $self['size'] = $size; + null !== $tags && $self['tags'] = $tags; + null !== $thumbnail && $self['thumbnail'] = $thumbnail; + null !== $type && $self['type'] = $type; + null !== $updatedAt && $self['updatedAt'] = $updatedAt; + null !== $url && $self['url'] = $url; + null !== $versionInfo && $self['versionInfo'] = $versionInfo; + null !== $width && $self['width'] = $width; + + return $self; } /** @@ -291,10 +291,10 @@ public static function with( */ public function withAITags(?array $aiTags): self { - $obj = clone $this; - $obj['aiTags'] = $aiTags; + $self = clone $this; + $self['aiTags'] = $aiTags; - return $obj; + return $self; } /** @@ -302,10 +302,10 @@ public function withAITags(?array $aiTags): self */ public function withCreatedAt(\DateTimeInterface $createdAt): self { - $obj = clone $this; - $obj['createdAt'] = $createdAt; + $self = clone $this; + $self['createdAt'] = $createdAt; - return $obj; + return $self; } /** @@ -313,10 +313,10 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self */ public function withCustomCoordinates(?string $customCoordinates): self { - $obj = clone $this; - $obj['customCoordinates'] = $customCoordinates; + $self = clone $this; + $self['customCoordinates'] = $customCoordinates; - return $obj; + return $self; } /** @@ -326,10 +326,10 @@ public function withCustomCoordinates(?string $customCoordinates): self */ public function withCustomMetadata(array $customMetadata): self { - $obj = clone $this; - $obj['customMetadata'] = $customMetadata; + $self = clone $this; + $self['customMetadata'] = $customMetadata; - return $obj; + return $self; } /** @@ -337,10 +337,10 @@ public function withCustomMetadata(array $customMetadata): self */ public function withDescription(string $description): self { - $obj = clone $this; - $obj['description'] = $description; + $self = clone $this; + $self['description'] = $description; - return $obj; + return $self; } /** @@ -348,10 +348,10 @@ public function withDescription(string $description): self */ public function withFileID(string $fileID): self { - $obj = clone $this; - $obj['fileID'] = $fileID; + $self = clone $this; + $self['fileID'] = $fileID; - return $obj; + return $self; } /** @@ -359,10 +359,10 @@ public function withFileID(string $fileID): self */ public function withFilePath(string $filePath): self { - $obj = clone $this; - $obj['filePath'] = $filePath; + $self = clone $this; + $self['filePath'] = $filePath; - return $obj; + return $self; } /** @@ -370,10 +370,10 @@ public function withFilePath(string $filePath): self */ public function withFileType(string $fileType): self { - $obj = clone $this; - $obj['fileType'] = $fileType; + $self = clone $this; + $self['fileType'] = $fileType; - return $obj; + return $self; } /** @@ -381,10 +381,10 @@ public function withFileType(string $fileType): self */ public function withHasAlpha(bool $hasAlpha): self { - $obj = clone $this; - $obj['hasAlpha'] = $hasAlpha; + $self = clone $this; + $self['hasAlpha'] = $hasAlpha; - return $obj; + return $self; } /** @@ -392,10 +392,10 @@ public function withHasAlpha(bool $hasAlpha): self */ public function withHeight(float $height): self { - $obj = clone $this; - $obj['height'] = $height; + $self = clone $this; + $self['height'] = $height; - return $obj; + return $self; } /** @@ -403,10 +403,10 @@ public function withHeight(float $height): self */ public function withIsPrivateFile(bool $isPrivateFile): self { - $obj = clone $this; - $obj['isPrivateFile'] = $isPrivateFile; + $self = clone $this; + $self['isPrivateFile'] = $isPrivateFile; - return $obj; + return $self; } /** @@ -414,10 +414,10 @@ public function withIsPrivateFile(bool $isPrivateFile): self */ public function withIsPublished(bool $isPublished): self { - $obj = clone $this; - $obj['isPublished'] = $isPublished; + $self = clone $this; + $self['isPublished'] = $isPublished; - return $obj; + return $self; } /** @@ -425,10 +425,10 @@ public function withIsPublished(bool $isPublished): self */ public function withMime(string $mime): self { - $obj = clone $this; - $obj['mime'] = $mime; + $self = clone $this; + $self['mime'] = $mime; - return $obj; + return $self; } /** @@ -436,10 +436,10 @@ public function withMime(string $mime): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -464,10 +464,10 @@ public function withName(string $name): self */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { - $obj = clone $this; - $obj['selectedFieldsSchema'] = $selectedFieldsSchema; + $self = clone $this; + $self['selectedFieldsSchema'] = $selectedFieldsSchema; - return $obj; + return $self; } /** @@ -475,10 +475,10 @@ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self */ public function withSize(float $size): self { - $obj = clone $this; - $obj['size'] = $size; + $self = clone $this; + $self['size'] = $size; - return $obj; + return $self; } /** @@ -488,10 +488,10 @@ public function withSize(float $size): self */ public function withTags(?array $tags): self { - $obj = clone $this; - $obj['tags'] = $tags; + $self = clone $this; + $self['tags'] = $tags; - return $obj; + return $self; } /** @@ -499,10 +499,10 @@ public function withTags(?array $tags): self */ public function withThumbnail(string $thumbnail): self { - $obj = clone $this; - $obj['thumbnail'] = $thumbnail; + $self = clone $this; + $self['thumbnail'] = $thumbnail; - return $obj; + return $self; } /** @@ -512,10 +512,10 @@ public function withThumbnail(string $thumbnail): self */ public function withType(Type|string $type): self { - $obj = clone $this; - $obj['type'] = $type; + $self = clone $this; + $self['type'] = $type; - return $obj; + return $self; } /** @@ -523,10 +523,10 @@ public function withType(Type|string $type): self */ public function withUpdatedAt(\DateTimeInterface $updatedAt): self { - $obj = clone $this; - $obj['updatedAt'] = $updatedAt; + $self = clone $this; + $self['updatedAt'] = $updatedAt; - return $obj; + return $self; } /** @@ -534,10 +534,10 @@ public function withUpdatedAt(\DateTimeInterface $updatedAt): self */ public function withURL(string $url): self { - $obj = clone $this; - $obj['url'] = $url; + $self = clone $this; + $self['url'] = $url; - return $obj; + return $self; } /** @@ -547,10 +547,10 @@ public function withURL(string $url): self */ public function withVersionInfo(VersionInfo|array $versionInfo): self { - $obj = clone $this; - $obj['versionInfo'] = $versionInfo; + $self = clone $this; + $self['versionInfo'] = $versionInfo; - return $obj; + return $self; } /** @@ -558,9 +558,9 @@ public function withVersionInfo(VersionInfo|array $versionInfo): self */ public function withWidth(float $width): self { - $obj = clone $this; - $obj['width'] = $width; + $self = clone $this; + $self['width'] = $width; - return $obj; + return $self; } } diff --git a/src/Files/File/AITag.php b/src/Files/File/AITag.php index 4c975e96..446832e5 100644 --- a/src/Files/File/AITag.php +++ b/src/Files/File/AITag.php @@ -51,13 +51,13 @@ public static function with( ?string $name = null, ?string $source = null ): self { - $obj = new self; + $self = new self; - null !== $confidence && $obj['confidence'] = $confidence; - null !== $name && $obj['name'] = $name; - null !== $source && $obj['source'] = $source; + null !== $confidence && $self['confidence'] = $confidence; + null !== $name && $self['name'] = $name; + null !== $source && $self['source'] = $source; - return $obj; + return $self; } /** @@ -65,10 +65,10 @@ public static function with( */ public function withConfidence(float $confidence): self { - $obj = clone $this; - $obj['confidence'] = $confidence; + $self = clone $this; + $self['confidence'] = $confidence; - return $obj; + return $self; } /** @@ -76,10 +76,10 @@ public function withConfidence(float $confidence): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -87,9 +87,9 @@ public function withName(string $name): self */ public function withSource(string $source): self { - $obj = clone $this; - $obj['source'] = $source; + $self = clone $this; + $self['source'] = $source; - return $obj; + return $self; } } diff --git a/src/Files/File/SelectedFieldsSchema.php b/src/Files/File/SelectedFieldsSchema.php index 8b05b851..1b6267fa 100644 --- a/src/Files/File/SelectedFieldsSchema.php +++ b/src/Files/File/SelectedFieldsSchema.php @@ -137,21 +137,21 @@ public static function with( ?array $selectOptions = null, ?bool $selectOptionsTruncated = null, ): self { - $obj = new self; + $self = new self; - $obj['type'] = $type; + $self['type'] = $type; - null !== $defaultValue && $obj['defaultValue'] = $defaultValue; - null !== $isValueRequired && $obj['isValueRequired'] = $isValueRequired; - null !== $maxLength && $obj['maxLength'] = $maxLength; - null !== $maxValue && $obj['maxValue'] = $maxValue; - null !== $minLength && $obj['minLength'] = $minLength; - null !== $minValue && $obj['minValue'] = $minValue; - null !== $readOnly && $obj['readOnly'] = $readOnly; - null !== $selectOptions && $obj['selectOptions'] = $selectOptions; - null !== $selectOptionsTruncated && $obj['selectOptionsTruncated'] = $selectOptionsTruncated; + null !== $defaultValue && $self['defaultValue'] = $defaultValue; + null !== $isValueRequired && $self['isValueRequired'] = $isValueRequired; + null !== $maxLength && $self['maxLength'] = $maxLength; + null !== $maxValue && $self['maxValue'] = $maxValue; + null !== $minLength && $self['minLength'] = $minLength; + null !== $minValue && $self['minValue'] = $minValue; + null !== $readOnly && $self['readOnly'] = $readOnly; + null !== $selectOptions && $self['selectOptions'] = $selectOptions; + null !== $selectOptionsTruncated && $self['selectOptionsTruncated'] = $selectOptionsTruncated; - return $obj; + return $self; } /** @@ -162,10 +162,10 @@ public static function with( public function withType( Type|string $type ): self { - $obj = clone $this; - $obj['type'] = $type; + $self = clone $this; + $self['type'] = $type; - return $obj; + return $self; } /** @@ -176,10 +176,10 @@ public function withType( public function withDefaultValue( string|float|bool|array $defaultValue ): self { - $obj = clone $this; - $obj['defaultValue'] = $defaultValue; + $self = clone $this; + $self['defaultValue'] = $defaultValue; - return $obj; + return $self; } /** @@ -187,10 +187,10 @@ public function withDefaultValue( */ public function withIsValueRequired(bool $isValueRequired): self { - $obj = clone $this; - $obj['isValueRequired'] = $isValueRequired; + $self = clone $this; + $self['isValueRequired'] = $isValueRequired; - return $obj; + return $self; } /** @@ -198,10 +198,10 @@ public function withIsValueRequired(bool $isValueRequired): self */ public function withMaxLength(float $maxLength): self { - $obj = clone $this; - $obj['maxLength'] = $maxLength; + $self = clone $this; + $self['maxLength'] = $maxLength; - return $obj; + return $self; } /** @@ -209,10 +209,10 @@ public function withMaxLength(float $maxLength): self */ public function withMaxValue(string|float $maxValue): self { - $obj = clone $this; - $obj['maxValue'] = $maxValue; + $self = clone $this; + $self['maxValue'] = $maxValue; - return $obj; + return $self; } /** @@ -220,10 +220,10 @@ public function withMaxValue(string|float $maxValue): self */ public function withMinLength(float $minLength): self { - $obj = clone $this; - $obj['minLength'] = $minLength; + $self = clone $this; + $self['minLength'] = $minLength; - return $obj; + return $self; } /** @@ -231,10 +231,10 @@ public function withMinLength(float $minLength): self */ public function withMinValue(string|float $minValue): self { - $obj = clone $this; - $obj['minValue'] = $minValue; + $self = clone $this; + $self['minValue'] = $minValue; - return $obj; + return $self; } /** @@ -242,10 +242,10 @@ public function withMinValue(string|float $minValue): self */ public function withReadOnly(bool $readOnly): self { - $obj = clone $this; - $obj['readOnly'] = $readOnly; + $self = clone $this; + $self['readOnly'] = $readOnly; - return $obj; + return $self; } /** @@ -255,10 +255,10 @@ public function withReadOnly(bool $readOnly): self */ public function withSelectOptions(array $selectOptions): self { - $obj = clone $this; - $obj['selectOptions'] = $selectOptions; + $self = clone $this; + $self['selectOptions'] = $selectOptions; - return $obj; + return $self; } /** @@ -267,9 +267,9 @@ public function withSelectOptions(array $selectOptions): self public function withSelectOptionsTruncated( bool $selectOptionsTruncated ): self { - $obj = clone $this; - $obj['selectOptionsTruncated'] = $selectOptionsTruncated; + $self = clone $this; + $self['selectOptionsTruncated'] = $selectOptionsTruncated; - return $obj; + return $self; } } diff --git a/src/Files/File/VersionInfo.php b/src/Files/File/VersionInfo.php index 0a2239e6..d7ff2131 100644 --- a/src/Files/File/VersionInfo.php +++ b/src/Files/File/VersionInfo.php @@ -42,12 +42,12 @@ public function __construct() */ public static function with(?string $id = null, ?string $name = null): self { - $obj = new self; + $self = new self; - null !== $id && $obj['id'] = $id; - null !== $name && $obj['name'] = $name; + null !== $id && $self['id'] = $id; + null !== $name && $self['name'] = $name; - return $obj; + return $self; } /** @@ -55,10 +55,10 @@ public static function with(?string $id = null, ?string $name = null): self */ public function withID(string $id): self { - $obj = clone $this; - $obj['id'] = $id; + $self = clone $this; + $self['id'] = $id; - return $obj; + return $self; } /** @@ -66,9 +66,9 @@ public function withID(string $id): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } } diff --git a/src/Files/FileCopyParams.php b/src/Files/FileCopyParams.php index b779ad41..aff0a333 100644 --- a/src/Files/FileCopyParams.php +++ b/src/Files/FileCopyParams.php @@ -74,14 +74,14 @@ public static function with( string $sourceFilePath, ?bool $includeFileVersions = null, ): self { - $obj = new self; + $self = new self; - $obj['destinationPath'] = $destinationPath; - $obj['sourceFilePath'] = $sourceFilePath; + $self['destinationPath'] = $destinationPath; + $self['sourceFilePath'] = $sourceFilePath; - null !== $includeFileVersions && $obj['includeFileVersions'] = $includeFileVersions; + null !== $includeFileVersions && $self['includeFileVersions'] = $includeFileVersions; - return $obj; + return $self; } /** @@ -89,10 +89,10 @@ public static function with( */ public function withDestinationPath(string $destinationPath): self { - $obj = clone $this; - $obj['destinationPath'] = $destinationPath; + $self = clone $this; + $self['destinationPath'] = $destinationPath; - return $obj; + return $self; } /** @@ -100,10 +100,10 @@ public function withDestinationPath(string $destinationPath): self */ public function withSourceFilePath(string $sourceFilePath): self { - $obj = clone $this; - $obj['sourceFilePath'] = $sourceFilePath; + $self = clone $this; + $self['sourceFilePath'] = $sourceFilePath; - return $obj; + return $self; } /** @@ -111,9 +111,9 @@ public function withSourceFilePath(string $sourceFilePath): self */ public function withIncludeFileVersions(bool $includeFileVersions): self { - $obj = clone $this; - $obj['includeFileVersions'] = $includeFileVersions; + $self = clone $this; + $self['includeFileVersions'] = $includeFileVersions; - return $obj; + return $self; } } diff --git a/src/Files/FileMoveParams.php b/src/Files/FileMoveParams.php index 28a2b923..d973fa5d 100644 --- a/src/Files/FileMoveParams.php +++ b/src/Files/FileMoveParams.php @@ -66,12 +66,12 @@ public static function with( string $destinationPath, string $sourceFilePath ): self { - $obj = new self; + $self = new self; - $obj['destinationPath'] = $destinationPath; - $obj['sourceFilePath'] = $sourceFilePath; + $self['destinationPath'] = $destinationPath; + $self['sourceFilePath'] = $sourceFilePath; - return $obj; + return $self; } /** @@ -79,10 +79,10 @@ public static function with( */ public function withDestinationPath(string $destinationPath): self { - $obj = clone $this; - $obj['destinationPath'] = $destinationPath; + $self = clone $this; + $self['destinationPath'] = $destinationPath; - return $obj; + return $self; } /** @@ -90,9 +90,9 @@ public function withDestinationPath(string $destinationPath): self */ public function withSourceFilePath(string $sourceFilePath): self { - $obj = clone $this; - $obj['sourceFilePath'] = $sourceFilePath; + $self = clone $this; + $self['sourceFilePath'] = $sourceFilePath; - return $obj; + return $self; } } diff --git a/src/Files/FileRenameParams.php b/src/Files/FileRenameParams.php index 81e10ba4..f19e015a 100644 --- a/src/Files/FileRenameParams.php +++ b/src/Files/FileRenameParams.php @@ -87,14 +87,14 @@ public static function with( string $newFileName, ?bool $purgeCache = null ): self { - $obj = new self; + $self = new self; - $obj['filePath'] = $filePath; - $obj['newFileName'] = $newFileName; + $self['filePath'] = $filePath; + $self['newFileName'] = $newFileName; - null !== $purgeCache && $obj['purgeCache'] = $purgeCache; + null !== $purgeCache && $self['purgeCache'] = $purgeCache; - return $obj; + return $self; } /** @@ -102,10 +102,10 @@ public static function with( */ public function withFilePath(string $filePath): self { - $obj = clone $this; - $obj['filePath'] = $filePath; + $self = clone $this; + $self['filePath'] = $filePath; - return $obj; + return $self; } /** @@ -118,10 +118,10 @@ public function withFilePath(string $filePath): self */ public function withNewFileName(string $newFileName): self { - $obj = clone $this; - $obj['newFileName'] = $newFileName; + $self = clone $this; + $self['newFileName'] = $newFileName; - return $obj; + return $self; } /** @@ -137,9 +137,9 @@ public function withNewFileName(string $newFileName): self */ public function withPurgeCache(bool $purgeCache): self { - $obj = clone $this; - $obj['purgeCache'] = $purgeCache; + $self = clone $this; + $self['purgeCache'] = $purgeCache; - return $obj; + return $self; } } diff --git a/src/Files/FileRenameResponse.php b/src/Files/FileRenameResponse.php index 28ed10e9..ce95b15b 100644 --- a/src/Files/FileRenameResponse.php +++ b/src/Files/FileRenameResponse.php @@ -34,11 +34,11 @@ public function __construct() */ public static function with(?string $purgeRequestID = null): self { - $obj = new self; + $self = new self; - null !== $purgeRequestID && $obj['purgeRequestID'] = $purgeRequestID; + null !== $purgeRequestID && $self['purgeRequestID'] = $purgeRequestID; - return $obj; + return $self; } /** @@ -46,9 +46,9 @@ public static function with(?string $purgeRequestID = null): self */ public function withPurgeRequestID(string $purgeRequestID): self { - $obj = clone $this; - $obj['purgeRequestID'] = $purgeRequestID; + $self = clone $this; + $self['purgeRequestID'] = $purgeRequestID; - return $obj; + return $self; } } diff --git a/src/Files/FileUpdateParams.php b/src/Files/FileUpdateParams.php index 997ac9d9..6f6e9299 100644 --- a/src/Files/FileUpdateParams.php +++ b/src/Files/FileUpdateParams.php @@ -135,18 +135,18 @@ public static function with( ?string $webhookURL = null, Publish|array|null $publish = null, ): self { - $obj = new self; - - null !== $customCoordinates && $obj['customCoordinates'] = $customCoordinates; - null !== $customMetadata && $obj['customMetadata'] = $customMetadata; - null !== $description && $obj['description'] = $description; - null !== $extensions && $obj['extensions'] = $extensions; - null !== $removeAITags && $obj['removeAITags'] = $removeAITags; - null !== $tags && $obj['tags'] = $tags; - null !== $webhookURL && $obj['webhookURL'] = $webhookURL; - null !== $publish && $obj['publish'] = $publish; - - return $obj; + $self = new self; + + null !== $customCoordinates && $self['customCoordinates'] = $customCoordinates; + null !== $customMetadata && $self['customMetadata'] = $customMetadata; + null !== $description && $self['description'] = $description; + null !== $extensions && $self['extensions'] = $extensions; + null !== $removeAITags && $self['removeAITags'] = $removeAITags; + null !== $tags && $self['tags'] = $tags; + null !== $webhookURL && $self['webhookURL'] = $webhookURL; + null !== $publish && $self['publish'] = $publish; + + return $self; } /** @@ -154,10 +154,10 @@ public static function with( */ public function withCustomCoordinates(?string $customCoordinates): self { - $obj = clone $this; - $obj['customCoordinates'] = $customCoordinates; + $self = clone $this; + $self['customCoordinates'] = $customCoordinates; - return $obj; + return $self; } /** @@ -167,10 +167,10 @@ public function withCustomCoordinates(?string $customCoordinates): self */ public function withCustomMetadata(array $customMetadata): self { - $obj = clone $this; - $obj['customMetadata'] = $customMetadata; + $self = clone $this; + $self['customMetadata'] = $customMetadata; - return $obj; + return $self; } /** @@ -178,10 +178,10 @@ public function withCustomMetadata(array $customMetadata): self */ public function withDescription(string $description): self { - $obj = clone $this; - $obj['description'] = $description; + $self = clone $this; + $self['description'] = $description; - return $obj; + return $self; } /** @@ -195,10 +195,10 @@ public function withDescription(string $description): self */ public function withExtensions(array $extensions): self { - $obj = clone $this; - $obj['extensions'] = $extensions; + $self = clone $this; + $self['extensions'] = $extensions; - return $obj; + return $self; } /** @@ -212,10 +212,10 @@ public function withExtensions(array $extensions): self */ public function withRemoveAITags(string|array $removeAITags): self { - $obj = clone $this; - $obj['removeAITags'] = $removeAITags; + $self = clone $this; + $self['removeAITags'] = $removeAITags; - return $obj; + return $self; } /** @@ -225,10 +225,10 @@ public function withRemoveAITags(string|array $removeAITags): self */ public function withTags(?array $tags): self { - $obj = clone $this; - $obj['tags'] = $tags; + $self = clone $this; + $self['tags'] = $tags; - return $obj; + return $self; } /** @@ -236,10 +236,10 @@ public function withTags(?array $tags): self */ public function withWebhookURL(string $webhookURL): self { - $obj = clone $this; - $obj['webhookURL'] = $webhookURL; + $self = clone $this; + $self['webhookURL'] = $webhookURL; - return $obj; + return $self; } /** @@ -251,9 +251,9 @@ public function withWebhookURL(string $webhookURL): self */ public function withPublish(Publish|array $publish): self { - $obj = clone $this; - $obj['publish'] = $publish; + $self = clone $this; + $self['publish'] = $publish; - return $obj; + return $self; } } diff --git a/src/Files/FileUpdateParams/Publish.php b/src/Files/FileUpdateParams/Publish.php index 74cbd21b..53d27bf7 100644 --- a/src/Files/FileUpdateParams/Publish.php +++ b/src/Files/FileUpdateParams/Publish.php @@ -61,13 +61,13 @@ public static function with( bool $isPublished, ?bool $includeFileVersions = null ): self { - $obj = new self; + $self = new self; - $obj['isPublished'] = $isPublished; + $self['isPublished'] = $isPublished; - null !== $includeFileVersions && $obj['includeFileVersions'] = $includeFileVersions; + null !== $includeFileVersions && $self['includeFileVersions'] = $includeFileVersions; - return $obj; + return $self; } /** @@ -75,10 +75,10 @@ public static function with( */ public function withIsPublished(bool $isPublished): self { - $obj = clone $this; - $obj['isPublished'] = $isPublished; + $self = clone $this; + $self['isPublished'] = $isPublished; - return $obj; + return $self; } /** @@ -86,9 +86,9 @@ public function withIsPublished(bool $isPublished): self */ public function withIncludeFileVersions(bool $includeFileVersions): self { - $obj = clone $this; - $obj['includeFileVersions'] = $includeFileVersions; + $self = clone $this; + $self['includeFileVersions'] = $includeFileVersions; - return $obj; + return $self; } } diff --git a/src/Files/FileUpdateResponse.php b/src/Files/FileUpdateResponse.php index 98535459..744732d9 100644 --- a/src/Files/FileUpdateResponse.php +++ b/src/Files/FileUpdateResponse.php @@ -269,34 +269,34 @@ public static function with( ?float $width = null, ExtensionStatus|array|null $extensionStatus = null, ): self { - $obj = new self; - - null !== $aiTags && $obj['aiTags'] = $aiTags; - null !== $createdAt && $obj['createdAt'] = $createdAt; - null !== $customCoordinates && $obj['customCoordinates'] = $customCoordinates; - null !== $customMetadata && $obj['customMetadata'] = $customMetadata; - null !== $description && $obj['description'] = $description; - null !== $fileID && $obj['fileID'] = $fileID; - null !== $filePath && $obj['filePath'] = $filePath; - null !== $fileType && $obj['fileType'] = $fileType; - null !== $hasAlpha && $obj['hasAlpha'] = $hasAlpha; - null !== $height && $obj['height'] = $height; - null !== $isPrivateFile && $obj['isPrivateFile'] = $isPrivateFile; - null !== $isPublished && $obj['isPublished'] = $isPublished; - null !== $mime && $obj['mime'] = $mime; - null !== $name && $obj['name'] = $name; - null !== $selectedFieldsSchema && $obj['selectedFieldsSchema'] = $selectedFieldsSchema; - null !== $size && $obj['size'] = $size; - null !== $tags && $obj['tags'] = $tags; - null !== $thumbnail && $obj['thumbnail'] = $thumbnail; - null !== $type && $obj['type'] = $type; - null !== $updatedAt && $obj['updatedAt'] = $updatedAt; - null !== $url && $obj['url'] = $url; - null !== $versionInfo && $obj['versionInfo'] = $versionInfo; - null !== $width && $obj['width'] = $width; - null !== $extensionStatus && $obj['extensionStatus'] = $extensionStatus; - - return $obj; + $self = new self; + + null !== $aiTags && $self['aiTags'] = $aiTags; + null !== $createdAt && $self['createdAt'] = $createdAt; + null !== $customCoordinates && $self['customCoordinates'] = $customCoordinates; + null !== $customMetadata && $self['customMetadata'] = $customMetadata; + null !== $description && $self['description'] = $description; + null !== $fileID && $self['fileID'] = $fileID; + null !== $filePath && $self['filePath'] = $filePath; + null !== $fileType && $self['fileType'] = $fileType; + null !== $hasAlpha && $self['hasAlpha'] = $hasAlpha; + null !== $height && $self['height'] = $height; + null !== $isPrivateFile && $self['isPrivateFile'] = $isPrivateFile; + null !== $isPublished && $self['isPublished'] = $isPublished; + null !== $mime && $self['mime'] = $mime; + null !== $name && $self['name'] = $name; + null !== $selectedFieldsSchema && $self['selectedFieldsSchema'] = $selectedFieldsSchema; + null !== $size && $self['size'] = $size; + null !== $tags && $self['tags'] = $tags; + null !== $thumbnail && $self['thumbnail'] = $thumbnail; + null !== $type && $self['type'] = $type; + null !== $updatedAt && $self['updatedAt'] = $updatedAt; + null !== $url && $self['url'] = $url; + null !== $versionInfo && $self['versionInfo'] = $versionInfo; + null !== $width && $self['width'] = $width; + null !== $extensionStatus && $self['extensionStatus'] = $extensionStatus; + + return $self; } /** @@ -308,10 +308,10 @@ public static function with( */ public function withAITags(?array $aiTags): self { - $obj = clone $this; - $obj['aiTags'] = $aiTags; + $self = clone $this; + $self['aiTags'] = $aiTags; - return $obj; + return $self; } /** @@ -319,10 +319,10 @@ public function withAITags(?array $aiTags): self */ public function withCreatedAt(\DateTimeInterface $createdAt): self { - $obj = clone $this; - $obj['createdAt'] = $createdAt; + $self = clone $this; + $self['createdAt'] = $createdAt; - return $obj; + return $self; } /** @@ -330,10 +330,10 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self */ public function withCustomCoordinates(?string $customCoordinates): self { - $obj = clone $this; - $obj['customCoordinates'] = $customCoordinates; + $self = clone $this; + $self['customCoordinates'] = $customCoordinates; - return $obj; + return $self; } /** @@ -343,10 +343,10 @@ public function withCustomCoordinates(?string $customCoordinates): self */ public function withCustomMetadata(array $customMetadata): self { - $obj = clone $this; - $obj['customMetadata'] = $customMetadata; + $self = clone $this; + $self['customMetadata'] = $customMetadata; - return $obj; + return $self; } /** @@ -354,10 +354,10 @@ public function withCustomMetadata(array $customMetadata): self */ public function withDescription(string $description): self { - $obj = clone $this; - $obj['description'] = $description; + $self = clone $this; + $self['description'] = $description; - return $obj; + return $self; } /** @@ -365,10 +365,10 @@ public function withDescription(string $description): self */ public function withFileID(string $fileID): self { - $obj = clone $this; - $obj['fileID'] = $fileID; + $self = clone $this; + $self['fileID'] = $fileID; - return $obj; + return $self; } /** @@ -376,10 +376,10 @@ public function withFileID(string $fileID): self */ public function withFilePath(string $filePath): self { - $obj = clone $this; - $obj['filePath'] = $filePath; + $self = clone $this; + $self['filePath'] = $filePath; - return $obj; + return $self; } /** @@ -387,10 +387,10 @@ public function withFilePath(string $filePath): self */ public function withFileType(string $fileType): self { - $obj = clone $this; - $obj['fileType'] = $fileType; + $self = clone $this; + $self['fileType'] = $fileType; - return $obj; + return $self; } /** @@ -398,10 +398,10 @@ public function withFileType(string $fileType): self */ public function withHasAlpha(bool $hasAlpha): self { - $obj = clone $this; - $obj['hasAlpha'] = $hasAlpha; + $self = clone $this; + $self['hasAlpha'] = $hasAlpha; - return $obj; + return $self; } /** @@ -409,10 +409,10 @@ public function withHasAlpha(bool $hasAlpha): self */ public function withHeight(float $height): self { - $obj = clone $this; - $obj['height'] = $height; + $self = clone $this; + $self['height'] = $height; - return $obj; + return $self; } /** @@ -420,10 +420,10 @@ public function withHeight(float $height): self */ public function withIsPrivateFile(bool $isPrivateFile): self { - $obj = clone $this; - $obj['isPrivateFile'] = $isPrivateFile; + $self = clone $this; + $self['isPrivateFile'] = $isPrivateFile; - return $obj; + return $self; } /** @@ -431,10 +431,10 @@ public function withIsPrivateFile(bool $isPrivateFile): self */ public function withIsPublished(bool $isPublished): self { - $obj = clone $this; - $obj['isPublished'] = $isPublished; + $self = clone $this; + $self['isPublished'] = $isPublished; - return $obj; + return $self; } /** @@ -442,10 +442,10 @@ public function withIsPublished(bool $isPublished): self */ public function withMime(string $mime): self { - $obj = clone $this; - $obj['mime'] = $mime; + $self = clone $this; + $self['mime'] = $mime; - return $obj; + return $self; } /** @@ -453,10 +453,10 @@ public function withMime(string $mime): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -481,10 +481,10 @@ public function withName(string $name): self */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { - $obj = clone $this; - $obj['selectedFieldsSchema'] = $selectedFieldsSchema; + $self = clone $this; + $self['selectedFieldsSchema'] = $selectedFieldsSchema; - return $obj; + return $self; } /** @@ -492,10 +492,10 @@ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self */ public function withSize(float $size): self { - $obj = clone $this; - $obj['size'] = $size; + $self = clone $this; + $self['size'] = $size; - return $obj; + return $self; } /** @@ -505,10 +505,10 @@ public function withSize(float $size): self */ public function withTags(?array $tags): self { - $obj = clone $this; - $obj['tags'] = $tags; + $self = clone $this; + $self['tags'] = $tags; - return $obj; + return $self; } /** @@ -516,10 +516,10 @@ public function withTags(?array $tags): self */ public function withThumbnail(string $thumbnail): self { - $obj = clone $this; - $obj['thumbnail'] = $thumbnail; + $self = clone $this; + $self['thumbnail'] = $thumbnail; - return $obj; + return $self; } /** @@ -529,10 +529,10 @@ public function withThumbnail(string $thumbnail): self */ public function withType(Type|string $type): self { - $obj = clone $this; - $obj['type'] = $type; + $self = clone $this; + $self['type'] = $type; - return $obj; + return $self; } /** @@ -540,10 +540,10 @@ public function withType(Type|string $type): self */ public function withUpdatedAt(\DateTimeInterface $updatedAt): self { - $obj = clone $this; - $obj['updatedAt'] = $updatedAt; + $self = clone $this; + $self['updatedAt'] = $updatedAt; - return $obj; + return $self; } /** @@ -551,10 +551,10 @@ public function withUpdatedAt(\DateTimeInterface $updatedAt): self */ public function withURL(string $url): self { - $obj = clone $this; - $obj['url'] = $url; + $self = clone $this; + $self['url'] = $url; - return $obj; + return $self; } /** @@ -564,10 +564,10 @@ public function withURL(string $url): self */ public function withVersionInfo(VersionInfo|array $versionInfo): self { - $obj = clone $this; - $obj['versionInfo'] = $versionInfo; + $self = clone $this; + $self['versionInfo'] = $versionInfo; - return $obj; + return $self; } /** @@ -575,10 +575,10 @@ public function withVersionInfo(VersionInfo|array $versionInfo): self */ public function withWidth(float $width): self { - $obj = clone $this; - $obj['width'] = $width; + $self = clone $this; + $self['width'] = $width; - return $obj; + return $self; } /** @@ -592,9 +592,9 @@ public function withWidth(float $width): self public function withExtensionStatus( ExtensionStatus|array $extensionStatus ): self { - $obj = clone $this; - $obj['extensionStatus'] = $extensionStatus; + $self = clone $this; + $self['extensionStatus'] = $extensionStatus; - return $obj; + return $self; } } diff --git a/src/Files/FileUpdateResponse/ExtensionStatus.php b/src/Files/FileUpdateResponse/ExtensionStatus.php index 7fcced98..64d80c94 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus.php @@ -62,14 +62,14 @@ public static function with( GoogleAutoTagging|string|null $googleAutoTagging = null, RemoveBg|string|null $removeBg = null, ): self { - $obj = new self; + $self = new self; - null !== $aiAutoDescription && $obj['aiAutoDescription'] = $aiAutoDescription; - null !== $awsAutoTagging && $obj['awsAutoTagging'] = $awsAutoTagging; - null !== $googleAutoTagging && $obj['googleAutoTagging'] = $googleAutoTagging; - null !== $removeBg && $obj['removeBg'] = $removeBg; + null !== $aiAutoDescription && $self['aiAutoDescription'] = $aiAutoDescription; + null !== $awsAutoTagging && $self['awsAutoTagging'] = $awsAutoTagging; + null !== $googleAutoTagging && $self['googleAutoTagging'] = $googleAutoTagging; + null !== $removeBg && $self['removeBg'] = $removeBg; - return $obj; + return $self; } /** @@ -78,10 +78,10 @@ public static function with( public function withAIAutoDescription( AIAutoDescription|string $aiAutoDescription ): self { - $obj = clone $this; - $obj['aiAutoDescription'] = $aiAutoDescription; + $self = clone $this; + $self['aiAutoDescription'] = $aiAutoDescription; - return $obj; + return $self; } /** @@ -90,10 +90,10 @@ public function withAIAutoDescription( public function withAwsAutoTagging( AwsAutoTagging|string $awsAutoTagging ): self { - $obj = clone $this; - $obj['awsAutoTagging'] = $awsAutoTagging; + $self = clone $this; + $self['awsAutoTagging'] = $awsAutoTagging; - return $obj; + return $self; } /** @@ -102,10 +102,10 @@ public function withAwsAutoTagging( public function withGoogleAutoTagging( GoogleAutoTagging|string $googleAutoTagging ): self { - $obj = clone $this; - $obj['googleAutoTagging'] = $googleAutoTagging; + $self = clone $this; + $self['googleAutoTagging'] = $googleAutoTagging; - return $obj; + return $self; } /** @@ -113,9 +113,9 @@ public function withGoogleAutoTagging( */ public function withRemoveBg(RemoveBg|string $removeBg): self { - $obj = clone $this; - $obj['removeBg'] = $removeBg; + $self = clone $this; + $self['removeBg'] = $removeBg; - return $obj; + return $self; } } diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index bbe5c7f3..fd76ba3d 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -334,34 +334,34 @@ public static function with( ?bool $useUniqueFileName = null, ?string $webhookURL = null, ): self { - $obj = new self; - - $obj['file'] = $file; - $obj['fileName'] = $fileName; - - null !== $token && $obj['token'] = $token; - null !== $checks && $obj['checks'] = $checks; - null !== $customCoordinates && $obj['customCoordinates'] = $customCoordinates; - null !== $customMetadata && $obj['customMetadata'] = $customMetadata; - null !== $description && $obj['description'] = $description; - null !== $expire && $obj['expire'] = $expire; - null !== $extensions && $obj['extensions'] = $extensions; - null !== $folder && $obj['folder'] = $folder; - null !== $isPrivateFile && $obj['isPrivateFile'] = $isPrivateFile; - null !== $isPublished && $obj['isPublished'] = $isPublished; - null !== $overwriteAITags && $obj['overwriteAITags'] = $overwriteAITags; - null !== $overwriteCustomMetadata && $obj['overwriteCustomMetadata'] = $overwriteCustomMetadata; - null !== $overwriteFile && $obj['overwriteFile'] = $overwriteFile; - null !== $overwriteTags && $obj['overwriteTags'] = $overwriteTags; - null !== $publicKey && $obj['publicKey'] = $publicKey; - null !== $responseFields && $obj['responseFields'] = $responseFields; - null !== $signature && $obj['signature'] = $signature; - null !== $tags && $obj['tags'] = $tags; - null !== $transformation && $obj['transformation'] = $transformation; - null !== $useUniqueFileName && $obj['useUniqueFileName'] = $useUniqueFileName; - null !== $webhookURL && $obj['webhookURL'] = $webhookURL; - - return $obj; + $self = new self; + + $self['file'] = $file; + $self['fileName'] = $fileName; + + null !== $token && $self['token'] = $token; + null !== $checks && $self['checks'] = $checks; + null !== $customCoordinates && $self['customCoordinates'] = $customCoordinates; + null !== $customMetadata && $self['customMetadata'] = $customMetadata; + null !== $description && $self['description'] = $description; + null !== $expire && $self['expire'] = $expire; + null !== $extensions && $self['extensions'] = $extensions; + null !== $folder && $self['folder'] = $folder; + null !== $isPrivateFile && $self['isPrivateFile'] = $isPrivateFile; + null !== $isPublished && $self['isPublished'] = $isPublished; + null !== $overwriteAITags && $self['overwriteAITags'] = $overwriteAITags; + null !== $overwriteCustomMetadata && $self['overwriteCustomMetadata'] = $overwriteCustomMetadata; + null !== $overwriteFile && $self['overwriteFile'] = $overwriteFile; + null !== $overwriteTags && $self['overwriteTags'] = $overwriteTags; + null !== $publicKey && $self['publicKey'] = $publicKey; + null !== $responseFields && $self['responseFields'] = $responseFields; + null !== $signature && $self['signature'] = $signature; + null !== $tags && $self['tags'] = $tags; + null !== $transformation && $self['transformation'] = $transformation; + null !== $useUniqueFileName && $self['useUniqueFileName'] = $useUniqueFileName; + null !== $webhookURL && $self['webhookURL'] = $webhookURL; + + return $self; } /** @@ -375,10 +375,10 @@ public static function with( */ public function withFile(string $file): self { - $obj = clone $this; - $obj['file'] = $file; + $self = clone $this; + $self['file'] = $file; - return $obj; + return $self; } /** @@ -392,10 +392,10 @@ public function withFile(string $file): self */ public function withFileName(string $fileName): self { - $obj = clone $this; - $obj['fileName'] = $fileName; + $self = clone $this; + $self['fileName'] = $fileName; - return $obj; + return $self; } /** @@ -405,10 +405,10 @@ public function withFileName(string $fileName): self */ public function withToken(string $token): self { - $obj = clone $this; - $obj['token'] = $token; + $self = clone $this; + $self['token'] = $token; - return $obj; + return $self; } /** @@ -417,10 +417,10 @@ public function withToken(string $token): self */ public function withChecks(string $checks): self { - $obj = clone $this; - $obj['checks'] = $checks; + $self = clone $this; + $self['checks'] = $checks; - return $obj; + return $self; } /** @@ -432,10 +432,10 @@ public function withChecks(string $checks): self */ public function withCustomCoordinates(string $customCoordinates): self { - $obj = clone $this; - $obj['customCoordinates'] = $customCoordinates; + $self = clone $this; + $self['customCoordinates'] = $customCoordinates; - return $obj; + return $self; } /** @@ -445,10 +445,10 @@ public function withCustomCoordinates(string $customCoordinates): self */ public function withCustomMetadata(array $customMetadata): self { - $obj = clone $this; - $obj['customMetadata'] = $customMetadata; + $self = clone $this; + $self['customMetadata'] = $customMetadata; - return $obj; + return $self; } /** @@ -456,10 +456,10 @@ public function withCustomMetadata(array $customMetadata): self */ public function withDescription(string $description): self { - $obj = clone $this; - $obj['description'] = $description; + $self = clone $this; + $self['description'] = $description; - return $obj; + return $self; } /** @@ -467,10 +467,10 @@ public function withDescription(string $description): self */ public function withExpire(int $expire): self { - $obj = clone $this; - $obj['expire'] = $expire; + $self = clone $this; + $self['expire'] = $expire; - return $obj; + return $self; } /** @@ -484,10 +484,10 @@ public function withExpire(int $expire): self */ public function withExtensions(array $extensions): self { - $obj = clone $this; - $obj['extensions'] = $extensions; + $self = clone $this; + $self['extensions'] = $extensions; - return $obj; + return $self; } /** @@ -502,10 +502,10 @@ public function withExtensions(array $extensions): self */ public function withFolder(string $folder): self { - $obj = clone $this; - $obj['folder'] = $folder; + $self = clone $this; + $self['folder'] = $folder; - return $obj; + return $self; } /** @@ -515,10 +515,10 @@ public function withFolder(string $folder): self */ public function withIsPrivateFile(bool $isPrivateFile): self { - $obj = clone $this; - $obj['isPrivateFile'] = $isPrivateFile; + $self = clone $this; + $self['isPrivateFile'] = $isPrivateFile; - return $obj; + return $self; } /** @@ -530,10 +530,10 @@ public function withIsPrivateFile(bool $isPrivateFile): self */ public function withIsPublished(bool $isPublished): self { - $obj = clone $this; - $obj['isPublished'] = $isPublished; + $self = clone $this; + $self['isPublished'] = $isPublished; - return $obj; + return $self; } /** @@ -541,10 +541,10 @@ public function withIsPublished(bool $isPublished): self */ public function withOverwriteAITags(bool $overwriteAITags): self { - $obj = clone $this; - $obj['overwriteAITags'] = $overwriteAITags; + $self = clone $this; + $self['overwriteAITags'] = $overwriteAITags; - return $obj; + return $self; } /** @@ -553,10 +553,10 @@ public function withOverwriteAITags(bool $overwriteAITags): self public function withOverwriteCustomMetadata( bool $overwriteCustomMetadata ): self { - $obj = clone $this; - $obj['overwriteCustomMetadata'] = $overwriteCustomMetadata; + $self = clone $this; + $self['overwriteCustomMetadata'] = $overwriteCustomMetadata; - return $obj; + return $self; } /** @@ -564,10 +564,10 @@ public function withOverwriteCustomMetadata( */ public function withOverwriteFile(bool $overwriteFile): self { - $obj = clone $this; - $obj['overwriteFile'] = $overwriteFile; + $self = clone $this; + $self['overwriteFile'] = $overwriteFile; - return $obj; + return $self; } /** @@ -575,10 +575,10 @@ public function withOverwriteFile(bool $overwriteFile): self */ public function withOverwriteTags(bool $overwriteTags): self { - $obj = clone $this; - $obj['overwriteTags'] = $overwriteTags; + $self = clone $this; + $self['overwriteTags'] = $overwriteTags; - return $obj; + return $self; } /** @@ -586,10 +586,10 @@ public function withOverwriteTags(bool $overwriteTags): self */ public function withPublicKey(string $publicKey): self { - $obj = clone $this; - $obj['publicKey'] = $publicKey; + $self = clone $this; + $self['publicKey'] = $publicKey; - return $obj; + return $self; } /** @@ -599,10 +599,10 @@ public function withPublicKey(string $publicKey): self */ public function withResponseFields(array $responseFields): self { - $obj = clone $this; - $obj['responseFields'] = $responseFields; + $self = clone $this; + $self['responseFields'] = $responseFields; - return $obj; + return $self; } /** @@ -612,10 +612,10 @@ public function withResponseFields(array $responseFields): self */ public function withSignature(string $signature): self { - $obj = clone $this; - $obj['signature'] = $signature; + $self = clone $this; + $self['signature'] = $signature; - return $obj; + return $self; } /** @@ -627,10 +627,10 @@ public function withSignature(string $signature): self */ public function withTags(array $tags): self { - $obj = clone $this; - $obj['tags'] = $tags; + $self = clone $this; + $self['tags'] = $tags; - return $obj; + return $self; } /** @@ -652,10 +652,10 @@ public function withTags(array $tags): self public function withTransformation( Transformation|array $transformation ): self { - $obj = clone $this; - $obj['transformation'] = $transformation; + $self = clone $this; + $self['transformation'] = $transformation; - return $obj; + return $self; } /** @@ -667,10 +667,10 @@ public function withTransformation( */ public function withUseUniqueFileName(bool $useUniqueFileName): self { - $obj = clone $this; - $obj['useUniqueFileName'] = $useUniqueFileName; + $self = clone $this; + $self['useUniqueFileName'] = $useUniqueFileName; - return $obj; + return $self; } /** @@ -678,9 +678,9 @@ public function withUseUniqueFileName(bool $useUniqueFileName): self */ public function withWebhookURL(string $webhookURL): self { - $obj = clone $this; - $obj['webhookURL'] = $webhookURL; + $self = clone $this; + $self['webhookURL'] = $webhookURL; - return $obj; + return $self; } } diff --git a/src/Files/FileUploadParams/Transformation.php b/src/Files/FileUploadParams/Transformation.php index 8794c5f6..c6c88a46 100644 --- a/src/Files/FileUploadParams/Transformation.php +++ b/src/Files/FileUploadParams/Transformation.php @@ -68,12 +68,12 @@ public function __construct() */ public static function with(?array $post = null, ?string $pre = null): self { - $obj = new self; + $self = new self; - null !== $post && $obj['post'] = $post; - null !== $pre && $obj['pre'] = $pre; + null !== $post && $self['post'] = $post; + null !== $pre && $self['pre'] = $pre; - return $obj; + return $self; } /** @@ -89,10 +89,10 @@ public static function with(?array $post = null, ?string $pre = null): self */ public function withPost(array $post): self { - $obj = clone $this; - $obj['post'] = $post; + $self = clone $this; + $self['post'] = $post; - return $obj; + return $self; } /** @@ -100,9 +100,9 @@ public function withPost(array $post): self */ public function withPre(string $pre): self { - $obj = clone $this; - $obj['pre'] = $pre; + $self = clone $this; + $self['pre'] = $pre; - return $obj; + return $self; } } diff --git a/src/Files/FileUploadParams/Transformation/Post/Abs.php b/src/Files/FileUploadParams/Transformation/Post/Abs.php index bf5ff4f4..3b9685b7 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Abs.php +++ b/src/Files/FileUploadParams/Transformation/Post/Abs.php @@ -69,12 +69,12 @@ public function __construct() */ public static function with(Protocol|string $protocol, string $value): self { - $obj = new self; + $self = new self; - $obj['protocol'] = $protocol; - $obj['value'] = $value; + $self['protocol'] = $protocol; + $self['value'] = $value; - return $obj; + return $self; } /** @@ -84,10 +84,10 @@ public static function with(Protocol|string $protocol, string $value): self */ public function withProtocol(Protocol|string $protocol): self { - $obj = clone $this; - $obj['protocol'] = $protocol; + $self = clone $this; + $self['protocol'] = $protocol; - return $obj; + return $self; } /** @@ -95,9 +95,9 @@ public function withProtocol(Protocol|string $protocol): self */ public function withValue(string $value): self { - $obj = clone $this; - $obj['value'] = $value; + $self = clone $this; + $self['value'] = $value; - return $obj; + return $self; } } diff --git a/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php b/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php index 618d5ce0..a23687b9 100644 --- a/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php +++ b/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php @@ -46,11 +46,11 @@ public function __construct() */ public static function with(?string $value = null): self { - $obj = new self; + $self = new self; - null !== $value && $obj['value'] = $value; + null !== $value && $self['value'] = $value; - return $obj; + return $self; } /** @@ -59,9 +59,9 @@ public static function with(?string $value = null): self */ public function withValue(string $value): self { - $obj = clone $this; - $obj['value'] = $value; + $self = clone $this; + $self['value'] = $value; - return $obj; + return $self; } } diff --git a/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php b/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php index 6e84fe81..3fcd7624 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php +++ b/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php @@ -44,11 +44,11 @@ public function __construct() */ public static function with(?string $value = null): self { - $obj = new self; + $self = new self; - null !== $value && $obj['value'] = $value; + null !== $value && $self['value'] = $value; - return $obj; + return $self; } /** @@ -57,9 +57,9 @@ public static function with(?string $value = null): self */ public function withValue(string $value): self { - $obj = clone $this; - $obj['value'] = $value; + $self = clone $this; + $self['value'] = $value; - return $obj; + return $self; } } diff --git a/src/Files/FileUploadParams/Transformation/Post/Transformation.php b/src/Files/FileUploadParams/Transformation/Post/Transformation.php index bf7b592d..5afcf18e 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Transformation.php +++ b/src/Files/FileUploadParams/Transformation/Post/Transformation.php @@ -59,11 +59,11 @@ public function __construct() */ public static function with(string $value): self { - $obj = new self; + $self = new self; - $obj['value'] = $value; + $self['value'] = $value; - return $obj; + return $self; } /** @@ -72,9 +72,9 @@ public static function with(string $value): self */ public function withValue(string $value): self { - $obj = clone $this; - $obj['value'] = $value; + $self = clone $this; + $self['value'] = $value; - return $obj; + return $self; } } diff --git a/src/Files/FileUploadResponse.php b/src/Files/FileUploadResponse.php index 91efd8bc..65ba2ca4 100644 --- a/src/Files/FileUploadResponse.php +++ b/src/Files/FileUploadResponse.php @@ -303,35 +303,35 @@ public static function with( ?string $videoCodec = null, ?float $width = null, ): self { - $obj = new self; - - null !== $aiTags && $obj['aiTags'] = $aiTags; - null !== $audioCodec && $obj['audioCodec'] = $audioCodec; - null !== $bitRate && $obj['bitRate'] = $bitRate; - null !== $customCoordinates && $obj['customCoordinates'] = $customCoordinates; - null !== $customMetadata && $obj['customMetadata'] = $customMetadata; - null !== $description && $obj['description'] = $description; - null !== $duration && $obj['duration'] = $duration; - null !== $embeddedMetadata && $obj['embeddedMetadata'] = $embeddedMetadata; - null !== $extensionStatus && $obj['extensionStatus'] = $extensionStatus; - null !== $fileID && $obj['fileID'] = $fileID; - null !== $filePath && $obj['filePath'] = $filePath; - null !== $fileType && $obj['fileType'] = $fileType; - null !== $height && $obj['height'] = $height; - null !== $isPrivateFile && $obj['isPrivateFile'] = $isPrivateFile; - null !== $isPublished && $obj['isPublished'] = $isPublished; - null !== $metadata && $obj['metadata'] = $metadata; - null !== $name && $obj['name'] = $name; - null !== $selectedFieldsSchema && $obj['selectedFieldsSchema'] = $selectedFieldsSchema; - null !== $size && $obj['size'] = $size; - null !== $tags && $obj['tags'] = $tags; - null !== $thumbnailURL && $obj['thumbnailURL'] = $thumbnailURL; - null !== $url && $obj['url'] = $url; - null !== $versionInfo && $obj['versionInfo'] = $versionInfo; - null !== $videoCodec && $obj['videoCodec'] = $videoCodec; - null !== $width && $obj['width'] = $width; - - return $obj; + $self = new self; + + null !== $aiTags && $self['aiTags'] = $aiTags; + null !== $audioCodec && $self['audioCodec'] = $audioCodec; + null !== $bitRate && $self['bitRate'] = $bitRate; + null !== $customCoordinates && $self['customCoordinates'] = $customCoordinates; + null !== $customMetadata && $self['customMetadata'] = $customMetadata; + null !== $description && $self['description'] = $description; + null !== $duration && $self['duration'] = $duration; + null !== $embeddedMetadata && $self['embeddedMetadata'] = $embeddedMetadata; + null !== $extensionStatus && $self['extensionStatus'] = $extensionStatus; + null !== $fileID && $self['fileID'] = $fileID; + null !== $filePath && $self['filePath'] = $filePath; + null !== $fileType && $self['fileType'] = $fileType; + null !== $height && $self['height'] = $height; + null !== $isPrivateFile && $self['isPrivateFile'] = $isPrivateFile; + null !== $isPublished && $self['isPublished'] = $isPublished; + null !== $metadata && $self['metadata'] = $metadata; + null !== $name && $self['name'] = $name; + null !== $selectedFieldsSchema && $self['selectedFieldsSchema'] = $selectedFieldsSchema; + null !== $size && $self['size'] = $size; + null !== $tags && $self['tags'] = $tags; + null !== $thumbnailURL && $self['thumbnailURL'] = $thumbnailURL; + null !== $url && $self['url'] = $url; + null !== $versionInfo && $self['versionInfo'] = $versionInfo; + null !== $videoCodec && $self['videoCodec'] = $videoCodec; + null !== $width && $self['width'] = $width; + + return $self; } /** @@ -343,10 +343,10 @@ public static function with( */ public function withAITags(?array $aiTags): self { - $obj = clone $this; - $obj['aiTags'] = $aiTags; + $self = clone $this; + $self['aiTags'] = $aiTags; - return $obj; + return $self; } /** @@ -354,10 +354,10 @@ public function withAITags(?array $aiTags): self */ public function withAudioCodec(string $audioCodec): self { - $obj = clone $this; - $obj['audioCodec'] = $audioCodec; + $self = clone $this; + $self['audioCodec'] = $audioCodec; - return $obj; + return $self; } /** @@ -365,10 +365,10 @@ public function withAudioCodec(string $audioCodec): self */ public function withBitRate(int $bitRate): self { - $obj = clone $this; - $obj['bitRate'] = $bitRate; + $self = clone $this; + $self['bitRate'] = $bitRate; - return $obj; + return $self; } /** @@ -376,10 +376,10 @@ public function withBitRate(int $bitRate): self */ public function withCustomCoordinates(?string $customCoordinates): self { - $obj = clone $this; - $obj['customCoordinates'] = $customCoordinates; + $self = clone $this; + $self['customCoordinates'] = $customCoordinates; - return $obj; + return $self; } /** @@ -389,10 +389,10 @@ public function withCustomCoordinates(?string $customCoordinates): self */ public function withCustomMetadata(array $customMetadata): self { - $obj = clone $this; - $obj['customMetadata'] = $customMetadata; + $self = clone $this; + $self['customMetadata'] = $customMetadata; - return $obj; + return $self; } /** @@ -400,10 +400,10 @@ public function withCustomMetadata(array $customMetadata): self */ public function withDescription(string $description): self { - $obj = clone $this; - $obj['description'] = $description; + $self = clone $this; + $self['description'] = $description; - return $obj; + return $self; } /** @@ -411,10 +411,10 @@ public function withDescription(string $description): self */ public function withDuration(int $duration): self { - $obj = clone $this; - $obj['duration'] = $duration; + $self = clone $this; + $self['duration'] = $duration; - return $obj; + return $self; } /** @@ -424,10 +424,10 @@ public function withDuration(int $duration): self */ public function withEmbeddedMetadata(array $embeddedMetadata): self { - $obj = clone $this; - $obj['embeddedMetadata'] = $embeddedMetadata; + $self = clone $this; + $self['embeddedMetadata'] = $embeddedMetadata; - return $obj; + return $self; } /** @@ -449,10 +449,10 @@ public function withEmbeddedMetadata(array $embeddedMetadata): self public function withExtensionStatus( ExtensionStatus|array $extensionStatus ): self { - $obj = clone $this; - $obj['extensionStatus'] = $extensionStatus; + $self = clone $this; + $self['extensionStatus'] = $extensionStatus; - return $obj; + return $self; } /** @@ -460,10 +460,10 @@ public function withExtensionStatus( */ public function withFileID(string $fileID): self { - $obj = clone $this; - $obj['fileID'] = $fileID; + $self = clone $this; + $self['fileID'] = $fileID; - return $obj; + return $self; } /** @@ -471,10 +471,10 @@ public function withFileID(string $fileID): self */ public function withFilePath(string $filePath): self { - $obj = clone $this; - $obj['filePath'] = $filePath; + $self = clone $this; + $self['filePath'] = $filePath; - return $obj; + return $self; } /** @@ -482,10 +482,10 @@ public function withFilePath(string $filePath): self */ public function withFileType(string $fileType): self { - $obj = clone $this; - $obj['fileType'] = $fileType; + $self = clone $this; + $self['fileType'] = $fileType; - return $obj; + return $self; } /** @@ -493,10 +493,10 @@ public function withFileType(string $fileType): self */ public function withHeight(float $height): self { - $obj = clone $this; - $obj['height'] = $height; + $self = clone $this; + $self['height'] = $height; - return $obj; + return $self; } /** @@ -504,10 +504,10 @@ public function withHeight(float $height): self */ public function withIsPrivateFile(bool $isPrivateFile): self { - $obj = clone $this; - $obj['isPrivateFile'] = $isPrivateFile; + $self = clone $this; + $self['isPrivateFile'] = $isPrivateFile; - return $obj; + return $self; } /** @@ -515,10 +515,10 @@ public function withIsPrivateFile(bool $isPrivateFile): self */ public function withIsPublished(bool $isPublished): self { - $obj = clone $this; - $obj['isPublished'] = $isPublished; + $self = clone $this; + $self['isPublished'] = $isPublished; - return $obj; + return $self; } /** @@ -543,10 +543,10 @@ public function withIsPublished(bool $isPublished): self */ public function withMetadata(Metadata|array $metadata): self { - $obj = clone $this; - $obj['metadata'] = $metadata; + $self = clone $this; + $self['metadata'] = $metadata; - return $obj; + return $self; } /** @@ -554,10 +554,10 @@ public function withMetadata(Metadata|array $metadata): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -582,10 +582,10 @@ public function withName(string $name): self */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { - $obj = clone $this; - $obj['selectedFieldsSchema'] = $selectedFieldsSchema; + $self = clone $this; + $self['selectedFieldsSchema'] = $selectedFieldsSchema; - return $obj; + return $self; } /** @@ -593,10 +593,10 @@ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self */ public function withSize(float $size): self { - $obj = clone $this; - $obj['size'] = $size; + $self = clone $this; + $self['size'] = $size; - return $obj; + return $self; } /** @@ -606,10 +606,10 @@ public function withSize(float $size): self */ public function withTags(?array $tags): self { - $obj = clone $this; - $obj['tags'] = $tags; + $self = clone $this; + $self['tags'] = $tags; - return $obj; + return $self; } /** @@ -617,10 +617,10 @@ public function withTags(?array $tags): self */ public function withThumbnailURL(string $thumbnailURL): self { - $obj = clone $this; - $obj['thumbnailURL'] = $thumbnailURL; + $self = clone $this; + $self['thumbnailURL'] = $thumbnailURL; - return $obj; + return $self; } /** @@ -628,10 +628,10 @@ public function withThumbnailURL(string $thumbnailURL): self */ public function withURL(string $url): self { - $obj = clone $this; - $obj['url'] = $url; + $self = clone $this; + $self['url'] = $url; - return $obj; + return $self; } /** @@ -641,10 +641,10 @@ public function withURL(string $url): self */ public function withVersionInfo(VersionInfo|array $versionInfo): self { - $obj = clone $this; - $obj['versionInfo'] = $versionInfo; + $self = clone $this; + $self['versionInfo'] = $versionInfo; - return $obj; + return $self; } /** @@ -652,10 +652,10 @@ public function withVersionInfo(VersionInfo|array $versionInfo): self */ public function withVideoCodec(string $videoCodec): self { - $obj = clone $this; - $obj['videoCodec'] = $videoCodec; + $self = clone $this; + $self['videoCodec'] = $videoCodec; - return $obj; + return $self; } /** @@ -663,9 +663,9 @@ public function withVideoCodec(string $videoCodec): self */ public function withWidth(float $width): self { - $obj = clone $this; - $obj['width'] = $width; + $self = clone $this; + $self['width'] = $width; - return $obj; + return $self; } } diff --git a/src/Files/FileUploadResponse/AITag.php b/src/Files/FileUploadResponse/AITag.php index 8ec551e8..3a4845ea 100644 --- a/src/Files/FileUploadResponse/AITag.php +++ b/src/Files/FileUploadResponse/AITag.php @@ -51,13 +51,13 @@ public static function with( ?string $name = null, ?string $source = null ): self { - $obj = new self; + $self = new self; - null !== $confidence && $obj['confidence'] = $confidence; - null !== $name && $obj['name'] = $name; - null !== $source && $obj['source'] = $source; + null !== $confidence && $self['confidence'] = $confidence; + null !== $name && $self['name'] = $name; + null !== $source && $self['source'] = $source; - return $obj; + return $self; } /** @@ -65,10 +65,10 @@ public static function with( */ public function withConfidence(float $confidence): self { - $obj = clone $this; - $obj['confidence'] = $confidence; + $self = clone $this; + $self['confidence'] = $confidence; - return $obj; + return $self; } /** @@ -76,10 +76,10 @@ public function withConfidence(float $confidence): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -87,9 +87,9 @@ public function withName(string $name): self */ public function withSource(string $source): self { - $obj = clone $this; - $obj['source'] = $source; + $self = clone $this; + $self['source'] = $source; - return $obj; + return $self; } } diff --git a/src/Files/FileUploadResponse/ExtensionStatus.php b/src/Files/FileUploadResponse/ExtensionStatus.php index b33f98ae..a16e891c 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Files/FileUploadResponse/ExtensionStatus.php @@ -70,14 +70,14 @@ public static function with( GoogleAutoTagging|string|null $googleAutoTagging = null, RemoveBg|string|null $removeBg = null, ): self { - $obj = new self; + $self = new self; - null !== $aiAutoDescription && $obj['aiAutoDescription'] = $aiAutoDescription; - null !== $awsAutoTagging && $obj['awsAutoTagging'] = $awsAutoTagging; - null !== $googleAutoTagging && $obj['googleAutoTagging'] = $googleAutoTagging; - null !== $removeBg && $obj['removeBg'] = $removeBg; + null !== $aiAutoDescription && $self['aiAutoDescription'] = $aiAutoDescription; + null !== $awsAutoTagging && $self['awsAutoTagging'] = $awsAutoTagging; + null !== $googleAutoTagging && $self['googleAutoTagging'] = $googleAutoTagging; + null !== $removeBg && $self['removeBg'] = $removeBg; - return $obj; + return $self; } /** @@ -86,10 +86,10 @@ public static function with( public function withAIAutoDescription( AIAutoDescription|string $aiAutoDescription ): self { - $obj = clone $this; - $obj['aiAutoDescription'] = $aiAutoDescription; + $self = clone $this; + $self['aiAutoDescription'] = $aiAutoDescription; - return $obj; + return $self; } /** @@ -98,10 +98,10 @@ public function withAIAutoDescription( public function withAwsAutoTagging( AwsAutoTagging|string $awsAutoTagging ): self { - $obj = clone $this; - $obj['awsAutoTagging'] = $awsAutoTagging; + $self = clone $this; + $self['awsAutoTagging'] = $awsAutoTagging; - return $obj; + return $self; } /** @@ -110,10 +110,10 @@ public function withAwsAutoTagging( public function withGoogleAutoTagging( GoogleAutoTagging|string $googleAutoTagging ): self { - $obj = clone $this; - $obj['googleAutoTagging'] = $googleAutoTagging; + $self = clone $this; + $self['googleAutoTagging'] = $googleAutoTagging; - return $obj; + return $self; } /** @@ -121,9 +121,9 @@ public function withGoogleAutoTagging( */ public function withRemoveBg(RemoveBg|string $removeBg): self { - $obj = clone $this; - $obj['removeBg'] = $removeBg; + $self = clone $this; + $self['removeBg'] = $removeBg; - return $obj; + return $self; } } diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema.php b/src/Files/FileUploadResponse/SelectedFieldsSchema.php index 3b2a31fd..921dc0dc 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema.php @@ -137,21 +137,21 @@ public static function with( ?array $selectOptions = null, ?bool $selectOptionsTruncated = null, ): self { - $obj = new self; + $self = new self; - $obj['type'] = $type; + $self['type'] = $type; - null !== $defaultValue && $obj['defaultValue'] = $defaultValue; - null !== $isValueRequired && $obj['isValueRequired'] = $isValueRequired; - null !== $maxLength && $obj['maxLength'] = $maxLength; - null !== $maxValue && $obj['maxValue'] = $maxValue; - null !== $minLength && $obj['minLength'] = $minLength; - null !== $minValue && $obj['minValue'] = $minValue; - null !== $readOnly && $obj['readOnly'] = $readOnly; - null !== $selectOptions && $obj['selectOptions'] = $selectOptions; - null !== $selectOptionsTruncated && $obj['selectOptionsTruncated'] = $selectOptionsTruncated; + null !== $defaultValue && $self['defaultValue'] = $defaultValue; + null !== $isValueRequired && $self['isValueRequired'] = $isValueRequired; + null !== $maxLength && $self['maxLength'] = $maxLength; + null !== $maxValue && $self['maxValue'] = $maxValue; + null !== $minLength && $self['minLength'] = $minLength; + null !== $minValue && $self['minValue'] = $minValue; + null !== $readOnly && $self['readOnly'] = $readOnly; + null !== $selectOptions && $self['selectOptions'] = $selectOptions; + null !== $selectOptionsTruncated && $self['selectOptionsTruncated'] = $selectOptionsTruncated; - return $obj; + return $self; } /** @@ -161,10 +161,10 @@ public static function with( */ public function withType(Type|string $type): self { - $obj = clone $this; - $obj['type'] = $type; + $self = clone $this; + $self['type'] = $type; - return $obj; + return $self; } /** @@ -175,10 +175,10 @@ public function withType(Type|string $type): self public function withDefaultValue( string|float|bool|array $defaultValue ): self { - $obj = clone $this; - $obj['defaultValue'] = $defaultValue; + $self = clone $this; + $self['defaultValue'] = $defaultValue; - return $obj; + return $self; } /** @@ -186,10 +186,10 @@ public function withDefaultValue( */ public function withIsValueRequired(bool $isValueRequired): self { - $obj = clone $this; - $obj['isValueRequired'] = $isValueRequired; + $self = clone $this; + $self['isValueRequired'] = $isValueRequired; - return $obj; + return $self; } /** @@ -197,10 +197,10 @@ public function withIsValueRequired(bool $isValueRequired): self */ public function withMaxLength(float $maxLength): self { - $obj = clone $this; - $obj['maxLength'] = $maxLength; + $self = clone $this; + $self['maxLength'] = $maxLength; - return $obj; + return $self; } /** @@ -208,10 +208,10 @@ public function withMaxLength(float $maxLength): self */ public function withMaxValue(string|float $maxValue): self { - $obj = clone $this; - $obj['maxValue'] = $maxValue; + $self = clone $this; + $self['maxValue'] = $maxValue; - return $obj; + return $self; } /** @@ -219,10 +219,10 @@ public function withMaxValue(string|float $maxValue): self */ public function withMinLength(float $minLength): self { - $obj = clone $this; - $obj['minLength'] = $minLength; + $self = clone $this; + $self['minLength'] = $minLength; - return $obj; + return $self; } /** @@ -230,10 +230,10 @@ public function withMinLength(float $minLength): self */ public function withMinValue(string|float $minValue): self { - $obj = clone $this; - $obj['minValue'] = $minValue; + $self = clone $this; + $self['minValue'] = $minValue; - return $obj; + return $self; } /** @@ -241,10 +241,10 @@ public function withMinValue(string|float $minValue): self */ public function withReadOnly(bool $readOnly): self { - $obj = clone $this; - $obj['readOnly'] = $readOnly; + $self = clone $this; + $self['readOnly'] = $readOnly; - return $obj; + return $self; } /** @@ -254,10 +254,10 @@ public function withReadOnly(bool $readOnly): self */ public function withSelectOptions(array $selectOptions): self { - $obj = clone $this; - $obj['selectOptions'] = $selectOptions; + $self = clone $this; + $self['selectOptions'] = $selectOptions; - return $obj; + return $self; } /** @@ -266,9 +266,9 @@ public function withSelectOptions(array $selectOptions): self public function withSelectOptionsTruncated( bool $selectOptionsTruncated ): self { - $obj = clone $this; - $obj['selectOptionsTruncated'] = $selectOptionsTruncated; + $self = clone $this; + $self['selectOptionsTruncated'] = $selectOptionsTruncated; - return $obj; + return $self; } } diff --git a/src/Files/FileUploadResponse/VersionInfo.php b/src/Files/FileUploadResponse/VersionInfo.php index 2f97b876..8df22100 100644 --- a/src/Files/FileUploadResponse/VersionInfo.php +++ b/src/Files/FileUploadResponse/VersionInfo.php @@ -42,12 +42,12 @@ public function __construct() */ public static function with(?string $id = null, ?string $name = null): self { - $obj = new self; + $self = new self; - null !== $id && $obj['id'] = $id; - null !== $name && $obj['name'] = $name; + null !== $id && $self['id'] = $id; + null !== $name && $self['name'] = $name; - return $obj; + return $self; } /** @@ -55,10 +55,10 @@ public static function with(?string $id = null, ?string $name = null): self */ public function withID(string $id): self { - $obj = clone $this; - $obj['id'] = $id; + $self = clone $this; + $self['id'] = $id; - return $obj; + return $self; } /** @@ -66,9 +66,9 @@ public function withID(string $id): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } } diff --git a/src/Files/Folder.php b/src/Files/Folder.php index beccf343..768e12a3 100644 --- a/src/Files/Folder.php +++ b/src/Files/Folder.php @@ -82,16 +82,16 @@ public static function with( Type|string|null $type = null, ?\DateTimeInterface $updatedAt = null, ): self { - $obj = new self; + $self = new self; - null !== $createdAt && $obj['createdAt'] = $createdAt; - null !== $folderID && $obj['folderID'] = $folderID; - null !== $folderPath && $obj['folderPath'] = $folderPath; - null !== $name && $obj['name'] = $name; - null !== $type && $obj['type'] = $type; - null !== $updatedAt && $obj['updatedAt'] = $updatedAt; + null !== $createdAt && $self['createdAt'] = $createdAt; + null !== $folderID && $self['folderID'] = $folderID; + null !== $folderPath && $self['folderPath'] = $folderPath; + null !== $name && $self['name'] = $name; + null !== $type && $self['type'] = $type; + null !== $updatedAt && $self['updatedAt'] = $updatedAt; - return $obj; + return $self; } /** @@ -99,10 +99,10 @@ public static function with( */ public function withCreatedAt(\DateTimeInterface $createdAt): self { - $obj = clone $this; - $obj['createdAt'] = $createdAt; + $self = clone $this; + $self['createdAt'] = $createdAt; - return $obj; + return $self; } /** @@ -110,10 +110,10 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self */ public function withFolderID(string $folderID): self { - $obj = clone $this; - $obj['folderID'] = $folderID; + $self = clone $this; + $self['folderID'] = $folderID; - return $obj; + return $self; } /** @@ -121,10 +121,10 @@ public function withFolderID(string $folderID): self */ public function withFolderPath(string $folderPath): self { - $obj = clone $this; - $obj['folderPath'] = $folderPath; + $self = clone $this; + $self['folderPath'] = $folderPath; - return $obj; + return $self; } /** @@ -132,10 +132,10 @@ public function withFolderPath(string $folderPath): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -145,10 +145,10 @@ public function withName(string $name): self */ public function withType(Type|string $type): self { - $obj = clone $this; - $obj['type'] = $type; + $self = clone $this; + $self['type'] = $type; - return $obj; + return $self; } /** @@ -156,9 +156,9 @@ public function withType(Type|string $type): self */ public function withUpdatedAt(\DateTimeInterface $updatedAt): self { - $obj = clone $this; - $obj['updatedAt'] = $updatedAt; + $self = clone $this; + $self['updatedAt'] = $updatedAt; - return $obj; + return $self; } } diff --git a/src/Files/Metadata.php b/src/Files/Metadata.php index fb622405..691ab256 100644 --- a/src/Files/Metadata.php +++ b/src/Files/Metadata.php @@ -154,24 +154,24 @@ public static function with( ?string $videoCodec = null, ?int $width = null, ): self { - $obj = new self; - - null !== $audioCodec && $obj['audioCodec'] = $audioCodec; - null !== $bitRate && $obj['bitRate'] = $bitRate; - null !== $density && $obj['density'] = $density; - null !== $duration && $obj['duration'] = $duration; - null !== $exif && $obj['exif'] = $exif; - null !== $format && $obj['format'] = $format; - null !== $hasColorProfile && $obj['hasColorProfile'] = $hasColorProfile; - null !== $hasTransparency && $obj['hasTransparency'] = $hasTransparency; - null !== $height && $obj['height'] = $height; - null !== $pHash && $obj['pHash'] = $pHash; - null !== $quality && $obj['quality'] = $quality; - null !== $size && $obj['size'] = $size; - null !== $videoCodec && $obj['videoCodec'] = $videoCodec; - null !== $width && $obj['width'] = $width; - - return $obj; + $self = new self; + + null !== $audioCodec && $self['audioCodec'] = $audioCodec; + null !== $bitRate && $self['bitRate'] = $bitRate; + null !== $density && $self['density'] = $density; + null !== $duration && $self['duration'] = $duration; + null !== $exif && $self['exif'] = $exif; + null !== $format && $self['format'] = $format; + null !== $hasColorProfile && $self['hasColorProfile'] = $hasColorProfile; + null !== $hasTransparency && $self['hasTransparency'] = $hasTransparency; + null !== $height && $self['height'] = $height; + null !== $pHash && $self['pHash'] = $pHash; + null !== $quality && $self['quality'] = $quality; + null !== $size && $self['size'] = $size; + null !== $videoCodec && $self['videoCodec'] = $videoCodec; + null !== $width && $self['width'] = $width; + + return $self; } /** @@ -179,10 +179,10 @@ public static function with( */ public function withAudioCodec(string $audioCodec): self { - $obj = clone $this; - $obj['audioCodec'] = $audioCodec; + $self = clone $this; + $self['audioCodec'] = $audioCodec; - return $obj; + return $self; } /** @@ -190,10 +190,10 @@ public function withAudioCodec(string $audioCodec): self */ public function withBitRate(int $bitRate): self { - $obj = clone $this; - $obj['bitRate'] = $bitRate; + $self = clone $this; + $self['bitRate'] = $bitRate; - return $obj; + return $self; } /** @@ -201,10 +201,10 @@ public function withBitRate(int $bitRate): self */ public function withDensity(int $density): self { - $obj = clone $this; - $obj['density'] = $density; + $self = clone $this; + $self['density'] = $density; - return $obj; + return $self; } /** @@ -212,10 +212,10 @@ public function withDensity(int $density): self */ public function withDuration(int $duration): self { - $obj = clone $this; - $obj['duration'] = $duration; + $self = clone $this; + $self['duration'] = $duration; - return $obj; + return $self; } /** @@ -230,10 +230,10 @@ public function withDuration(int $duration): self */ public function withExif(Exif|array $exif): self { - $obj = clone $this; - $obj['exif'] = $exif; + $self = clone $this; + $self['exif'] = $exif; - return $obj; + return $self; } /** @@ -241,10 +241,10 @@ public function withExif(Exif|array $exif): self */ public function withFormat(string $format): self { - $obj = clone $this; - $obj['format'] = $format; + $self = clone $this; + $self['format'] = $format; - return $obj; + return $self; } /** @@ -252,10 +252,10 @@ public function withFormat(string $format): self */ public function withHasColorProfile(bool $hasColorProfile): self { - $obj = clone $this; - $obj['hasColorProfile'] = $hasColorProfile; + $self = clone $this; + $self['hasColorProfile'] = $hasColorProfile; - return $obj; + return $self; } /** @@ -263,10 +263,10 @@ public function withHasColorProfile(bool $hasColorProfile): self */ public function withHasTransparency(bool $hasTransparency): self { - $obj = clone $this; - $obj['hasTransparency'] = $hasTransparency; + $self = clone $this; + $self['hasTransparency'] = $hasTransparency; - return $obj; + return $self; } /** @@ -274,10 +274,10 @@ public function withHasTransparency(bool $hasTransparency): self */ public function withHeight(int $height): self { - $obj = clone $this; - $obj['height'] = $height; + $self = clone $this; + $self['height'] = $height; - return $obj; + return $self; } /** @@ -285,10 +285,10 @@ public function withHeight(int $height): self */ public function withPHash(string $pHash): self { - $obj = clone $this; - $obj['pHash'] = $pHash; + $self = clone $this; + $self['pHash'] = $pHash; - return $obj; + return $self; } /** @@ -296,10 +296,10 @@ public function withPHash(string $pHash): self */ public function withQuality(int $quality): self { - $obj = clone $this; - $obj['quality'] = $quality; + $self = clone $this; + $self['quality'] = $quality; - return $obj; + return $self; } /** @@ -307,10 +307,10 @@ public function withQuality(int $quality): self */ public function withSize(int $size): self { - $obj = clone $this; - $obj['size'] = $size; + $self = clone $this; + $self['size'] = $size; - return $obj; + return $self; } /** @@ -318,10 +318,10 @@ public function withSize(int $size): self */ public function withVideoCodec(string $videoCodec): self { - $obj = clone $this; - $obj['videoCodec'] = $videoCodec; + $self = clone $this; + $self['videoCodec'] = $videoCodec; - return $obj; + return $self; } /** @@ -329,9 +329,9 @@ public function withVideoCodec(string $videoCodec): self */ public function withWidth(int $width): self { - $obj = clone $this; - $obj['width'] = $width; + $self = clone $this; + $self['width'] = $width; - return $obj; + return $self; } } diff --git a/src/Files/Metadata/Exif.php b/src/Files/Metadata/Exif.php index f96f1473..9fef0dd8 100644 --- a/src/Files/Metadata/Exif.php +++ b/src/Files/Metadata/Exif.php @@ -134,16 +134,16 @@ public static function with( ?array $makernote = null, Thumbnail|array|null $thumbnail = null, ): self { - $obj = new self; + $self = new self; - null !== $exif && $obj['exif'] = $exif; - null !== $gps && $obj['gps'] = $gps; - null !== $image && $obj['image'] = $image; - null !== $interoperability && $obj['interoperability'] = $interoperability; - null !== $makernote && $obj['makernote'] = $makernote; - null !== $thumbnail && $obj['thumbnail'] = $thumbnail; + null !== $exif && $self['exif'] = $exif; + null !== $gps && $self['gps'] = $gps; + null !== $image && $self['image'] = $image; + null !== $interoperability && $self['interoperability'] = $interoperability; + null !== $makernote && $self['makernote'] = $makernote; + null !== $thumbnail && $self['thumbnail'] = $thumbnail; - return $obj; + return $self; } /** @@ -181,10 +181,10 @@ public static function with( public function withExif( Exif\Exif|array $exif ): self { - $obj = clone $this; - $obj['exif'] = $exif; + $self = clone $this; + $self['exif'] = $exif; - return $obj; + return $self; } /** @@ -194,10 +194,10 @@ public function withExif( */ public function withGps(Gps|array $gps): self { - $obj = clone $this; - $obj['gps'] = $gps; + $self = clone $this; + $self['gps'] = $gps; - return $obj; + return $self; } /** @@ -219,10 +219,10 @@ public function withGps(Gps|array $gps): self */ public function withImage(Image|array $image): self { - $obj = clone $this; - $obj['image'] = $image; + $self = clone $this; + $self['image'] = $image; - return $obj; + return $self; } /** @@ -235,10 +235,10 @@ public function withImage(Image|array $image): self public function withInteroperability( Interoperability|array $interoperability ): self { - $obj = clone $this; - $obj['interoperability'] = $interoperability; + $self = clone $this; + $self['interoperability'] = $interoperability; - return $obj; + return $self; } /** @@ -246,10 +246,10 @@ public function withInteroperability( */ public function withMakernote(array $makernote): self { - $obj = clone $this; - $obj['makernote'] = $makernote; + $self = clone $this; + $self['makernote'] = $makernote; - return $obj; + return $self; } /** @@ -266,9 +266,9 @@ public function withMakernote(array $makernote): self */ public function withThumbnail(Thumbnail|array $thumbnail): self { - $obj = clone $this; - $obj['thumbnail'] = $thumbnail; + $self = clone $this; + $self['thumbnail'] = $thumbnail; - return $obj; + return $self; } } diff --git a/src/Files/Metadata/Exif/Exif.php b/src/Files/Metadata/Exif/Exif.php index d332f322..68bcf4d4 100644 --- a/src/Files/Metadata/Exif/Exif.php +++ b/src/Files/Metadata/Exif/Exif.php @@ -161,246 +161,246 @@ public static function with( ?string $subSecTime = null, ?int $whiteBalance = null, ): self { - $obj = new self; - - null !== $apertureValue && $obj['apertureValue'] = $apertureValue; - null !== $colorSpace && $obj['colorSpace'] = $colorSpace; - null !== $createDate && $obj['createDate'] = $createDate; - null !== $customRendered && $obj['customRendered'] = $customRendered; - null !== $dateTimeOriginal && $obj['dateTimeOriginal'] = $dateTimeOriginal; - null !== $exifImageHeight && $obj['exifImageHeight'] = $exifImageHeight; - null !== $exifImageWidth && $obj['exifImageWidth'] = $exifImageWidth; - null !== $exifVersion && $obj['exifVersion'] = $exifVersion; - null !== $exposureCompensation && $obj['exposureCompensation'] = $exposureCompensation; - null !== $exposureMode && $obj['exposureMode'] = $exposureMode; - null !== $exposureProgram && $obj['exposureProgram'] = $exposureProgram; - null !== $exposureTime && $obj['exposureTime'] = $exposureTime; - null !== $flash && $obj['flash'] = $flash; - null !== $flashpixVersion && $obj['flashpixVersion'] = $flashpixVersion; - null !== $fNumber && $obj['fNumber'] = $fNumber; - null !== $focalLength && $obj['focalLength'] = $focalLength; - null !== $focalPlaneResolutionUnit && $obj['focalPlaneResolutionUnit'] = $focalPlaneResolutionUnit; - null !== $focalPlaneXResolution && $obj['focalPlaneXResolution'] = $focalPlaneXResolution; - null !== $focalPlaneYResolution && $obj['focalPlaneYResolution'] = $focalPlaneYResolution; - null !== $interopOffset && $obj['interopOffset'] = $interopOffset; - null !== $iso && $obj['iso'] = $iso; - null !== $meteringMode && $obj['meteringMode'] = $meteringMode; - null !== $sceneCaptureType && $obj['sceneCaptureType'] = $sceneCaptureType; - null !== $shutterSpeedValue && $obj['shutterSpeedValue'] = $shutterSpeedValue; - null !== $subSecTime && $obj['subSecTime'] = $subSecTime; - null !== $whiteBalance && $obj['whiteBalance'] = $whiteBalance; - - return $obj; + $self = new self; + + null !== $apertureValue && $self['apertureValue'] = $apertureValue; + null !== $colorSpace && $self['colorSpace'] = $colorSpace; + null !== $createDate && $self['createDate'] = $createDate; + null !== $customRendered && $self['customRendered'] = $customRendered; + null !== $dateTimeOriginal && $self['dateTimeOriginal'] = $dateTimeOriginal; + null !== $exifImageHeight && $self['exifImageHeight'] = $exifImageHeight; + null !== $exifImageWidth && $self['exifImageWidth'] = $exifImageWidth; + null !== $exifVersion && $self['exifVersion'] = $exifVersion; + null !== $exposureCompensation && $self['exposureCompensation'] = $exposureCompensation; + null !== $exposureMode && $self['exposureMode'] = $exposureMode; + null !== $exposureProgram && $self['exposureProgram'] = $exposureProgram; + null !== $exposureTime && $self['exposureTime'] = $exposureTime; + null !== $flash && $self['flash'] = $flash; + null !== $flashpixVersion && $self['flashpixVersion'] = $flashpixVersion; + null !== $fNumber && $self['fNumber'] = $fNumber; + null !== $focalLength && $self['focalLength'] = $focalLength; + null !== $focalPlaneResolutionUnit && $self['focalPlaneResolutionUnit'] = $focalPlaneResolutionUnit; + null !== $focalPlaneXResolution && $self['focalPlaneXResolution'] = $focalPlaneXResolution; + null !== $focalPlaneYResolution && $self['focalPlaneYResolution'] = $focalPlaneYResolution; + null !== $interopOffset && $self['interopOffset'] = $interopOffset; + null !== $iso && $self['iso'] = $iso; + null !== $meteringMode && $self['meteringMode'] = $meteringMode; + null !== $sceneCaptureType && $self['sceneCaptureType'] = $sceneCaptureType; + null !== $shutterSpeedValue && $self['shutterSpeedValue'] = $shutterSpeedValue; + null !== $subSecTime && $self['subSecTime'] = $subSecTime; + null !== $whiteBalance && $self['whiteBalance'] = $whiteBalance; + + return $self; } public function withApertureValue(float $apertureValue): self { - $obj = clone $this; - $obj['apertureValue'] = $apertureValue; + $self = clone $this; + $self['apertureValue'] = $apertureValue; - return $obj; + return $self; } public function withColorSpace(int $colorSpace): self { - $obj = clone $this; - $obj['colorSpace'] = $colorSpace; + $self = clone $this; + $self['colorSpace'] = $colorSpace; - return $obj; + return $self; } public function withCreateDate(string $createDate): self { - $obj = clone $this; - $obj['createDate'] = $createDate; + $self = clone $this; + $self['createDate'] = $createDate; - return $obj; + return $self; } public function withCustomRendered(int $customRendered): self { - $obj = clone $this; - $obj['customRendered'] = $customRendered; + $self = clone $this; + $self['customRendered'] = $customRendered; - return $obj; + return $self; } public function withDateTimeOriginal(string $dateTimeOriginal): self { - $obj = clone $this; - $obj['dateTimeOriginal'] = $dateTimeOriginal; + $self = clone $this; + $self['dateTimeOriginal'] = $dateTimeOriginal; - return $obj; + return $self; } public function withExifImageHeight(int $exifImageHeight): self { - $obj = clone $this; - $obj['exifImageHeight'] = $exifImageHeight; + $self = clone $this; + $self['exifImageHeight'] = $exifImageHeight; - return $obj; + return $self; } public function withExifImageWidth(int $exifImageWidth): self { - $obj = clone $this; - $obj['exifImageWidth'] = $exifImageWidth; + $self = clone $this; + $self['exifImageWidth'] = $exifImageWidth; - return $obj; + return $self; } public function withExifVersion(string $exifVersion): self { - $obj = clone $this; - $obj['exifVersion'] = $exifVersion; + $self = clone $this; + $self['exifVersion'] = $exifVersion; - return $obj; + return $self; } public function withExposureCompensation(float $exposureCompensation): self { - $obj = clone $this; - $obj['exposureCompensation'] = $exposureCompensation; + $self = clone $this; + $self['exposureCompensation'] = $exposureCompensation; - return $obj; + return $self; } public function withExposureMode(int $exposureMode): self { - $obj = clone $this; - $obj['exposureMode'] = $exposureMode; + $self = clone $this; + $self['exposureMode'] = $exposureMode; - return $obj; + return $self; } public function withExposureProgram(int $exposureProgram): self { - $obj = clone $this; - $obj['exposureProgram'] = $exposureProgram; + $self = clone $this; + $self['exposureProgram'] = $exposureProgram; - return $obj; + return $self; } public function withExposureTime(float $exposureTime): self { - $obj = clone $this; - $obj['exposureTime'] = $exposureTime; + $self = clone $this; + $self['exposureTime'] = $exposureTime; - return $obj; + return $self; } public function withFlash(int $flash): self { - $obj = clone $this; - $obj['flash'] = $flash; + $self = clone $this; + $self['flash'] = $flash; - return $obj; + return $self; } public function withFlashpixVersion(string $flashpixVersion): self { - $obj = clone $this; - $obj['flashpixVersion'] = $flashpixVersion; + $self = clone $this; + $self['flashpixVersion'] = $flashpixVersion; - return $obj; + return $self; } public function withFNumber(float $fNumber): self { - $obj = clone $this; - $obj['fNumber'] = $fNumber; + $self = clone $this; + $self['fNumber'] = $fNumber; - return $obj; + return $self; } public function withFocalLength(int $focalLength): self { - $obj = clone $this; - $obj['focalLength'] = $focalLength; + $self = clone $this; + $self['focalLength'] = $focalLength; - return $obj; + return $self; } public function withFocalPlaneResolutionUnit( int $focalPlaneResolutionUnit ): self { - $obj = clone $this; - $obj['focalPlaneResolutionUnit'] = $focalPlaneResolutionUnit; + $self = clone $this; + $self['focalPlaneResolutionUnit'] = $focalPlaneResolutionUnit; - return $obj; + return $self; } public function withFocalPlaneXResolution( float $focalPlaneXResolution ): self { - $obj = clone $this; - $obj['focalPlaneXResolution'] = $focalPlaneXResolution; + $self = clone $this; + $self['focalPlaneXResolution'] = $focalPlaneXResolution; - return $obj; + return $self; } public function withFocalPlaneYResolution( float $focalPlaneYResolution ): self { - $obj = clone $this; - $obj['focalPlaneYResolution'] = $focalPlaneYResolution; + $self = clone $this; + $self['focalPlaneYResolution'] = $focalPlaneYResolution; - return $obj; + return $self; } public function withInteropOffset(int $interopOffset): self { - $obj = clone $this; - $obj['interopOffset'] = $interopOffset; + $self = clone $this; + $self['interopOffset'] = $interopOffset; - return $obj; + return $self; } public function withISO(int $iso): self { - $obj = clone $this; - $obj['iso'] = $iso; + $self = clone $this; + $self['iso'] = $iso; - return $obj; + return $self; } public function withMeteringMode(int $meteringMode): self { - $obj = clone $this; - $obj['meteringMode'] = $meteringMode; + $self = clone $this; + $self['meteringMode'] = $meteringMode; - return $obj; + return $self; } public function withSceneCaptureType(int $sceneCaptureType): self { - $obj = clone $this; - $obj['sceneCaptureType'] = $sceneCaptureType; + $self = clone $this; + $self['sceneCaptureType'] = $sceneCaptureType; - return $obj; + return $self; } public function withShutterSpeedValue(float $shutterSpeedValue): self { - $obj = clone $this; - $obj['shutterSpeedValue'] = $shutterSpeedValue; + $self = clone $this; + $self['shutterSpeedValue'] = $shutterSpeedValue; - return $obj; + return $self; } public function withSubSecTime(string $subSecTime): self { - $obj = clone $this; - $obj['subSecTime'] = $subSecTime; + $self = clone $this; + $self['subSecTime'] = $subSecTime; - return $obj; + return $self; } public function withWhiteBalance(int $whiteBalance): self { - $obj = clone $this; - $obj['whiteBalance'] = $whiteBalance; + $self = clone $this; + $self['whiteBalance'] = $whiteBalance; - return $obj; + return $self; } } diff --git a/src/Files/Metadata/Exif/Gps.php b/src/Files/Metadata/Exif/Gps.php index e3565801..df1828ef 100644 --- a/src/Files/Metadata/Exif/Gps.php +++ b/src/Files/Metadata/Exif/Gps.php @@ -36,11 +36,11 @@ public function __construct() */ public static function with(?array $gpsVersionID = null): self { - $obj = new self; + $self = new self; - null !== $gpsVersionID && $obj['gpsVersionID'] = $gpsVersionID; + null !== $gpsVersionID && $self['gpsVersionID'] = $gpsVersionID; - return $obj; + return $self; } /** @@ -48,9 +48,9 @@ public static function with(?array $gpsVersionID = null): self */ public function withGpsVersionID(array $gpsVersionID): self { - $obj = clone $this; - $obj['gpsVersionID'] = $gpsVersionID; + $self = clone $this; + $self['gpsVersionID'] = $gpsVersionID; - return $obj; + return $self; } } diff --git a/src/Files/Metadata/Exif/Image.php b/src/Files/Metadata/Exif/Image.php index 8c298152..8eb0bb24 100644 --- a/src/Files/Metadata/Exif/Image.php +++ b/src/Files/Metadata/Exif/Image.php @@ -86,108 +86,108 @@ public static function with( ?int $yCbCrPositioning = null, ?int $yResolution = null, ): self { - $obj = new self; - - null !== $exifOffset && $obj['exifOffset'] = $exifOffset; - null !== $gpsInfo && $obj['gpsInfo'] = $gpsInfo; - null !== $make && $obj['make'] = $make; - null !== $model && $obj['model'] = $model; - null !== $modifyDate && $obj['modifyDate'] = $modifyDate; - null !== $orientation && $obj['orientation'] = $orientation; - null !== $resolutionUnit && $obj['resolutionUnit'] = $resolutionUnit; - null !== $software && $obj['software'] = $software; - null !== $xResolution && $obj['xResolution'] = $xResolution; - null !== $yCbCrPositioning && $obj['yCbCrPositioning'] = $yCbCrPositioning; - null !== $yResolution && $obj['yResolution'] = $yResolution; - - return $obj; + $self = new self; + + null !== $exifOffset && $self['exifOffset'] = $exifOffset; + null !== $gpsInfo && $self['gpsInfo'] = $gpsInfo; + null !== $make && $self['make'] = $make; + null !== $model && $self['model'] = $model; + null !== $modifyDate && $self['modifyDate'] = $modifyDate; + null !== $orientation && $self['orientation'] = $orientation; + null !== $resolutionUnit && $self['resolutionUnit'] = $resolutionUnit; + null !== $software && $self['software'] = $software; + null !== $xResolution && $self['xResolution'] = $xResolution; + null !== $yCbCrPositioning && $self['yCbCrPositioning'] = $yCbCrPositioning; + null !== $yResolution && $self['yResolution'] = $yResolution; + + return $self; } public function withExifOffset(int $exifOffset): self { - $obj = clone $this; - $obj['exifOffset'] = $exifOffset; + $self = clone $this; + $self['exifOffset'] = $exifOffset; - return $obj; + return $self; } public function withGpsInfo(int $gpsInfo): self { - $obj = clone $this; - $obj['gpsInfo'] = $gpsInfo; + $self = clone $this; + $self['gpsInfo'] = $gpsInfo; - return $obj; + return $self; } public function withMake(string $make): self { - $obj = clone $this; - $obj['make'] = $make; + $self = clone $this; + $self['make'] = $make; - return $obj; + return $self; } public function withModel(string $model): self { - $obj = clone $this; - $obj['model'] = $model; + $self = clone $this; + $self['model'] = $model; - return $obj; + return $self; } public function withModifyDate(string $modifyDate): self { - $obj = clone $this; - $obj['modifyDate'] = $modifyDate; + $self = clone $this; + $self['modifyDate'] = $modifyDate; - return $obj; + return $self; } public function withOrientation(int $orientation): self { - $obj = clone $this; - $obj['orientation'] = $orientation; + $self = clone $this; + $self['orientation'] = $orientation; - return $obj; + return $self; } public function withResolutionUnit(int $resolutionUnit): self { - $obj = clone $this; - $obj['resolutionUnit'] = $resolutionUnit; + $self = clone $this; + $self['resolutionUnit'] = $resolutionUnit; - return $obj; + return $self; } public function withSoftware(string $software): self { - $obj = clone $this; - $obj['software'] = $software; + $self = clone $this; + $self['software'] = $software; - return $obj; + return $self; } public function withXResolution(int $xResolution): self { - $obj = clone $this; - $obj['xResolution'] = $xResolution; + $self = clone $this; + $self['xResolution'] = $xResolution; - return $obj; + return $self; } public function withYCbCrPositioning(int $yCbCrPositioning): self { - $obj = clone $this; - $obj['yCbCrPositioning'] = $yCbCrPositioning; + $self = clone $this; + $self['yCbCrPositioning'] = $yCbCrPositioning; - return $obj; + return $self; } public function withYResolution(int $yResolution): self { - $obj = clone $this; - $obj['yResolution'] = $yResolution; + $self = clone $this; + $self['yResolution'] = $yResolution; - return $obj; + return $self; } } diff --git a/src/Files/Metadata/Exif/Interoperability.php b/src/Files/Metadata/Exif/Interoperability.php index baa352c7..d47a2f28 100644 --- a/src/Files/Metadata/Exif/Interoperability.php +++ b/src/Files/Metadata/Exif/Interoperability.php @@ -40,27 +40,27 @@ public static function with( ?string $interopIndex = null, ?string $interopVersion = null ): self { - $obj = new self; + $self = new self; - null !== $interopIndex && $obj['interopIndex'] = $interopIndex; - null !== $interopVersion && $obj['interopVersion'] = $interopVersion; + null !== $interopIndex && $self['interopIndex'] = $interopIndex; + null !== $interopVersion && $self['interopVersion'] = $interopVersion; - return $obj; + return $self; } public function withInteropIndex(string $interopIndex): self { - $obj = clone $this; - $obj['interopIndex'] = $interopIndex; + $self = clone $this; + $self['interopIndex'] = $interopIndex; - return $obj; + return $self; } public function withInteropVersion(string $interopVersion): self { - $obj = clone $this; - $obj['interopVersion'] = $interopVersion; + $self = clone $this; + $self['interopVersion'] = $interopVersion; - return $obj; + return $self; } } diff --git a/src/Files/Metadata/Exif/Thumbnail.php b/src/Files/Metadata/Exif/Thumbnail.php index ef75e3a7..4a1c1094 100644 --- a/src/Files/Metadata/Exif/Thumbnail.php +++ b/src/Files/Metadata/Exif/Thumbnail.php @@ -61,63 +61,63 @@ public static function with( ?int $xResolution = null, ?int $yResolution = null, ): self { - $obj = new self; + $self = new self; - null !== $compression && $obj['compression'] = $compression; - null !== $resolutionUnit && $obj['resolutionUnit'] = $resolutionUnit; - null !== $thumbnailLength && $obj['thumbnailLength'] = $thumbnailLength; - null !== $thumbnailOffset && $obj['thumbnailOffset'] = $thumbnailOffset; - null !== $xResolution && $obj['xResolution'] = $xResolution; - null !== $yResolution && $obj['yResolution'] = $yResolution; + null !== $compression && $self['compression'] = $compression; + null !== $resolutionUnit && $self['resolutionUnit'] = $resolutionUnit; + null !== $thumbnailLength && $self['thumbnailLength'] = $thumbnailLength; + null !== $thumbnailOffset && $self['thumbnailOffset'] = $thumbnailOffset; + null !== $xResolution && $self['xResolution'] = $xResolution; + null !== $yResolution && $self['yResolution'] = $yResolution; - return $obj; + return $self; } public function withCompression(int $compression): self { - $obj = clone $this; - $obj['compression'] = $compression; + $self = clone $this; + $self['compression'] = $compression; - return $obj; + return $self; } public function withResolutionUnit(int $resolutionUnit): self { - $obj = clone $this; - $obj['resolutionUnit'] = $resolutionUnit; + $self = clone $this; + $self['resolutionUnit'] = $resolutionUnit; - return $obj; + return $self; } public function withThumbnailLength(int $thumbnailLength): self { - $obj = clone $this; - $obj['thumbnailLength'] = $thumbnailLength; + $self = clone $this; + $self['thumbnailLength'] = $thumbnailLength; - return $obj; + return $self; } public function withThumbnailOffset(int $thumbnailOffset): self { - $obj = clone $this; - $obj['thumbnailOffset'] = $thumbnailOffset; + $self = clone $this; + $self['thumbnailOffset'] = $thumbnailOffset; - return $obj; + return $self; } public function withXResolution(int $xResolution): self { - $obj = clone $this; - $obj['xResolution'] = $xResolution; + $self = clone $this; + $self['xResolution'] = $xResolution; - return $obj; + return $self; } public function withYResolution(int $yResolution): self { - $obj = clone $this; - $obj['yResolution'] = $yResolution; + $self = clone $this; + $self['yResolution'] = $yResolution; - return $obj; + return $self; } } diff --git a/src/Files/Metadata/MetadataGetFromURLParams.php b/src/Files/Metadata/MetadataGetFromURLParams.php index 09cc152e..d9b0a422 100644 --- a/src/Files/Metadata/MetadataGetFromURLParams.php +++ b/src/Files/Metadata/MetadataGetFromURLParams.php @@ -54,11 +54,11 @@ public function __construct() */ public static function with(string $url): self { - $obj = new self; + $self = new self; - $obj['url'] = $url; + $self['url'] = $url; - return $obj; + return $self; } /** @@ -66,9 +66,9 @@ public static function with(string $url): self */ public function withURL(string $url): self { - $obj = clone $this; - $obj['url'] = $url; + $self = clone $this; + $self['url'] = $url; - return $obj; + return $self; } } diff --git a/src/Files/UpdateFileRequest/ChangePublicationStatus.php b/src/Files/UpdateFileRequest/ChangePublicationStatus.php index 1e872743..48e6ef1e 100644 --- a/src/Files/UpdateFileRequest/ChangePublicationStatus.php +++ b/src/Files/UpdateFileRequest/ChangePublicationStatus.php @@ -39,11 +39,11 @@ public function __construct() */ public static function with(Publish|array|null $publish = null): self { - $obj = new self; + $self = new self; - null !== $publish && $obj['publish'] = $publish; + null !== $publish && $self['publish'] = $publish; - return $obj; + return $self; } /** @@ -55,9 +55,9 @@ public static function with(Publish|array|null $publish = null): self */ public function withPublish(Publish|array $publish): self { - $obj = clone $this; - $obj['publish'] = $publish; + $self = clone $this; + $self['publish'] = $publish; - return $obj; + return $self; } } diff --git a/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php b/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php index faaf2c10..5928c599 100644 --- a/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php +++ b/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php @@ -61,13 +61,13 @@ public static function with( bool $isPublished, ?bool $includeFileVersions = null ): self { - $obj = new self; + $self = new self; - $obj['isPublished'] = $isPublished; + $self['isPublished'] = $isPublished; - null !== $includeFileVersions && $obj['includeFileVersions'] = $includeFileVersions; + null !== $includeFileVersions && $self['includeFileVersions'] = $includeFileVersions; - return $obj; + return $self; } /** @@ -75,10 +75,10 @@ public static function with( */ public function withIsPublished(bool $isPublished): self { - $obj = clone $this; - $obj['isPublished'] = $isPublished; + $self = clone $this; + $self['isPublished'] = $isPublished; - return $obj; + return $self; } /** @@ -86,9 +86,9 @@ public function withIsPublished(bool $isPublished): self */ public function withIncludeFileVersions(bool $includeFileVersions): self { - $obj = clone $this; - $obj['includeFileVersions'] = $includeFileVersions; + $self = clone $this; + $self['includeFileVersions'] = $includeFileVersions; - return $obj; + return $self; } } diff --git a/src/Files/UpdateFileRequest/UpdateFileDetails.php b/src/Files/UpdateFileRequest/UpdateFileDetails.php index 727b6648..e42c209d 100644 --- a/src/Files/UpdateFileRequest/UpdateFileDetails.php +++ b/src/Files/UpdateFileRequest/UpdateFileDetails.php @@ -113,17 +113,17 @@ public static function with( ?array $tags = null, ?string $webhookURL = null, ): self { - $obj = new self; + $self = new self; - null !== $customCoordinates && $obj['customCoordinates'] = $customCoordinates; - null !== $customMetadata && $obj['customMetadata'] = $customMetadata; - null !== $description && $obj['description'] = $description; - null !== $extensions && $obj['extensions'] = $extensions; - null !== $removeAITags && $obj['removeAITags'] = $removeAITags; - null !== $tags && $obj['tags'] = $tags; - null !== $webhookURL && $obj['webhookURL'] = $webhookURL; + null !== $customCoordinates && $self['customCoordinates'] = $customCoordinates; + null !== $customMetadata && $self['customMetadata'] = $customMetadata; + null !== $description && $self['description'] = $description; + null !== $extensions && $self['extensions'] = $extensions; + null !== $removeAITags && $self['removeAITags'] = $removeAITags; + null !== $tags && $self['tags'] = $tags; + null !== $webhookURL && $self['webhookURL'] = $webhookURL; - return $obj; + return $self; } /** @@ -131,10 +131,10 @@ public static function with( */ public function withCustomCoordinates(?string $customCoordinates): self { - $obj = clone $this; - $obj['customCoordinates'] = $customCoordinates; + $self = clone $this; + $self['customCoordinates'] = $customCoordinates; - return $obj; + return $self; } /** @@ -144,10 +144,10 @@ public function withCustomCoordinates(?string $customCoordinates): self */ public function withCustomMetadata(array $customMetadata): self { - $obj = clone $this; - $obj['customMetadata'] = $customMetadata; + $self = clone $this; + $self['customMetadata'] = $customMetadata; - return $obj; + return $self; } /** @@ -155,10 +155,10 @@ public function withCustomMetadata(array $customMetadata): self */ public function withDescription(string $description): self { - $obj = clone $this; - $obj['description'] = $description; + $self = clone $this; + $self['description'] = $description; - return $obj; + return $self; } /** @@ -172,10 +172,10 @@ public function withDescription(string $description): self */ public function withExtensions(array $extensions): self { - $obj = clone $this; - $obj['extensions'] = $extensions; + $self = clone $this; + $self['extensions'] = $extensions; - return $obj; + return $self; } /** @@ -189,10 +189,10 @@ public function withExtensions(array $extensions): self */ public function withRemoveAITags(string|array $removeAITags): self { - $obj = clone $this; - $obj['removeAITags'] = $removeAITags; + $self = clone $this; + $self['removeAITags'] = $removeAITags; - return $obj; + return $self; } /** @@ -202,10 +202,10 @@ public function withRemoveAITags(string|array $removeAITags): self */ public function withTags(?array $tags): self { - $obj = clone $this; - $obj['tags'] = $tags; + $self = clone $this; + $self['tags'] = $tags; - return $obj; + return $self; } /** @@ -213,9 +213,9 @@ public function withTags(?array $tags): self */ public function withWebhookURL(string $webhookURL): self { - $obj = clone $this; - $obj['webhookURL'] = $webhookURL; + $self = clone $this; + $self['webhookURL'] = $webhookURL; - return $obj; + return $self; } } diff --git a/src/Files/Versions/VersionDeleteParams.php b/src/Files/Versions/VersionDeleteParams.php index 32d80f34..0deba939 100644 --- a/src/Files/Versions/VersionDeleteParams.php +++ b/src/Files/Versions/VersionDeleteParams.php @@ -53,18 +53,18 @@ public function __construct() */ public static function with(string $fileID): self { - $obj = new self; + $self = new self; - $obj['fileID'] = $fileID; + $self['fileID'] = $fileID; - return $obj; + return $self; } public function withFileID(string $fileID): self { - $obj = clone $this; - $obj['fileID'] = $fileID; + $self = clone $this; + $self['fileID'] = $fileID; - return $obj; + return $self; } } diff --git a/src/Files/Versions/VersionGetParams.php b/src/Files/Versions/VersionGetParams.php index 3061e29b..0c62b7fb 100644 --- a/src/Files/Versions/VersionGetParams.php +++ b/src/Files/Versions/VersionGetParams.php @@ -51,18 +51,18 @@ public function __construct() */ public static function with(string $fileID): self { - $obj = new self; + $self = new self; - $obj['fileID'] = $fileID; + $self['fileID'] = $fileID; - return $obj; + return $self; } public function withFileID(string $fileID): self { - $obj = clone $this; - $obj['fileID'] = $fileID; + $self = clone $this; + $self['fileID'] = $fileID; - return $obj; + return $self; } } diff --git a/src/Files/Versions/VersionRestoreParams.php b/src/Files/Versions/VersionRestoreParams.php index 28e46b91..9d9fcfef 100644 --- a/src/Files/Versions/VersionRestoreParams.php +++ b/src/Files/Versions/VersionRestoreParams.php @@ -51,18 +51,18 @@ public function __construct() */ public static function with(string $fileID): self { - $obj = new self; + $self = new self; - $obj['fileID'] = $fileID; + $self['fileID'] = $fileID; - return $obj; + return $self; } public function withFileID(string $fileID): self { - $obj = clone $this; - $obj['fileID'] = $fileID; + $self = clone $this; + $self['fileID'] = $fileID; - return $obj; + return $self; } } diff --git a/src/Folders/FolderCopyParams.php b/src/Folders/FolderCopyParams.php index bf78e3d1..1b307942 100644 --- a/src/Folders/FolderCopyParams.php +++ b/src/Folders/FolderCopyParams.php @@ -72,14 +72,14 @@ public static function with( string $sourceFolderPath, ?bool $includeVersions = null, ): self { - $obj = new self; + $self = new self; - $obj['destinationPath'] = $destinationPath; - $obj['sourceFolderPath'] = $sourceFolderPath; + $self['destinationPath'] = $destinationPath; + $self['sourceFolderPath'] = $sourceFolderPath; - null !== $includeVersions && $obj['includeVersions'] = $includeVersions; + null !== $includeVersions && $self['includeVersions'] = $includeVersions; - return $obj; + return $self; } /** @@ -87,10 +87,10 @@ public static function with( */ public function withDestinationPath(string $destinationPath): self { - $obj = clone $this; - $obj['destinationPath'] = $destinationPath; + $self = clone $this; + $self['destinationPath'] = $destinationPath; - return $obj; + return $self; } /** @@ -98,10 +98,10 @@ public function withDestinationPath(string $destinationPath): self */ public function withSourceFolderPath(string $sourceFolderPath): self { - $obj = clone $this; - $obj['sourceFolderPath'] = $sourceFolderPath; + $self = clone $this; + $self['sourceFolderPath'] = $sourceFolderPath; - return $obj; + return $self; } /** @@ -109,9 +109,9 @@ public function withSourceFolderPath(string $sourceFolderPath): self */ public function withIncludeVersions(bool $includeVersions): self { - $obj = clone $this; - $obj['includeVersions'] = $includeVersions; + $self = clone $this; + $self['includeVersions'] = $includeVersions; - return $obj; + return $self; } } diff --git a/src/Folders/FolderCopyResponse.php b/src/Folders/FolderCopyResponse.php index 16a453bc..c4f76c16 100644 --- a/src/Folders/FolderCopyResponse.php +++ b/src/Folders/FolderCopyResponse.php @@ -50,11 +50,11 @@ public function __construct() */ public static function with(string $jobID): self { - $obj = new self; + $self = new self; - $obj['jobID'] = $jobID; + $self['jobID'] = $jobID; - return $obj; + return $self; } /** @@ -62,9 +62,9 @@ public static function with(string $jobID): self */ public function withJobID(string $jobID): self { - $obj = clone $this; - $obj['jobID'] = $jobID; + $self = clone $this; + $self['jobID'] = $jobID; - return $obj; + return $self; } } diff --git a/src/Folders/FolderCreateParams.php b/src/Folders/FolderCreateParams.php index c779ee99..92a3cbab 100644 --- a/src/Folders/FolderCreateParams.php +++ b/src/Folders/FolderCreateParams.php @@ -68,12 +68,12 @@ public static function with( string $folderName, string $parentFolderPath ): self { - $obj = new self; + $self = new self; - $obj['folderName'] = $folderName; - $obj['parentFolderPath'] = $parentFolderPath; + $self['folderName'] = $folderName; + $self['parentFolderPath'] = $parentFolderPath; - return $obj; + return $self; } /** @@ -83,10 +83,10 @@ public static function with( */ public function withFolderName(string $folderName): self { - $obj = clone $this; - $obj['folderName'] = $folderName; + $self = clone $this; + $self['folderName'] = $folderName; - return $obj; + return $self; } /** @@ -96,9 +96,9 @@ public function withFolderName(string $folderName): self */ public function withParentFolderPath(string $parentFolderPath): self { - $obj = clone $this; - $obj['parentFolderPath'] = $parentFolderPath; + $self = clone $this; + $self['parentFolderPath'] = $parentFolderPath; - return $obj; + return $self; } } diff --git a/src/Folders/FolderDeleteParams.php b/src/Folders/FolderDeleteParams.php index 5e49e0eb..85870454 100644 --- a/src/Folders/FolderDeleteParams.php +++ b/src/Folders/FolderDeleteParams.php @@ -54,11 +54,11 @@ public function __construct() */ public static function with(string $folderPath): self { - $obj = new self; + $self = new self; - $obj['folderPath'] = $folderPath; + $self['folderPath'] = $folderPath; - return $obj; + return $self; } /** @@ -66,9 +66,9 @@ public static function with(string $folderPath): self */ public function withFolderPath(string $folderPath): self { - $obj = clone $this; - $obj['folderPath'] = $folderPath; + $self = clone $this; + $self['folderPath'] = $folderPath; - return $obj; + return $self; } } diff --git a/src/Folders/FolderMoveParams.php b/src/Folders/FolderMoveParams.php index 99801ff5..5f55b636 100644 --- a/src/Folders/FolderMoveParams.php +++ b/src/Folders/FolderMoveParams.php @@ -64,12 +64,12 @@ public static function with( string $destinationPath, string $sourceFolderPath ): self { - $obj = new self; + $self = new self; - $obj['destinationPath'] = $destinationPath; - $obj['sourceFolderPath'] = $sourceFolderPath; + $self['destinationPath'] = $destinationPath; + $self['sourceFolderPath'] = $sourceFolderPath; - return $obj; + return $self; } /** @@ -77,10 +77,10 @@ public static function with( */ public function withDestinationPath(string $destinationPath): self { - $obj = clone $this; - $obj['destinationPath'] = $destinationPath; + $self = clone $this; + $self['destinationPath'] = $destinationPath; - return $obj; + return $self; } /** @@ -88,9 +88,9 @@ public function withDestinationPath(string $destinationPath): self */ public function withSourceFolderPath(string $sourceFolderPath): self { - $obj = clone $this; - $obj['sourceFolderPath'] = $sourceFolderPath; + $self = clone $this; + $self['sourceFolderPath'] = $sourceFolderPath; - return $obj; + return $self; } } diff --git a/src/Folders/FolderMoveResponse.php b/src/Folders/FolderMoveResponse.php index 8d149c42..7151fa0d 100644 --- a/src/Folders/FolderMoveResponse.php +++ b/src/Folders/FolderMoveResponse.php @@ -50,11 +50,11 @@ public function __construct() */ public static function with(string $jobID): self { - $obj = new self; + $self = new self; - $obj['jobID'] = $jobID; + $self['jobID'] = $jobID; - return $obj; + return $self; } /** @@ -62,9 +62,9 @@ public static function with(string $jobID): self */ public function withJobID(string $jobID): self { - $obj = clone $this; - $obj['jobID'] = $jobID; + $self = clone $this; + $self['jobID'] = $jobID; - return $obj; + return $self; } } diff --git a/src/Folders/FolderRenameParams.php b/src/Folders/FolderRenameParams.php index d731154e..16c9918c 100644 --- a/src/Folders/FolderRenameParams.php +++ b/src/Folders/FolderRenameParams.php @@ -80,14 +80,14 @@ public static function with( string $newFolderName, ?bool $purgeCache = null ): self { - $obj = new self; + $self = new self; - $obj['folderPath'] = $folderPath; - $obj['newFolderName'] = $newFolderName; + $self['folderPath'] = $folderPath; + $self['newFolderName'] = $newFolderName; - null !== $purgeCache && $obj['purgeCache'] = $purgeCache; + null !== $purgeCache && $self['purgeCache'] = $purgeCache; - return $obj; + return $self; } /** @@ -95,10 +95,10 @@ public static function with( */ public function withFolderPath(string $folderPath): self { - $obj = clone $this; - $obj['folderPath'] = $folderPath; + $self = clone $this; + $self['folderPath'] = $folderPath; - return $obj; + return $self; } /** @@ -108,10 +108,10 @@ public function withFolderPath(string $folderPath): self */ public function withNewFolderName(string $newFolderName): self { - $obj = clone $this; - $obj['newFolderName'] = $newFolderName; + $self = clone $this; + $self['newFolderName'] = $newFolderName; - return $obj; + return $self; } /** @@ -125,9 +125,9 @@ public function withNewFolderName(string $newFolderName): self */ public function withPurgeCache(bool $purgeCache): self { - $obj = clone $this; - $obj['purgeCache'] = $purgeCache; + $self = clone $this; + $self['purgeCache'] = $purgeCache; - return $obj; + return $self; } } diff --git a/src/Folders/FolderRenameResponse.php b/src/Folders/FolderRenameResponse.php index dd9eede6..fa79bc71 100644 --- a/src/Folders/FolderRenameResponse.php +++ b/src/Folders/FolderRenameResponse.php @@ -50,11 +50,11 @@ public function __construct() */ public static function with(string $jobID): self { - $obj = new self; + $self = new self; - $obj['jobID'] = $jobID; + $self['jobID'] = $jobID; - return $obj; + return $self; } /** @@ -62,9 +62,9 @@ public static function with(string $jobID): self */ public function withJobID(string $jobID): self { - $obj = clone $this; - $obj['jobID'] = $jobID; + $self = clone $this; + $self['jobID'] = $jobID; - return $obj; + return $self; } } diff --git a/src/Folders/Job/JobGetResponse.php b/src/Folders/Job/JobGetResponse.php index 5b526d04..e47c9bf1 100644 --- a/src/Folders/Job/JobGetResponse.php +++ b/src/Folders/Job/JobGetResponse.php @@ -70,14 +70,14 @@ public static function with( Status|string|null $status = null, Type|string|null $type = null, ): self { - $obj = new self; + $self = new self; - null !== $jobID && $obj['jobID'] = $jobID; - null !== $purgeRequestID && $obj['purgeRequestID'] = $purgeRequestID; - null !== $status && $obj['status'] = $status; - null !== $type && $obj['type'] = $type; + null !== $jobID && $self['jobID'] = $jobID; + null !== $purgeRequestID && $self['purgeRequestID'] = $purgeRequestID; + null !== $status && $self['status'] = $status; + null !== $type && $self['type'] = $type; - return $obj; + return $self; } /** @@ -85,10 +85,10 @@ public static function with( */ public function withJobID(string $jobID): self { - $obj = clone $this; - $obj['jobID'] = $jobID; + $self = clone $this; + $self['jobID'] = $jobID; - return $obj; + return $self; } /** @@ -96,10 +96,10 @@ public function withJobID(string $jobID): self */ public function withPurgeRequestID(string $purgeRequestID): self { - $obj = clone $this; - $obj['purgeRequestID'] = $purgeRequestID; + $self = clone $this; + $self['purgeRequestID'] = $purgeRequestID; - return $obj; + return $self; } /** @@ -109,10 +109,10 @@ public function withPurgeRequestID(string $purgeRequestID): self */ public function withStatus(Status|string $status): self { - $obj = clone $this; - $obj['status'] = $status; + $self = clone $this; + $self['status'] = $status; - return $obj; + return $self; } /** @@ -122,9 +122,9 @@ public function withStatus(Status|string $status): self */ public function withType(Type|string $type): self { - $obj = clone $this; - $obj['type'] = $type; + $self = clone $this; + $self['type'] = $type; - return $obj; + return $self; } } diff --git a/src/GetImageAttributesOptions.php b/src/GetImageAttributesOptions.php index cba62811..3109477e 100644 --- a/src/GetImageAttributesOptions.php +++ b/src/GetImageAttributesOptions.php @@ -187,22 +187,22 @@ public static function with( ?string $sizes = null, ?float $width = null, ): self { - $obj = new self; - - $obj['src'] = $src; - $obj['urlEndpoint'] = $urlEndpoint; - - null !== $expiresIn && $obj['expiresIn'] = $expiresIn; - null !== $queryParameters && $obj['queryParameters'] = $queryParameters; - null !== $signed && $obj['signed'] = $signed; - null !== $transformation && $obj['transformation'] = $transformation; - null !== $transformationPosition && $obj['transformationPosition'] = $transformationPosition; - null !== $deviceBreakpoints && $obj['deviceBreakpoints'] = $deviceBreakpoints; - null !== $imageBreakpoints && $obj['imageBreakpoints'] = $imageBreakpoints; - null !== $sizes && $obj['sizes'] = $sizes; - null !== $width && $obj['width'] = $width; - - return $obj; + $self = new self; + + $self['src'] = $src; + $self['urlEndpoint'] = $urlEndpoint; + + null !== $expiresIn && $self['expiresIn'] = $expiresIn; + null !== $queryParameters && $self['queryParameters'] = $queryParameters; + null !== $signed && $self['signed'] = $signed; + null !== $transformation && $self['transformation'] = $transformation; + null !== $transformationPosition && $self['transformationPosition'] = $transformationPosition; + null !== $deviceBreakpoints && $self['deviceBreakpoints'] = $deviceBreakpoints; + null !== $imageBreakpoints && $self['imageBreakpoints'] = $imageBreakpoints; + null !== $sizes && $self['sizes'] = $sizes; + null !== $width && $self['width'] = $width; + + return $self; } /** @@ -211,10 +211,10 @@ public static function with( */ public function withSrc(string $src): self { - $obj = clone $this; - $obj['src'] = $src; + $self = clone $this; + $self['src'] = $src; - return $obj; + return $self; } /** @@ -222,10 +222,10 @@ public function withSrc(string $src): self */ public function withURLEndpoint(string $urlEndpoint): self { - $obj = clone $this; - $obj['urlEndpoint'] = $urlEndpoint; + $self = clone $this; + $self['urlEndpoint'] = $urlEndpoint; - return $obj; + return $self; } /** @@ -240,10 +240,10 @@ public function withURLEndpoint(string $urlEndpoint): self */ public function withExpiresIn(float $expiresIn): self { - $obj = clone $this; - $obj['expiresIn'] = $expiresIn; + $self = clone $this; + $self['expiresIn'] = $expiresIn; - return $obj; + return $self; } /** @@ -255,10 +255,10 @@ public function withExpiresIn(float $expiresIn): self */ public function withQueryParameters(array $queryParameters): self { - $obj = clone $this; - $obj['queryParameters'] = $queryParameters; + $self = clone $this; + $self['queryParameters'] = $queryParameters; - return $obj; + return $self; } /** @@ -269,10 +269,10 @@ public function withQueryParameters(array $queryParameters): self */ public function withSigned(bool $signed): self { - $obj = clone $this; - $obj['signed'] = $signed; + $self = clone $this; + $self['signed'] = $signed; - return $obj; + return $self; } /** @@ -283,10 +283,10 @@ public function withSigned(bool $signed): self */ public function withTransformation(array $transformation): self { - $obj = clone $this; - $obj['transformation'] = $transformation; + $self = clone $this; + $self['transformation'] = $transformation; - return $obj; + return $self; } /** @@ -299,10 +299,10 @@ public function withTransformation(array $transformation): self public function withTransformationPosition( TransformationPosition|string $transformationPosition ): self { - $obj = clone $this; - $obj['transformationPosition'] = $transformationPosition; + $self = clone $this; + $self['transformationPosition'] = $transformationPosition; - return $obj; + return $self; } /** @@ -316,10 +316,10 @@ public function withTransformationPosition( */ public function withDeviceBreakpoints(array $deviceBreakpoints): self { - $obj = clone $this; - $obj['deviceBreakpoints'] = $deviceBreakpoints; + $self = clone $this; + $self['deviceBreakpoints'] = $deviceBreakpoints; - return $obj; + return $self; } /** @@ -334,10 +334,10 @@ public function withDeviceBreakpoints(array $deviceBreakpoints): self */ public function withImageBreakpoints(array $imageBreakpoints): self { - $obj = clone $this; - $obj['imageBreakpoints'] = $imageBreakpoints; + $self = clone $this; + $self['imageBreakpoints'] = $imageBreakpoints; - return $obj; + return $self; } /** @@ -351,10 +351,10 @@ public function withImageBreakpoints(array $imageBreakpoints): self */ public function withSizes(string $sizes): self { - $obj = clone $this; - $obj['sizes'] = $sizes; + $self = clone $this; + $self['sizes'] = $sizes; - return $obj; + return $self; } /** @@ -367,9 +367,9 @@ public function withSizes(string $sizes): self */ public function withWidth(float $width): self { - $obj = clone $this; - $obj['width'] = $width; + $self = clone $this; + $self['width'] = $width; - return $obj; + return $self; } } diff --git a/src/ImageOverlay.php b/src/ImageOverlay.php index 9736ed94..56454d2e 100644 --- a/src/ImageOverlay.php +++ b/src/ImageOverlay.php @@ -104,16 +104,16 @@ public static function with( Encoding|string|null $encoding = null, ?array $transformation = null, ): self { - $obj = new self; + $self = new self; - $obj['input'] = $input; + $self['input'] = $input; - null !== $position && $obj['position'] = $position; - null !== $timing && $obj['timing'] = $timing; - null !== $encoding && $obj['encoding'] = $encoding; - null !== $transformation && $obj['transformation'] = $transformation; + null !== $position && $self['position'] = $position; + null !== $timing && $self['timing'] = $timing; + null !== $encoding && $self['encoding'] = $encoding; + null !== $transformation && $self['transformation'] = $transformation; - return $obj; + return $self; } /** @@ -123,10 +123,10 @@ public static function with( */ public function withPosition(OverlayPosition|array $position): self { - $obj = clone $this; - $obj['position'] = $position; + $self = clone $this; + $self['position'] = $position; - return $obj; + return $self; } /** @@ -138,10 +138,10 @@ public function withPosition(OverlayPosition|array $position): self */ public function withTiming(OverlayTiming|array $timing): self { - $obj = clone $this; - $obj['timing'] = $timing; + $self = clone $this; + $self['timing'] = $timing; - return $obj; + return $self; } /** @@ -149,10 +149,10 @@ public function withTiming(OverlayTiming|array $timing): self */ public function withInput(string $input): self { - $obj = clone $this; - $obj['input'] = $input; + $self = clone $this; + $self['input'] = $input; - return $obj; + return $self; } /** @@ -165,10 +165,10 @@ public function withInput(string $input): self */ public function withEncoding(Encoding|string $encoding): self { - $obj = clone $this; - $obj['encoding'] = $encoding; + $self = clone $this; + $self['encoding'] = $encoding; - return $obj; + return $self; } /** @@ -179,9 +179,9 @@ public function withEncoding(Encoding|string $encoding): self */ public function withTransformation(array $transformation): self { - $obj = clone $this; - $obj['transformation'] = $transformation; + $self = clone $this; + $self['transformation'] = $transformation; - return $obj; + return $self; } } diff --git a/src/OverlayPosition.php b/src/OverlayPosition.php index 2cfb49f2..5669b5c9 100644 --- a/src/OverlayPosition.php +++ b/src/OverlayPosition.php @@ -63,13 +63,13 @@ public static function with( float|string|null $x = null, float|string|null $y = null ): self { - $obj = new self; + $self = new self; - null !== $focus && $obj['focus'] = $focus; - null !== $x && $obj['x'] = $x; - null !== $y && $obj['y'] = $y; + null !== $focus && $self['focus'] = $focus; + null !== $x && $self['x'] = $x; + null !== $y && $self['y'] = $y; - return $obj; + return $self; } /** @@ -80,10 +80,10 @@ public static function with( */ public function withFocus(Focus|string $focus): self { - $obj = clone $this; - $obj['focus'] = $focus; + $self = clone $this; + $self['focus'] = $focus; - return $obj; + return $self; } /** @@ -94,10 +94,10 @@ public function withFocus(Focus|string $focus): self */ public function withX(float|string $x): self { - $obj = clone $this; - $obj['x'] = $x; + $self = clone $this; + $self['x'] = $x; - return $obj; + return $self; } /** @@ -108,9 +108,9 @@ public function withX(float|string $x): self */ public function withY(float|string $y): self { - $obj = clone $this; - $obj['y'] = $y; + $self = clone $this; + $self['y'] = $y; - return $obj; + return $self; } } diff --git a/src/OverlayTiming.php b/src/OverlayTiming.php index d7cb2826..3ce11e1c 100644 --- a/src/OverlayTiming.php +++ b/src/OverlayTiming.php @@ -63,13 +63,13 @@ public static function with( float|string|null $end = null, float|string|null $start = null, ): self { - $obj = new self; + $self = new self; - null !== $duration && $obj['duration'] = $duration; - null !== $end && $obj['end'] = $end; - null !== $start && $obj['start'] = $start; + null !== $duration && $self['duration'] = $duration; + null !== $end && $self['end'] = $end; + null !== $start && $self['start'] = $start; - return $obj; + return $self; } /** @@ -80,10 +80,10 @@ public static function with( */ public function withDuration(float|string $duration): self { - $obj = clone $this; - $obj['duration'] = $duration; + $self = clone $this; + $self['duration'] = $duration; - return $obj; + return $self; } /** @@ -95,10 +95,10 @@ public function withDuration(float|string $duration): self */ public function withEnd(float|string $end): self { - $obj = clone $this; - $obj['end'] = $end; + $self = clone $this; + $self['end'] = $end; - return $obj; + return $self; } /** @@ -109,9 +109,9 @@ public function withEnd(float|string $end): self */ public function withStart(float|string $start): self { - $obj = clone $this; - $obj['start'] = $start; + $self = clone $this; + $self['start'] = $start; - return $obj; + return $self; } } diff --git a/src/RequestOptions.php b/src/RequestOptions.php index d865195f..53077bba 100644 --- a/src/RequestOptions.php +++ b/src/RequestOptions.php @@ -106,53 +106,55 @@ public static function with( ?StreamFactoryInterface $streamFactory = null, ?RequestFactoryInterface $requestFactory = null, ): self { - $obj = new self; - - null !== $timeout && $obj->timeout = $timeout; - null !== $maxRetries && $obj->maxRetries = $maxRetries; - null !== $initialRetryDelay && $obj->initialRetryDelay = $initialRetryDelay; - null !== $maxRetryDelay && $obj->maxRetryDelay = $maxRetryDelay; - null !== $extraHeaders && $obj->extraHeaders = $extraHeaders; - null !== $extraQueryParams && $obj->extraQueryParams = $extraQueryParams; - omit !== $extraBodyParams && $obj->extraBodyParams = $extraBodyParams; - null !== $transporter && $obj->transporter = $transporter; - null !== $uriFactory && $obj->uriFactory = $uriFactory; - null !== $streamFactory && $obj->streamFactory = $streamFactory; - null !== $requestFactory && $obj->requestFactory = $requestFactory; - - return $obj; + $self = new self; + + null !== $timeout && $self->timeout = $timeout; + null !== $maxRetries && $self->maxRetries = $maxRetries; + null !== $initialRetryDelay && $self + ->initialRetryDelay = $initialRetryDelay + ; + null !== $maxRetryDelay && $self->maxRetryDelay = $maxRetryDelay; + null !== $extraHeaders && $self->extraHeaders = $extraHeaders; + null !== $extraQueryParams && $self->extraQueryParams = $extraQueryParams; + omit !== $extraBodyParams && $self->extraBodyParams = $extraBodyParams; + null !== $transporter && $self->transporter = $transporter; + null !== $uriFactory && $self->uriFactory = $uriFactory; + null !== $streamFactory && $self->streamFactory = $streamFactory; + null !== $requestFactory && $self->requestFactory = $requestFactory; + + return $self; } public function withTimeout(float $timeout): self { - $obj = clone $this; - $obj->timeout = $timeout; + $self = clone $this; + $self->timeout = $timeout; - return $obj; + return $self; } public function withMaxRetries(int $maxRetries): self { - $obj = clone $this; - $obj->maxRetries = $maxRetries; + $self = clone $this; + $self->maxRetries = $maxRetries; - return $obj; + return $self; } public function withInitialRetryDelay(float $initialRetryDelay): self { - $obj = clone $this; - $obj->initialRetryDelay = $initialRetryDelay; + $self = clone $this; + $self->initialRetryDelay = $initialRetryDelay; - return $obj; + return $self; } public function withMaxRetryDelay(float $maxRetryDelay): self { - $obj = clone $this; - $obj->maxRetryDelay = $maxRetryDelay; + $self = clone $this; + $self->maxRetryDelay = $maxRetryDelay; - return $obj; + return $self; } /** @@ -160,10 +162,10 @@ public function withMaxRetryDelay(float $maxRetryDelay): self */ public function withExtraHeaders(array $extraHeaders): self { - $obj = clone $this; - $obj->extraHeaders = $extraHeaders; + $self = clone $this; + $self->extraHeaders = $extraHeaders; - return $obj; + return $self; } /** @@ -171,51 +173,51 @@ public function withExtraHeaders(array $extraHeaders): self */ public function withExtraQueryParams(array $extraQueryParams): self { - $obj = clone $this; - $obj->extraQueryParams = $extraQueryParams; + $self = clone $this; + $self->extraQueryParams = $extraQueryParams; - return $obj; + return $self; } public function withExtraBodyParams(mixed $extraBodyParams): self { - $obj = clone $this; - $obj->extraBodyParams = $extraBodyParams; + $self = clone $this; + $self->extraBodyParams = $extraBodyParams; - return $obj; + return $self; } public function withTransporter(ClientInterface $transporter): self { - $obj = clone $this; - $obj->transporter = $transporter; + $self = clone $this; + $self->transporter = $transporter; - return $obj; + return $self; } public function withUriFactory(UriFactoryInterface $uriFactory): self { - $obj = clone $this; - $obj->uriFactory = $uriFactory; + $self = clone $this; + $self->uriFactory = $uriFactory; - return $obj; + return $self; } public function withStreamFactory( StreamFactoryInterface $streamFactory ): self { - $obj = clone $this; - $obj->streamFactory = $streamFactory; + $self = clone $this; + $self->streamFactory = $streamFactory; - return $obj; + return $self; } public function withRequestFactory( RequestFactoryInterface $requestFactory ): self { - $obj = clone $this; - $obj->requestFactory = $requestFactory; + $self = clone $this; + $self->requestFactory = $requestFactory; - return $obj; + return $self; } } diff --git a/src/ResponsiveImageAttributes.php b/src/ResponsiveImageAttributes.php index 9e9983c7..966754f1 100644 --- a/src/ResponsiveImageAttributes.php +++ b/src/ResponsiveImageAttributes.php @@ -78,15 +78,15 @@ public static function with( ?string $srcSet = null, ?float $width = null, ): self { - $obj = new self; + $self = new self; - $obj['src'] = $src; + $self['src'] = $src; - null !== $sizes && $obj['sizes'] = $sizes; - null !== $srcSet && $obj['srcSet'] = $srcSet; - null !== $width && $obj['width'] = $width; + null !== $sizes && $self['sizes'] = $sizes; + null !== $srcSet && $self['srcSet'] = $srcSet; + null !== $width && $self['width'] = $width; - return $obj; + return $self; } /** @@ -94,10 +94,10 @@ public static function with( */ public function withSrc(string $src): self { - $obj = clone $this; - $obj['src'] = $src; + $self = clone $this; + $self['src'] = $src; - return $obj; + return $self; } /** @@ -106,10 +106,10 @@ public function withSrc(string $src): self */ public function withSizes(string $sizes): self { - $obj = clone $this; - $obj['sizes'] = $sizes; + $self = clone $this; + $self['sizes'] = $sizes; - return $obj; + return $self; } /** @@ -118,10 +118,10 @@ public function withSizes(string $sizes): self */ public function withSrcSet(string $srcSet): self { - $obj = clone $this; - $obj['srcSet'] = $srcSet; + $self = clone $this; + $self['srcSet'] = $srcSet; - return $obj; + return $self; } /** @@ -129,9 +129,9 @@ public function withSrcSet(string $srcSet): self */ public function withWidth(float $width): self { - $obj = clone $this; - $obj['width'] = $width; + $self = clone $this; + $self['width'] = $width; - return $obj; + return $self; } } diff --git a/src/SolidColorOverlay.php b/src/SolidColorOverlay.php index 59de1cf0..18b332e3 100644 --- a/src/SolidColorOverlay.php +++ b/src/SolidColorOverlay.php @@ -97,15 +97,15 @@ public static function with( OverlayTiming|array|null $timing = null, ?array $transformation = null, ): self { - $obj = new self; + $self = new self; - $obj['color'] = $color; + $self['color'] = $color; - null !== $position && $obj['position'] = $position; - null !== $timing && $obj['timing'] = $timing; - null !== $transformation && $obj['transformation'] = $transformation; + null !== $position && $self['position'] = $position; + null !== $timing && $self['timing'] = $timing; + null !== $transformation && $self['transformation'] = $transformation; - return $obj; + return $self; } /** @@ -115,10 +115,10 @@ public static function with( */ public function withPosition(OverlayPosition|array $position): self { - $obj = clone $this; - $obj['position'] = $position; + $self = clone $this; + $self['position'] = $position; - return $obj; + return $self; } /** @@ -130,10 +130,10 @@ public function withPosition(OverlayPosition|array $position): self */ public function withTiming(OverlayTiming|array $timing): self { - $obj = clone $this; - $obj['timing'] = $timing; + $self = clone $this; + $self['timing'] = $timing; - return $obj; + return $self; } /** @@ -142,10 +142,10 @@ public function withTiming(OverlayTiming|array $timing): self */ public function withColor(string $color): self { - $obj = clone $this; - $obj['color'] = $color; + $self = clone $this; + $self['color'] = $color; - return $obj; + return $self; } /** @@ -163,9 +163,9 @@ public function withColor(string $color): self */ public function withTransformation(array $transformation): self { - $obj = clone $this; - $obj['transformation'] = $transformation; + $self = clone $this; + $self['transformation'] = $transformation; - return $obj; + return $self; } } diff --git a/src/SolidColorOverlayTransformation.php b/src/SolidColorOverlayTransformation.php index ab3c2ba8..3af0dc4b 100644 --- a/src/SolidColorOverlayTransformation.php +++ b/src/SolidColorOverlayTransformation.php @@ -85,16 +85,16 @@ public static function with( float|string|null $radius = null, float|string|null $width = null, ): self { - $obj = new self; + $self = new self; - null !== $alpha && $obj['alpha'] = $alpha; - null !== $background && $obj['background'] = $background; - null !== $gradient && $obj['gradient'] = $gradient; - null !== $height && $obj['height'] = $height; - null !== $radius && $obj['radius'] = $radius; - null !== $width && $obj['width'] = $width; + null !== $alpha && $self['alpha'] = $alpha; + null !== $background && $self['background'] = $background; + null !== $gradient && $self['gradient'] = $gradient; + null !== $height && $self['height'] = $height; + null !== $radius && $self['radius'] = $radius; + null !== $width && $self['width'] = $width; - return $obj; + return $self; } /** @@ -102,10 +102,10 @@ public static function with( */ public function withAlpha(float $alpha): self { - $obj = clone $this; - $obj['alpha'] = $alpha; + $self = clone $this; + $self['alpha'] = $alpha; - return $obj; + return $self; } /** @@ -113,10 +113,10 @@ public function withAlpha(float $alpha): self */ public function withBackground(string $background): self { - $obj = clone $this; - $obj['background'] = $background; + $self = clone $this; + $self['background'] = $background; - return $obj; + return $self; } /** @@ -125,10 +125,10 @@ public function withBackground(string $background): self */ public function withGradient(string|bool $gradient): self { - $obj = clone $this; - $obj['gradient'] = $gradient; + $self = clone $this; + $self['gradient'] = $gradient; - return $obj; + return $self; } /** @@ -137,10 +137,10 @@ public function withGradient(string|bool $gradient): self */ public function withHeight(float|string $height): self { - $obj = clone $this; - $obj['height'] = $height; + $self = clone $this; + $self['height'] = $height; - return $obj; + return $self; } /** @@ -151,10 +151,10 @@ public function withHeight(float|string $height): self */ public function withRadius(float|string $radius): self { - $obj = clone $this; - $obj['radius'] = $radius; + $self = clone $this; + $self['radius'] = $radius; - return $obj; + return $self; } /** @@ -163,9 +163,9 @@ public function withRadius(float|string $radius): self */ public function withWidth(float|string $width): self { - $obj = clone $this; - $obj['width'] = $width; + $self = clone $this; + $self['width'] = $width; - return $obj; + return $self; } } diff --git a/src/SrcOptions.php b/src/SrcOptions.php index b89bbff9..b03d5b50 100644 --- a/src/SrcOptions.php +++ b/src/SrcOptions.php @@ -128,18 +128,18 @@ public static function with( ?array $transformation = null, TransformationPosition|string|null $transformationPosition = null, ): self { - $obj = new self; + $self = new self; - $obj['src'] = $src; - $obj['urlEndpoint'] = $urlEndpoint; + $self['src'] = $src; + $self['urlEndpoint'] = $urlEndpoint; - null !== $expiresIn && $obj['expiresIn'] = $expiresIn; - null !== $queryParameters && $obj['queryParameters'] = $queryParameters; - null !== $signed && $obj['signed'] = $signed; - null !== $transformation && $obj['transformation'] = $transformation; - null !== $transformationPosition && $obj['transformationPosition'] = $transformationPosition; + null !== $expiresIn && $self['expiresIn'] = $expiresIn; + null !== $queryParameters && $self['queryParameters'] = $queryParameters; + null !== $signed && $self['signed'] = $signed; + null !== $transformation && $self['transformation'] = $transformation; + null !== $transformationPosition && $self['transformationPosition'] = $transformationPosition; - return $obj; + return $self; } /** @@ -148,10 +148,10 @@ public static function with( */ public function withSrc(string $src): self { - $obj = clone $this; - $obj['src'] = $src; + $self = clone $this; + $self['src'] = $src; - return $obj; + return $self; } /** @@ -159,10 +159,10 @@ public function withSrc(string $src): self */ public function withURLEndpoint(string $urlEndpoint): self { - $obj = clone $this; - $obj['urlEndpoint'] = $urlEndpoint; + $self = clone $this; + $self['urlEndpoint'] = $urlEndpoint; - return $obj; + return $self; } /** @@ -177,10 +177,10 @@ public function withURLEndpoint(string $urlEndpoint): self */ public function withExpiresIn(float $expiresIn): self { - $obj = clone $this; - $obj['expiresIn'] = $expiresIn; + $self = clone $this; + $self['expiresIn'] = $expiresIn; - return $obj; + return $self; } /** @@ -192,10 +192,10 @@ public function withExpiresIn(float $expiresIn): self */ public function withQueryParameters(array $queryParameters): self { - $obj = clone $this; - $obj['queryParameters'] = $queryParameters; + $self = clone $this; + $self['queryParameters'] = $queryParameters; - return $obj; + return $self; } /** @@ -206,10 +206,10 @@ public function withQueryParameters(array $queryParameters): self */ public function withSigned(bool $signed): self { - $obj = clone $this; - $obj['signed'] = $signed; + $self = clone $this; + $self['signed'] = $signed; - return $obj; + return $self; } /** @@ -220,10 +220,10 @@ public function withSigned(bool $signed): self */ public function withTransformation(array $transformation): self { - $obj = clone $this; - $obj['transformation'] = $transformation; + $self = clone $this; + $self['transformation'] = $transformation; - return $obj; + return $self; } /** @@ -236,9 +236,9 @@ public function withTransformation(array $transformation): self public function withTransformationPosition( TransformationPosition|string $transformationPosition ): self { - $obj = clone $this; - $obj['transformationPosition'] = $transformationPosition; + $self = clone $this; + $self['transformationPosition'] = $transformationPosition; - return $obj; + return $self; } } diff --git a/src/SubtitleOverlay.php b/src/SubtitleOverlay.php index b9854d69..3b2baf29 100644 --- a/src/SubtitleOverlay.php +++ b/src/SubtitleOverlay.php @@ -112,16 +112,16 @@ public static function with( Encoding|string|null $encoding = null, ?array $transformation = null, ): self { - $obj = new self; + $self = new self; - $obj['input'] = $input; + $self['input'] = $input; - null !== $position && $obj['position'] = $position; - null !== $timing && $obj['timing'] = $timing; - null !== $encoding && $obj['encoding'] = $encoding; - null !== $transformation && $obj['transformation'] = $transformation; + null !== $position && $self['position'] = $position; + null !== $timing && $self['timing'] = $timing; + null !== $encoding && $self['encoding'] = $encoding; + null !== $transformation && $self['transformation'] = $transformation; - return $obj; + return $self; } /** @@ -131,10 +131,10 @@ public static function with( */ public function withPosition(OverlayPosition|array $position): self { - $obj = clone $this; - $obj['position'] = $position; + $self = clone $this; + $self['position'] = $position; - return $obj; + return $self; } /** @@ -146,10 +146,10 @@ public function withPosition(OverlayPosition|array $position): self */ public function withTiming(OverlayTiming|array $timing): self { - $obj = clone $this; - $obj['timing'] = $timing; + $self = clone $this; + $self['timing'] = $timing; - return $obj; + return $self; } /** @@ -157,10 +157,10 @@ public function withTiming(OverlayTiming|array $timing): self */ public function withInput(string $input): self { - $obj = clone $this; - $obj['input'] = $input; + $self = clone $this; + $self['input'] = $input; - return $obj; + return $self; } /** @@ -173,10 +173,10 @@ public function withInput(string $input): self */ public function withEncoding(Encoding|string $encoding): self { - $obj = clone $this; - $obj['encoding'] = $encoding; + $self = clone $this; + $self['encoding'] = $encoding; - return $obj; + return $self; } /** @@ -194,9 +194,9 @@ public function withEncoding(Encoding|string $encoding): self */ public function withTransformation(array $transformation): self { - $obj = clone $this; - $obj['transformation'] = $transformation; + $self = clone $this; + $self['transformation'] = $transformation; - return $obj; + return $self; } } diff --git a/src/SubtitleOverlayTransformation.php b/src/SubtitleOverlayTransformation.php index fad66615..65a926dc 100644 --- a/src/SubtitleOverlayTransformation.php +++ b/src/SubtitleOverlayTransformation.php @@ -108,17 +108,17 @@ public static function with( ?float $fontSize = null, Typography|string|null $typography = null, ): self { - $obj = new self; + $self = new self; - null !== $background && $obj['background'] = $background; - null !== $color && $obj['color'] = $color; - null !== $fontFamily && $obj['fontFamily'] = $fontFamily; - null !== $fontOutline && $obj['fontOutline'] = $fontOutline; - null !== $fontShadow && $obj['fontShadow'] = $fontShadow; - null !== $fontSize && $obj['fontSize'] = $fontSize; - null !== $typography && $obj['typography'] = $typography; + null !== $background && $self['background'] = $background; + null !== $color && $self['color'] = $color; + null !== $fontFamily && $self['fontFamily'] = $fontFamily; + null !== $fontOutline && $self['fontOutline'] = $fontOutline; + null !== $fontShadow && $self['fontShadow'] = $fontShadow; + null !== $fontSize && $self['fontSize'] = $fontSize; + null !== $typography && $self['typography'] = $typography; - return $obj; + return $self; } /** @@ -128,10 +128,10 @@ public static function with( */ public function withBackground(string $background): self { - $obj = clone $this; - $obj['background'] = $background; + $self = clone $this; + $self['background'] = $background; - return $obj; + return $self; } /** @@ -141,10 +141,10 @@ public function withBackground(string $background): self */ public function withColor(string $color): self { - $obj = clone $this; - $obj['color'] = $color; + $self = clone $this; + $self['color'] = $color; - return $obj; + return $self; } /** @@ -152,10 +152,10 @@ public function withColor(string $color): self */ public function withFontFamily(string $fontFamily): self { - $obj = clone $this; - $obj['fontFamily'] = $fontFamily; + $self = clone $this; + $self['fontFamily'] = $fontFamily; - return $obj; + return $self; } /** @@ -167,10 +167,10 @@ public function withFontFamily(string $fontFamily): self */ public function withFontOutline(string $fontOutline): self { - $obj = clone $this; - $obj['fontOutline'] = $fontOutline; + $self = clone $this; + $self['fontOutline'] = $fontOutline; - return $obj; + return $self; } /** @@ -182,10 +182,10 @@ public function withFontOutline(string $fontOutline): self */ public function withFontShadow(string $fontShadow): self { - $obj = clone $this; - $obj['fontShadow'] = $fontShadow; + $self = clone $this; + $self['fontShadow'] = $fontShadow; - return $obj; + return $self; } /** @@ -195,10 +195,10 @@ public function withFontShadow(string $fontShadow): self */ public function withFontSize(float $fontSize): self { - $obj = clone $this; - $obj['fontSize'] = $fontSize; + $self = clone $this; + $self['fontSize'] = $fontSize; - return $obj; + return $self; } /** @@ -210,9 +210,9 @@ public function withFontSize(float $fontSize): self */ public function withTypography(Typography|string $typography): self { - $obj = clone $this; - $obj['typography'] = $typography; + $self = clone $this; + $self['typography'] = $typography; - return $obj; + return $self; } } diff --git a/src/TextOverlay.php b/src/TextOverlay.php index e0b25cc3..98618ccf 100644 --- a/src/TextOverlay.php +++ b/src/TextOverlay.php @@ -119,16 +119,16 @@ public static function with( Encoding|string|null $encoding = null, ?array $transformation = null, ): self { - $obj = new self; + $self = new self; - $obj['text'] = $text; + $self['text'] = $text; - null !== $position && $obj['position'] = $position; - null !== $timing && $obj['timing'] = $timing; - null !== $encoding && $obj['encoding'] = $encoding; - null !== $transformation && $obj['transformation'] = $transformation; + null !== $position && $self['position'] = $position; + null !== $timing && $self['timing'] = $timing; + null !== $encoding && $self['encoding'] = $encoding; + null !== $transformation && $self['transformation'] = $transformation; - return $obj; + return $self; } /** @@ -138,10 +138,10 @@ public static function with( */ public function withPosition(OverlayPosition|array $position): self { - $obj = clone $this; - $obj['position'] = $position; + $self = clone $this; + $self['position'] = $position; - return $obj; + return $self; } /** @@ -153,10 +153,10 @@ public function withPosition(OverlayPosition|array $position): self */ public function withTiming(OverlayTiming|array $timing): self { - $obj = clone $this; - $obj['timing'] = $timing; + $self = clone $this; + $self['timing'] = $timing; - return $obj; + return $self; } /** @@ -164,10 +164,10 @@ public function withTiming(OverlayTiming|array $timing): self */ public function withText(string $text): self { - $obj = clone $this; - $obj['text'] = $text; + $self = clone $this; + $self['text'] = $text; - return $obj; + return $self; } /** @@ -180,10 +180,10 @@ public function withText(string $text): self */ public function withEncoding(Encoding|string $encoding): self { - $obj = clone $this; - $obj['encoding'] = $encoding; + $self = clone $this; + $self['encoding'] = $encoding; - return $obj; + return $self; } /** @@ -207,9 +207,9 @@ public function withEncoding(Encoding|string $encoding): self */ public function withTransformation(array $transformation): self { - $obj = clone $this; - $obj['transformation'] = $transformation; + $self = clone $this; + $self['transformation'] = $transformation; - return $obj; + return $self; } } diff --git a/src/TextOverlayTransformation.php b/src/TextOverlayTransformation.php index df155335..8f64a7dc 100644 --- a/src/TextOverlayTransformation.php +++ b/src/TextOverlayTransformation.php @@ -156,23 +156,23 @@ public static function with( ?string $typography = null, float|string|null $width = null, ): self { - $obj = new self; - - null !== $alpha && $obj['alpha'] = $alpha; - null !== $background && $obj['background'] = $background; - null !== $flip && $obj['flip'] = $flip; - null !== $fontColor && $obj['fontColor'] = $fontColor; - null !== $fontFamily && $obj['fontFamily'] = $fontFamily; - null !== $fontSize && $obj['fontSize'] = $fontSize; - null !== $innerAlignment && $obj['innerAlignment'] = $innerAlignment; - null !== $lineHeight && $obj['lineHeight'] = $lineHeight; - null !== $padding && $obj['padding'] = $padding; - null !== $radius && $obj['radius'] = $radius; - null !== $rotation && $obj['rotation'] = $rotation; - null !== $typography && $obj['typography'] = $typography; - null !== $width && $obj['width'] = $width; - - return $obj; + $self = new self; + + null !== $alpha && $self['alpha'] = $alpha; + null !== $background && $self['background'] = $background; + null !== $flip && $self['flip'] = $flip; + null !== $fontColor && $self['fontColor'] = $fontColor; + null !== $fontFamily && $self['fontFamily'] = $fontFamily; + null !== $fontSize && $self['fontSize'] = $fontSize; + null !== $innerAlignment && $self['innerAlignment'] = $innerAlignment; + null !== $lineHeight && $self['lineHeight'] = $lineHeight; + null !== $padding && $self['padding'] = $padding; + null !== $radius && $self['radius'] = $radius; + null !== $rotation && $self['rotation'] = $rotation; + null !== $typography && $self['typography'] = $typography; + null !== $width && $self['width'] = $width; + + return $self; } /** @@ -180,10 +180,10 @@ public static function with( */ public function withAlpha(float $alpha): self { - $obj = clone $this; - $obj['alpha'] = $alpha; + $self = clone $this; + $self['alpha'] = $alpha; - return $obj; + return $self; } /** @@ -192,10 +192,10 @@ public function withAlpha(float $alpha): self */ public function withBackground(string $background): self { - $obj = clone $this; - $obj['background'] = $background; + $self = clone $this; + $self['background'] = $background; - return $obj; + return $self; } /** @@ -205,10 +205,10 @@ public function withBackground(string $background): self */ public function withFlip(Flip|string $flip): self { - $obj = clone $this; - $obj['flip'] = $flip; + $self = clone $this; + $self['flip'] = $flip; - return $obj; + return $self; } /** @@ -216,10 +216,10 @@ public function withFlip(Flip|string $flip): self */ public function withFontColor(string $fontColor): self { - $obj = clone $this; - $obj['fontColor'] = $fontColor; + $self = clone $this; + $self['fontColor'] = $fontColor; - return $obj; + return $self; } /** @@ -228,10 +228,10 @@ public function withFontColor(string $fontColor): self */ public function withFontFamily(string $fontFamily): self { - $obj = clone $this; - $obj['fontFamily'] = $fontFamily; + $self = clone $this; + $self['fontFamily'] = $fontFamily; - return $obj; + return $self; } /** @@ -239,10 +239,10 @@ public function withFontFamily(string $fontFamily): self */ public function withFontSize(float|string $fontSize): self { - $obj = clone $this; - $obj['fontSize'] = $fontSize; + $self = clone $this; + $self['fontSize'] = $fontSize; - return $obj; + return $self; } /** @@ -253,10 +253,10 @@ public function withFontSize(float|string $fontSize): self public function withInnerAlignment( InnerAlignment|string $innerAlignment ): self { - $obj = clone $this; - $obj['innerAlignment'] = $innerAlignment; + $self = clone $this; + $self['innerAlignment'] = $innerAlignment; - return $obj; + return $self; } /** @@ -265,10 +265,10 @@ public function withInnerAlignment( */ public function withLineHeight(float|string $lineHeight): self { - $obj = clone $this; - $obj['lineHeight'] = $lineHeight; + $self = clone $this; + $self['lineHeight'] = $lineHeight; - return $obj; + return $self; } /** @@ -278,10 +278,10 @@ public function withLineHeight(float|string $lineHeight): self */ public function withPadding(float|string $padding): self { - $obj = clone $this; - $obj['padding'] = $padding; + $self = clone $this; + $self['padding'] = $padding; - return $obj; + return $self; } /** @@ -292,10 +292,10 @@ public function withPadding(float|string $padding): self */ public function withRadius(float|string $radius): self { - $obj = clone $this; - $obj['radius'] = $radius; + $self = clone $this; + $self['radius'] = $radius; - return $obj; + return $self; } /** @@ -304,10 +304,10 @@ public function withRadius(float|string $radius): self */ public function withRotation(float|string $rotation): self { - $obj = clone $this; - $obj['rotation'] = $rotation; + $self = clone $this; + $self['rotation'] = $rotation; - return $obj; + return $self; } /** @@ -318,10 +318,10 @@ public function withRotation(float|string $rotation): self */ public function withTypography(string $typography): self { - $obj = clone $this; - $obj['typography'] = $typography; + $self = clone $this; + $self['typography'] = $typography; - return $obj; + return $self; } /** @@ -330,9 +330,9 @@ public function withTypography(string $typography): self */ public function withWidth(float|string $width): self { - $obj = clone $this; - $obj['width'] = $width; + $self = clone $this; + $self['width'] = $width; - return $obj; + return $self; } } diff --git a/src/Transformation.php b/src/Transformation.php index a8252b3f..31c5d88a 100644 --- a/src/Transformation.php +++ b/src/Transformation.php @@ -564,62 +564,62 @@ public static function with( float|string|null $yCenter = null, ?float $zoom = null, ): self { - $obj = new self; - - null !== $aiChangeBackground && $obj['aiChangeBackground'] = $aiChangeBackground; - null !== $aiDropShadow && $obj['aiDropShadow'] = $aiDropShadow; - null !== $aiEdit && $obj['aiEdit'] = $aiEdit; - null !== $aiRemoveBackground && $obj['aiRemoveBackground'] = $aiRemoveBackground; - null !== $aiRemoveBackgroundExternal && $obj['aiRemoveBackgroundExternal'] = $aiRemoveBackgroundExternal; - null !== $aiRetouch && $obj['aiRetouch'] = $aiRetouch; - null !== $aiUpscale && $obj['aiUpscale'] = $aiUpscale; - null !== $aiVariation && $obj['aiVariation'] = $aiVariation; - null !== $aspectRatio && $obj['aspectRatio'] = $aspectRatio; - null !== $audioCodec && $obj['audioCodec'] = $audioCodec; - null !== $background && $obj['background'] = $background; - null !== $blur && $obj['blur'] = $blur; - null !== $border && $obj['border'] = $border; - null !== $colorProfile && $obj['colorProfile'] = $colorProfile; - null !== $contrastStretch && $obj['contrastStretch'] = $contrastStretch; - null !== $crop && $obj['crop'] = $crop; - null !== $cropMode && $obj['cropMode'] = $cropMode; - null !== $defaultImage && $obj['defaultImage'] = $defaultImage; - null !== $dpr && $obj['dpr'] = $dpr; - null !== $duration && $obj['duration'] = $duration; - null !== $endOffset && $obj['endOffset'] = $endOffset; - null !== $flip && $obj['flip'] = $flip; - null !== $focus && $obj['focus'] = $focus; - null !== $format && $obj['format'] = $format; - null !== $gradient && $obj['gradient'] = $gradient; - null !== $grayscale && $obj['grayscale'] = $grayscale; - null !== $height && $obj['height'] = $height; - null !== $lossless && $obj['lossless'] = $lossless; - null !== $metadata && $obj['metadata'] = $metadata; - null !== $named && $obj['named'] = $named; - null !== $opacity && $obj['opacity'] = $opacity; - null !== $original && $obj['original'] = $original; - null !== $overlay && $obj['overlay'] = $overlay; - null !== $page && $obj['page'] = $page; - null !== $progressive && $obj['progressive'] = $progressive; - null !== $quality && $obj['quality'] = $quality; - null !== $radius && $obj['radius'] = $radius; - null !== $raw && $obj['raw'] = $raw; - null !== $rotation && $obj['rotation'] = $rotation; - null !== $shadow && $obj['shadow'] = $shadow; - null !== $sharpen && $obj['sharpen'] = $sharpen; - null !== $startOffset && $obj['startOffset'] = $startOffset; - null !== $streamingResolutions && $obj['streamingResolutions'] = $streamingResolutions; - null !== $trim && $obj['trim'] = $trim; - null !== $unsharpMask && $obj['unsharpMask'] = $unsharpMask; - null !== $videoCodec && $obj['videoCodec'] = $videoCodec; - null !== $width && $obj['width'] = $width; - null !== $x && $obj['x'] = $x; - null !== $xCenter && $obj['xCenter'] = $xCenter; - null !== $y && $obj['y'] = $y; - null !== $yCenter && $obj['yCenter'] = $yCenter; - null !== $zoom && $obj['zoom'] = $zoom; - - return $obj; + $self = new self; + + null !== $aiChangeBackground && $self['aiChangeBackground'] = $aiChangeBackground; + null !== $aiDropShadow && $self['aiDropShadow'] = $aiDropShadow; + null !== $aiEdit && $self['aiEdit'] = $aiEdit; + null !== $aiRemoveBackground && $self['aiRemoveBackground'] = $aiRemoveBackground; + null !== $aiRemoveBackgroundExternal && $self['aiRemoveBackgroundExternal'] = $aiRemoveBackgroundExternal; + null !== $aiRetouch && $self['aiRetouch'] = $aiRetouch; + null !== $aiUpscale && $self['aiUpscale'] = $aiUpscale; + null !== $aiVariation && $self['aiVariation'] = $aiVariation; + null !== $aspectRatio && $self['aspectRatio'] = $aspectRatio; + null !== $audioCodec && $self['audioCodec'] = $audioCodec; + null !== $background && $self['background'] = $background; + null !== $blur && $self['blur'] = $blur; + null !== $border && $self['border'] = $border; + null !== $colorProfile && $self['colorProfile'] = $colorProfile; + null !== $contrastStretch && $self['contrastStretch'] = $contrastStretch; + null !== $crop && $self['crop'] = $crop; + null !== $cropMode && $self['cropMode'] = $cropMode; + null !== $defaultImage && $self['defaultImage'] = $defaultImage; + null !== $dpr && $self['dpr'] = $dpr; + null !== $duration && $self['duration'] = $duration; + null !== $endOffset && $self['endOffset'] = $endOffset; + null !== $flip && $self['flip'] = $flip; + null !== $focus && $self['focus'] = $focus; + null !== $format && $self['format'] = $format; + null !== $gradient && $self['gradient'] = $gradient; + null !== $grayscale && $self['grayscale'] = $grayscale; + null !== $height && $self['height'] = $height; + null !== $lossless && $self['lossless'] = $lossless; + null !== $metadata && $self['metadata'] = $metadata; + null !== $named && $self['named'] = $named; + null !== $opacity && $self['opacity'] = $opacity; + null !== $original && $self['original'] = $original; + null !== $overlay && $self['overlay'] = $overlay; + null !== $page && $self['page'] = $page; + null !== $progressive && $self['progressive'] = $progressive; + null !== $quality && $self['quality'] = $quality; + null !== $radius && $self['radius'] = $radius; + null !== $raw && $self['raw'] = $raw; + null !== $rotation && $self['rotation'] = $rotation; + null !== $shadow && $self['shadow'] = $shadow; + null !== $sharpen && $self['sharpen'] = $sharpen; + null !== $startOffset && $self['startOffset'] = $startOffset; + null !== $streamingResolutions && $self['streamingResolutions'] = $streamingResolutions; + null !== $trim && $self['trim'] = $trim; + null !== $unsharpMask && $self['unsharpMask'] = $unsharpMask; + null !== $videoCodec && $self['videoCodec'] = $videoCodec; + null !== $width && $self['width'] = $width; + null !== $x && $self['x'] = $x; + null !== $xCenter && $self['xCenter'] = $xCenter; + null !== $y && $self['y'] = $y; + null !== $yCenter && $self['yCenter'] = $yCenter; + null !== $zoom && $self['zoom'] = $zoom; + + return $self; } /** @@ -630,10 +630,10 @@ public static function with( */ public function withAIChangeBackground(string $aiChangeBackground): self { - $obj = clone $this; - $obj['aiChangeBackground'] = $aiChangeBackground; + $self = clone $this; + $self['aiChangeBackground'] = $aiChangeBackground; - return $obj; + return $self; } /** @@ -645,10 +645,10 @@ public function withAIChangeBackground(string $aiChangeBackground): self */ public function withAIDropShadow(string|bool $aiDropShadow): self { - $obj = clone $this; - $obj['aiDropShadow'] = $aiDropShadow; + $self = clone $this; + $self['aiDropShadow'] = $aiDropShadow; - return $obj; + return $self; } /** @@ -659,10 +659,10 @@ public function withAIDropShadow(string|bool $aiDropShadow): self */ public function withAIEdit(string $aiEdit): self { - $obj = clone $this; - $obj['aiEdit'] = $aiEdit; + $self = clone $this; + $self['aiEdit'] = $aiEdit; - return $obj; + return $self; } /** @@ -672,10 +672,10 @@ public function withAIEdit(string $aiEdit): self */ public function withAIRemoveBackground(bool $aiRemoveBackground): self { - $obj = clone $this; - $obj['aiRemoveBackground'] = $aiRemoveBackground; + $self = clone $this; + $self['aiRemoveBackground'] = $aiRemoveBackground; - return $obj; + return $self; } /** @@ -687,10 +687,10 @@ public function withAIRemoveBackground(bool $aiRemoveBackground): self public function withAIRemoveBackgroundExternal( bool $aiRemoveBackgroundExternal ): self { - $obj = clone $this; - $obj['aiRemoveBackgroundExternal'] = $aiRemoveBackgroundExternal; + $self = clone $this; + $self['aiRemoveBackgroundExternal'] = $aiRemoveBackgroundExternal; - return $obj; + return $self; } /** @@ -699,10 +699,10 @@ public function withAIRemoveBackgroundExternal( */ public function withAIRetouch(bool $aiRetouch): self { - $obj = clone $this; - $obj['aiRetouch'] = $aiRetouch; + $self = clone $this; + $self['aiRetouch'] = $aiRetouch; - return $obj; + return $self; } /** @@ -711,10 +711,10 @@ public function withAIRetouch(bool $aiRetouch): self */ public function withAIUpscale(bool $aiUpscale): self { - $obj = clone $this; - $obj['aiUpscale'] = $aiUpscale; + $self = clone $this; + $self['aiUpscale'] = $aiUpscale; - return $obj; + return $self; } /** @@ -724,10 +724,10 @@ public function withAIUpscale(bool $aiUpscale): self */ public function withAIVariation(bool $aiVariation): self { - $obj = clone $this; - $obj['aiVariation'] = $aiVariation; + $self = clone $this; + $self['aiVariation'] = $aiVariation; - return $obj; + return $self; } /** @@ -737,10 +737,10 @@ public function withAIVariation(bool $aiVariation): self */ public function withAspectRatio(float|string $aspectRatio): self { - $obj = clone $this; - $obj['aspectRatio'] = $aspectRatio; + $self = clone $this; + $self['aspectRatio'] = $aspectRatio; - return $obj; + return $self; } /** @@ -750,10 +750,10 @@ public function withAspectRatio(float|string $aspectRatio): self */ public function withAudioCodec(AudioCodec|string $audioCodec): self { - $obj = clone $this; - $obj['audioCodec'] = $audioCodec; + $self = clone $this; + $self['audioCodec'] = $audioCodec; - return $obj; + return $self; } /** @@ -765,10 +765,10 @@ public function withAudioCodec(AudioCodec|string $audioCodec): self */ public function withBackground(string $background): self { - $obj = clone $this; - $obj['background'] = $background; + $self = clone $this; + $self['background'] = $background; - return $obj; + return $self; } /** @@ -777,10 +777,10 @@ public function withBackground(string $background): self */ public function withBlur(float $blur): self { - $obj = clone $this; - $obj['blur'] = $blur; + $self = clone $this; + $self['blur'] = $blur; - return $obj; + return $self; } /** @@ -790,10 +790,10 @@ public function withBlur(float $blur): self */ public function withBorder(string $border): self { - $obj = clone $this; - $obj['border'] = $border; + $self = clone $this; + $self['border'] = $border; - return $obj; + return $self; } /** @@ -802,10 +802,10 @@ public function withBorder(string $border): self */ public function withColorProfile(bool $colorProfile): self { - $obj = clone $this; - $obj['colorProfile'] = $colorProfile; + $self = clone $this; + $self['colorProfile'] = $colorProfile; - return $obj; + return $self; } /** @@ -814,10 +814,10 @@ public function withColorProfile(bool $colorProfile): self */ public function withContrastStretch(bool $contrastStretch): self { - $obj = clone $this; - $obj['contrastStretch'] = $contrastStretch; + $self = clone $this; + $self['contrastStretch'] = $contrastStretch; - return $obj; + return $self; } /** @@ -827,10 +827,10 @@ public function withContrastStretch(bool $contrastStretch): self */ public function withCrop(Crop|string $crop): self { - $obj = clone $this; - $obj['crop'] = $crop; + $self = clone $this; + $self['crop'] = $crop; - return $obj; + return $self; } /** @@ -840,10 +840,10 @@ public function withCrop(Crop|string $crop): self */ public function withCropMode(CropMode|string $cropMode): self { - $obj = clone $this; - $obj['cropMode'] = $cropMode; + $self = clone $this; + $self['cropMode'] = $cropMode; - return $obj; + return $self; } /** @@ -852,10 +852,10 @@ public function withCropMode(CropMode|string $cropMode): self */ public function withDefaultImage(string $defaultImage): self { - $obj = clone $this; - $obj['defaultImage'] = $defaultImage; + $self = clone $this; + $self['defaultImage'] = $defaultImage; - return $obj; + return $self; } /** @@ -864,10 +864,10 @@ public function withDefaultImage(string $defaultImage): self */ public function withDpr(float $dpr): self { - $obj = clone $this; - $obj['dpr'] = $dpr; + $self = clone $this; + $self['dpr'] = $dpr; - return $obj; + return $self; } /** @@ -877,10 +877,10 @@ public function withDpr(float $dpr): self */ public function withDuration(float|string $duration): self { - $obj = clone $this; - $obj['duration'] = $duration; + $self = clone $this; + $self['duration'] = $duration; - return $obj; + return $self; } /** @@ -890,10 +890,10 @@ public function withDuration(float|string $duration): self */ public function withEndOffset(float|string $endOffset): self { - $obj = clone $this; - $obj['endOffset'] = $endOffset; + $self = clone $this; + $self['endOffset'] = $endOffset; - return $obj; + return $self; } /** @@ -905,10 +905,10 @@ public function withEndOffset(float|string $endOffset): self */ public function withFlip(Flip|string $flip): self { - $obj = clone $this; - $obj['flip'] = $flip; + $self = clone $this; + $self['flip'] = $flip; - return $obj; + return $self; } /** @@ -921,10 +921,10 @@ public function withFlip(Flip|string $flip): self */ public function withFocus(string $focus): self { - $obj = clone $this; - $obj['focus'] = $focus; + $self = clone $this; + $self['focus'] = $focus; - return $obj; + return $self; } /** @@ -937,10 +937,10 @@ public function withFocus(string $focus): self */ public function withFormat(Format|string $format): self { - $obj = clone $this; - $obj['format'] = $format; + $self = clone $this; + $self['format'] = $format; - return $obj; + return $self; } /** @@ -949,10 +949,10 @@ public function withFormat(Format|string $format): self */ public function withGradient(string|bool $gradient): self { - $obj = clone $this; - $obj['gradient'] = $gradient; + $self = clone $this; + $self['gradient'] = $gradient; - return $obj; + return $self; } /** @@ -960,10 +960,10 @@ public function withGradient(string|bool $gradient): self */ public function withGrayscale(bool $grayscale): self { - $obj = clone $this; - $obj['grayscale'] = $grayscale; + $self = clone $this; + $self['grayscale'] = $grayscale; - return $obj; + return $self; } /** @@ -973,10 +973,10 @@ public function withGrayscale(bool $grayscale): self */ public function withHeight(float|string $height): self { - $obj = clone $this; - $obj['height'] = $height; + $self = clone $this; + $self['height'] = $height; - return $obj; + return $self; } /** @@ -985,10 +985,10 @@ public function withHeight(float|string $height): self */ public function withLossless(bool $lossless): self { - $obj = clone $this; - $obj['lossless'] = $lossless; + $self = clone $this; + $self['lossless'] = $lossless; - return $obj; + return $self; } /** @@ -998,10 +998,10 @@ public function withLossless(bool $lossless): self */ public function withMetadata(bool $metadata): self { - $obj = clone $this; - $obj['metadata'] = $metadata; + $self = clone $this; + $self['metadata'] = $metadata; - return $obj; + return $self; } /** @@ -1009,10 +1009,10 @@ public function withMetadata(bool $metadata): self */ public function withNamed(string $named): self { - $obj = clone $this; - $obj['named'] = $named; + $self = clone $this; + $self['named'] = $named; - return $obj; + return $self; } /** @@ -1020,10 +1020,10 @@ public function withNamed(string $named): self */ public function withOpacity(float $opacity): self { - $obj = clone $this; - $obj['opacity'] = $opacity; + $self = clone $this; + $self['opacity'] = $opacity; - return $obj; + return $self; } /** @@ -1032,10 +1032,10 @@ public function withOpacity(float $opacity): self */ public function withOriginal(bool $original): self { - $obj = clone $this; - $obj['original'] = $original; + $self = clone $this; + $self['original'] = $original; - return $obj; + return $self; } /** @@ -1045,10 +1045,10 @@ public function withOriginal(bool $original): self */ public function withOverlay(Overlay $overlay): self { - $obj = clone $this; - $obj['overlay'] = $overlay; + $self = clone $this; + $self['overlay'] = $overlay; - return $obj; + return $self; } /** @@ -1059,10 +1059,10 @@ public function withOverlay(Overlay $overlay): self */ public function withPage(float|string $page): self { - $obj = clone $this; - $obj['page'] = $page; + $self = clone $this; + $self['page'] = $page; - return $obj; + return $self; } /** @@ -1072,10 +1072,10 @@ public function withPage(float|string $page): self */ public function withProgressive(bool $progressive): self { - $obj = clone $this; - $obj['progressive'] = $progressive; + $self = clone $this; + $self['progressive'] = $progressive; - return $obj; + return $self; } /** @@ -1085,10 +1085,10 @@ public function withProgressive(bool $progressive): self */ public function withQuality(float $quality): self { - $obj = clone $this; - $obj['quality'] = $quality; + $self = clone $this; + $self['quality'] = $quality; - return $obj; + return $self; } /** @@ -1099,10 +1099,10 @@ public function withQuality(float $quality): self */ public function withRadius(float|string $radius): self { - $obj = clone $this; - $obj['radius'] = $radius; + $self = clone $this; + $self['radius'] = $radius; - return $obj; + return $self; } /** @@ -1111,10 +1111,10 @@ public function withRadius(float|string $radius): self */ public function withRaw(string $raw): self { - $obj = clone $this; - $obj['raw'] = $raw; + $self = clone $this; + $self['raw'] = $raw; - return $obj; + return $self; } /** @@ -1125,10 +1125,10 @@ public function withRaw(string $raw): self */ public function withRotation(float|string $rotation): self { - $obj = clone $this; - $obj['rotation'] = $rotation; + $self = clone $this; + $self['rotation'] = $rotation; - return $obj; + return $self; } /** @@ -1139,10 +1139,10 @@ public function withRotation(float|string $rotation): self */ public function withShadow(string|bool $shadow): self { - $obj = clone $this; - $obj['shadow'] = $shadow; + $self = clone $this; + $self['shadow'] = $shadow; - return $obj; + return $self; } /** @@ -1152,10 +1152,10 @@ public function withShadow(string|bool $shadow): self */ public function withSharpen(float|bool $sharpen): self { - $obj = clone $this; - $obj['sharpen'] = $sharpen; + $self = clone $this; + $self['sharpen'] = $sharpen; - return $obj; + return $self; } /** @@ -1165,10 +1165,10 @@ public function withSharpen(float|bool $sharpen): self */ public function withStartOffset(float|string $startOffset): self { - $obj = clone $this; - $obj['startOffset'] = $startOffset; + $self = clone $this; + $self['startOffset'] = $startOffset; - return $obj; + return $self; } /** @@ -1179,10 +1179,10 @@ public function withStartOffset(float|string $startOffset): self */ public function withStreamingResolutions(array $streamingResolutions): self { - $obj = clone $this; - $obj['streamingResolutions'] = $streamingResolutions; + $self = clone $this; + $self['streamingResolutions'] = $streamingResolutions; - return $obj; + return $self; } /** @@ -1192,10 +1192,10 @@ public function withStreamingResolutions(array $streamingResolutions): self */ public function withTrim(float|bool $trim): self { - $obj = clone $this; - $obj['trim'] = $trim; + $self = clone $this; + $self['trim'] = $trim; - return $obj; + return $self; } /** @@ -1205,10 +1205,10 @@ public function withTrim(float|bool $trim): self */ public function withUnsharpMask(string|bool $unsharpMask): self { - $obj = clone $this; - $obj['unsharpMask'] = $unsharpMask; + $self = clone $this; + $self['unsharpMask'] = $unsharpMask; - return $obj; + return $self; } /** @@ -1218,10 +1218,10 @@ public function withUnsharpMask(string|bool $unsharpMask): self */ public function withVideoCodec(VideoCodec|string $videoCodec): self { - $obj = clone $this; - $obj['videoCodec'] = $videoCodec; + $self = clone $this; + $self['videoCodec'] = $videoCodec; - return $obj; + return $self; } /** @@ -1231,10 +1231,10 @@ public function withVideoCodec(VideoCodec|string $videoCodec): self */ public function withWidth(float|string $width): self { - $obj = clone $this; - $obj['width'] = $width; + $self = clone $this; + $self['width'] = $width; - return $obj; + return $self; } /** @@ -1242,10 +1242,10 @@ public function withWidth(float|string $width): self */ public function withX(float|string $x): self { - $obj = clone $this; - $obj['x'] = $x; + $self = clone $this; + $self['x'] = $x; - return $obj; + return $self; } /** @@ -1253,10 +1253,10 @@ public function withX(float|string $x): self */ public function withXCenter(float|string $xCenter): self { - $obj = clone $this; - $obj['xCenter'] = $xCenter; + $self = clone $this; + $self['xCenter'] = $xCenter; - return $obj; + return $self; } /** @@ -1264,10 +1264,10 @@ public function withXCenter(float|string $xCenter): self */ public function withY(float|string $y): self { - $obj = clone $this; - $obj['y'] = $y; + $self = clone $this; + $self['y'] = $y; - return $obj; + return $self; } /** @@ -1275,10 +1275,10 @@ public function withY(float|string $y): self */ public function withYCenter(float|string $yCenter): self { - $obj = clone $this; - $obj['yCenter'] = $yCenter; + $self = clone $this; + $self['yCenter'] = $yCenter; - return $obj; + return $self; } /** @@ -1288,9 +1288,9 @@ public function withYCenter(float|string $yCenter): self */ public function withZoom(float $zoom): self { - $obj = clone $this; - $obj['zoom'] = $zoom; + $self = clone $this; + $self['zoom'] = $zoom; - return $obj; + return $self; } } diff --git a/src/VideoOverlay.php b/src/VideoOverlay.php index f363e2ad..539aac3a 100644 --- a/src/VideoOverlay.php +++ b/src/VideoOverlay.php @@ -104,16 +104,16 @@ public static function with( Encoding|string|null $encoding = null, ?array $transformation = null, ): self { - $obj = new self; + $self = new self; - $obj['input'] = $input; + $self['input'] = $input; - null !== $position && $obj['position'] = $position; - null !== $timing && $obj['timing'] = $timing; - null !== $encoding && $obj['encoding'] = $encoding; - null !== $transformation && $obj['transformation'] = $transformation; + null !== $position && $self['position'] = $position; + null !== $timing && $self['timing'] = $timing; + null !== $encoding && $self['encoding'] = $encoding; + null !== $transformation && $self['transformation'] = $transformation; - return $obj; + return $self; } /** @@ -123,10 +123,10 @@ public static function with( */ public function withPosition(OverlayPosition|array $position): self { - $obj = clone $this; - $obj['position'] = $position; + $self = clone $this; + $self['position'] = $position; - return $obj; + return $self; } /** @@ -138,10 +138,10 @@ public function withPosition(OverlayPosition|array $position): self */ public function withTiming(OverlayTiming|array $timing): self { - $obj = clone $this; - $obj['timing'] = $timing; + $self = clone $this; + $self['timing'] = $timing; - return $obj; + return $self; } /** @@ -149,10 +149,10 @@ public function withTiming(OverlayTiming|array $timing): self */ public function withInput(string $input): self { - $obj = clone $this; - $obj['input'] = $input; + $self = clone $this; + $self['input'] = $input; - return $obj; + return $self; } /** @@ -165,10 +165,10 @@ public function withInput(string $input): self */ public function withEncoding(Encoding|string $encoding): self { - $obj = clone $this; - $obj['encoding'] = $encoding; + $self = clone $this; + $self['encoding'] = $encoding; - return $obj; + return $self; } /** @@ -179,9 +179,9 @@ public function withEncoding(Encoding|string $encoding): self */ public function withTransformation(array $transformation): self { - $obj = clone $this; - $obj['transformation'] = $transformation; + $self = clone $this; + $self['transformation'] = $transformation; - return $obj; + return $self; } } diff --git a/src/Webhooks/BaseWebhookEvent.php b/src/Webhooks/BaseWebhookEvent.php index c5b1cafa..c91cc020 100644 --- a/src/Webhooks/BaseWebhookEvent.php +++ b/src/Webhooks/BaseWebhookEvent.php @@ -54,12 +54,12 @@ public function __construct() */ public static function with(string $id, string $type): self { - $obj = new self; + $self = new self; - $obj['id'] = $id; - $obj['type'] = $type; + $self['id'] = $id; + $self['type'] = $type; - return $obj; + return $self; } /** @@ -67,10 +67,10 @@ public static function with(string $id, string $type): self */ public function withID(string $id): self { - $obj = clone $this; - $obj['id'] = $id; + $self = clone $this; + $self['id'] = $id; - return $obj; + return $self; } /** @@ -78,9 +78,9 @@ public function withID(string $id): self */ public function withType(string $type): self { - $obj = clone $this; - $obj['type'] = $type; + $self = clone $this; + $self['type'] = $type; - return $obj; + return $self; } } diff --git a/src/Webhooks/UploadPostTransformErrorEvent.php b/src/Webhooks/UploadPostTransformErrorEvent.php index fc9788ba..05ccf202 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent.php +++ b/src/Webhooks/UploadPostTransformErrorEvent.php @@ -101,15 +101,15 @@ public static function with( Data|array $data, Request|array $request, ): self { - $obj = new self; + $self = new self; - $obj['id'] = $id; - $obj['type'] = $type; - $obj['createdAt'] = $createdAt; - $obj['data'] = $data; - $obj['request'] = $request; + $self['id'] = $id; + $self['type'] = $type; + $self['createdAt'] = $createdAt; + $self['data'] = $data; + $self['request'] = $request; - return $obj; + return $self; } /** @@ -117,10 +117,10 @@ public static function with( */ public function withID(string $id): self { - $obj = clone $this; - $obj['id'] = $id; + $self = clone $this; + $self['id'] = $id; - return $obj; + return $self; } /** @@ -128,10 +128,10 @@ public function withID(string $id): self */ public function withType(string $type): self { - $obj = clone $this; - $obj['type'] = $type; + $self = clone $this; + $self['type'] = $type; - return $obj; + return $self; } /** @@ -139,10 +139,10 @@ public function withType(string $type): self */ public function withCreatedAt(\DateTimeInterface $createdAt): self { - $obj = clone $this; - $obj['createdAt'] = $createdAt; + $self = clone $this; + $self['createdAt'] = $createdAt; - return $obj; + return $self; } /** @@ -156,10 +156,10 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self */ public function withData(Data|array $data): self { - $obj = clone $this; - $obj['data'] = $data; + $self = clone $this; + $self['data'] = $data; - return $obj; + return $self; } /** @@ -170,9 +170,9 @@ public function withData(Data|array $data): self */ public function withRequest(Request|array $request): self { - $obj = clone $this; - $obj['request'] = $request; + $self = clone $this; + $self['request'] = $request; - return $obj; + return $self; } } diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data.php b/src/Webhooks/UploadPostTransformErrorEvent/Data.php index fb728438..ded8dece 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Data.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data.php @@ -89,15 +89,15 @@ public static function with( Transformation|array $transformation, string $url, ): self { - $obj = new self; + $self = new self; - $obj['fileID'] = $fileID; - $obj['name'] = $name; - $obj['path'] = $path; - $obj['transformation'] = $transformation; - $obj['url'] = $url; + $self['fileID'] = $fileID; + $self['name'] = $name; + $self['path'] = $path; + $self['transformation'] = $transformation; + $self['url'] = $url; - return $obj; + return $self; } /** @@ -105,10 +105,10 @@ public static function with( */ public function withFileID(string $fileID): self { - $obj = clone $this; - $obj['fileID'] = $fileID; + $self = clone $this; + $self['fileID'] = $fileID; - return $obj; + return $self; } /** @@ -116,10 +116,10 @@ public function withFileID(string $fileID): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -127,10 +127,10 @@ public function withName(string $name): self */ public function withPath(string $path): self { - $obj = clone $this; - $obj['path'] = $path; + $self = clone $this; + $self['path'] = $path; - return $obj; + return $self; } /** @@ -139,10 +139,10 @@ public function withPath(string $path): self public function withTransformation( Transformation|array $transformation ): self { - $obj = clone $this; - $obj['transformation'] = $transformation; + $self = clone $this; + $self['transformation'] = $transformation; - return $obj; + return $self; } /** @@ -150,9 +150,9 @@ public function withTransformation( */ public function withURL(string $url): self { - $obj = clone $this; - $obj['url'] = $url; + $self = clone $this; + $self['url'] = $url; - return $obj; + return $self; } } diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php index 2f9c5dc2..ed209c11 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php @@ -48,11 +48,11 @@ public function __construct() */ public static function with(Error|array $error): self { - $obj = new self; + $self = new self; - $obj['error'] = $error; + $self['error'] = $error; - return $obj; + return $self; } /** @@ -60,9 +60,9 @@ public static function with(Error|array $error): self */ public function withError(Error|array $error): self { - $obj = clone $this; - $obj['error'] = $error; + $self = clone $this; + $self['error'] = $error; - return $obj; + return $self; } } diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php index 322726f9..a3b4f219 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php @@ -48,11 +48,11 @@ public function __construct() */ public static function with(string $reason): self { - $obj = new self; + $self = new self; - $obj['reason'] = $reason; + $self['reason'] = $reason; - return $obj; + return $self; } /** @@ -60,9 +60,9 @@ public static function with(string $reason): self */ public function withReason(string $reason): self { - $obj = clone $this; - $obj['reason'] = $reason; + $self = clone $this; + $self['reason'] = $reason; - return $obj; + return $self; } } diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request.php b/src/Webhooks/UploadPostTransformErrorEvent/Request.php index 5b7441ce..b125a023 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request.php @@ -62,12 +62,12 @@ public static function with( Transformation|array $transformation, string $xRequestID ): self { - $obj = new self; + $self = new self; - $obj['transformation'] = $transformation; - $obj['xRequestID'] = $xRequestID; + $self['transformation'] = $transformation; + $self['xRequestID'] = $xRequestID; - return $obj; + return $self; } /** @@ -78,10 +78,10 @@ public static function with( public function withTransformation( Transformation|array $transformation ): self { - $obj = clone $this; - $obj['transformation'] = $transformation; + $self = clone $this; + $self['transformation'] = $transformation; - return $obj; + return $self; } /** @@ -89,9 +89,9 @@ public function withTransformation( */ public function withXRequestID(string $xRequestID): self { - $obj = clone $this; - $obj['xRequestID'] = $xRequestID; + $self = clone $this; + $self['xRequestID'] = $xRequestID; - return $obj; + return $self; } } diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php index 7e2b9ecd..f1e0a5c3 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php @@ -75,14 +75,14 @@ public static function with( Protocol|string|null $protocol = null, ?string $value = null ): self { - $obj = new self; + $self = new self; - $obj['type'] = $type; + $self['type'] = $type; - null !== $protocol && $obj['protocol'] = $protocol; - null !== $value && $obj['value'] = $value; + null !== $protocol && $self['protocol'] = $protocol; + null !== $value && $self['value'] = $value; - return $obj; + return $self; } /** @@ -92,10 +92,10 @@ public static function with( */ public function withType(Type|string $type): self { - $obj = clone $this; - $obj['type'] = $type; + $self = clone $this; + $self['type'] = $type; - return $obj; + return $self; } /** @@ -105,10 +105,10 @@ public function withType(Type|string $type): self */ public function withProtocol(Protocol|string $protocol): self { - $obj = clone $this; - $obj['protocol'] = $protocol; + $self = clone $this; + $self['protocol'] = $protocol; - return $obj; + return $self; } /** @@ -116,9 +116,9 @@ public function withProtocol(Protocol|string $protocol): self */ public function withValue(string $value): self { - $obj = clone $this; - $obj['value'] = $value; + $self = clone $this; + $self['value'] = $value; - return $obj; + return $self; } } diff --git a/src/Webhooks/UploadPostTransformSuccessEvent.php b/src/Webhooks/UploadPostTransformSuccessEvent.php index 29902e4d..30ecbe35 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent.php @@ -94,15 +94,15 @@ public static function with( Data|array $data, Request|array $request, ): self { - $obj = new self; + $self = new self; - $obj['id'] = $id; - $obj['type'] = $type; - $obj['createdAt'] = $createdAt; - $obj['data'] = $data; - $obj['request'] = $request; + $self['id'] = $id; + $self['type'] = $type; + $self['createdAt'] = $createdAt; + $self['data'] = $data; + $self['request'] = $request; - return $obj; + return $self; } /** @@ -110,10 +110,10 @@ public static function with( */ public function withID(string $id): self { - $obj = clone $this; - $obj['id'] = $id; + $self = clone $this; + $self['id'] = $id; - return $obj; + return $self; } /** @@ -121,10 +121,10 @@ public function withID(string $id): self */ public function withType(string $type): self { - $obj = clone $this; - $obj['type'] = $type; + $self = clone $this; + $self['type'] = $type; - return $obj; + return $self; } /** @@ -132,10 +132,10 @@ public function withType(string $type): self */ public function withCreatedAt(\DateTimeInterface $createdAt): self { - $obj = clone $this; - $obj['createdAt'] = $createdAt; + $self = clone $this; + $self['createdAt'] = $createdAt; - return $obj; + return $self; } /** @@ -143,10 +143,10 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self */ public function withData(Data|array $data): self { - $obj = clone $this; - $obj['data'] = $data; + $self = clone $this; + $self['data'] = $data; - return $obj; + return $self; } /** @@ -156,9 +156,9 @@ public function withData(Data|array $data): self */ public function withRequest(Request|array $request): self { - $obj = clone $this; - $obj['request'] = $request; + $self = clone $this; + $self['request'] = $request; - return $obj; + return $self; } } diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Data.php b/src/Webhooks/UploadPostTransformSuccessEvent/Data.php index 43a1721c..9bfe6258 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Data.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Data.php @@ -60,13 +60,13 @@ public function __construct() */ public static function with(string $fileID, string $name, string $url): self { - $obj = new self; + $self = new self; - $obj['fileID'] = $fileID; - $obj['name'] = $name; - $obj['url'] = $url; + $self['fileID'] = $fileID; + $self['name'] = $name; + $self['url'] = $url; - return $obj; + return $self; } /** @@ -74,10 +74,10 @@ public static function with(string $fileID, string $name, string $url): self */ public function withFileID(string $fileID): self { - $obj = clone $this; - $obj['fileID'] = $fileID; + $self = clone $this; + $self['fileID'] = $fileID; - return $obj; + return $self; } /** @@ -85,10 +85,10 @@ public function withFileID(string $fileID): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -96,9 +96,9 @@ public function withName(string $name): self */ public function withURL(string $url): self { - $obj = clone $this; - $obj['url'] = $url; + $self = clone $this; + $self['url'] = $url; - return $obj; + return $self; } } diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request.php index 161f26b8..f39acb27 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request.php @@ -62,12 +62,12 @@ public static function with( Transformation|array $transformation, string $xRequestID ): self { - $obj = new self; + $self = new self; - $obj['transformation'] = $transformation; - $obj['xRequestID'] = $xRequestID; + $self['transformation'] = $transformation; + $self['xRequestID'] = $xRequestID; - return $obj; + return $self; } /** @@ -78,10 +78,10 @@ public static function with( public function withTransformation( Transformation|array $transformation ): self { - $obj = clone $this; - $obj['transformation'] = $transformation; + $self = clone $this; + $self['transformation'] = $transformation; - return $obj; + return $self; } /** @@ -89,9 +89,9 @@ public function withTransformation( */ public function withXRequestID(string $xRequestID): self { - $obj = clone $this; - $obj['xRequestID'] = $xRequestID; + $self = clone $this; + $self['xRequestID'] = $xRequestID; - return $obj; + return $self; } } diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php index 5318565d..27d17c20 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php @@ -75,14 +75,14 @@ public static function with( Protocol|string|null $protocol = null, ?string $value = null ): self { - $obj = new self; + $self = new self; - $obj['type'] = $type; + $self['type'] = $type; - null !== $protocol && $obj['protocol'] = $protocol; - null !== $value && $obj['value'] = $value; + null !== $protocol && $self['protocol'] = $protocol; + null !== $value && $self['value'] = $value; - return $obj; + return $self; } /** @@ -92,10 +92,10 @@ public static function with( */ public function withType(Type|string $type): self { - $obj = clone $this; - $obj['type'] = $type; + $self = clone $this; + $self['type'] = $type; - return $obj; + return $self; } /** @@ -105,10 +105,10 @@ public function withType(Type|string $type): self */ public function withProtocol(Protocol|string $protocol): self { - $obj = clone $this; - $obj['protocol'] = $protocol; + $self = clone $this; + $self['protocol'] = $protocol; - return $obj; + return $self; } /** @@ -116,9 +116,9 @@ public function withProtocol(Protocol|string $protocol): self */ public function withValue(string $value): self { - $obj = clone $this; - $obj['value'] = $value; + $self = clone $this; + $self['value'] = $value; - return $obj; + return $self; } } diff --git a/src/Webhooks/UploadPreTransformErrorEvent.php b/src/Webhooks/UploadPreTransformErrorEvent.php index 650803b3..6938ea00 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent.php +++ b/src/Webhooks/UploadPreTransformErrorEvent.php @@ -94,15 +94,15 @@ public static function with( Data|array $data, Request|array $request, ): self { - $obj = new self; + $self = new self; - $obj['id'] = $id; - $obj['type'] = $type; - $obj['createdAt'] = $createdAt; - $obj['data'] = $data; - $obj['request'] = $request; + $self['id'] = $id; + $self['type'] = $type; + $self['createdAt'] = $createdAt; + $self['data'] = $data; + $self['request'] = $request; - return $obj; + return $self; } /** @@ -110,10 +110,10 @@ public static function with( */ public function withID(string $id): self { - $obj = clone $this; - $obj['id'] = $id; + $self = clone $this; + $self['id'] = $id; - return $obj; + return $self; } /** @@ -121,10 +121,10 @@ public function withID(string $id): self */ public function withType(string $type): self { - $obj = clone $this; - $obj['type'] = $type; + $self = clone $this; + $self['type'] = $type; - return $obj; + return $self; } /** @@ -132,10 +132,10 @@ public function withType(string $type): self */ public function withCreatedAt(\DateTimeInterface $createdAt): self { - $obj = clone $this; - $obj['createdAt'] = $createdAt; + $self = clone $this; + $self['createdAt'] = $createdAt; - return $obj; + return $self; } /** @@ -145,10 +145,10 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self */ public function withData(Data|array $data): self { - $obj = clone $this; - $obj['data'] = $data; + $self = clone $this; + $self['data'] = $data; - return $obj; + return $self; } /** @@ -156,9 +156,9 @@ public function withData(Data|array $data): self */ public function withRequest(Request|array $request): self { - $obj = clone $this; - $obj['request'] = $request; + $self = clone $this; + $self['request'] = $request; - return $obj; + return $self; } } diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data.php b/src/Webhooks/UploadPreTransformErrorEvent/Data.php index 1cec48dd..0bcafcab 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Data.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data.php @@ -66,13 +66,13 @@ public static function with( string $path, Transformation|array $transformation ): self { - $obj = new self; + $self = new self; - $obj['name'] = $name; - $obj['path'] = $path; - $obj['transformation'] = $transformation; + $self['name'] = $name; + $self['path'] = $path; + $self['transformation'] = $transformation; - return $obj; + return $self; } /** @@ -80,10 +80,10 @@ public static function with( */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -91,10 +91,10 @@ public function withName(string $name): self */ public function withPath(string $path): self { - $obj = clone $this; - $obj['path'] = $path; + $self = clone $this; + $self['path'] = $path; - return $obj; + return $self; } /** @@ -103,9 +103,9 @@ public function withPath(string $path): self public function withTransformation( Transformation|array $transformation ): self { - $obj = clone $this; - $obj['transformation'] = $transformation; + $self = clone $this; + $self['transformation'] = $transformation; - return $obj; + return $self; } } diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php index 2748faff..7386b3d3 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php @@ -48,11 +48,11 @@ public function __construct() */ public static function with(Error|array $error): self { - $obj = new self; + $self = new self; - $obj['error'] = $error; + $self['error'] = $error; - return $obj; + return $self; } /** @@ -60,9 +60,9 @@ public static function with(Error|array $error): self */ public function withError(Error|array $error): self { - $obj = clone $this; - $obj['error'] = $error; + $self = clone $this; + $self['error'] = $error; - return $obj; + return $self; } } diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php index 18d37e74..48554237 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php @@ -48,11 +48,11 @@ public function __construct() */ public static function with(string $reason): self { - $obj = new self; + $self = new self; - $obj['reason'] = $reason; + $self['reason'] = $reason; - return $obj; + return $self; } /** @@ -60,9 +60,9 @@ public static function with(string $reason): self */ public function withReason(string $reason): self { - $obj = clone $this; - $obj['reason'] = $reason; + $self = clone $this; + $self['reason'] = $reason; - return $obj; + return $self; } } diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Request.php b/src/Webhooks/UploadPreTransformErrorEvent/Request.php index 2730c0d9..2e7acc64 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Request.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Request.php @@ -56,12 +56,12 @@ public static function with( string $transformation, string $xRequestID ): self { - $obj = new self; + $self = new self; - $obj['transformation'] = $transformation; - $obj['xRequestID'] = $xRequestID; + $self['transformation'] = $transformation; + $self['xRequestID'] = $xRequestID; - return $obj; + return $self; } /** @@ -69,10 +69,10 @@ public static function with( */ public function withTransformation(string $transformation): self { - $obj = clone $this; - $obj['transformation'] = $transformation; + $self = clone $this; + $self['transformation'] = $transformation; - return $obj; + return $self; } /** @@ -80,9 +80,9 @@ public function withTransformation(string $transformation): self */ public function withXRequestID(string $xRequestID): self { - $obj = clone $this; - $obj['xRequestID'] = $xRequestID; + $self = clone $this; + $self['xRequestID'] = $xRequestID; - return $obj; + return $self; } } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent.php b/src/Webhooks/UploadPreTransformSuccessEvent.php index 937b8ca2..1fc100e4 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent.php @@ -125,15 +125,15 @@ public static function with( Data|array $data, Request|array $request, ): self { - $obj = new self; + $self = new self; - $obj['id'] = $id; - $obj['type'] = $type; - $obj['createdAt'] = $createdAt; - $obj['data'] = $data; - $obj['request'] = $request; + $self['id'] = $id; + $self['type'] = $type; + $self['createdAt'] = $createdAt; + $self['data'] = $data; + $self['request'] = $request; - return $obj; + return $self; } /** @@ -141,10 +141,10 @@ public static function with( */ public function withID(string $id): self { - $obj = clone $this; - $obj['id'] = $id; + $self = clone $this; + $self['id'] = $id; - return $obj; + return $self; } /** @@ -152,10 +152,10 @@ public function withID(string $id): self */ public function withType(string $type): self { - $obj = clone $this; - $obj['type'] = $type; + $self = clone $this; + $self['type'] = $type; - return $obj; + return $self; } /** @@ -163,10 +163,10 @@ public function withType(string $type): self */ public function withCreatedAt(\DateTimeInterface $createdAt): self { - $obj = clone $this; - $obj['createdAt'] = $createdAt; + $self = clone $this; + $self['createdAt'] = $createdAt; - return $obj; + return $self; } /** @@ -202,10 +202,10 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self */ public function withData(Data|array $data): self { - $obj = clone $this; - $obj['data'] = $data; + $self = clone $this; + $self['data'] = $data; - return $obj; + return $self; } /** @@ -213,9 +213,9 @@ public function withData(Data|array $data): self */ public function withRequest(Request|array $request): self { - $obj = clone $this; - $obj['request'] = $request; + $self = clone $this; + $self['request'] = $request; - return $obj; + return $self; } } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php index e10ed1f6..43345ec5 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php @@ -304,35 +304,35 @@ public static function with( ?string $videoCodec = null, ?float $width = null, ): self { - $obj = new self; - - null !== $aiTags && $obj['aiTags'] = $aiTags; - null !== $audioCodec && $obj['audioCodec'] = $audioCodec; - null !== $bitRate && $obj['bitRate'] = $bitRate; - null !== $customCoordinates && $obj['customCoordinates'] = $customCoordinates; - null !== $customMetadata && $obj['customMetadata'] = $customMetadata; - null !== $description && $obj['description'] = $description; - null !== $duration && $obj['duration'] = $duration; - null !== $embeddedMetadata && $obj['embeddedMetadata'] = $embeddedMetadata; - null !== $extensionStatus && $obj['extensionStatus'] = $extensionStatus; - null !== $fileID && $obj['fileID'] = $fileID; - null !== $filePath && $obj['filePath'] = $filePath; - null !== $fileType && $obj['fileType'] = $fileType; - null !== $height && $obj['height'] = $height; - null !== $isPrivateFile && $obj['isPrivateFile'] = $isPrivateFile; - null !== $isPublished && $obj['isPublished'] = $isPublished; - null !== $metadata && $obj['metadata'] = $metadata; - null !== $name && $obj['name'] = $name; - null !== $selectedFieldsSchema && $obj['selectedFieldsSchema'] = $selectedFieldsSchema; - null !== $size && $obj['size'] = $size; - null !== $tags && $obj['tags'] = $tags; - null !== $thumbnailURL && $obj['thumbnailURL'] = $thumbnailURL; - null !== $url && $obj['url'] = $url; - null !== $versionInfo && $obj['versionInfo'] = $versionInfo; - null !== $videoCodec && $obj['videoCodec'] = $videoCodec; - null !== $width && $obj['width'] = $width; - - return $obj; + $self = new self; + + null !== $aiTags && $self['aiTags'] = $aiTags; + null !== $audioCodec && $self['audioCodec'] = $audioCodec; + null !== $bitRate && $self['bitRate'] = $bitRate; + null !== $customCoordinates && $self['customCoordinates'] = $customCoordinates; + null !== $customMetadata && $self['customMetadata'] = $customMetadata; + null !== $description && $self['description'] = $description; + null !== $duration && $self['duration'] = $duration; + null !== $embeddedMetadata && $self['embeddedMetadata'] = $embeddedMetadata; + null !== $extensionStatus && $self['extensionStatus'] = $extensionStatus; + null !== $fileID && $self['fileID'] = $fileID; + null !== $filePath && $self['filePath'] = $filePath; + null !== $fileType && $self['fileType'] = $fileType; + null !== $height && $self['height'] = $height; + null !== $isPrivateFile && $self['isPrivateFile'] = $isPrivateFile; + null !== $isPublished && $self['isPublished'] = $isPublished; + null !== $metadata && $self['metadata'] = $metadata; + null !== $name && $self['name'] = $name; + null !== $selectedFieldsSchema && $self['selectedFieldsSchema'] = $selectedFieldsSchema; + null !== $size && $self['size'] = $size; + null !== $tags && $self['tags'] = $tags; + null !== $thumbnailURL && $self['thumbnailURL'] = $thumbnailURL; + null !== $url && $self['url'] = $url; + null !== $versionInfo && $self['versionInfo'] = $versionInfo; + null !== $videoCodec && $self['videoCodec'] = $videoCodec; + null !== $width && $self['width'] = $width; + + return $self; } /** @@ -344,10 +344,10 @@ public static function with( */ public function withAITags(?array $aiTags): self { - $obj = clone $this; - $obj['aiTags'] = $aiTags; + $self = clone $this; + $self['aiTags'] = $aiTags; - return $obj; + return $self; } /** @@ -355,10 +355,10 @@ public function withAITags(?array $aiTags): self */ public function withAudioCodec(string $audioCodec): self { - $obj = clone $this; - $obj['audioCodec'] = $audioCodec; + $self = clone $this; + $self['audioCodec'] = $audioCodec; - return $obj; + return $self; } /** @@ -366,10 +366,10 @@ public function withAudioCodec(string $audioCodec): self */ public function withBitRate(int $bitRate): self { - $obj = clone $this; - $obj['bitRate'] = $bitRate; + $self = clone $this; + $self['bitRate'] = $bitRate; - return $obj; + return $self; } /** @@ -377,10 +377,10 @@ public function withBitRate(int $bitRate): self */ public function withCustomCoordinates(?string $customCoordinates): self { - $obj = clone $this; - $obj['customCoordinates'] = $customCoordinates; + $self = clone $this; + $self['customCoordinates'] = $customCoordinates; - return $obj; + return $self; } /** @@ -390,10 +390,10 @@ public function withCustomCoordinates(?string $customCoordinates): self */ public function withCustomMetadata(array $customMetadata): self { - $obj = clone $this; - $obj['customMetadata'] = $customMetadata; + $self = clone $this; + $self['customMetadata'] = $customMetadata; - return $obj; + return $self; } /** @@ -401,10 +401,10 @@ public function withCustomMetadata(array $customMetadata): self */ public function withDescription(string $description): self { - $obj = clone $this; - $obj['description'] = $description; + $self = clone $this; + $self['description'] = $description; - return $obj; + return $self; } /** @@ -412,10 +412,10 @@ public function withDescription(string $description): self */ public function withDuration(int $duration): self { - $obj = clone $this; - $obj['duration'] = $duration; + $self = clone $this; + $self['duration'] = $duration; - return $obj; + return $self; } /** @@ -425,10 +425,10 @@ public function withDuration(int $duration): self */ public function withEmbeddedMetadata(array $embeddedMetadata): self { - $obj = clone $this; - $obj['embeddedMetadata'] = $embeddedMetadata; + $self = clone $this; + $self['embeddedMetadata'] = $embeddedMetadata; - return $obj; + return $self; } /** @@ -450,10 +450,10 @@ public function withEmbeddedMetadata(array $embeddedMetadata): self public function withExtensionStatus( ExtensionStatus|array $extensionStatus ): self { - $obj = clone $this; - $obj['extensionStatus'] = $extensionStatus; + $self = clone $this; + $self['extensionStatus'] = $extensionStatus; - return $obj; + return $self; } /** @@ -461,10 +461,10 @@ public function withExtensionStatus( */ public function withFileID(string $fileID): self { - $obj = clone $this; - $obj['fileID'] = $fileID; + $self = clone $this; + $self['fileID'] = $fileID; - return $obj; + return $self; } /** @@ -472,10 +472,10 @@ public function withFileID(string $fileID): self */ public function withFilePath(string $filePath): self { - $obj = clone $this; - $obj['filePath'] = $filePath; + $self = clone $this; + $self['filePath'] = $filePath; - return $obj; + return $self; } /** @@ -483,10 +483,10 @@ public function withFilePath(string $filePath): self */ public function withFileType(string $fileType): self { - $obj = clone $this; - $obj['fileType'] = $fileType; + $self = clone $this; + $self['fileType'] = $fileType; - return $obj; + return $self; } /** @@ -494,10 +494,10 @@ public function withFileType(string $fileType): self */ public function withHeight(float $height): self { - $obj = clone $this; - $obj['height'] = $height; + $self = clone $this; + $self['height'] = $height; - return $obj; + return $self; } /** @@ -505,10 +505,10 @@ public function withHeight(float $height): self */ public function withIsPrivateFile(bool $isPrivateFile): self { - $obj = clone $this; - $obj['isPrivateFile'] = $isPrivateFile; + $self = clone $this; + $self['isPrivateFile'] = $isPrivateFile; - return $obj; + return $self; } /** @@ -516,10 +516,10 @@ public function withIsPrivateFile(bool $isPrivateFile): self */ public function withIsPublished(bool $isPublished): self { - $obj = clone $this; - $obj['isPublished'] = $isPublished; + $self = clone $this; + $self['isPublished'] = $isPublished; - return $obj; + return $self; } /** @@ -544,10 +544,10 @@ public function withIsPublished(bool $isPublished): self */ public function withMetadata(Metadata|array $metadata): self { - $obj = clone $this; - $obj['metadata'] = $metadata; + $self = clone $this; + $self['metadata'] = $metadata; - return $obj; + return $self; } /** @@ -555,10 +555,10 @@ public function withMetadata(Metadata|array $metadata): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -583,10 +583,10 @@ public function withName(string $name): self */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { - $obj = clone $this; - $obj['selectedFieldsSchema'] = $selectedFieldsSchema; + $self = clone $this; + $self['selectedFieldsSchema'] = $selectedFieldsSchema; - return $obj; + return $self; } /** @@ -594,10 +594,10 @@ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self */ public function withSize(float $size): self { - $obj = clone $this; - $obj['size'] = $size; + $self = clone $this; + $self['size'] = $size; - return $obj; + return $self; } /** @@ -607,10 +607,10 @@ public function withSize(float $size): self */ public function withTags(?array $tags): self { - $obj = clone $this; - $obj['tags'] = $tags; + $self = clone $this; + $self['tags'] = $tags; - return $obj; + return $self; } /** @@ -618,10 +618,10 @@ public function withTags(?array $tags): self */ public function withThumbnailURL(string $thumbnailURL): self { - $obj = clone $this; - $obj['thumbnailURL'] = $thumbnailURL; + $self = clone $this; + $self['thumbnailURL'] = $thumbnailURL; - return $obj; + return $self; } /** @@ -629,10 +629,10 @@ public function withThumbnailURL(string $thumbnailURL): self */ public function withURL(string $url): self { - $obj = clone $this; - $obj['url'] = $url; + $self = clone $this; + $self['url'] = $url; - return $obj; + return $self; } /** @@ -642,10 +642,10 @@ public function withURL(string $url): self */ public function withVersionInfo(VersionInfo|array $versionInfo): self { - $obj = clone $this; - $obj['versionInfo'] = $versionInfo; + $self = clone $this; + $self['versionInfo'] = $versionInfo; - return $obj; + return $self; } /** @@ -653,10 +653,10 @@ public function withVersionInfo(VersionInfo|array $versionInfo): self */ public function withVideoCodec(string $videoCodec): self { - $obj = clone $this; - $obj['videoCodec'] = $videoCodec; + $self = clone $this; + $self['videoCodec'] = $videoCodec; - return $obj; + return $self; } /** @@ -664,9 +664,9 @@ public function withVideoCodec(string $videoCodec): self */ public function withWidth(float $width): self { - $obj = clone $this; - $obj['width'] = $width; + $self = clone $this; + $self['width'] = $width; - return $obj; + return $self; } } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php index 062e84a8..ab3b5f38 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php @@ -51,13 +51,13 @@ public static function with( ?string $name = null, ?string $source = null ): self { - $obj = new self; + $self = new self; - null !== $confidence && $obj['confidence'] = $confidence; - null !== $name && $obj['name'] = $name; - null !== $source && $obj['source'] = $source; + null !== $confidence && $self['confidence'] = $confidence; + null !== $name && $self['name'] = $name; + null !== $source && $self['source'] = $source; - return $obj; + return $self; } /** @@ -65,10 +65,10 @@ public static function with( */ public function withConfidence(float $confidence): self { - $obj = clone $this; - $obj['confidence'] = $confidence; + $self = clone $this; + $self['confidence'] = $confidence; - return $obj; + return $self; } /** @@ -76,10 +76,10 @@ public function withConfidence(float $confidence): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } /** @@ -87,9 +87,9 @@ public function withName(string $name): self */ public function withSource(string $source): self { - $obj = clone $this; - $obj['source'] = $source; + $self = clone $this; + $self['source'] = $source; - return $obj; + return $self; } } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php index 83d18636..8b6252cc 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php @@ -70,14 +70,14 @@ public static function with( GoogleAutoTagging|string|null $googleAutoTagging = null, RemoveBg|string|null $removeBg = null, ): self { - $obj = new self; + $self = new self; - null !== $aiAutoDescription && $obj['aiAutoDescription'] = $aiAutoDescription; - null !== $awsAutoTagging && $obj['awsAutoTagging'] = $awsAutoTagging; - null !== $googleAutoTagging && $obj['googleAutoTagging'] = $googleAutoTagging; - null !== $removeBg && $obj['removeBg'] = $removeBg; + null !== $aiAutoDescription && $self['aiAutoDescription'] = $aiAutoDescription; + null !== $awsAutoTagging && $self['awsAutoTagging'] = $awsAutoTagging; + null !== $googleAutoTagging && $self['googleAutoTagging'] = $googleAutoTagging; + null !== $removeBg && $self['removeBg'] = $removeBg; - return $obj; + return $self; } /** @@ -86,10 +86,10 @@ public static function with( public function withAIAutoDescription( AIAutoDescription|string $aiAutoDescription ): self { - $obj = clone $this; - $obj['aiAutoDescription'] = $aiAutoDescription; + $self = clone $this; + $self['aiAutoDescription'] = $aiAutoDescription; - return $obj; + return $self; } /** @@ -98,10 +98,10 @@ public function withAIAutoDescription( public function withAwsAutoTagging( AwsAutoTagging|string $awsAutoTagging ): self { - $obj = clone $this; - $obj['awsAutoTagging'] = $awsAutoTagging; + $self = clone $this; + $self['awsAutoTagging'] = $awsAutoTagging; - return $obj; + return $self; } /** @@ -110,10 +110,10 @@ public function withAwsAutoTagging( public function withGoogleAutoTagging( GoogleAutoTagging|string $googleAutoTagging ): self { - $obj = clone $this; - $obj['googleAutoTagging'] = $googleAutoTagging; + $self = clone $this; + $self['googleAutoTagging'] = $googleAutoTagging; - return $obj; + return $self; } /** @@ -121,9 +121,9 @@ public function withGoogleAutoTagging( */ public function withRemoveBg(RemoveBg|string $removeBg): self { - $obj = clone $this; - $obj['removeBg'] = $removeBg; + $self = clone $this; + $self['removeBg'] = $removeBg; - return $obj; + return $self; } } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php index fa333553..9d8ca6c0 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php @@ -137,21 +137,21 @@ public static function with( ?array $selectOptions = null, ?bool $selectOptionsTruncated = null, ): self { - $obj = new self; + $self = new self; - $obj['type'] = $type; + $self['type'] = $type; - null !== $defaultValue && $obj['defaultValue'] = $defaultValue; - null !== $isValueRequired && $obj['isValueRequired'] = $isValueRequired; - null !== $maxLength && $obj['maxLength'] = $maxLength; - null !== $maxValue && $obj['maxValue'] = $maxValue; - null !== $minLength && $obj['minLength'] = $minLength; - null !== $minValue && $obj['minValue'] = $minValue; - null !== $readOnly && $obj['readOnly'] = $readOnly; - null !== $selectOptions && $obj['selectOptions'] = $selectOptions; - null !== $selectOptionsTruncated && $obj['selectOptionsTruncated'] = $selectOptionsTruncated; + null !== $defaultValue && $self['defaultValue'] = $defaultValue; + null !== $isValueRequired && $self['isValueRequired'] = $isValueRequired; + null !== $maxLength && $self['maxLength'] = $maxLength; + null !== $maxValue && $self['maxValue'] = $maxValue; + null !== $minLength && $self['minLength'] = $minLength; + null !== $minValue && $self['minValue'] = $minValue; + null !== $readOnly && $self['readOnly'] = $readOnly; + null !== $selectOptions && $self['selectOptions'] = $selectOptions; + null !== $selectOptionsTruncated && $self['selectOptionsTruncated'] = $selectOptionsTruncated; - return $obj; + return $self; } /** @@ -161,10 +161,10 @@ public static function with( */ public function withType(Type|string $type): self { - $obj = clone $this; - $obj['type'] = $type; + $self = clone $this; + $self['type'] = $type; - return $obj; + return $self; } /** @@ -175,10 +175,10 @@ public function withType(Type|string $type): self public function withDefaultValue( string|float|bool|array $defaultValue ): self { - $obj = clone $this; - $obj['defaultValue'] = $defaultValue; + $self = clone $this; + $self['defaultValue'] = $defaultValue; - return $obj; + return $self; } /** @@ -186,10 +186,10 @@ public function withDefaultValue( */ public function withIsValueRequired(bool $isValueRequired): self { - $obj = clone $this; - $obj['isValueRequired'] = $isValueRequired; + $self = clone $this; + $self['isValueRequired'] = $isValueRequired; - return $obj; + return $self; } /** @@ -197,10 +197,10 @@ public function withIsValueRequired(bool $isValueRequired): self */ public function withMaxLength(float $maxLength): self { - $obj = clone $this; - $obj['maxLength'] = $maxLength; + $self = clone $this; + $self['maxLength'] = $maxLength; - return $obj; + return $self; } /** @@ -208,10 +208,10 @@ public function withMaxLength(float $maxLength): self */ public function withMaxValue(string|float $maxValue): self { - $obj = clone $this; - $obj['maxValue'] = $maxValue; + $self = clone $this; + $self['maxValue'] = $maxValue; - return $obj; + return $self; } /** @@ -219,10 +219,10 @@ public function withMaxValue(string|float $maxValue): self */ public function withMinLength(float $minLength): self { - $obj = clone $this; - $obj['minLength'] = $minLength; + $self = clone $this; + $self['minLength'] = $minLength; - return $obj; + return $self; } /** @@ -230,10 +230,10 @@ public function withMinLength(float $minLength): self */ public function withMinValue(string|float $minValue): self { - $obj = clone $this; - $obj['minValue'] = $minValue; + $self = clone $this; + $self['minValue'] = $minValue; - return $obj; + return $self; } /** @@ -241,10 +241,10 @@ public function withMinValue(string|float $minValue): self */ public function withReadOnly(bool $readOnly): self { - $obj = clone $this; - $obj['readOnly'] = $readOnly; + $self = clone $this; + $self['readOnly'] = $readOnly; - return $obj; + return $self; } /** @@ -254,10 +254,10 @@ public function withReadOnly(bool $readOnly): self */ public function withSelectOptions(array $selectOptions): self { - $obj = clone $this; - $obj['selectOptions'] = $selectOptions; + $self = clone $this; + $self['selectOptions'] = $selectOptions; - return $obj; + return $self; } /** @@ -266,9 +266,9 @@ public function withSelectOptions(array $selectOptions): self public function withSelectOptionsTruncated( bool $selectOptionsTruncated ): self { - $obj = clone $this; - $obj['selectOptionsTruncated'] = $selectOptionsTruncated; + $self = clone $this; + $self['selectOptionsTruncated'] = $selectOptionsTruncated; - return $obj; + return $self; } } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php index edf972aa..7d8289c0 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php @@ -42,12 +42,12 @@ public function __construct() */ public static function with(?string $id = null, ?string $name = null): self { - $obj = new self; + $self = new self; - null !== $id && $obj['id'] = $id; - null !== $name && $obj['name'] = $name; + null !== $id && $self['id'] = $id; + null !== $name && $self['name'] = $name; - return $obj; + return $self; } /** @@ -55,10 +55,10 @@ public static function with(?string $id = null, ?string $name = null): self */ public function withID(string $id): self { - $obj = clone $this; - $obj['id'] = $id; + $self = clone $this; + $self['id'] = $id; - return $obj; + return $self; } /** @@ -66,9 +66,9 @@ public function withID(string $id): self */ public function withName(string $name): self { - $obj = clone $this; - $obj['name'] = $name; + $self = clone $this; + $self['name'] = $name; - return $obj; + return $self; } } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Request.php b/src/Webhooks/UploadPreTransformSuccessEvent/Request.php index 7486c472..12ce9bd0 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Request.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Request.php @@ -56,12 +56,12 @@ public static function with( string $transformation, string $xRequestID ): self { - $obj = new self; + $self = new self; - $obj['transformation'] = $transformation; - $obj['xRequestID'] = $xRequestID; + $self['transformation'] = $transformation; + $self['xRequestID'] = $xRequestID; - return $obj; + return $self; } /** @@ -69,10 +69,10 @@ public static function with( */ public function withTransformation(string $transformation): self { - $obj = clone $this; - $obj['transformation'] = $transformation; + $self = clone $this; + $self['transformation'] = $transformation; - return $obj; + return $self; } /** @@ -80,9 +80,9 @@ public function withTransformation(string $transformation): self */ public function withXRequestID(string $xRequestID): self { - $obj = clone $this; - $obj['xRequestID'] = $xRequestID; + $self = clone $this; + $self['xRequestID'] = $xRequestID; - return $obj; + return $self; } } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent.php b/src/Webhooks/VideoTransformationAcceptedEvent.php index 99ac46c8..ad68d071 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent.php @@ -98,15 +98,15 @@ public static function with( Data|array $data, Request|array $request, ): self { - $obj = new self; + $self = new self; - $obj['id'] = $id; - $obj['type'] = $type; - $obj['createdAt'] = $createdAt; - $obj['data'] = $data; - $obj['request'] = $request; + $self['id'] = $id; + $self['type'] = $type; + $self['createdAt'] = $createdAt; + $self['data'] = $data; + $self['request'] = $request; - return $obj; + return $self; } /** @@ -114,10 +114,10 @@ public static function with( */ public function withID(string $id): self { - $obj = clone $this; - $obj['id'] = $id; + $self = clone $this; + $self['id'] = $id; - return $obj; + return $self; } /** @@ -125,10 +125,10 @@ public function withID(string $id): self */ public function withType(string $type): self { - $obj = clone $this; - $obj['type'] = $type; + $self = clone $this; + $self['type'] = $type; - return $obj; + return $self; } /** @@ -136,10 +136,10 @@ public function withType(string $type): self */ public function withCreatedAt(\DateTimeInterface $createdAt): self { - $obj = clone $this; - $obj['createdAt'] = $createdAt; + $self = clone $this; + $self['createdAt'] = $createdAt; - return $obj; + return $self; } /** @@ -147,10 +147,10 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self */ public function withData(Data|array $data): self { - $obj = clone $this; - $obj['data'] = $data; + $self = clone $this; + $self['data'] = $data; - return $obj; + return $self; } /** @@ -162,9 +162,9 @@ public function withData(Data|array $data): self */ public function withRequest(Request|array $request): self { - $obj = clone $this; - $obj['request'] = $request; + $self = clone $this; + $self['request'] = $request; - return $obj; + return $self; } } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data.php index 36a7d4c6..dee503cc 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data.php @@ -65,12 +65,12 @@ public static function with( Asset|array $asset, Transformation|array $transformation ): self { - $obj = new self; + $self = new self; - $obj['asset'] = $asset; - $obj['transformation'] = $transformation; + $self['asset'] = $asset; + $self['transformation'] = $transformation; - return $obj; + return $self; } /** @@ -80,10 +80,10 @@ public static function with( */ public function withAsset(Asset|array $asset): self { - $obj = clone $this; - $obj['asset'] = $asset; + $self = clone $this; + $self['asset'] = $asset; - return $obj; + return $self; } /** @@ -96,9 +96,9 @@ public function withAsset(Asset|array $asset): self public function withTransformation( Transformation|array $transformation ): self { - $obj = clone $this; - $obj['transformation'] = $transformation; + $self = clone $this; + $self['transformation'] = $transformation; - return $obj; + return $self; } } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php index 7c050028..726c4b50 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php @@ -50,11 +50,11 @@ public function __construct() */ public static function with(string $url): self { - $obj = new self; + $self = new self; - $obj['url'] = $url; + $self['url'] = $url; - return $obj; + return $self; } /** @@ -62,9 +62,9 @@ public static function with(string $url): self */ public function withURL(string $url): self { - $obj = clone $this; - $obj['url'] = $url; + $self = clone $this; + $self['url'] = $url; - return $obj; + return $self; } } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php index ad10d4be..48b7fc55 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php @@ -83,13 +83,13 @@ public static function with( Type|string $type, Options|array|null $options = null ): self { - $obj = new self; + $self = new self; - $obj['type'] = $type; + $self['type'] = $type; - null !== $options && $obj['options'] = $options; + null !== $options && $self['options'] = $options; - return $obj; + return $self; } /** @@ -102,10 +102,10 @@ public static function with( */ public function withType(Type|string $type): self { - $obj = clone $this; - $obj['type'] = $type; + $self = clone $this; + $self['type'] = $type; - return $obj; + return $self; } /** @@ -123,9 +123,9 @@ public function withType(Type|string $type): self */ public function withOptions(Options|array $options): self { - $obj = clone $this; - $obj['options'] = $options; + $self = clone $this; + $self['options'] = $options; - return $obj; + return $self; } } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php index bcbbc039..6a990514 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php @@ -107,17 +107,17 @@ public static function with( ?array $variants = null, VideoCodec|string|null $videoCodec = null, ): self { - $obj = new self; + $self = new self; - null !== $audioCodec && $obj['audioCodec'] = $audioCodec; - null !== $autoRotate && $obj['autoRotate'] = $autoRotate; - null !== $format && $obj['format'] = $format; - null !== $quality && $obj['quality'] = $quality; - null !== $streamProtocol && $obj['streamProtocol'] = $streamProtocol; - null !== $variants && $obj['variants'] = $variants; - null !== $videoCodec && $obj['videoCodec'] = $videoCodec; + null !== $audioCodec && $self['audioCodec'] = $audioCodec; + null !== $autoRotate && $self['autoRotate'] = $autoRotate; + null !== $format && $self['format'] = $format; + null !== $quality && $self['quality'] = $quality; + null !== $streamProtocol && $self['streamProtocol'] = $streamProtocol; + null !== $variants && $self['variants'] = $variants; + null !== $videoCodec && $self['videoCodec'] = $videoCodec; - return $obj; + return $self; } /** @@ -127,10 +127,10 @@ public static function with( */ public function withAudioCodec(AudioCodec|string $audioCodec): self { - $obj = clone $this; - $obj['audioCodec'] = $audioCodec; + $self = clone $this; + $self['audioCodec'] = $audioCodec; - return $obj; + return $self; } /** @@ -138,10 +138,10 @@ public function withAudioCodec(AudioCodec|string $audioCodec): self */ public function withAutoRotate(bool $autoRotate): self { - $obj = clone $this; - $obj['autoRotate'] = $autoRotate; + $self = clone $this; + $self['autoRotate'] = $autoRotate; - return $obj; + return $self; } /** @@ -151,10 +151,10 @@ public function withAutoRotate(bool $autoRotate): self */ public function withFormat(Format|string $format): self { - $obj = clone $this; - $obj['format'] = $format; + $self = clone $this; + $self['format'] = $format; - return $obj; + return $self; } /** @@ -162,10 +162,10 @@ public function withFormat(Format|string $format): self */ public function withQuality(int $quality): self { - $obj = clone $this; - $obj['quality'] = $quality; + $self = clone $this; + $self['quality'] = $quality; - return $obj; + return $self; } /** @@ -176,10 +176,10 @@ public function withQuality(int $quality): self public function withStreamProtocol( StreamProtocol|string $streamProtocol ): self { - $obj = clone $this; - $obj['streamProtocol'] = $streamProtocol; + $self = clone $this; + $self['streamProtocol'] = $streamProtocol; - return $obj; + return $self; } /** @@ -189,10 +189,10 @@ public function withStreamProtocol( */ public function withVariants(array $variants): self { - $obj = clone $this; - $obj['variants'] = $variants; + $self = clone $this; + $self['variants'] = $variants; - return $obj; + return $self; } /** @@ -202,9 +202,9 @@ public function withVariants(array $variants): self */ public function withVideoCodec(VideoCodec|string $videoCodec): self { - $obj = clone $this; - $obj['videoCodec'] = $videoCodec; + $self = clone $this; + $self['videoCodec'] = $videoCodec; - return $obj; + return $self; } } diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Request.php b/src/Webhooks/VideoTransformationAcceptedEvent/Request.php index 364b7938..202799d0 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Request.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Request.php @@ -68,14 +68,14 @@ public static function with( string $xRequestID, ?string $userAgent = null ): self { - $obj = new self; + $self = new self; - $obj['url'] = $url; - $obj['xRequestID'] = $xRequestID; + $self['url'] = $url; + $self['xRequestID'] = $xRequestID; - null !== $userAgent && $obj['userAgent'] = $userAgent; + null !== $userAgent && $self['userAgent'] = $userAgent; - return $obj; + return $self; } /** @@ -83,10 +83,10 @@ public static function with( */ public function withURL(string $url): self { - $obj = clone $this; - $obj['url'] = $url; + $self = clone $this; + $self['url'] = $url; - return $obj; + return $self; } /** @@ -94,10 +94,10 @@ public function withURL(string $url): self */ public function withXRequestID(string $xRequestID): self { - $obj = clone $this; - $obj['xRequestID'] = $xRequestID; + $self = clone $this; + $self['xRequestID'] = $xRequestID; - return $obj; + return $self; } /** @@ -105,9 +105,9 @@ public function withXRequestID(string $xRequestID): self */ public function withUserAgent(string $userAgent): self { - $obj = clone $this; - $obj['userAgent'] = $userAgent; + $self = clone $this; + $self['userAgent'] = $userAgent; - return $obj; + return $self; } } diff --git a/src/Webhooks/VideoTransformationErrorEvent.php b/src/Webhooks/VideoTransformationErrorEvent.php index 5e29a102..e27901ed 100644 --- a/src/Webhooks/VideoTransformationErrorEvent.php +++ b/src/Webhooks/VideoTransformationErrorEvent.php @@ -98,15 +98,15 @@ public static function with( Data|array $data, Request|array $request, ): self { - $obj = new self; + $self = new self; - $obj['id'] = $id; - $obj['type'] = $type; - $obj['createdAt'] = $createdAt; - $obj['data'] = $data; - $obj['request'] = $request; + $self['id'] = $id; + $self['type'] = $type; + $self['createdAt'] = $createdAt; + $self['data'] = $data; + $self['request'] = $request; - return $obj; + return $self; } /** @@ -114,10 +114,10 @@ public static function with( */ public function withID(string $id): self { - $obj = clone $this; - $obj['id'] = $id; + $self = clone $this; + $self['id'] = $id; - return $obj; + return $self; } /** @@ -125,10 +125,10 @@ public function withID(string $id): self */ public function withType(string $type): self { - $obj = clone $this; - $obj['type'] = $type; + $self = clone $this; + $self['type'] = $type; - return $obj; + return $self; } /** @@ -136,10 +136,10 @@ public function withType(string $type): self */ public function withCreatedAt(\DateTimeInterface $createdAt): self { - $obj = clone $this; - $obj['createdAt'] = $createdAt; + $self = clone $this; + $self['createdAt'] = $createdAt; - return $obj; + return $self; } /** @@ -147,10 +147,10 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self */ public function withData(Data|array $data): self { - $obj = clone $this; - $obj['data'] = $data; + $self = clone $this; + $self['data'] = $data; - return $obj; + return $self; } /** @@ -162,9 +162,9 @@ public function withData(Data|array $data): self */ public function withRequest(Request|array $request): self { - $obj = clone $this; - $obj['request'] = $request; + $self = clone $this; + $self['request'] = $request; - return $obj; + return $self; } } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data.php b/src/Webhooks/VideoTransformationErrorEvent/Data.php index 18ccae52..a2f9d10c 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data.php @@ -63,12 +63,12 @@ public static function with( Asset|array $asset, Transformation|array $transformation ): self { - $obj = new self; + $self = new self; - $obj['asset'] = $asset; - $obj['transformation'] = $transformation; + $self['asset'] = $asset; + $self['transformation'] = $transformation; - return $obj; + return $self; } /** @@ -78,10 +78,10 @@ public static function with( */ public function withAsset(Asset|array $asset): self { - $obj = clone $this; - $obj['asset'] = $asset; + $self = clone $this; + $self['asset'] = $asset; - return $obj; + return $self; } /** @@ -92,9 +92,9 @@ public function withAsset(Asset|array $asset): self public function withTransformation( Transformation|array $transformation ): self { - $obj = clone $this; - $obj['transformation'] = $transformation; + $self = clone $this; + $self['transformation'] = $transformation; - return $obj; + return $self; } } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php index b7edac3f..0f6fc2ac 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php @@ -50,11 +50,11 @@ public function __construct() */ public static function with(string $url): self { - $obj = new self; + $self = new self; - $obj['url'] = $url; + $self['url'] = $url; - return $obj; + return $self; } /** @@ -62,9 +62,9 @@ public static function with(string $url): self */ public function withURL(string $url): self { - $obj = clone $this; - $obj['url'] = $url; + $self = clone $this; + $self['url'] = $url; - return $obj; + return $self; } } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php index 51297625..a9af038d 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php @@ -91,14 +91,14 @@ public static function with( Error|array|null $error = null, Options|array|null $options = null ): self { - $obj = new self; + $self = new self; - $obj['type'] = $type; + $self['type'] = $type; - null !== $error && $obj['error'] = $error; - null !== $options && $obj['options'] = $options; + null !== $error && $self['error'] = $error; + null !== $options && $self['options'] = $options; - return $obj; + return $self; } /** @@ -111,10 +111,10 @@ public static function with( */ public function withType(Type|string $type): self { - $obj = clone $this; - $obj['type'] = $type; + $self = clone $this; + $self['type'] = $type; - return $obj; + return $self; } /** @@ -124,10 +124,10 @@ public function withType(Type|string $type): self */ public function withError(Error|array $error): self { - $obj = clone $this; - $obj['error'] = $error; + $self = clone $this; + $self['error'] = $error; - return $obj; + return $self; } /** @@ -145,9 +145,9 @@ public function withError(Error|array $error): self */ public function withOptions(Options|array $options): self { - $obj = clone $this; - $obj['options'] = $options; + $self = clone $this; + $self['options'] = $options; - return $obj; + return $self; } } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php index bdd021c0..1c3af45d 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php @@ -58,11 +58,11 @@ public function __construct() */ public static function with(Reason|string $reason): self { - $obj = new self; + $self = new self; - $obj['reason'] = $reason; + $self['reason'] = $reason; - return $obj; + return $self; } /** @@ -75,9 +75,9 @@ public static function with(Reason|string $reason): self */ public function withReason(Reason|string $reason): self { - $obj = clone $this; - $obj['reason'] = $reason; + $self = clone $this; + $self['reason'] = $reason; - return $obj; + return $self; } } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php index 4a1c6e1c..b7574a62 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php @@ -107,17 +107,17 @@ public static function with( ?array $variants = null, VideoCodec|string|null $videoCodec = null, ): self { - $obj = new self; + $self = new self; - null !== $audioCodec && $obj['audioCodec'] = $audioCodec; - null !== $autoRotate && $obj['autoRotate'] = $autoRotate; - null !== $format && $obj['format'] = $format; - null !== $quality && $obj['quality'] = $quality; - null !== $streamProtocol && $obj['streamProtocol'] = $streamProtocol; - null !== $variants && $obj['variants'] = $variants; - null !== $videoCodec && $obj['videoCodec'] = $videoCodec; + null !== $audioCodec && $self['audioCodec'] = $audioCodec; + null !== $autoRotate && $self['autoRotate'] = $autoRotate; + null !== $format && $self['format'] = $format; + null !== $quality && $self['quality'] = $quality; + null !== $streamProtocol && $self['streamProtocol'] = $streamProtocol; + null !== $variants && $self['variants'] = $variants; + null !== $videoCodec && $self['videoCodec'] = $videoCodec; - return $obj; + return $self; } /** @@ -127,10 +127,10 @@ public static function with( */ public function withAudioCodec(AudioCodec|string $audioCodec): self { - $obj = clone $this; - $obj['audioCodec'] = $audioCodec; + $self = clone $this; + $self['audioCodec'] = $audioCodec; - return $obj; + return $self; } /** @@ -138,10 +138,10 @@ public function withAudioCodec(AudioCodec|string $audioCodec): self */ public function withAutoRotate(bool $autoRotate): self { - $obj = clone $this; - $obj['autoRotate'] = $autoRotate; + $self = clone $this; + $self['autoRotate'] = $autoRotate; - return $obj; + return $self; } /** @@ -151,10 +151,10 @@ public function withAutoRotate(bool $autoRotate): self */ public function withFormat(Format|string $format): self { - $obj = clone $this; - $obj['format'] = $format; + $self = clone $this; + $self['format'] = $format; - return $obj; + return $self; } /** @@ -162,10 +162,10 @@ public function withFormat(Format|string $format): self */ public function withQuality(int $quality): self { - $obj = clone $this; - $obj['quality'] = $quality; + $self = clone $this; + $self['quality'] = $quality; - return $obj; + return $self; } /** @@ -176,10 +176,10 @@ public function withQuality(int $quality): self public function withStreamProtocol( StreamProtocol|string $streamProtocol ): self { - $obj = clone $this; - $obj['streamProtocol'] = $streamProtocol; + $self = clone $this; + $self['streamProtocol'] = $streamProtocol; - return $obj; + return $self; } /** @@ -189,10 +189,10 @@ public function withStreamProtocol( */ public function withVariants(array $variants): self { - $obj = clone $this; - $obj['variants'] = $variants; + $self = clone $this; + $self['variants'] = $variants; - return $obj; + return $self; } /** @@ -202,9 +202,9 @@ public function withVariants(array $variants): self */ public function withVideoCodec(VideoCodec|string $videoCodec): self { - $obj = clone $this; - $obj['videoCodec'] = $videoCodec; + $self = clone $this; + $self['videoCodec'] = $videoCodec; - return $obj; + return $self; } } diff --git a/src/Webhooks/VideoTransformationErrorEvent/Request.php b/src/Webhooks/VideoTransformationErrorEvent/Request.php index 748eeb9a..02a6b569 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Request.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Request.php @@ -68,14 +68,14 @@ public static function with( string $xRequestID, ?string $userAgent = null ): self { - $obj = new self; + $self = new self; - $obj['url'] = $url; - $obj['xRequestID'] = $xRequestID; + $self['url'] = $url; + $self['xRequestID'] = $xRequestID; - null !== $userAgent && $obj['userAgent'] = $userAgent; + null !== $userAgent && $self['userAgent'] = $userAgent; - return $obj; + return $self; } /** @@ -83,10 +83,10 @@ public static function with( */ public function withURL(string $url): self { - $obj = clone $this; - $obj['url'] = $url; + $self = clone $this; + $self['url'] = $url; - return $obj; + return $self; } /** @@ -94,10 +94,10 @@ public function withURL(string $url): self */ public function withXRequestID(string $xRequestID): self { - $obj = clone $this; - $obj['xRequestID'] = $xRequestID; + $self = clone $this; + $self['xRequestID'] = $xRequestID; - return $obj; + return $self; } /** @@ -105,9 +105,9 @@ public function withXRequestID(string $xRequestID): self */ public function withUserAgent(string $userAgent): self { - $obj = clone $this; - $obj['userAgent'] = $userAgent; + $self = clone $this; + $self['userAgent'] = $userAgent; - return $obj; + return $self; } } diff --git a/src/Webhooks/VideoTransformationReadyEvent.php b/src/Webhooks/VideoTransformationReadyEvent.php index cb3f6722..45d4a85c 100644 --- a/src/Webhooks/VideoTransformationReadyEvent.php +++ b/src/Webhooks/VideoTransformationReadyEvent.php @@ -111,17 +111,17 @@ public static function with( Request|array $request, Timings|array|null $timings = null, ): self { - $obj = new self; + $self = new self; - $obj['id'] = $id; - $obj['type'] = $type; - $obj['createdAt'] = $createdAt; - $obj['data'] = $data; - $obj['request'] = $request; + $self['id'] = $id; + $self['type'] = $type; + $self['createdAt'] = $createdAt; + $self['data'] = $data; + $self['request'] = $request; - null !== $timings && $obj['timings'] = $timings; + null !== $timings && $self['timings'] = $timings; - return $obj; + return $self; } /** @@ -129,10 +129,10 @@ public static function with( */ public function withID(string $id): self { - $obj = clone $this; - $obj['id'] = $id; + $self = clone $this; + $self['id'] = $id; - return $obj; + return $self; } /** @@ -140,10 +140,10 @@ public function withID(string $id): self */ public function withType(string $type): self { - $obj = clone $this; - $obj['type'] = $type; + $self = clone $this; + $self['type'] = $type; - return $obj; + return $self; } /** @@ -151,10 +151,10 @@ public function withType(string $type): self */ public function withCreatedAt(\DateTimeInterface $createdAt): self { - $obj = clone $this; - $obj['createdAt'] = $createdAt; + $self = clone $this; + $self['createdAt'] = $createdAt; - return $obj; + return $self; } /** @@ -162,10 +162,10 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self */ public function withData(Data|array $data): self { - $obj = clone $this; - $obj['data'] = $data; + $self = clone $this; + $self['data'] = $data; - return $obj; + return $self; } /** @@ -177,10 +177,10 @@ public function withData(Data|array $data): self */ public function withRequest(Request|array $request): self { - $obj = clone $this; - $obj['request'] = $request; + $self = clone $this; + $self['request'] = $request; - return $obj; + return $self; } /** @@ -192,9 +192,9 @@ public function withRequest(Request|array $request): self */ public function withTimings(Timings|array $timings): self { - $obj = clone $this; - $obj['timings'] = $timings; + $self = clone $this; + $self['timings'] = $timings; - return $obj; + return $self; } } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data.php b/src/Webhooks/VideoTransformationReadyEvent/Data.php index d8ad3d4f..6dc7d3b8 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data.php @@ -63,12 +63,12 @@ public static function with( Asset|array $asset, Transformation|array $transformation ): self { - $obj = new self; + $self = new self; - $obj['asset'] = $asset; - $obj['transformation'] = $transformation; + $self['asset'] = $asset; + $self['transformation'] = $transformation; - return $obj; + return $self; } /** @@ -78,10 +78,10 @@ public static function with( */ public function withAsset(Asset|array $asset): self { - $obj = clone $this; - $obj['asset'] = $asset; + $self = clone $this; + $self['asset'] = $asset; - return $obj; + return $self; } /** @@ -92,9 +92,9 @@ public function withAsset(Asset|array $asset): self public function withTransformation( Transformation|array $transformation ): self { - $obj = clone $this; - $obj['transformation'] = $transformation; + $self = clone $this; + $self['transformation'] = $transformation; - return $obj; + return $self; } } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php index 7700a7ee..bc5ae690 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php @@ -50,11 +50,11 @@ public function __construct() */ public static function with(string $url): self { - $obj = new self; + $self = new self; - $obj['url'] = $url; + $self['url'] = $url; - return $obj; + return $self; } /** @@ -62,9 +62,9 @@ public static function with(string $url): self */ public function withURL(string $url): self { - $obj = clone $this; - $obj['url'] = $url; + $self = clone $this; + $self['url'] = $url; - return $obj; + return $self; } } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php index 024b6b03..4f11ea05 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php @@ -91,14 +91,14 @@ public static function with( Options|array|null $options = null, Output|array|null $output = null, ): self { - $obj = new self; + $self = new self; - $obj['type'] = $type; + $self['type'] = $type; - null !== $options && $obj['options'] = $options; - null !== $output && $obj['output'] = $output; + null !== $options && $self['options'] = $options; + null !== $output && $self['output'] = $output; - return $obj; + return $self; } /** @@ -111,10 +111,10 @@ public static function with( */ public function withType(Type|string $type): self { - $obj = clone $this; - $obj['type'] = $type; + $self = clone $this; + $self['type'] = $type; - return $obj; + return $self; } /** @@ -132,10 +132,10 @@ public function withType(Type|string $type): self */ public function withOptions(Options|array $options): self { - $obj = clone $this; - $obj['options'] = $options; + $self = clone $this; + $self['options'] = $options; - return $obj; + return $self; } /** @@ -145,9 +145,9 @@ public function withOptions(Options|array $options): self */ public function withOutput(Output|array $output): self { - $obj = clone $this; - $obj['output'] = $output; + $self = clone $this; + $self['output'] = $output; - return $obj; + return $self; } } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php index eb95c208..bf94b65c 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php @@ -107,17 +107,17 @@ public static function with( ?array $variants = null, VideoCodec|string|null $videoCodec = null, ): self { - $obj = new self; + $self = new self; - null !== $audioCodec && $obj['audioCodec'] = $audioCodec; - null !== $autoRotate && $obj['autoRotate'] = $autoRotate; - null !== $format && $obj['format'] = $format; - null !== $quality && $obj['quality'] = $quality; - null !== $streamProtocol && $obj['streamProtocol'] = $streamProtocol; - null !== $variants && $obj['variants'] = $variants; - null !== $videoCodec && $obj['videoCodec'] = $videoCodec; + null !== $audioCodec && $self['audioCodec'] = $audioCodec; + null !== $autoRotate && $self['autoRotate'] = $autoRotate; + null !== $format && $self['format'] = $format; + null !== $quality && $self['quality'] = $quality; + null !== $streamProtocol && $self['streamProtocol'] = $streamProtocol; + null !== $variants && $self['variants'] = $variants; + null !== $videoCodec && $self['videoCodec'] = $videoCodec; - return $obj; + return $self; } /** @@ -127,10 +127,10 @@ public static function with( */ public function withAudioCodec(AudioCodec|string $audioCodec): self { - $obj = clone $this; - $obj['audioCodec'] = $audioCodec; + $self = clone $this; + $self['audioCodec'] = $audioCodec; - return $obj; + return $self; } /** @@ -138,10 +138,10 @@ public function withAudioCodec(AudioCodec|string $audioCodec): self */ public function withAutoRotate(bool $autoRotate): self { - $obj = clone $this; - $obj['autoRotate'] = $autoRotate; + $self = clone $this; + $self['autoRotate'] = $autoRotate; - return $obj; + return $self; } /** @@ -151,10 +151,10 @@ public function withAutoRotate(bool $autoRotate): self */ public function withFormat(Format|string $format): self { - $obj = clone $this; - $obj['format'] = $format; + $self = clone $this; + $self['format'] = $format; - return $obj; + return $self; } /** @@ -162,10 +162,10 @@ public function withFormat(Format|string $format): self */ public function withQuality(int $quality): self { - $obj = clone $this; - $obj['quality'] = $quality; + $self = clone $this; + $self['quality'] = $quality; - return $obj; + return $self; } /** @@ -176,10 +176,10 @@ public function withQuality(int $quality): self public function withStreamProtocol( StreamProtocol|string $streamProtocol ): self { - $obj = clone $this; - $obj['streamProtocol'] = $streamProtocol; + $self = clone $this; + $self['streamProtocol'] = $streamProtocol; - return $obj; + return $self; } /** @@ -189,10 +189,10 @@ public function withStreamProtocol( */ public function withVariants(array $variants): self { - $obj = clone $this; - $obj['variants'] = $variants; + $self = clone $this; + $self['variants'] = $variants; - return $obj; + return $self; } /** @@ -202,9 +202,9 @@ public function withVariants(array $variants): self */ public function withVideoCodec(VideoCodec|string $videoCodec): self { - $obj = clone $this; - $obj['videoCodec'] = $videoCodec; + $self = clone $this; + $self['videoCodec'] = $videoCodec; - return $obj; + return $self; } } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php index 0403f669..c7eeab7a 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php @@ -66,13 +66,13 @@ public static function with( string $url, VideoMetadata|array|null $videoMetadata = null ): self { - $obj = new self; + $self = new self; - $obj['url'] = $url; + $self['url'] = $url; - null !== $videoMetadata && $obj['videoMetadata'] = $videoMetadata; + null !== $videoMetadata && $self['videoMetadata'] = $videoMetadata; - return $obj; + return $self; } /** @@ -80,10 +80,10 @@ public static function with( */ public function withURL(string $url): self { - $obj = clone $this; - $obj['url'] = $url; + $self = clone $this; + $self['url'] = $url; - return $obj; + return $self; } /** @@ -95,9 +95,9 @@ public function withURL(string $url): self */ public function withVideoMetadata(VideoMetadata|array $videoMetadata): self { - $obj = clone $this; - $obj['videoMetadata'] = $videoMetadata; + $self = clone $this; + $self['videoMetadata'] = $videoMetadata; - return $obj; + return $self; } } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php index 707a4f17..7edcfa3b 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php @@ -78,14 +78,14 @@ public static function with( int $height, int $width ): self { - $obj = new self; + $self = new self; - $obj['bitrate'] = $bitrate; - $obj['duration'] = $duration; - $obj['height'] = $height; - $obj['width'] = $width; + $self['bitrate'] = $bitrate; + $self['duration'] = $duration; + $self['height'] = $height; + $self['width'] = $width; - return $obj; + return $self; } /** @@ -93,10 +93,10 @@ public static function with( */ public function withBitrate(int $bitrate): self { - $obj = clone $this; - $obj['bitrate'] = $bitrate; + $self = clone $this; + $self['bitrate'] = $bitrate; - return $obj; + return $self; } /** @@ -104,10 +104,10 @@ public function withBitrate(int $bitrate): self */ public function withDuration(float $duration): self { - $obj = clone $this; - $obj['duration'] = $duration; + $self = clone $this; + $self['duration'] = $duration; - return $obj; + return $self; } /** @@ -115,10 +115,10 @@ public function withDuration(float $duration): self */ public function withHeight(int $height): self { - $obj = clone $this; - $obj['height'] = $height; + $self = clone $this; + $self['height'] = $height; - return $obj; + return $self; } /** @@ -126,9 +126,9 @@ public function withHeight(int $height): self */ public function withWidth(int $width): self { - $obj = clone $this; - $obj['width'] = $width; + $self = clone $this; + $self['width'] = $width; - return $obj; + return $self; } } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Request.php b/src/Webhooks/VideoTransformationReadyEvent/Request.php index 68203d5c..38343e7b 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Request.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Request.php @@ -68,14 +68,14 @@ public static function with( string $xRequestID, ?string $userAgent = null ): self { - $obj = new self; + $self = new self; - $obj['url'] = $url; - $obj['xRequestID'] = $xRequestID; + $self['url'] = $url; + $self['xRequestID'] = $xRequestID; - null !== $userAgent && $obj['userAgent'] = $userAgent; + null !== $userAgent && $self['userAgent'] = $userAgent; - return $obj; + return $self; } /** @@ -83,10 +83,10 @@ public static function with( */ public function withURL(string $url): self { - $obj = clone $this; - $obj['url'] = $url; + $self = clone $this; + $self['url'] = $url; - return $obj; + return $self; } /** @@ -94,10 +94,10 @@ public function withURL(string $url): self */ public function withXRequestID(string $xRequestID): self { - $obj = clone $this; - $obj['xRequestID'] = $xRequestID; + $self = clone $this; + $self['xRequestID'] = $xRequestID; - return $obj; + return $self; } /** @@ -105,9 +105,9 @@ public function withXRequestID(string $xRequestID): self */ public function withUserAgent(string $userAgent): self { - $obj = clone $this; - $obj['userAgent'] = $userAgent; + $self = clone $this; + $self['userAgent'] = $userAgent; - return $obj; + return $self; } } diff --git a/src/Webhooks/VideoTransformationReadyEvent/Timings.php b/src/Webhooks/VideoTransformationReadyEvent/Timings.php index 8bcddfd7..ce383aa0 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Timings.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Timings.php @@ -46,12 +46,12 @@ public static function with( ?int $downloadDuration = null, ?int $encodingDuration = null ): self { - $obj = new self; + $self = new self; - null !== $downloadDuration && $obj['downloadDuration'] = $downloadDuration; - null !== $encodingDuration && $obj['encodingDuration'] = $encodingDuration; + null !== $downloadDuration && $self['downloadDuration'] = $downloadDuration; + null !== $encodingDuration && $self['encodingDuration'] = $encodingDuration; - return $obj; + return $self; } /** @@ -59,10 +59,10 @@ public static function with( */ public function withDownloadDuration(int $downloadDuration): self { - $obj = clone $this; - $obj['downloadDuration'] = $downloadDuration; + $self = clone $this; + $self['downloadDuration'] = $downloadDuration; - return $obj; + return $self; } /** @@ -70,9 +70,9 @@ public function withDownloadDuration(int $downloadDuration): self */ public function withEncodingDuration(int $encodingDuration): self { - $obj = clone $this; - $obj['encodingDuration'] = $encodingDuration; + $self = clone $this; + $self['encodingDuration'] = $encodingDuration; - return $obj; + return $self; } } From 72581b38ac28d0bc43aa76e0df66a66a53c744e5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 9 Dec 2025 15:27:48 +0000 Subject: [PATCH 091/193] feat: split out services into normal & raw types --- README.md | 20 +- .../Accounts/OriginsContract.php | 83 +++- .../Accounts/OriginsRawContract.php | 89 +++++ .../Accounts/URLEndpointsContract.php | 27 +- .../Accounts/URLEndpointsRawContract.php | 82 ++++ .../Accounts/UsageContract.php | 9 +- .../Accounts/UsageRawContract.php | 28 ++ src/ServiceContracts/AccountsRawContract.php | 7 + src/ServiceContracts/AssetsContract.php | 42 +- src/ServiceContracts/AssetsRawContract.php | 29 ++ .../Beta/V2/FilesContract.php | 79 +++- .../Beta/V2/FilesRawContract.php | 28 ++ src/ServiceContracts/Beta/V2RawContract.php | 7 + src/ServiceContracts/BetaRawContract.php | 7 + .../Cache/InvalidationContract.php | 9 +- .../Cache/InvalidationRawContract.php | 43 +++ src/ServiceContracts/CacheRawContract.php | 7 + .../CustomMetadataFieldsContract.php | 44 ++- .../CustomMetadataFieldsRawContract.php | 75 ++++ src/ServiceContracts/Files/BulkContract.php | 28 +- .../Files/BulkRawContract.php | 76 ++++ .../Files/MetadataContract.php | 9 +- .../Files/MetadataRawContract.php | 42 ++ .../Files/VersionsContract.php | 26 +- .../Files/VersionsRawContract.php | 79 ++++ src/ServiceContracts/FilesContract.php | 172 ++++++++- src/ServiceContracts/FilesRawContract.php | 123 ++++++ src/ServiceContracts/Folders/JobContract.php | 2 + .../Folders/JobRawContract.php | 27 ++ src/ServiceContracts/FoldersContract.php | 57 ++- src/ServiceContracts/FoldersRawContract.php | 92 +++++ src/ServiceContracts/WebhooksRawContract.php | 7 + src/Services/Accounts/OriginsRawService.php | 211 ++++++++++ src/Services/Accounts/OriginsService.php | 249 +++++++----- .../Accounts/URLEndpointsRawService.php | 169 ++++++++ src/Services/Accounts/URLEndpointsService.php | 124 +++--- src/Services/Accounts/UsageRawService.php | 54 +++ src/Services/Accounts/UsageService.php | 39 +- src/Services/AccountsRawService.php | 17 + src/Services/AccountsService.php | 6 + src/Services/AssetsRawService.php | 66 ++++ src/Services/AssetsService.php | 85 +++-- src/Services/Beta/V2/FilesRawService.php | 91 +++++ src/Services/Beta/V2/FilesService.php | 150 ++++++-- src/Services/Beta/V2RawService.php | 17 + src/Services/Beta/V2Service.php | 6 + src/Services/BetaRawService.php | 17 + src/Services/BetaService.php | 6 + src/Services/Cache/InvalidationRawService.php | 77 ++++ src/Services/Cache/InvalidationService.php | 44 +-- src/Services/CacheRawService.php | 17 + src/Services/CacheService.php | 6 + .../CustomMetadataFieldsRawService.php | 171 +++++++++ src/Services/CustomMetadataFieldsService.php | 143 +++---- src/Services/Files/BulkRawService.php | 158 ++++++++ src/Services/Files/BulkService.php | 111 ++---- src/Services/Files/MetadataRawService.php | 78 ++++ src/Services/Files/MetadataService.php | 44 +-- src/Services/Files/VersionsRawService.php | 151 ++++++++ src/Services/Files/VersionsService.php | 101 ++--- src/Services/FilesRawService.php | 296 ++++++++++++++ src/Services/FilesService.php | 361 +++++++++++------- src/Services/Folders/JobRawService.php | 45 +++ src/Services/Folders/JobService.php | 22 +- src/Services/FoldersRawService.php | 188 +++++++++ src/Services/FoldersService.php | 174 ++++----- src/Services/WebhooksRawService.php | 17 + src/Services/WebhooksService.php | 10 +- tests/Services/Accounts/OriginsTest.php | 156 ++++---- tests/Services/Accounts/URLEndpointsTest.php | 32 +- tests/Services/Accounts/UsageTest.php | 16 +- tests/Services/AssetsTest.php | 2 +- tests/Services/Beta/V2/FilesTest.php | 51 +-- tests/Services/Cache/InvalidationTest.php | 12 +- tests/Services/CustomMetadataFieldsTest.php | 22 +- tests/Services/Files/BulkTest.php | 60 +-- tests/Services/Files/MetadataTest.php | 12 +- tests/Services/Files/VersionsTest.php | 12 +- tests/Services/FilesTest.php | 107 +++--- tests/Services/FoldersTest.php | 73 ++-- 80 files changed, 4370 insertions(+), 1161 deletions(-) create mode 100644 src/ServiceContracts/Accounts/OriginsRawContract.php create mode 100644 src/ServiceContracts/Accounts/URLEndpointsRawContract.php create mode 100644 src/ServiceContracts/Accounts/UsageRawContract.php create mode 100644 src/ServiceContracts/AccountsRawContract.php create mode 100644 src/ServiceContracts/AssetsRawContract.php create mode 100644 src/ServiceContracts/Beta/V2/FilesRawContract.php create mode 100644 src/ServiceContracts/Beta/V2RawContract.php create mode 100644 src/ServiceContracts/BetaRawContract.php create mode 100644 src/ServiceContracts/Cache/InvalidationRawContract.php create mode 100644 src/ServiceContracts/CacheRawContract.php create mode 100644 src/ServiceContracts/CustomMetadataFieldsRawContract.php create mode 100644 src/ServiceContracts/Files/BulkRawContract.php create mode 100644 src/ServiceContracts/Files/MetadataRawContract.php create mode 100644 src/ServiceContracts/Files/VersionsRawContract.php create mode 100644 src/ServiceContracts/FilesRawContract.php create mode 100644 src/ServiceContracts/Folders/JobRawContract.php create mode 100644 src/ServiceContracts/FoldersRawContract.php create mode 100644 src/ServiceContracts/WebhooksRawContract.php create mode 100644 src/Services/Accounts/OriginsRawService.php create mode 100644 src/Services/Accounts/URLEndpointsRawService.php create mode 100644 src/Services/Accounts/UsageRawService.php create mode 100644 src/Services/AccountsRawService.php create mode 100644 src/Services/AssetsRawService.php create mode 100644 src/Services/Beta/V2/FilesRawService.php create mode 100644 src/Services/Beta/V2RawService.php create mode 100644 src/Services/BetaRawService.php create mode 100644 src/Services/Cache/InvalidationRawService.php create mode 100644 src/Services/CacheRawService.php create mode 100644 src/Services/CustomMetadataFieldsRawService.php create mode 100644 src/Services/Files/BulkRawService.php create mode 100644 src/Services/Files/MetadataRawService.php create mode 100644 src/Services/Files/VersionsRawService.php create mode 100644 src/Services/FilesRawService.php create mode 100644 src/Services/Folders/JobRawService.php create mode 100644 src/Services/FoldersRawService.php create mode 100644 src/Services/WebhooksRawService.php diff --git a/README.md b/README.md index 05d76b54..dd816440 100644 --- a/README.md +++ b/README.md @@ -46,9 +46,7 @@ $client = new Client( password: getenv('OPTIONAL_IMAGEKIT_IGNORES_THIS') ?: 'do_not_set', ); -$response = $client->files->upload([ - 'file' => 'file', 'fileName' => 'file-name.jpg' -]); +$response = $client->files->upload(file: 'file', fileName: 'file-name.jpg'); var_dump($response->videoCodec); ``` @@ -70,13 +68,11 @@ When the library is unable to connect to the API, or if the API returns a non-su use Imagekit\Core\Exceptions\APIConnectionException; try { - $response = $client->files->upload([ - 'file' => 'file', 'fileName' => 'file-name.jpg' - ]); + $response = $client->files->upload(file: 'file', fileName: 'file-name.jpg'); } catch (APIConnectionException $e) { echo "The server could not be reached", PHP_EOL; var_dump($e->getPrevious()); -} catch (RateLimitError $_) { +} catch (RateLimitError $e) { echo "A 429 status code was received; we should back off a bit.", PHP_EOL; } catch (APIStatusError $e) { echo "Another non-200-range status code was received", PHP_EOL; @@ -119,8 +115,9 @@ $client = new Client(maxRetries: 0); // Or, configure per-request: $result = $client->files->upload( - ['file' => 'file', 'fileName' => 'file-name.jpg'], - RequestOptions::with(maxRetries: 5), + file: 'file', + fileName: 'file-name.jpg', + requestOptions: RequestOptions::with(maxRetries: 5), ); ``` @@ -140,8 +137,9 @@ Note: the `extra*` parameters of the same name overrides the documented paramete use Imagekit\RequestOptions; $response = $client->files->upload( - ['file' => 'file', 'fileName' => 'file-name.jpg'], - RequestOptions::with( + file: 'file', + fileName: 'file-name.jpg', + requestOptions: RequestOptions::with( extraQueryParams: ['my_query_parameter' => 'value'], extraBodyParams: ['my_body_parameter' => 'value'], extraHeaders: ['my-header' => 'value'], diff --git a/src/ServiceContracts/Accounts/OriginsContract.php b/src/ServiceContracts/Accounts/OriginsContract.php index 5d91c41b..a32d610e 100644 --- a/src/ServiceContracts/Accounts/OriginsContract.php +++ b/src/ServiceContracts/Accounts/OriginsContract.php @@ -4,7 +4,6 @@ namespace Imagekit\ServiceContracts\Accounts; -use Imagekit\Accounts\Origins\OriginCreateParams; use Imagekit\Accounts\Origins\OriginResponse\AkeneoPim; use Imagekit\Accounts\Origins\OriginResponse\AzureBlob; use Imagekit\Accounts\Origins\OriginResponse\CloudinaryBackup; @@ -13,7 +12,6 @@ use Imagekit\Accounts\Origins\OriginResponse\S3Compatible; use Imagekit\Accounts\Origins\OriginResponse\WebFolder; use Imagekit\Accounts\Origins\OriginResponse\WebProxy; -use Imagekit\Accounts\Origins\OriginUpdateParams; use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; @@ -22,25 +20,92 @@ interface OriginsContract /** * @api * - * @param array|OriginCreateParams $params + * @param string $accessKey access key for the bucket + * @param string $name display name of the origin + * @param string $secretKey secret key for the bucket + * @param string $endpoint custom S3-compatible endpoint + * @param string $baseURL akeneo instance base URL + * @param string $clientID akeneo API client ID + * @param string $clientSecret akeneo API client secret + * @param string $password akeneo API password + * @param string $username akeneo API username + * @param 'AKENEO_PIM' $type + * @param string $baseURLForCanonicalHeader URL used in the Canonical header (if enabled) + * @param bool $includeCanonicalHeader whether to send a Canonical header + * @param bool $s3ForcePathStyle Use path-style S3 URLs? + * @param bool $forwardHostHeaderToOrigin Forward the Host header to origin? * * @throws APIException */ public function create( - array|OriginCreateParams $params, - ?RequestOptions $requestOptions = null + string $accessKey, + string $bucket, + string $name, + string $secretKey, + string $endpoint, + string $baseURL, + string $clientEmail, + string $privateKey, + string $accountName, + string $container, + string $sasToken, + string $clientID, + string $clientSecret, + string $password, + string $username, + string $type = 'AKENEO_PIM', + ?string $baseURLForCanonicalHeader = null, + bool $includeCanonicalHeader = false, + string $prefix = '', + bool $s3ForcePathStyle = false, + bool $forwardHostHeaderToOrigin = false, + ?RequestOptions $requestOptions = null, ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim; /** * @api * - * @param array|OriginUpdateParams $params + * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + * @param string $accessKey access key for the bucket + * @param string $name display name of the origin + * @param string $secretKey secret key for the bucket + * @param string $endpoint custom S3-compatible endpoint + * @param string $baseURL akeneo instance base URL + * @param string $clientID akeneo API client ID + * @param string $clientSecret akeneo API client secret + * @param string $password akeneo API password + * @param string $username akeneo API username + * @param 'AKENEO_PIM' $type + * @param string $baseURLForCanonicalHeader URL used in the Canonical header (if enabled) + * @param bool $includeCanonicalHeader whether to send a Canonical header + * @param bool $s3ForcePathStyle Use path-style S3 URLs? + * @param bool $forwardHostHeaderToOrigin Forward the Host header to origin? * * @throws APIException */ public function update( string $id, - array|OriginUpdateParams $params, + string $accessKey, + string $bucket, + string $name, + string $secretKey, + string $endpoint, + string $baseURL, + string $clientEmail, + string $privateKey, + string $accountName, + string $container, + string $sasToken, + string $clientID, + string $clientSecret, + string $password, + string $username, + string $type = 'AKENEO_PIM', + ?string $baseURLForCanonicalHeader = null, + bool $includeCanonicalHeader = false, + string $prefix = '', + bool $s3ForcePathStyle = false, + bool $forwardHostHeaderToOrigin = false, ?RequestOptions $requestOptions = null, ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim; @@ -56,6 +121,8 @@ public function list(?RequestOptions $requestOptions = null): array; /** * @api * + * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + * * @throws APIException */ public function delete( @@ -66,6 +133,8 @@ public function delete( /** * @api * + * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + * * @throws APIException */ public function get( diff --git a/src/ServiceContracts/Accounts/OriginsRawContract.php b/src/ServiceContracts/Accounts/OriginsRawContract.php new file mode 100644 index 00000000..d474ec81 --- /dev/null +++ b/src/ServiceContracts/Accounts/OriginsRawContract.php @@ -0,0 +1,89 @@ +|OriginCreateParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function create( + array|OriginCreateParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse; + + /** + * @api + * + * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + * @param array|OriginUpdateParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function update( + string $id, + array|OriginUpdateParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse; + + /** + * @api + * + * @return BaseResponse,> + * + * @throws APIException + */ + public function list(?RequestOptions $requestOptions = null): BaseResponse; + + /** + * @api + * + * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + * + * @return BaseResponse + * + * @throws APIException + */ + public function delete( + string $id, + ?RequestOptions $requestOptions = null + ): BaseResponse; + + /** + * @api + * + * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + * + * @return BaseResponse + * + * @throws APIException + */ + public function get( + string $id, + ?RequestOptions $requestOptions = null + ): BaseResponse; +} diff --git a/src/ServiceContracts/Accounts/URLEndpointsContract.php b/src/ServiceContracts/Accounts/URLEndpointsContract.php index 4984aa86..b7ef282a 100644 --- a/src/ServiceContracts/Accounts/URLEndpointsContract.php +++ b/src/ServiceContracts/Accounts/URLEndpointsContract.php @@ -4,9 +4,7 @@ namespace Imagekit\ServiceContracts\Accounts; -use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams; use Imagekit\Accounts\URLEndpoints\URLEndpointResponse; -use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams; use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; @@ -15,25 +13,38 @@ interface URLEndpointsContract /** * @api * - * @param array|URLEndpointCreateParams $params + * @param string $description description of the URL endpoint + * @param list $origins Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. + * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) + * @param array $urlRewriter configuration for third-party URL rewriting * * @throws APIException */ public function create( - array|URLEndpointCreateParams $params, + string $description, + array $origins = [], + string $urlPrefix = '', + ?array $urlRewriter = null, ?RequestOptions $requestOptions = null, ): URLEndpointResponse; /** * @api * - * @param array|URLEndpointUpdateParams $params + * @param string $id Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. + * @param string $description description of the URL endpoint + * @param list $origins Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. + * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) + * @param array $urlRewriter configuration for third-party URL rewriting * * @throws APIException */ public function update( string $id, - array|URLEndpointUpdateParams $params, + string $description, + array $origins = [], + string $urlPrefix = '', + ?array $urlRewriter = null, ?RequestOptions $requestOptions = null, ): URLEndpointResponse; @@ -49,6 +60,8 @@ public function list(?RequestOptions $requestOptions = null): array; /** * @api * + * @param string $id Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. + * * @throws APIException */ public function delete( @@ -59,6 +72,8 @@ public function delete( /** * @api * + * @param string $id Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. + * * @throws APIException */ public function get( diff --git a/src/ServiceContracts/Accounts/URLEndpointsRawContract.php b/src/ServiceContracts/Accounts/URLEndpointsRawContract.php new file mode 100644 index 00000000..68734ae3 --- /dev/null +++ b/src/ServiceContracts/Accounts/URLEndpointsRawContract.php @@ -0,0 +1,82 @@ +|URLEndpointCreateParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function create( + array|URLEndpointCreateParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse; + + /** + * @api + * + * @param string $id Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. + * @param array|URLEndpointUpdateParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function update( + string $id, + array|URLEndpointUpdateParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse; + + /** + * @api + * + * @return BaseResponse> + * + * @throws APIException + */ + public function list(?RequestOptions $requestOptions = null): BaseResponse; + + /** + * @api + * + * @param string $id Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. + * + * @return BaseResponse + * + * @throws APIException + */ + public function delete( + string $id, + ?RequestOptions $requestOptions = null + ): BaseResponse; + + /** + * @api + * + * @param string $id Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. + * + * @return BaseResponse + * + * @throws APIException + */ + public function get( + string $id, + ?RequestOptions $requestOptions = null + ): BaseResponse; +} diff --git a/src/ServiceContracts/Accounts/UsageContract.php b/src/ServiceContracts/Accounts/UsageContract.php index 9ebd1eae..cd338505 100644 --- a/src/ServiceContracts/Accounts/UsageContract.php +++ b/src/ServiceContracts/Accounts/UsageContract.php @@ -4,7 +4,6 @@ namespace Imagekit\ServiceContracts\Accounts; -use Imagekit\Accounts\Usage\UsageGetParams; use Imagekit\Accounts\Usage\UsageGetResponse; use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; @@ -14,12 +13,14 @@ interface UsageContract /** * @api * - * @param array|UsageGetParams $params + * @param string|\DateTimeInterface $endDate Specify a `endDate` in `YYYY-MM-DD` format. It should be after the `startDate`. The difference between `startDate` and `endDate` should be less than 90 days. + * @param string|\DateTimeInterface $startDate Specify a `startDate` in `YYYY-MM-DD` format. It should be before the `endDate`. The difference between `startDate` and `endDate` should be less than 90 days. * * @throws APIException */ public function get( - array|UsageGetParams $params, - ?RequestOptions $requestOptions = null + string|\DateTimeInterface $endDate, + string|\DateTimeInterface $startDate, + ?RequestOptions $requestOptions = null, ): UsageGetResponse; } diff --git a/src/ServiceContracts/Accounts/UsageRawContract.php b/src/ServiceContracts/Accounts/UsageRawContract.php new file mode 100644 index 00000000..d6c6fcfd --- /dev/null +++ b/src/ServiceContracts/Accounts/UsageRawContract.php @@ -0,0 +1,28 @@ +|UsageGetParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function get( + array|UsageGetParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse; +} diff --git a/src/ServiceContracts/AccountsRawContract.php b/src/ServiceContracts/AccountsRawContract.php new file mode 100644 index 00000000..c4da8e64 --- /dev/null +++ b/src/ServiceContracts/AccountsRawContract.php @@ -0,0 +1,7 @@ +|AssetListParams $params + * @param 'all'|'image'|'non-image'|FileType $fileType Filter results by file type. + * + * - `all` — include all file types + * - `image` — include only image files + * - `non-image` — include only non-image files (e.g., JS, CSS, video) + * @param int $limit the maximum number of results to return in response + * @param string $path Folder path if you want to limit the search within a specific folder. For example, `/sales-banner/` will only search in folder sales-banner. + * + * Note : If your use case involves searching within a folder as well as its subfolders, you can use `path` parameter in `searchQuery` with appropriate operator. + * Checkout [Supported parameters](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#supported-parameters) for more information. + * @param string $searchQuery Query string in a Lucene-like query language e.g. `createdAt > "7d"`. + * + * Note : When the searchQuery parameter is present, the following query parameters will have no effect on the result: + * + * 1. `tags` + * 2. `type` + * 3. `name` + * + * [Learn more](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#advanced-search-queries) from examples. + * @param int $skip the number of results to skip before returning results + * @param 'ASC_NAME'|'DESC_NAME'|'ASC_CREATED'|'DESC_CREATED'|'ASC_UPDATED'|'DESC_UPDATED'|'ASC_HEIGHT'|'DESC_HEIGHT'|'ASC_WIDTH'|'DESC_WIDTH'|'ASC_SIZE'|'DESC_SIZE'|'ASC_RELEVANCE'|'DESC_RELEVANCE'|Sort $sort sort the results by one of the supported fields in ascending or descending order + * @param 'file'|'file-version'|'folder'|'all'|Type $type Filter results by asset type. + * + * - `file` — returns only files + * - `file-version` — returns specific file versions + * - `folder` — returns only folders + * - `all` — returns both files and folders (excludes `file-version`) * * @return list * * @throws APIException */ public function list( - array|AssetListParams $params, - ?RequestOptions $requestOptions = null + string|FileType $fileType = 'all', + int $limit = 1000, + ?string $path = null, + ?string $searchQuery = null, + int $skip = 0, + string|Sort $sort = 'ASC_CREATED', + string|Type $type = 'file', + ?RequestOptions $requestOptions = null, ): array; } diff --git a/src/ServiceContracts/AssetsRawContract.php b/src/ServiceContracts/AssetsRawContract.php new file mode 100644 index 00000000..6dedb872 --- /dev/null +++ b/src/ServiceContracts/AssetsRawContract.php @@ -0,0 +1,29 @@ +|AssetListParams $params + * + * @return BaseResponse> + * + * @throws APIException + */ + public function list( + array|AssetListParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse; +} diff --git a/src/ServiceContracts/Beta/V2/FilesContract.php b/src/ServiceContracts/Beta/V2/FilesContract.php index bf3b7e80..12dfb7a9 100644 --- a/src/ServiceContracts/Beta/V2/FilesContract.php +++ b/src/ServiceContracts/Beta/V2/FilesContract.php @@ -4,7 +4,7 @@ namespace Imagekit\ServiceContracts\Beta\V2; -use Imagekit\Beta\V2\Files\FileUploadParams; +use Imagekit\Beta\V2\Files\FileUploadParams\ResponseField; use Imagekit\Beta\V2\Files\FileUploadResponse; use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; @@ -14,12 +14,83 @@ interface FilesContract /** * @api * - * @param array|FileUploadParams $params + * @param string $file The API accepts any of the following: + * + * - **Binary data** – send the raw bytes as `multipart/form-data`. + * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. + * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. + * + * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + * @param string $fileName the name with which the file has to be uploaded + * @param string $token This is the client-generated JSON Web Token (JWT). The ImageKit.io server uses it to authenticate and check that the upload request parameters have not been tampered with after the token has been generated. Learn how to create the token on the page below. This field is only required for authentication when uploading a file from the client side. + * @param string $checks Server-side checks to run on the asset. + * Read more about [Upload API checks](/docs/api-reference/upload-file/upload-file-v2#upload-api-checks). + * @param string $customCoordinates Define an important area in the image. This is only relevant for image type files. + * + * - To be passed as a string with the x and y coordinates of the top-left corner, and width and height of the area of interest in the format `x,y,width,height`. For example - `10,10,100,100` + * - Can be used with fo-customtransformation. + * - If this field is not specified and the file is overwritten, then customCoordinates will be removed. + * @param array $customMetadata JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. + * @param string $description optional text to describe the contents of the file + * @param list> $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. + * @param string $folder The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. Using multiple `/` creates a nested folder. + * @param bool $isPrivateFile Whether to mark the file as private or not. + * + * If `true`, the file is marked as private and is accessible only using named transformation or signed URL. + * @param bool $isPublished Whether to upload file as published or not. + * + * If `false`, the file is marked as unpublished, which restricts access to the file only via the media library. Files in draft or unpublished state can only be publicly accessed after being published. + * + * The option to upload in draft state is only available in custom enterprise pricing plans. + * @param bool $overwriteAITags If set to `true` and a file already exists at the exact location, its AITags will be removed. Set `overwriteAITags` to `false` to preserve AITags. + * @param bool $overwriteCustomMetadata if the request does not have `customMetadata`, and a file already exists at the exact location, existing customMetadata will be removed + * @param bool $overwriteFile if `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately + * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed + * @param list<'tags'|'customCoordinates'|'isPrivateFile'|'embeddedMetadata'|'isPublished'|'customMetadata'|'metadata'|'selectedFieldsSchema'|ResponseField> $responseFields array of response field keys to include in the API response body + * @param list $tags Set the tags while uploading the file. + * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. + * If this field is not specified and the file is overwritten, the existing tags will be removed. + * @param array{ + * post?: list>, pre?: string + * } $transformation Configure pre-processing (`pre`) and post-processing (`post`) transformations. + * + * - `pre` — applied before the file is uploaded to the Media Library. + * Useful for reducing file size or applying basic optimizations upfront (e.g., resize, compress). + * + * - `post` — applied immediately after upload. + * Ideal for generating transformed versions (like video encodes or thumbnails) in advance, so they're ready for delivery without delay. + * + * You can mix and match any combination of post-processing types. + * @param bool $useUniqueFileName Whether to use a unique filename for this file or not. + * + * If `true`, ImageKit.io will add a unique suffix to the filename parameter to get a unique filename. + * + * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. + * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. * * @throws APIException */ public function upload( - array|FileUploadParams $params, - ?RequestOptions $requestOptions = null + string $file, + string $fileName, + ?string $token = null, + ?string $checks = null, + ?string $customCoordinates = null, + ?array $customMetadata = null, + ?string $description = null, + ?array $extensions = null, + string $folder = '/', + bool $isPrivateFile = false, + bool $isPublished = true, + bool $overwriteAITags = true, + bool $overwriteCustomMetadata = true, + bool $overwriteFile = true, + bool $overwriteTags = true, + ?array $responseFields = null, + ?array $tags = null, + ?array $transformation = null, + bool $useUniqueFileName = true, + ?string $webhookURL = null, + ?RequestOptions $requestOptions = null, ): FileUploadResponse; } diff --git a/src/ServiceContracts/Beta/V2/FilesRawContract.php b/src/ServiceContracts/Beta/V2/FilesRawContract.php new file mode 100644 index 00000000..dd25ec75 --- /dev/null +++ b/src/ServiceContracts/Beta/V2/FilesRawContract.php @@ -0,0 +1,28 @@ +|FileUploadParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function upload( + array|FileUploadParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse; +} diff --git a/src/ServiceContracts/Beta/V2RawContract.php b/src/ServiceContracts/Beta/V2RawContract.php new file mode 100644 index 00000000..998afd13 --- /dev/null +++ b/src/ServiceContracts/Beta/V2RawContract.php @@ -0,0 +1,7 @@ +|InvalidationCreateParams $params + * @param string $url the full URL of the file to be purged * * @throws APIException */ public function create( - array|InvalidationCreateParams $params, - ?RequestOptions $requestOptions = null, + string $url, + ?RequestOptions $requestOptions = null ): InvalidationNewResponse; /** * @api * + * @param string $requestID should be a valid requestId + * * @throws APIException */ public function get( diff --git a/src/ServiceContracts/Cache/InvalidationRawContract.php b/src/ServiceContracts/Cache/InvalidationRawContract.php new file mode 100644 index 00000000..8f8d5ffd --- /dev/null +++ b/src/ServiceContracts/Cache/InvalidationRawContract.php @@ -0,0 +1,43 @@ +|InvalidationCreateParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function create( + array|InvalidationCreateParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse; + + /** + * @api + * + * @param string $requestID should be a valid requestId + * + * @return BaseResponse + * + * @throws APIException + */ + public function get( + string $requestID, + ?RequestOptions $requestOptions = null + ): BaseResponse; +} diff --git a/src/ServiceContracts/CacheRawContract.php b/src/ServiceContracts/CacheRawContract.php new file mode 100644 index 00000000..601fbc3a --- /dev/null +++ b/src/ServiceContracts/CacheRawContract.php @@ -0,0 +1,7 @@ +|CustomMetadataFieldCreateParams $params + * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. + * @param string $name API name of the custom metadata field. This should be unique across all (including deleted) custom metadata fields. + * @param array{ + * type: 'Text'|'Textarea'|'Number'|'Date'|'Boolean'|'SingleSelect'|'MultiSelect'|Type, + * defaultValue?: mixed, + * isValueRequired?: bool, + * maxLength?: float, + * maxValue?: string|float, + * minLength?: float, + * minValue?: string|float, + * selectOptions?: list, + * } $schema * * @throws APIException */ public function create( - array|CustomMetadataFieldCreateParams $params, + string $label, + string $name, + array $schema, ?RequestOptions $requestOptions = null, ): CustomMetadataField; /** * @api * - * @param array|CustomMetadataFieldUpdateParams $params + * @param string $id should be a valid custom metadata field id + * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. This parameter is required if `schema` is not provided. + * @param array{ + * defaultValue?: mixed, + * isValueRequired?: bool, + * maxLength?: float, + * maxValue?: string|float, + * minLength?: float, + * minValue?: string|float, + * selectOptions?: list, + * } $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. * * @throws APIException */ public function update( string $id, - array|CustomMetadataFieldUpdateParams $params, + ?string $label = null, + ?array $schema = null, ?RequestOptions $requestOptions = null, ): CustomMetadataField; /** * @api * - * @param array|CustomMetadataFieldListParams $params + * @param string $folderPath The folder path (e.g., `/path/to/folder`) for which to retrieve applicable custom metadata fields. Useful for determining path-specific field selections when the [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in use. + * @param bool $includeDeleted set it to `true` to include deleted field objects in the API response * * @return list * * @throws APIException */ public function list( - array|CustomMetadataFieldListParams $params, + ?string $folderPath = null, + bool $includeDeleted = false, ?RequestOptions $requestOptions = null, ): array; /** * @api * + * @param string $id should be a valid custom metadata field id + * * @throws APIException */ public function delete( diff --git a/src/ServiceContracts/CustomMetadataFieldsRawContract.php b/src/ServiceContracts/CustomMetadataFieldsRawContract.php new file mode 100644 index 00000000..bb310038 --- /dev/null +++ b/src/ServiceContracts/CustomMetadataFieldsRawContract.php @@ -0,0 +1,75 @@ +|CustomMetadataFieldCreateParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function create( + array|CustomMetadataFieldCreateParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse; + + /** + * @api + * + * @param string $id should be a valid custom metadata field id + * @param array|CustomMetadataFieldUpdateParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function update( + string $id, + array|CustomMetadataFieldUpdateParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse; + + /** + * @api + * + * @param array|CustomMetadataFieldListParams $params + * + * @return BaseResponse> + * + * @throws APIException + */ + public function list( + array|CustomMetadataFieldListParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse; + + /** + * @api + * + * @param string $id should be a valid custom metadata field id + * + * @return BaseResponse + * + * @throws APIException + */ + public function delete( + string $id, + ?RequestOptions $requestOptions = null + ): BaseResponse; +} diff --git a/src/ServiceContracts/Files/BulkContract.php b/src/ServiceContracts/Files/BulkContract.php index 993feb56..fdcecd47 100644 --- a/src/ServiceContracts/Files/BulkContract.php +++ b/src/ServiceContracts/Files/BulkContract.php @@ -5,13 +5,9 @@ namespace Imagekit\ServiceContracts\Files; use Imagekit\Core\Exceptions\APIException; -use Imagekit\Files\Bulk\BulkAddTagsParams; use Imagekit\Files\Bulk\BulkAddTagsResponse; -use Imagekit\Files\Bulk\BulkDeleteParams; use Imagekit\Files\Bulk\BulkDeleteResponse; -use Imagekit\Files\Bulk\BulkRemoveAITagsParams; use Imagekit\Files\Bulk\BulkRemoveAITagsResponse; -use Imagekit\Files\Bulk\BulkRemoveTagsParams; use Imagekit\Files\Bulk\BulkRemoveTagsResponse; use Imagekit\RequestOptions; @@ -20,48 +16,54 @@ interface BulkContract /** * @api * - * @param array|BulkDeleteParams $params + * @param list $fileIDs an array of fileIds which you want to delete * * @throws APIException */ public function delete( - array|BulkDeleteParams $params, + array $fileIDs, ?RequestOptions $requestOptions = null ): BulkDeleteResponse; /** * @api * - * @param array|BulkAddTagsParams $params + * @param list $fileIDs an array of fileIds to which you want to add tags + * @param list $tags an array of tags that you want to add to the files * * @throws APIException */ public function addTags( - array|BulkAddTagsParams $params, + array $fileIDs, + array $tags, ?RequestOptions $requestOptions = null ): BulkAddTagsResponse; /** * @api * - * @param array|BulkRemoveAITagsParams $params + * @param list $aiTags an array of AITags that you want to remove from the files + * @param list $fileIDs an array of fileIds from which you want to remove AITags * * @throws APIException */ public function removeAITags( - array|BulkRemoveAITagsParams $params, - ?RequestOptions $requestOptions = null, + array $aiTags, + array $fileIDs, + ?RequestOptions $requestOptions = null ): BulkRemoveAITagsResponse; /** * @api * - * @param array|BulkRemoveTagsParams $params + * @param list $fileIDs an array of fileIds from which you want to remove tags + * @param list $tags an array of tags that you want to remove from the files * * @throws APIException */ public function removeTags( - array|BulkRemoveTagsParams $params, + array $fileIDs, + array $tags, ?RequestOptions $requestOptions = null ): BulkRemoveTagsResponse; } diff --git a/src/ServiceContracts/Files/BulkRawContract.php b/src/ServiceContracts/Files/BulkRawContract.php new file mode 100644 index 00000000..7919f22d --- /dev/null +++ b/src/ServiceContracts/Files/BulkRawContract.php @@ -0,0 +1,76 @@ +|BulkDeleteParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function delete( + array|BulkDeleteParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse; + + /** + * @api + * + * @param array|BulkAddTagsParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function addTags( + array|BulkAddTagsParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse; + + /** + * @api + * + * @param array|BulkRemoveAITagsParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function removeAITags( + array|BulkRemoveAITagsParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse; + + /** + * @api + * + * @param array|BulkRemoveTagsParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function removeTags( + array|BulkRemoveTagsParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse; +} diff --git a/src/ServiceContracts/Files/MetadataContract.php b/src/ServiceContracts/Files/MetadataContract.php index 4ad4559a..692aa5d2 100644 --- a/src/ServiceContracts/Files/MetadataContract.php +++ b/src/ServiceContracts/Files/MetadataContract.php @@ -6,7 +6,6 @@ use Imagekit\Core\Exceptions\APIException; use Imagekit\Files\Metadata; -use Imagekit\Files\Metadata\MetadataGetFromURLParams; use Imagekit\RequestOptions; interface MetadataContract @@ -14,6 +13,8 @@ interface MetadataContract /** * @api * + * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in the list and search assets API and upload API. + * * @throws APIException */ public function get( @@ -24,12 +25,12 @@ public function get( /** * @api * - * @param array|MetadataGetFromURLParams $params + * @param string $url Should be a valid file URL. It should be accessible using your ImageKit.io account. * * @throws APIException */ public function getFromURL( - array|MetadataGetFromURLParams $params, - ?RequestOptions $requestOptions = null, + string $url, + ?RequestOptions $requestOptions = null ): Metadata; } diff --git a/src/ServiceContracts/Files/MetadataRawContract.php b/src/ServiceContracts/Files/MetadataRawContract.php new file mode 100644 index 00000000..b909aedb --- /dev/null +++ b/src/ServiceContracts/Files/MetadataRawContract.php @@ -0,0 +1,42 @@ + + * + * @throws APIException + */ + public function get( + string $fileID, + ?RequestOptions $requestOptions = null + ): BaseResponse; + + /** + * @api + * + * @param array|MetadataGetFromURLParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function getFromURL( + array|MetadataGetFromURLParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse; +} diff --git a/src/ServiceContracts/Files/VersionsContract.php b/src/ServiceContracts/Files/VersionsContract.php index 79c8dd0b..315db822 100644 --- a/src/ServiceContracts/Files/VersionsContract.php +++ b/src/ServiceContracts/Files/VersionsContract.php @@ -6,10 +6,7 @@ use Imagekit\Core\Exceptions\APIException; use Imagekit\Files\File; -use Imagekit\Files\Versions\VersionDeleteParams; use Imagekit\Files\Versions\VersionDeleteResponse; -use Imagekit\Files\Versions\VersionGetParams; -use Imagekit\Files\Versions\VersionRestoreParams; use Imagekit\RequestOptions; interface VersionsContract @@ -17,6 +14,8 @@ interface VersionsContract /** * @api * + * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. + * * @return list * * @throws APIException @@ -29,39 +28,42 @@ public function list( /** * @api * - * @param array|VersionDeleteParams $params + * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. + * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. * * @throws APIException */ public function delete( string $versionID, - array|VersionDeleteParams $params, - ?RequestOptions $requestOptions = null, + string $fileID, + ?RequestOptions $requestOptions = null ): VersionDeleteResponse; /** * @api * - * @param array|VersionGetParams $params + * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. + * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. * * @throws APIException */ public function get( string $versionID, - array|VersionGetParams $params, - ?RequestOptions $requestOptions = null, + string $fileID, + ?RequestOptions $requestOptions = null ): File; /** * @api * - * @param array|VersionRestoreParams $params + * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. + * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. * * @throws APIException */ public function restore( string $versionID, - array|VersionRestoreParams $params, - ?RequestOptions $requestOptions = null, + string $fileID, + ?RequestOptions $requestOptions = null ): File; } diff --git a/src/ServiceContracts/Files/VersionsRawContract.php b/src/ServiceContracts/Files/VersionsRawContract.php new file mode 100644 index 00000000..ef64450d --- /dev/null +++ b/src/ServiceContracts/Files/VersionsRawContract.php @@ -0,0 +1,79 @@ +> + * + * @throws APIException + */ + public function list( + string $fileID, + ?RequestOptions $requestOptions = null + ): BaseResponse; + + /** + * @api + * + * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. + * @param array|VersionDeleteParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function delete( + string $versionID, + array|VersionDeleteParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse; + + /** + * @api + * + * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. + * @param array|VersionGetParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function get( + string $versionID, + array|VersionGetParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse; + + /** + * @api + * + * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. + * @param array|VersionRestoreParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function restore( + string $versionID, + array|VersionRestoreParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse; +} diff --git a/src/ServiceContracts/FilesContract.php b/src/ServiceContracts/FilesContract.php index 352285d1..993da2a1 100644 --- a/src/ServiceContracts/FilesContract.php +++ b/src/ServiceContracts/FilesContract.php @@ -6,15 +6,11 @@ use Imagekit\Core\Exceptions\APIException; use Imagekit\Files\File; -use Imagekit\Files\FileCopyParams; use Imagekit\Files\FileCopyResponse; -use Imagekit\Files\FileMoveParams; use Imagekit\Files\FileMoveResponse; -use Imagekit\Files\FileRenameParams; use Imagekit\Files\FileRenameResponse; -use Imagekit\Files\FileUpdateParams; use Imagekit\Files\FileUpdateResponse; -use Imagekit\Files\FileUploadParams; +use Imagekit\Files\FileUploadParams\ResponseField; use Imagekit\Files\FileUploadResponse; use Imagekit\RequestOptions; @@ -23,19 +19,42 @@ interface FilesContract /** * @api * - * @param array|FileUpdateParams $params + * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. + * @param string|null $customCoordinates Define an important area in the image in the format `x,y,width,height` e.g. `10,10,100,100`. Send `null` to unset this value. + * @param array $customMetadata A key-value data to be associated with the asset. To unset a key, send `null` value for that key. Before setting any custom metadata on an asset you have to create the field using custom metadata fields API. + * @param string $description optional text to describe the contents of the file + * @param list> $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. + * @param 'all'|list $removeAITags An array of AITags associated with the file that you want to remove, e.g. `["car", "vehicle", "motorsports"]`. + * + * If you want to remove all AITags associated with the file, send a string - "all". + * + * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. + * @param list|null $tags An array of tags associated with the file, such as `["tag1", "tag2"]`. Send `null` to unset all tags associated with the file. + * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + * @param array{ + * isPublished: bool, includeFileVersions?: bool + * } $publish Configure the publication status of a file and its versions * * @throws APIException */ public function update( string $fileID, - array|FileUpdateParams $params, + ?string $customCoordinates = null, + ?array $customMetadata = null, + ?string $description = null, + ?array $extensions = null, + string|array|null $removeAITags = null, + ?array $tags = null, + ?string $webhookURL = null, + ?array $publish = null, ?RequestOptions $requestOptions = null, ): FileUpdateResponse; /** * @api * + * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. + * * @throws APIException */ public function delete( @@ -46,18 +65,24 @@ public function delete( /** * @api * - * @param array|FileCopyParams $params + * @param string $destinationPath full path to the folder you want to copy the above file into + * @param string $sourceFilePath the full path of the file you want to copy + * @param bool $includeFileVersions Option to copy all versions of a file. By default, only the current version of the file is copied. When set to true, all versions of the file will be copied. Default value - `false`. * * @throws APIException */ public function copy( - array|FileCopyParams $params, - ?RequestOptions $requestOptions = null + string $destinationPath, + string $sourceFilePath, + ?bool $includeFileVersions = null, + ?RequestOptions $requestOptions = null, ): FileCopyResponse; /** * @api * + * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in the list and search assets API and upload API. + * * @throws APIException */ public function get( @@ -68,36 +93,145 @@ public function get( /** * @api * - * @param array|FileMoveParams $params + * @param string $destinationPath full path to the folder you want to move the above file into + * @param string $sourceFilePath the full path of the file you want to move * * @throws APIException */ public function move( - array|FileMoveParams $params, - ?RequestOptions $requestOptions = null + string $destinationPath, + string $sourceFilePath, + ?RequestOptions $requestOptions = null, ): FileMoveResponse; /** * @api * - * @param array|FileRenameParams $params + * @param string $filePath the full path of the file you want to rename + * @param string $newFileName The new name of the file. A filename can contain: + * + * Alphanumeric Characters: `a-z`, `A-Z`, `0-9` (including Unicode letters, marks, and numerals in other languages). + * Special Characters: `.`, `_`, and `-`. + * + * Any other character, including space, will be replaced by `_`. + * @param bool $purgeCache Option to purge cache for the old file and its versions' URLs. + * + * When set to true, it will internally issue a purge cache request on CDN to remove cached content of old file and its versions. This purge request is counted against your monthly purge quota. + * + * Note: If the old file were accessible at `https://ik.imagekit.io/demo/old-filename.jpg`, a purge cache request would be issued against `https://ik.imagekit.io/demo/old-filename.jpg*` (with a wildcard at the end). It will remove the file and its versions' URLs and any transformations made using query parameters on this file or its versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. * * @throws APIException */ public function rename( - array|FileRenameParams $params, - ?RequestOptions $requestOptions = null + string $filePath, + string $newFileName, + ?bool $purgeCache = null, + ?RequestOptions $requestOptions = null, ): FileRenameResponse; /** * @api * - * @param array|FileUploadParams $params + * @param string $file The API accepts any of the following: + * + * - **Binary data** – send the raw bytes as `multipart/form-data`. + * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. + * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. + * + * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + * @param string $fileName The name with which the file has to be uploaded. + * The file name can contain: + * + * - Alphanumeric Characters: `a-z`, `A-Z`, `0-9`. + * - Special Characters: `.`, `-` + * + * Any other character including space will be replaced by `_` + * @param string $token A unique value that the ImageKit.io server will use to recognize and prevent subsequent retries for the same request. We suggest using V4 UUIDs, or another random string with enough entropy to avoid collisions. This field is only required for authentication when uploading a file from the client side. + * + * **Note**: Sending a value that has been used in the past will result in a validation error. Even if your previous request resulted in an error, you should always send a new value for this field. + * @param string $checks Server-side checks to run on the asset. + * Read more about [Upload API checks](/docs/api-reference/upload-file/upload-file#upload-api-checks). + * @param string $customCoordinates Define an important area in the image. This is only relevant for image type files. + * + * - To be passed as a string with the x and y coordinates of the top-left corner, and width and height of the area of interest in the format `x,y,width,height`. For example - `10,10,100,100` + * - Can be used with fo-customtransformation. + * - If this field is not specified and the file is overwritten, then customCoordinates will be removed. + * @param array $customMetadata JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. + * @param string $description optional text to describe the contents of the file + * @param int $expire The time until your signature is valid. It must be a [Unix time](https://en.wikipedia.org/wiki/Unix_time) in less than 1 hour into the future. It should be in seconds. This field is only required for authentication when uploading a file from the client side. + * @param list> $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. + * @param string $folder The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. + * + * The folder name can contain: + * + * - Alphanumeric Characters: `a-z` , `A-Z` , `0-9` + * - Special Characters: `/` , `_` , `-` + * + * Using multiple `/` creates a nested folder. + * @param bool $isPrivateFile Whether to mark the file as private or not. + * + * If `true`, the file is marked as private and is accessible only using named transformation or signed URL. + * @param bool $isPublished Whether to upload file as published or not. + * + * If `false`, the file is marked as unpublished, which restricts access to the file only via the media library. Files in draft or unpublished state can only be publicly accessed after being published. + * + * The option to upload in draft state is only available in custom enterprise pricing plans. + * @param bool $overwriteAITags If set to `true` and a file already exists at the exact location, its AITags will be removed. Set `overwriteAITags` to `false` to preserve AITags. + * @param bool $overwriteCustomMetadata if the request does not have `customMetadata`, and a file already exists at the exact location, existing customMetadata will be removed + * @param bool $overwriteFile if `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately + * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed + * @param string $publicKey Your ImageKit.io public key. This field is only required for authentication when uploading a file from the client side. + * @param list<'tags'|'customCoordinates'|'isPrivateFile'|'embeddedMetadata'|'isPublished'|'customMetadata'|'metadata'|'selectedFieldsSchema'|ResponseField> $responseFields array of response field keys to include in the API response body + * @param string $signature HMAC-SHA1 digest of the token+expire using your ImageKit.io private API key as a key. Learn how to create a signature on the page below. This should be in lowercase. + * + * Signature must be calculated on the server-side. This field is only required for authentication when uploading a file from the client side. + * @param list $tags Set the tags while uploading the file. + * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. + * If this field is not specified and the file is overwritten, the existing tags will be removed. + * @param array{ + * post?: list>, pre?: string + * } $transformation Configure pre-processing (`pre`) and post-processing (`post`) transformations. + * + * - `pre` — applied before the file is uploaded to the Media Library. + * Useful for reducing file size or applying basic optimizations upfront (e.g., resize, compress). + * + * - `post` — applied immediately after upload. + * Ideal for generating transformed versions (like video encodes or thumbnails) in advance, so they're ready for delivery without delay. + * + * You can mix and match any combination of post-processing types. + * @param bool $useUniqueFileName Whether to use a unique filename for this file or not. + * + * If `true`, ImageKit.io will add a unique suffix to the filename parameter to get a unique filename. + * + * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. + * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. * * @throws APIException */ public function upload( - array|FileUploadParams $params, - ?RequestOptions $requestOptions = null + string $file, + string $fileName, + ?string $token = null, + ?string $checks = null, + ?string $customCoordinates = null, + ?array $customMetadata = null, + ?string $description = null, + ?int $expire = null, + ?array $extensions = null, + string $folder = '/', + bool $isPrivateFile = false, + bool $isPublished = true, + bool $overwriteAITags = true, + bool $overwriteCustomMetadata = true, + bool $overwriteFile = true, + bool $overwriteTags = true, + ?string $publicKey = null, + ?array $responseFields = null, + ?string $signature = null, + ?array $tags = null, + ?array $transformation = null, + bool $useUniqueFileName = true, + ?string $webhookURL = null, + ?RequestOptions $requestOptions = null, ): FileUploadResponse; } diff --git a/src/ServiceContracts/FilesRawContract.php b/src/ServiceContracts/FilesRawContract.php new file mode 100644 index 00000000..e1cfa367 --- /dev/null +++ b/src/ServiceContracts/FilesRawContract.php @@ -0,0 +1,123 @@ +|FileUpdateParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function update( + string $fileID, + array|FileUpdateParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse; + + /** + * @api + * + * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. + * + * @return BaseResponse + * + * @throws APIException + */ + public function delete( + string $fileID, + ?RequestOptions $requestOptions = null + ): BaseResponse; + + /** + * @api + * + * @param array|FileCopyParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function copy( + array|FileCopyParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse; + + /** + * @api + * + * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in the list and search assets API and upload API. + * + * @return BaseResponse + * + * @throws APIException + */ + public function get( + string $fileID, + ?RequestOptions $requestOptions = null + ): BaseResponse; + + /** + * @api + * + * @param array|FileMoveParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function move( + array|FileMoveParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse; + + /** + * @api + * + * @param array|FileRenameParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function rename( + array|FileRenameParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse; + + /** + * @api + * + * @param array|FileUploadParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function upload( + array|FileUploadParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse; +} diff --git a/src/ServiceContracts/Folders/JobContract.php b/src/ServiceContracts/Folders/JobContract.php index 4cab7130..01a2e7a8 100644 --- a/src/ServiceContracts/Folders/JobContract.php +++ b/src/ServiceContracts/Folders/JobContract.php @@ -13,6 +13,8 @@ interface JobContract /** * @api * + * @param string $jobID The `jobId` is returned in the response of bulk job API e.g. copy folder or move folder API. + * * @throws APIException */ public function get( diff --git a/src/ServiceContracts/Folders/JobRawContract.php b/src/ServiceContracts/Folders/JobRawContract.php new file mode 100644 index 00000000..16bd5b31 --- /dev/null +++ b/src/ServiceContracts/Folders/JobRawContract.php @@ -0,0 +1,27 @@ + + * + * @throws APIException + */ + public function get( + string $jobID, + ?RequestOptions $requestOptions = null + ): BaseResponse; +} diff --git a/src/ServiceContracts/FoldersContract.php b/src/ServiceContracts/FoldersContract.php index edccd8fa..421a7770 100644 --- a/src/ServiceContracts/FoldersContract.php +++ b/src/ServiceContracts/FoldersContract.php @@ -5,15 +5,10 @@ namespace Imagekit\ServiceContracts; use Imagekit\Core\Exceptions\APIException; -use Imagekit\Folders\FolderCopyParams; use Imagekit\Folders\FolderCopyResponse; -use Imagekit\Folders\FolderCreateParams; -use Imagekit\Folders\FolderDeleteParams; use Imagekit\Folders\FolderDeleteResponse; -use Imagekit\Folders\FolderMoveParams; use Imagekit\Folders\FolderMoveResponse; use Imagekit\Folders\FolderNewResponse; -use Imagekit\Folders\FolderRenameParams; use Imagekit\Folders\FolderRenameResponse; use Imagekit\RequestOptions; @@ -22,60 +17,84 @@ interface FoldersContract /** * @api * - * @param array|FolderCreateParams $params + * @param string $folderName The folder will be created with this name. + * + * All characters except alphabets and numbers (inclusive of unicode letters, marks, and numerals in other languages) will be replaced by an underscore i.e. `_`. + * @param string $parentFolderPath The folder where the new folder should be created, for root use `/` else the path e.g. `containing/folder/`. + * + * Note: If any folder(s) is not present in the parentFolderPath parameter, it will be automatically created. For example, if you pass `/product/images/summer`, then `product`, `images`, and `summer` folders will be created if they don't already exist. * * @throws APIException */ public function create( - array|FolderCreateParams $params, - ?RequestOptions $requestOptions = null + string $folderName, + string $parentFolderPath, + ?RequestOptions $requestOptions = null, ): FolderNewResponse; /** * @api * - * @param array|FolderDeleteParams $params + * @param string $folderPath Full path to the folder you want to delete. For example `/folder/to/delete/`. * * @throws APIException */ public function delete( - array|FolderDeleteParams $params, + string $folderPath, ?RequestOptions $requestOptions = null ): FolderDeleteResponse; /** * @api * - * @param array|FolderCopyParams $params + * @param string $destinationPath full path to the destination folder where you want to copy the source folder into + * @param string $sourceFolderPath the full path to the source folder you want to copy + * @param bool $includeVersions Option to copy all versions of files that are nested inside the selected folder. By default, only the current version of each file will be copied. When set to true, all versions of each file will be copied. Default value - `false`. * * @throws APIException */ public function copy( - array|FolderCopyParams $params, - ?RequestOptions $requestOptions = null + string $destinationPath, + string $sourceFolderPath, + ?bool $includeVersions = null, + ?RequestOptions $requestOptions = null, ): FolderCopyResponse; /** * @api * - * @param array|FolderMoveParams $params + * @param string $destinationPath full path to the destination folder where you want to move the source folder into + * @param string $sourceFolderPath the full path to the source folder you want to move * * @throws APIException */ public function move( - array|FolderMoveParams $params, - ?RequestOptions $requestOptions = null + string $destinationPath, + string $sourceFolderPath, + ?RequestOptions $requestOptions = null, ): FolderMoveResponse; /** * @api * - * @param array|FolderRenameParams $params + * @param string $folderPath the full path to the folder you want to rename + * @param string $newFolderName The new name for the folder. + * + * All characters except alphabets and numbers (inclusive of unicode letters, marks, and numerals in other languages) and `-` will be replaced by an underscore i.e. `_`. + * @param bool $purgeCache Option to purge cache for the old nested files and their versions' URLs. + * + * When set to true, it will internally issue a purge cache request on CDN to remove the cached content of the old nested files and their versions. There will only be one purge request for all the nested files, which will be counted against your monthly purge quota. + * + * Note: A purge cache request will be issued against `https://ik.imagekit.io/old/folder/path*` (with a wildcard at the end). This will remove all nested files, their versions' URLs, and any transformations made using query parameters on these files or their versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. + * + * Default value - `false` * * @throws APIException */ public function rename( - array|FolderRenameParams $params, - ?RequestOptions $requestOptions = null + string $folderPath, + string $newFolderName, + ?bool $purgeCache = null, + ?RequestOptions $requestOptions = null, ): FolderRenameResponse; } diff --git a/src/ServiceContracts/FoldersRawContract.php b/src/ServiceContracts/FoldersRawContract.php new file mode 100644 index 00000000..38845323 --- /dev/null +++ b/src/ServiceContracts/FoldersRawContract.php @@ -0,0 +1,92 @@ +|FolderCreateParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function create( + array|FolderCreateParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse; + + /** + * @api + * + * @param array|FolderDeleteParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function delete( + array|FolderDeleteParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse; + + /** + * @api + * + * @param array|FolderCopyParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function copy( + array|FolderCopyParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse; + + /** + * @api + * + * @param array|FolderMoveParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function move( + array|FolderMoveParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse; + + /** + * @api + * + * @param array|FolderRenameParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function rename( + array|FolderRenameParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse; +} diff --git a/src/ServiceContracts/WebhooksRawContract.php b/src/ServiceContracts/WebhooksRawContract.php new file mode 100644 index 00000000..9be0a2e1 --- /dev/null +++ b/src/ServiceContracts/WebhooksRawContract.php @@ -0,0 +1,7 @@ + + * + * @throws APIException + */ + public function create( + array|OriginCreateParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse { + [$parsed, $options] = OriginCreateParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'post', + path: 'v1/accounts/origins', + body: (object) $parsed, + options: $options, + convert: OriginResponse::class, + ); + } + + /** + * @api + * + * **Note:** This API is currently in beta. + * Updates the origin identified by `id` and returns the updated origin object. + * + * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + * @param array{ + * accessKey: string, + * bucket: string, + * name: string, + * secretKey: string, + * type?: 'AKENEO_PIM', + * baseURLForCanonicalHeader?: string, + * includeCanonicalHeader?: bool, + * prefix?: string, + * endpoint: string, + * s3ForcePathStyle?: bool, + * baseURL: string, + * forwardHostHeaderToOrigin?: bool, + * clientEmail: string, + * privateKey: string, + * accountName: string, + * container: string, + * sasToken: string, + * clientID: string, + * clientSecret: string, + * password: string, + * username: string, + * }|OriginUpdateParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function update( + string $id, + array|OriginUpdateParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse { + [$parsed, $options] = OriginUpdateParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'put', + path: ['v1/accounts/origins/%1$s', $id], + body: (object) $parsed, + options: $options, + convert: OriginResponse::class, + ); + } + + /** + * @api + * + * **Note:** This API is currently in beta. + * Returns an array of all configured origins for the current account. + * + * @return BaseResponse,> + * + * @throws APIException + */ + public function list(?RequestOptions $requestOptions = null): BaseResponse + { + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'get', + path: 'v1/accounts/origins', + options: $requestOptions, + convert: new ListOf(OriginResponse::class), + ); + } + + /** + * @api + * + * **Note:** This API is currently in beta. + * Permanently removes the origin identified by `id`. If the origin is in use by any URL‑endpoints, the API will return an error. + * + * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + * + * @return BaseResponse + * + * @throws APIException + */ + public function delete( + string $id, + ?RequestOptions $requestOptions = null + ): BaseResponse { + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'delete', + path: ['v1/accounts/origins/%1$s', $id], + options: $requestOptions, + convert: null, + ); + } + + /** + * @api + * + * **Note:** This API is currently in beta. + * Retrieves the origin identified by `id`. + * + * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + * + * @return BaseResponse + * + * @throws APIException + */ + public function get( + string $id, + ?RequestOptions $requestOptions = null + ): BaseResponse { + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'get', + path: ['v1/accounts/origins/%1$s', $id], + options: $requestOptions, + convert: OriginResponse::class, + ); + } +} diff --git a/src/Services/Accounts/OriginsService.php b/src/Services/Accounts/OriginsService.php index 9d02de86..f5788e01 100644 --- a/src/Services/Accounts/OriginsService.php +++ b/src/Services/Accounts/OriginsService.php @@ -4,8 +4,6 @@ namespace Imagekit\Services\Accounts; -use Imagekit\Accounts\Origins\OriginCreateParams; -use Imagekit\Accounts\Origins\OriginResponse; use Imagekit\Accounts\Origins\OriginResponse\AkeneoPim; use Imagekit\Accounts\Origins\OriginResponse\AzureBlob; use Imagekit\Accounts\Origins\OriginResponse\CloudinaryBackup; @@ -14,20 +12,25 @@ use Imagekit\Accounts\Origins\OriginResponse\S3Compatible; use Imagekit\Accounts\Origins\OriginResponse\WebFolder; use Imagekit\Accounts\Origins\OriginResponse\WebProxy; -use Imagekit\Accounts\Origins\OriginUpdateParams; use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Conversion\ListOf; use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Accounts\OriginsContract; final class OriginsService implements OriginsContract { + /** + * @api + */ + public OriginsRawService $raw; + /** * @internal */ - public function __construct(private Client $client) {} + public function __construct(private Client $client) + { + $this->raw = new OriginsRawService($client); + } /** * @api @@ -35,49 +38,75 @@ public function __construct(private Client $client) {} * **Note:** This API is currently in beta. * Creates a new origin and returns the origin object. * - * @param array{ - * accessKey: string, - * bucket: string, - * name: string, - * secretKey: string, - * type?: 'AKENEO_PIM', - * baseURLForCanonicalHeader?: string, - * includeCanonicalHeader?: bool, - * prefix?: string, - * endpoint: string, - * s3ForcePathStyle?: bool, - * baseURL: string, - * forwardHostHeaderToOrigin?: bool, - * clientEmail: string, - * privateKey: string, - * accountName: string, - * container: string, - * sasToken: string, - * clientID: string, - * clientSecret: string, - * password: string, - * username: string, - * }|OriginCreateParams $params + * @param string $accessKey access key for the bucket + * @param string $name display name of the origin + * @param string $secretKey secret key for the bucket + * @param string $endpoint custom S3-compatible endpoint + * @param string $baseURL akeneo instance base URL + * @param string $clientID akeneo API client ID + * @param string $clientSecret akeneo API client secret + * @param string $password akeneo API password + * @param string $username akeneo API username + * @param 'AKENEO_PIM' $type + * @param string $baseURLForCanonicalHeader URL used in the Canonical header (if enabled) + * @param bool $includeCanonicalHeader whether to send a Canonical header + * @param bool $s3ForcePathStyle Use path-style S3 URLs? + * @param bool $forwardHostHeaderToOrigin Forward the Host header to origin? * * @throws APIException */ public function create( - array|OriginCreateParams $params, - ?RequestOptions $requestOptions = null + string $accessKey, + string $bucket, + string $name, + string $secretKey, + string $endpoint, + string $baseURL, + string $clientEmail, + string $privateKey, + string $accountName, + string $container, + string $sasToken, + string $clientID, + string $clientSecret, + string $password, + string $username, + string $type = 'AKENEO_PIM', + ?string $baseURLForCanonicalHeader = null, + bool $includeCanonicalHeader = false, + string $prefix = '', + bool $s3ForcePathStyle = false, + bool $forwardHostHeaderToOrigin = false, + ?RequestOptions $requestOptions = null, ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { - [$parsed, $options] = OriginCreateParams::parseRequest( - $params, - $requestOptions, - ); - - /** @var BaseResponse */ - $response = $this->client->request( - method: 'post', - path: 'v1/accounts/origins', - body: (object) $parsed, - options: $options, - convert: OriginResponse::class, - ); + $params = [ + 'accessKey' => $accessKey, + 'bucket' => $bucket, + 'name' => $name, + 'secretKey' => $secretKey, + 'type' => $type, + 'baseURLForCanonicalHeader' => $baseURLForCanonicalHeader, + 'includeCanonicalHeader' => $includeCanonicalHeader, + 'prefix' => $prefix, + 'endpoint' => $endpoint, + 's3ForcePathStyle' => $s3ForcePathStyle, + 'baseURL' => $baseURL, + 'forwardHostHeaderToOrigin' => $forwardHostHeaderToOrigin, + 'clientEmail' => $clientEmail, + 'privateKey' => $privateKey, + 'accountName' => $accountName, + 'container' => $container, + 'sasToken' => $sasToken, + 'clientID' => $clientID, + 'clientSecret' => $clientSecret, + 'password' => $password, + 'username' => $username, + ]; + // @phpstan-ignore-next-line function.impossibleType + $params = array_filter($params, callback: static fn ($v) => !is_null($v)); + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->create(params: $params, requestOptions: $requestOptions); return $response->parse(); } @@ -88,50 +117,77 @@ public function create( * **Note:** This API is currently in beta. * Updates the origin identified by `id` and returns the updated origin object. * - * @param array{ - * accessKey: string, - * bucket: string, - * name: string, - * secretKey: string, - * type?: 'AKENEO_PIM', - * baseURLForCanonicalHeader?: string, - * includeCanonicalHeader?: bool, - * prefix?: string, - * endpoint: string, - * s3ForcePathStyle?: bool, - * baseURL: string, - * forwardHostHeaderToOrigin?: bool, - * clientEmail: string, - * privateKey: string, - * accountName: string, - * container: string, - * sasToken: string, - * clientID: string, - * clientSecret: string, - * password: string, - * username: string, - * }|OriginUpdateParams $params + * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + * @param string $accessKey access key for the bucket + * @param string $name display name of the origin + * @param string $secretKey secret key for the bucket + * @param string $endpoint custom S3-compatible endpoint + * @param string $baseURL akeneo instance base URL + * @param string $clientID akeneo API client ID + * @param string $clientSecret akeneo API client secret + * @param string $password akeneo API password + * @param string $username akeneo API username + * @param 'AKENEO_PIM' $type + * @param string $baseURLForCanonicalHeader URL used in the Canonical header (if enabled) + * @param bool $includeCanonicalHeader whether to send a Canonical header + * @param bool $s3ForcePathStyle Use path-style S3 URLs? + * @param bool $forwardHostHeaderToOrigin Forward the Host header to origin? * * @throws APIException */ public function update( string $id, - array|OriginUpdateParams $params, + string $accessKey, + string $bucket, + string $name, + string $secretKey, + string $endpoint, + string $baseURL, + string $clientEmail, + string $privateKey, + string $accountName, + string $container, + string $sasToken, + string $clientID, + string $clientSecret, + string $password, + string $username, + string $type = 'AKENEO_PIM', + ?string $baseURLForCanonicalHeader = null, + bool $includeCanonicalHeader = false, + string $prefix = '', + bool $s3ForcePathStyle = false, + bool $forwardHostHeaderToOrigin = false, ?RequestOptions $requestOptions = null, ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { - [$parsed, $options] = OriginUpdateParams::parseRequest( - $params, - $requestOptions, - ); - - /** @var BaseResponse */ - $response = $this->client->request( - method: 'put', - path: ['v1/accounts/origins/%1$s', $id], - body: (object) $parsed, - options: $options, - convert: OriginResponse::class, - ); + $params = [ + 'accessKey' => $accessKey, + 'bucket' => $bucket, + 'name' => $name, + 'secretKey' => $secretKey, + 'type' => $type, + 'baseURLForCanonicalHeader' => $baseURLForCanonicalHeader, + 'includeCanonicalHeader' => $includeCanonicalHeader, + 'prefix' => $prefix, + 'endpoint' => $endpoint, + 's3ForcePathStyle' => $s3ForcePathStyle, + 'baseURL' => $baseURL, + 'forwardHostHeaderToOrigin' => $forwardHostHeaderToOrigin, + 'clientEmail' => $clientEmail, + 'privateKey' => $privateKey, + 'accountName' => $accountName, + 'container' => $container, + 'sasToken' => $sasToken, + 'clientID' => $clientID, + 'clientSecret' => $clientSecret, + 'password' => $password, + 'username' => $username, + ]; + // @phpstan-ignore-next-line function.impossibleType + $params = array_filter($params, callback: static fn ($v) => !is_null($v)); + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->update($id, params: $params, requestOptions: $requestOptions); return $response->parse(); } @@ -148,13 +204,8 @@ public function update( */ public function list(?RequestOptions $requestOptions = null): array { - /** @var BaseResponse,> */ - $response = $this->client->request( - method: 'get', - path: 'v1/accounts/origins', - options: $requestOptions, - convert: new ListOf(OriginResponse::class), - ); + // @phpstan-ignore-next-line argument.type + $response = $this->raw->list(requestOptions: $requestOptions); return $response->parse(); } @@ -165,19 +216,16 @@ public function list(?RequestOptions $requestOptions = null): array * **Note:** This API is currently in beta. * Permanently removes the origin identified by `id`. If the origin is in use by any URL‑endpoints, the API will return an error. * + * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + * * @throws APIException */ public function delete( string $id, ?RequestOptions $requestOptions = null ): mixed { - /** @var BaseResponse */ - $response = $this->client->request( - method: 'delete', - path: ['v1/accounts/origins/%1$s', $id], - options: $requestOptions, - convert: null, - ); + // @phpstan-ignore-next-line argument.type + $response = $this->raw->delete($id, requestOptions: $requestOptions); return $response->parse(); } @@ -188,19 +236,16 @@ public function delete( * **Note:** This API is currently in beta. * Retrieves the origin identified by `id`. * + * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + * * @throws APIException */ public function get( string $id, ?RequestOptions $requestOptions = null ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { - /** @var BaseResponse */ - $response = $this->client->request( - method: 'get', - path: ['v1/accounts/origins/%1$s', $id], - options: $requestOptions, - convert: OriginResponse::class, - ); + // @phpstan-ignore-next-line argument.type + $response = $this->raw->get($id, requestOptions: $requestOptions); return $response->parse(); } diff --git a/src/Services/Accounts/URLEndpointsRawService.php b/src/Services/Accounts/URLEndpointsRawService.php new file mode 100644 index 00000000..4db052e2 --- /dev/null +++ b/src/Services/Accounts/URLEndpointsRawService.php @@ -0,0 +1,169 @@ +, + * urlPrefix?: string, + * urlRewriter?: array, + * }|URLEndpointCreateParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function create( + array|URLEndpointCreateParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse { + [$parsed, $options] = URLEndpointCreateParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'post', + path: 'v1/accounts/url-endpoints', + body: (object) $parsed, + options: $options, + convert: URLEndpointResponse::class, + ); + } + + /** + * @api + * + * **Note:** This API is currently in beta. + * Updates the URL‑endpoint identified by `id` and returns the updated object. + * + * @param string $id Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. + * @param array{ + * description: string, + * origins?: list, + * urlPrefix?: string, + * urlRewriter?: array, + * }|URLEndpointUpdateParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function update( + string $id, + array|URLEndpointUpdateParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse { + [$parsed, $options] = URLEndpointUpdateParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'put', + path: ['v1/accounts/url-endpoints/%1$s', $id], + body: (object) $parsed, + options: $options, + convert: URLEndpointResponse::class, + ); + } + + /** + * @api + * + * **Note:** This API is currently in beta. + * Returns an array of all URL‑endpoints configured including the default URL-endpoint generated by ImageKit during account creation. + * + * @return BaseResponse> + * + * @throws APIException + */ + public function list(?RequestOptions $requestOptions = null): BaseResponse + { + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'get', + path: 'v1/accounts/url-endpoints', + options: $requestOptions, + convert: new ListOf(URLEndpointResponse::class), + ); + } + + /** + * @api + * + * **Note:** This API is currently in beta. + * Deletes the URL‑endpoint identified by `id`. You cannot delete the default URL‑endpoint created by ImageKit during account creation. + * + * @param string $id Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. + * + * @return BaseResponse + * + * @throws APIException + */ + public function delete( + string $id, + ?RequestOptions $requestOptions = null + ): BaseResponse { + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'delete', + path: ['v1/accounts/url-endpoints/%1$s', $id], + options: $requestOptions, + convert: null, + ); + } + + /** + * @api + * + * **Note:** This API is currently in beta. + * Retrieves the URL‑endpoint identified by `id`. + * + * @param string $id Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. + * + * @return BaseResponse + * + * @throws APIException + */ + public function get( + string $id, + ?RequestOptions $requestOptions = null + ): BaseResponse { + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'get', + path: ['v1/accounts/url-endpoints/%1$s', $id], + options: $requestOptions, + convert: URLEndpointResponse::class, + ); + } +} diff --git a/src/Services/Accounts/URLEndpointsService.php b/src/Services/Accounts/URLEndpointsService.php index 2296c3db..b32b0a42 100644 --- a/src/Services/Accounts/URLEndpointsService.php +++ b/src/Services/Accounts/URLEndpointsService.php @@ -4,22 +4,26 @@ namespace Imagekit\Services\Accounts; -use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams; use Imagekit\Accounts\URLEndpoints\URLEndpointResponse; -use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams; use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Conversion\ListOf; use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Accounts\URLEndpointsContract; final class URLEndpointsService implements URLEndpointsContract { + /** + * @api + */ + public URLEndpointsRawService $raw; + /** * @internal */ - public function __construct(private Client $client) {} + public function __construct(private Client $client) + { + $this->raw = new URLEndpointsRawService($client); + } /** * @api @@ -27,32 +31,31 @@ public function __construct(private Client $client) {} * **Note:** This API is currently in beta. * Creates a new URL‑endpoint and returns the resulting object. * - * @param array{ - * description: string, - * origins?: list, - * urlPrefix?: string, - * urlRewriter?: array, - * }|URLEndpointCreateParams $params + * @param string $description description of the URL endpoint + * @param list $origins Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. + * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) + * @param array $urlRewriter configuration for third-party URL rewriting * * @throws APIException */ public function create( - array|URLEndpointCreateParams $params, + string $description, + array $origins = [], + string $urlPrefix = '', + ?array $urlRewriter = null, ?RequestOptions $requestOptions = null, ): URLEndpointResponse { - [$parsed, $options] = URLEndpointCreateParams::parseRequest( - $params, - $requestOptions, - ); - - /** @var BaseResponse */ - $response = $this->client->request( - method: 'post', - path: 'v1/accounts/url-endpoints', - body: (object) $parsed, - options: $options, - convert: URLEndpointResponse::class, - ); + $params = [ + 'description' => $description, + 'origins' => $origins, + 'urlPrefix' => $urlPrefix, + 'urlRewriter' => $urlRewriter, + ]; + // @phpstan-ignore-next-line function.impossibleType + $params = array_filter($params, callback: static fn ($v) => !is_null($v)); + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->create(params: $params, requestOptions: $requestOptions); return $response->parse(); } @@ -63,33 +66,33 @@ public function create( * **Note:** This API is currently in beta. * Updates the URL‑endpoint identified by `id` and returns the updated object. * - * @param array{ - * description: string, - * origins?: list, - * urlPrefix?: string, - * urlRewriter?: array, - * }|URLEndpointUpdateParams $params + * @param string $id Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. + * @param string $description description of the URL endpoint + * @param list $origins Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. + * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) + * @param array $urlRewriter configuration for third-party URL rewriting * * @throws APIException */ public function update( string $id, - array|URLEndpointUpdateParams $params, + string $description, + array $origins = [], + string $urlPrefix = '', + ?array $urlRewriter = null, ?RequestOptions $requestOptions = null, ): URLEndpointResponse { - [$parsed, $options] = URLEndpointUpdateParams::parseRequest( - $params, - $requestOptions, - ); - - /** @var BaseResponse */ - $response = $this->client->request( - method: 'put', - path: ['v1/accounts/url-endpoints/%1$s', $id], - body: (object) $parsed, - options: $options, - convert: URLEndpointResponse::class, - ); + $params = [ + 'description' => $description, + 'origins' => $origins, + 'urlPrefix' => $urlPrefix, + 'urlRewriter' => $urlRewriter, + ]; + // @phpstan-ignore-next-line function.impossibleType + $params = array_filter($params, callback: static fn ($v) => !is_null($v)); + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->update($id, params: $params, requestOptions: $requestOptions); return $response->parse(); } @@ -106,13 +109,8 @@ public function update( */ public function list(?RequestOptions $requestOptions = null): array { - /** @var BaseResponse> */ - $response = $this->client->request( - method: 'get', - path: 'v1/accounts/url-endpoints', - options: $requestOptions, - convert: new ListOf(URLEndpointResponse::class), - ); + // @phpstan-ignore-next-line argument.type + $response = $this->raw->list(requestOptions: $requestOptions); return $response->parse(); } @@ -123,19 +121,16 @@ public function list(?RequestOptions $requestOptions = null): array * **Note:** This API is currently in beta. * Deletes the URL‑endpoint identified by `id`. You cannot delete the default URL‑endpoint created by ImageKit during account creation. * + * @param string $id Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. + * * @throws APIException */ public function delete( string $id, ?RequestOptions $requestOptions = null ): mixed { - /** @var BaseResponse */ - $response = $this->client->request( - method: 'delete', - path: ['v1/accounts/url-endpoints/%1$s', $id], - options: $requestOptions, - convert: null, - ); + // @phpstan-ignore-next-line argument.type + $response = $this->raw->delete($id, requestOptions: $requestOptions); return $response->parse(); } @@ -146,19 +141,16 @@ public function delete( * **Note:** This API is currently in beta. * Retrieves the URL‑endpoint identified by `id`. * + * @param string $id Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. + * * @throws APIException */ public function get( string $id, ?RequestOptions $requestOptions = null ): URLEndpointResponse { - /** @var BaseResponse */ - $response = $this->client->request( - method: 'get', - path: ['v1/accounts/url-endpoints/%1$s', $id], - options: $requestOptions, - convert: URLEndpointResponse::class, - ); + // @phpstan-ignore-next-line argument.type + $response = $this->raw->get($id, requestOptions: $requestOptions); return $response->parse(); } diff --git a/src/Services/Accounts/UsageRawService.php b/src/Services/Accounts/UsageRawService.php new file mode 100644 index 00000000..6ba02ce3 --- /dev/null +++ b/src/Services/Accounts/UsageRawService.php @@ -0,0 +1,54 @@ + + * + * @throws APIException + */ + public function get( + array|UsageGetParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse { + [$parsed, $options] = UsageGetParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'get', + path: 'v1/accounts/usage', + query: $parsed, + options: $options, + convert: UsageGetResponse::class, + ); + } +} diff --git a/src/Services/Accounts/UsageService.php b/src/Services/Accounts/UsageService.php index 2f6143e2..2ec15090 100644 --- a/src/Services/Accounts/UsageService.php +++ b/src/Services/Accounts/UsageService.php @@ -4,49 +4,46 @@ namespace Imagekit\Services\Accounts; -use Imagekit\Accounts\Usage\UsageGetParams; use Imagekit\Accounts\Usage\UsageGetResponse; use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Accounts\UsageContract; final class UsageService implements UsageContract { + /** + * @api + */ + public UsageRawService $raw; + /** * @internal */ - public function __construct(private Client $client) {} + public function __construct(private Client $client) + { + $this->raw = new UsageRawService($client); + } /** * @api * * Get the account usage information between two dates. Note that the API response includes data from the start date while excluding data from the end date. In other words, the data covers the period starting from the specified start date up to, but not including, the end date. * - * @param array{ - * endDate: string|\DateTimeInterface, startDate: string|\DateTimeInterface - * }|UsageGetParams $params + * @param string|\DateTimeInterface $endDate Specify a `endDate` in `YYYY-MM-DD` format. It should be after the `startDate`. The difference between `startDate` and `endDate` should be less than 90 days. + * @param string|\DateTimeInterface $startDate Specify a `startDate` in `YYYY-MM-DD` format. It should be before the `endDate`. The difference between `startDate` and `endDate` should be less than 90 days. * * @throws APIException */ public function get( - array|UsageGetParams $params, - ?RequestOptions $requestOptions = null + string|\DateTimeInterface $endDate, + string|\DateTimeInterface $startDate, + ?RequestOptions $requestOptions = null, ): UsageGetResponse { - [$parsed, $options] = UsageGetParams::parseRequest( - $params, - $requestOptions, - ); - - /** @var BaseResponse */ - $response = $this->client->request( - method: 'get', - path: 'v1/accounts/usage', - query: $parsed, - options: $options, - convert: UsageGetResponse::class, - ); + $params = ['endDate' => $endDate, 'startDate' => $startDate]; + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->get(params: $params, requestOptions: $requestOptions); return $response->parse(); } diff --git a/src/Services/AccountsRawService.php b/src/Services/AccountsRawService.php new file mode 100644 index 00000000..199cf855 --- /dev/null +++ b/src/Services/AccountsRawService.php @@ -0,0 +1,17 @@ +raw = new AccountsRawService($client); $this->usage = new UsageService($client); $this->origins = new OriginsService($client); $this->urlEndpoints = new URLEndpointsService($client); diff --git a/src/Services/AssetsRawService.php b/src/Services/AssetsRawService.php new file mode 100644 index 00000000..98e88d7a --- /dev/null +++ b/src/Services/AssetsRawService.php @@ -0,0 +1,66 @@ +, + * type?: 'file'|'file-version'|'folder'|'all'|Type, + * }|AssetListParams $params + * + * @return BaseResponse> + * + * @throws APIException + */ + public function list( + array|AssetListParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse { + [$parsed, $options] = AssetListParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'get', + path: 'v1/files', + query: $parsed, + options: $options, + convert: new ListOf(AssetListResponseItem::class), + ); + } +} diff --git a/src/Services/AssetsService.php b/src/Services/AssetsService.php index 817670c4..206cf4aa 100644 --- a/src/Services/AssetsService.php +++ b/src/Services/AssetsService.php @@ -4,14 +4,10 @@ namespace Imagekit\Services; -use Imagekit\Assets\AssetListParams; use Imagekit\Assets\AssetListParams\FileType; use Imagekit\Assets\AssetListParams\Sort; use Imagekit\Assets\AssetListParams\Type; -use Imagekit\Assets\AssetListResponseItem; use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Conversion\ListOf; use Imagekit\Core\Exceptions\APIException; use Imagekit\Files\File; use Imagekit\Files\Folder; @@ -20,47 +16,80 @@ final class AssetsService implements AssetsContract { + /** + * @api + */ + public AssetsRawService $raw; + /** * @internal */ - public function __construct(private Client $client) {} + public function __construct(private Client $client) + { + $this->raw = new AssetsRawService($client); + } /** * @api * * This API can list all the uploaded files and folders in your ImageKit.io media library. In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and provide this generated string as the value of the `searchQuery`. * - * @param array{ - * fileType?: 'all'|'image'|'non-image'|FileType, - * limit?: int, - * path?: string, - * searchQuery?: string, - * skip?: int, - * sort?: value-of, - * type?: 'file'|'file-version'|'folder'|'all'|Type, - * }|AssetListParams $params + * @param 'all'|'image'|'non-image'|FileType $fileType Filter results by file type. + * + * - `all` — include all file types + * - `image` — include only image files + * - `non-image` — include only non-image files (e.g., JS, CSS, video) + * @param int $limit the maximum number of results to return in response + * @param string $path Folder path if you want to limit the search within a specific folder. For example, `/sales-banner/` will only search in folder sales-banner. + * + * Note : If your use case involves searching within a folder as well as its subfolders, you can use `path` parameter in `searchQuery` with appropriate operator. + * Checkout [Supported parameters](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#supported-parameters) for more information. + * @param string $searchQuery Query string in a Lucene-like query language e.g. `createdAt > "7d"`. + * + * Note : When the searchQuery parameter is present, the following query parameters will have no effect on the result: + * + * 1. `tags` + * 2. `type` + * 3. `name` + * + * [Learn more](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#advanced-search-queries) from examples. + * @param int $skip the number of results to skip before returning results + * @param 'ASC_NAME'|'DESC_NAME'|'ASC_CREATED'|'DESC_CREATED'|'ASC_UPDATED'|'DESC_UPDATED'|'ASC_HEIGHT'|'DESC_HEIGHT'|'ASC_WIDTH'|'DESC_WIDTH'|'ASC_SIZE'|'DESC_SIZE'|'ASC_RELEVANCE'|'DESC_RELEVANCE'|Sort $sort sort the results by one of the supported fields in ascending or descending order + * @param 'file'|'file-version'|'folder'|'all'|Type $type Filter results by asset type. + * + * - `file` — returns only files + * - `file-version` — returns specific file versions + * - `folder` — returns only folders + * - `all` — returns both files and folders (excludes `file-version`) * * @return list * * @throws APIException */ public function list( - array|AssetListParams $params, - ?RequestOptions $requestOptions = null + string|FileType $fileType = 'all', + int $limit = 1000, + ?string $path = null, + ?string $searchQuery = null, + int $skip = 0, + string|Sort $sort = 'ASC_CREATED', + string|Type $type = 'file', + ?RequestOptions $requestOptions = null, ): array { - [$parsed, $options] = AssetListParams::parseRequest( - $params, - $requestOptions, - ); + $params = [ + 'fileType' => $fileType, + 'limit' => $limit, + 'path' => $path, + 'searchQuery' => $searchQuery, + 'skip' => $skip, + 'sort' => $sort, + 'type' => $type, + ]; + // @phpstan-ignore-next-line function.impossibleType + $params = array_filter($params, callback: static fn ($v) => !is_null($v)); - /** @var BaseResponse> */ - $response = $this->client->request( - method: 'get', - path: 'v1/files', - query: $parsed, - options: $options, - convert: new ListOf(AssetListResponseItem::class), - ); + // @phpstan-ignore-next-line argument.type + $response = $this->raw->list(params: $params, requestOptions: $requestOptions); return $response->parse(); } diff --git a/src/Services/Beta/V2/FilesRawService.php b/src/Services/Beta/V2/FilesRawService.php new file mode 100644 index 00000000..17b7fc92 --- /dev/null +++ b/src/Services/Beta/V2/FilesRawService.php @@ -0,0 +1,91 @@ +, + * description?: string, + * extensions?: list>, + * folder?: string, + * isPrivateFile?: bool, + * isPublished?: bool, + * overwriteAITags?: bool, + * overwriteCustomMetadata?: bool, + * overwriteFile?: bool, + * overwriteTags?: bool, + * responseFields?: list<'tags'|'customCoordinates'|'isPrivateFile'|'embeddedMetadata'|'isPublished'|'customMetadata'|'metadata'|'selectedFieldsSchema'|ResponseField>, + * tags?: list, + * transformation?: array{post?: list>, pre?: string}, + * useUniqueFileName?: bool, + * webhookURL?: string, + * }|FileUploadParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function upload( + array|FileUploadParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse { + [$parsed, $options] = FileUploadParams::parseRequest( + $params, + $requestOptions, + ); + $path = $this + ->client + ->baseUrlOverridden ? 'api/v2/files/upload' : 'https://upload.imagekit.io/api/v2/files/upload'; + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'post', + path: $path, + headers: ['Content-Type' => 'multipart/form-data'], + body: (object) $parsed, + options: $options, + convert: FileUploadResponse::class, + ); + } +} diff --git a/src/Services/Beta/V2/FilesService.php b/src/Services/Beta/V2/FilesService.php index 74335188..9831f512 100644 --- a/src/Services/Beta/V2/FilesService.php +++ b/src/Services/Beta/V2/FilesService.php @@ -4,21 +4,27 @@ namespace Imagekit\Services\Beta\V2; -use Imagekit\Beta\V2\Files\FileUploadParams; use Imagekit\Beta\V2\Files\FileUploadParams\ResponseField; use Imagekit\Beta\V2\Files\FileUploadResponse; use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Beta\V2\FilesContract; final class FilesService implements FilesContract { + /** + * @api + */ + public FilesRawService $raw; + /** * @internal */ - public function __construct(private Client $client) {} + public function __construct(private Client $client) + { + $this->raw = new FilesRawService($client); + } /** * @api @@ -38,52 +44,112 @@ public function __construct(private Client $client) {} * - A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more. * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. * + * @param string $file The API accepts any of the following: + * + * - **Binary data** – send the raw bytes as `multipart/form-data`. + * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. + * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. + * + * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + * @param string $fileName the name with which the file has to be uploaded + * @param string $token This is the client-generated JSON Web Token (JWT). The ImageKit.io server uses it to authenticate and check that the upload request parameters have not been tampered with after the token has been generated. Learn how to create the token on the page below. This field is only required for authentication when uploading a file from the client side. + * @param string $checks Server-side checks to run on the asset. + * Read more about [Upload API checks](/docs/api-reference/upload-file/upload-file-v2#upload-api-checks). + * @param string $customCoordinates Define an important area in the image. This is only relevant for image type files. + * + * - To be passed as a string with the x and y coordinates of the top-left corner, and width and height of the area of interest in the format `x,y,width,height`. For example - `10,10,100,100` + * - Can be used with fo-customtransformation. + * - If this field is not specified and the file is overwritten, then customCoordinates will be removed. + * @param array $customMetadata JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. + * @param string $description optional text to describe the contents of the file + * @param list> $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. + * @param string $folder The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. Using multiple `/` creates a nested folder. + * @param bool $isPrivateFile Whether to mark the file as private or not. + * + * If `true`, the file is marked as private and is accessible only using named transformation or signed URL. + * @param bool $isPublished Whether to upload file as published or not. + * + * If `false`, the file is marked as unpublished, which restricts access to the file only via the media library. Files in draft or unpublished state can only be publicly accessed after being published. + * + * The option to upload in draft state is only available in custom enterprise pricing plans. + * @param bool $overwriteAITags If set to `true` and a file already exists at the exact location, its AITags will be removed. Set `overwriteAITags` to `false` to preserve AITags. + * @param bool $overwriteCustomMetadata if the request does not have `customMetadata`, and a file already exists at the exact location, existing customMetadata will be removed + * @param bool $overwriteFile if `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately + * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed + * @param list<'tags'|'customCoordinates'|'isPrivateFile'|'embeddedMetadata'|'isPublished'|'customMetadata'|'metadata'|'selectedFieldsSchema'|ResponseField> $responseFields array of response field keys to include in the API response body + * @param list $tags Set the tags while uploading the file. + * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. + * If this field is not specified and the file is overwritten, the existing tags will be removed. * @param array{ - * file: string, - * fileName: string, - * token?: string, - * checks?: string, - * customCoordinates?: string, - * customMetadata?: array, - * description?: string, - * extensions?: list>, - * folder?: string, - * isPrivateFile?: bool, - * isPublished?: bool, - * overwriteAITags?: bool, - * overwriteCustomMetadata?: bool, - * overwriteFile?: bool, - * overwriteTags?: bool, - * responseFields?: list<'tags'|'customCoordinates'|'isPrivateFile'|'embeddedMetadata'|'isPublished'|'customMetadata'|'metadata'|'selectedFieldsSchema'|ResponseField>, - * tags?: list, - * transformation?: array{post?: list>, pre?: string}, - * useUniqueFileName?: bool, - * webhookURL?: string, - * }|FileUploadParams $params + * post?: list>, pre?: string + * } $transformation Configure pre-processing (`pre`) and post-processing (`post`) transformations. + * + * - `pre` — applied before the file is uploaded to the Media Library. + * Useful for reducing file size or applying basic optimizations upfront (e.g., resize, compress). + * + * - `post` — applied immediately after upload. + * Ideal for generating transformed versions (like video encodes or thumbnails) in advance, so they're ready for delivery without delay. + * + * You can mix and match any combination of post-processing types. + * @param bool $useUniqueFileName Whether to use a unique filename for this file or not. + * + * If `true`, ImageKit.io will add a unique suffix to the filename parameter to get a unique filename. + * + * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. + * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. * * @throws APIException */ public function upload( - array|FileUploadParams $params, - ?RequestOptions $requestOptions = null + string $file, + string $fileName, + ?string $token = null, + ?string $checks = null, + ?string $customCoordinates = null, + ?array $customMetadata = null, + ?string $description = null, + ?array $extensions = null, + string $folder = '/', + bool $isPrivateFile = false, + bool $isPublished = true, + bool $overwriteAITags = true, + bool $overwriteCustomMetadata = true, + bool $overwriteFile = true, + bool $overwriteTags = true, + ?array $responseFields = null, + ?array $tags = null, + ?array $transformation = null, + bool $useUniqueFileName = true, + ?string $webhookURL = null, + ?RequestOptions $requestOptions = null, ): FileUploadResponse { - [$parsed, $options] = FileUploadParams::parseRequest( - $params, - $requestOptions, - ); - $path = $this - ->client - ->baseUrlOverridden ? 'api/v2/files/upload' : 'https://upload.imagekit.io/api/v2/files/upload'; + $params = [ + 'file' => $file, + 'fileName' => $fileName, + 'token' => $token, + 'checks' => $checks, + 'customCoordinates' => $customCoordinates, + 'customMetadata' => $customMetadata, + 'description' => $description, + 'extensions' => $extensions, + 'folder' => $folder, + 'isPrivateFile' => $isPrivateFile, + 'isPublished' => $isPublished, + 'overwriteAITags' => $overwriteAITags, + 'overwriteCustomMetadata' => $overwriteCustomMetadata, + 'overwriteFile' => $overwriteFile, + 'overwriteTags' => $overwriteTags, + 'responseFields' => $responseFields, + 'tags' => $tags, + 'transformation' => $transformation, + 'useUniqueFileName' => $useUniqueFileName, + 'webhookURL' => $webhookURL, + ]; + // @phpstan-ignore-next-line function.impossibleType + $params = array_filter($params, callback: static fn ($v) => !is_null($v)); - /** @var BaseResponse */ - $response = $this->client->request( - method: 'post', - path: $path, - headers: ['Content-Type' => 'multipart/form-data'], - body: (object) $parsed, - options: $options, - convert: FileUploadResponse::class, - ); + // @phpstan-ignore-next-line argument.type + $response = $this->raw->upload(params: $params, requestOptions: $requestOptions); return $response->parse(); } diff --git a/src/Services/Beta/V2RawService.php b/src/Services/Beta/V2RawService.php new file mode 100644 index 00000000..7c1b018e --- /dev/null +++ b/src/Services/Beta/V2RawService.php @@ -0,0 +1,17 @@ +raw = new V2RawService($client); $this->files = new FilesService($client); } } diff --git a/src/Services/BetaRawService.php b/src/Services/BetaRawService.php new file mode 100644 index 00000000..1be324fd --- /dev/null +++ b/src/Services/BetaRawService.php @@ -0,0 +1,17 @@ +raw = new BetaRawService($client); $this->v2 = new V2Service($client); } } diff --git a/src/Services/Cache/InvalidationRawService.php b/src/Services/Cache/InvalidationRawService.php new file mode 100644 index 00000000..4fe31ebd --- /dev/null +++ b/src/Services/Cache/InvalidationRawService.php @@ -0,0 +1,77 @@ + + * + * @throws APIException + */ + public function create( + array|InvalidationCreateParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse { + [$parsed, $options] = InvalidationCreateParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'post', + path: 'v1/files/purge', + body: (object) $parsed, + options: $options, + convert: InvalidationNewResponse::class, + ); + } + + /** + * @api + * + * This API returns the status of a purge cache request. + * + * @param string $requestID should be a valid requestId + * + * @return BaseResponse + * + * @throws APIException + */ + public function get( + string $requestID, + ?RequestOptions $requestOptions = null + ): BaseResponse { + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'get', + path: ['v1/files/purge/%1$s', $requestID], + options: $requestOptions, + convert: InvalidationGetResponse::class, + ); + } +} diff --git a/src/Services/Cache/InvalidationService.php b/src/Services/Cache/InvalidationService.php index d0c7b780..8fff5014 100644 --- a/src/Services/Cache/InvalidationService.php +++ b/src/Services/Cache/InvalidationService.php @@ -4,48 +4,45 @@ namespace Imagekit\Services\Cache; -use Imagekit\Cache\Invalidation\InvalidationCreateParams; use Imagekit\Cache\Invalidation\InvalidationGetResponse; use Imagekit\Cache\Invalidation\InvalidationNewResponse; use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Cache\InvalidationContract; final class InvalidationService implements InvalidationContract { + /** + * @api + */ + public InvalidationRawService $raw; + /** * @internal */ - public function __construct(private Client $client) {} + public function __construct(private Client $client) + { + $this->raw = new InvalidationRawService($client); + } /** * @api * * This API will purge CDN cache and ImageKit.io's internal cache for a file. Note: Purge cache is an asynchronous process and it may take some time to reflect the changes. * - * @param array{url: string}|InvalidationCreateParams $params + * @param string $url the full URL of the file to be purged * * @throws APIException */ public function create( - array|InvalidationCreateParams $params, - ?RequestOptions $requestOptions = null, + string $url, + ?RequestOptions $requestOptions = null ): InvalidationNewResponse { - [$parsed, $options] = InvalidationCreateParams::parseRequest( - $params, - $requestOptions, - ); + $params = ['url' => $url]; - /** @var BaseResponse */ - $response = $this->client->request( - method: 'post', - path: 'v1/files/purge', - body: (object) $parsed, - options: $options, - convert: InvalidationNewResponse::class, - ); + // @phpstan-ignore-next-line argument.type + $response = $this->raw->create(params: $params, requestOptions: $requestOptions); return $response->parse(); } @@ -55,19 +52,16 @@ public function create( * * This API returns the status of a purge cache request. * + * @param string $requestID should be a valid requestId + * * @throws APIException */ public function get( string $requestID, ?RequestOptions $requestOptions = null ): InvalidationGetResponse { - /** @var BaseResponse */ - $response = $this->client->request( - method: 'get', - path: ['v1/files/purge/%1$s', $requestID], - options: $requestOptions, - convert: InvalidationGetResponse::class, - ); + // @phpstan-ignore-next-line argument.type + $response = $this->raw->get($requestID, requestOptions: $requestOptions); return $response->parse(); } diff --git a/src/Services/CacheRawService.php b/src/Services/CacheRawService.php new file mode 100644 index 00000000..a435dd7c --- /dev/null +++ b/src/Services/CacheRawService.php @@ -0,0 +1,17 @@ +raw = new CacheRawService($client); $this->invalidation = new InvalidationService($client); } } diff --git a/src/Services/CustomMetadataFieldsRawService.php b/src/Services/CustomMetadataFieldsRawService.php new file mode 100644 index 00000000..5650c84b --- /dev/null +++ b/src/Services/CustomMetadataFieldsRawService.php @@ -0,0 +1,171 @@ +, + * }, + * }|CustomMetadataFieldCreateParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function create( + array|CustomMetadataFieldCreateParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse { + [$parsed, $options] = CustomMetadataFieldCreateParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'post', + path: 'v1/customMetadataFields', + body: (object) $parsed, + options: $options, + convert: CustomMetadataField::class, + ); + } + + /** + * @api + * + * This API updates the label or schema of an existing custom metadata field. + * + * @param string $id should be a valid custom metadata field id + * @param array{ + * label?: string, + * schema?: array{ + * defaultValue?: mixed, + * isValueRequired?: bool, + * maxLength?: float, + * maxValue?: string|float, + * minLength?: float, + * minValue?: string|float, + * selectOptions?: list, + * }, + * }|CustomMetadataFieldUpdateParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function update( + string $id, + array|CustomMetadataFieldUpdateParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse { + [$parsed, $options] = CustomMetadataFieldUpdateParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'patch', + path: ['v1/customMetadataFields/%1$s', $id], + body: (object) $parsed, + options: $options, + convert: CustomMetadataField::class, + ); + } + + /** + * @api + * + * This API returns the array of created custom metadata field objects. By default the API returns only non deleted field objects, but you can include deleted fields in the API response. + * + * You can also filter results by a specific folder path to retrieve custom metadata fields applicable at that location. This path-specific filtering is useful when using the **Path policy** feature to determine which custom metadata fields are selected for a given path. + * + * @param array{ + * folderPath?: string, includeDeleted?: bool + * }|CustomMetadataFieldListParams $params + * + * @return BaseResponse> + * + * @throws APIException + */ + public function list( + array|CustomMetadataFieldListParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse { + [$parsed, $options] = CustomMetadataFieldListParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'get', + path: 'v1/customMetadataFields', + query: $parsed, + options: $options, + convert: new ListOf(CustomMetadataField::class), + ); + } + + /** + * @api + * + * This API deletes a custom metadata field. Even after deleting a custom metadata field, you cannot create any new custom metadata field with the same name. + * + * @param string $id should be a valid custom metadata field id + * + * @return BaseResponse + * + * @throws APIException + */ + public function delete( + string $id, + ?RequestOptions $requestOptions = null + ): BaseResponse { + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'delete', + path: ['v1/customMetadataFields/%1$s', $id], + options: $requestOptions, + convert: CustomMetadataFieldDeleteResponse::class, + ); + } +} diff --git a/src/Services/CustomMetadataFieldsService.php b/src/Services/CustomMetadataFieldsService.php index 610f84f1..9da410b9 100644 --- a/src/Services/CustomMetadataFieldsService.php +++ b/src/Services/CustomMetadataFieldsService.php @@ -5,64 +5,58 @@ namespace Imagekit\Services; use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Conversion\ListOf; use Imagekit\Core\Exceptions\APIException; use Imagekit\CustomMetadataFields\CustomMetadataField; -use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams; use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\Type; use Imagekit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; -use Imagekit\CustomMetadataFields\CustomMetadataFieldListParams; -use Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\CustomMetadataFieldsContract; final class CustomMetadataFieldsService implements CustomMetadataFieldsContract { + /** + * @api + */ + public CustomMetadataFieldsRawService $raw; + /** * @internal */ - public function __construct(private Client $client) {} + public function __construct(private Client $client) + { + $this->raw = new CustomMetadataFieldsRawService($client); + } /** * @api * * This API creates a new custom metadata field. Once a custom metadata field is created either through this API or using the dashboard UI, its value can be set on the assets. The value of a field for an asset can be set using the media library UI or programmatically through upload or update assets API. * + * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. + * @param string $name API name of the custom metadata field. This should be unique across all (including deleted) custom metadata fields. * @param array{ - * label: string, - * name: string, - * schema: array{ - * type: 'Text'|'Textarea'|'Number'|'Date'|'Boolean'|'SingleSelect'|'MultiSelect'|Type, - * defaultValue?: mixed, - * isValueRequired?: bool, - * maxLength?: float, - * maxValue?: string|float, - * minLength?: float, - * minValue?: string|float, - * selectOptions?: list, - * }, - * }|CustomMetadataFieldCreateParams $params + * type: 'Text'|'Textarea'|'Number'|'Date'|'Boolean'|'SingleSelect'|'MultiSelect'|Type, + * defaultValue?: mixed, + * isValueRequired?: bool, + * maxLength?: float, + * maxValue?: string|float, + * minLength?: float, + * minValue?: string|float, + * selectOptions?: list, + * } $schema * * @throws APIException */ public function create( - array|CustomMetadataFieldCreateParams $params, + string $label, + string $name, + array $schema, ?RequestOptions $requestOptions = null, ): CustomMetadataField { - [$parsed, $options] = CustomMetadataFieldCreateParams::parseRequest( - $params, - $requestOptions, - ); - - /** @var BaseResponse */ - $response = $this->client->request( - method: 'post', - path: 'v1/customMetadataFields', - body: (object) $parsed, - options: $options, - convert: CustomMetadataField::class, - ); + $params = ['label' => $label, 'name' => $name, 'schema' => $schema]; + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->create(params: $params, requestOptions: $requestOptions); return $response->parse(); } @@ -72,39 +66,32 @@ public function create( * * This API updates the label or schema of an existing custom metadata field. * + * @param string $id should be a valid custom metadata field id + * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. This parameter is required if `schema` is not provided. * @param array{ - * label?: string, - * schema?: array{ - * defaultValue?: mixed, - * isValueRequired?: bool, - * maxLength?: float, - * maxValue?: string|float, - * minLength?: float, - * minValue?: string|float, - * selectOptions?: list, - * }, - * }|CustomMetadataFieldUpdateParams $params + * defaultValue?: mixed, + * isValueRequired?: bool, + * maxLength?: float, + * maxValue?: string|float, + * minLength?: float, + * minValue?: string|float, + * selectOptions?: list, + * } $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. * * @throws APIException */ public function update( string $id, - array|CustomMetadataFieldUpdateParams $params, + ?string $label = null, + ?array $schema = null, ?RequestOptions $requestOptions = null, ): CustomMetadataField { - [$parsed, $options] = CustomMetadataFieldUpdateParams::parseRequest( - $params, - $requestOptions, - ); - - /** @var BaseResponse */ - $response = $this->client->request( - method: 'patch', - path: ['v1/customMetadataFields/%1$s', $id], - body: (object) $parsed, - options: $options, - convert: CustomMetadataField::class, - ); + $params = ['label' => $label, 'schema' => $schema]; + // @phpstan-ignore-next-line function.impossibleType + $params = array_filter($params, callback: static fn ($v) => !is_null($v)); + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->update($id, params: $params, requestOptions: $requestOptions); return $response->parse(); } @@ -116,31 +103,26 @@ public function update( * * You can also filter results by a specific folder path to retrieve custom metadata fields applicable at that location. This path-specific filtering is useful when using the **Path policy** feature to determine which custom metadata fields are selected for a given path. * - * @param array{ - * folderPath?: string, includeDeleted?: bool - * }|CustomMetadataFieldListParams $params + * @param string $folderPath The folder path (e.g., `/path/to/folder`) for which to retrieve applicable custom metadata fields. Useful for determining path-specific field selections when the [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in use. + * @param bool $includeDeleted set it to `true` to include deleted field objects in the API response * * @return list * * @throws APIException */ public function list( - array|CustomMetadataFieldListParams $params, + ?string $folderPath = null, + bool $includeDeleted = false, ?RequestOptions $requestOptions = null, ): array { - [$parsed, $options] = CustomMetadataFieldListParams::parseRequest( - $params, - $requestOptions, - ); - - /** @var BaseResponse> */ - $response = $this->client->request( - method: 'get', - path: 'v1/customMetadataFields', - query: $parsed, - options: $options, - convert: new ListOf(CustomMetadataField::class), - ); + $params = [ + 'folderPath' => $folderPath, 'includeDeleted' => $includeDeleted, + ]; + // @phpstan-ignore-next-line function.impossibleType + $params = array_filter($params, callback: static fn ($v) => !is_null($v)); + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->list(params: $params, requestOptions: $requestOptions); return $response->parse(); } @@ -150,19 +132,16 @@ public function list( * * This API deletes a custom metadata field. Even after deleting a custom metadata field, you cannot create any new custom metadata field with the same name. * + * @param string $id should be a valid custom metadata field id + * * @throws APIException */ public function delete( string $id, ?RequestOptions $requestOptions = null ): CustomMetadataFieldDeleteResponse { - /** @var BaseResponse */ - $response = $this->client->request( - method: 'delete', - path: ['v1/customMetadataFields/%1$s', $id], - options: $requestOptions, - convert: CustomMetadataFieldDeleteResponse::class, - ); + // @phpstan-ignore-next-line argument.type + $response = $this->raw->delete($id, requestOptions: $requestOptions); return $response->parse(); } diff --git a/src/Services/Files/BulkRawService.php b/src/Services/Files/BulkRawService.php new file mode 100644 index 00000000..a9aa5c0b --- /dev/null +++ b/src/Services/Files/BulkRawService.php @@ -0,0 +1,158 @@ +}|BulkDeleteParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function delete( + array|BulkDeleteParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse { + [$parsed, $options] = BulkDeleteParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'post', + path: 'v1/files/batch/deleteByFileIds', + body: (object) $parsed, + options: $options, + convert: BulkDeleteResponse::class, + ); + } + + /** + * @api + * + * This API adds tags to multiple files in bulk. A maximum of 50 files can be specified at a time. + * + * @param array{ + * fileIDs: list, tags: list + * }|BulkAddTagsParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function addTags( + array|BulkAddTagsParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse { + [$parsed, $options] = BulkAddTagsParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'post', + path: 'v1/files/addTags', + body: (object) $parsed, + options: $options, + convert: BulkAddTagsResponse::class, + ); + } + + /** + * @api + * + * This API removes AITags from multiple files in bulk. A maximum of 50 files can be specified at a time. + * + * @param array{ + * aiTags: list, fileIDs: list + * }|BulkRemoveAITagsParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function removeAITags( + array|BulkRemoveAITagsParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse { + [$parsed, $options] = BulkRemoveAITagsParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'post', + path: 'v1/files/removeAITags', + body: (object) $parsed, + options: $options, + convert: BulkRemoveAITagsResponse::class, + ); + } + + /** + * @api + * + * This API removes tags from multiple files in bulk. A maximum of 50 files can be specified at a time. + * + * @param array{ + * fileIDs: list, tags: list + * }|BulkRemoveTagsParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function removeTags( + array|BulkRemoveTagsParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse { + [$parsed, $options] = BulkRemoveTagsParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'post', + path: 'v1/files/removeTags', + body: (object) $parsed, + options: $options, + convert: BulkRemoveTagsResponse::class, + ); + } +} diff --git a/src/Services/Files/BulkService.php b/src/Services/Files/BulkService.php index 61833f1f..54452052 100644 --- a/src/Services/Files/BulkService.php +++ b/src/Services/Files/BulkService.php @@ -5,25 +5,28 @@ namespace Imagekit\Services\Files; use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Exceptions\APIException; -use Imagekit\Files\Bulk\BulkAddTagsParams; use Imagekit\Files\Bulk\BulkAddTagsResponse; -use Imagekit\Files\Bulk\BulkDeleteParams; use Imagekit\Files\Bulk\BulkDeleteResponse; -use Imagekit\Files\Bulk\BulkRemoveAITagsParams; use Imagekit\Files\Bulk\BulkRemoveAITagsResponse; -use Imagekit\Files\Bulk\BulkRemoveTagsParams; use Imagekit\Files\Bulk\BulkRemoveTagsResponse; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Files\BulkContract; final class BulkService implements BulkContract { + /** + * @api + */ + public BulkRawService $raw; + /** * @internal */ - public function __construct(private Client $client) {} + public function __construct(private Client $client) + { + $this->raw = new BulkRawService($client); + } /** * @api @@ -34,27 +37,18 @@ public function __construct(private Client $client) {} * * A maximum of 100 files can be deleted at a time. * - * @param array{fileIDs: list}|BulkDeleteParams $params + * @param list $fileIDs an array of fileIds which you want to delete * * @throws APIException */ public function delete( - array|BulkDeleteParams $params, + array $fileIDs, ?RequestOptions $requestOptions = null ): BulkDeleteResponse { - [$parsed, $options] = BulkDeleteParams::parseRequest( - $params, - $requestOptions, - ); - - /** @var BaseResponse */ - $response = $this->client->request( - method: 'post', - path: 'v1/files/batch/deleteByFileIds', - body: (object) $parsed, - options: $options, - convert: BulkDeleteResponse::class, - ); + $params = ['fileIDs' => $fileIDs]; + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->delete(params: $params, requestOptions: $requestOptions); return $response->parse(); } @@ -64,29 +58,20 @@ public function delete( * * This API adds tags to multiple files in bulk. A maximum of 50 files can be specified at a time. * - * @param array{ - * fileIDs: list, tags: list - * }|BulkAddTagsParams $params + * @param list $fileIDs an array of fileIds to which you want to add tags + * @param list $tags an array of tags that you want to add to the files * * @throws APIException */ public function addTags( - array|BulkAddTagsParams $params, + array $fileIDs, + array $tags, ?RequestOptions $requestOptions = null ): BulkAddTagsResponse { - [$parsed, $options] = BulkAddTagsParams::parseRequest( - $params, - $requestOptions, - ); - - /** @var BaseResponse */ - $response = $this->client->request( - method: 'post', - path: 'v1/files/addTags', - body: (object) $parsed, - options: $options, - convert: BulkAddTagsResponse::class, - ); + $params = ['fileIDs' => $fileIDs, 'tags' => $tags]; + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->addTags(params: $params, requestOptions: $requestOptions); return $response->parse(); } @@ -96,29 +81,20 @@ public function addTags( * * This API removes AITags from multiple files in bulk. A maximum of 50 files can be specified at a time. * - * @param array{ - * aiTags: list, fileIDs: list - * }|BulkRemoveAITagsParams $params + * @param list $aiTags an array of AITags that you want to remove from the files + * @param list $fileIDs an array of fileIds from which you want to remove AITags * * @throws APIException */ public function removeAITags( - array|BulkRemoveAITagsParams $params, + array $aiTags, + array $fileIDs, ?RequestOptions $requestOptions = null ): BulkRemoveAITagsResponse { - [$parsed, $options] = BulkRemoveAITagsParams::parseRequest( - $params, - $requestOptions, - ); - - /** @var BaseResponse */ - $response = $this->client->request( - method: 'post', - path: 'v1/files/removeAITags', - body: (object) $parsed, - options: $options, - convert: BulkRemoveAITagsResponse::class, - ); + $params = ['aiTags' => $aiTags, 'fileIDs' => $fileIDs]; + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->removeAITags(params: $params, requestOptions: $requestOptions); return $response->parse(); } @@ -128,29 +104,20 @@ public function removeAITags( * * This API removes tags from multiple files in bulk. A maximum of 50 files can be specified at a time. * - * @param array{ - * fileIDs: list, tags: list - * }|BulkRemoveTagsParams $params + * @param list $fileIDs an array of fileIds from which you want to remove tags + * @param list $tags an array of tags that you want to remove from the files * * @throws APIException */ public function removeTags( - array|BulkRemoveTagsParams $params, + array $fileIDs, + array $tags, ?RequestOptions $requestOptions = null ): BulkRemoveTagsResponse { - [$parsed, $options] = BulkRemoveTagsParams::parseRequest( - $params, - $requestOptions, - ); - - /** @var BaseResponse */ - $response = $this->client->request( - method: 'post', - path: 'v1/files/removeTags', - body: (object) $parsed, - options: $options, - convert: BulkRemoveTagsResponse::class, - ); + $params = ['fileIDs' => $fileIDs, 'tags' => $tags]; + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->removeTags(params: $params, requestOptions: $requestOptions); return $response->parse(); } diff --git a/src/Services/Files/MetadataRawService.php b/src/Services/Files/MetadataRawService.php new file mode 100644 index 00000000..2c17c681 --- /dev/null +++ b/src/Services/Files/MetadataRawService.php @@ -0,0 +1,78 @@ + + * + * @throws APIException + */ + public function get( + string $fileID, + ?RequestOptions $requestOptions = null + ): BaseResponse { + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'get', + path: ['v1/files/%1$s/metadata', $fileID], + options: $requestOptions, + convert: Metadata::class, + ); + } + + /** + * @api + * + * Get image EXIF, pHash, and other metadata from ImageKit.io powered remote URL using this API. + * + * @param array{url: string}|MetadataGetFromURLParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function getFromURL( + array|MetadataGetFromURLParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse { + [$parsed, $options] = MetadataGetFromURLParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'get', + path: 'v1/files/metadata', + query: $parsed, + options: $options, + convert: Metadata::class, + ); + } +} diff --git a/src/Services/Files/MetadataService.php b/src/Services/Files/MetadataService.php index b5bc6e2c..bf6718b9 100644 --- a/src/Services/Files/MetadataService.php +++ b/src/Services/Files/MetadataService.php @@ -5,19 +5,25 @@ namespace Imagekit\Services\Files; use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Exceptions\APIException; use Imagekit\Files\Metadata; -use Imagekit\Files\Metadata\MetadataGetFromURLParams; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Files\MetadataContract; final class MetadataService implements MetadataContract { + /** + * @api + */ + public MetadataRawService $raw; + /** * @internal */ - public function __construct(private Client $client) {} + public function __construct(private Client $client) + { + $this->raw = new MetadataRawService($client); + } /** * @api @@ -26,19 +32,16 @@ public function __construct(private Client $client) {} * * You can also get the metadata in upload API response by passing `metadata` in `responseFields` parameter. * + * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in the list and search assets API and upload API. + * * @throws APIException */ public function get( string $fileID, ?RequestOptions $requestOptions = null ): Metadata { - /** @var BaseResponse */ - $response = $this->client->request( - method: 'get', - path: ['v1/files/%1$s/metadata', $fileID], - options: $requestOptions, - convert: Metadata::class, - ); + // @phpstan-ignore-next-line argument.type + $response = $this->raw->get($fileID, requestOptions: $requestOptions); return $response->parse(); } @@ -48,27 +51,18 @@ public function get( * * Get image EXIF, pHash, and other metadata from ImageKit.io powered remote URL using this API. * - * @param array{url: string}|MetadataGetFromURLParams $params + * @param string $url Should be a valid file URL. It should be accessible using your ImageKit.io account. * * @throws APIException */ public function getFromURL( - array|MetadataGetFromURLParams $params, - ?RequestOptions $requestOptions = null, + string $url, + ?RequestOptions $requestOptions = null ): Metadata { - [$parsed, $options] = MetadataGetFromURLParams::parseRequest( - $params, - $requestOptions, - ); + $params = ['url' => $url]; - /** @var BaseResponse */ - $response = $this->client->request( - method: 'get', - path: 'v1/files/metadata', - query: $parsed, - options: $options, - convert: Metadata::class, - ); + // @phpstan-ignore-next-line argument.type + $response = $this->raw->getFromURL(params: $params, requestOptions: $requestOptions); return $response->parse(); } diff --git a/src/Services/Files/VersionsRawService.php b/src/Services/Files/VersionsRawService.php new file mode 100644 index 00000000..d4e91400 --- /dev/null +++ b/src/Services/Files/VersionsRawService.php @@ -0,0 +1,151 @@ +> + * + * @throws APIException + */ + public function list( + string $fileID, + ?RequestOptions $requestOptions = null + ): BaseResponse { + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'get', + path: ['v1/files/%1$s/versions', $fileID], + options: $requestOptions, + convert: new ListOf(File::class), + ); + } + + /** + * @api + * + * This API deletes a non-current file version permanently. The API returns an empty response. + * + * Note: If you want to delete all versions of a file, use the delete file API. + * + * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. + * @param array{fileID: string}|VersionDeleteParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function delete( + string $versionID, + array|VersionDeleteParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse { + [$parsed, $options] = VersionDeleteParams::parseRequest( + $params, + $requestOptions, + ); + $fileID = $parsed['fileID']; + unset($parsed['fileID']); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'delete', + path: ['v1/files/%1$s/versions/%2$s', $fileID, $versionID], + options: $options, + convert: VersionDeleteResponse::class, + ); + } + + /** + * @api + * + * This API returns an object with details or attributes of a file version. + * + * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. + * @param array{fileID: string}|VersionGetParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function get( + string $versionID, + array|VersionGetParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse { + [$parsed, $options] = VersionGetParams::parseRequest( + $params, + $requestOptions, + ); + $fileID = $parsed['fileID']; + unset($parsed['fileID']); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'get', + path: ['v1/files/%1$s/versions/%2$s', $fileID, $versionID], + options: $options, + convert: File::class, + ); + } + + /** + * @api + * + * This API restores a file version as the current file version. + * + * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. + * @param array{fileID: string}|VersionRestoreParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function restore( + string $versionID, + array|VersionRestoreParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse { + [$parsed, $options] = VersionRestoreParams::parseRequest( + $params, + $requestOptions, + ); + $fileID = $parsed['fileID']; + unset($parsed['fileID']); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'put', + path: ['v1/files/%1$s/versions/%2$s/restore', $fileID, $versionID], + options: $options, + convert: File::class, + ); + } +} diff --git a/src/Services/Files/VersionsService.php b/src/Services/Files/VersionsService.php index 83512ac1..db8c8272 100644 --- a/src/Services/Files/VersionsService.php +++ b/src/Services/Files/VersionsService.php @@ -5,29 +5,34 @@ namespace Imagekit\Services\Files; use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Conversion\ListOf; use Imagekit\Core\Exceptions\APIException; use Imagekit\Files\File; -use Imagekit\Files\Versions\VersionDeleteParams; use Imagekit\Files\Versions\VersionDeleteResponse; -use Imagekit\Files\Versions\VersionGetParams; -use Imagekit\Files\Versions\VersionRestoreParams; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Files\VersionsContract; final class VersionsService implements VersionsContract { + /** + * @api + */ + public VersionsRawService $raw; + /** * @internal */ - public function __construct(private Client $client) {} + public function __construct(private Client $client) + { + $this->raw = new VersionsRawService($client); + } /** * @api * * This API returns details of all versions of a file. * + * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. + * * @return list * * @throws APIException @@ -36,13 +41,8 @@ public function list( string $fileID, ?RequestOptions $requestOptions = null ): array { - /** @var BaseResponse> */ - $response = $this->client->request( - method: 'get', - path: ['v1/files/%1$s/versions', $fileID], - options: $requestOptions, - convert: new ListOf(File::class), - ); + // @phpstan-ignore-next-line argument.type + $response = $this->raw->list($fileID, requestOptions: $requestOptions); return $response->parse(); } @@ -54,29 +54,20 @@ public function list( * * Note: If you want to delete all versions of a file, use the delete file API. * - * @param array{fileID: string}|VersionDeleteParams $params + * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. + * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. * * @throws APIException */ public function delete( string $versionID, - array|VersionDeleteParams $params, - ?RequestOptions $requestOptions = null, + string $fileID, + ?RequestOptions $requestOptions = null ): VersionDeleteResponse { - [$parsed, $options] = VersionDeleteParams::parseRequest( - $params, - $requestOptions, - ); - $fileID = $parsed['fileID']; - unset($parsed['fileID']); - - /** @var BaseResponse */ - $response = $this->client->request( - method: 'delete', - path: ['v1/files/%1$s/versions/%2$s', $fileID, $versionID], - options: $options, - convert: VersionDeleteResponse::class, - ); + $params = ['fileID' => $fileID]; + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->delete($versionID, params: $params, requestOptions: $requestOptions); return $response->parse(); } @@ -86,29 +77,20 @@ public function delete( * * This API returns an object with details or attributes of a file version. * - * @param array{fileID: string}|VersionGetParams $params + * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. + * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. * * @throws APIException */ public function get( string $versionID, - array|VersionGetParams $params, - ?RequestOptions $requestOptions = null, + string $fileID, + ?RequestOptions $requestOptions = null ): File { - [$parsed, $options] = VersionGetParams::parseRequest( - $params, - $requestOptions, - ); - $fileID = $parsed['fileID']; - unset($parsed['fileID']); - - /** @var BaseResponse */ - $response = $this->client->request( - method: 'get', - path: ['v1/files/%1$s/versions/%2$s', $fileID, $versionID], - options: $options, - convert: File::class, - ); + $params = ['fileID' => $fileID]; + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->get($versionID, params: $params, requestOptions: $requestOptions); return $response->parse(); } @@ -118,29 +100,20 @@ public function get( * * This API restores a file version as the current file version. * - * @param array{fileID: string}|VersionRestoreParams $params + * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. + * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. * * @throws APIException */ public function restore( string $versionID, - array|VersionRestoreParams $params, - ?RequestOptions $requestOptions = null, + string $fileID, + ?RequestOptions $requestOptions = null ): File { - [$parsed, $options] = VersionRestoreParams::parseRequest( - $params, - $requestOptions, - ); - $fileID = $parsed['fileID']; - unset($parsed['fileID']); - - /** @var BaseResponse */ - $response = $this->client->request( - method: 'put', - path: ['v1/files/%1$s/versions/%2$s/restore', $fileID, $versionID], - options: $options, - convert: File::class, - ); + $params = ['fileID' => $fileID]; + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->restore($versionID, params: $params, requestOptions: $requestOptions); return $response->parse(); } diff --git a/src/Services/FilesRawService.php b/src/Services/FilesRawService.php new file mode 100644 index 00000000..1029efa2 --- /dev/null +++ b/src/Services/FilesRawService.php @@ -0,0 +1,296 @@ +, + * description?: string, + * extensions?: list>, + * removeAITags?: 'all'|list, + * tags?: list|null, + * webhookURL?: string, + * publish?: array{isPublished: bool, includeFileVersions?: bool}, + * }|FileUpdateParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function update( + string $fileID, + array|FileUpdateParams $params, + ?RequestOptions $requestOptions = null, + ): BaseResponse { + [$parsed, $options] = FileUpdateParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'patch', + path: ['v1/files/%1$s/details', $fileID], + body: (object) $parsed, + options: $options, + convert: FileUpdateResponse::class, + ); + } + + /** + * @api + * + * This API deletes the file and all its file versions permanently. + * + * Note: If a file or specific transformation has been requested in the past, then the response is cached. Deleting a file does not purge the cache. You can purge the cache using purge cache API. + * + * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. + * + * @return BaseResponse + * + * @throws APIException + */ + public function delete( + string $fileID, + ?RequestOptions $requestOptions = null + ): BaseResponse { + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'delete', + path: ['v1/files/%1$s', $fileID], + options: $requestOptions, + convert: null, + ); + } + + /** + * @api + * + * This will copy a file from one folder to another. + * + * Note: If any file at the destination has the same name as the source file, then the source file and its versions (if `includeFileVersions` is set to true) will be appended to the destination file version history. + * + * @param array{ + * destinationPath: string, sourceFilePath: string, includeFileVersions?: bool + * }|FileCopyParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function copy( + array|FileCopyParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse { + [$parsed, $options] = FileCopyParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'post', + path: 'v1/files/copy', + body: (object) $parsed, + options: $options, + convert: FileCopyResponse::class, + ); + } + + /** + * @api + * + * This API returns an object with details or attributes about the current version of the file. + * + * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in the list and search assets API and upload API. + * + * @return BaseResponse + * + * @throws APIException + */ + public function get( + string $fileID, + ?RequestOptions $requestOptions = null + ): BaseResponse { + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'get', + path: ['v1/files/%1$s/details', $fileID], + options: $requestOptions, + convert: File::class, + ); + } + + /** + * @api + * + * This will move a file and all its versions from one folder to another. + * + * Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file. + * + * @param array{ + * destinationPath: string, sourceFilePath: string + * }|FileMoveParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function move( + array|FileMoveParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse { + [$parsed, $options] = FileMoveParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'post', + path: 'v1/files/move', + body: (object) $parsed, + options: $options, + convert: FileMoveResponse::class, + ); + } + + /** + * @api + * + * You can rename an already existing file in the media library using rename file API. This operation would rename all file versions of the file. + * + * Note: The old URLs will stop working. The file/file version URLs cached on CDN will continue to work unless a purge is requested. + * + * @param array{ + * filePath: string, newFileName: string, purgeCache?: bool + * }|FileRenameParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function rename( + array|FileRenameParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse { + [$parsed, $options] = FileRenameParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'put', + path: 'v1/files/rename', + body: (object) $parsed, + options: $options, + convert: FileRenameResponse::class, + ); + } + + /** + * @api + * + * ImageKit.io allows you to upload files directly from both the server and client sides. For server-side uploads, private API key authentication is used. For client-side uploads, generate a one-time `token`, `signature`, and `expire` from your secure backend using private API. [Learn more](/docs/api-reference/upload-file/upload-file#how-to-implement-client-side-file-upload) about how to implement client-side file upload. + * + * The [V2 API](/docs/api-reference/upload-file/upload-file-v2) enhances security by verifying the entire payload using JWT. + * + * **File size limit** \ + * On the free plan, the maximum upload file sizes are 20MB for images, audio, and raw files and 100MB for videos. On the paid plan, these limits increase to 40MB for images, audio, and raw files and 2GB for videos. These limits can be further increased with higher-tier plans. + * + * **Version limit** \ + * A file can have a maximum of 100 versions. + * + * **Demo applications** + * + * - A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more. + * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. + * + * @param array{ + * file: string, + * fileName: string, + * token?: string, + * checks?: string, + * customCoordinates?: string, + * customMetadata?: array, + * description?: string, + * expire?: int, + * extensions?: list>, + * folder?: string, + * isPrivateFile?: bool, + * isPublished?: bool, + * overwriteAITags?: bool, + * overwriteCustomMetadata?: bool, + * overwriteFile?: bool, + * overwriteTags?: bool, + * publicKey?: string, + * responseFields?: list<'tags'|'customCoordinates'|'isPrivateFile'|'embeddedMetadata'|'isPublished'|'customMetadata'|'metadata'|'selectedFieldsSchema'|ResponseField>, + * signature?: string, + * tags?: list, + * transformation?: array{post?: list>, pre?: string}, + * useUniqueFileName?: bool, + * webhookURL?: string, + * }|FileUploadParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function upload( + array|FileUploadParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse { + [$parsed, $options] = FileUploadParams::parseRequest( + $params, + $requestOptions, + ); + $path = $this + ->client + ->baseUrlOverridden ? 'api/v1/files/upload' : 'https://upload.imagekit.io/api/v1/files/upload'; + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'post', + path: $path, + headers: ['Content-Type' => 'multipart/form-data'], + body: (object) $parsed, + options: $options, + convert: FileUploadResponse::class, + ); + } +} diff --git a/src/Services/FilesService.php b/src/Services/FilesService.php index c1a03878..93510e8c 100644 --- a/src/Services/FilesService.php +++ b/src/Services/FilesService.php @@ -5,18 +5,12 @@ namespace Imagekit\Services; use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Exceptions\APIException; use Imagekit\Files\File; -use Imagekit\Files\FileCopyParams; use Imagekit\Files\FileCopyResponse; -use Imagekit\Files\FileMoveParams; use Imagekit\Files\FileMoveResponse; -use Imagekit\Files\FileRenameParams; use Imagekit\Files\FileRenameResponse; -use Imagekit\Files\FileUpdateParams; use Imagekit\Files\FileUpdateResponse; -use Imagekit\Files\FileUploadParams; use Imagekit\Files\FileUploadParams\ResponseField; use Imagekit\Files\FileUploadResponse; use Imagekit\RequestOptions; @@ -27,6 +21,11 @@ final class FilesService implements FilesContract { + /** + * @api + */ + public FilesRawService $raw; + /** * @api */ @@ -47,6 +46,7 @@ final class FilesService implements FilesContract */ public function __construct(private Client $client) { + $this->raw = new FilesRawService($client); $this->bulk = new BulkService($client); $this->versions = new VersionsService($client); $this->metadata = new MetadataService($client); @@ -57,37 +57,51 @@ public function __construct(private Client $client) * * This API updates the details or attributes of the current version of the file. You can update `tags`, `customCoordinates`, `customMetadata`, publication status, remove existing `AITags` and apply extensions using this API. * + * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. + * @param string|null $customCoordinates Define an important area in the image in the format `x,y,width,height` e.g. `10,10,100,100`. Send `null` to unset this value. + * @param array $customMetadata A key-value data to be associated with the asset. To unset a key, send `null` value for that key. Before setting any custom metadata on an asset you have to create the field using custom metadata fields API. + * @param string $description optional text to describe the contents of the file + * @param list> $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. + * @param 'all'|list $removeAITags An array of AITags associated with the file that you want to remove, e.g. `["car", "vehicle", "motorsports"]`. + * + * If you want to remove all AITags associated with the file, send a string - "all". + * + * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. + * @param list|null $tags An array of tags associated with the file, such as `["tag1", "tag2"]`. Send `null` to unset all tags associated with the file. + * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. * @param array{ - * customCoordinates?: string|null, - * customMetadata?: array, - * description?: string, - * extensions?: list>, - * removeAITags?: 'all'|list, - * tags?: list|null, - * webhookURL?: string, - * publish?: array{isPublished: bool, includeFileVersions?: bool}, - * }|FileUpdateParams $params + * isPublished: bool, includeFileVersions?: bool + * } $publish Configure the publication status of a file and its versions * * @throws APIException */ public function update( string $fileID, - array|FileUpdateParams $params, + ?string $customCoordinates = null, + ?array $customMetadata = null, + ?string $description = null, + ?array $extensions = null, + string|array|null $removeAITags = null, + ?array $tags = null, + ?string $webhookURL = null, + ?array $publish = null, ?RequestOptions $requestOptions = null, ): FileUpdateResponse { - [$parsed, $options] = FileUpdateParams::parseRequest( - $params, - $requestOptions, - ); + $params = [ + 'customCoordinates' => $customCoordinates, + 'customMetadata' => $customMetadata, + 'description' => $description, + 'extensions' => $extensions, + 'removeAITags' => $removeAITags, + 'tags' => $tags, + 'webhookURL' => $webhookURL, + 'publish' => $publish, + ]; + // @phpstan-ignore-next-line function.impossibleType + $params = array_filter($params, callback: static fn ($v) => !is_null($v)); - /** @var BaseResponse */ - $response = $this->client->request( - method: 'patch', - path: ['v1/files/%1$s/details', $fileID], - body: (object) $parsed, - options: $options, - convert: FileUpdateResponse::class, - ); + // @phpstan-ignore-next-line argument.type + $response = $this->raw->update($fileID, params: $params, requestOptions: $requestOptions); return $response->parse(); } @@ -99,19 +113,16 @@ public function update( * * Note: If a file or specific transformation has been requested in the past, then the response is cached. Deleting a file does not purge the cache. You can purge the cache using purge cache API. * + * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. + * * @throws APIException */ public function delete( string $fileID, ?RequestOptions $requestOptions = null ): mixed { - /** @var BaseResponse */ - $response = $this->client->request( - method: 'delete', - path: ['v1/files/%1$s', $fileID], - options: $requestOptions, - convert: null, - ); + // @phpstan-ignore-next-line argument.type + $response = $this->raw->delete($fileID, requestOptions: $requestOptions); return $response->parse(); } @@ -123,29 +134,28 @@ public function delete( * * Note: If any file at the destination has the same name as the source file, then the source file and its versions (if `includeFileVersions` is set to true) will be appended to the destination file version history. * - * @param array{ - * destinationPath: string, sourceFilePath: string, includeFileVersions?: bool - * }|FileCopyParams $params + * @param string $destinationPath full path to the folder you want to copy the above file into + * @param string $sourceFilePath the full path of the file you want to copy + * @param bool $includeFileVersions Option to copy all versions of a file. By default, only the current version of the file is copied. When set to true, all versions of the file will be copied. Default value - `false`. * * @throws APIException */ public function copy( - array|FileCopyParams $params, - ?RequestOptions $requestOptions = null + string $destinationPath, + string $sourceFilePath, + ?bool $includeFileVersions = null, + ?RequestOptions $requestOptions = null, ): FileCopyResponse { - [$parsed, $options] = FileCopyParams::parseRequest( - $params, - $requestOptions, - ); + $params = [ + 'destinationPath' => $destinationPath, + 'sourceFilePath' => $sourceFilePath, + 'includeFileVersions' => $includeFileVersions, + ]; + // @phpstan-ignore-next-line function.impossibleType + $params = array_filter($params, callback: static fn ($v) => !is_null($v)); - /** @var BaseResponse */ - $response = $this->client->request( - method: 'post', - path: 'v1/files/copy', - body: (object) $parsed, - options: $options, - convert: FileCopyResponse::class, - ); + // @phpstan-ignore-next-line argument.type + $response = $this->raw->copy(params: $params, requestOptions: $requestOptions); return $response->parse(); } @@ -155,19 +165,16 @@ public function copy( * * This API returns an object with details or attributes about the current version of the file. * + * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in the list and search assets API and upload API. + * * @throws APIException */ public function get( string $fileID, ?RequestOptions $requestOptions = null ): File { - /** @var BaseResponse */ - $response = $this->client->request( - method: 'get', - path: ['v1/files/%1$s/details', $fileID], - options: $requestOptions, - convert: File::class, - ); + // @phpstan-ignore-next-line argument.type + $response = $this->raw->get($fileID, requestOptions: $requestOptions); return $response->parse(); } @@ -179,29 +186,22 @@ public function get( * * Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file. * - * @param array{ - * destinationPath: string, sourceFilePath: string - * }|FileMoveParams $params + * @param string $destinationPath full path to the folder you want to move the above file into + * @param string $sourceFilePath the full path of the file you want to move * * @throws APIException */ public function move( - array|FileMoveParams $params, - ?RequestOptions $requestOptions = null + string $destinationPath, + string $sourceFilePath, + ?RequestOptions $requestOptions = null, ): FileMoveResponse { - [$parsed, $options] = FileMoveParams::parseRequest( - $params, - $requestOptions, - ); + $params = [ + 'destinationPath' => $destinationPath, 'sourceFilePath' => $sourceFilePath, + ]; - /** @var BaseResponse */ - $response = $this->client->request( - method: 'post', - path: 'v1/files/move', - body: (object) $parsed, - options: $options, - convert: FileMoveResponse::class, - ); + // @phpstan-ignore-next-line argument.type + $response = $this->raw->move(params: $params, requestOptions: $requestOptions); return $response->parse(); } @@ -213,29 +213,37 @@ public function move( * * Note: The old URLs will stop working. The file/file version URLs cached on CDN will continue to work unless a purge is requested. * - * @param array{ - * filePath: string, newFileName: string, purgeCache?: bool - * }|FileRenameParams $params + * @param string $filePath the full path of the file you want to rename + * @param string $newFileName The new name of the file. A filename can contain: + * + * Alphanumeric Characters: `a-z`, `A-Z`, `0-9` (including Unicode letters, marks, and numerals in other languages). + * Special Characters: `.`, `_`, and `-`. + * + * Any other character, including space, will be replaced by `_`. + * @param bool $purgeCache Option to purge cache for the old file and its versions' URLs. + * + * When set to true, it will internally issue a purge cache request on CDN to remove cached content of old file and its versions. This purge request is counted against your monthly purge quota. + * + * Note: If the old file were accessible at `https://ik.imagekit.io/demo/old-filename.jpg`, a purge cache request would be issued against `https://ik.imagekit.io/demo/old-filename.jpg*` (with a wildcard at the end). It will remove the file and its versions' URLs and any transformations made using query parameters on this file or its versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. * * @throws APIException */ public function rename( - array|FileRenameParams $params, - ?RequestOptions $requestOptions = null + string $filePath, + string $newFileName, + ?bool $purgeCache = null, + ?RequestOptions $requestOptions = null, ): FileRenameResponse { - [$parsed, $options] = FileRenameParams::parseRequest( - $params, - $requestOptions, - ); + $params = [ + 'filePath' => $filePath, + 'newFileName' => $newFileName, + 'purgeCache' => $purgeCache, + ]; + // @phpstan-ignore-next-line function.impossibleType + $params = array_filter($params, callback: static fn ($v) => !is_null($v)); - /** @var BaseResponse */ - $response = $this->client->request( - method: 'put', - path: 'v1/files/rename', - body: (object) $parsed, - options: $options, - convert: FileRenameResponse::class, - ); + // @phpstan-ignore-next-line argument.type + $response = $this->raw->rename(params: $params, requestOptions: $requestOptions); return $response->parse(); } @@ -258,55 +266,138 @@ public function rename( * - A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more. * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. * + * @param string $file The API accepts any of the following: + * + * - **Binary data** – send the raw bytes as `multipart/form-data`. + * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. + * - **Base64 string** – the file encoded as a Base64 data URI or plain Base64. + * + * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. + * @param string $fileName The name with which the file has to be uploaded. + * The file name can contain: + * + * - Alphanumeric Characters: `a-z`, `A-Z`, `0-9`. + * - Special Characters: `.`, `-` + * + * Any other character including space will be replaced by `_` + * @param string $token A unique value that the ImageKit.io server will use to recognize and prevent subsequent retries for the same request. We suggest using V4 UUIDs, or another random string with enough entropy to avoid collisions. This field is only required for authentication when uploading a file from the client side. + * + * **Note**: Sending a value that has been used in the past will result in a validation error. Even if your previous request resulted in an error, you should always send a new value for this field. + * @param string $checks Server-side checks to run on the asset. + * Read more about [Upload API checks](/docs/api-reference/upload-file/upload-file#upload-api-checks). + * @param string $customCoordinates Define an important area in the image. This is only relevant for image type files. + * + * - To be passed as a string with the x and y coordinates of the top-left corner, and width and height of the area of interest in the format `x,y,width,height`. For example - `10,10,100,100` + * - Can be used with fo-customtransformation. + * - If this field is not specified and the file is overwritten, then customCoordinates will be removed. + * @param array $customMetadata JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. + * @param string $description optional text to describe the contents of the file + * @param int $expire The time until your signature is valid. It must be a [Unix time](https://en.wikipedia.org/wiki/Unix_time) in less than 1 hour into the future. It should be in seconds. This field is only required for authentication when uploading a file from the client side. + * @param list> $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. + * @param string $folder The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. + * + * The folder name can contain: + * + * - Alphanumeric Characters: `a-z` , `A-Z` , `0-9` + * - Special Characters: `/` , `_` , `-` + * + * Using multiple `/` creates a nested folder. + * @param bool $isPrivateFile Whether to mark the file as private or not. + * + * If `true`, the file is marked as private and is accessible only using named transformation or signed URL. + * @param bool $isPublished Whether to upload file as published or not. + * + * If `false`, the file is marked as unpublished, which restricts access to the file only via the media library. Files in draft or unpublished state can only be publicly accessed after being published. + * + * The option to upload in draft state is only available in custom enterprise pricing plans. + * @param bool $overwriteAITags If set to `true` and a file already exists at the exact location, its AITags will be removed. Set `overwriteAITags` to `false` to preserve AITags. + * @param bool $overwriteCustomMetadata if the request does not have `customMetadata`, and a file already exists at the exact location, existing customMetadata will be removed + * @param bool $overwriteFile if `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately + * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed + * @param string $publicKey Your ImageKit.io public key. This field is only required for authentication when uploading a file from the client side. + * @param list<'tags'|'customCoordinates'|'isPrivateFile'|'embeddedMetadata'|'isPublished'|'customMetadata'|'metadata'|'selectedFieldsSchema'|ResponseField> $responseFields array of response field keys to include in the API response body + * @param string $signature HMAC-SHA1 digest of the token+expire using your ImageKit.io private API key as a key. Learn how to create a signature on the page below. This should be in lowercase. + * + * Signature must be calculated on the server-side. This field is only required for authentication when uploading a file from the client side. + * @param list $tags Set the tags while uploading the file. + * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. + * If this field is not specified and the file is overwritten, the existing tags will be removed. * @param array{ - * file: string, - * fileName: string, - * token?: string, - * checks?: string, - * customCoordinates?: string, - * customMetadata?: array, - * description?: string, - * expire?: int, - * extensions?: list>, - * folder?: string, - * isPrivateFile?: bool, - * isPublished?: bool, - * overwriteAITags?: bool, - * overwriteCustomMetadata?: bool, - * overwriteFile?: bool, - * overwriteTags?: bool, - * publicKey?: string, - * responseFields?: list<'tags'|'customCoordinates'|'isPrivateFile'|'embeddedMetadata'|'isPublished'|'customMetadata'|'metadata'|'selectedFieldsSchema'|ResponseField>, - * signature?: string, - * tags?: list, - * transformation?: array{post?: list>, pre?: string}, - * useUniqueFileName?: bool, - * webhookURL?: string, - * }|FileUploadParams $params + * post?: list>, pre?: string + * } $transformation Configure pre-processing (`pre`) and post-processing (`post`) transformations. + * + * - `pre` — applied before the file is uploaded to the Media Library. + * Useful for reducing file size or applying basic optimizations upfront (e.g., resize, compress). + * + * - `post` — applied immediately after upload. + * Ideal for generating transformed versions (like video encodes or thumbnails) in advance, so they're ready for delivery without delay. + * + * You can mix and match any combination of post-processing types. + * @param bool $useUniqueFileName Whether to use a unique filename for this file or not. + * + * If `true`, ImageKit.io will add a unique suffix to the filename parameter to get a unique filename. + * + * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. + * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. * * @throws APIException */ public function upload( - array|FileUploadParams $params, - ?RequestOptions $requestOptions = null + string $file, + string $fileName, + ?string $token = null, + ?string $checks = null, + ?string $customCoordinates = null, + ?array $customMetadata = null, + ?string $description = null, + ?int $expire = null, + ?array $extensions = null, + string $folder = '/', + bool $isPrivateFile = false, + bool $isPublished = true, + bool $overwriteAITags = true, + bool $overwriteCustomMetadata = true, + bool $overwriteFile = true, + bool $overwriteTags = true, + ?string $publicKey = null, + ?array $responseFields = null, + ?string $signature = null, + ?array $tags = null, + ?array $transformation = null, + bool $useUniqueFileName = true, + ?string $webhookURL = null, + ?RequestOptions $requestOptions = null, ): FileUploadResponse { - [$parsed, $options] = FileUploadParams::parseRequest( - $params, - $requestOptions, - ); - $path = $this - ->client - ->baseUrlOverridden ? 'api/v1/files/upload' : 'https://upload.imagekit.io/api/v1/files/upload'; + $params = [ + 'file' => $file, + 'fileName' => $fileName, + 'token' => $token, + 'checks' => $checks, + 'customCoordinates' => $customCoordinates, + 'customMetadata' => $customMetadata, + 'description' => $description, + 'expire' => $expire, + 'extensions' => $extensions, + 'folder' => $folder, + 'isPrivateFile' => $isPrivateFile, + 'isPublished' => $isPublished, + 'overwriteAITags' => $overwriteAITags, + 'overwriteCustomMetadata' => $overwriteCustomMetadata, + 'overwriteFile' => $overwriteFile, + 'overwriteTags' => $overwriteTags, + 'publicKey' => $publicKey, + 'responseFields' => $responseFields, + 'signature' => $signature, + 'tags' => $tags, + 'transformation' => $transformation, + 'useUniqueFileName' => $useUniqueFileName, + 'webhookURL' => $webhookURL, + ]; + // @phpstan-ignore-next-line function.impossibleType + $params = array_filter($params, callback: static fn ($v) => !is_null($v)); - /** @var BaseResponse */ - $response = $this->client->request( - method: 'post', - path: $path, - headers: ['Content-Type' => 'multipart/form-data'], - body: (object) $parsed, - options: $options, - convert: FileUploadResponse::class, - ); + // @phpstan-ignore-next-line argument.type + $response = $this->raw->upload(params: $params, requestOptions: $requestOptions); return $response->parse(); } diff --git a/src/Services/Folders/JobRawService.php b/src/Services/Folders/JobRawService.php new file mode 100644 index 00000000..f0e7fc19 --- /dev/null +++ b/src/Services/Folders/JobRawService.php @@ -0,0 +1,45 @@ + + * + * @throws APIException + */ + public function get( + string $jobID, + ?RequestOptions $requestOptions = null + ): BaseResponse { + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'get', + path: ['v1/bulkJobs/%1$s', $jobID], + options: $requestOptions, + convert: JobGetResponse::class, + ); + } +} diff --git a/src/Services/Folders/JobService.php b/src/Services/Folders/JobService.php index 867d35c6..0944e899 100644 --- a/src/Services/Folders/JobService.php +++ b/src/Services/Folders/JobService.php @@ -5,7 +5,6 @@ namespace Imagekit\Services\Folders; use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Exceptions\APIException; use Imagekit\Folders\Job\JobGetResponse; use Imagekit\RequestOptions; @@ -13,29 +12,34 @@ final class JobService implements JobContract { + /** + * @api + */ + public JobRawService $raw; + /** * @internal */ - public function __construct(private Client $client) {} + public function __construct(private Client $client) + { + $this->raw = new JobRawService($client); + } /** * @api * * This API returns the status of a bulk job like copy and move folder operations. * + * @param string $jobID The `jobId` is returned in the response of bulk job API e.g. copy folder or move folder API. + * * @throws APIException */ public function get( string $jobID, ?RequestOptions $requestOptions = null ): JobGetResponse { - /** @var BaseResponse */ - $response = $this->client->request( - method: 'get', - path: ['v1/bulkJobs/%1$s', $jobID], - options: $requestOptions, - convert: JobGetResponse::class, - ); + // @phpstan-ignore-next-line argument.type + $response = $this->raw->get($jobID, requestOptions: $requestOptions); return $response->parse(); } diff --git a/src/Services/FoldersRawService.php b/src/Services/FoldersRawService.php new file mode 100644 index 00000000..04747927 --- /dev/null +++ b/src/Services/FoldersRawService.php @@ -0,0 +1,188 @@ + + * + * @throws APIException + */ + public function create( + array|FolderCreateParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse { + [$parsed, $options] = FolderCreateParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'post', + path: 'v1/folder', + body: (object) $parsed, + options: $options, + convert: FolderNewResponse::class, + ); + } + + /** + * @api + * + * This will delete a folder and all its contents permanently. The API returns an empty response. + * + * @param array{folderPath: string}|FolderDeleteParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function delete( + array|FolderDeleteParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse { + [$parsed, $options] = FolderDeleteParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'delete', + path: 'v1/folder', + body: (object) $parsed, + options: $options, + convert: FolderDeleteResponse::class, + ); + } + + /** + * @api + * + * This will copy one folder into another. The selected folder, its nested folders, files, and their versions (in `includeVersions` is set to true) are copied in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history. + * + * @param array{ + * destinationPath: string, sourceFolderPath: string, includeVersions?: bool + * }|FolderCopyParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function copy( + array|FolderCopyParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse { + [$parsed, $options] = FolderCopyParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'post', + path: 'v1/bulkJobs/copyFolder', + body: (object) $parsed, + options: $options, + convert: FolderCopyResponse::class, + ); + } + + /** + * @api + * + * This will move one folder into another. The selected folder, its nested folders, files, and their versions are moved in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history. + * + * @param array{ + * destinationPath: string, sourceFolderPath: string + * }|FolderMoveParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function move( + array|FolderMoveParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse { + [$parsed, $options] = FolderMoveParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'post', + path: 'v1/bulkJobs/moveFolder', + body: (object) $parsed, + options: $options, + convert: FolderMoveResponse::class, + ); + } + + /** + * @api + * + * This API allows you to rename an existing folder. The folder and all its nested assets and sub-folders will remain unchanged, but their paths will be updated to reflect the new folder name. + * + * @param array{ + * folderPath: string, newFolderName: string, purgeCache?: bool + * }|FolderRenameParams $params + * + * @return BaseResponse + * + * @throws APIException + */ + public function rename( + array|FolderRenameParams $params, + ?RequestOptions $requestOptions = null + ): BaseResponse { + [$parsed, $options] = FolderRenameParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'post', + path: 'v1/bulkJobs/renameFolder', + body: (object) $parsed, + options: $options, + convert: FolderRenameResponse::class, + ); + } +} diff --git a/src/Services/FoldersService.php b/src/Services/FoldersService.php index e0ed79f9..f6e801aa 100644 --- a/src/Services/FoldersService.php +++ b/src/Services/FoldersService.php @@ -5,17 +5,11 @@ namespace Imagekit\Services; use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Exceptions\APIException; -use Imagekit\Folders\FolderCopyParams; use Imagekit\Folders\FolderCopyResponse; -use Imagekit\Folders\FolderCreateParams; -use Imagekit\Folders\FolderDeleteParams; use Imagekit\Folders\FolderDeleteResponse; -use Imagekit\Folders\FolderMoveParams; use Imagekit\Folders\FolderMoveResponse; use Imagekit\Folders\FolderNewResponse; -use Imagekit\Folders\FolderRenameParams; use Imagekit\Folders\FolderRenameResponse; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\FoldersContract; @@ -23,6 +17,11 @@ final class FoldersService implements FoldersContract { + /** + * @api + */ + public FoldersRawService $raw; + /** * @api */ @@ -33,6 +32,7 @@ final class FoldersService implements FoldersContract */ public function __construct(private Client $client) { + $this->raw = new FoldersRawService($client); $this->job = new JobService($client); } @@ -41,29 +41,26 @@ public function __construct(private Client $client) * * This will create a new folder. You can specify the folder name and location of the parent folder where this new folder should be created. * - * @param array{ - * folderName: string, parentFolderPath: string - * }|FolderCreateParams $params + * @param string $folderName The folder will be created with this name. + * + * All characters except alphabets and numbers (inclusive of unicode letters, marks, and numerals in other languages) will be replaced by an underscore i.e. `_`. + * @param string $parentFolderPath The folder where the new folder should be created, for root use `/` else the path e.g. `containing/folder/`. + * + * Note: If any folder(s) is not present in the parentFolderPath parameter, it will be automatically created. For example, if you pass `/product/images/summer`, then `product`, `images`, and `summer` folders will be created if they don't already exist. * * @throws APIException */ public function create( - array|FolderCreateParams $params, - ?RequestOptions $requestOptions = null + string $folderName, + string $parentFolderPath, + ?RequestOptions $requestOptions = null, ): FolderNewResponse { - [$parsed, $options] = FolderCreateParams::parseRequest( - $params, - $requestOptions, - ); - - /** @var BaseResponse */ - $response = $this->client->request( - method: 'post', - path: 'v1/folder', - body: (object) $parsed, - options: $options, - convert: FolderNewResponse::class, - ); + $params = [ + 'folderName' => $folderName, 'parentFolderPath' => $parentFolderPath, + ]; + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->create(params: $params, requestOptions: $requestOptions); return $response->parse(); } @@ -73,27 +70,18 @@ public function create( * * This will delete a folder and all its contents permanently. The API returns an empty response. * - * @param array{folderPath: string}|FolderDeleteParams $params + * @param string $folderPath Full path to the folder you want to delete. For example `/folder/to/delete/`. * * @throws APIException */ public function delete( - array|FolderDeleteParams $params, + string $folderPath, ?RequestOptions $requestOptions = null ): FolderDeleteResponse { - [$parsed, $options] = FolderDeleteParams::parseRequest( - $params, - $requestOptions, - ); - - /** @var BaseResponse */ - $response = $this->client->request( - method: 'delete', - path: 'v1/folder', - body: (object) $parsed, - options: $options, - convert: FolderDeleteResponse::class, - ); + $params = ['folderPath' => $folderPath]; + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->delete(params: $params, requestOptions: $requestOptions); return $response->parse(); } @@ -103,29 +91,28 @@ public function delete( * * This will copy one folder into another. The selected folder, its nested folders, files, and their versions (in `includeVersions` is set to true) are copied in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history. * - * @param array{ - * destinationPath: string, sourceFolderPath: string, includeVersions?: bool - * }|FolderCopyParams $params + * @param string $destinationPath full path to the destination folder where you want to copy the source folder into + * @param string $sourceFolderPath the full path to the source folder you want to copy + * @param bool $includeVersions Option to copy all versions of files that are nested inside the selected folder. By default, only the current version of each file will be copied. When set to true, all versions of each file will be copied. Default value - `false`. * * @throws APIException */ public function copy( - array|FolderCopyParams $params, - ?RequestOptions $requestOptions = null + string $destinationPath, + string $sourceFolderPath, + ?bool $includeVersions = null, + ?RequestOptions $requestOptions = null, ): FolderCopyResponse { - [$parsed, $options] = FolderCopyParams::parseRequest( - $params, - $requestOptions, - ); - - /** @var BaseResponse */ - $response = $this->client->request( - method: 'post', - path: 'v1/bulkJobs/copyFolder', - body: (object) $parsed, - options: $options, - convert: FolderCopyResponse::class, - ); + $params = [ + 'destinationPath' => $destinationPath, + 'sourceFolderPath' => $sourceFolderPath, + 'includeVersions' => $includeVersions, + ]; + // @phpstan-ignore-next-line function.impossibleType + $params = array_filter($params, callback: static fn ($v) => !is_null($v)); + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->copy(params: $params, requestOptions: $requestOptions); return $response->parse(); } @@ -135,29 +122,23 @@ public function copy( * * This will move one folder into another. The selected folder, its nested folders, files, and their versions are moved in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history. * - * @param array{ - * destinationPath: string, sourceFolderPath: string - * }|FolderMoveParams $params + * @param string $destinationPath full path to the destination folder where you want to move the source folder into + * @param string $sourceFolderPath the full path to the source folder you want to move * * @throws APIException */ public function move( - array|FolderMoveParams $params, - ?RequestOptions $requestOptions = null + string $destinationPath, + string $sourceFolderPath, + ?RequestOptions $requestOptions = null, ): FolderMoveResponse { - [$parsed, $options] = FolderMoveParams::parseRequest( - $params, - $requestOptions, - ); - - /** @var BaseResponse */ - $response = $this->client->request( - method: 'post', - path: 'v1/bulkJobs/moveFolder', - body: (object) $parsed, - options: $options, - convert: FolderMoveResponse::class, - ); + $params = [ + 'destinationPath' => $destinationPath, + 'sourceFolderPath' => $sourceFolderPath, + ]; + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->move(params: $params, requestOptions: $requestOptions); return $response->parse(); } @@ -167,29 +148,36 @@ public function move( * * This API allows you to rename an existing folder. The folder and all its nested assets and sub-folders will remain unchanged, but their paths will be updated to reflect the new folder name. * - * @param array{ - * folderPath: string, newFolderName: string, purgeCache?: bool - * }|FolderRenameParams $params + * @param string $folderPath the full path to the folder you want to rename + * @param string $newFolderName The new name for the folder. + * + * All characters except alphabets and numbers (inclusive of unicode letters, marks, and numerals in other languages) and `-` will be replaced by an underscore i.e. `_`. + * @param bool $purgeCache Option to purge cache for the old nested files and their versions' URLs. + * + * When set to true, it will internally issue a purge cache request on CDN to remove the cached content of the old nested files and their versions. There will only be one purge request for all the nested files, which will be counted against your monthly purge quota. + * + * Note: A purge cache request will be issued against `https://ik.imagekit.io/old/folder/path*` (with a wildcard at the end). This will remove all nested files, their versions' URLs, and any transformations made using query parameters on these files or their versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. + * + * Default value - `false` * * @throws APIException */ public function rename( - array|FolderRenameParams $params, - ?RequestOptions $requestOptions = null + string $folderPath, + string $newFolderName, + ?bool $purgeCache = null, + ?RequestOptions $requestOptions = null, ): FolderRenameResponse { - [$parsed, $options] = FolderRenameParams::parseRequest( - $params, - $requestOptions, - ); - - /** @var BaseResponse */ - $response = $this->client->request( - method: 'post', - path: 'v1/bulkJobs/renameFolder', - body: (object) $parsed, - options: $options, - convert: FolderRenameResponse::class, - ); + $params = [ + 'folderPath' => $folderPath, + 'newFolderName' => $newFolderName, + 'purgeCache' => $purgeCache, + ]; + // @phpstan-ignore-next-line function.impossibleType + $params = array_filter($params, callback: static fn ($v) => !is_null($v)); + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->rename(params: $params, requestOptions: $requestOptions); return $response->parse(); } diff --git a/src/Services/WebhooksRawService.php b/src/Services/WebhooksRawService.php new file mode 100644 index 00000000..38bd2b03 --- /dev/null +++ b/src/Services/WebhooksRawService.php @@ -0,0 +1,17 @@ +raw = new WebhooksRawService($client); + } } diff --git a/tests/Services/Accounts/OriginsTest.php b/tests/Services/Accounts/OriginsTest.php index 14a5d01b..1ac45a75 100644 --- a/tests/Services/Accounts/OriginsTest.php +++ b/tests/Services/Accounts/OriginsTest.php @@ -37,23 +37,23 @@ public function testCreate(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->accounts->origins->create([ - 'accessKey' => 'AKIAIOSFODNN7EXAMPLE', - 'bucket' => 'gcs-media', - 'name' => 'US S3 Storage', - 'secretKey' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', - 'endpoint' => 'https://s3.eu-central-1.wasabisys.com', - 'baseURL' => 'https://akeneo.company.com', - 'clientEmail' => 'service-account@project.iam.gserviceaccount.com', - 'privateKey' => '-----BEGIN PRIVATE KEY-----\nMIIEv...', - 'accountName' => 'account123', - 'container' => 'images', - 'sasToken' => '?sv=2023-01-03&sr=c&sig=abc123', - 'clientID' => 'akeneo-client-id', - 'clientSecret' => 'akeneo-client-secret', - 'password' => 'strongpassword123', - 'username' => 'integration-user', - ]); + $result = $this->client->accounts->origins->create( + accessKey: 'AKIAIOSFODNN7EXAMPLE', + bucket: 'gcs-media', + name: 'US S3 Storage', + secretKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', + endpoint: 'https://s3.eu-central-1.wasabisys.com', + baseURL: 'https://akeneo.company.com', + clientEmail: 'service-account@project.iam.gserviceaccount.com', + privateKey: '-----BEGIN PRIVATE KEY-----\nMIIEv...', + accountName: 'account123', + container: 'images', + sasToken: '?sv=2023-01-03&sr=c&sig=abc123', + clientID: 'akeneo-client-id', + clientSecret: 'akeneo-client-secret', + password: 'strongpassword123', + username: 'integration-user', + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertNotNull($result); @@ -66,29 +66,29 @@ public function testCreateWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->accounts->origins->create([ - 'accessKey' => 'AKIAIOSFODNN7EXAMPLE', - 'bucket' => 'gcs-media', - 'name' => 'US S3 Storage', - 'secretKey' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', - 'type' => 'AKENEO_PIM', - 'baseURLForCanonicalHeader' => 'https://cdn.example.com', - 'includeCanonicalHeader' => false, - 'prefix' => 'uploads', - 'endpoint' => 'https://s3.eu-central-1.wasabisys.com', - 's3ForcePathStyle' => true, - 'baseURL' => 'https://akeneo.company.com', - 'forwardHostHeaderToOrigin' => false, - 'clientEmail' => 'service-account@project.iam.gserviceaccount.com', - 'privateKey' => '-----BEGIN PRIVATE KEY-----\nMIIEv...', - 'accountName' => 'account123', - 'container' => 'images', - 'sasToken' => '?sv=2023-01-03&sr=c&sig=abc123', - 'clientID' => 'akeneo-client-id', - 'clientSecret' => 'akeneo-client-secret', - 'password' => 'strongpassword123', - 'username' => 'integration-user', - ]); + $result = $this->client->accounts->origins->create( + accessKey: 'AKIAIOSFODNN7EXAMPLE', + bucket: 'gcs-media', + name: 'US S3 Storage', + secretKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', + type: 'AKENEO_PIM', + baseURLForCanonicalHeader: 'https://cdn.example.com', + includeCanonicalHeader: false, + prefix: 'uploads', + endpoint: 'https://s3.eu-central-1.wasabisys.com', + s3ForcePathStyle: true, + baseURL: 'https://akeneo.company.com', + forwardHostHeaderToOrigin: false, + clientEmail: 'service-account@project.iam.gserviceaccount.com', + privateKey: '-----BEGIN PRIVATE KEY-----\nMIIEv...', + accountName: 'account123', + container: 'images', + sasToken: '?sv=2023-01-03&sr=c&sig=abc123', + clientID: 'akeneo-client-id', + clientSecret: 'akeneo-client-secret', + password: 'strongpassword123', + username: 'integration-user', + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertNotNull($result); @@ -103,23 +103,21 @@ public function testUpdate(): void $result = $this->client->accounts->origins->update( 'id', - [ - 'accessKey' => 'AKIAIOSFODNN7EXAMPLE', - 'bucket' => 'gcs-media', - 'name' => 'US S3 Storage', - 'secretKey' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', - 'endpoint' => 'https://s3.eu-central-1.wasabisys.com', - 'baseURL' => 'https://akeneo.company.com', - 'clientEmail' => 'service-account@project.iam.gserviceaccount.com', - 'privateKey' => '-----BEGIN PRIVATE KEY-----\nMIIEv...', - 'accountName' => 'account123', - 'container' => 'images', - 'sasToken' => '?sv=2023-01-03&sr=c&sig=abc123', - 'clientID' => 'akeneo-client-id', - 'clientSecret' => 'akeneo-client-secret', - 'password' => 'strongpassword123', - 'username' => 'integration-user', - ], + accessKey: 'AKIAIOSFODNN7EXAMPLE', + bucket: 'gcs-media', + name: 'US S3 Storage', + secretKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', + endpoint: 'https://s3.eu-central-1.wasabisys.com', + baseURL: 'https://akeneo.company.com', + clientEmail: 'service-account@project.iam.gserviceaccount.com', + privateKey: '-----BEGIN PRIVATE KEY-----\nMIIEv...', + accountName: 'account123', + container: 'images', + sasToken: '?sv=2023-01-03&sr=c&sig=abc123', + clientID: 'akeneo-client-id', + clientSecret: 'akeneo-client-secret', + password: 'strongpassword123', + username: 'integration-user', ); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -135,29 +133,27 @@ public function testUpdateWithOptionalParams(): void $result = $this->client->accounts->origins->update( 'id', - [ - 'accessKey' => 'AKIAIOSFODNN7EXAMPLE', - 'bucket' => 'gcs-media', - 'name' => 'US S3 Storage', - 'secretKey' => 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', - 'type' => 'AKENEO_PIM', - 'baseURLForCanonicalHeader' => 'https://cdn.example.com', - 'includeCanonicalHeader' => false, - 'prefix' => 'uploads', - 'endpoint' => 'https://s3.eu-central-1.wasabisys.com', - 's3ForcePathStyle' => true, - 'baseURL' => 'https://akeneo.company.com', - 'forwardHostHeaderToOrigin' => false, - 'clientEmail' => 'service-account@project.iam.gserviceaccount.com', - 'privateKey' => '-----BEGIN PRIVATE KEY-----\nMIIEv...', - 'accountName' => 'account123', - 'container' => 'images', - 'sasToken' => '?sv=2023-01-03&sr=c&sig=abc123', - 'clientID' => 'akeneo-client-id', - 'clientSecret' => 'akeneo-client-secret', - 'password' => 'strongpassword123', - 'username' => 'integration-user', - ], + accessKey: 'AKIAIOSFODNN7EXAMPLE', + bucket: 'gcs-media', + name: 'US S3 Storage', + secretKey: 'wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY', + type: 'AKENEO_PIM', + baseURLForCanonicalHeader: 'https://cdn.example.com', + includeCanonicalHeader: false, + prefix: 'uploads', + endpoint: 'https://s3.eu-central-1.wasabisys.com', + s3ForcePathStyle: true, + baseURL: 'https://akeneo.company.com', + forwardHostHeaderToOrigin: false, + clientEmail: 'service-account@project.iam.gserviceaccount.com', + privateKey: '-----BEGIN PRIVATE KEY-----\nMIIEv...', + accountName: 'account123', + container: 'images', + sasToken: '?sv=2023-01-03&sr=c&sig=abc123', + clientID: 'akeneo-client-id', + clientSecret: 'akeneo-client-secret', + password: 'strongpassword123', + username: 'integration-user', ); // @phpstan-ignore-next-line method.alreadyNarrowedType diff --git a/tests/Services/Accounts/URLEndpointsTest.php b/tests/Services/Accounts/URLEndpointsTest.php index f17ff9b9..cd56ff93 100644 --- a/tests/Services/Accounts/URLEndpointsTest.php +++ b/tests/Services/Accounts/URLEndpointsTest.php @@ -38,9 +38,9 @@ public function testCreate(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->accounts->urlEndpoints->create([ - 'description' => 'My custom URL endpoint', - ]); + $result = $this->client->accounts->urlEndpoints->create( + description: 'My custom URL endpoint' + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(URLEndpointResponse::class, $result); @@ -53,14 +53,14 @@ public function testCreateWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->accounts->urlEndpoints->create([ - 'description' => 'My custom URL endpoint', - 'origins' => ['origin-id-1'], - 'urlPrefix' => 'product-images', - 'urlRewriter' => [ + $result = $this->client->accounts->urlEndpoints->create( + description: 'My custom URL endpoint', + origins: ['origin-id-1'], + urlPrefix: 'product-images', + urlRewriter: [ 'type' => 'CLOUDINARY', 'preserveAssetDeliveryTypes' => true, ], - ]); + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(URLEndpointResponse::class, $result); @@ -75,7 +75,7 @@ public function testUpdate(): void $result = $this->client->accounts->urlEndpoints->update( 'id', - ['description' => 'My custom URL endpoint'] + description: 'My custom URL endpoint' ); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -91,13 +91,11 @@ public function testUpdateWithOptionalParams(): void $result = $this->client->accounts->urlEndpoints->update( 'id', - [ - 'description' => 'My custom URL endpoint', - 'origins' => ['origin-id-1'], - 'urlPrefix' => 'product-images', - 'urlRewriter' => [ - 'type' => 'CLOUDINARY', 'preserveAssetDeliveryTypes' => true, - ], + description: 'My custom URL endpoint', + origins: ['origin-id-1'], + urlPrefix: 'product-images', + urlRewriter: [ + 'type' => 'CLOUDINARY', 'preserveAssetDeliveryTypes' => true, ], ); diff --git a/tests/Services/Accounts/UsageTest.php b/tests/Services/Accounts/UsageTest.php index 0449d16b..45d42ad2 100644 --- a/tests/Services/Accounts/UsageTest.php +++ b/tests/Services/Accounts/UsageTest.php @@ -38,10 +38,10 @@ public function testGet(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->accounts->usage->get([ - 'endDate' => new \DateTimeImmutable('2019-12-27'), - 'startDate' => new \DateTimeImmutable('2019-12-27'), - ]); + $result = $this->client->accounts->usage->get( + endDate: new \DateTimeImmutable('2019-12-27'), + startDate: new \DateTimeImmutable('2019-12-27'), + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(UsageGetResponse::class, $result); @@ -54,10 +54,10 @@ public function testGetWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->accounts->usage->get([ - 'endDate' => new \DateTimeImmutable('2019-12-27'), - 'startDate' => new \DateTimeImmutable('2019-12-27'), - ]); + $result = $this->client->accounts->usage->get( + endDate: new \DateTimeImmutable('2019-12-27'), + startDate: new \DateTimeImmutable('2019-12-27'), + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(UsageGetResponse::class, $result); diff --git a/tests/Services/AssetsTest.php b/tests/Services/AssetsTest.php index 16a9970b..bd886fd6 100644 --- a/tests/Services/AssetsTest.php +++ b/tests/Services/AssetsTest.php @@ -37,7 +37,7 @@ public function testList(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->assets->list([]); + $result = $this->client->assets->list(); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertIsList($result); diff --git a/tests/Services/Beta/V2/FilesTest.php b/tests/Services/Beta/V2/FilesTest.php index ae962243..704a6c92 100644 --- a/tests/Services/Beta/V2/FilesTest.php +++ b/tests/Services/Beta/V2/FilesTest.php @@ -38,9 +38,10 @@ public function testUpload(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->beta->v2->files->upload([ - 'file' => 'file', 'fileName' => 'fileName', - ]); + $result = $this->client->beta->v2->files->upload( + file: 'file', + fileName: 'fileName' + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(FileUploadResponse::class, $result); @@ -53,15 +54,15 @@ public function testUploadWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->beta->v2->files->upload([ - 'file' => 'file', - 'fileName' => 'fileName', - 'token' => 'token', - 'checks' => '"request.folder" : "marketing/"\n', - 'customCoordinates' => 'customCoordinates', - 'customMetadata' => ['brand' => 'bar', 'color' => 'bar'], - 'description' => 'Running shoes', - 'extensions' => [ + $result = $this->client->beta->v2->files->upload( + file: 'file', + fileName: 'fileName', + token: 'token', + checks: '"request.folder" : "marketing/"\n', + customCoordinates: 'customCoordinates', + customMetadata: ['brand' => 'bar', 'color' => 'bar'], + description: 'Running shoes', + extensions: [ [ 'name' => 'remove-bg', 'options' => [ @@ -76,16 +77,16 @@ public function testUploadWithOptionalParams(): void ], ['name' => 'ai-auto-description'], ], - 'folder' => 'folder', - 'isPrivateFile' => true, - 'isPublished' => true, - 'overwriteAITags' => true, - 'overwriteCustomMetadata' => true, - 'overwriteFile' => true, - 'overwriteTags' => true, - 'responseFields' => ['tags', 'customCoordinates', 'isPrivateFile'], - 'tags' => ['t-shirt', 'round-neck', 'men'], - 'transformation' => [ + folder: 'folder', + isPrivateFile: true, + isPublished: true, + overwriteAITags: true, + overwriteCustomMetadata: true, + overwriteFile: true, + overwriteTags: true, + responseFields: ['tags', 'customCoordinates', 'isPrivateFile'], + tags: ['t-shirt', 'round-neck', 'men'], + transformation: [ 'post' => [ ['type' => 'thumbnail', 'value' => 'w-150,h-150'], [ @@ -96,9 +97,9 @@ public function testUploadWithOptionalParams(): void ], 'pre' => 'w-300,h-300,q-80', ], - 'useUniqueFileName' => true, - 'webhookURL' => 'https://example.com', - ]); + useUniqueFileName: true, + webhookURL: 'https://example.com', + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(FileUploadResponse::class, $result); diff --git a/tests/Services/Cache/InvalidationTest.php b/tests/Services/Cache/InvalidationTest.php index 6ec0bbd7..f488e694 100644 --- a/tests/Services/Cache/InvalidationTest.php +++ b/tests/Services/Cache/InvalidationTest.php @@ -39,9 +39,9 @@ public function testCreate(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->cache->invalidation->create([ - 'url' => 'https://ik.imagekit.io/your_imagekit_id/default-image.jpg', - ]); + $result = $this->client->cache->invalidation->create( + url: 'https://ik.imagekit.io/your_imagekit_id/default-image.jpg' + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(InvalidationNewResponse::class, $result); @@ -54,9 +54,9 @@ public function testCreateWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->cache->invalidation->create([ - 'url' => 'https://ik.imagekit.io/your_imagekit_id/default-image.jpg', - ]); + $result = $this->client->cache->invalidation->create( + url: 'https://ik.imagekit.io/your_imagekit_id/default-image.jpg' + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(InvalidationNewResponse::class, $result); diff --git a/tests/Services/CustomMetadataFieldsTest.php b/tests/Services/CustomMetadataFieldsTest.php index 29ac0707..5333467e 100644 --- a/tests/Services/CustomMetadataFieldsTest.php +++ b/tests/Services/CustomMetadataFieldsTest.php @@ -39,9 +39,11 @@ public function testCreate(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->customMetadataFields->create([ - 'label' => 'price', 'name' => 'price', 'schema' => ['type' => 'Number'], - ]); + $result = $this->client->customMetadataFields->create( + label: 'price', + name: 'price', + schema: ['type' => 'Number'] + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(CustomMetadataField::class, $result); @@ -54,10 +56,10 @@ public function testCreateWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->customMetadataFields->create([ - 'label' => 'price', - 'name' => 'price', - 'schema' => [ + $result = $this->client->customMetadataFields->create( + label: 'price', + name: 'price', + schema: [ 'type' => 'Number', 'defaultValue' => 'string', 'isValueRequired' => true, @@ -67,7 +69,7 @@ public function testCreateWithOptionalParams(): void 'minValue' => 1000, 'selectOptions' => ['small', 'medium', 'large', 30, 40, true], ], - ]); + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(CustomMetadataField::class, $result); @@ -80,7 +82,7 @@ public function testUpdate(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->customMetadataFields->update('id', []); + $result = $this->client->customMetadataFields->update('id'); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(CustomMetadataField::class, $result); @@ -93,7 +95,7 @@ public function testList(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->customMetadataFields->list([]); + $result = $this->client->customMetadataFields->list(); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertIsList($result); diff --git a/tests/Services/Files/BulkTest.php b/tests/Services/Files/BulkTest.php index 1a22fb4f..a1bef5d1 100644 --- a/tests/Services/Files/BulkTest.php +++ b/tests/Services/Files/BulkTest.php @@ -41,9 +41,9 @@ public function testDelete(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->bulk->delete([ - 'fileIDs' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], - ]); + $result = $this->client->files->bulk->delete( + fileIDs: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'] + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(BulkDeleteResponse::class, $result); @@ -56,9 +56,9 @@ public function testDeleteWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->bulk->delete([ - 'fileIDs' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], - ]); + $result = $this->client->files->bulk->delete( + fileIDs: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'] + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(BulkDeleteResponse::class, $result); @@ -71,10 +71,10 @@ public function testAddTags(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->bulk->addTags([ - 'fileIDs' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], - 'tags' => ['t-shirt', 'round-neck', 'sale2019'], - ]); + $result = $this->client->files->bulk->addTags( + fileIDs: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + tags: ['t-shirt', 'round-neck', 'sale2019'], + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(BulkAddTagsResponse::class, $result); @@ -87,10 +87,10 @@ public function testAddTagsWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->bulk->addTags([ - 'fileIDs' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], - 'tags' => ['t-shirt', 'round-neck', 'sale2019'], - ]); + $result = $this->client->files->bulk->addTags( + fileIDs: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + tags: ['t-shirt', 'round-neck', 'sale2019'], + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(BulkAddTagsResponse::class, $result); @@ -103,10 +103,10 @@ public function testRemoveAITags(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->bulk->removeAITags([ - 'aiTags' => ['t-shirt', 'round-neck', 'sale2019'], - 'fileIDs' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], - ]); + $result = $this->client->files->bulk->removeAITags( + aiTags: ['t-shirt', 'round-neck', 'sale2019'], + fileIDs: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(BulkRemoveAITagsResponse::class, $result); @@ -119,10 +119,10 @@ public function testRemoveAITagsWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->bulk->removeAITags([ - 'aiTags' => ['t-shirt', 'round-neck', 'sale2019'], - 'fileIDs' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], - ]); + $result = $this->client->files->bulk->removeAITags( + aiTags: ['t-shirt', 'round-neck', 'sale2019'], + fileIDs: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(BulkRemoveAITagsResponse::class, $result); @@ -135,10 +135,10 @@ public function testRemoveTags(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->bulk->removeTags([ - 'fileIDs' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], - 'tags' => ['t-shirt', 'round-neck', 'sale2019'], - ]); + $result = $this->client->files->bulk->removeTags( + fileIDs: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + tags: ['t-shirt', 'round-neck', 'sale2019'], + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(BulkRemoveTagsResponse::class, $result); @@ -151,10 +151,10 @@ public function testRemoveTagsWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->bulk->removeTags([ - 'fileIDs' => ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], - 'tags' => ['t-shirt', 'round-neck', 'sale2019'], - ]); + $result = $this->client->files->bulk->removeTags( + fileIDs: ['598821f949c0a938d57563bd', '598821f949c0a938d57563be'], + tags: ['t-shirt', 'round-neck', 'sale2019'], + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(BulkRemoveTagsResponse::class, $result); diff --git a/tests/Services/Files/MetadataTest.php b/tests/Services/Files/MetadataTest.php index 5f46d31d..59f43f7a 100644 --- a/tests/Services/Files/MetadataTest.php +++ b/tests/Services/Files/MetadataTest.php @@ -51,9 +51,9 @@ public function testGetFromURL(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->metadata->getFromURL([ - 'url' => 'https://example.com', - ]); + $result = $this->client->files->metadata->getFromURL( + url: 'https://example.com' + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(Metadata::class, $result); @@ -66,9 +66,9 @@ public function testGetFromURLWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->metadata->getFromURL([ - 'url' => 'https://example.com', - ]); + $result = $this->client->files->metadata->getFromURL( + url: 'https://example.com' + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(Metadata::class, $result); diff --git a/tests/Services/Files/VersionsTest.php b/tests/Services/Files/VersionsTest.php index 0c75ffd8..c1d85c36 100644 --- a/tests/Services/Files/VersionsTest.php +++ b/tests/Services/Files/VersionsTest.php @@ -54,7 +54,7 @@ public function testDelete(): void $result = $this->client->files->versions->delete( 'versionId', - ['fileID' => 'fileId'] + fileID: 'fileId' ); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -70,7 +70,7 @@ public function testDeleteWithOptionalParams(): void $result = $this->client->files->versions->delete( 'versionId', - ['fileID' => 'fileId'] + fileID: 'fileId' ); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -86,7 +86,7 @@ public function testGet(): void $result = $this->client->files->versions->get( 'versionId', - ['fileID' => 'fileId'] + fileID: 'fileId' ); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -102,7 +102,7 @@ public function testGetWithOptionalParams(): void $result = $this->client->files->versions->get( 'versionId', - ['fileID' => 'fileId'] + fileID: 'fileId' ); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -118,7 +118,7 @@ public function testRestore(): void $result = $this->client->files->versions->restore( 'versionId', - ['fileID' => 'fileId'] + fileID: 'fileId' ); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -134,7 +134,7 @@ public function testRestoreWithOptionalParams(): void $result = $this->client->files->versions->restore( 'versionId', - ['fileID' => 'fileId'] + fileID: 'fileId' ); // @phpstan-ignore-next-line method.alreadyNarrowedType diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index 4944de70..57d121b2 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -43,7 +43,7 @@ public function testUpdate(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->update('fileId', []); + $result = $this->client->files->update('fileId'); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(FileUpdateResponse::class, $result); @@ -69,10 +69,10 @@ public function testCopy(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->copy([ - 'destinationPath' => '/folder/to/copy/into/', - 'sourceFilePath' => '/path/to/file.jpg', - ]); + $result = $this->client->files->copy( + destinationPath: '/folder/to/copy/into/', + sourceFilePath: '/path/to/file.jpg', + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(FileCopyResponse::class, $result); @@ -85,11 +85,11 @@ public function testCopyWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->copy([ - 'destinationPath' => '/folder/to/copy/into/', - 'sourceFilePath' => '/path/to/file.jpg', - 'includeFileVersions' => false, - ]); + $result = $this->client->files->copy( + destinationPath: '/folder/to/copy/into/', + sourceFilePath: '/path/to/file.jpg', + includeFileVersions: false, + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(FileCopyResponse::class, $result); @@ -115,10 +115,10 @@ public function testMove(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->move([ - 'destinationPath' => '/folder/to/move/into/', - 'sourceFilePath' => '/path/to/file.jpg', - ]); + $result = $this->client->files->move( + destinationPath: '/folder/to/move/into/', + sourceFilePath: '/path/to/file.jpg', + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(FileMoveResponse::class, $result); @@ -131,10 +131,10 @@ public function testMoveWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->move([ - 'destinationPath' => '/folder/to/move/into/', - 'sourceFilePath' => '/path/to/file.jpg', - ]); + $result = $this->client->files->move( + destinationPath: '/folder/to/move/into/', + sourceFilePath: '/path/to/file.jpg', + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(FileMoveResponse::class, $result); @@ -147,9 +147,10 @@ public function testRename(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->rename([ - 'filePath' => '/path/to/file.jpg', 'newFileName' => 'newFileName.jpg', - ]); + $result = $this->client->files->rename( + filePath: '/path/to/file.jpg', + newFileName: 'newFileName.jpg' + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(FileRenameResponse::class, $result); @@ -162,11 +163,11 @@ public function testRenameWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->rename([ - 'filePath' => '/path/to/file.jpg', - 'newFileName' => 'newFileName.jpg', - 'purgeCache' => true, - ]); + $result = $this->client->files->rename( + filePath: '/path/to/file.jpg', + newFileName: 'newFileName.jpg', + purgeCache: true, + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(FileRenameResponse::class, $result); @@ -179,9 +180,7 @@ public function testUpload(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->upload([ - 'file' => 'file', 'fileName' => 'fileName', - ]); + $result = $this->client->files->upload(file: 'file', fileName: 'fileName'); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(FileUploadResponse::class, $result); @@ -194,16 +193,16 @@ public function testUploadWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->files->upload([ - 'file' => 'file', - 'fileName' => 'fileName', - 'token' => 'token', - 'checks' => '"request.folder" : "marketing/"\n', - 'customCoordinates' => 'customCoordinates', - 'customMetadata' => ['brand' => 'bar', 'color' => 'bar'], - 'description' => 'Running shoes', - 'expire' => 0, - 'extensions' => [ + $result = $this->client->files->upload( + file: 'file', + fileName: 'fileName', + token: 'token', + checks: '"request.folder" : "marketing/"\n', + customCoordinates: 'customCoordinates', + customMetadata: ['brand' => 'bar', 'color' => 'bar'], + description: 'Running shoes', + expire: 0, + extensions: [ [ 'name' => 'remove-bg', 'options' => [ @@ -218,18 +217,18 @@ public function testUploadWithOptionalParams(): void ], ['name' => 'ai-auto-description'], ], - 'folder' => 'folder', - 'isPrivateFile' => true, - 'isPublished' => true, - 'overwriteAITags' => true, - 'overwriteCustomMetadata' => true, - 'overwriteFile' => true, - 'overwriteTags' => true, - 'publicKey' => 'publicKey', - 'responseFields' => ['tags', 'customCoordinates', 'isPrivateFile'], - 'signature' => 'signature', - 'tags' => ['t-shirt', 'round-neck', 'men'], - 'transformation' => [ + folder: 'folder', + isPrivateFile: true, + isPublished: true, + overwriteAITags: true, + overwriteCustomMetadata: true, + overwriteFile: true, + overwriteTags: true, + publicKey: 'publicKey', + responseFields: ['tags', 'customCoordinates', 'isPrivateFile'], + signature: 'signature', + tags: ['t-shirt', 'round-neck', 'men'], + transformation: [ 'post' => [ ['type' => 'thumbnail', 'value' => 'w-150,h-150'], [ @@ -240,9 +239,9 @@ public function testUploadWithOptionalParams(): void ], 'pre' => 'w-300,h-300,q-80', ], - 'useUniqueFileName' => true, - 'webhookURL' => 'https://example.com', - ]); + useUniqueFileName: true, + webhookURL: 'https://example.com', + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(FileUploadResponse::class, $result); diff --git a/tests/Services/FoldersTest.php b/tests/Services/FoldersTest.php index 3430bc72..217bbbd9 100644 --- a/tests/Services/FoldersTest.php +++ b/tests/Services/FoldersTest.php @@ -42,9 +42,10 @@ public function testCreate(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->folders->create([ - 'folderName' => 'summer', 'parentFolderPath' => '/product/images/', - ]); + $result = $this->client->folders->create( + folderName: 'summer', + parentFolderPath: '/product/images/' + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(FolderNewResponse::class, $result); @@ -57,9 +58,10 @@ public function testCreateWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->folders->create([ - 'folderName' => 'summer', 'parentFolderPath' => '/product/images/', - ]); + $result = $this->client->folders->create( + folderName: 'summer', + parentFolderPath: '/product/images/' + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(FolderNewResponse::class, $result); @@ -72,9 +74,7 @@ public function testDelete(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->folders->delete([ - 'folderPath' => '/folder/to/delete/', - ]); + $result = $this->client->folders->delete(folderPath: '/folder/to/delete/'); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(FolderDeleteResponse::class, $result); @@ -87,9 +87,7 @@ public function testDeleteWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->folders->delete([ - 'folderPath' => '/folder/to/delete/', - ]); + $result = $this->client->folders->delete(folderPath: '/folder/to/delete/'); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(FolderDeleteResponse::class, $result); @@ -102,10 +100,10 @@ public function testCopy(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->folders->copy([ - 'destinationPath' => '/path/of/destination/folder', - 'sourceFolderPath' => '/path/of/source/folder', - ]); + $result = $this->client->folders->copy( + destinationPath: '/path/of/destination/folder', + sourceFolderPath: '/path/of/source/folder', + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(FolderCopyResponse::class, $result); @@ -118,11 +116,11 @@ public function testCopyWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->folders->copy([ - 'destinationPath' => '/path/of/destination/folder', - 'sourceFolderPath' => '/path/of/source/folder', - 'includeVersions' => true, - ]); + $result = $this->client->folders->copy( + destinationPath: '/path/of/destination/folder', + sourceFolderPath: '/path/of/source/folder', + includeVersions: true, + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(FolderCopyResponse::class, $result); @@ -135,10 +133,10 @@ public function testMove(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->folders->move([ - 'destinationPath' => '/path/of/destination/folder', - 'sourceFolderPath' => '/path/of/source/folder', - ]); + $result = $this->client->folders->move( + destinationPath: '/path/of/destination/folder', + sourceFolderPath: '/path/of/source/folder', + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(FolderMoveResponse::class, $result); @@ -151,10 +149,10 @@ public function testMoveWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->folders->move([ - 'destinationPath' => '/path/of/destination/folder', - 'sourceFolderPath' => '/path/of/source/folder', - ]); + $result = $this->client->folders->move( + destinationPath: '/path/of/destination/folder', + sourceFolderPath: '/path/of/source/folder', + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(FolderMoveResponse::class, $result); @@ -167,9 +165,10 @@ public function testRename(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->folders->rename([ - 'folderPath' => '/path/of/folder', 'newFolderName' => 'new-folder-name', - ]); + $result = $this->client->folders->rename( + folderPath: '/path/of/folder', + newFolderName: 'new-folder-name' + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(FolderRenameResponse::class, $result); @@ -182,11 +181,11 @@ public function testRenameWithOptionalParams(): void $this->markTestSkipped('Prism tests are disabled'); } - $result = $this->client->folders->rename([ - 'folderPath' => '/path/of/folder', - 'newFolderName' => 'new-folder-name', - 'purgeCache' => true, - ]); + $result = $this->client->folders->rename( + folderPath: '/path/of/folder', + newFolderName: 'new-folder-name', + purgeCache: true, + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(FolderRenameResponse::class, $result); From 387f46c0d4956e0df99308f0c407c17bc23970ae Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 10 Dec 2025 00:41:18 +0000 Subject: [PATCH 092/193] feat: support unwrapping envelopes --- src/Client.php | 7 ++-- src/Core/BaseClient.php | 54 ++----------------------- src/Core/Implementation/RawResponse.php | 12 ++++-- src/Core/Util.php | 26 ++++++++++++ 4 files changed, 42 insertions(+), 57 deletions(-) diff --git a/src/Client.php b/src/Client.php index a4c6e25f..7cdf79f0 100644 --- a/src/Client.php +++ b/src/Client.php @@ -7,6 +7,7 @@ use Http\Discovery\Psr17FactoryDiscovery; use Http\Discovery\Psr18ClientDiscovery; use Imagekit\Core\BaseClient; +use Imagekit\Core\Util; use Imagekit\Services\AccountsService; use Imagekit\Services\AssetsService; use Imagekit\Services\BetaService; @@ -91,9 +92,9 @@ public function __construct( 'User-Agent' => sprintf('ImageKit/PHP %s', '0.0.1'), 'X-Stainless-Lang' => 'php', 'X-Stainless-Package-Version' => '0.0.1', - 'X-Stainless-OS' => $this->getNormalizedOS(), - 'X-Stainless-Arch' => $this->getNormalizedArchitecture(), - 'X-Stainless-Runtime' => 'php', + 'X-Stainless-Arch' => Util::machtype(), + 'X-Stainless-OS' => Util::ostype(), + 'X-Stainless-Runtime' => php_sapi_name(), 'X-Stainless-Runtime-Version' => phpversion(), ], // x-release-please-end diff --git a/src/Core/BaseClient.php b/src/Core/BaseClient.php index c8258eee..e1d5affe 100644 --- a/src/Core/BaseClient.php +++ b/src/Core/BaseClient.php @@ -53,6 +53,7 @@ public function __construct( * @param string|list $path * @param array $query * @param array $headers + * @param string|int|list|null $unwrap * @param class-string>|null $page * @param class-string>|null $stream * @param RequestOptions|array|null $options @@ -65,6 +66,7 @@ public function request( array $query = [], array $headers = [], mixed $body = null, + string|int|array|null $unwrap = null, string|Converter|ConverterSource|null $convert = null, ?string $page = null, ?string $stream = null, @@ -82,62 +84,12 @@ public function request( $rsp = $this->sendRequest($opts, req: $request, data: $body, redirectCount: 0, retryCount: 0); // @phpstan-ignore-next-line argument.type - return new RawResponse(client: $this, request: $request, response: $rsp, options: $opts, requestInfo: $req, stream: $stream, page: $page, convert: $convert ?? 'null'); + return new RawResponse(client: $this, request: $request, response: $rsp, options: $opts, requestInfo: $req, unwrap: $unwrap, stream: $stream, page: $page, convert: $convert ?? 'null'); } /** @return array */ abstract protected function authHeaders(): array; - protected function getNormalizedOS(): string - { - $os = strtolower(PHP_OS_FAMILY); - - switch ($os) { - case 'windows': - return 'Windows'; - - case 'darwin': - return 'MacOS'; - - case 'linux': - return 'Linux'; - - case 'bsd': - case 'freebsd': - case 'openbsd': - return 'BSD'; - - case 'solaris': - return 'Solaris'; - - case 'unix': - case 'unknown': - return 'Unknown'; - - default: - return 'Other:'.$os; - } - } - - protected function getNormalizedArchitecture(): string - { - $arch = php_uname('m'); - if (false !== strpos($arch, 'x86_64') || false !== strpos($arch, 'amd64')) { - return 'x64'; - } - if (false !== strpos($arch, 'i386') || false !== strpos($arch, 'i686')) { - return 'x32'; - } - if (false !== strpos($arch, 'aarch64') || false !== strpos($arch, 'arm64')) { - return 'arm64'; - } - if (false !== strpos($arch, 'arm')) { - return 'arm'; - } - - return 'unknown'; - } - /** * @internal * diff --git a/src/Core/Implementation/RawResponse.php b/src/Core/Implementation/RawResponse.php index 65cf8bd9..110ce25d 100644 --- a/src/Core/Implementation/RawResponse.php +++ b/src/Core/Implementation/RawResponse.php @@ -2,7 +2,7 @@ namespace Imagekit\Core\Implementation; -use Imagekit\Client; +use Imagekit\Core\BaseClient; use Imagekit\Core\Concerns\ResponseProxy; use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Conversion; @@ -36,13 +36,15 @@ class RawResponse implements BaseResponse /** * @param normalized_request $requestInfo + * @param list|string|int|null $unwrap */ public function __construct( - private Client $client, + private BaseClient $client, private RequestOptions $options, private RequestInterface $request, private ResponseInterface $response, private array $requestInfo, + private array|string|int|null $unwrap, private Converter|ConverterSource|string $convert, private ?string $page, private ?string $stream, @@ -91,7 +93,11 @@ public function parse(): mixed private function getDecoded(): mixed { if (!$this->decoded) { - $this->decodedBody = Util::decodeContent($this->response); + $decoded = Util::decodeContent($this->response); + if (!is_null($this->unwrap)) { + $decoded = Util::dig($decoded, key: $this->unwrap); + } + $this->decodedBody = $decoded; $this->decoded = true; } diff --git a/src/Core/Util.php b/src/Core/Util.php index 8a0c52ac..bc08483d 100644 --- a/src/Core/Util.php +++ b/src/Core/Util.php @@ -33,6 +33,32 @@ public static function get_object_vars(object $object): array return get_object_vars($object); } + public static function machtype(): string + { + $arch = php_uname('m'); + + return match (true) { + str_contains($arch, 'aarch64'), str_contains($arch, 'arm64') => 'arm64', + str_contains($arch, 'x86_64'), str_contains($arch, 'amd64') => 'x64', + str_contains($arch, 'i386'), str_contains($arch, 'i686') => 'x32', + str_contains($arch, 'arm') => 'arm', + default => 'unknown', + }; + } + + public static function ostype(): string + { + return match ($os = strtolower(PHP_OS_FAMILY)) { + 'linux' => 'Linux', + 'darwin' => 'MacOS', + 'windows' => 'Windows', + 'solaris' => 'Solaris', + // @phpstan-ignore-next-line match.alwaysFalse + 'bsd', 'freebsd', 'openbsd' => 'BSD', + default => "Other:{$os}", + }; + } + /** * @template T * From cfc16863ed169c087bd75f0b9a66715aab8aa80f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 10 Dec 2025 06:34:27 +0000 Subject: [PATCH 093/193] fix: correctly serialize dates --- src/Accounts/Usage/UsageGetParams.php | 18 +++++++----------- src/Core/Conversion.php | 2 +- src/Core/Util.php | 16 ++++++++++++++-- .../Accounts/UsageContract.php | 10 +++++----- src/Services/Accounts/UsageRawService.php | 4 +--- src/Services/Accounts/UsageService.php | 10 +++++----- tests/Services/Accounts/UsageTest.php | 8 ++++---- 7 files changed, 37 insertions(+), 31 deletions(-) diff --git a/src/Accounts/Usage/UsageGetParams.php b/src/Accounts/Usage/UsageGetParams.php index bd9ca144..dede1fd7 100644 --- a/src/Accounts/Usage/UsageGetParams.php +++ b/src/Accounts/Usage/UsageGetParams.php @@ -14,9 +14,7 @@ * * @see Imagekit\Services\Accounts\UsageService::get() * - * @phpstan-type UsageGetParamsShape = array{ - * endDate: \DateTimeInterface, startDate: \DateTimeInterface - * } + * @phpstan-type UsageGetParamsShape = array{endDate: string, startDate: string} */ final class UsageGetParams implements BaseModel { @@ -28,13 +26,13 @@ final class UsageGetParams implements BaseModel * Specify a `endDate` in `YYYY-MM-DD` format. It should be after the `startDate`. The difference between `startDate` and `endDate` should be less than 90 days. */ #[Required] - public \DateTimeInterface $endDate; + public string $endDate; /** * Specify a `startDate` in `YYYY-MM-DD` format. It should be before the `endDate`. The difference between `startDate` and `endDate` should be less than 90 days. */ #[Required] - public \DateTimeInterface $startDate; + public string $startDate; /** * `new UsageGetParams()` is missing required properties by the API. @@ -60,10 +58,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. */ - public static function with( - \DateTimeInterface $endDate, - \DateTimeInterface $startDate - ): self { + public static function with(string $endDate, string $startDate): self + { $self = new self; $self['endDate'] = $endDate; @@ -75,7 +71,7 @@ public static function with( /** * Specify a `endDate` in `YYYY-MM-DD` format. It should be after the `startDate`. The difference between `startDate` and `endDate` should be less than 90 days. */ - public function withEndDate(\DateTimeInterface $endDate): self + public function withEndDate(string $endDate): self { $self = clone $this; $self['endDate'] = $endDate; @@ -86,7 +82,7 @@ public function withEndDate(\DateTimeInterface $endDate): self /** * Specify a `startDate` in `YYYY-MM-DD` format. It should be before the `endDate`. The difference between `startDate` and `endDate` should be less than 90 days. */ - public function withStartDate(\DateTimeInterface $startDate): self + public function withStartDate(string $startDate): self { $self = clone $this; $self['startDate'] = $startDate; diff --git a/src/Core/Conversion.php b/src/Core/Conversion.php index 822c71bd..5cfc926f 100644 --- a/src/Core/Conversion.php +++ b/src/Core/Conversion.php @@ -30,7 +30,7 @@ public static function dump_unknown(mixed $value, DumpState $state): mixed } if (is_a($value, class: \DateTimeInterface::class)) { - return $value->format(format: \DateTimeInterface::RFC3339); + return date_format($value, format: \DateTimeInterface::RFC3339); } if (is_a($value, class: \JsonSerializable::class)) { diff --git a/src/Core/Util.php b/src/Core/Util.php index bc08483d..eb795c7a 100644 --- a/src/Core/Util.php +++ b/src/Core/Util.php @@ -127,8 +127,9 @@ public static function parsePath(string|array $path): string } [$template] = $path; + $mapped = array_map(static fn ($s) => self::rawUrlEncode($s), array: array_slice($path, 1)); - return sprintf($template, ...array_map('rawurlencode', array: array_slice($path, 1))); + return sprintf($template, ...$mapped); } /** @@ -381,6 +382,17 @@ public static function prettyEncodeJson(mixed $obj): string return json_encode($obj, flags: JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) ?: ''; } + private static function rawUrlEncode( + string|int|\DateTimeInterface $value + ): string { + // @phpstan-ignore-next-line function.alreadyNarrowedType + if (is_object($value) && is_a($value, class: \DateTimeInterface::class)) { + $value = date_format($value, format: \DateTimeInterface::RFC3339); + } + + return rawurlencode((string) $value); + } + /** * @param list $closing * @@ -429,7 +441,7 @@ private static function writeMultipartChunk( yield 'Content-Disposition: form-data'; if (!is_null($key)) { - $name = rawurlencode($key); + $name = self::rawUrlEncode($key); yield "; name=\"{$name}\""; } diff --git a/src/ServiceContracts/Accounts/UsageContract.php b/src/ServiceContracts/Accounts/UsageContract.php index cd338505..3ef31ff4 100644 --- a/src/ServiceContracts/Accounts/UsageContract.php +++ b/src/ServiceContracts/Accounts/UsageContract.php @@ -13,14 +13,14 @@ interface UsageContract /** * @api * - * @param string|\DateTimeInterface $endDate Specify a `endDate` in `YYYY-MM-DD` format. It should be after the `startDate`. The difference between `startDate` and `endDate` should be less than 90 days. - * @param string|\DateTimeInterface $startDate Specify a `startDate` in `YYYY-MM-DD` format. It should be before the `endDate`. The difference between `startDate` and `endDate` should be less than 90 days. + * @param string $endDate Specify a `endDate` in `YYYY-MM-DD` format. It should be after the `startDate`. The difference between `startDate` and `endDate` should be less than 90 days. + * @param string $startDate Specify a `startDate` in `YYYY-MM-DD` format. It should be before the `endDate`. The difference between `startDate` and `endDate` should be less than 90 days. * * @throws APIException */ public function get( - string|\DateTimeInterface $endDate, - string|\DateTimeInterface $startDate, - ?RequestOptions $requestOptions = null, + string $endDate, + string $startDate, + ?RequestOptions $requestOptions = null ): UsageGetResponse; } diff --git a/src/Services/Accounts/UsageRawService.php b/src/Services/Accounts/UsageRawService.php index 6ba02ce3..f24c089a 100644 --- a/src/Services/Accounts/UsageRawService.php +++ b/src/Services/Accounts/UsageRawService.php @@ -25,9 +25,7 @@ public function __construct(private Client $client) {} * * Get the account usage information between two dates. Note that the API response includes data from the start date while excluding data from the end date. In other words, the data covers the period starting from the specified start date up to, but not including, the end date. * - * @param array{ - * endDate: string|\DateTimeInterface, startDate: string|\DateTimeInterface - * }|UsageGetParams $params + * @param array{endDate: string, startDate: string}|UsageGetParams $params * * @return BaseResponse * diff --git a/src/Services/Accounts/UsageService.php b/src/Services/Accounts/UsageService.php index 2ec15090..c4fef438 100644 --- a/src/Services/Accounts/UsageService.php +++ b/src/Services/Accounts/UsageService.php @@ -30,15 +30,15 @@ public function __construct(private Client $client) * * Get the account usage information between two dates. Note that the API response includes data from the start date while excluding data from the end date. In other words, the data covers the period starting from the specified start date up to, but not including, the end date. * - * @param string|\DateTimeInterface $endDate Specify a `endDate` in `YYYY-MM-DD` format. It should be after the `startDate`. The difference between `startDate` and `endDate` should be less than 90 days. - * @param string|\DateTimeInterface $startDate Specify a `startDate` in `YYYY-MM-DD` format. It should be before the `endDate`. The difference between `startDate` and `endDate` should be less than 90 days. + * @param string $endDate Specify a `endDate` in `YYYY-MM-DD` format. It should be after the `startDate`. The difference between `startDate` and `endDate` should be less than 90 days. + * @param string $startDate Specify a `startDate` in `YYYY-MM-DD` format. It should be before the `endDate`. The difference between `startDate` and `endDate` should be less than 90 days. * * @throws APIException */ public function get( - string|\DateTimeInterface $endDate, - string|\DateTimeInterface $startDate, - ?RequestOptions $requestOptions = null, + string $endDate, + string $startDate, + ?RequestOptions $requestOptions = null ): UsageGetResponse { $params = ['endDate' => $endDate, 'startDate' => $startDate]; diff --git a/tests/Services/Accounts/UsageTest.php b/tests/Services/Accounts/UsageTest.php index 45d42ad2..49e8dd20 100644 --- a/tests/Services/Accounts/UsageTest.php +++ b/tests/Services/Accounts/UsageTest.php @@ -39,8 +39,8 @@ public function testGet(): void } $result = $this->client->accounts->usage->get( - endDate: new \DateTimeImmutable('2019-12-27'), - startDate: new \DateTimeImmutable('2019-12-27'), + endDate: '2019-12-27', + startDate: '2019-12-27' ); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -55,8 +55,8 @@ public function testGetWithOptionalParams(): void } $result = $this->client->accounts->usage->get( - endDate: new \DateTimeImmutable('2019-12-27'), - startDate: new \DateTimeImmutable('2019-12-27'), + endDate: '2019-12-27', + startDate: '2019-12-27' ); // @phpstan-ignore-next-line method.alreadyNarrowedType From 328063f0ab0c9604527c9adb1dc5015778e52de1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 10 Dec 2025 15:08:41 +0000 Subject: [PATCH 094/193] fix: a number of serialization errors --- src/Core/BaseClient.php | 4 +- src/Core/Concerns/SdkEnum.php | 3 +- src/Core/Concerns/SdkModel.php | 50 +++++--- src/Core/Concerns/SdkPage.php | 9 -- src/Core/Concerns/SdkParams.php | 6 +- src/Core/Concerns/SdkUnion.php | 2 +- src/Core/Conversion/ListOf.php | 3 +- src/Core/Conversion/ModelOf.php | 3 +- src/Core/Conversion/PropertyInfo.php | 3 +- src/Core/Util.php | 62 +++++++--- src/Services/Accounts/OriginsService.php | 101 +++++++-------- src/Services/Accounts/URLEndpointsService.php | 33 ++--- src/Services/Accounts/UsageService.php | 5 +- src/Services/AssetsService.php | 23 ++-- src/Services/Beta/V2/FilesService.php | 49 ++++---- src/Services/Cache/InvalidationService.php | 3 +- src/Services/CustomMetadataFieldsService.php | 17 ++- src/Services/Files/BulkService.php | 9 +- src/Services/Files/MetadataService.php | 3 +- src/Services/Files/VersionsService.php | 7 +- src/Services/FilesService.php | 116 +++++++++--------- src/Services/FoldersService.php | 47 +++---- tests/Core/{TestModel.php => ModelTest.php} | 22 ++-- tests/Core/UtilTest.php | 39 ++++++ 24 files changed, 359 insertions(+), 260 deletions(-) rename tests/Core/{TestModel.php => ModelTest.php} (91%) create mode 100644 tests/Core/UtilTest.php diff --git a/src/Core/BaseClient.php b/src/Core/BaseClient.php index e1d5affe..b00d5cf8 100644 --- a/src/Core/BaseClient.php +++ b/src/Core/BaseClient.php @@ -74,14 +74,14 @@ public function request( ): BaseResponse { // @phpstan-ignore-next-line [$req, $opts] = $this->buildRequest(method: $method, path: $path, query: $query, headers: $headers, body: $body, opts: $options); - ['method' => $method, 'path' => $uri, 'headers' => $headers] = $req; + ['method' => $method, 'path' => $uri, 'headers' => $headers, 'body' => $data] = $req; assert(!is_null($opts->requestFactory)); $request = $opts->requestFactory->createRequest($method, uri: $uri); $request = Util::withSetHeaders($request, headers: $headers); // @phpstan-ignore-next-line argument.type - $rsp = $this->sendRequest($opts, req: $request, data: $body, redirectCount: 0, retryCount: 0); + $rsp = $this->sendRequest($opts, req: $request, data: $data, redirectCount: 0, retryCount: 0); // @phpstan-ignore-next-line argument.type return new RawResponse(client: $this, request: $request, response: $rsp, options: $opts, requestInfo: $req, unwrap: $unwrap, stream: $stream, page: $page, convert: $convert ?? 'null'); diff --git a/src/Core/Concerns/SdkEnum.php b/src/Core/Concerns/SdkEnum.php index c34de0b7..f24b2689 100644 --- a/src/Core/Concerns/SdkEnum.php +++ b/src/Core/Concerns/SdkEnum.php @@ -28,6 +28,7 @@ public static function converter(): Converter } } - return static::$converter = new EnumOf($acc); // @phpstan-ignore-line + // @phpstan-ignore-next-line return.type + return static::$converter = new EnumOf($acc); } } diff --git a/src/Core/Concerns/SdkModel.php b/src/Core/Concerns/SdkModel.php index ed357f70..e8fbd471 100644 --- a/src/Core/Concerns/SdkModel.php +++ b/src/Core/Concerns/SdkModel.php @@ -32,7 +32,7 @@ trait SdkModel */ public function __serialize(): array { - $properties = $this->toProperties(); // @phpstan-ignore-line + $properties = $this->toProperties(); return array_map(static fn ($v) => self::serialize($v), array: $properties); } @@ -45,7 +45,8 @@ public function __serialize(): array public function __unserialize(array $data): void { foreach ($data as $key => $value) { - $this->offsetSet($key, value: $value); // @phpstan-ignore-line + // @phpstan-ignore-next-line argument.type + $this->offsetSet($key, value: $value); } } @@ -94,7 +95,8 @@ public function __get(string $key): mixed // An optional property which was unset to be omitted from serialized is being accessed. // Return null to match user's expectations. - return null; // @phpstan-ignore-line + // @phpstan-ignore-next-line return.type + return null; } /** @@ -104,7 +106,8 @@ public function __get(string $key): mixed */ public function toProperties(): array { - return [...Util::get_object_vars($this), ...$this->_data]; // @phpstan-ignore-line + // @phpstan-ignore-next-line return.type + return [...Util::get_object_vars($this), ...$this->_data]; } /** @@ -114,7 +117,8 @@ public function toProperties(): array */ public function offsetExists(mixed $offset): bool { - if (!is_string($offset)) { // @phpstan-ignore-line + // @phpstan-ignore-next-line function.alreadyNarrowedType + if (!is_string($offset)) { throw new \InvalidArgumentException; } @@ -142,19 +146,24 @@ public function offsetExists(mixed $offset): bool */ public function &offsetGet(mixed $offset): mixed { - if (!is_string($offset)) { // @phpstan-ignore-line + // @phpstan-ignore-next-line function.alreadyNarrowedType + if (!is_string($offset)) { throw new \InvalidArgumentException; } - if (!$this->offsetExists($offset)) { // @phpstan-ignore-line - return null; // @phpstan-ignore-line + // @phpstan-ignore-next-line function.alreadyNarrowedType + if (!$this->offsetExists($offset)) { + // @phpstan-ignore-next-line return.type + return null; } if (array_key_exists($offset, array: $this->_data)) { - return $this->_data[$offset]; // @phpstan-ignore-line + // @phpstan-ignore-next-line return.type + return $this->_data[$offset]; } - return $this->{$offset}; // @phpstan-ignore-line + // @phpstan-ignore-next-line return.type + return $this->{$offset}; } /** @@ -164,7 +173,8 @@ public function &offsetGet(mixed $offset): mixed */ public function offsetSet(mixed $offset, mixed $value): void { - if (!is_string($offset)) { // @phpstan-ignore-line + // @phpstan-ignore-next-line function.alreadyNarrowedType + if (!is_string($offset)) { throw new \InvalidArgumentException; } @@ -174,13 +184,16 @@ public function offsetSet(mixed $offset, mixed $value): void $coerced = Conversion::coerce($type, value: $value, state: new CoerceState(translateNames: false)); - if (property_exists($this, property: $offset)) { // @phpstan-ignore-line + // @phpstan-ignore-next-line function.alreadyNarrowedType + if (property_exists($this, property: $offset)) { try { - $this->{$offset} = $coerced; // @phpstan-ignore-line + // @phpstan-ignore-next-line assign.propertyType + $this->{$offset} = $coerced; unset($this->_data[$offset]); return; - } catch (\TypeError) { // @phpstan-ignore-line + // @phpstan-ignore-next-line catch.neverThrown + } catch (\TypeError) { unset($this->{$offset}); } } @@ -195,11 +208,13 @@ public function offsetSet(mixed $offset, mixed $value): void */ public function offsetUnset(mixed $offset): void { - if (!is_string($offset)) { // @phpstan-ignore-line + // @phpstan-ignore-next-line function.alreadyNarrowedType + if (!is_string($offset)) { throw new \InvalidArgumentException; } - if (property_exists($this, property: $offset)) { // @phpstan-ignore-line + // @phpstan-ignore-next-line function.alreadyNarrowedType + if (property_exists($this, property: $offset)) { unset($this->{$offset}); } @@ -222,7 +237,8 @@ public function jsonSerialize(): array */ public static function fromArray(array $data): static { - return self::converter()->from($data); // @phpstan-ignore-line + // @phpstan-ignore-next-line argument.type + return self::converter()->from($data); } /** diff --git a/src/Core/Concerns/SdkPage.php b/src/Core/Concerns/SdkPage.php index d6886618..557b46f6 100644 --- a/src/Core/Concerns/SdkPage.php +++ b/src/Core/Concerns/SdkPage.php @@ -91,15 +91,6 @@ public function pagingEachItem(): \Generator } } - /** - * @internal - * - * @param array $data - * - * @return static - */ - abstract public static function fromArray(array $data): static; - /** * @internal * diff --git a/src/Core/Concerns/SdkParams.php b/src/Core/Concerns/SdkParams.php index 130f6de3..6a5601d4 100644 --- a/src/Core/Concerns/SdkParams.php +++ b/src/Core/Concerns/SdkParams.php @@ -25,12 +25,14 @@ public static function parseRequest(mixed $params, array|RequestOptions|null $op $converter = self::converter(); $state = new DumpState; $dumped = (array) Conversion::dump($converter, value: $value, state: $state); - $opts = RequestOptions::parse($options); // @phpstan-ignore-line + // @phpstan-ignore-next-line argument.type + $opts = RequestOptions::parse($options); if (!$state->canRetry) { $opts->maxRetries = 0; } - return [$dumped, $opts]; // @phpstan-ignore-line + // @phpstan-ignore-next-line return.type + return [$dumped, $opts]; } } diff --git a/src/Core/Concerns/SdkUnion.php b/src/Core/Concerns/SdkUnion.php index a5ae2034..3045665d 100644 --- a/src/Core/Concerns/SdkUnion.php +++ b/src/Core/Concerns/SdkUnion.php @@ -15,7 +15,7 @@ trait SdkUnion { private static Converter $converter; - public static function discriminator(): ?string // @phpstan-ignore-line + public static function discriminator(): ?string { return null; } diff --git a/src/Core/Conversion/ListOf.php b/src/Core/Conversion/ListOf.php index e7d330a3..2caad9a6 100644 --- a/src/Core/Conversion/ListOf.php +++ b/src/Core/Conversion/ListOf.php @@ -14,7 +14,8 @@ final class ListOf implements Converter { use ArrayOf; - private function empty(): array|object // @phpstan-ignore-line + // @phpstan-ignore-next-line missingType.iterableValue + private function empty(): array|object { return []; } diff --git a/src/Core/Conversion/ModelOf.php b/src/Core/Conversion/ModelOf.php index 38dd2267..713a803a 100644 --- a/src/Core/Conversion/ModelOf.php +++ b/src/Core/Conversion/ModelOf.php @@ -91,7 +91,8 @@ public function coerce(mixed $value, CoerceState $state): mixed $acc[$name] = $item; } - return $this->from($acc); // @phpstan-ignore-line + // @phpstan-ignore-next-line return.type + return $this->from($acc); } public function dump(mixed $value, DumpState $state): mixed diff --git a/src/Core/Conversion/PropertyInfo.php b/src/Core/Conversion/PropertyInfo.php index 9722f607..0017d339 100644 --- a/src/Core/Conversion/PropertyInfo.php +++ b/src/Core/Conversion/PropertyInfo.php @@ -57,7 +57,8 @@ private static function parse(array|Converter|ConverterSource|\ReflectionType|st } if (is_array($type)) { - return new UnionOf($type); // @phpstan-ignore-line + // @phpstan-ignore-next-line return.type + return new UnionOf($type); } if ($type instanceof \ReflectionUnionType) { diff --git a/src/Core/Util.php b/src/Core/Util.php index eb795c7a..1da08e39 100644 --- a/src/Core/Util.php +++ b/src/Core/Util.php @@ -87,6 +87,29 @@ public static function array_filter_omit(array $arr): array return array_filter($arr, fn ($v, $_) => OMIT !== $v, mode: ARRAY_FILTER_USE_BOTH); } + /** + * @param callable $callback + */ + public static function mapRecursive(mixed $callback, mixed $value): mixed + { + $mapped = match (true) { + is_array($value) => array_map(static fn ($v) => self::mapRecursive($callback, value: $v), $value), + default => $value, + }; + + return $callback($mapped); + } + + public static function removeNulls(mixed $value): mixed + { + $mapped = self::mapRecursive( + static fn ($vs) => is_array($vs) && !array_is_list($vs) ? array_filter($vs, callback: static fn ($v) => !is_null($v)) : $vs, + value: $value + ); + + return $mapped; + } + /** * @param string|int|list|callable $key */ @@ -127,7 +150,7 @@ public static function parsePath(string|array $path): string } [$template] = $path; - $mapped = array_map(static fn ($s) => self::rawUrlEncode($s), array: array_slice($path, 1)); + $mapped = array_map(static fn ($s) => rawurlencode(self::strVal($s)), array: array_slice($path, 1)); return sprintf($template, ...$mapped); } @@ -161,8 +184,9 @@ public static function joinUri( parse_str($base->getQuery(), $q1); parse_str($parsed['query'] ?? '', $q2); - $merged_query = array_merge_recursive($q1, $q2, $query); - $qs = http_build_query($merged_query, encoding_type: PHP_QUERY_RFC3986); + $mergedQuery = array_merge_recursive($q1, $q2, $query); + $normalizedQuery = array_map(static fn ($v) => self::strVal($v), array: $mergedQuery); + $qs = http_build_query($normalizedQuery, encoding_type: PHP_QUERY_RFC3986); return $base->withQuery($qs); } @@ -179,11 +203,7 @@ public static function withSetHeaders( /** @var RequestInterface */ $req = $req->withoutHeader($name); } else { - $value = is_int($value) - ? (string) $value - : (is_array($value) - ? array_map(static fn ($v) => (string) $v, array: $value) - : $value); + $value = is_array($value) ? array_map(static fn ($v) => self::strVal($v), array: $value) : self::strVal($value); /** @var RequestInterface */ $req = $req->withHeader($name, $value); @@ -251,6 +271,13 @@ public static function withSetBody( return $req->withBody($stream); } + if (is_string($body)) { + $stream = $factory->createStream($body); + + // @var RequestInterface + return $req->withBody($stream); + } + return $req; } @@ -382,15 +409,18 @@ public static function prettyEncodeJson(mixed $obj): string return json_encode($obj, flags: JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) ?: ''; } - private static function rawUrlEncode( - string|int|\DateTimeInterface $value - ): string { - // @phpstan-ignore-next-line function.alreadyNarrowedType + private static function strVal(mixed $value): string + { + if (is_bool($value)) { + return $value ? 'true' : 'false'; + } + if (is_object($value) && is_a($value, class: \DateTimeInterface::class)) { - $value = date_format($value, format: \DateTimeInterface::RFC3339); + return date_format($value, format: \DateTimeInterface::RFC3339); } - return rawurlencode((string) $value); + // @phpstan-ignore-next-line argument.type + return strval($value); } /** @@ -415,7 +445,7 @@ private static function writeMultipartContent( } elseif (is_string($val) || is_numeric($val) || is_bool($val)) { yield sprintf($contentLine, $contentType ?? 'text/plain'); - yield (string) $val; + yield self::strVal($val); } else { yield sprintf($contentLine, $contentType ?? 'application/json'); @@ -441,7 +471,7 @@ private static function writeMultipartChunk( yield 'Content-Disposition: form-data'; if (!is_null($key)) { - $name = self::rawUrlEncode($key); + $name = rawurlencode(self::strVal($key)); yield "; name=\"{$name}\""; } diff --git a/src/Services/Accounts/OriginsService.php b/src/Services/Accounts/OriginsService.php index f5788e01..86c5caa6 100644 --- a/src/Services/Accounts/OriginsService.php +++ b/src/Services/Accounts/OriginsService.php @@ -14,6 +14,7 @@ use Imagekit\Accounts\Origins\OriginResponse\WebProxy; use Imagekit\Client; use Imagekit\Core\Exceptions\APIException; +use Imagekit\Core\Util; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Accounts\OriginsContract; @@ -79,31 +80,31 @@ public function create( bool $forwardHostHeaderToOrigin = false, ?RequestOptions $requestOptions = null, ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { - $params = [ - 'accessKey' => $accessKey, - 'bucket' => $bucket, - 'name' => $name, - 'secretKey' => $secretKey, - 'type' => $type, - 'baseURLForCanonicalHeader' => $baseURLForCanonicalHeader, - 'includeCanonicalHeader' => $includeCanonicalHeader, - 'prefix' => $prefix, - 'endpoint' => $endpoint, - 's3ForcePathStyle' => $s3ForcePathStyle, - 'baseURL' => $baseURL, - 'forwardHostHeaderToOrigin' => $forwardHostHeaderToOrigin, - 'clientEmail' => $clientEmail, - 'privateKey' => $privateKey, - 'accountName' => $accountName, - 'container' => $container, - 'sasToken' => $sasToken, - 'clientID' => $clientID, - 'clientSecret' => $clientSecret, - 'password' => $password, - 'username' => $username, - ]; - // @phpstan-ignore-next-line function.impossibleType - $params = array_filter($params, callback: static fn ($v) => !is_null($v)); + $params = Util::removeNulls( + [ + 'accessKey' => $accessKey, + 'bucket' => $bucket, + 'name' => $name, + 'secretKey' => $secretKey, + 'type' => $type, + 'baseURLForCanonicalHeader' => $baseURLForCanonicalHeader, + 'includeCanonicalHeader' => $includeCanonicalHeader, + 'prefix' => $prefix, + 'endpoint' => $endpoint, + 's3ForcePathStyle' => $s3ForcePathStyle, + 'baseURL' => $baseURL, + 'forwardHostHeaderToOrigin' => $forwardHostHeaderToOrigin, + 'clientEmail' => $clientEmail, + 'privateKey' => $privateKey, + 'accountName' => $accountName, + 'container' => $container, + 'sasToken' => $sasToken, + 'clientID' => $clientID, + 'clientSecret' => $clientSecret, + 'password' => $password, + 'username' => $username, + ], + ); // @phpstan-ignore-next-line argument.type $response = $this->raw->create(params: $params, requestOptions: $requestOptions); @@ -160,31 +161,31 @@ public function update( bool $forwardHostHeaderToOrigin = false, ?RequestOptions $requestOptions = null, ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { - $params = [ - 'accessKey' => $accessKey, - 'bucket' => $bucket, - 'name' => $name, - 'secretKey' => $secretKey, - 'type' => $type, - 'baseURLForCanonicalHeader' => $baseURLForCanonicalHeader, - 'includeCanonicalHeader' => $includeCanonicalHeader, - 'prefix' => $prefix, - 'endpoint' => $endpoint, - 's3ForcePathStyle' => $s3ForcePathStyle, - 'baseURL' => $baseURL, - 'forwardHostHeaderToOrigin' => $forwardHostHeaderToOrigin, - 'clientEmail' => $clientEmail, - 'privateKey' => $privateKey, - 'accountName' => $accountName, - 'container' => $container, - 'sasToken' => $sasToken, - 'clientID' => $clientID, - 'clientSecret' => $clientSecret, - 'password' => $password, - 'username' => $username, - ]; - // @phpstan-ignore-next-line function.impossibleType - $params = array_filter($params, callback: static fn ($v) => !is_null($v)); + $params = Util::removeNulls( + [ + 'accessKey' => $accessKey, + 'bucket' => $bucket, + 'name' => $name, + 'secretKey' => $secretKey, + 'type' => $type, + 'baseURLForCanonicalHeader' => $baseURLForCanonicalHeader, + 'includeCanonicalHeader' => $includeCanonicalHeader, + 'prefix' => $prefix, + 'endpoint' => $endpoint, + 's3ForcePathStyle' => $s3ForcePathStyle, + 'baseURL' => $baseURL, + 'forwardHostHeaderToOrigin' => $forwardHostHeaderToOrigin, + 'clientEmail' => $clientEmail, + 'privateKey' => $privateKey, + 'accountName' => $accountName, + 'container' => $container, + 'sasToken' => $sasToken, + 'clientID' => $clientID, + 'clientSecret' => $clientSecret, + 'password' => $password, + 'username' => $username, + ], + ); // @phpstan-ignore-next-line argument.type $response = $this->raw->update($id, params: $params, requestOptions: $requestOptions); diff --git a/src/Services/Accounts/URLEndpointsService.php b/src/Services/Accounts/URLEndpointsService.php index b32b0a42..e2578f03 100644 --- a/src/Services/Accounts/URLEndpointsService.php +++ b/src/Services/Accounts/URLEndpointsService.php @@ -7,6 +7,7 @@ use Imagekit\Accounts\URLEndpoints\URLEndpointResponse; use Imagekit\Client; use Imagekit\Core\Exceptions\APIException; +use Imagekit\Core\Util; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Accounts\URLEndpointsContract; @@ -45,14 +46,14 @@ public function create( ?array $urlRewriter = null, ?RequestOptions $requestOptions = null, ): URLEndpointResponse { - $params = [ - 'description' => $description, - 'origins' => $origins, - 'urlPrefix' => $urlPrefix, - 'urlRewriter' => $urlRewriter, - ]; - // @phpstan-ignore-next-line function.impossibleType - $params = array_filter($params, callback: static fn ($v) => !is_null($v)); + $params = Util::removeNulls( + [ + 'description' => $description, + 'origins' => $origins, + 'urlPrefix' => $urlPrefix, + 'urlRewriter' => $urlRewriter, + ], + ); // @phpstan-ignore-next-line argument.type $response = $this->raw->create(params: $params, requestOptions: $requestOptions); @@ -82,14 +83,14 @@ public function update( ?array $urlRewriter = null, ?RequestOptions $requestOptions = null, ): URLEndpointResponse { - $params = [ - 'description' => $description, - 'origins' => $origins, - 'urlPrefix' => $urlPrefix, - 'urlRewriter' => $urlRewriter, - ]; - // @phpstan-ignore-next-line function.impossibleType - $params = array_filter($params, callback: static fn ($v) => !is_null($v)); + $params = Util::removeNulls( + [ + 'description' => $description, + 'origins' => $origins, + 'urlPrefix' => $urlPrefix, + 'urlRewriter' => $urlRewriter, + ], + ); // @phpstan-ignore-next-line argument.type $response = $this->raw->update($id, params: $params, requestOptions: $requestOptions); diff --git a/src/Services/Accounts/UsageService.php b/src/Services/Accounts/UsageService.php index c4fef438..589ee275 100644 --- a/src/Services/Accounts/UsageService.php +++ b/src/Services/Accounts/UsageService.php @@ -7,6 +7,7 @@ use Imagekit\Accounts\Usage\UsageGetResponse; use Imagekit\Client; use Imagekit\Core\Exceptions\APIException; +use Imagekit\Core\Util; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Accounts\UsageContract; @@ -40,7 +41,9 @@ public function get( string $startDate, ?RequestOptions $requestOptions = null ): UsageGetResponse { - $params = ['endDate' => $endDate, 'startDate' => $startDate]; + $params = Util::removeNulls( + ['endDate' => $endDate, 'startDate' => $startDate] + ); // @phpstan-ignore-next-line argument.type $response = $this->raw->get(params: $params, requestOptions: $requestOptions); diff --git a/src/Services/AssetsService.php b/src/Services/AssetsService.php index 206cf4aa..66aba91f 100644 --- a/src/Services/AssetsService.php +++ b/src/Services/AssetsService.php @@ -9,6 +9,7 @@ use Imagekit\Assets\AssetListParams\Type; use Imagekit\Client; use Imagekit\Core\Exceptions\APIException; +use Imagekit\Core\Util; use Imagekit\Files\File; use Imagekit\Files\Folder; use Imagekit\RequestOptions; @@ -76,17 +77,17 @@ public function list( string|Type $type = 'file', ?RequestOptions $requestOptions = null, ): array { - $params = [ - 'fileType' => $fileType, - 'limit' => $limit, - 'path' => $path, - 'searchQuery' => $searchQuery, - 'skip' => $skip, - 'sort' => $sort, - 'type' => $type, - ]; - // @phpstan-ignore-next-line function.impossibleType - $params = array_filter($params, callback: static fn ($v) => !is_null($v)); + $params = Util::removeNulls( + [ + 'fileType' => $fileType, + 'limit' => $limit, + 'path' => $path, + 'searchQuery' => $searchQuery, + 'skip' => $skip, + 'sort' => $sort, + 'type' => $type, + ], + ); // @phpstan-ignore-next-line argument.type $response = $this->raw->list(params: $params, requestOptions: $requestOptions); diff --git a/src/Services/Beta/V2/FilesService.php b/src/Services/Beta/V2/FilesService.php index 9831f512..f7bcf38d 100644 --- a/src/Services/Beta/V2/FilesService.php +++ b/src/Services/Beta/V2/FilesService.php @@ -8,6 +8,7 @@ use Imagekit\Beta\V2\Files\FileUploadResponse; use Imagekit\Client; use Imagekit\Core\Exceptions\APIException; +use Imagekit\Core\Util; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Beta\V2\FilesContract; @@ -123,30 +124,30 @@ public function upload( ?string $webhookURL = null, ?RequestOptions $requestOptions = null, ): FileUploadResponse { - $params = [ - 'file' => $file, - 'fileName' => $fileName, - 'token' => $token, - 'checks' => $checks, - 'customCoordinates' => $customCoordinates, - 'customMetadata' => $customMetadata, - 'description' => $description, - 'extensions' => $extensions, - 'folder' => $folder, - 'isPrivateFile' => $isPrivateFile, - 'isPublished' => $isPublished, - 'overwriteAITags' => $overwriteAITags, - 'overwriteCustomMetadata' => $overwriteCustomMetadata, - 'overwriteFile' => $overwriteFile, - 'overwriteTags' => $overwriteTags, - 'responseFields' => $responseFields, - 'tags' => $tags, - 'transformation' => $transformation, - 'useUniqueFileName' => $useUniqueFileName, - 'webhookURL' => $webhookURL, - ]; - // @phpstan-ignore-next-line function.impossibleType - $params = array_filter($params, callback: static fn ($v) => !is_null($v)); + $params = Util::removeNulls( + [ + 'file' => $file, + 'fileName' => $fileName, + 'token' => $token, + 'checks' => $checks, + 'customCoordinates' => $customCoordinates, + 'customMetadata' => $customMetadata, + 'description' => $description, + 'extensions' => $extensions, + 'folder' => $folder, + 'isPrivateFile' => $isPrivateFile, + 'isPublished' => $isPublished, + 'overwriteAITags' => $overwriteAITags, + 'overwriteCustomMetadata' => $overwriteCustomMetadata, + 'overwriteFile' => $overwriteFile, + 'overwriteTags' => $overwriteTags, + 'responseFields' => $responseFields, + 'tags' => $tags, + 'transformation' => $transformation, + 'useUniqueFileName' => $useUniqueFileName, + 'webhookURL' => $webhookURL, + ], + ); // @phpstan-ignore-next-line argument.type $response = $this->raw->upload(params: $params, requestOptions: $requestOptions); diff --git a/src/Services/Cache/InvalidationService.php b/src/Services/Cache/InvalidationService.php index 8fff5014..f887234e 100644 --- a/src/Services/Cache/InvalidationService.php +++ b/src/Services/Cache/InvalidationService.php @@ -8,6 +8,7 @@ use Imagekit\Cache\Invalidation\InvalidationNewResponse; use Imagekit\Client; use Imagekit\Core\Exceptions\APIException; +use Imagekit\Core\Util; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Cache\InvalidationContract; @@ -39,7 +40,7 @@ public function create( string $url, ?RequestOptions $requestOptions = null ): InvalidationNewResponse { - $params = ['url' => $url]; + $params = Util::removeNulls(['url' => $url]); // @phpstan-ignore-next-line argument.type $response = $this->raw->create(params: $params, requestOptions: $requestOptions); diff --git a/src/Services/CustomMetadataFieldsService.php b/src/Services/CustomMetadataFieldsService.php index 9da410b9..eccbbae3 100644 --- a/src/Services/CustomMetadataFieldsService.php +++ b/src/Services/CustomMetadataFieldsService.php @@ -6,6 +6,7 @@ use Imagekit\Client; use Imagekit\Core\Exceptions\APIException; +use Imagekit\Core\Util; use Imagekit\CustomMetadataFields\CustomMetadataField; use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\Type; use Imagekit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; @@ -53,7 +54,9 @@ public function create( array $schema, ?RequestOptions $requestOptions = null, ): CustomMetadataField { - $params = ['label' => $label, 'name' => $name, 'schema' => $schema]; + $params = Util::removeNulls( + ['label' => $label, 'name' => $name, 'schema' => $schema] + ); // @phpstan-ignore-next-line argument.type $response = $this->raw->create(params: $params, requestOptions: $requestOptions); @@ -86,9 +89,7 @@ public function update( ?array $schema = null, ?RequestOptions $requestOptions = null, ): CustomMetadataField { - $params = ['label' => $label, 'schema' => $schema]; - // @phpstan-ignore-next-line function.impossibleType - $params = array_filter($params, callback: static fn ($v) => !is_null($v)); + $params = Util::removeNulls(['label' => $label, 'schema' => $schema]); // @phpstan-ignore-next-line argument.type $response = $this->raw->update($id, params: $params, requestOptions: $requestOptions); @@ -115,11 +116,9 @@ public function list( bool $includeDeleted = false, ?RequestOptions $requestOptions = null, ): array { - $params = [ - 'folderPath' => $folderPath, 'includeDeleted' => $includeDeleted, - ]; - // @phpstan-ignore-next-line function.impossibleType - $params = array_filter($params, callback: static fn ($v) => !is_null($v)); + $params = Util::removeNulls( + ['folderPath' => $folderPath, 'includeDeleted' => $includeDeleted] + ); // @phpstan-ignore-next-line argument.type $response = $this->raw->list(params: $params, requestOptions: $requestOptions); diff --git a/src/Services/Files/BulkService.php b/src/Services/Files/BulkService.php index 54452052..d189276a 100644 --- a/src/Services/Files/BulkService.php +++ b/src/Services/Files/BulkService.php @@ -6,6 +6,7 @@ use Imagekit\Client; use Imagekit\Core\Exceptions\APIException; +use Imagekit\Core\Util; use Imagekit\Files\Bulk\BulkAddTagsResponse; use Imagekit\Files\Bulk\BulkDeleteResponse; use Imagekit\Files\Bulk\BulkRemoveAITagsResponse; @@ -45,7 +46,7 @@ public function delete( array $fileIDs, ?RequestOptions $requestOptions = null ): BulkDeleteResponse { - $params = ['fileIDs' => $fileIDs]; + $params = Util::removeNulls(['fileIDs' => $fileIDs]); // @phpstan-ignore-next-line argument.type $response = $this->raw->delete(params: $params, requestOptions: $requestOptions); @@ -68,7 +69,7 @@ public function addTags( array $tags, ?RequestOptions $requestOptions = null ): BulkAddTagsResponse { - $params = ['fileIDs' => $fileIDs, 'tags' => $tags]; + $params = Util::removeNulls(['fileIDs' => $fileIDs, 'tags' => $tags]); // @phpstan-ignore-next-line argument.type $response = $this->raw->addTags(params: $params, requestOptions: $requestOptions); @@ -91,7 +92,7 @@ public function removeAITags( array $fileIDs, ?RequestOptions $requestOptions = null ): BulkRemoveAITagsResponse { - $params = ['aiTags' => $aiTags, 'fileIDs' => $fileIDs]; + $params = Util::removeNulls(['aiTags' => $aiTags, 'fileIDs' => $fileIDs]); // @phpstan-ignore-next-line argument.type $response = $this->raw->removeAITags(params: $params, requestOptions: $requestOptions); @@ -114,7 +115,7 @@ public function removeTags( array $tags, ?RequestOptions $requestOptions = null ): BulkRemoveTagsResponse { - $params = ['fileIDs' => $fileIDs, 'tags' => $tags]; + $params = Util::removeNulls(['fileIDs' => $fileIDs, 'tags' => $tags]); // @phpstan-ignore-next-line argument.type $response = $this->raw->removeTags(params: $params, requestOptions: $requestOptions); diff --git a/src/Services/Files/MetadataService.php b/src/Services/Files/MetadataService.php index bf6718b9..be94b31f 100644 --- a/src/Services/Files/MetadataService.php +++ b/src/Services/Files/MetadataService.php @@ -6,6 +6,7 @@ use Imagekit\Client; use Imagekit\Core\Exceptions\APIException; +use Imagekit\Core\Util; use Imagekit\Files\Metadata; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Files\MetadataContract; @@ -59,7 +60,7 @@ public function getFromURL( string $url, ?RequestOptions $requestOptions = null ): Metadata { - $params = ['url' => $url]; + $params = Util::removeNulls(['url' => $url]); // @phpstan-ignore-next-line argument.type $response = $this->raw->getFromURL(params: $params, requestOptions: $requestOptions); diff --git a/src/Services/Files/VersionsService.php b/src/Services/Files/VersionsService.php index db8c8272..d898cdba 100644 --- a/src/Services/Files/VersionsService.php +++ b/src/Services/Files/VersionsService.php @@ -6,6 +6,7 @@ use Imagekit\Client; use Imagekit\Core\Exceptions\APIException; +use Imagekit\Core\Util; use Imagekit\Files\File; use Imagekit\Files\Versions\VersionDeleteResponse; use Imagekit\RequestOptions; @@ -64,7 +65,7 @@ public function delete( string $fileID, ?RequestOptions $requestOptions = null ): VersionDeleteResponse { - $params = ['fileID' => $fileID]; + $params = Util::removeNulls(['fileID' => $fileID]); // @phpstan-ignore-next-line argument.type $response = $this->raw->delete($versionID, params: $params, requestOptions: $requestOptions); @@ -87,7 +88,7 @@ public function get( string $fileID, ?RequestOptions $requestOptions = null ): File { - $params = ['fileID' => $fileID]; + $params = Util::removeNulls(['fileID' => $fileID]); // @phpstan-ignore-next-line argument.type $response = $this->raw->get($versionID, params: $params, requestOptions: $requestOptions); @@ -110,7 +111,7 @@ public function restore( string $fileID, ?RequestOptions $requestOptions = null ): File { - $params = ['fileID' => $fileID]; + $params = Util::removeNulls(['fileID' => $fileID]); // @phpstan-ignore-next-line argument.type $response = $this->raw->restore($versionID, params: $params, requestOptions: $requestOptions); diff --git a/src/Services/FilesService.php b/src/Services/FilesService.php index 93510e8c..46f5d504 100644 --- a/src/Services/FilesService.php +++ b/src/Services/FilesService.php @@ -6,6 +6,7 @@ use Imagekit\Client; use Imagekit\Core\Exceptions\APIException; +use Imagekit\Core\Util; use Imagekit\Files\File; use Imagekit\Files\FileCopyResponse; use Imagekit\Files\FileMoveResponse; @@ -87,18 +88,18 @@ public function update( ?array $publish = null, ?RequestOptions $requestOptions = null, ): FileUpdateResponse { - $params = [ - 'customCoordinates' => $customCoordinates, - 'customMetadata' => $customMetadata, - 'description' => $description, - 'extensions' => $extensions, - 'removeAITags' => $removeAITags, - 'tags' => $tags, - 'webhookURL' => $webhookURL, - 'publish' => $publish, - ]; - // @phpstan-ignore-next-line function.impossibleType - $params = array_filter($params, callback: static fn ($v) => !is_null($v)); + $params = Util::removeNulls( + [ + 'customCoordinates' => $customCoordinates, + 'customMetadata' => $customMetadata, + 'description' => $description, + 'extensions' => $extensions, + 'removeAITags' => $removeAITags, + 'tags' => $tags, + 'webhookURL' => $webhookURL, + 'publish' => $publish, + ], + ); // @phpstan-ignore-next-line argument.type $response = $this->raw->update($fileID, params: $params, requestOptions: $requestOptions); @@ -146,13 +147,13 @@ public function copy( ?bool $includeFileVersions = null, ?RequestOptions $requestOptions = null, ): FileCopyResponse { - $params = [ - 'destinationPath' => $destinationPath, - 'sourceFilePath' => $sourceFilePath, - 'includeFileVersions' => $includeFileVersions, - ]; - // @phpstan-ignore-next-line function.impossibleType - $params = array_filter($params, callback: static fn ($v) => !is_null($v)); + $params = Util::removeNulls( + [ + 'destinationPath' => $destinationPath, + 'sourceFilePath' => $sourceFilePath, + 'includeFileVersions' => $includeFileVersions, + ], + ); // @phpstan-ignore-next-line argument.type $response = $this->raw->copy(params: $params, requestOptions: $requestOptions); @@ -196,9 +197,12 @@ public function move( string $sourceFilePath, ?RequestOptions $requestOptions = null, ): FileMoveResponse { - $params = [ - 'destinationPath' => $destinationPath, 'sourceFilePath' => $sourceFilePath, - ]; + $params = Util::removeNulls( + [ + 'destinationPath' => $destinationPath, + 'sourceFilePath' => $sourceFilePath, + ], + ); // @phpstan-ignore-next-line argument.type $response = $this->raw->move(params: $params, requestOptions: $requestOptions); @@ -234,13 +238,13 @@ public function rename( ?bool $purgeCache = null, ?RequestOptions $requestOptions = null, ): FileRenameResponse { - $params = [ - 'filePath' => $filePath, - 'newFileName' => $newFileName, - 'purgeCache' => $purgeCache, - ]; - // @phpstan-ignore-next-line function.impossibleType - $params = array_filter($params, callback: static fn ($v) => !is_null($v)); + $params = Util::removeNulls( + [ + 'filePath' => $filePath, + 'newFileName' => $newFileName, + 'purgeCache' => $purgeCache, + ], + ); // @phpstan-ignore-next-line argument.type $response = $this->raw->rename(params: $params, requestOptions: $requestOptions); @@ -368,33 +372,33 @@ public function upload( ?string $webhookURL = null, ?RequestOptions $requestOptions = null, ): FileUploadResponse { - $params = [ - 'file' => $file, - 'fileName' => $fileName, - 'token' => $token, - 'checks' => $checks, - 'customCoordinates' => $customCoordinates, - 'customMetadata' => $customMetadata, - 'description' => $description, - 'expire' => $expire, - 'extensions' => $extensions, - 'folder' => $folder, - 'isPrivateFile' => $isPrivateFile, - 'isPublished' => $isPublished, - 'overwriteAITags' => $overwriteAITags, - 'overwriteCustomMetadata' => $overwriteCustomMetadata, - 'overwriteFile' => $overwriteFile, - 'overwriteTags' => $overwriteTags, - 'publicKey' => $publicKey, - 'responseFields' => $responseFields, - 'signature' => $signature, - 'tags' => $tags, - 'transformation' => $transformation, - 'useUniqueFileName' => $useUniqueFileName, - 'webhookURL' => $webhookURL, - ]; - // @phpstan-ignore-next-line function.impossibleType - $params = array_filter($params, callback: static fn ($v) => !is_null($v)); + $params = Util::removeNulls( + [ + 'file' => $file, + 'fileName' => $fileName, + 'token' => $token, + 'checks' => $checks, + 'customCoordinates' => $customCoordinates, + 'customMetadata' => $customMetadata, + 'description' => $description, + 'expire' => $expire, + 'extensions' => $extensions, + 'folder' => $folder, + 'isPrivateFile' => $isPrivateFile, + 'isPublished' => $isPublished, + 'overwriteAITags' => $overwriteAITags, + 'overwriteCustomMetadata' => $overwriteCustomMetadata, + 'overwriteFile' => $overwriteFile, + 'overwriteTags' => $overwriteTags, + 'publicKey' => $publicKey, + 'responseFields' => $responseFields, + 'signature' => $signature, + 'tags' => $tags, + 'transformation' => $transformation, + 'useUniqueFileName' => $useUniqueFileName, + 'webhookURL' => $webhookURL, + ], + ); // @phpstan-ignore-next-line argument.type $response = $this->raw->upload(params: $params, requestOptions: $requestOptions); diff --git a/src/Services/FoldersService.php b/src/Services/FoldersService.php index f6e801aa..786c8fe3 100644 --- a/src/Services/FoldersService.php +++ b/src/Services/FoldersService.php @@ -6,6 +6,7 @@ use Imagekit\Client; use Imagekit\Core\Exceptions\APIException; +use Imagekit\Core\Util; use Imagekit\Folders\FolderCopyResponse; use Imagekit\Folders\FolderDeleteResponse; use Imagekit\Folders\FolderMoveResponse; @@ -55,9 +56,9 @@ public function create( string $parentFolderPath, ?RequestOptions $requestOptions = null, ): FolderNewResponse { - $params = [ - 'folderName' => $folderName, 'parentFolderPath' => $parentFolderPath, - ]; + $params = Util::removeNulls( + ['folderName' => $folderName, 'parentFolderPath' => $parentFolderPath] + ); // @phpstan-ignore-next-line argument.type $response = $this->raw->create(params: $params, requestOptions: $requestOptions); @@ -78,7 +79,7 @@ public function delete( string $folderPath, ?RequestOptions $requestOptions = null ): FolderDeleteResponse { - $params = ['folderPath' => $folderPath]; + $params = Util::removeNulls(['folderPath' => $folderPath]); // @phpstan-ignore-next-line argument.type $response = $this->raw->delete(params: $params, requestOptions: $requestOptions); @@ -103,13 +104,13 @@ public function copy( ?bool $includeVersions = null, ?RequestOptions $requestOptions = null, ): FolderCopyResponse { - $params = [ - 'destinationPath' => $destinationPath, - 'sourceFolderPath' => $sourceFolderPath, - 'includeVersions' => $includeVersions, - ]; - // @phpstan-ignore-next-line function.impossibleType - $params = array_filter($params, callback: static fn ($v) => !is_null($v)); + $params = Util::removeNulls( + [ + 'destinationPath' => $destinationPath, + 'sourceFolderPath' => $sourceFolderPath, + 'includeVersions' => $includeVersions, + ], + ); // @phpstan-ignore-next-line argument.type $response = $this->raw->copy(params: $params, requestOptions: $requestOptions); @@ -132,10 +133,12 @@ public function move( string $sourceFolderPath, ?RequestOptions $requestOptions = null, ): FolderMoveResponse { - $params = [ - 'destinationPath' => $destinationPath, - 'sourceFolderPath' => $sourceFolderPath, - ]; + $params = Util::removeNulls( + [ + 'destinationPath' => $destinationPath, + 'sourceFolderPath' => $sourceFolderPath, + ], + ); // @phpstan-ignore-next-line argument.type $response = $this->raw->move(params: $params, requestOptions: $requestOptions); @@ -168,13 +171,13 @@ public function rename( ?bool $purgeCache = null, ?RequestOptions $requestOptions = null, ): FolderRenameResponse { - $params = [ - 'folderPath' => $folderPath, - 'newFolderName' => $newFolderName, - 'purgeCache' => $purgeCache, - ]; - // @phpstan-ignore-next-line function.impossibleType - $params = array_filter($params, callback: static fn ($v) => !is_null($v)); + $params = Util::removeNulls( + [ + 'folderPath' => $folderPath, + 'newFolderName' => $newFolderName, + 'purgeCache' => $purgeCache, + ], + ); // @phpstan-ignore-next-line argument.type $response = $this->raw->rename(params: $params, requestOptions: $requestOptions); diff --git a/tests/Core/TestModel.php b/tests/Core/ModelTest.php similarity index 91% rename from tests/Core/TestModel.php rename to tests/Core/ModelTest.php index 0d9cc520..54c81fab 100644 --- a/tests/Core/TestModel.php +++ b/tests/Core/ModelTest.php @@ -10,7 +10,7 @@ use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; -class TestModel implements BaseModel +class Model implements BaseModel { /** @use SdkModel> */ use SdkModel; @@ -53,12 +53,12 @@ public function __construct( * @coversNothing */ #[CoversNothing] -class TestModelTest extends TestCase +class ModelTest extends TestCase { #[Test] public function testBasicGetAndSet(): void { - $model = new TestModel( + $model = new Model( name: 'Bob', ageYears: 12, owner: null, @@ -72,7 +72,7 @@ public function testBasicGetAndSet(): void #[Test] public function testNullAccess(): void { - $model = new TestModel( + $model = new Model( name: 'Bob', ageYears: 12, owner: null, @@ -84,7 +84,7 @@ public function testNullAccess(): void #[Test] public function testArrayGetAndSet(): void { - $model = new TestModel( + $model = new Model( name: 'Bob', ageYears: 12, owner: null, @@ -98,12 +98,12 @@ public function testArrayGetAndSet(): void #[Test] public function testDiscernsBetweenNullAndUnset(): void { - $modelUnsetFriends = new TestModel( + $modelUnsetFriends = new Model( name: 'Bob', ageYears: 12, owner: null, ); - $modelNullFriends = new TestModel( + $modelNullFriends = new Model( name: 'bob', ageYears: 12, owner: null, @@ -126,7 +126,7 @@ public function testDiscernsBetweenNullAndUnset(): void #[Test] public function testIssetOnOmittedProperties(): void { - $model = new TestModel( + $model = new Model( name: 'Bob', ageYears: 12, owner: null, @@ -138,7 +138,7 @@ public function testIssetOnOmittedProperties(): void #[Test] public function testSerializeBasicModel(): void { - $model = new TestModel( + $model = new Model( name: 'Bob', ageYears: 12, owner: 'Eve', @@ -153,7 +153,7 @@ public function testSerializeBasicModel(): void #[Test] public function testSerializeModelWithOmittedProperties(): void { - $model = new TestModel( + $model = new Model( name: 'Bob', ageYears: 12, owner: null, @@ -167,7 +167,7 @@ public function testSerializeModelWithOmittedProperties(): void #[Test] public function testSerializeModelWithExplicitNull(): void { - $model = new TestModel( + $model = new Model( name: 'Bob', ageYears: 12, owner: null, diff --git a/tests/Core/UtilTest.php b/tests/Core/UtilTest.php new file mode 100644 index 00000000..088effef --- /dev/null +++ b/tests/Core/UtilTest.php @@ -0,0 +1,39 @@ + $v, + ], + [ + ['a' => null, 'b' => [null, null], 'c' => ['d' => null, 'e' => 0], 'f' => ['g' => null]], + ['b' => [null, null], 'c' => ['e' => 0], 'f' => []], + static fn ($vs) => is_array($vs) && !array_is_list($vs) ? array_filter($vs, callback: static fn ($v) => !is_null($v)) : $vs, + ], + ]; + + foreach ($cases as [$input, $output, $xform]) { + $mapped = Util::mapRecursive($xform, value: $input); + $this->assertEquals($mapped, $output); + } + } +} From a29b310c8c6d916ecb9098e81ab4c1f29034e506 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 10 Dec 2025 17:38:51 +0000 Subject: [PATCH 095/193] chore: none --- src/Accounts/Origins/OriginRequest.php | 8 ++--- .../{AzureBlob.php => AzureBlobStorage.php} | 14 ++++---- .../{Gcs.php => GoogleCloudStorageGcs.php} | 14 ++++---- src/Accounts/Origins/OriginResponse.php | 8 ++--- .../{AzureBlob.php => AzureBlobStorage.php} | 12 +++---- .../{Gcs.php => GoogleCloudStorageGcs.php} | 12 +++---- .../URLEndpoints/URLEndpointCreateParams.php | 30 ++++++++++------- .../URLEndpointCreateParams/URLRewriter.php | 12 +++---- .../{Akamai.php => AkamaiURLRewriter.php} | 6 ++-- ...oudinary.php => CloudinaryURLRewriter.php} | 6 ++-- .../{Imgix.php => ImgixURLRewriter.php} | 6 ++-- .../URLEndpoints/URLEndpointRequest.php | 26 ++++++++------- .../URLEndpointRequest/URLRewriter.php | 12 +++---- .../{Akamai.php => AkamaiURLRewriter.php} | 6 ++-- ...oudinary.php => CloudinaryURLRewriter.php} | 6 ++-- .../{Imgix.php => ImgixURLRewriter.php} | 6 ++-- .../URLEndpoints/URLEndpointResponse.php | 26 ++++++++------- .../URLEndpointResponse/URLRewriter.php | 12 +++---- .../{Akamai.php => AkamaiURLRewriter.php} | 6 ++-- ...oudinary.php => CloudinaryURLRewriter.php} | 12 +++---- .../{Imgix.php => ImgixURLRewriter.php} | 6 ++-- .../URLEndpoints/URLEndpointUpdateParams.php | 30 ++++++++++------- .../URLEndpointUpdateParams/URLRewriter.php | 12 +++---- .../{Akamai.php => AkamaiURLRewriter.php} | 6 ++-- ...oudinary.php => CloudinaryURLRewriter.php} | 6 ++-- .../{Imgix.php => ImgixURLRewriter.php} | 6 ++-- src/Beta/V2/Files/FileUploadParams.php | 33 ++++++++++--------- .../Files/FileUploadParams/Transformation.php | 33 ++++++++++++------- .../FileUploadParams/Transformation/Post.php | 16 ++++----- .../{Abs.php => AdaptiveBitrateStreaming.php} | 14 ++++---- .../Protocol.php | 2 +- .../{GifToVideo.php => ConvertGifToVideo.php} | 6 ++-- .../{Thumbnail.php => GenerateAThumbnail.php} | 8 +++-- ...ation.php => SimplePostTransformation.php} | 12 +++---- src/ExtensionItem.php | 8 ++--- ...ption.php => AutoDescriptionExtension.php} | 8 +++-- ...{RemoveBg.php => RemovedotBgExtension.php} | 10 +++--- .../Options.php | 2 +- src/Files/FileUpdateParams.php | 20 +++++------ src/Files/FileUploadParams.php | 33 ++++++++++--------- src/Files/FileUploadParams/Transformation.php | 33 ++++++++++++------- .../FileUploadParams/Transformation/Post.php | 16 ++++----- .../{Abs.php => AdaptiveBitrateStreaming.php} | 14 ++++---- .../Protocol.php | 2 +- .../{GifToVideo.php => ConvertGifToVideo.php} | 6 ++-- .../{Thumbnail.php => GenerateAThumbnail.php} | 8 +++-- ...ation.php => SimplePostTransformation.php} | 12 +++---- .../UpdateFileRequest/UpdateFileDetails.php | 18 +++++----- .../Accounts/OriginsContract.php | 12 +++---- .../Accounts/OriginsRawContract.php | 12 +++---- src/Services/Accounts/OriginsRawService.php | 12 +++---- src/Services/Accounts/OriginsService.php | 12 +++---- 52 files changed, 360 insertions(+), 308 deletions(-) rename src/Accounts/Origins/OriginRequest/{AzureBlob.php => AzureBlobStorage.php} (91%) rename src/Accounts/Origins/OriginRequest/{Gcs.php => GoogleCloudStorageGcs.php} (90%) rename src/Accounts/Origins/OriginResponse/{AzureBlob.php => AzureBlobStorage.php} (93%) rename src/Accounts/Origins/OriginResponse/{Gcs.php => GoogleCloudStorageGcs.php} (93%) rename src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/{Akamai.php => AkamaiURLRewriter.php} (80%) rename src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/{Cloudinary.php => CloudinaryURLRewriter.php} (90%) rename src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/{Imgix.php => ImgixURLRewriter.php} (80%) rename src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/{Akamai.php => AkamaiURLRewriter.php} (80%) rename src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/{Cloudinary.php => CloudinaryURLRewriter.php} (90%) rename src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/{Imgix.php => ImgixURLRewriter.php} (80%) rename src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/{Akamai.php => AkamaiURLRewriter.php} (80%) rename src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/{Cloudinary.php => CloudinaryURLRewriter.php} (80%) rename src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/{Imgix.php => ImgixURLRewriter.php} (80%) rename src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/{Akamai.php => AkamaiURLRewriter.php} (80%) rename src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/{Cloudinary.php => CloudinaryURLRewriter.php} (90%) rename src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/{Imgix.php => ImgixURLRewriter.php} (80%) rename src/Beta/V2/Files/FileUploadParams/Transformation/Post/{Abs.php => AdaptiveBitrateStreaming.php} (83%) rename src/Beta/V2/Files/FileUploadParams/Transformation/Post/{Abs => AdaptiveBitrateStreaming}/Protocol.php (87%) rename src/Beta/V2/Files/FileUploadParams/Transformation/Post/{GifToVideo.php => ConvertGifToVideo.php} (90%) rename src/Beta/V2/Files/FileUploadParams/Transformation/Post/{Thumbnail.php => GenerateAThumbnail.php} (85%) rename src/Beta/V2/Files/FileUploadParams/Transformation/Post/{Transformation.php => SimplePostTransformation.php} (80%) rename src/ExtensionItem/{AIAutoDescription.php => AutoDescriptionExtension.php} (77%) rename src/ExtensionItem/{RemoveBg.php => RemovedotBgExtension.php} (84%) rename src/ExtensionItem/{RemoveBg => RemovedotBgExtension}/Options.php (98%) rename src/Files/FileUploadParams/Transformation/Post/{Abs.php => AdaptiveBitrateStreaming.php} (80%) rename src/Files/FileUploadParams/Transformation/Post/{Abs => AdaptiveBitrateStreaming}/Protocol.php (64%) rename src/Files/FileUploadParams/Transformation/Post/{GifToVideo.php => ConvertGifToVideo.php} (89%) rename src/Files/FileUploadParams/Transformation/Post/{Thumbnail.php => GenerateAThumbnail.php} (85%) rename src/Files/FileUploadParams/Transformation/Post/{Transformation.php => SimplePostTransformation.php} (80%) diff --git a/src/Accounts/Origins/OriginRequest.php b/src/Accounts/Origins/OriginRequest.php index e9317273..1cf1f279 100644 --- a/src/Accounts/Origins/OriginRequest.php +++ b/src/Accounts/Origins/OriginRequest.php @@ -5,9 +5,9 @@ namespace Imagekit\Accounts\Origins; use Imagekit\Accounts\Origins\OriginRequest\AkeneoPim; -use Imagekit\Accounts\Origins\OriginRequest\AzureBlob; +use Imagekit\Accounts\Origins\OriginRequest\AzureBlobStorage; use Imagekit\Accounts\Origins\OriginRequest\CloudinaryBackup; -use Imagekit\Accounts\Origins\OriginRequest\Gcs; +use Imagekit\Accounts\Origins\OriginRequest\GoogleCloudStorageGcs; use Imagekit\Accounts\Origins\OriginRequest\S3; use Imagekit\Accounts\Origins\OriginRequest\S3Compatible; use Imagekit\Accounts\Origins\OriginRequest\WebFolder; @@ -39,8 +39,8 @@ public static function variants(): array 'CLOUDINARY_BACKUP' => CloudinaryBackup::class, 'WEB_FOLDER' => WebFolder::class, 'WEB_PROXY' => WebProxy::class, - 'GCS' => Gcs::class, - 'AZURE_BLOB' => AzureBlob::class, + 'GCS' => GoogleCloudStorageGcs::class, + 'AZURE_BLOB' => AzureBlobStorage::class, 'AKENEO_PIM' => AkeneoPim::class, ]; } diff --git a/src/Accounts/Origins/OriginRequest/AzureBlob.php b/src/Accounts/Origins/OriginRequest/AzureBlobStorage.php similarity index 91% rename from src/Accounts/Origins/OriginRequest/AzureBlob.php rename to src/Accounts/Origins/OriginRequest/AzureBlobStorage.php index c20498b3..eb0b2e5f 100644 --- a/src/Accounts/Origins/OriginRequest/AzureBlob.php +++ b/src/Accounts/Origins/OriginRequest/AzureBlobStorage.php @@ -10,7 +10,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type AzureBlobShape = array{ + * @phpstan-type AzureBlobStorageShape = array{ * accountName: string, * container: string, * name: string, @@ -21,9 +21,9 @@ * prefix?: string|null, * } */ -final class AzureBlob implements BaseModel +final class AzureBlobStorage implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @var 'AZURE_BLOB' $type */ @@ -61,17 +61,19 @@ final class AzureBlob implements BaseModel public ?string $prefix; /** - * `new AzureBlob()` is missing required properties by the API. + * `new AzureBlobStorage()` is missing required properties by the API. * * To enforce required parameters use * ``` - * AzureBlob::with(accountName: ..., container: ..., name: ..., sasToken: ...) + * AzureBlobStorage::with( + * accountName: ..., container: ..., name: ..., sasToken: ... + * ) * ``` * * Otherwise ensure the following setters are called * * ``` - * (new AzureBlob) + * (new AzureBlobStorage) * ->withAccountName(...) * ->withContainer(...) * ->withName(...) diff --git a/src/Accounts/Origins/OriginRequest/Gcs.php b/src/Accounts/Origins/OriginRequest/GoogleCloudStorageGcs.php similarity index 90% rename from src/Accounts/Origins/OriginRequest/Gcs.php rename to src/Accounts/Origins/OriginRequest/GoogleCloudStorageGcs.php index 5e7f2728..ae2fb5ed 100644 --- a/src/Accounts/Origins/OriginRequest/Gcs.php +++ b/src/Accounts/Origins/OriginRequest/GoogleCloudStorageGcs.php @@ -10,7 +10,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type GcsShape = array{ + * @phpstan-type GoogleCloudStorageGcsShape = array{ * bucket: string, * clientEmail: string, * name: string, @@ -21,9 +21,9 @@ * prefix?: string|null, * } */ -final class Gcs implements BaseModel +final class GoogleCloudStorageGcs implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @var 'GCS' $type */ @@ -61,17 +61,19 @@ final class Gcs implements BaseModel public ?string $prefix; /** - * `new Gcs()` is missing required properties by the API. + * `new GoogleCloudStorageGcs()` is missing required properties by the API. * * To enforce required parameters use * ``` - * Gcs::with(bucket: ..., clientEmail: ..., name: ..., privateKey: ...) + * GoogleCloudStorageGcs::with( + * bucket: ..., clientEmail: ..., name: ..., privateKey: ... + * ) * ``` * * Otherwise ensure the following setters are called * * ``` - * (new Gcs) + * (new GoogleCloudStorageGcs) * ->withBucket(...) * ->withClientEmail(...) * ->withName(...) diff --git a/src/Accounts/Origins/OriginResponse.php b/src/Accounts/Origins/OriginResponse.php index 8d39b427..2e6c5539 100644 --- a/src/Accounts/Origins/OriginResponse.php +++ b/src/Accounts/Origins/OriginResponse.php @@ -5,9 +5,9 @@ namespace Imagekit\Accounts\Origins; use Imagekit\Accounts\Origins\OriginResponse\AkeneoPim; -use Imagekit\Accounts\Origins\OriginResponse\AzureBlob; +use Imagekit\Accounts\Origins\OriginResponse\AzureBlobStorage; use Imagekit\Accounts\Origins\OriginResponse\CloudinaryBackup; -use Imagekit\Accounts\Origins\OriginResponse\Gcs; +use Imagekit\Accounts\Origins\OriginResponse\GoogleCloudStorageGcs; use Imagekit\Accounts\Origins\OriginResponse\S3; use Imagekit\Accounts\Origins\OriginResponse\S3Compatible; use Imagekit\Accounts\Origins\OriginResponse\WebFolder; @@ -39,8 +39,8 @@ public static function variants(): array 'CLOUDINARY_BACKUP' => CloudinaryBackup::class, 'WEB_FOLDER' => WebFolder::class, 'WEB_PROXY' => WebProxy::class, - 'GCS' => Gcs::class, - 'AZURE_BLOB' => AzureBlob::class, + 'GCS' => GoogleCloudStorageGcs::class, + 'AZURE_BLOB' => AzureBlobStorage::class, 'AKENEO_PIM' => AkeneoPim::class, ]; } diff --git a/src/Accounts/Origins/OriginResponse/AzureBlob.php b/src/Accounts/Origins/OriginResponse/AzureBlobStorage.php similarity index 93% rename from src/Accounts/Origins/OriginResponse/AzureBlob.php rename to src/Accounts/Origins/OriginResponse/AzureBlobStorage.php index 81f80431..b7766a6b 100644 --- a/src/Accounts/Origins/OriginResponse/AzureBlob.php +++ b/src/Accounts/Origins/OriginResponse/AzureBlobStorage.php @@ -10,7 +10,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type AzureBlobShape = array{ + * @phpstan-type AzureBlobStorageShape = array{ * id: string, * accountName: string, * container: string, @@ -21,9 +21,9 @@ * baseURLForCanonicalHeader?: string|null, * } */ -final class AzureBlob implements BaseModel +final class AzureBlobStorage implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @var 'AZURE_BLOB' $type */ @@ -64,11 +64,11 @@ final class AzureBlob implements BaseModel public ?string $baseURLForCanonicalHeader; /** - * `new AzureBlob()` is missing required properties by the API. + * `new AzureBlobStorage()` is missing required properties by the API. * * To enforce required parameters use * ``` - * AzureBlob::with( + * AzureBlobStorage::with( * id: ..., * accountName: ..., * container: ..., @@ -81,7 +81,7 @@ final class AzureBlob implements BaseModel * Otherwise ensure the following setters are called * * ``` - * (new AzureBlob) + * (new AzureBlobStorage) * ->withID(...) * ->withAccountName(...) * ->withContainer(...) diff --git a/src/Accounts/Origins/OriginResponse/Gcs.php b/src/Accounts/Origins/OriginResponse/GoogleCloudStorageGcs.php similarity index 93% rename from src/Accounts/Origins/OriginResponse/Gcs.php rename to src/Accounts/Origins/OriginResponse/GoogleCloudStorageGcs.php index 276c4b40..fba52c9c 100644 --- a/src/Accounts/Origins/OriginResponse/Gcs.php +++ b/src/Accounts/Origins/OriginResponse/GoogleCloudStorageGcs.php @@ -10,7 +10,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type GcsShape = array{ + * @phpstan-type GoogleCloudStorageGcsShape = array{ * id: string, * bucket: string, * clientEmail: string, @@ -21,9 +21,9 @@ * baseURLForCanonicalHeader?: string|null, * } */ -final class Gcs implements BaseModel +final class GoogleCloudStorageGcs implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @var 'GCS' $type */ @@ -64,11 +64,11 @@ final class Gcs implements BaseModel public ?string $baseURLForCanonicalHeader; /** - * `new Gcs()` is missing required properties by the API. + * `new GoogleCloudStorageGcs()` is missing required properties by the API. * * To enforce required parameters use * ``` - * Gcs::with( + * GoogleCloudStorageGcs::with( * id: ..., * bucket: ..., * clientEmail: ..., @@ -81,7 +81,7 @@ final class Gcs implements BaseModel * Otherwise ensure the following setters are called * * ``` - * (new Gcs) + * (new GoogleCloudStorageGcs) * ->withID(...) * ->withBucket(...) * ->withClientEmail(...) diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php index f2a4a13f..7507d7d8 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php @@ -5,9 +5,9 @@ namespace Imagekit\Accounts\URLEndpoints; use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Akamai; -use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Cloudinary; -use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Imgix; +use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\AkamaiURLRewriter; +use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\CloudinaryURLRewriter; +use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\ImgixURLRewriter; use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; @@ -24,9 +24,11 @@ * description: string, * origins?: list, * urlPrefix?: string, - * urlRewriter?: Cloudinary|array{ + * urlRewriter?: CloudinaryURLRewriter|array{ * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null - * }|Imgix|array{type?: 'IMGIX'}|Akamai|array{type?: 'AKAMAI'}, + * }|ImgixURLRewriter|array{type?: 'IMGIX'}|AkamaiURLRewriter|array{ + * type?: 'AKAMAI' + * }, * } */ final class URLEndpointCreateParams implements BaseModel @@ -59,7 +61,7 @@ final class URLEndpointCreateParams implements BaseModel * Configuration for third-party URL rewriting. */ #[Optional(union: URLRewriter::class)] - public Cloudinary|Imgix|Akamai|null $urlRewriter; + public CloudinaryURLRewriter|ImgixURLRewriter|AkamaiURLRewriter|null $urlRewriter; /** * `new URLEndpointCreateParams()` is missing required properties by the API. @@ -86,15 +88,17 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param list $origins - * @param Cloudinary|array{ + * @param CloudinaryURLRewriter|array{ * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null - * }|Imgix|array{type?: 'IMGIX'}|Akamai|array{type?: 'AKAMAI'} $urlRewriter + * }|ImgixURLRewriter|array{type?: 'IMGIX'}|AkamaiURLRewriter|array{ + * type?: 'AKAMAI' + * } $urlRewriter */ public static function with( string $description, ?array $origins = null, ?string $urlPrefix = null, - Cloudinary|array|Imgix|Akamai|null $urlRewriter = null, + CloudinaryURLRewriter|array|ImgixURLRewriter|AkamaiURLRewriter|null $urlRewriter = null, ): self { $self = new self; @@ -145,12 +149,14 @@ public function withURLPrefix(string $urlPrefix): self /** * Configuration for third-party URL rewriting. * - * @param Cloudinary|array{ + * @param CloudinaryURLRewriter|array{ * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null - * }|Imgix|array{type?: 'IMGIX'}|Akamai|array{type?: 'AKAMAI'} $urlRewriter + * }|ImgixURLRewriter|array{type?: 'IMGIX'}|AkamaiURLRewriter|array{ + * type?: 'AKAMAI' + * } $urlRewriter */ public function withURLRewriter( - Cloudinary|array|Imgix|Akamai $urlRewriter + CloudinaryURLRewriter|array|ImgixURLRewriter|AkamaiURLRewriter $urlRewriter ): self { $self = clone $this; $self['urlRewriter'] = $urlRewriter; diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php index 802940d1..951b2802 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php @@ -4,9 +4,9 @@ namespace Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams; -use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Akamai; -use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Cloudinary; -use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\Imgix; +use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\AkamaiURLRewriter; +use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\CloudinaryURLRewriter; +use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\ImgixURLRewriter; use Imagekit\Core\Concerns\SdkUnion; use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; @@ -29,9 +29,9 @@ public static function discriminator(): string public static function variants(): array { return [ - 'CLOUDINARY' => Cloudinary::class, - 'IMGIX' => Imgix::class, - 'AKAMAI' => Akamai::class, + 'CLOUDINARY' => CloudinaryURLRewriter::class, + 'IMGIX' => ImgixURLRewriter::class, + 'AKAMAI' => AkamaiURLRewriter::class, ]; } } diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/AkamaiURLRewriter.php similarity index 80% rename from src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php rename to src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/AkamaiURLRewriter.php index b2cb0c21..250a1195 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/AkamaiURLRewriter.php @@ -9,11 +9,11 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type AkamaiShape = array{type?: 'AKAMAI'} + * @phpstan-type AkamaiURLRewriterShape = array{type?: 'AKAMAI'} */ -final class Akamai implements BaseModel +final class AkamaiURLRewriter implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @var 'AKAMAI' $type */ diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/CloudinaryURLRewriter.php similarity index 90% rename from src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php rename to src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/CloudinaryURLRewriter.php index 31f60f9c..067f0134 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/CloudinaryURLRewriter.php @@ -10,13 +10,13 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type CloudinaryShape = array{ + * @phpstan-type CloudinaryURLRewriterShape = array{ * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null * } */ -final class Cloudinary implements BaseModel +final class CloudinaryURLRewriter implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @var 'CLOUDINARY' $type */ diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/ImgixURLRewriter.php similarity index 80% rename from src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php rename to src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/ImgixURLRewriter.php index ff5cdaf7..3d02bf72 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/ImgixURLRewriter.php @@ -9,11 +9,11 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type ImgixShape = array{type?: 'IMGIX'} + * @phpstan-type ImgixURLRewriterShape = array{type?: 'IMGIX'} */ -final class Imgix implements BaseModel +final class ImgixURLRewriter implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @var 'IMGIX' $type */ diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest.php b/src/Accounts/URLEndpoints/URLEndpointRequest.php index b0a9463b..a2c46916 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest.php @@ -5,9 +5,9 @@ namespace Imagekit\Accounts\URLEndpoints; use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\Akamai; -use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\Cloudinary; -use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\Imgix; +use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\AkamaiURLRewriter; +use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\CloudinaryURLRewriter; +use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\ImgixURLRewriter; use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; @@ -20,7 +20,7 @@ * description: string, * origins?: list|null, * urlPrefix?: string|null, - * urlRewriter?: null|Cloudinary|Imgix|Akamai, + * urlRewriter?: null|CloudinaryURLRewriter|ImgixURLRewriter|AkamaiURLRewriter, * } */ final class URLEndpointRequest implements BaseModel @@ -52,7 +52,7 @@ final class URLEndpointRequest implements BaseModel * Configuration for third-party URL rewriting. */ #[Optional(union: URLRewriter::class)] - public Cloudinary|Imgix|Akamai|null $urlRewriter; + public CloudinaryURLRewriter|ImgixURLRewriter|AkamaiURLRewriter|null $urlRewriter; /** * `new URLEndpointRequest()` is missing required properties by the API. @@ -79,15 +79,17 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param list $origins - * @param Cloudinary|array{ + * @param CloudinaryURLRewriter|array{ * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null - * }|Imgix|array{type?: 'IMGIX'}|Akamai|array{type?: 'AKAMAI'} $urlRewriter + * }|ImgixURLRewriter|array{type?: 'IMGIX'}|AkamaiURLRewriter|array{ + * type?: 'AKAMAI' + * } $urlRewriter */ public static function with( string $description, ?array $origins = null, ?string $urlPrefix = null, - Cloudinary|array|Imgix|Akamai|null $urlRewriter = null, + CloudinaryURLRewriter|array|ImgixURLRewriter|AkamaiURLRewriter|null $urlRewriter = null, ): self { $self = new self; @@ -138,12 +140,14 @@ public function withURLPrefix(string $urlPrefix): self /** * Configuration for third-party URL rewriting. * - * @param Cloudinary|array{ + * @param CloudinaryURLRewriter|array{ * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null - * }|Imgix|array{type?: 'IMGIX'}|Akamai|array{type?: 'AKAMAI'} $urlRewriter + * }|ImgixURLRewriter|array{type?: 'IMGIX'}|AkamaiURLRewriter|array{ + * type?: 'AKAMAI' + * } $urlRewriter */ public function withURLRewriter( - Cloudinary|array|Imgix|Akamai $urlRewriter + CloudinaryURLRewriter|array|ImgixURLRewriter|AkamaiURLRewriter $urlRewriter ): self { $self = clone $this; $self['urlRewriter'] = $urlRewriter; diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php index 5d1af17a..50c55d13 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php @@ -4,9 +4,9 @@ namespace Imagekit\Accounts\URLEndpoints\URLEndpointRequest; -use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\Akamai; -use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\Cloudinary; -use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\Imgix; +use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\AkamaiURLRewriter; +use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\CloudinaryURLRewriter; +use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\ImgixURLRewriter; use Imagekit\Core\Concerns\SdkUnion; use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; @@ -29,9 +29,9 @@ public static function discriminator(): string public static function variants(): array { return [ - 'CLOUDINARY' => Cloudinary::class, - 'IMGIX' => Imgix::class, - 'AKAMAI' => Akamai::class, + 'CLOUDINARY' => CloudinaryURLRewriter::class, + 'IMGIX' => ImgixURLRewriter::class, + 'AKAMAI' => AkamaiURLRewriter::class, ]; } } diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/AkamaiURLRewriter.php similarity index 80% rename from src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php rename to src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/AkamaiURLRewriter.php index 1e0bec69..72241fe9 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/AkamaiURLRewriter.php @@ -9,11 +9,11 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type AkamaiShape = array{type?: 'AKAMAI'} + * @phpstan-type AkamaiURLRewriterShape = array{type?: 'AKAMAI'} */ -final class Akamai implements BaseModel +final class AkamaiURLRewriter implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @var 'AKAMAI' $type */ diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/CloudinaryURLRewriter.php similarity index 90% rename from src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php rename to src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/CloudinaryURLRewriter.php index 34113a26..a94701b0 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/CloudinaryURLRewriter.php @@ -10,13 +10,13 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type CloudinaryShape = array{ + * @phpstan-type CloudinaryURLRewriterShape = array{ * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null * } */ -final class Cloudinary implements BaseModel +final class CloudinaryURLRewriter implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @var 'CLOUDINARY' $type */ diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/ImgixURLRewriter.php similarity index 80% rename from src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php rename to src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/ImgixURLRewriter.php index 0a676082..f4df9bf5 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/ImgixURLRewriter.php @@ -9,11 +9,11 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type ImgixShape = array{type?: 'IMGIX'} + * @phpstan-type ImgixURLRewriterShape = array{type?: 'IMGIX'} */ -final class Imgix implements BaseModel +final class ImgixURLRewriter implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @var 'IMGIX' $type */ diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse.php b/src/Accounts/URLEndpoints/URLEndpointResponse.php index 9610863f..0f3ea3d9 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse.php @@ -5,9 +5,9 @@ namespace Imagekit\Accounts\URLEndpoints; use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\Akamai; -use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\Cloudinary; -use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\Imgix; +use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\AkamaiURLRewriter; +use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\CloudinaryURLRewriter; +use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\ImgixURLRewriter; use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; @@ -21,7 +21,7 @@ * description: string, * origins: list, * urlPrefix: string, - * urlRewriter?: null|Cloudinary|Imgix|Akamai, + * urlRewriter?: null|CloudinaryURLRewriter|ImgixURLRewriter|AkamaiURLRewriter, * } */ final class URLEndpointResponse implements BaseModel @@ -59,7 +59,7 @@ final class URLEndpointResponse implements BaseModel * Configuration for third-party URL rewriting. */ #[Optional(union: URLRewriter::class)] - public Cloudinary|Imgix|Akamai|null $urlRewriter; + public CloudinaryURLRewriter|ImgixURLRewriter|AkamaiURLRewriter|null $urlRewriter; /** * `new URLEndpointResponse()` is missing required properties by the API. @@ -92,16 +92,18 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param list $origins - * @param Cloudinary|array{ + * @param CloudinaryURLRewriter|array{ * preserveAssetDeliveryTypes: bool, type?: 'CLOUDINARY' - * }|Imgix|array{type?: 'IMGIX'}|Akamai|array{type?: 'AKAMAI'} $urlRewriter + * }|ImgixURLRewriter|array{type?: 'IMGIX'}|AkamaiURLRewriter|array{ + * type?: 'AKAMAI' + * } $urlRewriter */ public static function with( string $id, string $description, array $origins = [], string $urlPrefix = '', - Cloudinary|array|Imgix|Akamai|null $urlRewriter = null, + CloudinaryURLRewriter|array|ImgixURLRewriter|AkamaiURLRewriter|null $urlRewriter = null, ): self { $self = new self; @@ -164,12 +166,14 @@ public function withURLPrefix(string $urlPrefix): self /** * Configuration for third-party URL rewriting. * - * @param Cloudinary|array{ + * @param CloudinaryURLRewriter|array{ * preserveAssetDeliveryTypes: bool, type?: 'CLOUDINARY' - * }|Imgix|array{type?: 'IMGIX'}|Akamai|array{type?: 'AKAMAI'} $urlRewriter + * }|ImgixURLRewriter|array{type?: 'IMGIX'}|AkamaiURLRewriter|array{ + * type?: 'AKAMAI' + * } $urlRewriter */ public function withURLRewriter( - Cloudinary|array|Imgix|Akamai $urlRewriter + CloudinaryURLRewriter|array|ImgixURLRewriter|AkamaiURLRewriter $urlRewriter ): self { $self = clone $this; $self['urlRewriter'] = $urlRewriter; diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php index 89243e87..d288d6dc 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php @@ -4,9 +4,9 @@ namespace Imagekit\Accounts\URLEndpoints\URLEndpointResponse; -use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\Akamai; -use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\Cloudinary; -use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\Imgix; +use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\AkamaiURLRewriter; +use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\CloudinaryURLRewriter; +use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\ImgixURLRewriter; use Imagekit\Core\Concerns\SdkUnion; use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; @@ -29,9 +29,9 @@ public static function discriminator(): string public static function variants(): array { return [ - 'CLOUDINARY' => Cloudinary::class, - 'IMGIX' => Imgix::class, - 'AKAMAI' => Akamai::class, + 'CLOUDINARY' => CloudinaryURLRewriter::class, + 'IMGIX' => ImgixURLRewriter::class, + 'AKAMAI' => AkamaiURLRewriter::class, ]; } } diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/AkamaiURLRewriter.php similarity index 80% rename from src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php rename to src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/AkamaiURLRewriter.php index 2b4608bb..29de7afb 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/AkamaiURLRewriter.php @@ -9,11 +9,11 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type AkamaiShape = array{type?: 'AKAMAI'} + * @phpstan-type AkamaiURLRewriterShape = array{type?: 'AKAMAI'} */ -final class Akamai implements BaseModel +final class AkamaiURLRewriter implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @var 'AKAMAI' $type */ diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/CloudinaryURLRewriter.php similarity index 80% rename from src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php rename to src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/CloudinaryURLRewriter.php index c4239206..93d28791 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/CloudinaryURLRewriter.php @@ -9,13 +9,13 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type CloudinaryShape = array{ + * @phpstan-type CloudinaryURLRewriterShape = array{ * preserveAssetDeliveryTypes: bool, type?: 'CLOUDINARY' * } */ -final class Cloudinary implements BaseModel +final class CloudinaryURLRewriter implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @var 'CLOUDINARY' $type */ @@ -29,17 +29,17 @@ final class Cloudinary implements BaseModel public bool $preserveAssetDeliveryTypes; /** - * `new Cloudinary()` is missing required properties by the API. + * `new CloudinaryURLRewriter()` is missing required properties by the API. * * To enforce required parameters use * ``` - * Cloudinary::with(preserveAssetDeliveryTypes: ...) + * CloudinaryURLRewriter::with(preserveAssetDeliveryTypes: ...) * ``` * * Otherwise ensure the following setters are called * * ``` - * (new Cloudinary)->withPreserveAssetDeliveryTypes(...) + * (new CloudinaryURLRewriter)->withPreserveAssetDeliveryTypes(...) * ``` */ public function __construct() diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/ImgixURLRewriter.php similarity index 80% rename from src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php rename to src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/ImgixURLRewriter.php index 31383d9d..7b50e2d2 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/ImgixURLRewriter.php @@ -9,11 +9,11 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type ImgixShape = array{type?: 'IMGIX'} + * @phpstan-type ImgixURLRewriterShape = array{type?: 'IMGIX'} */ -final class Imgix implements BaseModel +final class ImgixURLRewriter implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @var 'IMGIX' $type */ diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php index 102d0ef8..2dff6217 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php @@ -5,9 +5,9 @@ namespace Imagekit\Accounts\URLEndpoints; use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Akamai; -use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Cloudinary; -use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Imgix; +use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\AkamaiURLRewriter; +use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\CloudinaryURLRewriter; +use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\ImgixURLRewriter; use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; @@ -24,9 +24,11 @@ * description: string, * origins?: list, * urlPrefix?: string, - * urlRewriter?: Cloudinary|array{ + * urlRewriter?: CloudinaryURLRewriter|array{ * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null - * }|Imgix|array{type?: 'IMGIX'}|Akamai|array{type?: 'AKAMAI'}, + * }|ImgixURLRewriter|array{type?: 'IMGIX'}|AkamaiURLRewriter|array{ + * type?: 'AKAMAI' + * }, * } */ final class URLEndpointUpdateParams implements BaseModel @@ -59,7 +61,7 @@ final class URLEndpointUpdateParams implements BaseModel * Configuration for third-party URL rewriting. */ #[Optional(union: URLRewriter::class)] - public Cloudinary|Imgix|Akamai|null $urlRewriter; + public CloudinaryURLRewriter|ImgixURLRewriter|AkamaiURLRewriter|null $urlRewriter; /** * `new URLEndpointUpdateParams()` is missing required properties by the API. @@ -86,15 +88,17 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param list $origins - * @param Cloudinary|array{ + * @param CloudinaryURLRewriter|array{ * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null - * }|Imgix|array{type?: 'IMGIX'}|Akamai|array{type?: 'AKAMAI'} $urlRewriter + * }|ImgixURLRewriter|array{type?: 'IMGIX'}|AkamaiURLRewriter|array{ + * type?: 'AKAMAI' + * } $urlRewriter */ public static function with( string $description, ?array $origins = null, ?string $urlPrefix = null, - Cloudinary|array|Imgix|Akamai|null $urlRewriter = null, + CloudinaryURLRewriter|array|ImgixURLRewriter|AkamaiURLRewriter|null $urlRewriter = null, ): self { $self = new self; @@ -145,12 +149,14 @@ public function withURLPrefix(string $urlPrefix): self /** * Configuration for third-party URL rewriting. * - * @param Cloudinary|array{ + * @param CloudinaryURLRewriter|array{ * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null - * }|Imgix|array{type?: 'IMGIX'}|Akamai|array{type?: 'AKAMAI'} $urlRewriter + * }|ImgixURLRewriter|array{type?: 'IMGIX'}|AkamaiURLRewriter|array{ + * type?: 'AKAMAI' + * } $urlRewriter */ public function withURLRewriter( - Cloudinary|array|Imgix|Akamai $urlRewriter + CloudinaryURLRewriter|array|ImgixURLRewriter|AkamaiURLRewriter $urlRewriter ): self { $self = clone $this; $self['urlRewriter'] = $urlRewriter; diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php index c6a05390..cf468261 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php @@ -4,9 +4,9 @@ namespace Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams; -use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Akamai; -use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Cloudinary; -use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\Imgix; +use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\AkamaiURLRewriter; +use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\CloudinaryURLRewriter; +use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\ImgixURLRewriter; use Imagekit\Core\Concerns\SdkUnion; use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; @@ -29,9 +29,9 @@ public static function discriminator(): string public static function variants(): array { return [ - 'CLOUDINARY' => Cloudinary::class, - 'IMGIX' => Imgix::class, - 'AKAMAI' => Akamai::class, + 'CLOUDINARY' => CloudinaryURLRewriter::class, + 'IMGIX' => ImgixURLRewriter::class, + 'AKAMAI' => AkamaiURLRewriter::class, ]; } } diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/AkamaiURLRewriter.php similarity index 80% rename from src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php rename to src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/AkamaiURLRewriter.php index 27a12490..d2f4b776 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Akamai.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/AkamaiURLRewriter.php @@ -9,11 +9,11 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type AkamaiShape = array{type?: 'AKAMAI'} + * @phpstan-type AkamaiURLRewriterShape = array{type?: 'AKAMAI'} */ -final class Akamai implements BaseModel +final class AkamaiURLRewriter implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @var 'AKAMAI' $type */ diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/CloudinaryURLRewriter.php similarity index 90% rename from src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php rename to src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/CloudinaryURLRewriter.php index 18f80cd3..05eb3aea 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Cloudinary.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/CloudinaryURLRewriter.php @@ -10,13 +10,13 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type CloudinaryShape = array{ + * @phpstan-type CloudinaryURLRewriterShape = array{ * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null * } */ -final class Cloudinary implements BaseModel +final class CloudinaryURLRewriter implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @var 'CLOUDINARY' $type */ diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/ImgixURLRewriter.php similarity index 80% rename from src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php rename to src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/ImgixURLRewriter.php index 90e481f4..e4076243 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/Imgix.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/ImgixURLRewriter.php @@ -9,11 +9,11 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type ImgixShape = array{type?: 'IMGIX'} + * @phpstan-type ImgixURLRewriterShape = array{type?: 'IMGIX'} */ -final class Imgix implements BaseModel +final class ImgixURLRewriter implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @var 'IMGIX' $type */ diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index 0d6b86f1..6b239f15 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -6,20 +6,21 @@ use Imagekit\Beta\V2\Files\FileUploadParams\ResponseField; use Imagekit\Beta\V2\Files\FileUploadParams\Transformation; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\GifToVideo; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Thumbnail; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\ConvertGifToVideo; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\SimplePostTransformation; use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; use Imagekit\ExtensionItem; -use Imagekit\ExtensionItem\AIAutoDescription; +use Imagekit\ExtensionItem\AutoDescriptionExtension; use Imagekit\ExtensionItem\AutoTaggingExtension; use Imagekit\ExtensionItem\AutoTaggingExtension\Name; -use Imagekit\ExtensionItem\RemoveBg; -use Imagekit\ExtensionItem\RemoveBg\Options; +use Imagekit\ExtensionItem\RemovedotBgExtension; +use Imagekit\ExtensionItem\RemovedotBgExtension\Options; /** * The V2 API enhances security by verifying the entire payload using JWT. This API is in beta. @@ -47,11 +48,11 @@ * customCoordinates?: string, * customMetadata?: array, * description?: string, - * extensions?: list - * }|AIAutoDescription|array{name?: 'ai-auto-description'}>, + * }|AutoDescriptionExtension|array{name?: 'ai-auto-description'}>, * folder?: string, * isPrivateFile?: bool, * isPublished?: bool, @@ -62,7 +63,7 @@ * responseFields?: list>, * tags?: list, * transformation?: Transformation|array{ - * post?: list<\Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Transformation|GifToVideo|Thumbnail|Abs>|null, + * post?: list|null, * pre?: string|null, * }, * useUniqueFileName?: bool, @@ -138,7 +139,7 @@ final class FileUploadParams implements BaseModel /** * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * - * @var list|null $extensions + * @var list|null $extensions */ #[Optional(list: ExtensionItem::class)] public ?array $extensions; @@ -264,15 +265,15 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param array $customMetadata - * @param list - * }|AIAutoDescription|array{name?: 'ai-auto-description'}> $extensions + * }|AutoDescriptionExtension|array{name?: 'ai-auto-description'}> $extensions * @param list> $responseFields * @param list $tags * @param Transformation|array{ - * post?: list|null, + * post?: list|null, * pre?: string|null, * } $transformation */ @@ -423,11 +424,11 @@ public function withDescription(string $description): self /** * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * - * @param list - * }|AIAutoDescription|array{name?: 'ai-auto-description'}> $extensions + * }|AutoDescriptionExtension|array{name?: 'ai-auto-description'}> $extensions */ public function withExtensions(array $extensions): self { @@ -561,7 +562,7 @@ public function withTags(array $tags): self * You can mix and match any combination of post-processing types. * * @param Transformation|array{ - * post?: list|null, + * post?: list|null, * pre?: string|null, * } $transformation */ diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation.php index c5abfd84..ea027afb 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation.php @@ -5,10 +5,11 @@ namespace Imagekit\Beta\V2\Files\FileUploadParams; use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs\Protocol; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\GifToVideo; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Thumbnail; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming\Protocol; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\ConvertGifToVideo; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\SimplePostTransformation; use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -25,7 +26,7 @@ * You can mix and match any combination of post-processing types. * * @phpstan-type TransformationShape = array{ - * post?: list<\Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Transformation|GifToVideo|Thumbnail|Abs>|null, + * post?: list|null, * pre?: string|null, * } */ @@ -39,7 +40,7 @@ final class Transformation implements BaseModel * Each item must match one of the following types: * `transformation`, `gif-to-video`, `thumbnail`, `abs`. * - * @var list|null $post + * @var list|null $post */ #[Optional(list: Post::class)] public ?array $post; @@ -60,11 +61,15 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list, type?: 'abs', value: string}> $post + * }|AdaptiveBitrateStreaming|array{ + * protocol: value-of, type?: 'abs', value: string + * }> $post */ public static function with(?array $post = null, ?string $pre = null): self { @@ -81,11 +86,15 @@ public static function with(?array $post = null, ?string $pre = null): self * Each item must match one of the following types: * `transformation`, `gif-to-video`, `thumbnail`, `abs`. * - * @param list, type?: 'abs', value: string}> $post + * }|AdaptiveBitrateStreaming|array{ + * protocol: value-of, type?: 'abs', value: string + * }> $post */ public function withPost(array $post): self { diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php index 64fddedc..7b51547d 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php @@ -4,10 +4,10 @@ namespace Imagekit\Beta\V2\Files\FileUploadParams\Transformation; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\GifToVideo; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Thumbnail; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Transformation; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\ConvertGifToVideo; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\SimplePostTransformation; use Imagekit\Core\Concerns\SdkUnion; use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; @@ -27,10 +27,10 @@ public static function discriminator(): string public static function variants(): array { return [ - 'transformation' => Transformation::class, - 'gif-to-video' => GifToVideo::class, - 'thumbnail' => Thumbnail::class, - 'abs' => Abs::class, + 'transformation' => SimplePostTransformation::class, + 'gif-to-video' => ConvertGifToVideo::class, + 'thumbnail' => GenerateAThumbnail::class, + 'abs' => AdaptiveBitrateStreaming::class, ]; } } diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php similarity index 83% rename from src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php rename to src/Beta/V2/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php index 39fdcd2a..a9efb670 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php @@ -4,19 +4,19 @@ namespace Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs\Protocol; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming\Protocol; use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type AbsShape = array{ + * @phpstan-type AdaptiveBitrateStreamingShape = array{ * protocol: value-of, type?: 'abs', value: string * } */ -final class Abs implements BaseModel +final class AdaptiveBitrateStreaming implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @@ -42,17 +42,17 @@ final class Abs implements BaseModel public string $value; /** - * `new Abs()` is missing required properties by the API. + * `new AdaptiveBitrateStreaming()` is missing required properties by the API. * * To enforce required parameters use * ``` - * Abs::with(protocol: ..., value: ...) + * AdaptiveBitrateStreaming::with(protocol: ..., value: ...) * ``` * * Otherwise ensure the following setters are called * * ``` - * (new Abs)->withProtocol(...)->withValue(...) + * (new AdaptiveBitrateStreaming)->withProtocol(...)->withValue(...) * ``` */ public function __construct() diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming/Protocol.php similarity index 87% rename from src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php rename to src/Beta/V2/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming/Protocol.php index a2aaa672..c7e0f5eb 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming/Protocol.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\Abs; +namespace Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming; /** * Streaming protocol to use (`hls` or `dash`). diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php similarity index 90% rename from src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php rename to src/Beta/V2/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php index 9d4d09da..74113824 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GifToVideo.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php @@ -10,13 +10,13 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type GifToVideoShape = array{ + * @phpstan-type ConvertGifToVideoShape = array{ * type?: 'gif-to-video', value?: string|null * } */ -final class GifToVideo implements BaseModel +final class ConvertGifToVideo implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php similarity index 85% rename from src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php rename to src/Beta/V2/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php index d100c216..513de76c 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Thumbnail.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php @@ -10,11 +10,13 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type ThumbnailShape = array{type?: 'thumbnail', value?: string|null} + * @phpstan-type GenerateAThumbnailShape = array{ + * type?: 'thumbnail', value?: string|null + * } */ -final class Thumbnail implements BaseModel +final class GenerateAThumbnail implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php similarity index 80% rename from src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php rename to src/Beta/V2/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php index fc1082c8..b32a5759 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/Transformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php @@ -9,13 +9,13 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type TransformationShape = array{ + * @phpstan-type SimplePostTransformationShape = array{ * type?: 'transformation', value: string * } */ -final class Transformation implements BaseModel +final class SimplePostTransformation implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @@ -34,17 +34,17 @@ final class Transformation implements BaseModel public string $value; /** - * `new Transformation()` is missing required properties by the API. + * `new SimplePostTransformation()` is missing required properties by the API. * * To enforce required parameters use * ``` - * Transformation::with(value: ...) + * SimplePostTransformation::with(value: ...) * ``` * * Otherwise ensure the following setters are called * * ``` - * (new Transformation)->withValue(...) + * (new SimplePostTransformation)->withValue(...) * ``` */ public function __construct() diff --git a/src/ExtensionItem.php b/src/ExtensionItem.php index 058287a1..ad6e4c43 100644 --- a/src/ExtensionItem.php +++ b/src/ExtensionItem.php @@ -7,9 +7,9 @@ use Imagekit\Core\Concerns\SdkUnion; use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\ExtensionItem\AIAutoDescription; +use Imagekit\ExtensionItem\AutoDescriptionExtension; use Imagekit\ExtensionItem\AutoTaggingExtension; -use Imagekit\ExtensionItem\RemoveBg; +use Imagekit\ExtensionItem\RemovedotBgExtension; final class ExtensionItem implements ConverterSource { @@ -27,8 +27,8 @@ public static function variants(): array { return [ AutoTaggingExtension::class, - 'remove-bg' => RemoveBg::class, - 'ai-auto-description' => AIAutoDescription::class, + 'remove-bg' => RemovedotBgExtension::class, + 'ai-auto-description' => AutoDescriptionExtension::class, ]; } } diff --git a/src/ExtensionItem/AIAutoDescription.php b/src/ExtensionItem/AutoDescriptionExtension.php similarity index 77% rename from src/ExtensionItem/AIAutoDescription.php rename to src/ExtensionItem/AutoDescriptionExtension.php index 8ae68f21..80a7a30d 100644 --- a/src/ExtensionItem/AIAutoDescription.php +++ b/src/ExtensionItem/AutoDescriptionExtension.php @@ -9,11 +9,13 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type AIAutoDescriptionShape = array{name?: 'ai-auto-description'} + * @phpstan-type AutoDescriptionExtensionShape = array{ + * name?: 'ai-auto-description' + * } */ -final class AIAutoDescription implements BaseModel +final class AutoDescriptionExtension implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/ExtensionItem/RemoveBg.php b/src/ExtensionItem/RemovedotBgExtension.php similarity index 84% rename from src/ExtensionItem/RemoveBg.php rename to src/ExtensionItem/RemovedotBgExtension.php index 9eec3ffe..8dca08d7 100644 --- a/src/ExtensionItem/RemoveBg.php +++ b/src/ExtensionItem/RemovedotBgExtension.php @@ -8,14 +8,16 @@ use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionItem\RemoveBg\Options; +use Imagekit\ExtensionItem\RemovedotBgExtension\Options; /** - * @phpstan-type RemoveBgShape = array{name?: 'remove-bg', options?: Options|null} + * @phpstan-type RemovedotBgExtensionShape = array{ + * name?: 'remove-bg', options?: Options|null + * } */ -final class RemoveBg implements BaseModel +final class RemovedotBgExtension implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/ExtensionItem/RemoveBg/Options.php b/src/ExtensionItem/RemovedotBgExtension/Options.php similarity index 98% rename from src/ExtensionItem/RemoveBg/Options.php rename to src/ExtensionItem/RemovedotBgExtension/Options.php index 5a1df346..dbb57e4e 100644 --- a/src/ExtensionItem/RemoveBg/Options.php +++ b/src/ExtensionItem/RemovedotBgExtension/Options.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem\RemoveBg; +namespace Imagekit\ExtensionItem\RemovedotBgExtension; use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; diff --git a/src/Files/FileUpdateParams.php b/src/Files/FileUpdateParams.php index 6f6e9299..a56157c2 100644 --- a/src/Files/FileUpdateParams.php +++ b/src/Files/FileUpdateParams.php @@ -9,11 +9,11 @@ use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; use Imagekit\ExtensionItem; -use Imagekit\ExtensionItem\AIAutoDescription; +use Imagekit\ExtensionItem\AutoDescriptionExtension; use Imagekit\ExtensionItem\AutoTaggingExtension; use Imagekit\ExtensionItem\AutoTaggingExtension\Name; -use Imagekit\ExtensionItem\RemoveBg; -use Imagekit\ExtensionItem\RemoveBg\Options; +use Imagekit\ExtensionItem\RemovedotBgExtension; +use Imagekit\ExtensionItem\RemovedotBgExtension\Options; use Imagekit\Files\FileUpdateParams\Publish; use Imagekit\Files\FileUpdateParams\RemoveAITags; @@ -26,11 +26,11 @@ * customCoordinates?: string|null, * customMetadata?: array, * description?: string, - * extensions?: list - * }|AIAutoDescription|array{name?: 'ai-auto-description'}>, + * }|AutoDescriptionExtension|array{name?: 'ai-auto-description'}>, * removeAITags?: 'all'|list, * tags?: list|null, * webhookURL?: string, @@ -66,7 +66,7 @@ final class FileUpdateParams implements BaseModel /** * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * - * @var list|null $extensions + * @var list|null $extensions */ #[Optional(list: ExtensionItem::class)] public ?array $extensions; @@ -114,11 +114,11 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param array $customMetadata - * @param list - * }|AIAutoDescription|array{name?: 'ai-auto-description'}> $extensions + * }|AutoDescriptionExtension|array{name?: 'ai-auto-description'}> $extensions * @param 'all'|list $removeAITags * @param list|null $tags * @param Publish|array{ @@ -187,11 +187,11 @@ public function withDescription(string $description): self /** * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * - * @param list - * }|AIAutoDescription|array{name?: 'ai-auto-description'}> $extensions + * }|AutoDescriptionExtension|array{name?: 'ai-auto-description'}> $extensions */ public function withExtensions(array $extensions): self { diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index fd76ba3d..9fcf6cf1 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -10,16 +10,17 @@ use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; use Imagekit\ExtensionItem; -use Imagekit\ExtensionItem\AIAutoDescription; +use Imagekit\ExtensionItem\AutoDescriptionExtension; use Imagekit\ExtensionItem\AutoTaggingExtension; use Imagekit\ExtensionItem\AutoTaggingExtension\Name; -use Imagekit\ExtensionItem\RemoveBg; -use Imagekit\ExtensionItem\RemoveBg\Options; +use Imagekit\ExtensionItem\RemovedotBgExtension; +use Imagekit\ExtensionItem\RemovedotBgExtension\Options; use Imagekit\Files\FileUploadParams\ResponseField; use Imagekit\Files\FileUploadParams\Transformation; -use Imagekit\Files\FileUploadParams\Transformation\Post\Abs; -use Imagekit\Files\FileUploadParams\Transformation\Post\GifToVideo; -use Imagekit\Files\FileUploadParams\Transformation\Post\Thumbnail; +use Imagekit\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming; +use Imagekit\Files\FileUploadParams\Transformation\Post\ConvertGifToVideo; +use Imagekit\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail; +use Imagekit\Files\FileUploadParams\Transformation\Post\SimplePostTransformation; /** * ImageKit.io allows you to upload files directly from both the server and client sides. For server-side uploads, private API key authentication is used. For client-side uploads, generate a one-time `token`, `signature`, and `expire` from your secure backend using private API. [Learn more](/docs/api-reference/upload-file/upload-file#how-to-implement-client-side-file-upload) about how to implement client-side file upload. @@ -48,11 +49,11 @@ * customMetadata?: array, * description?: string, * expire?: int, - * extensions?: list - * }|AIAutoDescription|array{name?: 'ai-auto-description'}>, + * }|AutoDescriptionExtension|array{name?: 'ai-auto-description'}>, * folder?: string, * isPrivateFile?: bool, * isPublished?: bool, @@ -65,7 +66,7 @@ * signature?: string, * tags?: list, * transformation?: Transformation|array{ - * post?: list<\Imagekit\Files\FileUploadParams\Transformation\Post\Transformation|GifToVideo|Thumbnail|Abs>|null, + * post?: list|null, * pre?: string|null, * }, * useUniqueFileName?: bool, @@ -150,7 +151,7 @@ final class FileUploadParams implements BaseModel /** * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * - * @var list|null $extensions + * @var list|null $extensions */ #[Optional(list: ExtensionItem::class)] public ?array $extensions; @@ -297,15 +298,15 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param array $customMetadata - * @param list - * }|AIAutoDescription|array{name?: 'ai-auto-description'}> $extensions + * }|AutoDescriptionExtension|array{name?: 'ai-auto-description'}> $extensions * @param list> $responseFields * @param list $tags * @param Transformation|array{ - * post?: list|null, + * post?: list|null, * pre?: string|null, * } $transformation */ @@ -476,11 +477,11 @@ public function withExpire(int $expire): self /** * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * - * @param list - * }|AIAutoDescription|array{name?: 'ai-auto-description'}> $extensions + * }|AutoDescriptionExtension|array{name?: 'ai-auto-description'}> $extensions */ public function withExtensions(array $extensions): self { @@ -645,7 +646,7 @@ public function withTags(array $tags): self * You can mix and match any combination of post-processing types. * * @param Transformation|array{ - * post?: list|null, + * post?: list|null, * pre?: string|null, * } $transformation */ diff --git a/src/Files/FileUploadParams/Transformation.php b/src/Files/FileUploadParams/Transformation.php index c6c88a46..30d75ef8 100644 --- a/src/Files/FileUploadParams/Transformation.php +++ b/src/Files/FileUploadParams/Transformation.php @@ -8,10 +8,11 @@ use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Files\FileUploadParams\Transformation\Post; -use Imagekit\Files\FileUploadParams\Transformation\Post\Abs; -use Imagekit\Files\FileUploadParams\Transformation\Post\Abs\Protocol; -use Imagekit\Files\FileUploadParams\Transformation\Post\GifToVideo; -use Imagekit\Files\FileUploadParams\Transformation\Post\Thumbnail; +use Imagekit\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming; +use Imagekit\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming\Protocol; +use Imagekit\Files\FileUploadParams\Transformation\Post\ConvertGifToVideo; +use Imagekit\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail; +use Imagekit\Files\FileUploadParams\Transformation\Post\SimplePostTransformation; /** * Configure pre-processing (`pre`) and post-processing (`post`) transformations. @@ -25,7 +26,7 @@ * You can mix and match any combination of post-processing types. * * @phpstan-type TransformationShape = array{ - * post?: list<\Imagekit\Files\FileUploadParams\Transformation\Post\Transformation|GifToVideo|Thumbnail|Abs>|null, + * post?: list|null, * pre?: string|null, * } */ @@ -39,7 +40,7 @@ final class Transformation implements BaseModel * Each item must match one of the following types: * `transformation`, `gif-to-video`, `thumbnail`, `abs`. * - * @var list|null $post + * @var list|null $post */ #[Optional(list: Post::class)] public ?array $post; @@ -60,11 +61,15 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list, type?: 'abs', value: string}> $post + * }|AdaptiveBitrateStreaming|array{ + * protocol: value-of, type?: 'abs', value: string + * }> $post */ public static function with(?array $post = null, ?string $pre = null): self { @@ -81,11 +86,15 @@ public static function with(?array $post = null, ?string $pre = null): self * Each item must match one of the following types: * `transformation`, `gif-to-video`, `thumbnail`, `abs`. * - * @param list, type?: 'abs', value: string}> $post + * }|AdaptiveBitrateStreaming|array{ + * protocol: value-of, type?: 'abs', value: string + * }> $post */ public function withPost(array $post): self { diff --git a/src/Files/FileUploadParams/Transformation/Post.php b/src/Files/FileUploadParams/Transformation/Post.php index c7bba30c..9de55f74 100644 --- a/src/Files/FileUploadParams/Transformation/Post.php +++ b/src/Files/FileUploadParams/Transformation/Post.php @@ -7,10 +7,10 @@ use Imagekit\Core\Concerns\SdkUnion; use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Files\FileUploadParams\Transformation\Post\Abs; -use Imagekit\Files\FileUploadParams\Transformation\Post\GifToVideo; -use Imagekit\Files\FileUploadParams\Transformation\Post\Thumbnail; -use Imagekit\Files\FileUploadParams\Transformation\Post\Transformation; +use Imagekit\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming; +use Imagekit\Files\FileUploadParams\Transformation\Post\ConvertGifToVideo; +use Imagekit\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail; +use Imagekit\Files\FileUploadParams\Transformation\Post\SimplePostTransformation; final class Post implements ConverterSource { @@ -27,10 +27,10 @@ public static function discriminator(): string public static function variants(): array { return [ - 'transformation' => Transformation::class, - 'gif-to-video' => GifToVideo::class, - 'thumbnail' => Thumbnail::class, - 'abs' => Abs::class, + 'transformation' => SimplePostTransformation::class, + 'gif-to-video' => ConvertGifToVideo::class, + 'thumbnail' => GenerateAThumbnail::class, + 'abs' => AdaptiveBitrateStreaming::class, ]; } } diff --git a/src/Files/FileUploadParams/Transformation/Post/Abs.php b/src/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php similarity index 80% rename from src/Files/FileUploadParams/Transformation/Post/Abs.php rename to src/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php index 3b9685b7..d39d6e06 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Abs.php +++ b/src/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php @@ -7,16 +7,16 @@ use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Files\FileUploadParams\Transformation\Post\Abs\Protocol; +use Imagekit\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming\Protocol; /** - * @phpstan-type AbsShape = array{ + * @phpstan-type AdaptiveBitrateStreamingShape = array{ * protocol: value-of, type?: 'abs', value: string * } */ -final class Abs implements BaseModel +final class AdaptiveBitrateStreaming implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @@ -42,17 +42,17 @@ final class Abs implements BaseModel public string $value; /** - * `new Abs()` is missing required properties by the API. + * `new AdaptiveBitrateStreaming()` is missing required properties by the API. * * To enforce required parameters use * ``` - * Abs::with(protocol: ..., value: ...) + * AdaptiveBitrateStreaming::with(protocol: ..., value: ...) * ``` * * Otherwise ensure the following setters are called * * ``` - * (new Abs)->withProtocol(...)->withValue(...) + * (new AdaptiveBitrateStreaming)->withProtocol(...)->withValue(...) * ``` */ public function __construct() diff --git a/src/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php b/src/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming/Protocol.php similarity index 64% rename from src/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php rename to src/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming/Protocol.php index 3bf589b0..df516efd 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Abs/Protocol.php +++ b/src/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming/Protocol.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUploadParams\Transformation\Post\Abs; +namespace Imagekit\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming; /** * Streaming protocol to use (`hls` or `dash`). diff --git a/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php b/src/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php similarity index 89% rename from src/Files/FileUploadParams/Transformation/Post/GifToVideo.php rename to src/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php index a23687b9..2cfacd29 100644 --- a/src/Files/FileUploadParams/Transformation/Post/GifToVideo.php +++ b/src/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php @@ -10,13 +10,13 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type GifToVideoShape = array{ + * @phpstan-type ConvertGifToVideoShape = array{ * type?: 'gif-to-video', value?: string|null * } */ -final class GifToVideo implements BaseModel +final class ConvertGifToVideo implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php b/src/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php similarity index 85% rename from src/Files/FileUploadParams/Transformation/Post/Thumbnail.php rename to src/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php index 3fcd7624..81f00760 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Thumbnail.php +++ b/src/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php @@ -10,11 +10,13 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type ThumbnailShape = array{type?: 'thumbnail', value?: string|null} + * @phpstan-type GenerateAThumbnailShape = array{ + * type?: 'thumbnail', value?: string|null + * } */ -final class Thumbnail implements BaseModel +final class GenerateAThumbnail implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** diff --git a/src/Files/FileUploadParams/Transformation/Post/Transformation.php b/src/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php similarity index 80% rename from src/Files/FileUploadParams/Transformation/Post/Transformation.php rename to src/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php index 5afcf18e..d1b8afca 100644 --- a/src/Files/FileUploadParams/Transformation/Post/Transformation.php +++ b/src/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php @@ -9,13 +9,13 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type TransformationShape = array{ + * @phpstan-type SimplePostTransformationShape = array{ * type?: 'transformation', value: string * } */ -final class Transformation implements BaseModel +final class SimplePostTransformation implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @@ -34,17 +34,17 @@ final class Transformation implements BaseModel public string $value; /** - * `new Transformation()` is missing required properties by the API. + * `new SimplePostTransformation()` is missing required properties by the API. * * To enforce required parameters use * ``` - * Transformation::with(value: ...) + * SimplePostTransformation::with(value: ...) * ``` * * Otherwise ensure the following setters are called * * ``` - * (new Transformation)->withValue(...) + * (new SimplePostTransformation)->withValue(...) * ``` */ public function __construct() diff --git a/src/Files/UpdateFileRequest/UpdateFileDetails.php b/src/Files/UpdateFileRequest/UpdateFileDetails.php index e42c209d..2d6195b6 100644 --- a/src/Files/UpdateFileRequest/UpdateFileDetails.php +++ b/src/Files/UpdateFileRequest/UpdateFileDetails.php @@ -8,11 +8,11 @@ use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\ExtensionItem; -use Imagekit\ExtensionItem\AIAutoDescription; +use Imagekit\ExtensionItem\AutoDescriptionExtension; use Imagekit\ExtensionItem\AutoTaggingExtension; use Imagekit\ExtensionItem\AutoTaggingExtension\Name; -use Imagekit\ExtensionItem\RemoveBg; -use Imagekit\ExtensionItem\RemoveBg\Options; +use Imagekit\ExtensionItem\RemovedotBgExtension; +use Imagekit\ExtensionItem\RemovedotBgExtension\Options; use Imagekit\Files\UpdateFileRequest\UpdateFileDetails\RemoveAITags; /** @@ -20,7 +20,7 @@ * customCoordinates?: string|null, * customMetadata?: array|null, * description?: string|null, - * extensions?: list|null, + * extensions?: list|null, * removeAITags?: null|'all'|list, * tags?: list|null, * webhookURL?: string|null, @@ -54,7 +54,7 @@ final class UpdateFileDetails implements BaseModel /** * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * - * @var list|null $extensions + * @var list|null $extensions */ #[Optional(list: ExtensionItem::class)] public ?array $extensions; @@ -96,11 +96,11 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param array $customMetadata - * @param list - * }|AIAutoDescription|array{name?: 'ai-auto-description'}> $extensions + * }|AutoDescriptionExtension|array{name?: 'ai-auto-description'}> $extensions * @param 'all'|list $removeAITags * @param list|null $tags */ @@ -164,11 +164,11 @@ public function withDescription(string $description): self /** * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * - * @param list - * }|AIAutoDescription|array{name?: 'ai-auto-description'}> $extensions + * }|AutoDescriptionExtension|array{name?: 'ai-auto-description'}> $extensions */ public function withExtensions(array $extensions): self { diff --git a/src/ServiceContracts/Accounts/OriginsContract.php b/src/ServiceContracts/Accounts/OriginsContract.php index a32d610e..defa79a3 100644 --- a/src/ServiceContracts/Accounts/OriginsContract.php +++ b/src/ServiceContracts/Accounts/OriginsContract.php @@ -5,9 +5,9 @@ namespace Imagekit\ServiceContracts\Accounts; use Imagekit\Accounts\Origins\OriginResponse\AkeneoPim; -use Imagekit\Accounts\Origins\OriginResponse\AzureBlob; +use Imagekit\Accounts\Origins\OriginResponse\AzureBlobStorage; use Imagekit\Accounts\Origins\OriginResponse\CloudinaryBackup; -use Imagekit\Accounts\Origins\OriginResponse\Gcs; +use Imagekit\Accounts\Origins\OriginResponse\GoogleCloudStorageGcs; use Imagekit\Accounts\Origins\OriginResponse\S3; use Imagekit\Accounts\Origins\OriginResponse\S3Compatible; use Imagekit\Accounts\Origins\OriginResponse\WebFolder; @@ -60,7 +60,7 @@ public function create( bool $s3ForcePathStyle = false, bool $forwardHostHeaderToOrigin = false, ?RequestOptions $requestOptions = null, - ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim; + ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|GoogleCloudStorageGcs|AzureBlobStorage|AkeneoPim; /** * @api @@ -107,12 +107,12 @@ public function update( bool $s3ForcePathStyle = false, bool $forwardHostHeaderToOrigin = false, ?RequestOptions $requestOptions = null, - ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim; + ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|GoogleCloudStorageGcs|AzureBlobStorage|AkeneoPim; /** * @api * - * @return list + * @return list * * @throws APIException */ @@ -140,5 +140,5 @@ public function delete( public function get( string $id, ?RequestOptions $requestOptions = null - ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim; + ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|GoogleCloudStorageGcs|AzureBlobStorage|AkeneoPim; } diff --git a/src/ServiceContracts/Accounts/OriginsRawContract.php b/src/ServiceContracts/Accounts/OriginsRawContract.php index d474ec81..bb1244ec 100644 --- a/src/ServiceContracts/Accounts/OriginsRawContract.php +++ b/src/ServiceContracts/Accounts/OriginsRawContract.php @@ -6,9 +6,9 @@ use Imagekit\Accounts\Origins\OriginCreateParams; use Imagekit\Accounts\Origins\OriginResponse\AkeneoPim; -use Imagekit\Accounts\Origins\OriginResponse\AzureBlob; +use Imagekit\Accounts\Origins\OriginResponse\AzureBlobStorage; use Imagekit\Accounts\Origins\OriginResponse\CloudinaryBackup; -use Imagekit\Accounts\Origins\OriginResponse\Gcs; +use Imagekit\Accounts\Origins\OriginResponse\GoogleCloudStorageGcs; use Imagekit\Accounts\Origins\OriginResponse\S3; use Imagekit\Accounts\Origins\OriginResponse\S3Compatible; use Imagekit\Accounts\Origins\OriginResponse\WebFolder; @@ -25,7 +25,7 @@ interface OriginsRawContract * * @param array|OriginCreateParams $params * - * @return BaseResponse + * @return BaseResponse * * @throws APIException */ @@ -40,7 +40,7 @@ public function create( * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. * @param array|OriginUpdateParams $params * - * @return BaseResponse + * @return BaseResponse * * @throws APIException */ @@ -53,7 +53,7 @@ public function update( /** * @api * - * @return BaseResponse,> + * @return BaseResponse,> * * @throws APIException */ @@ -78,7 +78,7 @@ public function delete( * * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. * - * @return BaseResponse + * @return BaseResponse * * @throws APIException */ diff --git a/src/Services/Accounts/OriginsRawService.php b/src/Services/Accounts/OriginsRawService.php index 45bf75d5..7cbdaeef 100644 --- a/src/Services/Accounts/OriginsRawService.php +++ b/src/Services/Accounts/OriginsRawService.php @@ -7,9 +7,9 @@ use Imagekit\Accounts\Origins\OriginCreateParams; use Imagekit\Accounts\Origins\OriginResponse; use Imagekit\Accounts\Origins\OriginResponse\AkeneoPim; -use Imagekit\Accounts\Origins\OriginResponse\AzureBlob; +use Imagekit\Accounts\Origins\OriginResponse\AzureBlobStorage; use Imagekit\Accounts\Origins\OriginResponse\CloudinaryBackup; -use Imagekit\Accounts\Origins\OriginResponse\Gcs; +use Imagekit\Accounts\Origins\OriginResponse\GoogleCloudStorageGcs; use Imagekit\Accounts\Origins\OriginResponse\S3; use Imagekit\Accounts\Origins\OriginResponse\S3Compatible; use Imagekit\Accounts\Origins\OriginResponse\WebFolder; @@ -60,7 +60,7 @@ public function __construct(private Client $client) {} * username: string, * }|OriginCreateParams $params * - * @return BaseResponse + * @return BaseResponse * * @throws APIException */ @@ -114,7 +114,7 @@ public function create( * username: string, * }|OriginUpdateParams $params * - * @return BaseResponse + * @return BaseResponse * * @throws APIException */ @@ -144,7 +144,7 @@ public function update( * **Note:** This API is currently in beta. * Returns an array of all configured origins for the current account. * - * @return BaseResponse,> + * @return BaseResponse,> * * @throws APIException */ @@ -192,7 +192,7 @@ public function delete( * * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. * - * @return BaseResponse + * @return BaseResponse * * @throws APIException */ diff --git a/src/Services/Accounts/OriginsService.php b/src/Services/Accounts/OriginsService.php index 86c5caa6..e1ce9b04 100644 --- a/src/Services/Accounts/OriginsService.php +++ b/src/Services/Accounts/OriginsService.php @@ -5,9 +5,9 @@ namespace Imagekit\Services\Accounts; use Imagekit\Accounts\Origins\OriginResponse\AkeneoPim; -use Imagekit\Accounts\Origins\OriginResponse\AzureBlob; +use Imagekit\Accounts\Origins\OriginResponse\AzureBlobStorage; use Imagekit\Accounts\Origins\OriginResponse\CloudinaryBackup; -use Imagekit\Accounts\Origins\OriginResponse\Gcs; +use Imagekit\Accounts\Origins\OriginResponse\GoogleCloudStorageGcs; use Imagekit\Accounts\Origins\OriginResponse\S3; use Imagekit\Accounts\Origins\OriginResponse\S3Compatible; use Imagekit\Accounts\Origins\OriginResponse\WebFolder; @@ -79,7 +79,7 @@ public function create( bool $s3ForcePathStyle = false, bool $forwardHostHeaderToOrigin = false, ?RequestOptions $requestOptions = null, - ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { + ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|GoogleCloudStorageGcs|AzureBlobStorage|AkeneoPim { $params = Util::removeNulls( [ 'accessKey' => $accessKey, @@ -160,7 +160,7 @@ public function update( bool $s3ForcePathStyle = false, bool $forwardHostHeaderToOrigin = false, ?RequestOptions $requestOptions = null, - ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { + ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|GoogleCloudStorageGcs|AzureBlobStorage|AkeneoPim { $params = Util::removeNulls( [ 'accessKey' => $accessKey, @@ -199,7 +199,7 @@ public function update( * **Note:** This API is currently in beta. * Returns an array of all configured origins for the current account. * - * @return list + * @return list * * @throws APIException */ @@ -244,7 +244,7 @@ public function delete( public function get( string $id, ?RequestOptions $requestOptions = null - ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|Gcs|AzureBlob|AkeneoPim { + ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|GoogleCloudStorageGcs|AzureBlobStorage|AkeneoPim { // @phpstan-ignore-next-line argument.type $response = $this->raw->get($id, requestOptions: $requestOptions); From aabdd475e597cf8a33699651aeaa7fc6d8681b52 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 10 Dec 2025 20:16:40 +0000 Subject: [PATCH 096/193] feat: add idempotency header support --- composer.json | 1 + release-please-config.json | 2 +- src/Client.php | 6 ++---- src/Core/BaseClient.php | 23 ++++++++++++++++++++--- src/Version.php | 9 +++++++++ 5 files changed, 33 insertions(+), 8 deletions(-) create mode 100644 src/Version.php diff --git a/composer.json b/composer.json index f19a6279..287b791d 100644 --- a/composer.json +++ b/composer.json @@ -4,6 +4,7 @@ "autoload": { "files": [ "src/Core.php", + "src/Version.php", "src/Client.php" ], "psr-4": { diff --git a/release-please-config.json b/release-please-config.json index 5c15181d..83bea623 100644 --- a/release-please-config.json +++ b/release-please-config.json @@ -62,6 +62,6 @@ "release-type": "php", "extra-files": [ "README.md", - "src/Client.php" + "src/Version.php" ] } \ No newline at end of file diff --git a/src/Client.php b/src/Client.php index 7cdf79f0..950d49e4 100644 --- a/src/Client.php +++ b/src/Client.php @@ -85,11 +85,10 @@ public function __construct( ); parent::__construct( - // x-release-please-start-version headers: [ 'Content-Type' => 'application/json', 'Accept' => 'application/json', - 'User-Agent' => sprintf('ImageKit/PHP %s', '0.0.1'), + 'User-Agent' => sprintf('ImageKit/PHP %s', VERSION), 'X-Stainless-Lang' => 'php', 'X-Stainless-Package-Version' => '0.0.1', 'X-Stainless-Arch' => Util::machtype(), @@ -97,9 +96,8 @@ public function __construct( 'X-Stainless-Runtime' => php_sapi_name(), 'X-Stainless-Runtime-Version' => phpversion(), ], - // x-release-please-end baseUrl: $baseUrl, - options: $options, + options: $options ); $this->customMetadataFields = new CustomMetadataFieldsService($this); diff --git a/src/Core/BaseClient.php b/src/Core/BaseClient.php index b00d5cf8..d9c469a1 100644 --- a/src/Core/BaseClient.php +++ b/src/Core/BaseClient.php @@ -43,6 +43,7 @@ abstract class BaseClient public function __construct( protected array $headers, string $baseUrl, + protected ?string $idempotencyHeader = null, protected RequestOptions $options = new RequestOptions, ) { assert(!is_null($this->options->uriFactory)); @@ -90,6 +91,16 @@ public function request( /** @return array */ abstract protected function authHeaders(): array; + /** + * @internal + */ + protected function generateIdempotencyKey(): string + { + $hex = bin2hex(random_bytes(32)); + + return "stainless-php-retry-{$hex}"; + } + /** * @internal * @@ -127,15 +138,21 @@ protected function buildRequest( /** @var array $mergedQuery */ $mergedQuery = array_merge_recursive( $query, - $options->extraQueryParams ?? [], + $options->extraQueryParams ?? [] ); $uri = Util::joinUri($this->baseUrl, path: $parsedPath, query: $mergedQuery)->__toString(); + $idempotencyHeaders = $this->idempotencyHeader && !array_key_exists($this->idempotencyHeader, array: $headers) + ? [$this->idempotencyHeader => $this->generateIdempotencyKey()] + : []; /** @var array|null> $mergedHeaders */ - $mergedHeaders = [...$this->headers, + $mergedHeaders = [ + ...$this->headers, ...$this->authHeaders(), ...$headers, - ...($options->extraHeaders ?? []), ]; + ...($options->extraHeaders ?? []), + ...$idempotencyHeaders, + ]; $req = ['method' => strtoupper($method), 'path' => $uri, 'query' => $mergedQuery, 'headers' => $mergedHeaders, 'body' => $body]; diff --git a/src/Version.php b/src/Version.php new file mode 100644 index 00000000..6dac0f12 --- /dev/null +++ b/src/Version.php @@ -0,0 +1,9 @@ + Date: Thu, 11 Dec 2025 22:45:23 +0000 Subject: [PATCH 097/193] chore(internal): codegen related update --- src/Core/Attributes/Api.php | 66 +++++++ src/Core/Concerns/SdkResponse.php | 29 +++ .../Contracts/ResponseConverter.php | 18 ++ tests/Core/TestModel.php | 180 ++++++++++++++++++ 4 files changed, 293 insertions(+) create mode 100644 src/Core/Attributes/Api.php create mode 100644 src/Core/Concerns/SdkResponse.php create mode 100644 src/Core/Conversion/Contracts/ResponseConverter.php create mode 100644 tests/Core/TestModel.php diff --git a/src/Core/Attributes/Api.php b/src/Core/Attributes/Api.php new file mode 100644 index 00000000..3ed05474 --- /dev/null +++ b/src/Core/Attributes/Api.php @@ -0,0 +1,66 @@ +|Converter|string|null */ + public readonly Converter|string|null $type; + + /** @var array */ + private static array $enumConverters = []; + + /** + * @param class-string|Converter|string|null $type + * @param class-string<\BackedEnum>|Converter|null $enum + * @param class-string|Converter|null $union + * @param class-string|Converter|string|null $list + * @param class-string|Converter|string|null $map + */ + public function __construct( + public readonly ?string $apiName = null, + Converter|string|null $type = null, + Converter|string|null $enum = null, + Converter|string|null $union = null, + Converter|string|null $list = null, + Converter|string|null $map = null, + public readonly bool $nullable = false, + public readonly bool $optional = false, + ) { + $type ??= $union; + if (null !== $list) { + $type ??= new ListOf($list); + } + if (null !== $map) { + $type ??= new MapOf($map); + } + if (null !== $enum) { + $type ??= $enum instanceof Converter ? $enum : $this->getEnumConverter($enum); + } + + $this->type = $type; + } + + /** @property class-string<\BackedEnum> $enum */ + private function getEnumConverter(string $enum): Converter + { + if (!isset(self::$enumConverters[$enum])) { + $converter = new EnumOf(array_column($enum::cases(), 'value')); // @phpstan-ignore-line + self::$enumConverters[$enum] = $converter; + } + + return self::$enumConverters[$enum]; + } +} diff --git a/src/Core/Concerns/SdkResponse.php b/src/Core/Concerns/SdkResponse.php new file mode 100644 index 00000000..ddc05f1f --- /dev/null +++ b/src/Core/Concerns/SdkResponse.php @@ -0,0 +1,29 @@ +_rawResponse = $response; + $instance->__unserialize(Util::decodeContent($response)); // @phpstan-ignore-line + + return $instance; + } + + public function getRawResponse(): ?ResponseInterface + { + return $this->_rawResponse; + } +} diff --git a/src/Core/Conversion/Contracts/ResponseConverter.php b/src/Core/Conversion/Contracts/ResponseConverter.php new file mode 100644 index 00000000..593282df --- /dev/null +++ b/src/Core/Conversion/Contracts/ResponseConverter.php @@ -0,0 +1,18 @@ +> */ + use SdkModel; + + #[Api] + public string $name; + + #[Api('age_years')] + public int $ageYears; + + /** @var list|null */ + #[Api(optional: true)] + public ?array $friends; + + #[Api] + public ?string $owner; + + /** + * @param list|null $friends + */ + public function __construct( + string $name, + int $ageYears, + ?string $owner, + ?array $friends = null, + ) { + $this->initialize(); + + $this->name = $name; + $this->ageYears = $ageYears; + $this->owner = $owner; + + null != $friends && $this->friends = $friends; + } +} + +/** + * @internal + * + * @coversNothing + */ +#[CoversNothing] +class TestModelTest extends TestCase +{ + #[Test] + public function testBasicGetAndSet(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertEquals(12, $model->ageYears); + + ++$model->ageYears; + $this->assertEquals(13, $model->ageYears); + } + + #[Test] + public function testNullAccess(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertNull($model->owner); + $this->assertNull($model->friends); + } + + #[Test] + public function testArrayGetAndSet(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $model->friends ??= []; + $this->assertEquals([], $model->friends); + $model->friends[] = 'Alice'; + $this->assertEquals(['Alice'], $model->friends); + } + + #[Test] + public function testDiscernsBetweenNullAndUnset(): void + { + $modelUnsetFriends = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $modelNullFriends = new TestModel( + name: 'bob', + ageYears: 12, + owner: null, + ); + $modelNullFriends->friends = null; + + $this->assertEquals(12, $modelUnsetFriends->ageYears); + $this->assertEquals(12, $modelNullFriends->ageYears); + + $this->assertTrue($modelUnsetFriends->offsetExists('ageYears')); + $this->assertTrue($modelNullFriends->offsetExists('ageYears')); + + $this->assertNull($modelUnsetFriends->friends); + $this->assertNull($modelNullFriends->friends); + + $this->assertFalse($modelUnsetFriends->offsetExists('friends')); + $this->assertTrue($modelNullFriends->offsetExists('friends')); + } + + #[Test] + public function testIssetOnOmittedProperties(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertFalse(isset($model->owner)); + $this->assertFalse(isset($model->friends)); + } + + #[Test] + public function testSerializeBasicModel(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: 'Eve', + friends: ['Alice', 'Charlie'], + ); + $this->assertEquals( + '{"name":"Bob","age_years":12,"friends":["Alice","Charlie"],"owner":"Eve"}', + json_encode($model) + ); + } + + #[Test] + public function testSerializeModelWithOmittedProperties(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertEquals( + '{"name":"Bob","age_years":12,"owner":null}', + json_encode($model) + ); + } + + #[Test] + public function testSerializeModelWithExplicitNull(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $model->friends = null; + $this->assertEquals( + '{"name":"Bob","age_years":12,"friends":null,"owner":null}', + json_encode($model) + ); + } +} From 8cce69f9353760cd01788b3ae56718dbdbddc540 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 11 Dec 2025 22:52:38 +0000 Subject: [PATCH 098/193] chore(internal): codegen related update --- src/Core/Attributes/Api.php | 66 ------- src/Core/Concerns/SdkResponse.php | 29 --- .../Contracts/ResponseConverter.php | 18 -- tests/Core/TestModel.php | 180 ------------------ 4 files changed, 293 deletions(-) delete mode 100644 src/Core/Attributes/Api.php delete mode 100644 src/Core/Concerns/SdkResponse.php delete mode 100644 src/Core/Conversion/Contracts/ResponseConverter.php delete mode 100644 tests/Core/TestModel.php diff --git a/src/Core/Attributes/Api.php b/src/Core/Attributes/Api.php deleted file mode 100644 index 3ed05474..00000000 --- a/src/Core/Attributes/Api.php +++ /dev/null @@ -1,66 +0,0 @@ -|Converter|string|null */ - public readonly Converter|string|null $type; - - /** @var array */ - private static array $enumConverters = []; - - /** - * @param class-string|Converter|string|null $type - * @param class-string<\BackedEnum>|Converter|null $enum - * @param class-string|Converter|null $union - * @param class-string|Converter|string|null $list - * @param class-string|Converter|string|null $map - */ - public function __construct( - public readonly ?string $apiName = null, - Converter|string|null $type = null, - Converter|string|null $enum = null, - Converter|string|null $union = null, - Converter|string|null $list = null, - Converter|string|null $map = null, - public readonly bool $nullable = false, - public readonly bool $optional = false, - ) { - $type ??= $union; - if (null !== $list) { - $type ??= new ListOf($list); - } - if (null !== $map) { - $type ??= new MapOf($map); - } - if (null !== $enum) { - $type ??= $enum instanceof Converter ? $enum : $this->getEnumConverter($enum); - } - - $this->type = $type; - } - - /** @property class-string<\BackedEnum> $enum */ - private function getEnumConverter(string $enum): Converter - { - if (!isset(self::$enumConverters[$enum])) { - $converter = new EnumOf(array_column($enum::cases(), 'value')); // @phpstan-ignore-line - self::$enumConverters[$enum] = $converter; - } - - return self::$enumConverters[$enum]; - } -} diff --git a/src/Core/Concerns/SdkResponse.php b/src/Core/Concerns/SdkResponse.php deleted file mode 100644 index ddc05f1f..00000000 --- a/src/Core/Concerns/SdkResponse.php +++ /dev/null @@ -1,29 +0,0 @@ -_rawResponse = $response; - $instance->__unserialize(Util::decodeContent($response)); // @phpstan-ignore-line - - return $instance; - } - - public function getRawResponse(): ?ResponseInterface - { - return $this->_rawResponse; - } -} diff --git a/src/Core/Conversion/Contracts/ResponseConverter.php b/src/Core/Conversion/Contracts/ResponseConverter.php deleted file mode 100644 index 593282df..00000000 --- a/src/Core/Conversion/Contracts/ResponseConverter.php +++ /dev/null @@ -1,18 +0,0 @@ -> */ - use SdkModel; - - #[Api] - public string $name; - - #[Api('age_years')] - public int $ageYears; - - /** @var list|null */ - #[Api(optional: true)] - public ?array $friends; - - #[Api] - public ?string $owner; - - /** - * @param list|null $friends - */ - public function __construct( - string $name, - int $ageYears, - ?string $owner, - ?array $friends = null, - ) { - $this->initialize(); - - $this->name = $name; - $this->ageYears = $ageYears; - $this->owner = $owner; - - null != $friends && $this->friends = $friends; - } -} - -/** - * @internal - * - * @coversNothing - */ -#[CoversNothing] -class TestModelTest extends TestCase -{ - #[Test] - public function testBasicGetAndSet(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $this->assertEquals(12, $model->ageYears); - - ++$model->ageYears; - $this->assertEquals(13, $model->ageYears); - } - - #[Test] - public function testNullAccess(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $this->assertNull($model->owner); - $this->assertNull($model->friends); - } - - #[Test] - public function testArrayGetAndSet(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $model->friends ??= []; - $this->assertEquals([], $model->friends); - $model->friends[] = 'Alice'; - $this->assertEquals(['Alice'], $model->friends); - } - - #[Test] - public function testDiscernsBetweenNullAndUnset(): void - { - $modelUnsetFriends = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $modelNullFriends = new TestModel( - name: 'bob', - ageYears: 12, - owner: null, - ); - $modelNullFriends->friends = null; - - $this->assertEquals(12, $modelUnsetFriends->ageYears); - $this->assertEquals(12, $modelNullFriends->ageYears); - - $this->assertTrue($modelUnsetFriends->offsetExists('ageYears')); - $this->assertTrue($modelNullFriends->offsetExists('ageYears')); - - $this->assertNull($modelUnsetFriends->friends); - $this->assertNull($modelNullFriends->friends); - - $this->assertFalse($modelUnsetFriends->offsetExists('friends')); - $this->assertTrue($modelNullFriends->offsetExists('friends')); - } - - #[Test] - public function testIssetOnOmittedProperties(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $this->assertFalse(isset($model->owner)); - $this->assertFalse(isset($model->friends)); - } - - #[Test] - public function testSerializeBasicModel(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: 'Eve', - friends: ['Alice', 'Charlie'], - ); - $this->assertEquals( - '{"name":"Bob","age_years":12,"friends":["Alice","Charlie"],"owner":"Eve"}', - json_encode($model) - ); - } - - #[Test] - public function testSerializeModelWithOmittedProperties(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $this->assertEquals( - '{"name":"Bob","age_years":12,"owner":null}', - json_encode($model) - ); - } - - #[Test] - public function testSerializeModelWithExplicitNull(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $model->friends = null; - $this->assertEquals( - '{"name":"Bob","age_years":12,"friends":null,"owner":null}', - json_encode($model) - ); - } -} From 47e0b5b6f34a7839ed18f49ed00812ef778b76cc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 12 Dec 2025 11:54:28 +0000 Subject: [PATCH 099/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 6dfdc12a..2e7957ed 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-9d184cb502ab32a85db2889c796cdfebe812f2a55a604df79c85dd4b5e7e2add.yml openapi_spec_hash: a9aa620376fce66532c84f9364209b0b -config_hash: fd112bd17c0c8e9f81a50d0e15ea70d6 +config_hash: 2a4d7992f6d3a0db0e9a430d513d94e6 From 384a7941fca1bda695f5f57546a12e12ce8a8e01 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 12 Dec 2025 11:57:50 +0000 Subject: [PATCH 100/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 2e7957ed..f03cc097 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-9d184cb502ab32a85db2889c796cdfebe812f2a55a604df79c85dd4b5e7e2add.yml openapi_spec_hash: a9aa620376fce66532c84f9364209b0b -config_hash: 2a4d7992f6d3a0db0e9a430d513d94e6 +config_hash: b4f610d4f53fe5bb17b35cf77a7521ea From aeeb5d808126f625a06c67af7ccdc2915ffcf9a7 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 12 Dec 2025 12:01:25 +0000 Subject: [PATCH 101/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index f03cc097..e75a1bc7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 42 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-9d184cb502ab32a85db2889c796cdfebe812f2a55a604df79c85dd4b5e7e2add.yml openapi_spec_hash: a9aa620376fce66532c84f9364209b0b -config_hash: b4f610d4f53fe5bb17b35cf77a7521ea +config_hash: 71cab8223bb5610c6c7ca6e9c4cc1f89 From 629e73bd717a76d55f745a1b25dcec1e38d692d6 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 12 Dec 2025 18:34:03 +0000 Subject: [PATCH 102/193] feat!: improve identifier renaming for names that clash with builtins --- .../FileUploadResponse/SelectedFieldsSchema/DefaultValue.php | 4 ++-- .../DefaultValue/{Mixed1.php => Mixed_.php} | 2 +- .../CustomMetadataField/Schema/DefaultValue.php | 4 ++-- .../Schema/DefaultValue/{Mixed1.php => Mixed_.php} | 2 +- .../CustomMetadataFieldCreateParams/Schema/DefaultValue.php | 4 ++-- .../Schema/DefaultValue/{Mixed1.php => Mixed_.php} | 2 +- .../CustomMetadataFieldUpdateParams/Schema/DefaultValue.php | 4 ++-- .../Schema/DefaultValue/{Mixed1.php => Mixed_.php} | 2 +- src/Files/File/SelectedFieldsSchema/DefaultValue.php | 4 ++-- .../DefaultValue/{Mixed1.php => Mixed_.php} | 2 +- .../FileUploadResponse/SelectedFieldsSchema/DefaultValue.php | 4 ++-- .../DefaultValue/{Mixed1.php => Mixed_.php} | 2 +- .../Data/SelectedFieldsSchema/DefaultValue.php | 4 ++-- .../DefaultValue/{Mixed1.php => Mixed_.php} | 2 +- 14 files changed, 21 insertions(+), 21 deletions(-) rename src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/{Mixed1.php => Mixed_.php} (91%) rename src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/{Mixed1.php => Mixed_.php} (91%) rename src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/{Mixed1.php => Mixed_.php} (91%) rename src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/{Mixed1.php => Mixed_.php} (91%) rename src/Files/File/SelectedFieldsSchema/DefaultValue/{Mixed1.php => Mixed_.php} (91%) rename src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/{Mixed1.php => Mixed_.php} (91%) rename src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/{Mixed1.php => Mixed_.php} (91%) diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php index bfeda0b5..eaaa88f8 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php @@ -4,7 +4,7 @@ namespace Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; -use Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed1; +use Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed_; use Imagekit\Core\Concerns\SdkUnion; use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; @@ -22,6 +22,6 @@ final class DefaultValue implements ConverterSource */ public static function variants(): array { - return ['string', 'float', 'bool', new ListOf(Mixed1::class)]; + return ['string', 'float', 'bool', new ListOf(Mixed_::class)]; } } diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed1.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php similarity index 91% rename from src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed1.php rename to src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php index cf577e5c..f7f51a02 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed1.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php @@ -8,7 +8,7 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; -final class Mixed1 implements ConverterSource +final class Mixed_ implements ConverterSource { use SdkUnion; diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php index c4e99963..1028def8 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php @@ -8,7 +8,7 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; use Imagekit\Core\Conversion\ListOf; -use Imagekit\CustomMetadataFields\CustomMetadataField\Schema\DefaultValue\Mixed1; +use Imagekit\CustomMetadataFields\CustomMetadataField\Schema\DefaultValue\Mixed_; /** * The default value for this custom metadata field. Data type of default value depends on the field type. @@ -22,6 +22,6 @@ final class DefaultValue implements ConverterSource */ public static function variants(): array { - return ['string', 'float', 'bool', new ListOf(Mixed1::class)]; + return ['string', 'float', 'bool', new ListOf(Mixed_::class)]; } } diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed1.php b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed_.php similarity index 91% rename from src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed1.php rename to src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed_.php index c108c42f..7d209231 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed1.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed_.php @@ -8,7 +8,7 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; -final class Mixed1 implements ConverterSource +final class Mixed_ implements ConverterSource { use SdkUnion; diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php index 75973bed..50721478 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php @@ -8,7 +8,7 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; use Imagekit\Core\Conversion\ListOf; -use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\DefaultValue\Mixed1; +use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\DefaultValue\Mixed_; /** * The default value for this custom metadata field. This property is only required if `isValueRequired` property is set to `true`. The value should match the `type` of custom metadata field. @@ -22,6 +22,6 @@ final class DefaultValue implements ConverterSource */ public static function variants(): array { - return ['string', 'float', 'bool', new ListOf(Mixed1::class)]; + return ['string', 'float', 'bool', new ListOf(Mixed_::class)]; } } diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed1.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed_.php similarity index 91% rename from src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed1.php rename to src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed_.php index fa1671fa..29c64a8f 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed1.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed_.php @@ -8,7 +8,7 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; -final class Mixed1 implements ConverterSource +final class Mixed_ implements ConverterSource { use SdkUnion; diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php index a54f0d06..5132a7e1 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php @@ -8,7 +8,7 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; use Imagekit\Core\Conversion\ListOf; -use Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue\Mixed1; +use Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue\Mixed_; /** * The default value for this custom metadata field. This property is only required if `isValueRequired` property is set to `true`. The value should match the `type` of custom metadata field. @@ -22,6 +22,6 @@ final class DefaultValue implements ConverterSource */ public static function variants(): array { - return ['string', 'float', 'bool', new ListOf(Mixed1::class)]; + return ['string', 'float', 'bool', new ListOf(Mixed_::class)]; } } diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed1.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed_.php similarity index 91% rename from src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed1.php rename to src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed_.php index 14125a34..82aa00aa 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed1.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed_.php @@ -8,7 +8,7 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; -final class Mixed1 implements ConverterSource +final class Mixed_ implements ConverterSource { use SdkUnion; diff --git a/src/Files/File/SelectedFieldsSchema/DefaultValue.php b/src/Files/File/SelectedFieldsSchema/DefaultValue.php index 4a9e49aa..4e7c6db9 100644 --- a/src/Files/File/SelectedFieldsSchema/DefaultValue.php +++ b/src/Files/File/SelectedFieldsSchema/DefaultValue.php @@ -8,7 +8,7 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; use Imagekit\Core\Conversion\ListOf; -use Imagekit\Files\File\SelectedFieldsSchema\DefaultValue\Mixed1; +use Imagekit\Files\File\SelectedFieldsSchema\DefaultValue\Mixed_; /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. @@ -22,6 +22,6 @@ final class DefaultValue implements ConverterSource */ public static function variants(): array { - return ['string', 'float', 'bool', new ListOf(Mixed1::class)]; + return ['string', 'float', 'bool', new ListOf(Mixed_::class)]; } } diff --git a/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed1.php b/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed_.php similarity index 91% rename from src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed1.php rename to src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed_.php index 9d9297c2..62504461 100644 --- a/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed1.php +++ b/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed_.php @@ -8,7 +8,7 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; -final class Mixed1 implements ConverterSource +final class Mixed_ implements ConverterSource { use SdkUnion; diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php index a592eb4f..dc49a79e 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php @@ -8,7 +8,7 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; use Imagekit\Core\Conversion\ListOf; -use Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed1; +use Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed_; /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. @@ -22,6 +22,6 @@ final class DefaultValue implements ConverterSource */ public static function variants(): array { - return ['string', 'float', 'bool', new ListOf(Mixed1::class)]; + return ['string', 'float', 'bool', new ListOf(Mixed_::class)]; } } diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed1.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php similarity index 91% rename from src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed1.php rename to src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php index 93cf76b5..ec5ea825 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed1.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php @@ -8,7 +8,7 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; -final class Mixed1 implements ConverterSource +final class Mixed_ implements ConverterSource { use SdkUnion; diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php index 44d79dfa..b302081d 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php @@ -8,7 +8,7 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; use Imagekit\Core\Conversion\ListOf; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue\Mixed1; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue\Mixed_; /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. @@ -22,6 +22,6 @@ final class DefaultValue implements ConverterSource */ public static function variants(): array { - return ['string', 'float', 'bool', new ListOf(Mixed1::class)]; + return ['string', 'float', 'bool', new ListOf(Mixed_::class)]; } } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed1.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed_.php similarity index 91% rename from src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed1.php rename to src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed_.php index 187b1a7f..05ce9049 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed1.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed_.php @@ -8,7 +8,7 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; -final class Mixed1 implements ConverterSource +final class Mixed_ implements ConverterSource { use SdkUnion; From b7e0d887e721da064ebce2d8f4319af258170d5e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 16:53:07 +0000 Subject: [PATCH 103/193] feat!: use aliases for phpstan types --- src/Accounts/Origins/OriginCreateParams.php | 12 +- src/Accounts/Origins/OriginRequest.php | 11 ++ .../Origins/OriginRequest/AkeneoPim.php | 2 +- .../OriginRequest/AzureBlobStorage.php | 2 +- .../OriginRequest/CloudinaryBackup.php | 2 +- .../OriginRequest/GoogleCloudStorageGcs.php | 2 +- src/Accounts/Origins/OriginRequest/S3.php | 2 +- .../Origins/OriginRequest/S3Compatible.php | 2 +- .../Origins/OriginRequest/WebFolder.php | 2 +- .../Origins/OriginRequest/WebProxy.php | 2 +- src/Accounts/Origins/OriginResponse.php | 11 ++ .../Origins/OriginResponse/AkeneoPim.php | 2 +- .../OriginResponse/AzureBlobStorage.php | 2 +- .../OriginResponse/CloudinaryBackup.php | 2 +- .../OriginResponse/GoogleCloudStorageGcs.php | 2 +- src/Accounts/Origins/OriginResponse/S3.php | 2 +- .../Origins/OriginResponse/S3Compatible.php | 2 +- .../Origins/OriginResponse/WebFolder.php | 2 +- .../Origins/OriginResponse/WebProxy.php | 2 +- src/Accounts/Origins/OriginUpdateParams.php | 12 +- .../URLEndpoints/URLEndpointCreateParams.php | 24 +--- .../URLEndpointCreateParams/URLRewriter.php | 6 + .../URLRewriter/AkamaiURLRewriter.php | 2 +- .../URLRewriter/CloudinaryURLRewriter.php | 2 +- .../URLRewriter/ImgixURLRewriter.php | 2 +- .../URLEndpoints/URLEndpointRequest.php | 16 +-- .../URLEndpointRequest/URLRewriter.php | 6 + .../URLRewriter/AkamaiURLRewriter.php | 2 +- .../URLRewriter/CloudinaryURLRewriter.php | 2 +- .../URLRewriter/ImgixURLRewriter.php | 2 +- .../URLEndpoints/URLEndpointResponse.php | 16 +-- .../URLEndpointResponse/URLRewriter.php | 6 + .../URLRewriter/AkamaiURLRewriter.php | 2 +- .../URLRewriter/CloudinaryURLRewriter.php | 2 +- .../URLRewriter/ImgixURLRewriter.php | 2 +- .../URLEndpoints/URLEndpointUpdateParams.php | 24 +--- .../URLEndpointUpdateParams/URLRewriter.php | 6 + .../URLRewriter/AkamaiURLRewriter.php | 2 +- .../URLRewriter/CloudinaryURLRewriter.php | 2 +- .../URLRewriter/ImgixURLRewriter.php | 2 +- src/Assets/AssetListParams.php | 14 +- src/Assets/AssetListResponseItem.php | 5 + src/BaseOverlay.php | 27 ++-- src/Beta/V2/Files/FileUploadParams.php | 74 ++++------ .../Files/FileUploadParams/Transformation.php | 26 +--- .../FileUploadParams/Transformation/Post.php | 8 ++ .../Post/AdaptiveBitrateStreaming.php | 2 +- .../Transformation/Post/ConvertGifToVideo.php | 2 +- .../Post/GenerateAThumbnail.php | 2 +- .../Post/SimplePostTransformation.php | 2 +- src/Beta/V2/Files/FileUploadResponse.php | 108 +++----------- .../FileUploadResponse/ExtensionStatus.php | 8 +- .../SelectedFieldsSchema.php | 29 ++-- .../SelectedFieldsSchema/DefaultValue.php | 4 + .../DefaultValue/Mixed_.php | 3 + .../SelectedFieldsSchema/MaxValue.php | 2 + .../SelectedFieldsSchema/MinValue.php | 2 + .../SelectedFieldsSchema/SelectOption.php | 3 + .../Invalidation/InvalidationGetResponse.php | 2 +- src/Core/Concerns/SdkModel.php | 2 - .../CustomMetadataField.php | 27 +--- .../CustomMetadataField/Schema.php | 29 ++-- .../Schema/DefaultValue.php | 4 + .../Schema/DefaultValue/Mixed_.php | 3 + .../CustomMetadataField/Schema/MaxValue.php | 2 + .../CustomMetadataField/Schema/MinValue.php | 2 + .../Schema/SelectOption.php | 3 + .../CustomMetadataFieldCreateParams.php | 38 +---- .../Schema.php | 29 ++-- .../Schema/DefaultValue.php | 4 + .../Schema/DefaultValue/Mixed_.php | 3 + .../Schema/MaxValue.php | 2 + .../Schema/MinValue.php | 2 + .../Schema/SelectOption.php | 3 + .../CustomMetadataFieldListParams.php | 2 +- .../CustomMetadataFieldUpdateParams.php | 33 +---- .../Schema.php | 27 ++-- .../Schema/DefaultValue.php | 4 + .../Schema/DefaultValue/Mixed_.php | 3 + .../Schema/MaxValue.php | 2 + .../Schema/MinValue.php | 2 + .../Schema/SelectOption.php | 3 + src/ExtensionItem.php | 7 + .../AutoDescriptionExtension.php | 4 +- src/ExtensionItem/AutoTaggingExtension.php | 2 +- src/ExtensionItem/RemovedotBgExtension.php | 18 +-- src/Files/File.php | 50 ++----- src/Files/File/SelectedFieldsSchema.php | 29 ++-- .../SelectedFieldsSchema/DefaultValue.php | 4 + .../DefaultValue/Mixed_.php | 3 + .../File/SelectedFieldsSchema/MaxValue.php | 2 + .../File/SelectedFieldsSchema/MinValue.php | 2 + .../SelectedFieldsSchema/SelectOption.php | 3 + src/Files/FileCopyParams.php | 4 +- src/Files/FileRenameParams.php | 2 +- src/Files/FileUpdateParams.php | 46 +++--- src/Files/FileUpdateParams/RemoveAITags.php | 2 + src/Files/FileUpdateResponse.php | 71 +++------- .../FileUpdateResponse/ExtensionStatus.php | 8 +- src/Files/FileUploadParams.php | 80 ++++------- src/Files/FileUploadParams/Transformation.php | 26 +--- .../FileUploadParams/Transformation/Post.php | 8 ++ .../Post/AdaptiveBitrateStreaming.php | 2 +- .../Transformation/Post/ConvertGifToVideo.php | 2 +- .../Post/GenerateAThumbnail.php | 2 +- .../Post/SimplePostTransformation.php | 2 +- src/Files/FileUploadResponse.php | 108 +++----------- .../FileUploadResponse/ExtensionStatus.php | 8 +- .../SelectedFieldsSchema.php | 29 ++-- .../SelectedFieldsSchema/DefaultValue.php | 4 + .../DefaultValue/Mixed_.php | 3 + .../SelectedFieldsSchema/MaxValue.php | 2 + .../SelectedFieldsSchema/MinValue.php | 2 + .../SelectedFieldsSchema/SelectOption.php | 3 + src/Files/Folder.php | 2 +- src/Files/Metadata.php | 26 +--- src/Files/Metadata/Exif.php | 132 +++--------------- src/Files/UpdateFileRequest.php | 5 + .../ChangePublicationStatus.php | 14 +- .../UpdateFileRequest/UpdateFileDetails.php | 25 ++-- .../UpdateFileDetails/RemoveAITags.php | 2 + src/Folders/FolderCopyParams.php | 2 +- src/Folders/FolderRenameParams.php | 2 +- src/Folders/Job/JobGetResponse.php | 4 +- src/GetImageAttributesOptions.php | 2 +- src/ImageOverlay.php | 32 ++--- src/Overlay.php | 6 + src/OverlayPosition.php | 11 +- src/OverlayPosition/X.php | 2 + src/OverlayPosition/Y.php | 2 + src/OverlayTiming.php | 18 ++- src/OverlayTiming/Duration.php | 2 + src/OverlayTiming/End.php | 2 + src/OverlayTiming/Start.php | 2 + .../Accounts/OriginsRawContract.php | 4 +- .../Accounts/URLEndpointsRawContract.php | 4 +- .../Accounts/UsageRawContract.php | 2 +- src/ServiceContracts/AssetsRawContract.php | 2 +- .../Beta/V2/FilesRawContract.php | 2 +- .../Cache/InvalidationRawContract.php | 2 +- .../CustomMetadataFieldsRawContract.php | 6 +- .../Files/BulkRawContract.php | 8 +- .../Files/MetadataRawContract.php | 2 +- .../Files/VersionsRawContract.php | 6 +- src/ServiceContracts/FilesRawContract.php | 10 +- src/ServiceContracts/FoldersRawContract.php | 10 +- src/SolidColorOverlay.php | 51 ++----- src/SolidColorOverlayTransformation.php | 26 +++- .../Gradient.php | 2 + .../Height.php | 2 + .../Radius.php | 2 + src/SolidColorOverlayTransformation/Width.php | 2 + src/SrcOptions.php | 2 +- src/SubtitleOverlay.php | 56 ++------ src/SubtitleOverlayTransformation.php | 2 +- src/TextOverlay.php | 69 ++------- src/TextOverlayTransformation.php | 42 ++++-- src/TextOverlayTransformation/FontSize.php | 2 + src/TextOverlayTransformation/LineHeight.php | 2 + src/TextOverlayTransformation/Padding.php | 2 + src/TextOverlayTransformation/Radius.php | 2 + src/TextOverlayTransformation/Rotation.php | 2 + src/TextOverlayTransformation/Width.php | 2 + src/Transformation.php | 132 ++++++++++++++---- src/Transformation/AIDropShadow.php | 2 + src/Transformation/AspectRatio.php | 2 + src/Transformation/Duration.php | 2 + src/Transformation/EndOffset.php | 2 + src/Transformation/Gradient.php | 2 + src/Transformation/Height.php | 2 + src/Transformation/Page.php | 2 + src/Transformation/Radius.php | 2 + src/Transformation/Rotation.php | 2 + src/Transformation/Shadow.php | 2 + src/Transformation/Sharpen.php | 2 + src/Transformation/StartOffset.php | 2 + src/Transformation/Trim.php | 2 + src/Transformation/UnsharpMask.php | 2 + src/Transformation/Width.php | 2 + src/Transformation/X.php | 2 + src/Transformation/XCenter.php | 2 + src/Transformation/Y.php | 2 + src/Transformation/YCenter.php | 2 + src/VideoOverlay.php | 32 ++--- src/Webhooks/UnsafeUnwrapWebhookEvent.php | 10 ++ src/Webhooks/UnwrapWebhookEvent.php | 10 ++ .../UploadPostTransformErrorEvent.php | 34 ++--- .../UploadPostTransformErrorEvent/Data.php | 9 +- .../Data/Transformation.php | 8 +- .../UploadPostTransformErrorEvent/Request.php | 14 +- .../Request/Transformation.php | 4 +- .../UploadPostTransformSuccessEvent.php | 20 ++- .../Request.php | 14 +- .../Request/Transformation.php | 4 +- src/Webhooks/UploadPreTransformErrorEvent.php | 20 ++- .../UploadPreTransformErrorEvent/Data.php | 9 +- .../Data/Transformation.php | 8 +- .../UploadPreTransformSuccessEvent.php | 72 ++-------- .../UploadPreTransformSuccessEvent/Data.php | 108 +++----------- .../Data/ExtensionStatus.php | 8 +- .../Data/SelectedFieldsSchema.php | 29 ++-- .../SelectedFieldsSchema/DefaultValue.php | 4 + .../DefaultValue/Mixed_.php | 3 + .../Data/SelectedFieldsSchema/MaxValue.php | 2 + .../Data/SelectedFieldsSchema/MinValue.php | 2 + .../SelectedFieldsSchema/SelectOption.php | 3 + .../VideoTransformationAcceptedEvent.php | 21 ++- .../VideoTransformationAcceptedEvent/Data.php | 21 ++- .../Data/Transformation.php | 28 +--- .../Data/Transformation/Options.php | 8 +- .../VideoTransformationErrorEvent.php | 21 ++- .../VideoTransformationErrorEvent/Data.php | 22 ++- .../Data/Transformation.php | 36 ++--- .../Data/Transformation/Error.php | 2 +- .../Data/Transformation/Options.php | 8 +- .../VideoTransformationReadyEvent.php | 32 ++--- .../VideoTransformationReadyEvent/Data.php | 22 ++- .../Data/Transformation.php | 36 ++--- .../Data/Transformation/Options.php | 8 +- .../Data/Transformation/Output.php | 12 +- 220 files changed, 1221 insertions(+), 1568 deletions(-) diff --git a/src/Accounts/Origins/OriginCreateParams.php b/src/Accounts/Origins/OriginCreateParams.php index 42d541ae..6225eaab 100644 --- a/src/Accounts/Origins/OriginCreateParams.php +++ b/src/Accounts/Origins/OriginCreateParams.php @@ -17,18 +17,18 @@ * @see Imagekit\Services\Accounts\OriginsService::create() * * @phpstan-type OriginCreateParamsShape = array{ + * type: 'AKENEO_PIM', * accessKey: string, * bucket: string, * name: string, * secretKey: string, - * type: 'AKENEO_PIM', - * baseURLForCanonicalHeader?: string, - * includeCanonicalHeader?: bool, - * prefix?: string, + * baseURLForCanonicalHeader?: string|null, + * includeCanonicalHeader?: bool|null, + * prefix?: string|null, * endpoint: string, - * s3ForcePathStyle?: bool, + * s3ForcePathStyle?: bool|null, * baseURL: string, - * forwardHostHeaderToOrigin?: bool, + * forwardHostHeaderToOrigin?: bool|null, * clientEmail: string, * privateKey: string, * accountName: string, diff --git a/src/Accounts/Origins/OriginRequest.php b/src/Accounts/Origins/OriginRequest.php index 1cf1f279..ddf412ca 100644 --- a/src/Accounts/Origins/OriginRequest.php +++ b/src/Accounts/Origins/OriginRequest.php @@ -18,6 +18,17 @@ /** * Schema for origin request resources. + * + * @phpstan-import-type S3Shape from \Imagekit\Accounts\Origins\OriginRequest\S3 + * @phpstan-import-type S3CompatibleShape from \Imagekit\Accounts\Origins\OriginRequest\S3Compatible + * @phpstan-import-type CloudinaryBackupShape from \Imagekit\Accounts\Origins\OriginRequest\CloudinaryBackup + * @phpstan-import-type WebFolderShape from \Imagekit\Accounts\Origins\OriginRequest\WebFolder + * @phpstan-import-type WebProxyShape from \Imagekit\Accounts\Origins\OriginRequest\WebProxy + * @phpstan-import-type GoogleCloudStorageGcsShape from \Imagekit\Accounts\Origins\OriginRequest\GoogleCloudStorageGcs + * @phpstan-import-type AzureBlobStorageShape from \Imagekit\Accounts\Origins\OriginRequest\AzureBlobStorage + * @phpstan-import-type AkeneoPimShape from \Imagekit\Accounts\Origins\OriginRequest\AkeneoPim + * + * @phpstan-type OriginRequestShape = S3Shape|S3CompatibleShape|CloudinaryBackupShape|WebFolderShape|WebProxyShape|GoogleCloudStorageGcsShape|AzureBlobStorageShape|AkeneoPimShape */ final class OriginRequest implements ConverterSource { diff --git a/src/Accounts/Origins/OriginRequest/AkeneoPim.php b/src/Accounts/Origins/OriginRequest/AkeneoPim.php index e3bbef38..7e474089 100644 --- a/src/Accounts/Origins/OriginRequest/AkeneoPim.php +++ b/src/Accounts/Origins/OriginRequest/AkeneoPim.php @@ -16,7 +16,7 @@ * clientSecret: string, * name: string, * password: string, - * type?: 'AKENEO_PIM', + * type: 'AKENEO_PIM', * username: string, * baseURLForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, diff --git a/src/Accounts/Origins/OriginRequest/AzureBlobStorage.php b/src/Accounts/Origins/OriginRequest/AzureBlobStorage.php index eb0b2e5f..c15c2428 100644 --- a/src/Accounts/Origins/OriginRequest/AzureBlobStorage.php +++ b/src/Accounts/Origins/OriginRequest/AzureBlobStorage.php @@ -15,7 +15,7 @@ * container: string, * name: string, * sasToken: string, - * type?: 'AZURE_BLOB', + * type: 'AZURE_BLOB', * baseURLForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * prefix?: string|null, diff --git a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php index f018f6b3..1be1b7ba 100644 --- a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php @@ -15,7 +15,7 @@ * bucket: string, * name: string, * secretKey: string, - * type?: 'CLOUDINARY_BACKUP', + * type: 'CLOUDINARY_BACKUP', * baseURLForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * prefix?: string|null, diff --git a/src/Accounts/Origins/OriginRequest/GoogleCloudStorageGcs.php b/src/Accounts/Origins/OriginRequest/GoogleCloudStorageGcs.php index ae2fb5ed..deb33ed1 100644 --- a/src/Accounts/Origins/OriginRequest/GoogleCloudStorageGcs.php +++ b/src/Accounts/Origins/OriginRequest/GoogleCloudStorageGcs.php @@ -15,7 +15,7 @@ * clientEmail: string, * name: string, * privateKey: string, - * type?: 'GCS', + * type: 'GCS', * baseURLForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * prefix?: string|null, diff --git a/src/Accounts/Origins/OriginRequest/S3.php b/src/Accounts/Origins/OriginRequest/S3.php index ad6cefea..f7e25b5d 100644 --- a/src/Accounts/Origins/OriginRequest/S3.php +++ b/src/Accounts/Origins/OriginRequest/S3.php @@ -15,7 +15,7 @@ * bucket: string, * name: string, * secretKey: string, - * type?: 'S3', + * type: 'S3', * baseURLForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * prefix?: string|null, diff --git a/src/Accounts/Origins/OriginRequest/S3Compatible.php b/src/Accounts/Origins/OriginRequest/S3Compatible.php index b1e3d28f..6ea62486 100644 --- a/src/Accounts/Origins/OriginRequest/S3Compatible.php +++ b/src/Accounts/Origins/OriginRequest/S3Compatible.php @@ -16,7 +16,7 @@ * endpoint: string, * name: string, * secretKey: string, - * type?: 'S3_COMPATIBLE', + * type: 'S3_COMPATIBLE', * baseURLForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * prefix?: string|null, diff --git a/src/Accounts/Origins/OriginRequest/WebFolder.php b/src/Accounts/Origins/OriginRequest/WebFolder.php index 3592f024..50dd74f5 100644 --- a/src/Accounts/Origins/OriginRequest/WebFolder.php +++ b/src/Accounts/Origins/OriginRequest/WebFolder.php @@ -13,7 +13,7 @@ * @phpstan-type WebFolderShape = array{ * baseURL: string, * name: string, - * type?: 'WEB_FOLDER', + * type: 'WEB_FOLDER', * baseURLForCanonicalHeader?: string|null, * forwardHostHeaderToOrigin?: bool|null, * includeCanonicalHeader?: bool|null, diff --git a/src/Accounts/Origins/OriginRequest/WebProxy.php b/src/Accounts/Origins/OriginRequest/WebProxy.php index 80733ff0..9b0c48bd 100644 --- a/src/Accounts/Origins/OriginRequest/WebProxy.php +++ b/src/Accounts/Origins/OriginRequest/WebProxy.php @@ -12,7 +12,7 @@ /** * @phpstan-type WebProxyShape = array{ * name: string, - * type?: 'WEB_PROXY', + * type: 'WEB_PROXY', * baseURLForCanonicalHeader?: string|null, * includeCanonicalHeader?: bool|null, * } diff --git a/src/Accounts/Origins/OriginResponse.php b/src/Accounts/Origins/OriginResponse.php index 2e6c5539..0f40f023 100644 --- a/src/Accounts/Origins/OriginResponse.php +++ b/src/Accounts/Origins/OriginResponse.php @@ -18,6 +18,17 @@ /** * Origin object as returned by the API (sensitive fields removed). + * + * @phpstan-import-type S3Shape from \Imagekit\Accounts\Origins\OriginResponse\S3 + * @phpstan-import-type S3CompatibleShape from \Imagekit\Accounts\Origins\OriginResponse\S3Compatible + * @phpstan-import-type CloudinaryBackupShape from \Imagekit\Accounts\Origins\OriginResponse\CloudinaryBackup + * @phpstan-import-type WebFolderShape from \Imagekit\Accounts\Origins\OriginResponse\WebFolder + * @phpstan-import-type WebProxyShape from \Imagekit\Accounts\Origins\OriginResponse\WebProxy + * @phpstan-import-type GoogleCloudStorageGcsShape from \Imagekit\Accounts\Origins\OriginResponse\GoogleCloudStorageGcs + * @phpstan-import-type AzureBlobStorageShape from \Imagekit\Accounts\Origins\OriginResponse\AzureBlobStorage + * @phpstan-import-type AkeneoPimShape from \Imagekit\Accounts\Origins\OriginResponse\AkeneoPim + * + * @phpstan-type OriginResponseShape = S3Shape|S3CompatibleShape|CloudinaryBackupShape|WebFolderShape|WebProxyShape|GoogleCloudStorageGcsShape|AzureBlobStorageShape|AkeneoPimShape */ final class OriginResponse implements ConverterSource { diff --git a/src/Accounts/Origins/OriginResponse/AkeneoPim.php b/src/Accounts/Origins/OriginResponse/AkeneoPim.php index c78f4f42..0420eb23 100644 --- a/src/Accounts/Origins/OriginResponse/AkeneoPim.php +++ b/src/Accounts/Origins/OriginResponse/AkeneoPim.php @@ -15,7 +15,7 @@ * baseURL: string, * includeCanonicalHeader: bool, * name: string, - * type?: 'AKENEO_PIM', + * type: 'AKENEO_PIM', * baseURLForCanonicalHeader?: string|null, * } */ diff --git a/src/Accounts/Origins/OriginResponse/AzureBlobStorage.php b/src/Accounts/Origins/OriginResponse/AzureBlobStorage.php index b7766a6b..2e59f273 100644 --- a/src/Accounts/Origins/OriginResponse/AzureBlobStorage.php +++ b/src/Accounts/Origins/OriginResponse/AzureBlobStorage.php @@ -17,7 +17,7 @@ * includeCanonicalHeader: bool, * name: string, * prefix: string, - * type?: 'AZURE_BLOB', + * type: 'AZURE_BLOB', * baseURLForCanonicalHeader?: string|null, * } */ diff --git a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php index 174759c6..ee8073a2 100644 --- a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php @@ -16,7 +16,7 @@ * includeCanonicalHeader: bool, * name: string, * prefix: string, - * type?: 'CLOUDINARY_BACKUP', + * type: 'CLOUDINARY_BACKUP', * baseURLForCanonicalHeader?: string|null, * } */ diff --git a/src/Accounts/Origins/OriginResponse/GoogleCloudStorageGcs.php b/src/Accounts/Origins/OriginResponse/GoogleCloudStorageGcs.php index fba52c9c..9603dafc 100644 --- a/src/Accounts/Origins/OriginResponse/GoogleCloudStorageGcs.php +++ b/src/Accounts/Origins/OriginResponse/GoogleCloudStorageGcs.php @@ -17,7 +17,7 @@ * includeCanonicalHeader: bool, * name: string, * prefix: string, - * type?: 'GCS', + * type: 'GCS', * baseURLForCanonicalHeader?: string|null, * } */ diff --git a/src/Accounts/Origins/OriginResponse/S3.php b/src/Accounts/Origins/OriginResponse/S3.php index 021c64fb..5f3a092c 100644 --- a/src/Accounts/Origins/OriginResponse/S3.php +++ b/src/Accounts/Origins/OriginResponse/S3.php @@ -16,7 +16,7 @@ * includeCanonicalHeader: bool, * name: string, * prefix: string, - * type?: 'S3', + * type: 'S3', * baseURLForCanonicalHeader?: string|null, * } */ diff --git a/src/Accounts/Origins/OriginResponse/S3Compatible.php b/src/Accounts/Origins/OriginResponse/S3Compatible.php index 1574dcd5..c38b8eb5 100644 --- a/src/Accounts/Origins/OriginResponse/S3Compatible.php +++ b/src/Accounts/Origins/OriginResponse/S3Compatible.php @@ -18,7 +18,7 @@ * name: string, * prefix: string, * s3ForcePathStyle: bool, - * type?: 'S3_COMPATIBLE', + * type: 'S3_COMPATIBLE', * baseURLForCanonicalHeader?: string|null, * } */ diff --git a/src/Accounts/Origins/OriginResponse/WebFolder.php b/src/Accounts/Origins/OriginResponse/WebFolder.php index f248e130..6698f921 100644 --- a/src/Accounts/Origins/OriginResponse/WebFolder.php +++ b/src/Accounts/Origins/OriginResponse/WebFolder.php @@ -16,7 +16,7 @@ * forwardHostHeaderToOrigin: bool, * includeCanonicalHeader: bool, * name: string, - * type?: 'WEB_FOLDER', + * type: 'WEB_FOLDER', * baseURLForCanonicalHeader?: string|null, * } */ diff --git a/src/Accounts/Origins/OriginResponse/WebProxy.php b/src/Accounts/Origins/OriginResponse/WebProxy.php index 67386360..bb914556 100644 --- a/src/Accounts/Origins/OriginResponse/WebProxy.php +++ b/src/Accounts/Origins/OriginResponse/WebProxy.php @@ -14,7 +14,7 @@ * id: string, * includeCanonicalHeader: bool, * name: string, - * type?: 'WEB_PROXY', + * type: 'WEB_PROXY', * baseURLForCanonicalHeader?: string|null, * } */ diff --git a/src/Accounts/Origins/OriginUpdateParams.php b/src/Accounts/Origins/OriginUpdateParams.php index b1b26633..854f7834 100644 --- a/src/Accounts/Origins/OriginUpdateParams.php +++ b/src/Accounts/Origins/OriginUpdateParams.php @@ -17,18 +17,18 @@ * @see Imagekit\Services\Accounts\OriginsService::update() * * @phpstan-type OriginUpdateParamsShape = array{ + * type: 'AKENEO_PIM', * accessKey: string, * bucket: string, * name: string, * secretKey: string, - * type: 'AKENEO_PIM', - * baseURLForCanonicalHeader?: string, - * includeCanonicalHeader?: bool, - * prefix?: string, + * baseURLForCanonicalHeader?: string|null, + * includeCanonicalHeader?: bool|null, + * prefix?: string|null, * endpoint: string, - * s3ForcePathStyle?: bool, + * s3ForcePathStyle?: bool|null, * baseURL: string, - * forwardHostHeaderToOrigin?: bool, + * forwardHostHeaderToOrigin?: bool|null, * clientEmail: string, * privateKey: string, * accountName: string, diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php index 7507d7d8..ff96a971 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php @@ -20,15 +20,13 @@ * * @see Imagekit\Services\Accounts\URLEndpointsService::create() * + * @phpstan-import-type URLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter + * * @phpstan-type URLEndpointCreateParamsShape = array{ * description: string, - * origins?: list, - * urlPrefix?: string, - * urlRewriter?: CloudinaryURLRewriter|array{ - * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null - * }|ImgixURLRewriter|array{type?: 'IMGIX'}|AkamaiURLRewriter|array{ - * type?: 'AKAMAI' - * }, + * origins?: list|null, + * urlPrefix?: string|null, + * urlRewriter?: URLRewriterShape|null, * } */ final class URLEndpointCreateParams implements BaseModel @@ -88,11 +86,7 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param list $origins - * @param CloudinaryURLRewriter|array{ - * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null - * }|ImgixURLRewriter|array{type?: 'IMGIX'}|AkamaiURLRewriter|array{ - * type?: 'AKAMAI' - * } $urlRewriter + * @param URLRewriterShape $urlRewriter */ public static function with( string $description, @@ -149,11 +143,7 @@ public function withURLPrefix(string $urlPrefix): self /** * Configuration for third-party URL rewriting. * - * @param CloudinaryURLRewriter|array{ - * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null - * }|ImgixURLRewriter|array{type?: 'IMGIX'}|AkamaiURLRewriter|array{ - * type?: 'AKAMAI' - * } $urlRewriter + * @param URLRewriterShape $urlRewriter */ public function withURLRewriter( CloudinaryURLRewriter|array|ImgixURLRewriter|AkamaiURLRewriter $urlRewriter diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php index 951b2802..4a339f4d 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php @@ -13,6 +13,12 @@ /** * Configuration for third-party URL rewriting. + * + * @phpstan-import-type CloudinaryURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\CloudinaryURLRewriter + * @phpstan-import-type ImgixURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\ImgixURLRewriter + * @phpstan-import-type AkamaiURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\AkamaiURLRewriter + * + * @phpstan-type URLRewriterShape = CloudinaryURLRewriterShape|ImgixURLRewriterShape|AkamaiURLRewriterShape */ final class URLRewriter implements ConverterSource { diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/AkamaiURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/AkamaiURLRewriter.php index 250a1195..9c5f02f5 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/AkamaiURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/AkamaiURLRewriter.php @@ -9,7 +9,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type AkamaiURLRewriterShape = array{type?: 'AKAMAI'} + * @phpstan-type AkamaiURLRewriterShape = array{type: 'AKAMAI'} */ final class AkamaiURLRewriter implements BaseModel { diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/CloudinaryURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/CloudinaryURLRewriter.php index 067f0134..ea434fc5 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/CloudinaryURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/CloudinaryURLRewriter.php @@ -11,7 +11,7 @@ /** * @phpstan-type CloudinaryURLRewriterShape = array{ - * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null + * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null * } */ final class CloudinaryURLRewriter implements BaseModel diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/ImgixURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/ImgixURLRewriter.php index 3d02bf72..d8c4c34c 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/ImgixURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/ImgixURLRewriter.php @@ -9,7 +9,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type ImgixURLRewriterShape = array{type?: 'IMGIX'} + * @phpstan-type ImgixURLRewriterShape = array{type: 'IMGIX'} */ final class ImgixURLRewriter implements BaseModel { diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest.php b/src/Accounts/URLEndpoints/URLEndpointRequest.php index a2c46916..c6dbd0fe 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest.php @@ -16,11 +16,13 @@ /** * Schema for URL endpoint resource. * + * @phpstan-import-type URLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter + * * @phpstan-type URLEndpointRequestShape = array{ * description: string, * origins?: list|null, * urlPrefix?: string|null, - * urlRewriter?: null|CloudinaryURLRewriter|ImgixURLRewriter|AkamaiURLRewriter, + * urlRewriter?: null|URLRewriterShape|CloudinaryURLRewriter|ImgixURLRewriter|AkamaiURLRewriter, * } */ final class URLEndpointRequest implements BaseModel @@ -79,11 +81,7 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param list $origins - * @param CloudinaryURLRewriter|array{ - * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null - * }|ImgixURLRewriter|array{type?: 'IMGIX'}|AkamaiURLRewriter|array{ - * type?: 'AKAMAI' - * } $urlRewriter + * @param URLRewriterShape $urlRewriter */ public static function with( string $description, @@ -140,11 +138,7 @@ public function withURLPrefix(string $urlPrefix): self /** * Configuration for third-party URL rewriting. * - * @param CloudinaryURLRewriter|array{ - * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null - * }|ImgixURLRewriter|array{type?: 'IMGIX'}|AkamaiURLRewriter|array{ - * type?: 'AKAMAI' - * } $urlRewriter + * @param URLRewriterShape $urlRewriter */ public function withURLRewriter( CloudinaryURLRewriter|array|ImgixURLRewriter|AkamaiURLRewriter $urlRewriter diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php index 50c55d13..76a77e9c 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php @@ -13,6 +13,12 @@ /** * Configuration for third-party URL rewriting. + * + * @phpstan-import-type CloudinaryURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\CloudinaryURLRewriter + * @phpstan-import-type ImgixURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\ImgixURLRewriter + * @phpstan-import-type AkamaiURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\AkamaiURLRewriter + * + * @phpstan-type URLRewriterShape = CloudinaryURLRewriterShape|ImgixURLRewriterShape|AkamaiURLRewriterShape */ final class URLRewriter implements ConverterSource { diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/AkamaiURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/AkamaiURLRewriter.php index 72241fe9..02464861 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/AkamaiURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/AkamaiURLRewriter.php @@ -9,7 +9,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type AkamaiURLRewriterShape = array{type?: 'AKAMAI'} + * @phpstan-type AkamaiURLRewriterShape = array{type: 'AKAMAI'} */ final class AkamaiURLRewriter implements BaseModel { diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/CloudinaryURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/CloudinaryURLRewriter.php index a94701b0..51c78f1d 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/CloudinaryURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/CloudinaryURLRewriter.php @@ -11,7 +11,7 @@ /** * @phpstan-type CloudinaryURLRewriterShape = array{ - * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null + * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null * } */ final class CloudinaryURLRewriter implements BaseModel diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/ImgixURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/ImgixURLRewriter.php index f4df9bf5..805c184d 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/ImgixURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/ImgixURLRewriter.php @@ -9,7 +9,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type ImgixURLRewriterShape = array{type?: 'IMGIX'} + * @phpstan-type ImgixURLRewriterShape = array{type: 'IMGIX'} */ final class ImgixURLRewriter implements BaseModel { diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse.php b/src/Accounts/URLEndpoints/URLEndpointResponse.php index 0f3ea3d9..b6ae1858 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse.php @@ -16,12 +16,14 @@ /** * URL‑endpoint object as returned by the API. * + * @phpstan-import-type URLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter + * * @phpstan-type URLEndpointResponseShape = array{ * id: string, * description: string, * origins: list, * urlPrefix: string, - * urlRewriter?: null|CloudinaryURLRewriter|ImgixURLRewriter|AkamaiURLRewriter, + * urlRewriter?: null|URLRewriterShape|CloudinaryURLRewriter|ImgixURLRewriter|AkamaiURLRewriter, * } */ final class URLEndpointResponse implements BaseModel @@ -92,11 +94,7 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param list $origins - * @param CloudinaryURLRewriter|array{ - * preserveAssetDeliveryTypes: bool, type?: 'CLOUDINARY' - * }|ImgixURLRewriter|array{type?: 'IMGIX'}|AkamaiURLRewriter|array{ - * type?: 'AKAMAI' - * } $urlRewriter + * @param URLRewriterShape $urlRewriter */ public static function with( string $id, @@ -166,11 +164,7 @@ public function withURLPrefix(string $urlPrefix): self /** * Configuration for third-party URL rewriting. * - * @param CloudinaryURLRewriter|array{ - * preserveAssetDeliveryTypes: bool, type?: 'CLOUDINARY' - * }|ImgixURLRewriter|array{type?: 'IMGIX'}|AkamaiURLRewriter|array{ - * type?: 'AKAMAI' - * } $urlRewriter + * @param URLRewriterShape $urlRewriter */ public function withURLRewriter( CloudinaryURLRewriter|array|ImgixURLRewriter|AkamaiURLRewriter $urlRewriter diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php index d288d6dc..7272c75c 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php @@ -13,6 +13,12 @@ /** * Configuration for third-party URL rewriting. + * + * @phpstan-import-type CloudinaryURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\CloudinaryURLRewriter + * @phpstan-import-type ImgixURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\ImgixURLRewriter + * @phpstan-import-type AkamaiURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\AkamaiURLRewriter + * + * @phpstan-type URLRewriterShape = CloudinaryURLRewriterShape|ImgixURLRewriterShape|AkamaiURLRewriterShape */ final class URLRewriter implements ConverterSource { diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/AkamaiURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/AkamaiURLRewriter.php index 29de7afb..49c6e64a 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/AkamaiURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/AkamaiURLRewriter.php @@ -9,7 +9,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type AkamaiURLRewriterShape = array{type?: 'AKAMAI'} + * @phpstan-type AkamaiURLRewriterShape = array{type: 'AKAMAI'} */ final class AkamaiURLRewriter implements BaseModel { diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/CloudinaryURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/CloudinaryURLRewriter.php index 93d28791..eb118b3d 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/CloudinaryURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/CloudinaryURLRewriter.php @@ -10,7 +10,7 @@ /** * @phpstan-type CloudinaryURLRewriterShape = array{ - * preserveAssetDeliveryTypes: bool, type?: 'CLOUDINARY' + * preserveAssetDeliveryTypes: bool, type: 'CLOUDINARY' * } */ final class CloudinaryURLRewriter implements BaseModel diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/ImgixURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/ImgixURLRewriter.php index 7b50e2d2..0f122330 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/ImgixURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/ImgixURLRewriter.php @@ -9,7 +9,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type ImgixURLRewriterShape = array{type?: 'IMGIX'} + * @phpstan-type ImgixURLRewriterShape = array{type: 'IMGIX'} */ final class ImgixURLRewriter implements BaseModel { diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php index 2dff6217..a0d2b8f3 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php @@ -20,15 +20,13 @@ * * @see Imagekit\Services\Accounts\URLEndpointsService::update() * + * @phpstan-import-type URLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter + * * @phpstan-type URLEndpointUpdateParamsShape = array{ * description: string, - * origins?: list, - * urlPrefix?: string, - * urlRewriter?: CloudinaryURLRewriter|array{ - * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null - * }|ImgixURLRewriter|array{type?: 'IMGIX'}|AkamaiURLRewriter|array{ - * type?: 'AKAMAI' - * }, + * origins?: list|null, + * urlPrefix?: string|null, + * urlRewriter?: URLRewriterShape|null, * } */ final class URLEndpointUpdateParams implements BaseModel @@ -88,11 +86,7 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param list $origins - * @param CloudinaryURLRewriter|array{ - * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null - * }|ImgixURLRewriter|array{type?: 'IMGIX'}|AkamaiURLRewriter|array{ - * type?: 'AKAMAI' - * } $urlRewriter + * @param URLRewriterShape $urlRewriter */ public static function with( string $description, @@ -149,11 +143,7 @@ public function withURLPrefix(string $urlPrefix): self /** * Configuration for third-party URL rewriting. * - * @param CloudinaryURLRewriter|array{ - * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null - * }|ImgixURLRewriter|array{type?: 'IMGIX'}|AkamaiURLRewriter|array{ - * type?: 'AKAMAI' - * } $urlRewriter + * @param URLRewriterShape $urlRewriter */ public function withURLRewriter( CloudinaryURLRewriter|array|ImgixURLRewriter|AkamaiURLRewriter $urlRewriter diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php index cf468261..a6f04904 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php @@ -13,6 +13,12 @@ /** * Configuration for third-party URL rewriting. + * + * @phpstan-import-type CloudinaryURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\CloudinaryURLRewriter + * @phpstan-import-type ImgixURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\ImgixURLRewriter + * @phpstan-import-type AkamaiURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\AkamaiURLRewriter + * + * @phpstan-type URLRewriterShape = CloudinaryURLRewriterShape|ImgixURLRewriterShape|AkamaiURLRewriterShape */ final class URLRewriter implements ConverterSource { diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/AkamaiURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/AkamaiURLRewriter.php index d2f4b776..fc24126c 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/AkamaiURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/AkamaiURLRewriter.php @@ -9,7 +9,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type AkamaiURLRewriterShape = array{type?: 'AKAMAI'} + * @phpstan-type AkamaiURLRewriterShape = array{type: 'AKAMAI'} */ final class AkamaiURLRewriter implements BaseModel { diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/CloudinaryURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/CloudinaryURLRewriter.php index 05eb3aea..a973fd8e 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/CloudinaryURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/CloudinaryURLRewriter.php @@ -11,7 +11,7 @@ /** * @phpstan-type CloudinaryURLRewriterShape = array{ - * type?: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null + * type: 'CLOUDINARY', preserveAssetDeliveryTypes?: bool|null * } */ final class CloudinaryURLRewriter implements BaseModel diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/ImgixURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/ImgixURLRewriter.php index e4076243..02872eeb 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/ImgixURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/ImgixURLRewriter.php @@ -9,7 +9,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type ImgixURLRewriterShape = array{type?: 'IMGIX'} + * @phpstan-type ImgixURLRewriterShape = array{type: 'IMGIX'} */ final class ImgixURLRewriter implements BaseModel { diff --git a/src/Assets/AssetListParams.php b/src/Assets/AssetListParams.php index 487e23c6..8cac25a6 100644 --- a/src/Assets/AssetListParams.php +++ b/src/Assets/AssetListParams.php @@ -18,13 +18,13 @@ * @see Imagekit\Services\AssetsService::list() * * @phpstan-type AssetListParamsShape = array{ - * fileType?: FileType|value-of, - * limit?: int, - * path?: string, - * searchQuery?: string, - * skip?: int, - * sort?: Sort|value-of, - * type?: Type|value-of, + * fileType?: null|FileType|value-of, + * limit?: int|null, + * path?: string|null, + * searchQuery?: string|null, + * skip?: int|null, + * sort?: null|Sort|value-of, + * type?: null|Type|value-of, * } */ final class AssetListParams implements BaseModel diff --git a/src/Assets/AssetListResponseItem.php b/src/Assets/AssetListResponseItem.php index 500d7c3d..08dba554 100644 --- a/src/Assets/AssetListResponseItem.php +++ b/src/Assets/AssetListResponseItem.php @@ -12,6 +12,11 @@ /** * Object containing details of a file or file version. + * + * @phpstan-import-type FileShape from \Imagekit\Files\File + * @phpstan-import-type FolderShape from \Imagekit\Files\Folder + * + * @phpstan-type AssetListResponseItemShape = FileShape|FolderShape */ final class AssetListResponseItem implements ConverterSource { diff --git a/src/BaseOverlay.php b/src/BaseOverlay.php index 261a28c6..050dbb2f 100644 --- a/src/BaseOverlay.php +++ b/src/BaseOverlay.php @@ -7,11 +7,14 @@ use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\OverlayPosition\Focus; /** + * @phpstan-import-type OverlayPositionShape from \Imagekit\OverlayPosition + * @phpstan-import-type OverlayTimingShape from \Imagekit\OverlayTiming + * * @phpstan-type BaseOverlayShape = array{ - * position?: OverlayPosition|null, timing?: OverlayTiming|null + * position?: null|OverlayPosition|OverlayPositionShape, + * timing?: null|OverlayTiming|OverlayTimingShape, * } */ final class BaseOverlay implements BaseModel @@ -35,14 +38,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param OverlayPosition|array{ - * focus?: value-of|null, x?: float|string|null, y?: float|string|null - * } $position - * @param OverlayTiming|array{ - * duration?: float|string|null, - * end?: float|string|null, - * start?: float|string|null, - * } $timing + * @param OverlayPositionShape $position + * @param OverlayTimingShape $timing */ public static function with( OverlayPosition|array|null $position = null, @@ -57,9 +54,7 @@ public static function with( } /** - * @param OverlayPosition|array{ - * focus?: value-of|null, x?: float|string|null, y?: float|string|null - * } $position + * @param OverlayPositionShape $position */ public function withPosition(OverlayPosition|array $position): self { @@ -70,11 +65,7 @@ public function withPosition(OverlayPosition|array $position): self } /** - * @param OverlayTiming|array{ - * duration?: float|string|null, - * end?: float|string|null, - * start?: float|string|null, - * } $timing + * @param OverlayTimingShape $timing */ public function withTiming(OverlayTiming|array $timing): self { diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index 6b239f15..ab77e5ae 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -6,10 +6,6 @@ use Imagekit\Beta\V2\Files\FileUploadParams\ResponseField; use Imagekit\Beta\V2\Files\FileUploadParams\Transformation; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\ConvertGifToVideo; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\SimplePostTransformation; use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; @@ -18,9 +14,7 @@ use Imagekit\ExtensionItem; use Imagekit\ExtensionItem\AutoDescriptionExtension; use Imagekit\ExtensionItem\AutoTaggingExtension; -use Imagekit\ExtensionItem\AutoTaggingExtension\Name; use Imagekit\ExtensionItem\RemovedotBgExtension; -use Imagekit\ExtensionItem\RemovedotBgExtension\Options; /** * The V2 API enhances security by verifying the entire payload using JWT. This API is in beta. @@ -40,34 +34,30 @@ * * @see Imagekit\Services\Beta\V2\FilesService::upload() * + * @phpstan-import-type ExtensionItemShape from \Imagekit\ExtensionItem + * @phpstan-import-type TransformationShape from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation + * * @phpstan-type FileUploadParamsShape = array{ * file: string, * fileName: string, - * token?: string, - * checks?: string, - * customCoordinates?: string, - * customMetadata?: array, - * description?: string, - * extensions?: list - * }|AutoDescriptionExtension|array{name?: 'ai-auto-description'}>, - * folder?: string, - * isPrivateFile?: bool, - * isPublished?: bool, - * overwriteAITags?: bool, - * overwriteCustomMetadata?: bool, - * overwriteFile?: bool, - * overwriteTags?: bool, - * responseFields?: list>, - * tags?: list, - * transformation?: Transformation|array{ - * post?: list|null, - * pre?: string|null, - * }, - * useUniqueFileName?: bool, - * webhookURL?: string, + * token?: string|null, + * checks?: string|null, + * customCoordinates?: string|null, + * customMetadata?: array|null, + * description?: string|null, + * extensions?: list|null, + * folder?: string|null, + * isPrivateFile?: bool|null, + * isPublished?: bool|null, + * overwriteAITags?: bool|null, + * overwriteCustomMetadata?: bool|null, + * overwriteFile?: bool|null, + * overwriteTags?: bool|null, + * responseFields?: list>|null, + * tags?: list|null, + * transformation?: TransformationShape|null, + * useUniqueFileName?: bool|null, + * webhookURL?: string|null, * } */ final class FileUploadParams implements BaseModel @@ -265,17 +255,10 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param array $customMetadata - * @param list - * }|AutoDescriptionExtension|array{name?: 'ai-auto-description'}> $extensions + * @param list $extensions * @param list> $responseFields * @param list $tags - * @param Transformation|array{ - * post?: list|null, - * pre?: string|null, - * } $transformation + * @param TransformationShape $transformation */ public static function with( string $file, @@ -424,11 +407,7 @@ public function withDescription(string $description): self /** * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * - * @param list - * }|AutoDescriptionExtension|array{name?: 'ai-auto-description'}> $extensions + * @param list $extensions */ public function withExtensions(array $extensions): self { @@ -561,10 +540,7 @@ public function withTags(array $tags): self * * You can mix and match any combination of post-processing types. * - * @param Transformation|array{ - * post?: list|null, - * pre?: string|null, - * } $transformation + * @param TransformationShape $transformation */ public function withTransformation( Transformation|array $transformation diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation.php index ea027afb..27c283e3 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation.php @@ -6,7 +6,6 @@ use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post; use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming\Protocol; use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\ConvertGifToVideo; use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail; use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\SimplePostTransformation; @@ -25,9 +24,10 @@ * * You can mix and match any combination of post-processing types. * + * @phpstan-import-type PostShape from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post + * * @phpstan-type TransformationShape = array{ - * post?: list|null, - * pre?: string|null, + * post?: list|null, pre?: string|null * } */ final class Transformation implements BaseModel @@ -61,15 +61,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list, type?: 'abs', value: string - * }> $post + * @param list $post */ public static function with(?array $post = null, ?string $pre = null): self { @@ -86,15 +78,7 @@ public static function with(?array $post = null, ?string $pre = null): self * Each item must match one of the following types: * `transformation`, `gif-to-video`, `thumbnail`, `abs`. * - * @param list, type?: 'abs', value: string - * }> $post + * @param list $post */ public function withPost(array $post): self { diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php index 7b51547d..8ef59faa 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php @@ -12,6 +12,14 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; +/** + * @phpstan-import-type SimplePostTransformationShape from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\SimplePostTransformation + * @phpstan-import-type ConvertGifToVideoShape from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\ConvertGifToVideo + * @phpstan-import-type GenerateAThumbnailShape from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail + * @phpstan-import-type AdaptiveBitrateStreamingShape from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming + * + * @phpstan-type PostShape = SimplePostTransformationShape|ConvertGifToVideoShape|GenerateAThumbnailShape|AdaptiveBitrateStreamingShape + */ final class Post implements ConverterSource { use SdkUnion; diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php index a9efb670..1c2df6dc 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php @@ -11,7 +11,7 @@ /** * @phpstan-type AdaptiveBitrateStreamingShape = array{ - * protocol: value-of, type?: 'abs', value: string + * protocol: Protocol|value-of, type: 'abs', value: string * } */ final class AdaptiveBitrateStreaming implements BaseModel diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php index 74113824..613ac667 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php @@ -11,7 +11,7 @@ /** * @phpstan-type ConvertGifToVideoShape = array{ - * type?: 'gif-to-video', value?: string|null + * type: 'gif-to-video', value?: string|null * } */ final class ConvertGifToVideo implements BaseModel diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php index 513de76c..09321e61 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php @@ -11,7 +11,7 @@ /** * @phpstan-type GenerateAThumbnailShape = array{ - * type?: 'thumbnail', value?: string|null + * type: 'thumbnail', value?: string|null * } */ final class GenerateAThumbnail implements BaseModel diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php index b32a5759..d30dd815 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php @@ -10,7 +10,7 @@ /** * @phpstan-type SimplePostTransformationShape = array{ - * type?: 'transformation', value: string + * type: 'transformation', value: string * } */ final class SimplePostTransformation implements BaseModel diff --git a/src/Beta/V2/Files/FileUploadResponse.php b/src/Beta/V2/Files/FileUploadResponse.php index 42309f3e..0e345a9b 100644 --- a/src/Beta/V2/Files/FileUploadResponse.php +++ b/src/Beta/V2/Files/FileUploadResponse.php @@ -6,24 +6,24 @@ use Imagekit\Beta\V2\Files\FileUploadResponse\AITag; use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; -use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\AIAutoDescription; -use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\AwsAutoTagging; -use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\GoogleAutoTagging; -use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\RemoveBg; use Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; -use Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\Type; use Imagekit\Beta\V2\Files\FileUploadResponse\VersionInfo; use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Files\Metadata; -use Imagekit\Files\Metadata\Exif; /** * Object containing details of a successful upload. * + * @phpstan-import-type AITagShape from \Imagekit\Beta\V2\Files\FileUploadResponse\AITag + * @phpstan-import-type ExtensionStatusShape from \Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus + * @phpstan-import-type MetadataShape from \Imagekit\Files\Metadata + * @phpstan-import-type SelectedFieldsSchemaShape from \Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema + * @phpstan-import-type VersionInfoShape from \Imagekit\Beta\V2\Files\FileUploadResponse\VersionInfo + * * @phpstan-type FileUploadResponseShape = array{ - * aiTags?: list|null, + * aiTags?: list|null, * audioCodec?: string|null, * bitRate?: int|null, * customCoordinates?: string|null, @@ -31,21 +31,21 @@ * description?: string|null, * duration?: int|null, * embeddedMetadata?: array|null, - * extensionStatus?: ExtensionStatus|null, + * extensionStatus?: null|ExtensionStatus|ExtensionStatusShape, * fileID?: string|null, * filePath?: string|null, * fileType?: string|null, * height?: float|null, * isPrivateFile?: bool|null, * isPublished?: bool|null, - * metadata?: Metadata|null, + * metadata?: null|Metadata|MetadataShape, * name?: string|null, - * selectedFieldsSchema?: array|null, + * selectedFieldsSchema?: array|null, * size?: float|null, * tags?: list|null, * thumbnailURL?: string|null, * url?: string|null, - * versionInfo?: VersionInfo|null, + * versionInfo?: null|VersionInfo|VersionInfoShape, * videoCodec?: string|null, * width?: float|null, * } @@ -235,47 +235,14 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list|null $aiTags + * @param list|null $aiTags * @param array $customMetadata * @param array $embeddedMetadata - * @param ExtensionStatus|array{ - * aiAutoDescription?: value-of|null, - * awsAutoTagging?: value-of|null, - * googleAutoTagging?: value-of|null, - * removeBg?: value-of|null, - * } $extensionStatus - * @param Metadata|array{ - * audioCodec?: string|null, - * bitRate?: int|null, - * density?: int|null, - * duration?: int|null, - * exif?: Exif|null, - * format?: string|null, - * hasColorProfile?: bool|null, - * hasTransparency?: bool|null, - * height?: int|null, - * pHash?: string|null, - * quality?: int|null, - * size?: int|null, - * videoCodec?: string|null, - * width?: int|null, - * } $metadata - * @param array, - * defaultValue?: string|float|bool|list|null, - * isValueRequired?: bool|null, - * maxLength?: float|null, - * maxValue?: string|float|null, - * minLength?: float|null, - * minValue?: string|float|null, - * readOnly?: bool|null, - * selectOptions?: list|null, - * selectOptionsTruncated?: bool|null, - * }> $selectedFieldsSchema + * @param ExtensionStatusShape $extensionStatus + * @param MetadataShape $metadata + * @param array $selectedFieldsSchema * @param list|null $tags - * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo + * @param VersionInfoShape $versionInfo */ public static function with( ?array $aiTags = null, @@ -338,9 +305,7 @@ public static function with( /** * An array of tags assigned to the uploaded file by auto tagging. * - * @param list|null $aiTags + * @param list|null $aiTags */ public function withAITags(?array $aiTags): self { @@ -440,12 +405,7 @@ public function withEmbeddedMetadata(array $embeddedMetadata): self * * If no extension was requested, then this parameter is not returned. * - * @param ExtensionStatus|array{ - * aiAutoDescription?: value-of|null, - * awsAutoTagging?: value-of|null, - * googleAutoTagging?: value-of|null, - * removeBg?: value-of|null, - * } $extensionStatus + * @param ExtensionStatusShape $extensionStatus */ public function withExtensionStatus( ExtensionStatus|array $extensionStatus @@ -525,22 +485,7 @@ public function withIsPublished(bool $isPublished): self /** * Legacy metadata. Send `metadata` in `responseFields` in API request to get metadata in the upload API response. * - * @param Metadata|array{ - * audioCodec?: string|null, - * bitRate?: int|null, - * density?: int|null, - * duration?: int|null, - * exif?: Exif|null, - * format?: string|null, - * hasColorProfile?: bool|null, - * hasTransparency?: bool|null, - * height?: int|null, - * pHash?: string|null, - * quality?: int|null, - * size?: int|null, - * videoCodec?: string|null, - * width?: int|null, - * } $metadata + * @param MetadataShape $metadata */ public function withMetadata(Metadata|array $metadata): self { @@ -568,18 +513,7 @@ public function withName(string $name): self * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @param array, - * defaultValue?: string|float|bool|list|null, - * isValueRequired?: bool|null, - * maxLength?: float|null, - * maxValue?: string|float|null, - * minLength?: float|null, - * minValue?: string|float|null, - * readOnly?: bool|null, - * selectOptions?: list|null, - * selectOptionsTruncated?: bool|null, - * }> $selectedFieldsSchema + * @param array $selectedFieldsSchema */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { @@ -638,7 +572,7 @@ public function withURL(string $url): self /** * An object containing the file or file version's `id` (versionId) and `name`. * - * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo + * @param VersionInfoShape $versionInfo */ public function withVersionInfo(VersionInfo|array $versionInfo): self { diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php index bacaf4b7..93129fb2 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php @@ -22,10 +22,10 @@ * If no extension was requested, then this parameter is not returned. * * @phpstan-type ExtensionStatusShape = array{ - * aiAutoDescription?: value-of|null, - * awsAutoTagging?: value-of|null, - * googleAutoTagging?: value-of|null, - * removeBg?: value-of|null, + * aiAutoDescription?: null|AIAutoDescription|value-of, + * awsAutoTagging?: null|AwsAutoTagging|value-of, + * googleAutoTagging?: null|GoogleAutoTagging|value-of, + * removeBg?: null|RemoveBg|value-of, * } */ final class ExtensionStatus implements BaseModel diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php index 04788c71..7e920c01 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php @@ -13,16 +13,21 @@ use Imagekit\Core\Contracts\BaseModel; /** + * @phpstan-import-type DefaultValueShape from \Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue + * @phpstan-import-type MaxValueShape from \Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\MaxValue + * @phpstan-import-type MinValueShape from \Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\MinValue + * @phpstan-import-type SelectOptionShape from \Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\SelectOption + * * @phpstan-type SelectedFieldsSchemaShape = array{ - * type: value-of, - * defaultValue?: string|float|bool|null|list, + * type: Type|value-of, + * defaultValue?: DefaultValueShape|null, * isValueRequired?: bool|null, * maxLength?: float|null, - * maxValue?: string|float|null, + * maxValue?: MaxValueShape|null, * minLength?: float|null, - * minValue?: string|float|null, + * minValue?: MinValueShape|null, * readOnly?: bool|null, - * selectOptions?: list|null, + * selectOptions?: list|null, * selectOptionsTruncated?: bool|null, * } */ @@ -122,8 +127,10 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Type|value-of $type - * @param string|float|bool|list $defaultValue - * @param list $selectOptions + * @param DefaultValueShape $defaultValue + * @param MaxValueShape $maxValue + * @param MinValueShape $minValue + * @param list $selectOptions */ public static function with( Type|string $type, @@ -170,7 +177,7 @@ public function withType(Type|string $type): self /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. * - * @param string|float|bool|list $defaultValue + * @param DefaultValueShape $defaultValue */ public function withDefaultValue( string|float|bool|array $defaultValue @@ -205,6 +212,8 @@ public function withMaxLength(float $maxLength): self /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @param MaxValueShape $maxValue */ public function withMaxValue(string|float $maxValue): self { @@ -227,6 +236,8 @@ public function withMinLength(float $minLength): self /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @param MinValueShape $minValue */ public function withMinValue(string|float $minValue): self { @@ -250,7 +261,7 @@ public function withReadOnly(bool $readOnly): self /** * An array of allowed values when field type is `SingleSelect` or `MultiSelect`. * - * @param list $selectOptions + * @param list $selectOptions */ public function withSelectOptions(array $selectOptions): self { diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php index eaaa88f8..e7d8babd 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php @@ -12,6 +12,10 @@ /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. + * + * @phpstan-import-type MixedShape from \Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed_ + * + * @phpstan-type DefaultValueShape = string|float|bool|list */ final class DefaultValue implements ConverterSource { diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php index f7f51a02..f463a558 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php @@ -8,6 +8,9 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; +/** + * @phpstan-type MixedShape = string|float|bool + */ final class Mixed_ implements ConverterSource { use SdkUnion; diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php index 14792174..c6fd7e8c 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php @@ -10,6 +10,8 @@ /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @phpstan-type MaxValueShape = string|float */ final class MaxValue implements ConverterSource { diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php index 36dfab6f..046152bc 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php @@ -10,6 +10,8 @@ /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @phpstan-type MinValueShape = string|float */ final class MinValue implements ConverterSource { diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php index 4c15c3e0..cf02f607 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php @@ -8,6 +8,9 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; +/** + * @phpstan-type SelectOptionShape = string|float|bool + */ final class SelectOption implements ConverterSource { use SdkUnion; diff --git a/src/Cache/Invalidation/InvalidationGetResponse.php b/src/Cache/Invalidation/InvalidationGetResponse.php index e68359b4..c4e12c89 100644 --- a/src/Cache/Invalidation/InvalidationGetResponse.php +++ b/src/Cache/Invalidation/InvalidationGetResponse.php @@ -11,7 +11,7 @@ /** * @phpstan-type InvalidationGetResponseShape = array{ - * status?: value-of|null + * status?: null|Status|value-of * } */ final class InvalidationGetResponse implements BaseModel diff --git a/src/Core/Concerns/SdkModel.php b/src/Core/Concerns/SdkModel.php index e8fbd471..7c0d214e 100644 --- a/src/Core/Concerns/SdkModel.php +++ b/src/Core/Concerns/SdkModel.php @@ -75,8 +75,6 @@ public function __toString(): string * a native class property, indicating an omitted value, * or a property overridden with an incongruent type * - * @return value-of - * * @throws \Exception */ public function __get(string $key): mixed diff --git a/src/CustomMetadataFields/CustomMetadataField.php b/src/CustomMetadataFields/CustomMetadataField.php index 09b77980..b704d594 100644 --- a/src/CustomMetadataFields/CustomMetadataField.php +++ b/src/CustomMetadataFields/CustomMetadataField.php @@ -8,13 +8,14 @@ use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\CustomMetadataFields\CustomMetadataField\Schema; -use Imagekit\CustomMetadataFields\CustomMetadataField\Schema\Type; /** * Object containing details of a custom metadata field. * + * @phpstan-import-type SchemaShape from \Imagekit\CustomMetadataFields\CustomMetadataField\Schema + * * @phpstan-type CustomMetadataFieldShape = array{ - * id: string, label: string, name: string, schema: Schema + * id: string, label: string, name: string, schema: Schema|SchemaShape * } */ final class CustomMetadataField implements BaseModel @@ -74,16 +75,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Schema|array{ - * type: value-of, - * defaultValue?: string|float|bool|list|null, - * isValueRequired?: bool|null, - * maxLength?: float|null, - * maxValue?: string|float|null, - * minLength?: float|null, - * minValue?: string|float|null, - * selectOptions?: list|null, - * } $schema + * @param SchemaShape $schema */ public static function with( string $id, @@ -137,16 +129,7 @@ public function withName(string $name): self /** * An object that describes the rules for the custom metadata field value. * - * @param Schema|array{ - * type: value-of, - * defaultValue?: string|float|bool|list|null, - * isValueRequired?: bool|null, - * maxLength?: float|null, - * maxValue?: string|float|null, - * minLength?: float|null, - * minValue?: string|float|null, - * selectOptions?: list|null, - * } $schema + * @param SchemaShape $schema */ public function withSchema(Schema|array $schema): self { diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema.php b/src/CustomMetadataFields/CustomMetadataField/Schema.php index 11934c1b..d9b012ba 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema.php @@ -15,15 +15,20 @@ /** * An object that describes the rules for the custom metadata field value. * + * @phpstan-import-type DefaultValueShape from \Imagekit\CustomMetadataFields\CustomMetadataField\Schema\DefaultValue + * @phpstan-import-type MaxValueShape from \Imagekit\CustomMetadataFields\CustomMetadataField\Schema\MaxValue + * @phpstan-import-type MinValueShape from \Imagekit\CustomMetadataFields\CustomMetadataField\Schema\MinValue + * @phpstan-import-type SelectOptionShape from \Imagekit\CustomMetadataFields\CustomMetadataField\Schema\SelectOption + * * @phpstan-type SchemaShape = array{ - * type: value-of, - * defaultValue?: string|float|bool|null|list, + * type: Type|value-of, + * defaultValue?: DefaultValueShape|null, * isValueRequired?: bool|null, * maxLength?: float|null, - * maxValue?: string|float|null, + * maxValue?: MaxValueShape|null, * minLength?: float|null, - * minValue?: string|float|null, - * selectOptions?: list|null, + * minValue?: MinValueShape|null, + * selectOptions?: list|null, * } */ final class Schema implements BaseModel @@ -110,8 +115,10 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Type|value-of $type - * @param string|float|bool|list $defaultValue - * @param list $selectOptions + * @param DefaultValueShape $defaultValue + * @param MaxValueShape $maxValue + * @param MinValueShape $minValue + * @param list $selectOptions */ public static function with( Type|string $type, @@ -154,7 +161,7 @@ public function withType(Type|string $type): self /** * The default value for this custom metadata field. Data type of default value depends on the field type. * - * @param string|float|bool|list $defaultValue + * @param DefaultValueShape $defaultValue */ public function withDefaultValue( string|float|bool|array $defaultValue @@ -189,6 +196,8 @@ public function withMaxLength(float $maxLength): self /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @param MaxValueShape $maxValue */ public function withMaxValue(string|float $maxValue): self { @@ -211,6 +220,8 @@ public function withMinLength(float $minLength): self /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @param MinValueShape $minValue */ public function withMinValue(string|float $minValue): self { @@ -223,7 +234,7 @@ public function withMinValue(string|float $minValue): self /** * An array of allowed values when field type is `SingleSelect` or `MultiSelect`. * - * @param list $selectOptions + * @param list $selectOptions */ public function withSelectOptions(array $selectOptions): self { diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php index 1028def8..a496c5be 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php @@ -12,6 +12,10 @@ /** * The default value for this custom metadata field. Data type of default value depends on the field type. + * + * @phpstan-import-type MixedShape from \Imagekit\CustomMetadataFields\CustomMetadataField\Schema\DefaultValue\Mixed_ + * + * @phpstan-type DefaultValueShape = string|float|bool|list */ final class DefaultValue implements ConverterSource { diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed_.php b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed_.php index 7d209231..0aac49d5 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed_.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed_.php @@ -8,6 +8,9 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; +/** + * @phpstan-type MixedShape = string|float|bool + */ final class Mixed_ implements ConverterSource { use SdkUnion; diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/MaxValue.php b/src/CustomMetadataFields/CustomMetadataField/Schema/MaxValue.php index c13cbd2c..c3e1a8f8 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/MaxValue.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/MaxValue.php @@ -10,6 +10,8 @@ /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @phpstan-type MaxValueShape = string|float */ final class MaxValue implements ConverterSource { diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/MinValue.php b/src/CustomMetadataFields/CustomMetadataField/Schema/MinValue.php index 1ebcde0c..0a03e9e5 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/MinValue.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/MinValue.php @@ -10,6 +10,8 @@ /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @phpstan-type MinValueShape = string|float */ final class MinValue implements ConverterSource { diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/SelectOption.php b/src/CustomMetadataFields/CustomMetadataField/Schema/SelectOption.php index b331122a..0b2a9469 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/SelectOption.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/SelectOption.php @@ -8,6 +8,9 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; +/** + * @phpstan-type SelectOptionShape = string|float|bool + */ final class SelectOption implements ConverterSource { use SdkUnion; diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php index a0fa66d4..7a6f64d8 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php @@ -9,26 +9,16 @@ use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; -use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\Type; /** * This API creates a new custom metadata field. Once a custom metadata field is created either through this API or using the dashboard UI, its value can be set on the assets. The value of a field for an asset can be set using the media library UI or programmatically through upload or update assets API. * * @see Imagekit\Services\CustomMetadataFieldsService::create() * + * @phpstan-import-type SchemaShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema + * * @phpstan-type CustomMetadataFieldCreateParamsShape = array{ - * label: string, - * name: string, - * schema: Schema|array{ - * type: value-of, - * defaultValue?: string|float|bool|null|list, - * isValueRequired?: bool|null, - * maxLength?: float|null, - * maxValue?: string|float|null, - * minLength?: float|null, - * minValue?: string|float|null, - * selectOptions?: list|null, - * }, + * label: string, name: string, schema: SchemaShape * } */ final class CustomMetadataFieldCreateParams implements BaseModel @@ -79,16 +69,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Schema|array{ - * type: value-of, - * defaultValue?: string|float|bool|list|null, - * isValueRequired?: bool|null, - * maxLength?: float|null, - * maxValue?: string|float|null, - * minLength?: float|null, - * minValue?: string|float|null, - * selectOptions?: list|null, - * } $schema + * @param SchemaShape $schema */ public static function with( string $label, @@ -127,16 +108,7 @@ public function withName(string $name): self } /** - * @param Schema|array{ - * type: value-of, - * defaultValue?: string|float|bool|list|null, - * isValueRequired?: bool|null, - * maxLength?: float|null, - * maxValue?: string|float|null, - * minLength?: float|null, - * minValue?: string|float|null, - * selectOptions?: list|null, - * } $schema + * @param SchemaShape $schema */ public function withSchema(Schema|array $schema): self { diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php index 971a3d0e..095c2180 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php @@ -13,15 +13,20 @@ use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\Type; /** + * @phpstan-import-type DefaultValueShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\DefaultValue + * @phpstan-import-type MaxValueShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\MaxValue + * @phpstan-import-type MinValueShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\MinValue + * @phpstan-import-type SelectOptionShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\SelectOption + * * @phpstan-type SchemaShape = array{ - * type: value-of, - * defaultValue?: string|float|bool|null|list, + * type: Type|value-of, + * defaultValue?: DefaultValueShape|null, * isValueRequired?: bool|null, * maxLength?: float|null, - * maxValue?: string|float|null, + * maxValue?: MaxValueShape|null, * minLength?: float|null, - * minValue?: string|float|null, - * selectOptions?: list|null, + * minValue?: MinValueShape|null, + * selectOptions?: list|null, * } */ final class Schema implements BaseModel @@ -108,8 +113,10 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Type|value-of $type - * @param string|float|bool|list $defaultValue - * @param list $selectOptions + * @param DefaultValueShape $defaultValue + * @param MaxValueShape $maxValue + * @param MinValueShape $minValue + * @param list $selectOptions */ public static function with( Type|string $type, @@ -152,7 +159,7 @@ public function withType(Type|string $type): self /** * The default value for this custom metadata field. This property is only required if `isValueRequired` property is set to `true`. The value should match the `type` of custom metadata field. * - * @param string|float|bool|list $defaultValue + * @param DefaultValueShape $defaultValue */ public function withDefaultValue( string|float|bool|array $defaultValue @@ -187,6 +194,8 @@ public function withMaxLength(float $maxLength): self /** * Maximum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. + * + * @param MaxValueShape $maxValue */ public function withMaxValue(string|float $maxValue): self { @@ -209,6 +218,8 @@ public function withMinLength(float $minLength): self /** * Minimum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. + * + * @param MinValueShape $minValue */ public function withMinValue(string|float $minValue): self { @@ -221,7 +232,7 @@ public function withMinValue(string|float $minValue): self /** * An array of allowed values. This property is only required if `type` property is set to `SingleSelect` or `MultiSelect`. * - * @param list $selectOptions + * @param list $selectOptions */ public function withSelectOptions(array $selectOptions): self { diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php index 50721478..06e1e8ac 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php @@ -12,6 +12,10 @@ /** * The default value for this custom metadata field. This property is only required if `isValueRequired` property is set to `true`. The value should match the `type` of custom metadata field. + * + * @phpstan-import-type MixedShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\DefaultValue\Mixed_ + * + * @phpstan-type DefaultValueShape = string|float|bool|list */ final class DefaultValue implements ConverterSource { diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed_.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed_.php index 29c64a8f..092774b7 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed_.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed_.php @@ -8,6 +8,9 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; +/** + * @phpstan-type MixedShape = string|float|bool + */ final class Mixed_ implements ConverterSource { use SdkUnion; diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MaxValue.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MaxValue.php index fcc66df6..8228beff 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MaxValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MaxValue.php @@ -10,6 +10,8 @@ /** * Maximum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. + * + * @phpstan-type MaxValueShape = string|float */ final class MaxValue implements ConverterSource { diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MinValue.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MinValue.php index b7133e85..7f93ca06 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MinValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MinValue.php @@ -10,6 +10,8 @@ /** * Minimum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. + * + * @phpstan-type MinValueShape = string|float */ final class MinValue implements ConverterSource { diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/SelectOption.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/SelectOption.php index 928a5bc7..6b25e013 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/SelectOption.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/SelectOption.php @@ -8,6 +8,9 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; +/** + * @phpstan-type SelectOptionShape = string|float|bool + */ final class SelectOption implements ConverterSource { use SdkUnion; diff --git a/src/CustomMetadataFields/CustomMetadataFieldListParams.php b/src/CustomMetadataFields/CustomMetadataFieldListParams.php index 8e1fbd99..706d12a0 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldListParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldListParams.php @@ -17,7 +17,7 @@ * @see Imagekit\Services\CustomMetadataFieldsService::list() * * @phpstan-type CustomMetadataFieldListParamsShape = array{ - * folderPath?: string, includeDeleted?: bool + * folderPath?: string|null, includeDeleted?: bool|null * } */ final class CustomMetadataFieldListParams implements BaseModel diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php index 058c50c4..bd71741f 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php @@ -15,17 +15,10 @@ * * @see Imagekit\Services\CustomMetadataFieldsService::update() * + * @phpstan-import-type SchemaShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema + * * @phpstan-type CustomMetadataFieldUpdateParamsShape = array{ - * label?: string, - * schema?: Schema|array{ - * defaultValue?: string|float|bool|null|list, - * isValueRequired?: bool|null, - * maxLength?: float|null, - * maxValue?: string|float|null, - * minLength?: float|null, - * minValue?: string|float|null, - * selectOptions?: list|null, - * }, + * label?: string|null, schema?: SchemaShape|null * } */ final class CustomMetadataFieldUpdateParams implements BaseModel @@ -56,15 +49,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Schema|array{ - * defaultValue?: string|float|bool|list|null, - * isValueRequired?: bool|null, - * maxLength?: float|null, - * maxValue?: string|float|null, - * minLength?: float|null, - * minValue?: string|float|null, - * selectOptions?: list|null, - * } $schema + * @param SchemaShape $schema */ public static function with( ?string $label = null, @@ -92,15 +77,7 @@ public function withLabel(string $label): self /** * An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. * - * @param Schema|array{ - * defaultValue?: string|float|bool|list|null, - * isValueRequired?: bool|null, - * maxLength?: float|null, - * maxValue?: string|float|null, - * minLength?: float|null, - * minValue?: string|float|null, - * selectOptions?: list|null, - * } $schema + * @param SchemaShape $schema */ public function withSchema(Schema|array $schema): self { diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php index 17de0182..e23708bb 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php @@ -13,14 +13,19 @@ /** * An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. * + * @phpstan-import-type DefaultValueShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue + * @phpstan-import-type MaxValueShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\MaxValue + * @phpstan-import-type MinValueShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\MinValue + * @phpstan-import-type SelectOptionShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\SelectOption + * * @phpstan-type SchemaShape = array{ - * defaultValue?: string|float|bool|null|list, + * defaultValue?: DefaultValueShape|null, * isValueRequired?: bool|null, * maxLength?: float|null, - * maxValue?: string|float|null, + * maxValue?: MaxValueShape|null, * minLength?: float|null, - * minValue?: string|float|null, - * selectOptions?: list|null, + * minValue?: MinValueShape|null, + * selectOptions?: list|null, * } */ final class Schema implements BaseModel @@ -84,8 +89,10 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param string|float|bool|list $defaultValue - * @param list $selectOptions + * @param DefaultValueShape $defaultValue + * @param MaxValueShape $maxValue + * @param MinValueShape $minValue + * @param list $selectOptions */ public static function with( string|float|bool|array|null $defaultValue = null, @@ -112,7 +119,7 @@ public static function with( /** * The default value for this custom metadata field. This property is only required if `isValueRequired` property is set to `true`. The value should match the `type` of custom metadata field. * - * @param string|float|bool|list $defaultValue + * @param DefaultValueShape $defaultValue */ public function withDefaultValue( string|float|bool|array $defaultValue @@ -147,6 +154,8 @@ public function withMaxLength(float $maxLength): self /** * Maximum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. + * + * @param MaxValueShape $maxValue */ public function withMaxValue(string|float $maxValue): self { @@ -169,6 +178,8 @@ public function withMinLength(float $minLength): self /** * Minimum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. + * + * @param MinValueShape $minValue */ public function withMinValue(string|float $minValue): self { @@ -181,7 +192,7 @@ public function withMinValue(string|float $minValue): self /** * An array of allowed values. This property is only required if `type` property is set to `SingleSelect` or `MultiSelect`. * - * @param list $selectOptions + * @param list $selectOptions */ public function withSelectOptions(array $selectOptions): self { diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php index 5132a7e1..d6d2ff02 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php @@ -12,6 +12,10 @@ /** * The default value for this custom metadata field. This property is only required if `isValueRequired` property is set to `true`. The value should match the `type` of custom metadata field. + * + * @phpstan-import-type MixedShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue\Mixed_ + * + * @phpstan-type DefaultValueShape = string|float|bool|list */ final class DefaultValue implements ConverterSource { diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed_.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed_.php index 82aa00aa..ecc071c3 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed_.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed_.php @@ -8,6 +8,9 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; +/** + * @phpstan-type MixedShape = string|float|bool + */ final class Mixed_ implements ConverterSource { use SdkUnion; diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MaxValue.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MaxValue.php index 809b42e2..1b9f96e5 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MaxValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MaxValue.php @@ -10,6 +10,8 @@ /** * Maximum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. + * + * @phpstan-type MaxValueShape = string|float */ final class MaxValue implements ConverterSource { diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MinValue.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MinValue.php index 651b66f7..5c5c66cf 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MinValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MinValue.php @@ -10,6 +10,8 @@ /** * Minimum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. + * + * @phpstan-type MinValueShape = string|float */ final class MinValue implements ConverterSource { diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/SelectOption.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/SelectOption.php index 556c12c3..8f4e4c8a 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/SelectOption.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/SelectOption.php @@ -8,6 +8,9 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; +/** + * @phpstan-type SelectOptionShape = string|float|bool + */ final class SelectOption implements ConverterSource { use SdkUnion; diff --git a/src/ExtensionItem.php b/src/ExtensionItem.php index ad6e4c43..b657a164 100644 --- a/src/ExtensionItem.php +++ b/src/ExtensionItem.php @@ -11,6 +11,13 @@ use Imagekit\ExtensionItem\AutoTaggingExtension; use Imagekit\ExtensionItem\RemovedotBgExtension; +/** + * @phpstan-import-type RemovedotBgExtensionShape from \Imagekit\ExtensionItem\RemovedotBgExtension + * @phpstan-import-type AutoTaggingExtensionShape from \Imagekit\ExtensionItem\AutoTaggingExtension + * @phpstan-import-type AutoDescriptionExtensionShape from \Imagekit\ExtensionItem\AutoDescriptionExtension + * + * @phpstan-type ExtensionItemShape = RemovedotBgExtensionShape|AutoTaggingExtensionShape|AutoDescriptionExtensionShape + */ final class ExtensionItem implements ConverterSource { use SdkUnion; diff --git a/src/ExtensionItem/AutoDescriptionExtension.php b/src/ExtensionItem/AutoDescriptionExtension.php index 80a7a30d..624dd839 100644 --- a/src/ExtensionItem/AutoDescriptionExtension.php +++ b/src/ExtensionItem/AutoDescriptionExtension.php @@ -9,9 +9,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * @phpstan-type AutoDescriptionExtensionShape = array{ - * name?: 'ai-auto-description' - * } + * @phpstan-type AutoDescriptionExtensionShape = array{name: 'ai-auto-description'} */ final class AutoDescriptionExtension implements BaseModel { diff --git a/src/ExtensionItem/AutoTaggingExtension.php b/src/ExtensionItem/AutoTaggingExtension.php index f057cb4f..5351864c 100644 --- a/src/ExtensionItem/AutoTaggingExtension.php +++ b/src/ExtensionItem/AutoTaggingExtension.php @@ -11,7 +11,7 @@ /** * @phpstan-type AutoTaggingExtensionShape = array{ - * maxTags: int, minConfidence: int, name: value-of + * maxTags: int, minConfidence: int, name: Name|value-of * } */ final class AutoTaggingExtension implements BaseModel diff --git a/src/ExtensionItem/RemovedotBgExtension.php b/src/ExtensionItem/RemovedotBgExtension.php index 8dca08d7..7c0c123c 100644 --- a/src/ExtensionItem/RemovedotBgExtension.php +++ b/src/ExtensionItem/RemovedotBgExtension.php @@ -11,8 +11,10 @@ use Imagekit\ExtensionItem\RemovedotBgExtension\Options; /** + * @phpstan-import-type OptionsShape from \Imagekit\ExtensionItem\RemovedotBgExtension\Options + * * @phpstan-type RemovedotBgExtensionShape = array{ - * name?: 'remove-bg', options?: Options|null + * name: 'remove-bg', options?: null|Options|OptionsShape * } */ final class RemovedotBgExtension implements BaseModel @@ -41,12 +43,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Options|array{ - * addShadow?: bool|null, - * bgColor?: string|null, - * bgImageURL?: string|null, - * semitransparency?: bool|null, - * } $options + * @param OptionsShape $options */ public static function with(Options|array|null $options = null): self { @@ -58,12 +55,7 @@ public static function with(Options|array|null $options = null): self } /** - * @param Options|array{ - * addShadow?: bool|null, - * bgColor?: string|null, - * bgImageURL?: string|null, - * semitransparency?: bool|null, - * } $options + * @param OptionsShape $options */ public function withOptions(Options|array $options): self { diff --git a/src/Files/File.php b/src/Files/File.php index d5787b97..ffe4f82d 100644 --- a/src/Files/File.php +++ b/src/Files/File.php @@ -15,8 +15,12 @@ /** * Object containing details of a file or file version. * + * @phpstan-import-type AITagShape from \Imagekit\Files\File\AITag + * @phpstan-import-type SelectedFieldsSchemaShape from \Imagekit\Files\File\SelectedFieldsSchema + * @phpstan-import-type VersionInfoShape from \Imagekit\Files\File\VersionInfo + * * @phpstan-type FileShape = array{ - * aiTags?: list|null, + * aiTags?: list|null, * createdAt?: \DateTimeInterface|null, * customCoordinates?: string|null, * customMetadata?: array|null, @@ -30,14 +34,14 @@ * isPublished?: bool|null, * mime?: string|null, * name?: string|null, - * selectedFieldsSchema?: array|null, + * selectedFieldsSchema?: array|null, * size?: float|null, * tags?: list|null, * thumbnail?: string|null, - * type?: value-of|null, + * type?: null|Type|value-of, * updatedAt?: \DateTimeInterface|null, * url?: string|null, - * versionInfo?: VersionInfo|null, + * versionInfo?: null|VersionInfo|VersionInfoShape, * width?: float|null, * } */ @@ -208,25 +212,12 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list|null $aiTags + * @param list|null $aiTags * @param array $customMetadata - * @param array, - * defaultValue?: string|float|bool|list|null, - * isValueRequired?: bool|null, - * maxLength?: float|null, - * maxValue?: string|float|null, - * minLength?: float|null, - * minValue?: string|float|null, - * readOnly?: bool|null, - * selectOptions?: list|null, - * selectOptionsTruncated?: bool|null, - * }> $selectedFieldsSchema + * @param array $selectedFieldsSchema * @param list|null $tags * @param Type|value-of $type - * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo + * @param VersionInfoShape $versionInfo */ public static function with( ?array $aiTags = null, @@ -285,9 +276,7 @@ public static function with( /** * An array of tags assigned to the file by auto tagging. * - * @param list|null $aiTags + * @param list|null $aiTags */ public function withAITags(?array $aiTags): self { @@ -449,18 +438,7 @@ public function withName(string $name): self * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @param array, - * defaultValue?: string|float|bool|list|null, - * isValueRequired?: bool|null, - * maxLength?: float|null, - * maxValue?: string|float|null, - * minLength?: float|null, - * minValue?: string|float|null, - * readOnly?: bool|null, - * selectOptions?: list|null, - * selectOptionsTruncated?: bool|null, - * }> $selectedFieldsSchema + * @param array $selectedFieldsSchema */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { @@ -543,7 +521,7 @@ public function withURL(string $url): self /** * An object with details of the file version. * - * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo + * @param VersionInfoShape $versionInfo */ public function withVersionInfo(VersionInfo|array $versionInfo): self { diff --git a/src/Files/File/SelectedFieldsSchema.php b/src/Files/File/SelectedFieldsSchema.php index 1b6267fa..971cb318 100644 --- a/src/Files/File/SelectedFieldsSchema.php +++ b/src/Files/File/SelectedFieldsSchema.php @@ -13,16 +13,21 @@ use Imagekit\Files\File\SelectedFieldsSchema\Type; /** + * @phpstan-import-type DefaultValueShape from \Imagekit\Files\File\SelectedFieldsSchema\DefaultValue + * @phpstan-import-type MaxValueShape from \Imagekit\Files\File\SelectedFieldsSchema\MaxValue + * @phpstan-import-type MinValueShape from \Imagekit\Files\File\SelectedFieldsSchema\MinValue + * @phpstan-import-type SelectOptionShape from \Imagekit\Files\File\SelectedFieldsSchema\SelectOption + * * @phpstan-type SelectedFieldsSchemaShape = array{ - * type: value-of<\Imagekit\Files\File\SelectedFieldsSchema\Type>, - * defaultValue?: string|float|bool|null|list, + * type: \Imagekit\Files\File\SelectedFieldsSchema\Type|value-of<\Imagekit\Files\File\SelectedFieldsSchema\Type>, + * defaultValue?: DefaultValueShape|null, * isValueRequired?: bool|null, * maxLength?: float|null, - * maxValue?: string|float|null, + * maxValue?: MaxValueShape|null, * minLength?: float|null, - * minValue?: string|float|null, + * minValue?: MinValueShape|null, * readOnly?: bool|null, - * selectOptions?: list|null, + * selectOptions?: list|null, * selectOptionsTruncated?: bool|null, * } */ @@ -122,8 +127,10 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Type|value-of $type - * @param string|float|bool|list $defaultValue - * @param list $selectOptions + * @param DefaultValueShape $defaultValue + * @param MaxValueShape $maxValue + * @param MinValueShape $minValue + * @param list $selectOptions */ public static function with( Type|string $type, @@ -171,7 +178,7 @@ public function withType( /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. * - * @param string|float|bool|list $defaultValue + * @param DefaultValueShape $defaultValue */ public function withDefaultValue( string|float|bool|array $defaultValue @@ -206,6 +213,8 @@ public function withMaxLength(float $maxLength): self /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @param MaxValueShape $maxValue */ public function withMaxValue(string|float $maxValue): self { @@ -228,6 +237,8 @@ public function withMinLength(float $minLength): self /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @param MinValueShape $minValue */ public function withMinValue(string|float $minValue): self { @@ -251,7 +262,7 @@ public function withReadOnly(bool $readOnly): self /** * An array of allowed values when field type is `SingleSelect` or `MultiSelect`. * - * @param list $selectOptions + * @param list $selectOptions */ public function withSelectOptions(array $selectOptions): self { diff --git a/src/Files/File/SelectedFieldsSchema/DefaultValue.php b/src/Files/File/SelectedFieldsSchema/DefaultValue.php index 4e7c6db9..ef166f57 100644 --- a/src/Files/File/SelectedFieldsSchema/DefaultValue.php +++ b/src/Files/File/SelectedFieldsSchema/DefaultValue.php @@ -12,6 +12,10 @@ /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. + * + * @phpstan-import-type MixedShape from \Imagekit\Files\File\SelectedFieldsSchema\DefaultValue\Mixed_ + * + * @phpstan-type DefaultValueShape = string|float|bool|list */ final class DefaultValue implements ConverterSource { diff --git a/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed_.php b/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed_.php index 62504461..a502fe7e 100644 --- a/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed_.php +++ b/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed_.php @@ -8,6 +8,9 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; +/** + * @phpstan-type MixedShape = string|float|bool + */ final class Mixed_ implements ConverterSource { use SdkUnion; diff --git a/src/Files/File/SelectedFieldsSchema/MaxValue.php b/src/Files/File/SelectedFieldsSchema/MaxValue.php index 95013de6..6509d2cb 100644 --- a/src/Files/File/SelectedFieldsSchema/MaxValue.php +++ b/src/Files/File/SelectedFieldsSchema/MaxValue.php @@ -10,6 +10,8 @@ /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @phpstan-type MaxValueShape = string|float */ final class MaxValue implements ConverterSource { diff --git a/src/Files/File/SelectedFieldsSchema/MinValue.php b/src/Files/File/SelectedFieldsSchema/MinValue.php index 37423998..f1130948 100644 --- a/src/Files/File/SelectedFieldsSchema/MinValue.php +++ b/src/Files/File/SelectedFieldsSchema/MinValue.php @@ -10,6 +10,8 @@ /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @phpstan-type MinValueShape = string|float */ final class MinValue implements ConverterSource { diff --git a/src/Files/File/SelectedFieldsSchema/SelectOption.php b/src/Files/File/SelectedFieldsSchema/SelectOption.php index bf7be1d3..c54278a7 100644 --- a/src/Files/File/SelectedFieldsSchema/SelectOption.php +++ b/src/Files/File/SelectedFieldsSchema/SelectOption.php @@ -8,6 +8,9 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; +/** + * @phpstan-type SelectOptionShape = string|float|bool + */ final class SelectOption implements ConverterSource { use SdkUnion; diff --git a/src/Files/FileCopyParams.php b/src/Files/FileCopyParams.php index aff0a333..c36f163a 100644 --- a/src/Files/FileCopyParams.php +++ b/src/Files/FileCopyParams.php @@ -18,7 +18,9 @@ * @see Imagekit\Services\FilesService::copy() * * @phpstan-type FileCopyParamsShape = array{ - * destinationPath: string, sourceFilePath: string, includeFileVersions?: bool + * destinationPath: string, + * sourceFilePath: string, + * includeFileVersions?: bool|null, * } */ final class FileCopyParams implements BaseModel diff --git a/src/Files/FileRenameParams.php b/src/Files/FileRenameParams.php index f19e015a..d1c8b3b6 100644 --- a/src/Files/FileRenameParams.php +++ b/src/Files/FileRenameParams.php @@ -18,7 +18,7 @@ * @see Imagekit\Services\FilesService::rename() * * @phpstan-type FileRenameParamsShape = array{ - * filePath: string, newFileName: string, purgeCache?: bool + * filePath: string, newFileName: string, purgeCache?: bool|null * } */ final class FileRenameParams implements BaseModel diff --git a/src/Files/FileUpdateParams.php b/src/Files/FileUpdateParams.php index a56157c2..93b9b554 100644 --- a/src/Files/FileUpdateParams.php +++ b/src/Files/FileUpdateParams.php @@ -11,9 +11,7 @@ use Imagekit\ExtensionItem; use Imagekit\ExtensionItem\AutoDescriptionExtension; use Imagekit\ExtensionItem\AutoTaggingExtension; -use Imagekit\ExtensionItem\AutoTaggingExtension\Name; use Imagekit\ExtensionItem\RemovedotBgExtension; -use Imagekit\ExtensionItem\RemovedotBgExtension\Options; use Imagekit\Files\FileUpdateParams\Publish; use Imagekit\Files\FileUpdateParams\RemoveAITags; @@ -22,19 +20,19 @@ * * @see Imagekit\Services\FilesService::update() * + * @phpstan-import-type ExtensionItemShape from \Imagekit\ExtensionItem + * @phpstan-import-type RemoveAITagsShape from \Imagekit\Files\FileUpdateParams\RemoveAITags + * @phpstan-import-type PublishShape from \Imagekit\Files\FileUpdateParams\Publish + * * @phpstan-type FileUpdateParamsShape = array{ * customCoordinates?: string|null, - * customMetadata?: array, - * description?: string, - * extensions?: list - * }|AutoDescriptionExtension|array{name?: 'ai-auto-description'}>, - * removeAITags?: 'all'|list, + * customMetadata?: array|null, + * description?: string|null, + * extensions?: list|null, + * removeAITags?: RemoveAITagsShape|null, * tags?: list|null, - * webhookURL?: string, - * publish?: Publish|array{isPublished: bool, includeFileVersions?: bool|null}, + * webhookURL?: string|null, + * publish?: PublishShape|null, * } */ final class FileUpdateParams implements BaseModel @@ -114,16 +112,10 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param array $customMetadata - * @param list - * }|AutoDescriptionExtension|array{name?: 'ai-auto-description'}> $extensions - * @param 'all'|list $removeAITags + * @param list $extensions + * @param RemoveAITagsShape $removeAITags * @param list|null $tags - * @param Publish|array{ - * isPublished: bool, includeFileVersions?: bool|null - * } $publish + * @param PublishShape $publish */ public static function with( ?string $customCoordinates = null, @@ -187,11 +179,7 @@ public function withDescription(string $description): self /** * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * - * @param list - * }|AutoDescriptionExtension|array{name?: 'ai-auto-description'}> $extensions + * @param list $extensions */ public function withExtensions(array $extensions): self { @@ -208,7 +196,7 @@ public function withExtensions(array $extensions): self * * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. * - * @param 'all'|list $removeAITags + * @param RemoveAITagsShape $removeAITags */ public function withRemoveAITags(string|array $removeAITags): self { @@ -245,9 +233,7 @@ public function withWebhookURL(string $webhookURL): self /** * Configure the publication status of a file and its versions. * - * @param Publish|array{ - * isPublished: bool, includeFileVersions?: bool|null - * } $publish + * @param PublishShape $publish */ public function withPublish(Publish|array $publish): self { diff --git a/src/Files/FileUpdateParams/RemoveAITags.php b/src/Files/FileUpdateParams/RemoveAITags.php index c3b98949..613a851c 100644 --- a/src/Files/FileUpdateParams/RemoveAITags.php +++ b/src/Files/FileUpdateParams/RemoveAITags.php @@ -15,6 +15,8 @@ * If you want to remove all AITags associated with the file, send a string - "all". * * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. + * + * @phpstan-type RemoveAITagsShape = 'all'|list */ final class RemoveAITags implements ConverterSource { diff --git a/src/Files/FileUpdateResponse.php b/src/Files/FileUpdateResponse.php index 744732d9..a963e663 100644 --- a/src/Files/FileUpdateResponse.php +++ b/src/Files/FileUpdateResponse.php @@ -12,16 +12,17 @@ use Imagekit\Files\File\Type; use Imagekit\Files\File\VersionInfo; use Imagekit\Files\FileUpdateResponse\ExtensionStatus; -use Imagekit\Files\FileUpdateResponse\ExtensionStatus\AIAutoDescription; -use Imagekit\Files\FileUpdateResponse\ExtensionStatus\AwsAutoTagging; -use Imagekit\Files\FileUpdateResponse\ExtensionStatus\GoogleAutoTagging; -use Imagekit\Files\FileUpdateResponse\ExtensionStatus\RemoveBg; /** * Object containing details of a file or file version. * + * @phpstan-import-type AITagShape from \Imagekit\Files\File\AITag + * @phpstan-import-type SelectedFieldsSchemaShape from \Imagekit\Files\File\SelectedFieldsSchema + * @phpstan-import-type VersionInfoShape from \Imagekit\Files\File\VersionInfo + * @phpstan-import-type ExtensionStatusShape from \Imagekit\Files\FileUpdateResponse\ExtensionStatus + * * @phpstan-type FileUpdateResponseShape = array{ - * aiTags?: list|null, + * aiTags?: list|null, * createdAt?: \DateTimeInterface|null, * customCoordinates?: string|null, * customMetadata?: array|null, @@ -35,16 +36,16 @@ * isPublished?: bool|null, * mime?: string|null, * name?: string|null, - * selectedFieldsSchema?: array|null, + * selectedFieldsSchema?: array|null, * size?: float|null, * tags?: list|null, * thumbnail?: string|null, - * type?: value-of|null, + * type?: null|Type|value-of, * updatedAt?: \DateTimeInterface|null, * url?: string|null, - * versionInfo?: VersionInfo|null, + * versionInfo?: null|VersionInfo|VersionInfoShape, * width?: float|null, - * extensionStatus?: ExtensionStatus|null, + * extensionStatus?: null|ExtensionStatus|ExtensionStatusShape, * } */ final class FileUpdateResponse implements BaseModel @@ -217,31 +218,13 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list|null $aiTags + * @param list|null $aiTags * @param array $customMetadata - * @param array, - * defaultValue?: string|float|bool|list|null, - * isValueRequired?: bool|null, - * maxLength?: float|null, - * maxValue?: string|float|null, - * minLength?: float|null, - * minValue?: string|float|null, - * readOnly?: bool|null, - * selectOptions?: list|null, - * selectOptionsTruncated?: bool|null, - * }> $selectedFieldsSchema + * @param array $selectedFieldsSchema * @param list|null $tags * @param Type|value-of $type - * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo - * @param ExtensionStatus|array{ - * aiAutoDescription?: value-of|null, - * awsAutoTagging?: value-of|null, - * googleAutoTagging?: value-of|null, - * removeBg?: value-of|null, - * } $extensionStatus + * @param VersionInfoShape $versionInfo + * @param ExtensionStatusShape $extensionStatus */ public static function with( ?array $aiTags = null, @@ -302,9 +285,7 @@ public static function with( /** * An array of tags assigned to the file by auto tagging. * - * @param list|null $aiTags + * @param list|null $aiTags */ public function withAITags(?array $aiTags): self { @@ -466,18 +447,7 @@ public function withName(string $name): self * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @param array, - * defaultValue?: string|float|bool|list|null, - * isValueRequired?: bool|null, - * maxLength?: float|null, - * maxValue?: string|float|null, - * minLength?: float|null, - * minValue?: string|float|null, - * readOnly?: bool|null, - * selectOptions?: list|null, - * selectOptionsTruncated?: bool|null, - * }> $selectedFieldsSchema + * @param array $selectedFieldsSchema */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { @@ -560,7 +530,7 @@ public function withURL(string $url): self /** * An object with details of the file version. * - * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo + * @param VersionInfoShape $versionInfo */ public function withVersionInfo(VersionInfo|array $versionInfo): self { @@ -582,12 +552,7 @@ public function withWidth(float $width): self } /** - * @param ExtensionStatus|array{ - * aiAutoDescription?: value-of|null, - * awsAutoTagging?: value-of|null, - * googleAutoTagging?: value-of|null, - * removeBg?: value-of|null, - * } $extensionStatus + * @param ExtensionStatusShape $extensionStatus */ public function withExtensionStatus( ExtensionStatus|array $extensionStatus diff --git a/src/Files/FileUpdateResponse/ExtensionStatus.php b/src/Files/FileUpdateResponse/ExtensionStatus.php index 64d80c94..5b9f26d3 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus.php @@ -14,10 +14,10 @@ /** * @phpstan-type ExtensionStatusShape = array{ - * aiAutoDescription?: value-of|null, - * awsAutoTagging?: value-of|null, - * googleAutoTagging?: value-of|null, - * removeBg?: value-of|null, + * aiAutoDescription?: null|AIAutoDescription|value-of, + * awsAutoTagging?: null|AwsAutoTagging|value-of, + * googleAutoTagging?: null|GoogleAutoTagging|value-of, + * removeBg?: null|RemoveBg|value-of, * } */ final class ExtensionStatus implements BaseModel diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index 9fcf6cf1..f344f352 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -12,15 +12,9 @@ use Imagekit\ExtensionItem; use Imagekit\ExtensionItem\AutoDescriptionExtension; use Imagekit\ExtensionItem\AutoTaggingExtension; -use Imagekit\ExtensionItem\AutoTaggingExtension\Name; use Imagekit\ExtensionItem\RemovedotBgExtension; -use Imagekit\ExtensionItem\RemovedotBgExtension\Options; use Imagekit\Files\FileUploadParams\ResponseField; use Imagekit\Files\FileUploadParams\Transformation; -use Imagekit\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming; -use Imagekit\Files\FileUploadParams\Transformation\Post\ConvertGifToVideo; -use Imagekit\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail; -use Imagekit\Files\FileUploadParams\Transformation\Post\SimplePostTransformation; /** * ImageKit.io allows you to upload files directly from both the server and client sides. For server-side uploads, private API key authentication is used. For client-side uploads, generate a one-time `token`, `signature`, and `expire` from your secure backend using private API. [Learn more](/docs/api-reference/upload-file/upload-file#how-to-implement-client-side-file-upload) about how to implement client-side file upload. @@ -40,37 +34,33 @@ * * @see Imagekit\Services\FilesService::upload() * + * @phpstan-import-type ExtensionItemShape from \Imagekit\ExtensionItem + * @phpstan-import-type TransformationShape from \Imagekit\Files\FileUploadParams\Transformation + * * @phpstan-type FileUploadParamsShape = array{ * file: string, * fileName: string, - * token?: string, - * checks?: string, - * customCoordinates?: string, - * customMetadata?: array, - * description?: string, - * expire?: int, - * extensions?: list - * }|AutoDescriptionExtension|array{name?: 'ai-auto-description'}>, - * folder?: string, - * isPrivateFile?: bool, - * isPublished?: bool, - * overwriteAITags?: bool, - * overwriteCustomMetadata?: bool, - * overwriteFile?: bool, - * overwriteTags?: bool, - * publicKey?: string, - * responseFields?: list>, - * signature?: string, - * tags?: list, - * transformation?: Transformation|array{ - * post?: list|null, - * pre?: string|null, - * }, - * useUniqueFileName?: bool, - * webhookURL?: string, + * token?: string|null, + * checks?: string|null, + * customCoordinates?: string|null, + * customMetadata?: array|null, + * description?: string|null, + * expire?: int|null, + * extensions?: list|null, + * folder?: string|null, + * isPrivateFile?: bool|null, + * isPublished?: bool|null, + * overwriteAITags?: bool|null, + * overwriteCustomMetadata?: bool|null, + * overwriteFile?: bool|null, + * overwriteTags?: bool|null, + * publicKey?: string|null, + * responseFields?: list>|null, + * signature?: string|null, + * tags?: list|null, + * transformation?: TransformationShape|null, + * useUniqueFileName?: bool|null, + * webhookURL?: string|null, * } */ final class FileUploadParams implements BaseModel @@ -298,17 +288,10 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param array $customMetadata - * @param list - * }|AutoDescriptionExtension|array{name?: 'ai-auto-description'}> $extensions + * @param list $extensions * @param list> $responseFields * @param list $tags - * @param Transformation|array{ - * post?: list|null, - * pre?: string|null, - * } $transformation + * @param TransformationShape $transformation */ public static function with( string $file, @@ -477,11 +460,7 @@ public function withExpire(int $expire): self /** * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * - * @param list - * }|AutoDescriptionExtension|array{name?: 'ai-auto-description'}> $extensions + * @param list $extensions */ public function withExtensions(array $extensions): self { @@ -645,10 +624,7 @@ public function withTags(array $tags): self * * You can mix and match any combination of post-processing types. * - * @param Transformation|array{ - * post?: list|null, - * pre?: string|null, - * } $transformation + * @param TransformationShape $transformation */ public function withTransformation( Transformation|array $transformation diff --git a/src/Files/FileUploadParams/Transformation.php b/src/Files/FileUploadParams/Transformation.php index 30d75ef8..40421a69 100644 --- a/src/Files/FileUploadParams/Transformation.php +++ b/src/Files/FileUploadParams/Transformation.php @@ -9,7 +9,6 @@ use Imagekit\Core\Contracts\BaseModel; use Imagekit\Files\FileUploadParams\Transformation\Post; use Imagekit\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming; -use Imagekit\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming\Protocol; use Imagekit\Files\FileUploadParams\Transformation\Post\ConvertGifToVideo; use Imagekit\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail; use Imagekit\Files\FileUploadParams\Transformation\Post\SimplePostTransformation; @@ -25,9 +24,10 @@ * * You can mix and match any combination of post-processing types. * + * @phpstan-import-type PostShape from \Imagekit\Files\FileUploadParams\Transformation\Post + * * @phpstan-type TransformationShape = array{ - * post?: list|null, - * pre?: string|null, + * post?: list|null, pre?: string|null * } */ final class Transformation implements BaseModel @@ -61,15 +61,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list, type?: 'abs', value: string - * }> $post + * @param list $post */ public static function with(?array $post = null, ?string $pre = null): self { @@ -86,15 +78,7 @@ public static function with(?array $post = null, ?string $pre = null): self * Each item must match one of the following types: * `transformation`, `gif-to-video`, `thumbnail`, `abs`. * - * @param list, type?: 'abs', value: string - * }> $post + * @param list $post */ public function withPost(array $post): self { diff --git a/src/Files/FileUploadParams/Transformation/Post.php b/src/Files/FileUploadParams/Transformation/Post.php index 9de55f74..5868889e 100644 --- a/src/Files/FileUploadParams/Transformation/Post.php +++ b/src/Files/FileUploadParams/Transformation/Post.php @@ -12,6 +12,14 @@ use Imagekit\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail; use Imagekit\Files\FileUploadParams\Transformation\Post\SimplePostTransformation; +/** + * @phpstan-import-type SimplePostTransformationShape from \Imagekit\Files\FileUploadParams\Transformation\Post\SimplePostTransformation + * @phpstan-import-type ConvertGifToVideoShape from \Imagekit\Files\FileUploadParams\Transformation\Post\ConvertGifToVideo + * @phpstan-import-type GenerateAThumbnailShape from \Imagekit\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail + * @phpstan-import-type AdaptiveBitrateStreamingShape from \Imagekit\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming + * + * @phpstan-type PostShape = SimplePostTransformationShape|ConvertGifToVideoShape|GenerateAThumbnailShape|AdaptiveBitrateStreamingShape + */ final class Post implements ConverterSource { use SdkUnion; diff --git a/src/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php b/src/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php index d39d6e06..371c6231 100644 --- a/src/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php +++ b/src/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php @@ -11,7 +11,7 @@ /** * @phpstan-type AdaptiveBitrateStreamingShape = array{ - * protocol: value-of, type?: 'abs', value: string + * protocol: Protocol|value-of, type: 'abs', value: string * } */ final class AdaptiveBitrateStreaming implements BaseModel diff --git a/src/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php b/src/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php index 2cfacd29..dd2af96a 100644 --- a/src/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php +++ b/src/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php @@ -11,7 +11,7 @@ /** * @phpstan-type ConvertGifToVideoShape = array{ - * type?: 'gif-to-video', value?: string|null + * type: 'gif-to-video', value?: string|null * } */ final class ConvertGifToVideo implements BaseModel diff --git a/src/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php b/src/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php index 81f00760..eac46b05 100644 --- a/src/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php +++ b/src/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php @@ -11,7 +11,7 @@ /** * @phpstan-type GenerateAThumbnailShape = array{ - * type?: 'thumbnail', value?: string|null + * type: 'thumbnail', value?: string|null * } */ final class GenerateAThumbnail implements BaseModel diff --git a/src/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php b/src/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php index d1b8afca..29fa252e 100644 --- a/src/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php +++ b/src/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php @@ -10,7 +10,7 @@ /** * @phpstan-type SimplePostTransformationShape = array{ - * type?: 'transformation', value: string + * type: 'transformation', value: string * } */ final class SimplePostTransformation implements BaseModel diff --git a/src/Files/FileUploadResponse.php b/src/Files/FileUploadResponse.php index 65ba2ca4..2aa5433b 100644 --- a/src/Files/FileUploadResponse.php +++ b/src/Files/FileUploadResponse.php @@ -9,20 +9,20 @@ use Imagekit\Core\Contracts\BaseModel; use Imagekit\Files\FileUploadResponse\AITag; use Imagekit\Files\FileUploadResponse\ExtensionStatus; -use Imagekit\Files\FileUploadResponse\ExtensionStatus\AIAutoDescription; -use Imagekit\Files\FileUploadResponse\ExtensionStatus\AwsAutoTagging; -use Imagekit\Files\FileUploadResponse\ExtensionStatus\GoogleAutoTagging; -use Imagekit\Files\FileUploadResponse\ExtensionStatus\RemoveBg; use Imagekit\Files\FileUploadResponse\SelectedFieldsSchema; -use Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\Type; use Imagekit\Files\FileUploadResponse\VersionInfo; -use Imagekit\Files\Metadata\Exif; /** * Object containing details of a successful upload. * + * @phpstan-import-type AITagShape from \Imagekit\Files\FileUploadResponse\AITag + * @phpstan-import-type ExtensionStatusShape from \Imagekit\Files\FileUploadResponse\ExtensionStatus + * @phpstan-import-type MetadataShape from \Imagekit\Files\Metadata + * @phpstan-import-type SelectedFieldsSchemaShape from \Imagekit\Files\FileUploadResponse\SelectedFieldsSchema + * @phpstan-import-type VersionInfoShape from \Imagekit\Files\FileUploadResponse\VersionInfo + * * @phpstan-type FileUploadResponseShape = array{ - * aiTags?: list|null, + * aiTags?: list|null, * audioCodec?: string|null, * bitRate?: int|null, * customCoordinates?: string|null, @@ -30,21 +30,21 @@ * description?: string|null, * duration?: int|null, * embeddedMetadata?: array|null, - * extensionStatus?: ExtensionStatus|null, + * extensionStatus?: null|ExtensionStatus|ExtensionStatusShape, * fileID?: string|null, * filePath?: string|null, * fileType?: string|null, * height?: float|null, * isPrivateFile?: bool|null, * isPublished?: bool|null, - * metadata?: Metadata|null, + * metadata?: null|Metadata|MetadataShape, * name?: string|null, - * selectedFieldsSchema?: array|null, + * selectedFieldsSchema?: array|null, * size?: float|null, * tags?: list|null, * thumbnailURL?: string|null, * url?: string|null, - * versionInfo?: VersionInfo|null, + * versionInfo?: null|VersionInfo|VersionInfoShape, * videoCodec?: string|null, * width?: float|null, * } @@ -234,47 +234,14 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list|null $aiTags + * @param list|null $aiTags * @param array $customMetadata * @param array $embeddedMetadata - * @param ExtensionStatus|array{ - * aiAutoDescription?: value-of|null, - * awsAutoTagging?: value-of|null, - * googleAutoTagging?: value-of|null, - * removeBg?: value-of|null, - * } $extensionStatus - * @param Metadata|array{ - * audioCodec?: string|null, - * bitRate?: int|null, - * density?: int|null, - * duration?: int|null, - * exif?: Exif|null, - * format?: string|null, - * hasColorProfile?: bool|null, - * hasTransparency?: bool|null, - * height?: int|null, - * pHash?: string|null, - * quality?: int|null, - * size?: int|null, - * videoCodec?: string|null, - * width?: int|null, - * } $metadata - * @param array, - * defaultValue?: string|float|bool|list|null, - * isValueRequired?: bool|null, - * maxLength?: float|null, - * maxValue?: string|float|null, - * minLength?: float|null, - * minValue?: string|float|null, - * readOnly?: bool|null, - * selectOptions?: list|null, - * selectOptionsTruncated?: bool|null, - * }> $selectedFieldsSchema + * @param ExtensionStatusShape $extensionStatus + * @param MetadataShape $metadata + * @param array $selectedFieldsSchema * @param list|null $tags - * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo + * @param VersionInfoShape $versionInfo */ public static function with( ?array $aiTags = null, @@ -337,9 +304,7 @@ public static function with( /** * An array of tags assigned to the uploaded file by auto tagging. * - * @param list|null $aiTags + * @param list|null $aiTags */ public function withAITags(?array $aiTags): self { @@ -439,12 +404,7 @@ public function withEmbeddedMetadata(array $embeddedMetadata): self * * If no extension was requested, then this parameter is not returned. * - * @param ExtensionStatus|array{ - * aiAutoDescription?: value-of|null, - * awsAutoTagging?: value-of|null, - * googleAutoTagging?: value-of|null, - * removeBg?: value-of|null, - * } $extensionStatus + * @param ExtensionStatusShape $extensionStatus */ public function withExtensionStatus( ExtensionStatus|array $extensionStatus @@ -524,22 +484,7 @@ public function withIsPublished(bool $isPublished): self /** * Legacy metadata. Send `metadata` in `responseFields` in API request to get metadata in the upload API response. * - * @param Metadata|array{ - * audioCodec?: string|null, - * bitRate?: int|null, - * density?: int|null, - * duration?: int|null, - * exif?: Exif|null, - * format?: string|null, - * hasColorProfile?: bool|null, - * hasTransparency?: bool|null, - * height?: int|null, - * pHash?: string|null, - * quality?: int|null, - * size?: int|null, - * videoCodec?: string|null, - * width?: int|null, - * } $metadata + * @param MetadataShape $metadata */ public function withMetadata(Metadata|array $metadata): self { @@ -567,18 +512,7 @@ public function withName(string $name): self * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @param array, - * defaultValue?: string|float|bool|list|null, - * isValueRequired?: bool|null, - * maxLength?: float|null, - * maxValue?: string|float|null, - * minLength?: float|null, - * minValue?: string|float|null, - * readOnly?: bool|null, - * selectOptions?: list|null, - * selectOptionsTruncated?: bool|null, - * }> $selectedFieldsSchema + * @param array $selectedFieldsSchema */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { @@ -637,7 +571,7 @@ public function withURL(string $url): self /** * An object containing the file or file version's `id` (versionId) and `name`. * - * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo + * @param VersionInfoShape $versionInfo */ public function withVersionInfo(VersionInfo|array $versionInfo): self { diff --git a/src/Files/FileUploadResponse/ExtensionStatus.php b/src/Files/FileUploadResponse/ExtensionStatus.php index a16e891c..091a6f0e 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Files/FileUploadResponse/ExtensionStatus.php @@ -22,10 +22,10 @@ * If no extension was requested, then this parameter is not returned. * * @phpstan-type ExtensionStatusShape = array{ - * aiAutoDescription?: value-of|null, - * awsAutoTagging?: value-of|null, - * googleAutoTagging?: value-of|null, - * removeBg?: value-of|null, + * aiAutoDescription?: null|AIAutoDescription|value-of, + * awsAutoTagging?: null|AwsAutoTagging|value-of, + * googleAutoTagging?: null|GoogleAutoTagging|value-of, + * removeBg?: null|RemoveBg|value-of, * } */ final class ExtensionStatus implements BaseModel diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema.php b/src/Files/FileUploadResponse/SelectedFieldsSchema.php index 921dc0dc..3545e6c8 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema.php @@ -13,16 +13,21 @@ use Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\Type; /** + * @phpstan-import-type DefaultValueShape from \Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue + * @phpstan-import-type MaxValueShape from \Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\MaxValue + * @phpstan-import-type MinValueShape from \Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\MinValue + * @phpstan-import-type SelectOptionShape from \Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\SelectOption + * * @phpstan-type SelectedFieldsSchemaShape = array{ - * type: value-of, - * defaultValue?: string|float|bool|null|list, + * type: Type|value-of, + * defaultValue?: DefaultValueShape|null, * isValueRequired?: bool|null, * maxLength?: float|null, - * maxValue?: string|float|null, + * maxValue?: MaxValueShape|null, * minLength?: float|null, - * minValue?: string|float|null, + * minValue?: MinValueShape|null, * readOnly?: bool|null, - * selectOptions?: list|null, + * selectOptions?: list|null, * selectOptionsTruncated?: bool|null, * } */ @@ -122,8 +127,10 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Type|value-of $type - * @param string|float|bool|list $defaultValue - * @param list $selectOptions + * @param DefaultValueShape $defaultValue + * @param MaxValueShape $maxValue + * @param MinValueShape $minValue + * @param list $selectOptions */ public static function with( Type|string $type, @@ -170,7 +177,7 @@ public function withType(Type|string $type): self /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. * - * @param string|float|bool|list $defaultValue + * @param DefaultValueShape $defaultValue */ public function withDefaultValue( string|float|bool|array $defaultValue @@ -205,6 +212,8 @@ public function withMaxLength(float $maxLength): self /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @param MaxValueShape $maxValue */ public function withMaxValue(string|float $maxValue): self { @@ -227,6 +236,8 @@ public function withMinLength(float $minLength): self /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @param MinValueShape $minValue */ public function withMinValue(string|float $minValue): self { @@ -250,7 +261,7 @@ public function withReadOnly(bool $readOnly): self /** * An array of allowed values when field type is `SingleSelect` or `MultiSelect`. * - * @param list $selectOptions + * @param list $selectOptions */ public function withSelectOptions(array $selectOptions): self { diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php index dc49a79e..adb5481d 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php @@ -12,6 +12,10 @@ /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. + * + * @phpstan-import-type MixedShape from \Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed_ + * + * @phpstan-type DefaultValueShape = string|float|bool|list */ final class DefaultValue implements ConverterSource { diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php index ec5ea825..99a42cef 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php @@ -8,6 +8,9 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; +/** + * @phpstan-type MixedShape = string|float|bool + */ final class Mixed_ implements ConverterSource { use SdkUnion; diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php index e13429a6..0917c285 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php @@ -10,6 +10,8 @@ /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @phpstan-type MaxValueShape = string|float */ final class MaxValue implements ConverterSource { diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php index 6f0a13a0..b847cf35 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php @@ -10,6 +10,8 @@ /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @phpstan-type MinValueShape = string|float */ final class MinValue implements ConverterSource { diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php index f7366d50..70276638 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php @@ -8,6 +8,9 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; +/** + * @phpstan-type SelectOptionShape = string|float|bool + */ final class SelectOption implements ConverterSource { use SdkUnion; diff --git a/src/Files/Folder.php b/src/Files/Folder.php index 768e12a3..e4de13d2 100644 --- a/src/Files/Folder.php +++ b/src/Files/Folder.php @@ -15,7 +15,7 @@ * folderID?: string|null, * folderPath?: string|null, * name?: string|null, - * type?: value-of|null, + * type?: null|Type|value-of, * updatedAt?: \DateTimeInterface|null, * } */ diff --git a/src/Files/Metadata.php b/src/Files/Metadata.php index 691ab256..06e9966e 100644 --- a/src/Files/Metadata.php +++ b/src/Files/Metadata.php @@ -8,20 +8,18 @@ use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Files\Metadata\Exif; -use Imagekit\Files\Metadata\Exif\Gps; -use Imagekit\Files\Metadata\Exif\Image; -use Imagekit\Files\Metadata\Exif\Interoperability; -use Imagekit\Files\Metadata\Exif\Thumbnail; /** * JSON object containing metadata. * + * @phpstan-import-type ExifShape from \Imagekit\Files\Metadata\Exif + * * @phpstan-type MetadataShape = array{ * audioCodec?: string|null, * bitRate?: int|null, * density?: int|null, * duration?: int|null, - * exif?: Exif|null, + * exif?: null|Exif|ExifShape, * format?: string|null, * hasColorProfile?: bool|null, * hasTransparency?: bool|null, @@ -129,14 +127,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Exif|array{ - * exif?: Exif\Exif|null, - * gps?: Gps|null, - * image?: Image|null, - * interoperability?: Interoperability|null, - * makernote?: array|null, - * thumbnail?: Thumbnail|null, - * } $exif + * @param ExifShape $exif */ public static function with( ?string $audioCodec = null, @@ -219,14 +210,7 @@ public function withDuration(int $duration): self } /** - * @param Exif|array{ - * exif?: Exif\Exif|null, - * gps?: Gps|null, - * image?: Image|null, - * interoperability?: Interoperability|null, - * makernote?: array|null, - * thumbnail?: Thumbnail|null, - * } $exif + * @param ExifShape $exif */ public function withExif(Exif|array $exif): self { diff --git a/src/Files/Metadata/Exif.php b/src/Files/Metadata/Exif.php index 9fef0dd8..45da1f1c 100644 --- a/src/Files/Metadata/Exif.php +++ b/src/Files/Metadata/Exif.php @@ -13,13 +13,19 @@ use Imagekit\Files\Metadata\Exif\Thumbnail; /** + * @phpstan-import-type ExifShape from \Imagekit\Files\Metadata\Exif\Exif as ExifShape1 + * @phpstan-import-type GpsShape from \Imagekit\Files\Metadata\Exif\Gps + * @phpstan-import-type ImageShape from \Imagekit\Files\Metadata\Exif\Image + * @phpstan-import-type InteroperabilityShape from \Imagekit\Files\Metadata\Exif\Interoperability + * @phpstan-import-type ThumbnailShape from \Imagekit\Files\Metadata\Exif\Thumbnail + * * @phpstan-type ExifShape = array{ - * exif?: \Imagekit\Files\Metadata\Exif\Exif|null, - * gps?: Gps|null, - * image?: Image|null, - * interoperability?: Interoperability|null, + * exif?: null|\Imagekit\Files\Metadata\Exif\Exif|ExifShape1, + * gps?: null|Gps|GpsShape, + * image?: null|Image|ImageShape, + * interoperability?: null|Interoperability|InteroperabilityShape, * makernote?: array|null, - * thumbnail?: Thumbnail|null, + * thumbnail?: null|Thumbnail|ThumbnailShape, * } */ final class Exif implements BaseModel @@ -71,60 +77,12 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Exif\Exif|array{ - * apertureValue?: float|null, - * colorSpace?: int|null, - * createDate?: string|null, - * customRendered?: int|null, - * dateTimeOriginal?: string|null, - * exifImageHeight?: int|null, - * exifImageWidth?: int|null, - * exifVersion?: string|null, - * exposureCompensation?: float|null, - * exposureMode?: int|null, - * exposureProgram?: int|null, - * exposureTime?: float|null, - * flash?: int|null, - * flashpixVersion?: string|null, - * fNumber?: float|null, - * focalLength?: int|null, - * focalPlaneResolutionUnit?: int|null, - * focalPlaneXResolution?: float|null, - * focalPlaneYResolution?: float|null, - * interopOffset?: int|null, - * iso?: int|null, - * meteringMode?: int|null, - * sceneCaptureType?: int|null, - * shutterSpeedValue?: float|null, - * subSecTime?: string|null, - * whiteBalance?: int|null, - * } $exif - * @param Gps|array{gpsVersionID?: list|null} $gps - * @param Image|array{ - * exifOffset?: int|null, - * gpsInfo?: int|null, - * make?: string|null, - * model?: string|null, - * modifyDate?: string|null, - * orientation?: int|null, - * resolutionUnit?: int|null, - * software?: string|null, - * xResolution?: int|null, - * yCbCrPositioning?: int|null, - * yResolution?: int|null, - * } $image - * @param Interoperability|array{ - * interopIndex?: string|null, interopVersion?: string|null - * } $interoperability + * @param ExifShape1 $exif + * @param GpsShape $gps + * @param ImageShape $image + * @param InteroperabilityShape $interoperability * @param array $makernote - * @param Thumbnail|array{ - * compression?: int|null, - * resolutionUnit?: int|null, - * thumbnailLength?: int|null, - * thumbnailOffset?: int|null, - * xResolution?: int|null, - * yResolution?: int|null, - * } $thumbnail + * @param ThumbnailShape $thumbnail */ public static function with( Exif\Exif|array|null $exif = null, @@ -149,34 +107,7 @@ public static function with( /** * Object containing Exif details. * - * @param Exif\Exif|array{ - * apertureValue?: float|null, - * colorSpace?: int|null, - * createDate?: string|null, - * customRendered?: int|null, - * dateTimeOriginal?: string|null, - * exifImageHeight?: int|null, - * exifImageWidth?: int|null, - * exifVersion?: string|null, - * exposureCompensation?: float|null, - * exposureMode?: int|null, - * exposureProgram?: int|null, - * exposureTime?: float|null, - * flash?: int|null, - * flashpixVersion?: string|null, - * fNumber?: float|null, - * focalLength?: int|null, - * focalPlaneResolutionUnit?: int|null, - * focalPlaneXResolution?: float|null, - * focalPlaneYResolution?: float|null, - * interopOffset?: int|null, - * iso?: int|null, - * meteringMode?: int|null, - * sceneCaptureType?: int|null, - * shutterSpeedValue?: float|null, - * subSecTime?: string|null, - * whiteBalance?: int|null, - * } $exif + * @param ExifShape1 $exif */ public function withExif( Exif\Exif|array $exif @@ -190,7 +121,7 @@ public function withExif( /** * Object containing GPS information. * - * @param Gps|array{gpsVersionID?: list|null} $gps + * @param GpsShape $gps */ public function withGps(Gps|array $gps): self { @@ -203,19 +134,7 @@ public function withGps(Gps|array $gps): self /** * Object containing EXIF image information. * - * @param Image|array{ - * exifOffset?: int|null, - * gpsInfo?: int|null, - * make?: string|null, - * model?: string|null, - * modifyDate?: string|null, - * orientation?: int|null, - * resolutionUnit?: int|null, - * software?: string|null, - * xResolution?: int|null, - * yCbCrPositioning?: int|null, - * yResolution?: int|null, - * } $image + * @param ImageShape $image */ public function withImage(Image|array $image): self { @@ -228,9 +147,7 @@ public function withImage(Image|array $image): self /** * JSON object. * - * @param Interoperability|array{ - * interopIndex?: string|null, interopVersion?: string|null - * } $interoperability + * @param InteroperabilityShape $interoperability */ public function withInteroperability( Interoperability|array $interoperability @@ -255,14 +172,7 @@ public function withMakernote(array $makernote): self /** * Object containing Thumbnail information. * - * @param Thumbnail|array{ - * compression?: int|null, - * resolutionUnit?: int|null, - * thumbnailLength?: int|null, - * thumbnailOffset?: int|null, - * xResolution?: int|null, - * yResolution?: int|null, - * } $thumbnail + * @param ThumbnailShape $thumbnail */ public function withThumbnail(Thumbnail|array $thumbnail): self { diff --git a/src/Files/UpdateFileRequest.php b/src/Files/UpdateFileRequest.php index d3089dd3..3ff531db 100644 --- a/src/Files/UpdateFileRequest.php +++ b/src/Files/UpdateFileRequest.php @@ -12,6 +12,11 @@ /** * Schema for update file update request. + * + * @phpstan-import-type UpdateFileDetailsShape from \Imagekit\Files\UpdateFileRequest\UpdateFileDetails + * @phpstan-import-type ChangePublicationStatusShape from \Imagekit\Files\UpdateFileRequest\ChangePublicationStatus + * + * @phpstan-type UpdateFileRequestShape = UpdateFileDetailsShape|ChangePublicationStatusShape */ final class UpdateFileRequest implements ConverterSource { diff --git a/src/Files/UpdateFileRequest/ChangePublicationStatus.php b/src/Files/UpdateFileRequest/ChangePublicationStatus.php index 48e6ef1e..f16861e0 100644 --- a/src/Files/UpdateFileRequest/ChangePublicationStatus.php +++ b/src/Files/UpdateFileRequest/ChangePublicationStatus.php @@ -10,7 +10,11 @@ use Imagekit\Files\UpdateFileRequest\ChangePublicationStatus\Publish; /** - * @phpstan-type ChangePublicationStatusShape = array{publish?: Publish|null} + * @phpstan-import-type PublishShape from \Imagekit\Files\UpdateFileRequest\ChangePublicationStatus\Publish + * + * @phpstan-type ChangePublicationStatusShape = array{ + * publish?: null|Publish|PublishShape + * } */ final class ChangePublicationStatus implements BaseModel { @@ -33,9 +37,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Publish|array{ - * isPublished: bool, includeFileVersions?: bool|null - * } $publish + * @param PublishShape $publish */ public static function with(Publish|array|null $publish = null): self { @@ -49,9 +51,7 @@ public static function with(Publish|array|null $publish = null): self /** * Configure the publication status of a file and its versions. * - * @param Publish|array{ - * isPublished: bool, includeFileVersions?: bool|null - * } $publish + * @param PublishShape $publish */ public function withPublish(Publish|array $publish): self { diff --git a/src/Files/UpdateFileRequest/UpdateFileDetails.php b/src/Files/UpdateFileRequest/UpdateFileDetails.php index 2d6195b6..37821b1c 100644 --- a/src/Files/UpdateFileRequest/UpdateFileDetails.php +++ b/src/Files/UpdateFileRequest/UpdateFileDetails.php @@ -10,18 +10,19 @@ use Imagekit\ExtensionItem; use Imagekit\ExtensionItem\AutoDescriptionExtension; use Imagekit\ExtensionItem\AutoTaggingExtension; -use Imagekit\ExtensionItem\AutoTaggingExtension\Name; use Imagekit\ExtensionItem\RemovedotBgExtension; -use Imagekit\ExtensionItem\RemovedotBgExtension\Options; use Imagekit\Files\UpdateFileRequest\UpdateFileDetails\RemoveAITags; /** + * @phpstan-import-type ExtensionItemShape from \Imagekit\ExtensionItem + * @phpstan-import-type RemoveAITagsShape from \Imagekit\Files\UpdateFileRequest\UpdateFileDetails\RemoveAITags + * * @phpstan-type UpdateFileDetailsShape = array{ * customCoordinates?: string|null, * customMetadata?: array|null, * description?: string|null, - * extensions?: list|null, - * removeAITags?: null|'all'|list, + * extensions?: list|null, + * removeAITags?: RemoveAITagsShape|null, * tags?: list|null, * webhookURL?: string|null, * } @@ -96,12 +97,8 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param array $customMetadata - * @param list - * }|AutoDescriptionExtension|array{name?: 'ai-auto-description'}> $extensions - * @param 'all'|list $removeAITags + * @param list $extensions + * @param RemoveAITagsShape $removeAITags * @param list|null $tags */ public static function with( @@ -164,11 +161,7 @@ public function withDescription(string $description): self /** * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * - * @param list - * }|AutoDescriptionExtension|array{name?: 'ai-auto-description'}> $extensions + * @param list $extensions */ public function withExtensions(array $extensions): self { @@ -185,7 +178,7 @@ public function withExtensions(array $extensions): self * * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. * - * @param 'all'|list $removeAITags + * @param RemoveAITagsShape $removeAITags */ public function withRemoveAITags(string|array $removeAITags): self { diff --git a/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php b/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php index dd36d37e..034f0f38 100644 --- a/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php +++ b/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php @@ -15,6 +15,8 @@ * If you want to remove all AITags associated with the file, send a string - "all". * * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. + * + * @phpstan-type RemoveAITagsShape = 'all'|list */ final class RemoveAITags implements ConverterSource { diff --git a/src/Folders/FolderCopyParams.php b/src/Folders/FolderCopyParams.php index 1b307942..726e2f14 100644 --- a/src/Folders/FolderCopyParams.php +++ b/src/Folders/FolderCopyParams.php @@ -16,7 +16,7 @@ * @see Imagekit\Services\FoldersService::copy() * * @phpstan-type FolderCopyParamsShape = array{ - * destinationPath: string, sourceFolderPath: string, includeVersions?: bool + * destinationPath: string, sourceFolderPath: string, includeVersions?: bool|null * } */ final class FolderCopyParams implements BaseModel diff --git a/src/Folders/FolderRenameParams.php b/src/Folders/FolderRenameParams.php index 16c9918c..dd706364 100644 --- a/src/Folders/FolderRenameParams.php +++ b/src/Folders/FolderRenameParams.php @@ -16,7 +16,7 @@ * @see Imagekit\Services\FoldersService::rename() * * @phpstan-type FolderRenameParamsShape = array{ - * folderPath: string, newFolderName: string, purgeCache?: bool + * folderPath: string, newFolderName: string, purgeCache?: bool|null * } */ final class FolderRenameParams implements BaseModel diff --git a/src/Folders/Job/JobGetResponse.php b/src/Folders/Job/JobGetResponse.php index e47c9bf1..5264e141 100644 --- a/src/Folders/Job/JobGetResponse.php +++ b/src/Folders/Job/JobGetResponse.php @@ -14,8 +14,8 @@ * @phpstan-type JobGetResponseShape = array{ * jobID?: string|null, * purgeRequestID?: string|null, - * status?: value-of|null, - * type?: value-of|null, + * status?: null|Status|value-of, + * type?: null|Type|value-of, * } */ final class JobGetResponse implements BaseModel diff --git a/src/GetImageAttributesOptions.php b/src/GetImageAttributesOptions.php index 3109477e..cec4010b 100644 --- a/src/GetImageAttributesOptions.php +++ b/src/GetImageAttributesOptions.php @@ -20,7 +20,7 @@ * queryParameters?: array|null, * signed?: bool|null, * transformation?: list|null, - * transformationPosition?: value-of|null, + * transformationPosition?: null|TransformationPosition|value-of, * deviceBreakpoints?: list|null, * imageBreakpoints?: list|null, * sizes?: string|null, diff --git a/src/ImageOverlay.php b/src/ImageOverlay.php index 56454d2e..c28b14d4 100644 --- a/src/ImageOverlay.php +++ b/src/ImageOverlay.php @@ -9,15 +9,17 @@ use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\ImageOverlay\Encoding; -use Imagekit\OverlayPosition\Focus; /** + * @phpstan-import-type OverlayPositionShape from \Imagekit\OverlayPosition + * @phpstan-import-type OverlayTimingShape from \Imagekit\OverlayTiming + * * @phpstan-type ImageOverlayShape = array{ - * position?: OverlayPosition|null, - * timing?: OverlayTiming|null, + * position?: null|OverlayPosition|OverlayPositionShape, + * timing?: null|OverlayTiming|OverlayTimingShape, * input: string, - * type?: 'image', - * encoding?: value-of|null, + * type: 'image', + * encoding?: null|Encoding|value-of, * transformation?: list|null, * } */ @@ -86,14 +88,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param OverlayPosition|array{ - * focus?: value-of|null, x?: float|string|null, y?: float|string|null - * } $position - * @param OverlayTiming|array{ - * duration?: float|string|null, - * end?: float|string|null, - * start?: float|string|null, - * } $timing + * @param OverlayPositionShape $position + * @param OverlayTimingShape $timing * @param Encoding|value-of $encoding * @param list $transformation */ @@ -117,9 +113,7 @@ public static function with( } /** - * @param OverlayPosition|array{ - * focus?: value-of|null, x?: float|string|null, y?: float|string|null - * } $position + * @param OverlayPositionShape $position */ public function withPosition(OverlayPosition|array $position): self { @@ -130,11 +124,7 @@ public function withPosition(OverlayPosition|array $position): self } /** - * @param OverlayTiming|array{ - * duration?: float|string|null, - * end?: float|string|null, - * start?: float|string|null, - * } $timing + * @param OverlayTimingShape $timing */ public function withTiming(OverlayTiming|array $timing): self { diff --git a/src/Overlay.php b/src/Overlay.php index 9cb94be8..cc18b4d8 100644 --- a/src/Overlay.php +++ b/src/Overlay.php @@ -12,6 +12,12 @@ * Specifies an overlay to be applied on the parent image or video. * ImageKit supports overlays including images, text, videos, subtitles, and solid colors. * See [Overlay using layers](https://imagekit.io/docs/transformations#overlay-using-layers). + * + * @phpstan-import-type TextOverlayShape from \Imagekit\TextOverlay + * @phpstan-import-type SubtitleOverlayShape from \Imagekit\SubtitleOverlay + * @phpstan-import-type SolidColorOverlayShape from \Imagekit\SolidColorOverlay + * + * @phpstan-type OverlayShape = TextOverlayShape|ImageOverlay|VideoOverlay|SubtitleOverlayShape|SolidColorOverlayShape */ final class Overlay implements ConverterSource { diff --git a/src/OverlayPosition.php b/src/OverlayPosition.php index 5669b5c9..9217b318 100644 --- a/src/OverlayPosition.php +++ b/src/OverlayPosition.php @@ -10,8 +10,11 @@ use Imagekit\OverlayPosition\Focus; /** + * @phpstan-import-type XShape from \Imagekit\OverlayPosition\X + * @phpstan-import-type YShape from \Imagekit\OverlayPosition\Y + * * @phpstan-type OverlayPositionShape = array{ - * focus?: value-of|null, x?: float|string|null, y?: float|string|null + * focus?: null|Focus|value-of, x?: XShape|null, y?: YShape|null * } */ final class OverlayPosition implements BaseModel @@ -57,6 +60,8 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Focus|value-of $focus + * @param XShape $x + * @param YShape $y */ public static function with( Focus|string|null $focus = null, @@ -91,6 +96,8 @@ public function withFocus(Focus|string $focus): self * It also accepts arithmetic expressions such as `bw_mul_0.4` or `bw_sub_cw`. * Maps to `lx` in the URL. * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * + * @param XShape $x */ public function withX(float|string $x): self { @@ -105,6 +112,8 @@ public function withX(float|string $x): self * It also accepts arithmetic expressions such as `bh_mul_0.4` or `bh_sub_ch`. * Maps to `ly` in the URL. * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * + * @param YShape $y */ public function withY(float|string $y): self { diff --git a/src/OverlayPosition/X.php b/src/OverlayPosition/X.php index 84bdbcc2..e961a883 100644 --- a/src/OverlayPosition/X.php +++ b/src/OverlayPosition/X.php @@ -13,6 +13,8 @@ * It also accepts arithmetic expressions such as `bw_mul_0.4` or `bw_sub_cw`. * Maps to `lx` in the URL. * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * + * @phpstan-type XShape = float|string */ final class X implements ConverterSource { diff --git a/src/OverlayPosition/Y.php b/src/OverlayPosition/Y.php index de81b5eb..b0241d3a 100644 --- a/src/OverlayPosition/Y.php +++ b/src/OverlayPosition/Y.php @@ -13,6 +13,8 @@ * It also accepts arithmetic expressions such as `bh_mul_0.4` or `bh_sub_ch`. * Maps to `ly` in the URL. * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * + * @phpstan-type YShape = float|string */ final class Y implements ConverterSource { diff --git a/src/OverlayTiming.php b/src/OverlayTiming.php index 3ce11e1c..73aa0430 100644 --- a/src/OverlayTiming.php +++ b/src/OverlayTiming.php @@ -9,10 +9,12 @@ use Imagekit\Core\Contracts\BaseModel; /** + * @phpstan-import-type DurationShape from \Imagekit\OverlayTiming\Duration + * @phpstan-import-type EndShape from \Imagekit\OverlayTiming\End + * @phpstan-import-type StartShape from \Imagekit\OverlayTiming\Start + * * @phpstan-type OverlayTimingShape = array{ - * duration?: float|string|null, - * end?: float|string|null, - * start?: float|string|null, + * duration?: DurationShape|null, end?: EndShape|null, start?: StartShape|null * } */ final class OverlayTiming implements BaseModel @@ -57,6 +59,10 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param DurationShape $duration + * @param EndShape $end + * @param StartShape $start */ public static function with( float|string|null $duration = null, @@ -77,6 +83,8 @@ public static function with( * Accepts a positive number up to two decimal places (e.g., `20` or `20.50`) and arithmetic expressions such as `bdu_mul_0.4` or `bdu_sub_idu`. * Applies only if the base asset is a video. * Maps to `ldu` in the URL. + * + * @param DurationShape $duration */ public function withDuration(float|string $duration): self { @@ -92,6 +100,8 @@ public function withDuration(float|string $duration): self * Accepts a positive number up to two decimal places (e.g., `20` or `20.50`) and arithmetic expressions such as `bdu_mul_0.4` or `bdu_sub_idu`. * Applies only if the base asset is a video. * Maps to `leo` in the URL. + * + * @param EndShape $end */ public function withEnd(float|string $end): self { @@ -106,6 +116,8 @@ public function withEnd(float|string $end): self * Accepts a positive number up to two decimal places (e.g., `20` or `20.50`) and arithmetic expressions such as `bdu_mul_0.4` or `bdu_sub_idu`. * Applies only if the base asset is a video. * Maps to `lso` in the URL. + * + * @param StartShape $start */ public function withStart(float|string $start): self { diff --git a/src/OverlayTiming/Duration.php b/src/OverlayTiming/Duration.php index 1b411d64..751fd5bc 100644 --- a/src/OverlayTiming/Duration.php +++ b/src/OverlayTiming/Duration.php @@ -13,6 +13,8 @@ * Accepts a positive number up to two decimal places (e.g., `20` or `20.50`) and arithmetic expressions such as `bdu_mul_0.4` or `bdu_sub_idu`. * Applies only if the base asset is a video. * Maps to `ldu` in the URL. + * + * @phpstan-type DurationShape = float|string */ final class Duration implements ConverterSource { diff --git a/src/OverlayTiming/End.php b/src/OverlayTiming/End.php index ac3cc087..71a70ebb 100644 --- a/src/OverlayTiming/End.php +++ b/src/OverlayTiming/End.php @@ -14,6 +14,8 @@ * Accepts a positive number up to two decimal places (e.g., `20` or `20.50`) and arithmetic expressions such as `bdu_mul_0.4` or `bdu_sub_idu`. * Applies only if the base asset is a video. * Maps to `leo` in the URL. + * + * @phpstan-type EndShape = float|string */ final class End implements ConverterSource { diff --git a/src/OverlayTiming/Start.php b/src/OverlayTiming/Start.php index 5e7cf6e7..59ee6feb 100644 --- a/src/OverlayTiming/Start.php +++ b/src/OverlayTiming/Start.php @@ -13,6 +13,8 @@ * Accepts a positive number up to two decimal places (e.g., `20` or `20.50`) and arithmetic expressions such as `bdu_mul_0.4` or `bdu_sub_idu`. * Applies only if the base asset is a video. * Maps to `lso` in the URL. + * + * @phpstan-type StartShape = float|string */ final class Start implements ConverterSource { diff --git a/src/ServiceContracts/Accounts/OriginsRawContract.php b/src/ServiceContracts/Accounts/OriginsRawContract.php index bb1244ec..f8cb7608 100644 --- a/src/ServiceContracts/Accounts/OriginsRawContract.php +++ b/src/ServiceContracts/Accounts/OriginsRawContract.php @@ -23,7 +23,7 @@ interface OriginsRawContract /** * @api * - * @param array|OriginCreateParams $params + * @param array|OriginCreateParams $params * * @return BaseResponse * @@ -38,7 +38,7 @@ public function create( * @api * * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. - * @param array|OriginUpdateParams $params + * @param array|OriginUpdateParams $params * * @return BaseResponse * diff --git a/src/ServiceContracts/Accounts/URLEndpointsRawContract.php b/src/ServiceContracts/Accounts/URLEndpointsRawContract.php index 68734ae3..161b6f29 100644 --- a/src/ServiceContracts/Accounts/URLEndpointsRawContract.php +++ b/src/ServiceContracts/Accounts/URLEndpointsRawContract.php @@ -16,7 +16,7 @@ interface URLEndpointsRawContract /** * @api * - * @param array|URLEndpointCreateParams $params + * @param array|URLEndpointCreateParams $params * * @return BaseResponse * @@ -31,7 +31,7 @@ public function create( * @api * * @param string $id Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. - * @param array|URLEndpointUpdateParams $params + * @param array|URLEndpointUpdateParams $params * * @return BaseResponse * diff --git a/src/ServiceContracts/Accounts/UsageRawContract.php b/src/ServiceContracts/Accounts/UsageRawContract.php index d6c6fcfd..bdbc53ad 100644 --- a/src/ServiceContracts/Accounts/UsageRawContract.php +++ b/src/ServiceContracts/Accounts/UsageRawContract.php @@ -15,7 +15,7 @@ interface UsageRawContract /** * @api * - * @param array|UsageGetParams $params + * @param array|UsageGetParams $params * * @return BaseResponse * diff --git a/src/ServiceContracts/AssetsRawContract.php b/src/ServiceContracts/AssetsRawContract.php index 6dedb872..35df741a 100644 --- a/src/ServiceContracts/AssetsRawContract.php +++ b/src/ServiceContracts/AssetsRawContract.php @@ -16,7 +16,7 @@ interface AssetsRawContract /** * @api * - * @param array|AssetListParams $params + * @param array|AssetListParams $params * * @return BaseResponse> * diff --git a/src/ServiceContracts/Beta/V2/FilesRawContract.php b/src/ServiceContracts/Beta/V2/FilesRawContract.php index dd25ec75..f0b61a2d 100644 --- a/src/ServiceContracts/Beta/V2/FilesRawContract.php +++ b/src/ServiceContracts/Beta/V2/FilesRawContract.php @@ -15,7 +15,7 @@ interface FilesRawContract /** * @api * - * @param array|FileUploadParams $params + * @param array|FileUploadParams $params * * @return BaseResponse * diff --git a/src/ServiceContracts/Cache/InvalidationRawContract.php b/src/ServiceContracts/Cache/InvalidationRawContract.php index 8f8d5ffd..3b4a65f1 100644 --- a/src/ServiceContracts/Cache/InvalidationRawContract.php +++ b/src/ServiceContracts/Cache/InvalidationRawContract.php @@ -16,7 +16,7 @@ interface InvalidationRawContract /** * @api * - * @param array|InvalidationCreateParams $params + * @param array|InvalidationCreateParams $params * * @return BaseResponse * diff --git a/src/ServiceContracts/CustomMetadataFieldsRawContract.php b/src/ServiceContracts/CustomMetadataFieldsRawContract.php index bb310038..b423f7d0 100644 --- a/src/ServiceContracts/CustomMetadataFieldsRawContract.php +++ b/src/ServiceContracts/CustomMetadataFieldsRawContract.php @@ -18,7 +18,7 @@ interface CustomMetadataFieldsRawContract /** * @api * - * @param array|CustomMetadataFieldCreateParams $params + * @param array|CustomMetadataFieldCreateParams $params * * @return BaseResponse * @@ -33,7 +33,7 @@ public function create( * @api * * @param string $id should be a valid custom metadata field id - * @param array|CustomMetadataFieldUpdateParams $params + * @param array|CustomMetadataFieldUpdateParams $params * * @return BaseResponse * @@ -48,7 +48,7 @@ public function update( /** * @api * - * @param array|CustomMetadataFieldListParams $params + * @param array|CustomMetadataFieldListParams $params * * @return BaseResponse> * diff --git a/src/ServiceContracts/Files/BulkRawContract.php b/src/ServiceContracts/Files/BulkRawContract.php index 7919f22d..2c90b25c 100644 --- a/src/ServiceContracts/Files/BulkRawContract.php +++ b/src/ServiceContracts/Files/BulkRawContract.php @@ -21,7 +21,7 @@ interface BulkRawContract /** * @api * - * @param array|BulkDeleteParams $params + * @param array|BulkDeleteParams $params * * @return BaseResponse * @@ -35,7 +35,7 @@ public function delete( /** * @api * - * @param array|BulkAddTagsParams $params + * @param array|BulkAddTagsParams $params * * @return BaseResponse * @@ -49,7 +49,7 @@ public function addTags( /** * @api * - * @param array|BulkRemoveAITagsParams $params + * @param array|BulkRemoveAITagsParams $params * * @return BaseResponse * @@ -63,7 +63,7 @@ public function removeAITags( /** * @api * - * @param array|BulkRemoveTagsParams $params + * @param array|BulkRemoveTagsParams $params * * @return BaseResponse * diff --git a/src/ServiceContracts/Files/MetadataRawContract.php b/src/ServiceContracts/Files/MetadataRawContract.php index b909aedb..199f24bc 100644 --- a/src/ServiceContracts/Files/MetadataRawContract.php +++ b/src/ServiceContracts/Files/MetadataRawContract.php @@ -29,7 +29,7 @@ public function get( /** * @api * - * @param array|MetadataGetFromURLParams $params + * @param array|MetadataGetFromURLParams $params * * @return BaseResponse * diff --git a/src/ServiceContracts/Files/VersionsRawContract.php b/src/ServiceContracts/Files/VersionsRawContract.php index ef64450d..e683e6f9 100644 --- a/src/ServiceContracts/Files/VersionsRawContract.php +++ b/src/ServiceContracts/Files/VersionsRawContract.php @@ -33,7 +33,7 @@ public function list( * @api * * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. - * @param array|VersionDeleteParams $params + * @param array|VersionDeleteParams $params * * @return BaseResponse * @@ -49,7 +49,7 @@ public function delete( * @api * * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. - * @param array|VersionGetParams $params + * @param array|VersionGetParams $params * * @return BaseResponse * @@ -65,7 +65,7 @@ public function get( * @api * * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. - * @param array|VersionRestoreParams $params + * @param array|VersionRestoreParams $params * * @return BaseResponse * diff --git a/src/ServiceContracts/FilesRawContract.php b/src/ServiceContracts/FilesRawContract.php index e1cfa367..01097e73 100644 --- a/src/ServiceContracts/FilesRawContract.php +++ b/src/ServiceContracts/FilesRawContract.php @@ -25,7 +25,7 @@ interface FilesRawContract * @api * * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. - * @param array|FileUpdateParams $params + * @param array|FileUpdateParams $params * * @return BaseResponse * @@ -54,7 +54,7 @@ public function delete( /** * @api * - * @param array|FileCopyParams $params + * @param array|FileCopyParams $params * * @return BaseResponse * @@ -82,7 +82,7 @@ public function get( /** * @api * - * @param array|FileMoveParams $params + * @param array|FileMoveParams $params * * @return BaseResponse * @@ -96,7 +96,7 @@ public function move( /** * @api * - * @param array|FileRenameParams $params + * @param array|FileRenameParams $params * * @return BaseResponse * @@ -110,7 +110,7 @@ public function rename( /** * @api * - * @param array|FileUploadParams $params + * @param array|FileUploadParams $params * * @return BaseResponse * diff --git a/src/ServiceContracts/FoldersRawContract.php b/src/ServiceContracts/FoldersRawContract.php index 38845323..b1413611 100644 --- a/src/ServiceContracts/FoldersRawContract.php +++ b/src/ServiceContracts/FoldersRawContract.php @@ -23,7 +23,7 @@ interface FoldersRawContract /** * @api * - * @param array|FolderCreateParams $params + * @param array|FolderCreateParams $params * * @return BaseResponse * @@ -37,7 +37,7 @@ public function create( /** * @api * - * @param array|FolderDeleteParams $params + * @param array|FolderDeleteParams $params * * @return BaseResponse * @@ -51,7 +51,7 @@ public function delete( /** * @api * - * @param array|FolderCopyParams $params + * @param array|FolderCopyParams $params * * @return BaseResponse * @@ -65,7 +65,7 @@ public function copy( /** * @api * - * @param array|FolderMoveParams $params + * @param array|FolderMoveParams $params * * @return BaseResponse * @@ -79,7 +79,7 @@ public function move( /** * @api * - * @param array|FolderRenameParams $params + * @param array|FolderRenameParams $params * * @return BaseResponse * diff --git a/src/SolidColorOverlay.php b/src/SolidColorOverlay.php index 18b332e3..afe0b228 100644 --- a/src/SolidColorOverlay.php +++ b/src/SolidColorOverlay.php @@ -8,15 +8,18 @@ use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\OverlayPosition\Focus; /** + * @phpstan-import-type OverlayPositionShape from \Imagekit\OverlayPosition + * @phpstan-import-type OverlayTimingShape from \Imagekit\OverlayTiming + * @phpstan-import-type SolidColorOverlayTransformationShape from \Imagekit\SolidColorOverlayTransformation + * * @phpstan-type SolidColorOverlayShape = array{ - * position?: OverlayPosition|null, - * timing?: OverlayTiming|null, + * position?: null|OverlayPosition|OverlayPositionShape, + * timing?: null|OverlayTiming|OverlayTimingShape, * color: string, - * type?: 'solidColor', - * transformation?: list|null, + * type: 'solidColor', + * transformation?: list|null, * } */ final class SolidColorOverlay implements BaseModel @@ -74,22 +77,9 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param OverlayPosition|array{ - * focus?: value-of|null, x?: float|string|null, y?: float|string|null - * } $position - * @param OverlayTiming|array{ - * duration?: float|string|null, - * end?: float|string|null, - * start?: float|string|null, - * } $timing - * @param list $transformation + * @param OverlayPositionShape $position + * @param OverlayTimingShape $timing + * @param list $transformation */ public static function with( string $color, @@ -109,9 +99,7 @@ public static function with( } /** - * @param OverlayPosition|array{ - * focus?: value-of|null, x?: float|string|null, y?: float|string|null - * } $position + * @param OverlayPositionShape $position */ public function withPosition(OverlayPosition|array $position): self { @@ -122,11 +110,7 @@ public function withPosition(OverlayPosition|array $position): self } /** - * @param OverlayTiming|array{ - * duration?: float|string|null, - * end?: float|string|null, - * start?: float|string|null, - * } $timing + * @param OverlayTimingShape $timing */ public function withTiming(OverlayTiming|array $timing): self { @@ -152,14 +136,7 @@ public function withColor(string $color): self * Control width and height of the solid color overlay. Supported transformations depend on the base/parent asset. * See overlays on [Images](https://imagekit.io/docs/add-overlays-on-images#apply-transformation-on-solid-color-overlay) and [Videos](https://imagekit.io/docs/add-overlays-on-videos#apply-transformations-on-solid-color-block-overlay). * - * @param list $transformation + * @param list $transformation */ public function withTransformation(array $transformation): self { diff --git a/src/SolidColorOverlayTransformation.php b/src/SolidColorOverlayTransformation.php index 3af0dc4b..c058f903 100644 --- a/src/SolidColorOverlayTransformation.php +++ b/src/SolidColorOverlayTransformation.php @@ -9,13 +9,18 @@ use Imagekit\Core\Contracts\BaseModel; /** + * @phpstan-import-type GradientShape from \Imagekit\SolidColorOverlayTransformation\Gradient + * @phpstan-import-type HeightShape from \Imagekit\SolidColorOverlayTransformation\Height + * @phpstan-import-type RadiusShape from \Imagekit\SolidColorOverlayTransformation\Radius + * @phpstan-import-type WidthShape from \Imagekit\SolidColorOverlayTransformation\Width + * * @phpstan-type SolidColorOverlayTransformationShape = array{ * alpha?: float|null, * background?: string|null, - * gradient?: string|null|bool, - * height?: float|string|null, - * radius?: float|null|'max', - * width?: float|string|null, + * gradient?: GradientShape|null, + * height?: HeightShape|null, + * radius?: RadiusShape|null, + * width?: WidthShape|null, * } */ final class SolidColorOverlayTransformation implements BaseModel @@ -75,7 +80,10 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param float|'max' $radius + * @param GradientShape $gradient + * @param HeightShape $height + * @param RadiusShape $radius + * @param WidthShape $width */ public static function with( ?float $alpha = null, @@ -122,6 +130,8 @@ public function withBackground(string $background): self /** * Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. * Only works if the base asset is an image. See [gradient](https://imagekit.io/docs/effects-and-enhancements#gradient---e-gradient). + * + * @param GradientShape $gradient */ public function withGradient(string|bool $gradient): self { @@ -134,6 +144,8 @@ public function withGradient(string|bool $gradient): self /** * Controls the height of the solid color overlay. Accepts a numeric value or an arithmetic expression. * Learn about [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * + * @param HeightShape $height */ public function withHeight(float|string $height): self { @@ -147,7 +159,7 @@ public function withHeight(float|string $height): self * Specifies the corner radius of the solid color overlay. Set to `max` for circular or oval shape. * See [radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). * - * @param float|'max' $radius + * @param RadiusShape $radius */ public function withRadius(float|string $radius): self { @@ -160,6 +172,8 @@ public function withRadius(float|string $radius): self /** * Controls the width of the solid color overlay. Accepts a numeric value or an arithmetic expression (e.g., `bw_mul_0.2` or `bh_div_2`). * Learn about [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * + * @param WidthShape $width */ public function withWidth(float|string $width): self { diff --git a/src/SolidColorOverlayTransformation/Gradient.php b/src/SolidColorOverlayTransformation/Gradient.php index f2b02412..b29fdad5 100644 --- a/src/SolidColorOverlayTransformation/Gradient.php +++ b/src/SolidColorOverlayTransformation/Gradient.php @@ -11,6 +11,8 @@ /** * Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. * Only works if the base asset is an image. See [gradient](https://imagekit.io/docs/effects-and-enhancements#gradient---e-gradient). + * + * @phpstan-type GradientShape = string|bool */ final class Gradient implements ConverterSource { diff --git a/src/SolidColorOverlayTransformation/Height.php b/src/SolidColorOverlayTransformation/Height.php index e66bf3ec..4e866ae5 100644 --- a/src/SolidColorOverlayTransformation/Height.php +++ b/src/SolidColorOverlayTransformation/Height.php @@ -11,6 +11,8 @@ /** * Controls the height of the solid color overlay. Accepts a numeric value or an arithmetic expression. * Learn about [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * + * @phpstan-type HeightShape = float|string */ final class Height implements ConverterSource { diff --git a/src/SolidColorOverlayTransformation/Radius.php b/src/SolidColorOverlayTransformation/Radius.php index 8582e3ad..6f2790da 100644 --- a/src/SolidColorOverlayTransformation/Radius.php +++ b/src/SolidColorOverlayTransformation/Radius.php @@ -11,6 +11,8 @@ /** * Specifies the corner radius of the solid color overlay. Set to `max` for circular or oval shape. * See [radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). + * + * @phpstan-type RadiusShape = float|'max' */ final class Radius implements ConverterSource { diff --git a/src/SolidColorOverlayTransformation/Width.php b/src/SolidColorOverlayTransformation/Width.php index 3717af43..556d8dcd 100644 --- a/src/SolidColorOverlayTransformation/Width.php +++ b/src/SolidColorOverlayTransformation/Width.php @@ -11,6 +11,8 @@ /** * Controls the width of the solid color overlay. Accepts a numeric value or an arithmetic expression (e.g., `bw_mul_0.2` or `bh_div_2`). * Learn about [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * + * @phpstan-type WidthShape = float|string */ final class Width implements ConverterSource { diff --git a/src/SrcOptions.php b/src/SrcOptions.php index b03d5b50..81238d4e 100644 --- a/src/SrcOptions.php +++ b/src/SrcOptions.php @@ -19,7 +19,7 @@ * queryParameters?: array|null, * signed?: bool|null, * transformation?: list|null, - * transformationPosition?: value-of|null, + * transformationPosition?: null|TransformationPosition|value-of, * } */ final class SrcOptions implements BaseModel diff --git a/src/SubtitleOverlay.php b/src/SubtitleOverlay.php index 3b2baf29..8eea4b63 100644 --- a/src/SubtitleOverlay.php +++ b/src/SubtitleOverlay.php @@ -8,18 +8,20 @@ use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\OverlayPosition\Focus; use Imagekit\SubtitleOverlay\Encoding; -use Imagekit\SubtitleOverlayTransformation\Typography; /** + * @phpstan-import-type OverlayPositionShape from \Imagekit\OverlayPosition + * @phpstan-import-type OverlayTimingShape from \Imagekit\OverlayTiming + * @phpstan-import-type SubtitleOverlayTransformationShape from \Imagekit\SubtitleOverlayTransformation + * * @phpstan-type SubtitleOverlayShape = array{ - * position?: OverlayPosition|null, - * timing?: OverlayTiming|null, + * position?: null|OverlayPosition|OverlayPositionShape, + * timing?: null|OverlayTiming|OverlayTimingShape, * input: string, - * type?: 'subtitle', - * encoding?: value-of|null, - * transformation?: list|null, + * type: 'subtitle', + * encoding?: null|Encoding|value-of, + * transformation?: list|null, * } */ final class SubtitleOverlay implements BaseModel @@ -86,24 +88,10 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param OverlayPosition|array{ - * focus?: value-of|null, x?: float|string|null, y?: float|string|null - * } $position - * @param OverlayTiming|array{ - * duration?: float|string|null, - * end?: float|string|null, - * start?: float|string|null, - * } $timing + * @param OverlayPositionShape $position + * @param OverlayTimingShape $timing * @param Encoding|value-of $encoding - * @param list|null, - * }> $transformation + * @param list $transformation */ public static function with( string $input, @@ -125,9 +113,7 @@ public static function with( } /** - * @param OverlayPosition|array{ - * focus?: value-of|null, x?: float|string|null, y?: float|string|null - * } $position + * @param OverlayPositionShape $position */ public function withPosition(OverlayPosition|array $position): self { @@ -138,11 +124,7 @@ public function withPosition(OverlayPosition|array $position): self } /** - * @param OverlayTiming|array{ - * duration?: float|string|null, - * end?: float|string|null, - * start?: float|string|null, - * } $timing + * @param OverlayTimingShape $timing */ public function withTiming(OverlayTiming|array $timing): self { @@ -182,15 +164,7 @@ public function withEncoding(Encoding|string $encoding): self /** * Control styling of the subtitle. See [Styling subtitles](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer). * - * @param list|null, - * }> $transformation + * @param list $transformation */ public function withTransformation(array $transformation): self { diff --git a/src/SubtitleOverlayTransformation.php b/src/SubtitleOverlayTransformation.php index 65a926dc..375c0568 100644 --- a/src/SubtitleOverlayTransformation.php +++ b/src/SubtitleOverlayTransformation.php @@ -19,7 +19,7 @@ * fontOutline?: string|null, * fontShadow?: string|null, * fontSize?: float|null, - * typography?: value-of|null, + * typography?: null|Typography|value-of, * } */ final class SubtitleOverlayTransformation implements BaseModel diff --git a/src/TextOverlay.php b/src/TextOverlay.php index 98618ccf..342cf13d 100644 --- a/src/TextOverlay.php +++ b/src/TextOverlay.php @@ -8,19 +8,20 @@ use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\OverlayPosition\Focus; use Imagekit\TextOverlay\Encoding; -use Imagekit\TextOverlayTransformation\Flip; -use Imagekit\TextOverlayTransformation\InnerAlignment; /** + * @phpstan-import-type OverlayPositionShape from \Imagekit\OverlayPosition + * @phpstan-import-type OverlayTimingShape from \Imagekit\OverlayTiming + * @phpstan-import-type TextOverlayTransformationShape from \Imagekit\TextOverlayTransformation + * * @phpstan-type TextOverlayShape = array{ - * position?: OverlayPosition|null, - * timing?: OverlayTiming|null, + * position?: null|OverlayPosition|OverlayPositionShape, + * timing?: null|OverlayTiming|OverlayTimingShape, * text: string, - * type?: 'text', - * encoding?: value-of|null, - * transformation?: list|null, + * type: 'text', + * encoding?: null|Encoding|value-of, + * transformation?: list|null, * } */ final class TextOverlay implements BaseModel @@ -87,30 +88,10 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param OverlayPosition|array{ - * focus?: value-of|null, x?: float|string|null, y?: float|string|null - * } $position - * @param OverlayTiming|array{ - * duration?: float|string|null, - * end?: float|string|null, - * start?: float|string|null, - * } $timing + * @param OverlayPositionShape $position + * @param OverlayTimingShape $timing * @param Encoding|value-of $encoding - * @param list|null, - * fontColor?: string|null, - * fontFamily?: string|null, - * fontSize?: float|string|null, - * innerAlignment?: value-of|null, - * lineHeight?: float|string|null, - * padding?: float|string|null, - * radius?: float|'max'|null, - * rotation?: float|string|null, - * typography?: string|null, - * width?: float|string|null, - * }> $transformation + * @param list $transformation */ public static function with( string $text, @@ -132,9 +113,7 @@ public static function with( } /** - * @param OverlayPosition|array{ - * focus?: value-of|null, x?: float|string|null, y?: float|string|null - * } $position + * @param OverlayPositionShape $position */ public function withPosition(OverlayPosition|array $position): self { @@ -145,11 +124,7 @@ public function withPosition(OverlayPosition|array $position): self } /** - * @param OverlayTiming|array{ - * duration?: float|string|null, - * end?: float|string|null, - * start?: float|string|null, - * } $timing + * @param OverlayTimingShape $timing */ public function withTiming(OverlayTiming|array $timing): self { @@ -189,21 +164,7 @@ public function withEncoding(Encoding|string $encoding): self /** * Control styling of the text overlay. See [Text overlays](https://imagekit.io/docs/add-overlays-on-images#text-overlay). * - * @param list|null, - * fontColor?: string|null, - * fontFamily?: string|null, - * fontSize?: float|string|null, - * innerAlignment?: value-of|null, - * lineHeight?: float|string|null, - * padding?: float|string|null, - * radius?: float|'max'|null, - * rotation?: float|string|null, - * typography?: string|null, - * width?: float|string|null, - * }> $transformation + * @param list $transformation */ public function withTransformation(array $transformation): self { diff --git a/src/TextOverlayTransformation.php b/src/TextOverlayTransformation.php index 8f64a7dc..61dc7d43 100644 --- a/src/TextOverlayTransformation.php +++ b/src/TextOverlayTransformation.php @@ -11,20 +11,27 @@ use Imagekit\TextOverlayTransformation\InnerAlignment; /** + * @phpstan-import-type FontSizeShape from \Imagekit\TextOverlayTransformation\FontSize + * @phpstan-import-type LineHeightShape from \Imagekit\TextOverlayTransformation\LineHeight + * @phpstan-import-type PaddingShape from \Imagekit\TextOverlayTransformation\Padding + * @phpstan-import-type RadiusShape from \Imagekit\TextOverlayTransformation\Radius + * @phpstan-import-type RotationShape from \Imagekit\TextOverlayTransformation\Rotation + * @phpstan-import-type WidthShape from \Imagekit\TextOverlayTransformation\Width + * * @phpstan-type TextOverlayTransformationShape = array{ * alpha?: float|null, * background?: string|null, - * flip?: value-of|null, + * flip?: null|Flip|value-of, * fontColor?: string|null, * fontFamily?: string|null, - * fontSize?: float|string|null, - * innerAlignment?: value-of|null, - * lineHeight?: float|string|null, - * padding?: float|string|null, - * radius?: float|null|'max', - * rotation?: float|string|null, + * fontSize?: FontSizeShape|null, + * innerAlignment?: null|InnerAlignment|value-of, + * lineHeight?: LineHeightShape|null, + * padding?: PaddingShape|null, + * radius?: RadiusShape|null, + * rotation?: RotationShape|null, * typography?: string|null, - * width?: float|string|null, + * width?: WidthShape|null, * } */ final class TextOverlayTransformation implements BaseModel @@ -138,8 +145,13 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Flip|value-of $flip + * @param FontSizeShape $fontSize * @param InnerAlignment|value-of $innerAlignment - * @param float|'max' $radius + * @param LineHeightShape $lineHeight + * @param PaddingShape $padding + * @param RadiusShape $radius + * @param RotationShape $rotation + * @param WidthShape $width */ public static function with( ?float $alpha = null, @@ -236,6 +248,8 @@ public function withFontFamily(string $fontFamily): self /** * Specifies the font size of the overlaid text. Accepts a numeric value or an arithmetic expression. + * + * @param FontSizeShape $fontSize */ public function withFontSize(float|string $fontSize): self { @@ -262,6 +276,8 @@ public function withInnerAlignment( /** * Specifies the line height of the text overlay. * Accepts integer values representing line height in points. It can also accept [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations) such as `bw_mul_0.2`, or `bh_div_20`. + * + * @param LineHeightShape $lineHeight */ public function withLineHeight(float|string $lineHeight): self { @@ -275,6 +291,8 @@ public function withLineHeight(float|string $lineHeight): self * Specifies the padding around the overlaid text. * Can be provided as a single positive integer or multiple values separated by underscores (following CSS shorthand order). * Arithmetic expressions are also accepted. + * + * @param PaddingShape $padding */ public function withPadding(float|string $padding): self { @@ -288,7 +306,7 @@ public function withPadding(float|string $padding): self * Specifies the corner radius of the text overlay. * Set to `max` to achieve a circular or oval shape. * - * @param float|'max' $radius + * @param RadiusShape $radius */ public function withRadius(float|string $radius): self { @@ -301,6 +319,8 @@ public function withRadius(float|string $radius): self /** * Specifies the rotation angle of the text overlay. * Accepts a numeric value for clockwise rotation or a string prefixed with "N" for counter-clockwise rotation. + * + * @param RotationShape $rotation */ public function withRotation(float|string $rotation): self { @@ -327,6 +347,8 @@ public function withTypography(string $typography): self /** * Specifies the maximum width (in pixels) of the overlaid text. The text wraps automatically, and arithmetic expressions (e.g., `bw_mul_0.2` or `bh_div_2`) are supported. Useful when used in conjunction with the `background`. * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * + * @param WidthShape $width */ public function withWidth(float|string $width): self { diff --git a/src/TextOverlayTransformation/FontSize.php b/src/TextOverlayTransformation/FontSize.php index 6b32a4eb..eb920b34 100644 --- a/src/TextOverlayTransformation/FontSize.php +++ b/src/TextOverlayTransformation/FontSize.php @@ -10,6 +10,8 @@ /** * Specifies the font size of the overlaid text. Accepts a numeric value or an arithmetic expression. + * + * @phpstan-type FontSizeShape = float|string */ final class FontSize implements ConverterSource { diff --git a/src/TextOverlayTransformation/LineHeight.php b/src/TextOverlayTransformation/LineHeight.php index f81fd5a1..091381d1 100644 --- a/src/TextOverlayTransformation/LineHeight.php +++ b/src/TextOverlayTransformation/LineHeight.php @@ -11,6 +11,8 @@ /** * Specifies the line height of the text overlay. * Accepts integer values representing line height in points. It can also accept [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations) such as `bw_mul_0.2`, or `bh_div_20`. + * + * @phpstan-type LineHeightShape = float|string */ final class LineHeight implements ConverterSource { diff --git a/src/TextOverlayTransformation/Padding.php b/src/TextOverlayTransformation/Padding.php index f143972c..d3d21c2a 100644 --- a/src/TextOverlayTransformation/Padding.php +++ b/src/TextOverlayTransformation/Padding.php @@ -12,6 +12,8 @@ * Specifies the padding around the overlaid text. * Can be provided as a single positive integer or multiple values separated by underscores (following CSS shorthand order). * Arithmetic expressions are also accepted. + * + * @phpstan-type PaddingShape = float|string */ final class Padding implements ConverterSource { diff --git a/src/TextOverlayTransformation/Radius.php b/src/TextOverlayTransformation/Radius.php index 578f9926..058fb00c 100644 --- a/src/TextOverlayTransformation/Radius.php +++ b/src/TextOverlayTransformation/Radius.php @@ -11,6 +11,8 @@ /** * Specifies the corner radius of the text overlay. * Set to `max` to achieve a circular or oval shape. + * + * @phpstan-type RadiusShape = float|'max' */ final class Radius implements ConverterSource { diff --git a/src/TextOverlayTransformation/Rotation.php b/src/TextOverlayTransformation/Rotation.php index 5e5be3c5..84f3c988 100644 --- a/src/TextOverlayTransformation/Rotation.php +++ b/src/TextOverlayTransformation/Rotation.php @@ -11,6 +11,8 @@ /** * Specifies the rotation angle of the text overlay. * Accepts a numeric value for clockwise rotation or a string prefixed with "N" for counter-clockwise rotation. + * + * @phpstan-type RotationShape = float|string */ final class Rotation implements ConverterSource { diff --git a/src/TextOverlayTransformation/Width.php b/src/TextOverlayTransformation/Width.php index d136c091..8f4b12b5 100644 --- a/src/TextOverlayTransformation/Width.php +++ b/src/TextOverlayTransformation/Width.php @@ -11,6 +11,8 @@ /** * Specifies the maximum width (in pixels) of the overlaid text. The text wraps automatically, and arithmetic expressions (e.g., `bw_mul_0.2` or `bh_div_2`) are supported. Useful when used in conjunction with the `background`. * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * + * @phpstan-type WidthShape = float|string */ final class Width implements ConverterSource { diff --git a/src/Transformation.php b/src/Transformation.php index 31c5d88a..ad0e496b 100644 --- a/src/Transformation.php +++ b/src/Transformation.php @@ -20,58 +20,78 @@ * You can use the `raw` parameter to pass the transformation string directly. * See the [Transformations documentation](https://imagekit.io/docs/transformations). * + * @phpstan-import-type AIDropShadowShape from \Imagekit\Transformation\AIDropShadow + * @phpstan-import-type AspectRatioShape from \Imagekit\Transformation\AspectRatio + * @phpstan-import-type DurationShape from \Imagekit\Transformation\Duration + * @phpstan-import-type EndOffsetShape from \Imagekit\Transformation\EndOffset + * @phpstan-import-type GradientShape from \Imagekit\Transformation\Gradient + * @phpstan-import-type HeightShape from \Imagekit\Transformation\Height + * @phpstan-import-type PageShape from \Imagekit\Transformation\Page + * @phpstan-import-type RadiusShape from \Imagekit\Transformation\Radius + * @phpstan-import-type RotationShape from \Imagekit\Transformation\Rotation + * @phpstan-import-type ShadowShape from \Imagekit\Transformation\Shadow + * @phpstan-import-type SharpenShape from \Imagekit\Transformation\Sharpen + * @phpstan-import-type StartOffsetShape from \Imagekit\Transformation\StartOffset + * @phpstan-import-type TrimShape from \Imagekit\Transformation\Trim + * @phpstan-import-type UnsharpMaskShape from \Imagekit\Transformation\UnsharpMask + * @phpstan-import-type WidthShape from \Imagekit\Transformation\Width + * @phpstan-import-type XShape from \Imagekit\Transformation\X + * @phpstan-import-type XCenterShape from \Imagekit\Transformation\XCenter + * @phpstan-import-type YShape from \Imagekit\Transformation\Y + * @phpstan-import-type YCenterShape from \Imagekit\Transformation\YCenter + * * @phpstan-type TransformationShape = array{ * aiChangeBackground?: string|null, - * aiDropShadow?: string|null|bool, + * aiDropShadow?: AIDropShadowShape|null, * aiEdit?: string|null, * aiRemoveBackground?: bool|null, * aiRemoveBackgroundExternal?: bool|null, * aiRetouch?: bool|null, * aiUpscale?: bool|null, * aiVariation?: bool|null, - * aspectRatio?: float|string|null, - * audioCodec?: value-of|null, + * aspectRatio?: AspectRatioShape|null, + * audioCodec?: null|AudioCodec|value-of, * background?: string|null, * blur?: float|null, * border?: string|null, * colorProfile?: bool|null, * contrastStretch?: bool|null, - * crop?: value-of|null, - * cropMode?: value-of|null, + * crop?: null|Crop|value-of, + * cropMode?: null|CropMode|value-of, * defaultImage?: string|null, * dpr?: float|null, - * duration?: float|string|null, - * endOffset?: float|string|null, - * flip?: value-of|null, + * duration?: DurationShape|null, + * endOffset?: EndOffsetShape|null, + * flip?: null|Flip|value-of, * focus?: string|null, - * format?: value-of|null, - * gradient?: string|null|bool, + * format?: null|Format|value-of, + * gradient?: GradientShape|null, * grayscale?: bool|null, - * height?: float|string|null, + * height?: HeightShape|null, * lossless?: bool|null, * metadata?: bool|null, * named?: string|null, * opacity?: float|null, * original?: bool|null, - * overlay?: Overlay|null, - * page?: float|string|null, + * overlay?: null|Overlay, + * page?: PageShape|null, * progressive?: bool|null, * quality?: float|null, - * radius?: float|null|'max', + * radius?: RadiusShape|null, * raw?: string|null, - * rotation?: float|string|null, - * shadow?: string|null|bool, - * sharpen?: float|null|bool, - * startOffset?: float|string|null, - * streamingResolutions?: list>|null, - * trim?: float|null|bool, - * unsharpMask?: string|null|bool, - * videoCodec?: value-of|null, - * width?: float|string|null, - * x?: float|string|null, - * xCenter?: float|string|null, - * y?: float|string|null, - * yCenter?: float|string|null, + * rotation?: RotationShape|null, + * shadow?: ShadowShape|null, + * sharpen?: SharpenShape|null, + * startOffset?: StartOffsetShape|null, + * streamingResolutions?: list>|null, + * trim?: TrimShape|null, + * unsharpMask?: UnsharpMaskShape|null, + * videoCodec?: null|VideoCodec|value-of, + * width?: WidthShape|null, + * x?: XShape|null, + * xCenter?: XCenterShape|null, + * y?: YShape|null, + * yCenter?: YCenterShape|null, * zoom?: float|null, * } */ @@ -501,14 +521,32 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * + * @param AIDropShadowShape $aiDropShadow + * @param AspectRatioShape $aspectRatio * @param AudioCodec|value-of $audioCodec * @param Crop|value-of $crop * @param CropMode|value-of $cropMode + * @param DurationShape $duration + * @param EndOffsetShape $endOffset * @param Flip|value-of $flip * @param Format|value-of $format - * @param float|'max' $radius + * @param GradientShape $gradient + * @param HeightShape $height + * @param PageShape $page + * @param RadiusShape $radius + * @param RotationShape $rotation + * @param ShadowShape $shadow + * @param SharpenShape $sharpen + * @param StartOffsetShape $startOffset * @param list> $streamingResolutions + * @param TrimShape $trim + * @param UnsharpMaskShape $unsharpMask * @param VideoCodec|value-of $videoCodec + * @param WidthShape $width + * @param XShape $x + * @param XCenterShape $xCenter + * @param YShape $y + * @param YCenterShape $yCenter */ public static function with( ?string $aiChangeBackground = null, @@ -642,6 +680,8 @@ public function withAIChangeBackground(string $aiChangeBackground): self * Pass `true` for the default drop shadow, or provide a string for a custom drop shadow. * Supported inside overlay. * See [AI Drop Shadow](https://imagekit.io/docs/ai-transformations#ai-drop-shadow-e-dropshadow). + * + * @param AIDropShadowShape $aiDropShadow */ public function withAIDropShadow(string|bool $aiDropShadow): self { @@ -734,6 +774,8 @@ public function withAIVariation(bool $aiVariation): self * Specifies the aspect ratio for the output, e.g., "ar-4-3". Typically used with either width or height (but not both). * For example: aspectRatio = `4:3`, `4_3`, or an expression like `iar_div_2`. * See [Image resize and crop – Aspect ratio](https://imagekit.io/docs/image-resize-and-crop#aspect-ratio---ar). + * + * @param AspectRatioShape $aspectRatio */ public function withAspectRatio(float|string $aspectRatio): self { @@ -874,6 +916,8 @@ public function withDpr(float $dpr): self * Specifies the duration (in seconds) for trimming videos, e.g., `5` or `10.5`. * Typically used with startOffset to indicate the length from the start offset. Arithmetic expressions are supported. * See [Trim videos – Duration](https://imagekit.io/docs/trim-videos#duration---du). + * + * @param DurationShape $duration */ public function withDuration(float|string $duration): self { @@ -887,6 +931,8 @@ public function withDuration(float|string $duration): self * Specifies the end offset (in seconds) for trimming videos, e.g., `5` or `10.5`. * Typically used with startOffset to define a time window. Arithmetic expressions are supported. * See [Trim videos – End offset](https://imagekit.io/docs/trim-videos#end-offset---eo). + * + * @param EndOffsetShape $endOffset */ public function withEndOffset(float|string $endOffset): self { @@ -946,6 +992,8 @@ public function withFormat(Format|string $format): self /** * Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. * See [Gradient](https://imagekit.io/docs/effects-and-enhancements#gradient---e-gradient). + * + * @param GradientShape $gradient */ public function withGradient(string|bool $gradient): self { @@ -970,6 +1018,8 @@ public function withGrayscale(bool $grayscale): self * Specifies the height of the output. If a value between 0 and 1 is provided, it is treated as a percentage (e.g., `0.5` represents 50% of the original height). * You can also supply arithmetic expressions (e.g., `ih_mul_0.5`). * Height transformation – [Images](https://imagekit.io/docs/image-resize-and-crop#height---h) · [Videos](https://imagekit.io/docs/video-resize-and-crop#height---h). + * + * @param HeightShape $height */ public function withHeight(float|string $height): self { @@ -1056,6 +1106,8 @@ public function withOverlay(Overlay $overlay): self * For example, specify by number (e.g., `2`), a range (e.g., `3-4` for the 2nd and 3rd layers), * or by name (e.g., `name-layer-4` for a PSD layer). * See [Thumbnail extraction](https://imagekit.io/docs/vector-and-animated-images#get-thumbnail-from-psd-pdf-ai-eps-and-animated-files). + * + * @param PageShape $page */ public function withPage(float|string $page): self { @@ -1095,7 +1147,7 @@ public function withQuality(float $quality): self * Specifies the corner radius for rounded corners (e.g., 20) or `max` for circular or oval shape. * See [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). * - * @param float|'max' $radius + * @param RadiusShape $radius */ public function withRadius(float|string $radius): self { @@ -1122,6 +1174,8 @@ public function withRaw(string $raw): self * or `auto` to use the orientation specified in the image's EXIF data. * For videos, only the following values are supported: 0, 90, 180, 270, or 360. * See [Rotate](https://imagekit.io/docs/effects-and-enhancements#rotate---rt). + * + * @param RotationShape $rotation */ public function withRotation(float|string $rotation): self { @@ -1136,6 +1190,8 @@ public function withRotation(float|string $rotation): self * For AI-based drop shadows, refer to aiDropShadow. * Pass `true` for a default shadow, or provide a string for a custom shadow. * See [Shadow](https://imagekit.io/docs/effects-and-enhancements#shadow---e-shadow). + * + * @param ShadowShape $shadow */ public function withShadow(string|bool $shadow): self { @@ -1149,6 +1205,8 @@ public function withShadow(string|bool $shadow): self * Sharpens the input image, highlighting edges and finer details. * Pass `true` for default sharpening, or provide a numeric value for custom sharpening. * See [Sharpen](https://imagekit.io/docs/effects-and-enhancements#sharpen---e-sharpen). + * + * @param SharpenShape $sharpen */ public function withSharpen(float|bool $sharpen): self { @@ -1162,6 +1220,8 @@ public function withSharpen(float|bool $sharpen): self * Specifies the start offset (in seconds) for trimming videos, e.g., `5` or `10.5`. * Arithmetic expressions are also supported. * See [Trim videos – Start offset](https://imagekit.io/docs/trim-videos#start-offset---so). + * + * @param StartOffsetShape $startOffset */ public function withStartOffset(float|string $startOffset): self { @@ -1189,6 +1249,8 @@ public function withStreamingResolutions(array $streamingResolutions): self * Useful for images with a solid or nearly solid background and a central object. This parameter trims the background, * leaving only the central object in the output image. * See [Trim edges](https://imagekit.io/docs/effects-and-enhancements#trim-edges---t). + * + * @param TrimShape $trim */ public function withTrim(float|bool $trim): self { @@ -1202,6 +1264,8 @@ public function withTrim(float|bool $trim): self * Applies Unsharp Masking (USM), an image sharpening technique. * Pass `true` for a default unsharp mask, or provide a string for a custom unsharp mask. * See [Unsharp Mask](https://imagekit.io/docs/effects-and-enhancements#unsharp-mask---e-usm). + * + * @param UnsharpMaskShape $unsharpMask */ public function withUnsharpMask(string|bool $unsharpMask): self { @@ -1228,6 +1292,8 @@ public function withVideoCodec(VideoCodec|string $videoCodec): self * Specifies the width of the output. If a value between 0 and 1 is provided, it is treated as a percentage (e.g., `0.4` represents 40% of the original width). * You can also supply arithmetic expressions (e.g., `iw_div_2`). * Width transformation – [Images](https://imagekit.io/docs/image-resize-and-crop#width---w) · [Videos](https://imagekit.io/docs/video-resize-and-crop#width---w). + * + * @param WidthShape $width */ public function withWidth(float|string $width): self { @@ -1239,6 +1305,8 @@ public function withWidth(float|string $width): self /** * Focus using cropped image coordinates - X coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). + * + * @param XShape $x */ public function withX(float|string $x): self { @@ -1250,6 +1318,8 @@ public function withX(float|string $x): self /** * Focus using cropped image coordinates - X center coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). + * + * @param XCenterShape $xCenter */ public function withXCenter(float|string $xCenter): self { @@ -1261,6 +1331,8 @@ public function withXCenter(float|string $xCenter): self /** * Focus using cropped image coordinates - Y coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). + * + * @param YShape $y */ public function withY(float|string $y): self { @@ -1272,6 +1344,8 @@ public function withY(float|string $y): self /** * Focus using cropped image coordinates - Y center coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). + * + * @param YCenterShape $yCenter */ public function withYCenter(float|string $yCenter): self { diff --git a/src/Transformation/AIDropShadow.php b/src/Transformation/AIDropShadow.php index 1b20141c..d4a09d58 100644 --- a/src/Transformation/AIDropShadow.php +++ b/src/Transformation/AIDropShadow.php @@ -14,6 +14,8 @@ * Pass `true` for the default drop shadow, or provide a string for a custom drop shadow. * Supported inside overlay. * See [AI Drop Shadow](https://imagekit.io/docs/ai-transformations#ai-drop-shadow-e-dropshadow). + * + * @phpstan-type AIDropShadowShape = string|bool */ final class AIDropShadow implements ConverterSource { diff --git a/src/Transformation/AspectRatio.php b/src/Transformation/AspectRatio.php index 13a4f470..77fa78fc 100644 --- a/src/Transformation/AspectRatio.php +++ b/src/Transformation/AspectRatio.php @@ -12,6 +12,8 @@ * Specifies the aspect ratio for the output, e.g., "ar-4-3". Typically used with either width or height (but not both). * For example: aspectRatio = `4:3`, `4_3`, or an expression like `iar_div_2`. * See [Image resize and crop – Aspect ratio](https://imagekit.io/docs/image-resize-and-crop#aspect-ratio---ar). + * + * @phpstan-type AspectRatioShape = float|string */ final class AspectRatio implements ConverterSource { diff --git a/src/Transformation/Duration.php b/src/Transformation/Duration.php index ed767f9b..cf9505dd 100644 --- a/src/Transformation/Duration.php +++ b/src/Transformation/Duration.php @@ -12,6 +12,8 @@ * Specifies the duration (in seconds) for trimming videos, e.g., `5` or `10.5`. * Typically used with startOffset to indicate the length from the start offset. Arithmetic expressions are supported. * See [Trim videos – Duration](https://imagekit.io/docs/trim-videos#duration---du). + * + * @phpstan-type DurationShape = float|string */ final class Duration implements ConverterSource { diff --git a/src/Transformation/EndOffset.php b/src/Transformation/EndOffset.php index 7f5be4ee..1fa42643 100644 --- a/src/Transformation/EndOffset.php +++ b/src/Transformation/EndOffset.php @@ -12,6 +12,8 @@ * Specifies the end offset (in seconds) for trimming videos, e.g., `5` or `10.5`. * Typically used with startOffset to define a time window. Arithmetic expressions are supported. * See [Trim videos – End offset](https://imagekit.io/docs/trim-videos#end-offset---eo). + * + * @phpstan-type EndOffsetShape = float|string */ final class EndOffset implements ConverterSource { diff --git a/src/Transformation/Gradient.php b/src/Transformation/Gradient.php index 96e5db30..2766197a 100644 --- a/src/Transformation/Gradient.php +++ b/src/Transformation/Gradient.php @@ -11,6 +11,8 @@ /** * Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. * See [Gradient](https://imagekit.io/docs/effects-and-enhancements#gradient---e-gradient). + * + * @phpstan-type GradientShape = string|bool */ final class Gradient implements ConverterSource { diff --git a/src/Transformation/Height.php b/src/Transformation/Height.php index e7db6d38..9ca197cf 100644 --- a/src/Transformation/Height.php +++ b/src/Transformation/Height.php @@ -12,6 +12,8 @@ * Specifies the height of the output. If a value between 0 and 1 is provided, it is treated as a percentage (e.g., `0.5` represents 50% of the original height). * You can also supply arithmetic expressions (e.g., `ih_mul_0.5`). * Height transformation – [Images](https://imagekit.io/docs/image-resize-and-crop#height---h) · [Videos](https://imagekit.io/docs/video-resize-and-crop#height---h). + * + * @phpstan-type HeightShape = float|string */ final class Height implements ConverterSource { diff --git a/src/Transformation/Page.php b/src/Transformation/Page.php index 4023b17a..76780fb2 100644 --- a/src/Transformation/Page.php +++ b/src/Transformation/Page.php @@ -13,6 +13,8 @@ * For example, specify by number (e.g., `2`), a range (e.g., `3-4` for the 2nd and 3rd layers), * or by name (e.g., `name-layer-4` for a PSD layer). * See [Thumbnail extraction](https://imagekit.io/docs/vector-and-animated-images#get-thumbnail-from-psd-pdf-ai-eps-and-animated-files). + * + * @phpstan-type PageShape = float|string */ final class Page implements ConverterSource { diff --git a/src/Transformation/Radius.php b/src/Transformation/Radius.php index 06c91982..d047429e 100644 --- a/src/Transformation/Radius.php +++ b/src/Transformation/Radius.php @@ -11,6 +11,8 @@ /** * Specifies the corner radius for rounded corners (e.g., 20) or `max` for circular or oval shape. * See [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). + * + * @phpstan-type RadiusShape = float|'max' */ final class Radius implements ConverterSource { diff --git a/src/Transformation/Rotation.php b/src/Transformation/Rotation.php index 4e155cca..be98783b 100644 --- a/src/Transformation/Rotation.php +++ b/src/Transformation/Rotation.php @@ -13,6 +13,8 @@ * or `auto` to use the orientation specified in the image's EXIF data. * For videos, only the following values are supported: 0, 90, 180, 270, or 360. * See [Rotate](https://imagekit.io/docs/effects-and-enhancements#rotate---rt). + * + * @phpstan-type RotationShape = float|string */ final class Rotation implements ConverterSource { diff --git a/src/Transformation/Shadow.php b/src/Transformation/Shadow.php index d157dc6f..df2238ee 100644 --- a/src/Transformation/Shadow.php +++ b/src/Transformation/Shadow.php @@ -13,6 +13,8 @@ * For AI-based drop shadows, refer to aiDropShadow. * Pass `true` for a default shadow, or provide a string for a custom shadow. * See [Shadow](https://imagekit.io/docs/effects-and-enhancements#shadow---e-shadow). + * + * @phpstan-type ShadowShape = string|bool */ final class Shadow implements ConverterSource { diff --git a/src/Transformation/Sharpen.php b/src/Transformation/Sharpen.php index 77f6f6cb..9732a6e8 100644 --- a/src/Transformation/Sharpen.php +++ b/src/Transformation/Sharpen.php @@ -12,6 +12,8 @@ * Sharpens the input image, highlighting edges and finer details. * Pass `true` for default sharpening, or provide a numeric value for custom sharpening. * See [Sharpen](https://imagekit.io/docs/effects-and-enhancements#sharpen---e-sharpen). + * + * @phpstan-type SharpenShape = float|bool */ final class Sharpen implements ConverterSource { diff --git a/src/Transformation/StartOffset.php b/src/Transformation/StartOffset.php index 0e783675..478533fb 100644 --- a/src/Transformation/StartOffset.php +++ b/src/Transformation/StartOffset.php @@ -12,6 +12,8 @@ * Specifies the start offset (in seconds) for trimming videos, e.g., `5` or `10.5`. * Arithmetic expressions are also supported. * See [Trim videos – Start offset](https://imagekit.io/docs/trim-videos#start-offset---so). + * + * @phpstan-type StartOffsetShape = float|string */ final class StartOffset implements ConverterSource { diff --git a/src/Transformation/Trim.php b/src/Transformation/Trim.php index cecd55bc..3b0a64e7 100644 --- a/src/Transformation/Trim.php +++ b/src/Transformation/Trim.php @@ -12,6 +12,8 @@ * Useful for images with a solid or nearly solid background and a central object. This parameter trims the background, * leaving only the central object in the output image. * See [Trim edges](https://imagekit.io/docs/effects-and-enhancements#trim-edges---t). + * + * @phpstan-type TrimShape = float|bool */ final class Trim implements ConverterSource { diff --git a/src/Transformation/UnsharpMask.php b/src/Transformation/UnsharpMask.php index f16b146d..b63f558c 100644 --- a/src/Transformation/UnsharpMask.php +++ b/src/Transformation/UnsharpMask.php @@ -12,6 +12,8 @@ * Applies Unsharp Masking (USM), an image sharpening technique. * Pass `true` for a default unsharp mask, or provide a string for a custom unsharp mask. * See [Unsharp Mask](https://imagekit.io/docs/effects-and-enhancements#unsharp-mask---e-usm). + * + * @phpstan-type UnsharpMaskShape = string|bool */ final class UnsharpMask implements ConverterSource { diff --git a/src/Transformation/Width.php b/src/Transformation/Width.php index 93022610..85d93a67 100644 --- a/src/Transformation/Width.php +++ b/src/Transformation/Width.php @@ -12,6 +12,8 @@ * Specifies the width of the output. If a value between 0 and 1 is provided, it is treated as a percentage (e.g., `0.4` represents 40% of the original width). * You can also supply arithmetic expressions (e.g., `iw_div_2`). * Width transformation – [Images](https://imagekit.io/docs/image-resize-and-crop#width---w) · [Videos](https://imagekit.io/docs/video-resize-and-crop#width---w). + * + * @phpstan-type WidthShape = float|string */ final class Width implements ConverterSource { diff --git a/src/Transformation/X.php b/src/Transformation/X.php index 23561502..609419df 100644 --- a/src/Transformation/X.php +++ b/src/Transformation/X.php @@ -10,6 +10,8 @@ /** * Focus using cropped image coordinates - X coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). + * + * @phpstan-type XShape = float|string */ final class X implements ConverterSource { diff --git a/src/Transformation/XCenter.php b/src/Transformation/XCenter.php index d53728aa..1acf7305 100644 --- a/src/Transformation/XCenter.php +++ b/src/Transformation/XCenter.php @@ -10,6 +10,8 @@ /** * Focus using cropped image coordinates - X center coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). + * + * @phpstan-type XCenterShape = float|string */ final class XCenter implements ConverterSource { diff --git a/src/Transformation/Y.php b/src/Transformation/Y.php index 6b27d281..80a5dc57 100644 --- a/src/Transformation/Y.php +++ b/src/Transformation/Y.php @@ -10,6 +10,8 @@ /** * Focus using cropped image coordinates - Y coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). + * + * @phpstan-type YShape = float|string */ final class Y implements ConverterSource { diff --git a/src/Transformation/YCenter.php b/src/Transformation/YCenter.php index b91641e4..c7f8eea5 100644 --- a/src/Transformation/YCenter.php +++ b/src/Transformation/YCenter.php @@ -10,6 +10,8 @@ /** * Focus using cropped image coordinates - Y center coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). + * + * @phpstan-type YCenterShape = float|string */ final class YCenter implements ConverterSource { diff --git a/src/VideoOverlay.php b/src/VideoOverlay.php index 539aac3a..8cffe6cd 100644 --- a/src/VideoOverlay.php +++ b/src/VideoOverlay.php @@ -8,16 +8,18 @@ use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\OverlayPosition\Focus; use Imagekit\VideoOverlay\Encoding; /** + * @phpstan-import-type OverlayPositionShape from \Imagekit\OverlayPosition + * @phpstan-import-type OverlayTimingShape from \Imagekit\OverlayTiming + * * @phpstan-type VideoOverlayShape = array{ - * position?: OverlayPosition|null, - * timing?: OverlayTiming|null, + * position?: null|OverlayPosition|OverlayPositionShape, + * timing?: null|OverlayTiming|OverlayTimingShape, * input: string, - * type?: 'video', - * encoding?: value-of|null, + * type: 'video', + * encoding?: null|Encoding|value-of, * transformation?: list|null, * } */ @@ -86,14 +88,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param OverlayPosition|array{ - * focus?: value-of|null, x?: float|string|null, y?: float|string|null - * } $position - * @param OverlayTiming|array{ - * duration?: float|string|null, - * end?: float|string|null, - * start?: float|string|null, - * } $timing + * @param OverlayPositionShape $position + * @param OverlayTimingShape $timing * @param Encoding|value-of $encoding * @param list $transformation */ @@ -117,9 +113,7 @@ public static function with( } /** - * @param OverlayPosition|array{ - * focus?: value-of|null, x?: float|string|null, y?: float|string|null - * } $position + * @param OverlayPositionShape $position */ public function withPosition(OverlayPosition|array $position): self { @@ -130,11 +124,7 @@ public function withPosition(OverlayPosition|array $position): self } /** - * @param OverlayTiming|array{ - * duration?: float|string|null, - * end?: float|string|null, - * start?: float|string|null, - * } $timing + * @param OverlayTimingShape $timing */ public function withTiming(OverlayTiming|array $timing): self { diff --git a/src/Webhooks/UnsafeUnwrapWebhookEvent.php b/src/Webhooks/UnsafeUnwrapWebhookEvent.php index 55621f75..ee556e98 100644 --- a/src/Webhooks/UnsafeUnwrapWebhookEvent.php +++ b/src/Webhooks/UnsafeUnwrapWebhookEvent.php @@ -10,6 +10,16 @@ /** * Triggered when a new video transformation request is accepted for processing. This event confirms that ImageKit has received and queued your transformation request. Use this for debugging and tracking transformation lifecycle. + * + * @phpstan-import-type VideoTransformationAcceptedEventShape from \Imagekit\Webhooks\VideoTransformationAcceptedEvent + * @phpstan-import-type VideoTransformationReadyEventShape from \Imagekit\Webhooks\VideoTransformationReadyEvent + * @phpstan-import-type VideoTransformationErrorEventShape from \Imagekit\Webhooks\VideoTransformationErrorEvent + * @phpstan-import-type UploadPreTransformSuccessEventShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent + * @phpstan-import-type UploadPreTransformErrorEventShape from \Imagekit\Webhooks\UploadPreTransformErrorEvent + * @phpstan-import-type UploadPostTransformSuccessEventShape from \Imagekit\Webhooks\UploadPostTransformSuccessEvent + * @phpstan-import-type UploadPostTransformErrorEventShape from \Imagekit\Webhooks\UploadPostTransformErrorEvent + * + * @phpstan-type UnsafeUnwrapWebhookEventShape = VideoTransformationAcceptedEventShape|VideoTransformationReadyEventShape|VideoTransformationErrorEventShape|UploadPreTransformSuccessEventShape|UploadPreTransformErrorEventShape|UploadPostTransformSuccessEventShape|UploadPostTransformErrorEventShape */ final class UnsafeUnwrapWebhookEvent implements ConverterSource { diff --git a/src/Webhooks/UnwrapWebhookEvent.php b/src/Webhooks/UnwrapWebhookEvent.php index 5801696f..cbef825d 100644 --- a/src/Webhooks/UnwrapWebhookEvent.php +++ b/src/Webhooks/UnwrapWebhookEvent.php @@ -10,6 +10,16 @@ /** * Triggered when a new video transformation request is accepted for processing. This event confirms that ImageKit has received and queued your transformation request. Use this for debugging and tracking transformation lifecycle. + * + * @phpstan-import-type VideoTransformationAcceptedEventShape from \Imagekit\Webhooks\VideoTransformationAcceptedEvent + * @phpstan-import-type VideoTransformationReadyEventShape from \Imagekit\Webhooks\VideoTransformationReadyEvent + * @phpstan-import-type VideoTransformationErrorEventShape from \Imagekit\Webhooks\VideoTransformationErrorEvent + * @phpstan-import-type UploadPreTransformSuccessEventShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent + * @phpstan-import-type UploadPreTransformErrorEventShape from \Imagekit\Webhooks\UploadPreTransformErrorEvent + * @phpstan-import-type UploadPostTransformSuccessEventShape from \Imagekit\Webhooks\UploadPostTransformSuccessEvent + * @phpstan-import-type UploadPostTransformErrorEventShape from \Imagekit\Webhooks\UploadPostTransformErrorEvent + * + * @phpstan-type UnwrapWebhookEventShape = VideoTransformationAcceptedEventShape|VideoTransformationReadyEventShape|VideoTransformationErrorEventShape|UploadPreTransformSuccessEventShape|UploadPreTransformErrorEventShape|UploadPostTransformSuccessEventShape|UploadPostTransformErrorEventShape */ final class UnwrapWebhookEvent implements ConverterSource { diff --git a/src/Webhooks/UploadPostTransformErrorEvent.php b/src/Webhooks/UploadPostTransformErrorEvent.php index 05ccf202..b941f851 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent.php +++ b/src/Webhooks/UploadPostTransformErrorEvent.php @@ -8,18 +8,20 @@ use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\UploadPostTransformErrorEvent\Data; -use Imagekit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation; use Imagekit\Webhooks\UploadPostTransformErrorEvent\Request; /** * Triggered when a post-transformation fails. The original file remains available, but the requested transformation could not be generated. * + * @phpstan-import-type DataShape from \Imagekit\Webhooks\UploadPostTransformErrorEvent\Data + * @phpstan-import-type RequestShape from \Imagekit\Webhooks\UploadPostTransformErrorEvent\Request + * * @phpstan-type UploadPostTransformErrorEventShape = array{ * id: string, * type: string, * createdAt: \DateTimeInterface, - * data: Data, - * request: Request, + * data: Data|DataShape, + * request: Request|RequestShape, * } */ final class UploadPostTransformErrorEvent implements BaseModel @@ -82,17 +84,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Data|array{ - * fileID: string, - * name: string, - * path: string, - * transformation: Transformation, - * url: string, - * } $data - * @param Request|array{ - * transformation: Request\Transformation, - * xRequestID: string, - * } $request + * @param DataShape $data + * @param RequestShape $request */ public static function with( string $id, @@ -146,13 +139,7 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self } /** - * @param Data|array{ - * fileID: string, - * name: string, - * path: string, - * transformation: Transformation, - * url: string, - * } $data + * @param DataShape $data */ public function withData(Data|array $data): self { @@ -163,10 +150,7 @@ public function withData(Data|array $data): self } /** - * @param Request|array{ - * transformation: Request\Transformation, - * xRequestID: string, - * } $request + * @param RequestShape $request */ public function withRequest(Request|array $request): self { diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data.php b/src/Webhooks/UploadPostTransformErrorEvent/Data.php index ded8dece..a2266030 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Data.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data.php @@ -8,14 +8,15 @@ use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation; -use Imagekit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation\Error; /** + * @phpstan-import-type TransformationShape from \Imagekit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation + * * @phpstan-type DataShape = array{ * fileID: string, * name: string, * path: string, - * transformation: Transformation, + * transformation: Transformation|TransformationShape, * url: string, * } */ @@ -80,7 +81,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Transformation|array{error: Error} $transformation + * @param TransformationShape $transformation */ public static function with( string $fileID, @@ -134,7 +135,7 @@ public function withPath(string $path): self } /** - * @param Transformation|array{error: Error} $transformation + * @param TransformationShape $transformation */ public function withTransformation( Transformation|array $transformation diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php index ed209c11..eed2e59c 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php @@ -10,7 +10,9 @@ use Imagekit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation\Error; /** - * @phpstan-type TransformationShape = array{error: Error} + * @phpstan-import-type ErrorShape from \Imagekit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation\Error + * + * @phpstan-type TransformationShape = array{error: Error|ErrorShape} */ final class Transformation implements BaseModel { @@ -44,7 +46,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Error|array{reason: string} $error + * @param ErrorShape $error */ public static function with(Error|array $error): self { @@ -56,7 +58,7 @@ public static function with(Error|array $error): self } /** - * @param Error|array{reason: string} $error + * @param ErrorShape $error */ public function withError(Error|array $error): self { diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request.php b/src/Webhooks/UploadPostTransformErrorEvent/Request.php index b125a023..22c9476d 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request.php @@ -8,12 +8,12 @@ use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation; -use Imagekit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation\Protocol; -use Imagekit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation\Type; /** + * @phpstan-import-type TransformationShape from \Imagekit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation + * * @phpstan-type RequestShape = array{ - * transformation: Transformation, xRequestID: string + * transformation: Transformation|TransformationShape, xRequestID: string * } */ final class Request implements BaseModel @@ -54,9 +54,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Transformation|array{ - * type: value-of, protocol?: value-of|null, value?: string|null - * } $transformation + * @param TransformationShape $transformation */ public static function with( Transformation|array $transformation, @@ -71,9 +69,7 @@ public static function with( } /** - * @param Transformation|array{ - * type: value-of, protocol?: value-of|null, value?: string|null - * } $transformation + * @param TransformationShape $transformation */ public function withTransformation( Transformation|array $transformation diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php index f1e0a5c3..536fa6f0 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php @@ -13,7 +13,9 @@ /** * @phpstan-type TransformationShape = array{ - * type: value-of, protocol?: value-of|null, value?: string|null + * type: Type|value-of, + * protocol?: null|Protocol|value-of, + * value?: string|null, * } */ final class Transformation implements BaseModel diff --git a/src/Webhooks/UploadPostTransformSuccessEvent.php b/src/Webhooks/UploadPostTransformSuccessEvent.php index 30ecbe35..04a56f85 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent.php @@ -9,17 +9,19 @@ use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\UploadPostTransformSuccessEvent\Data; use Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request; -use Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation; /** * Triggered when a post-transformation completes successfully. The transformed version of the file is now ready and can be accessed via the provided URL. Note that each post-transformation generates a separate webhook event. * + * @phpstan-import-type DataShape from \Imagekit\Webhooks\UploadPostTransformSuccessEvent\Data + * @phpstan-import-type RequestShape from \Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request + * * @phpstan-type UploadPostTransformSuccessEventShape = array{ * id: string, * type: string, * createdAt: \DateTimeInterface, - * data: Data, - * request: Request, + * data: Data|DataShape, + * request: Request|RequestShape, * } */ final class UploadPostTransformSuccessEvent implements BaseModel @@ -82,10 +84,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Data|array{fileID: string, name: string, url: string} $data - * @param Request|array{ - * transformation: Transformation, xRequestID: string - * } $request + * @param DataShape $data + * @param RequestShape $request */ public static function with( string $id, @@ -139,7 +139,7 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self } /** - * @param Data|array{fileID: string, name: string, url: string} $data + * @param DataShape $data */ public function withData(Data|array $data): self { @@ -150,9 +150,7 @@ public function withData(Data|array $data): self } /** - * @param Request|array{ - * transformation: Transformation, xRequestID: string - * } $request + * @param RequestShape $request */ public function withRequest(Request|array $request): self { diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request.php index f39acb27..ff57b3d5 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request.php @@ -8,12 +8,12 @@ use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation; -use Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation\Protocol; -use Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation\Type; /** + * @phpstan-import-type TransformationShape from \Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation + * * @phpstan-type RequestShape = array{ - * transformation: Transformation, xRequestID: string + * transformation: Transformation|TransformationShape, xRequestID: string * } */ final class Request implements BaseModel @@ -54,9 +54,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Transformation|array{ - * type: value-of, protocol?: value-of|null, value?: string|null - * } $transformation + * @param TransformationShape $transformation */ public static function with( Transformation|array $transformation, @@ -71,9 +69,7 @@ public static function with( } /** - * @param Transformation|array{ - * type: value-of, protocol?: value-of|null, value?: string|null - * } $transformation + * @param TransformationShape $transformation */ public function withTransformation( Transformation|array $transformation diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php index 27d17c20..183e0b92 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php @@ -13,7 +13,9 @@ /** * @phpstan-type TransformationShape = array{ - * type: value-of, protocol?: value-of|null, value?: string|null + * type: Type|value-of, + * protocol?: null|Protocol|value-of, + * value?: string|null, * } */ final class Transformation implements BaseModel diff --git a/src/Webhooks/UploadPreTransformErrorEvent.php b/src/Webhooks/UploadPreTransformErrorEvent.php index 6938ea00..a629c169 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent.php +++ b/src/Webhooks/UploadPreTransformErrorEvent.php @@ -8,18 +8,20 @@ use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\UploadPreTransformErrorEvent\Data; -use Imagekit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation; use Imagekit\Webhooks\UploadPreTransformErrorEvent\Request; /** * Triggered when a pre-transformation fails. The file upload may have been accepted, but the requested transformation could not be applied. * + * @phpstan-import-type DataShape from \Imagekit\Webhooks\UploadPreTransformErrorEvent\Data + * @phpstan-import-type RequestShape from \Imagekit\Webhooks\UploadPreTransformErrorEvent\Request + * * @phpstan-type UploadPreTransformErrorEventShape = array{ * id: string, * type: string, * createdAt: \DateTimeInterface, - * data: Data, - * request: Request, + * data: Data|DataShape, + * request: Request|RequestShape, * } */ final class UploadPreTransformErrorEvent implements BaseModel @@ -82,10 +84,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Data|array{ - * name: string, path: string, transformation: Transformation - * } $data - * @param Request|array{transformation: string, xRequestID: string} $request + * @param DataShape $data + * @param RequestShape $request */ public static function with( string $id, @@ -139,9 +139,7 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self } /** - * @param Data|array{ - * name: string, path: string, transformation: Transformation - * } $data + * @param DataShape $data */ public function withData(Data|array $data): self { @@ -152,7 +150,7 @@ public function withData(Data|array $data): self } /** - * @param Request|array{transformation: string, xRequestID: string} $request + * @param RequestShape $request */ public function withRequest(Request|array $request): self { diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data.php b/src/Webhooks/UploadPreTransformErrorEvent/Data.php index 0bcafcab..4578f42e 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Data.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data.php @@ -8,11 +8,12 @@ use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation; -use Imagekit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation\Error; /** + * @phpstan-import-type TransformationShape from \Imagekit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation + * * @phpstan-type DataShape = array{ - * name: string, path: string, transformation: Transformation + * name: string, path: string, transformation: Transformation|TransformationShape * } */ final class Data implements BaseModel @@ -59,7 +60,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Transformation|array{error: Error} $transformation + * @param TransformationShape $transformation */ public static function with( string $name, @@ -98,7 +99,7 @@ public function withPath(string $path): self } /** - * @param Transformation|array{error: Error} $transformation + * @param TransformationShape $transformation */ public function withTransformation( Transformation|array $transformation diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php index 7386b3d3..b23ca38e 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php @@ -10,7 +10,9 @@ use Imagekit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation\Error; /** - * @phpstan-type TransformationShape = array{error: Error} + * @phpstan-import-type ErrorShape from \Imagekit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation\Error + * + * @phpstan-type TransformationShape = array{error: Error|ErrorShape} */ final class Transformation implements BaseModel { @@ -44,7 +46,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Error|array{reason: string} $error + * @param ErrorShape $error */ public static function with(Error|array $error): self { @@ -56,7 +58,7 @@ public static function with(Error|array $error): self } /** - * @param Error|array{reason: string} $error + * @param ErrorShape $error */ public function withError(Error|array $error): self { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent.php b/src/Webhooks/UploadPreTransformSuccessEvent.php index 1fc100e4..548d5689 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent.php @@ -7,23 +7,21 @@ use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Files\Metadata; use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\AITag; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\VersionInfo; use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Request; /** * Triggered when a pre-transformation completes successfully. The file has been processed with the requested transformation and is now available in the Media Library. * + * @phpstan-import-type DataShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data + * @phpstan-import-type RequestShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Request + * * @phpstan-type UploadPreTransformSuccessEventShape = array{ * id: string, * type: string, * createdAt: \DateTimeInterface, - * data: Data, - * request: Request, + * data: Data|DataShape, + * request: Request|RequestShape, * } */ final class UploadPreTransformSuccessEvent implements BaseModel @@ -89,34 +87,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Data|array{ - * aiTags?: list|null, - * audioCodec?: string|null, - * bitRate?: int|null, - * customCoordinates?: string|null, - * customMetadata?: array|null, - * description?: string|null, - * duration?: int|null, - * embeddedMetadata?: array|null, - * extensionStatus?: ExtensionStatus|null, - * fileID?: string|null, - * filePath?: string|null, - * fileType?: string|null, - * height?: float|null, - * isPrivateFile?: bool|null, - * isPublished?: bool|null, - * metadata?: Metadata|null, - * name?: string|null, - * selectedFieldsSchema?: array|null, - * size?: float|null, - * tags?: list|null, - * thumbnailURL?: string|null, - * url?: string|null, - * versionInfo?: VersionInfo|null, - * videoCodec?: string|null, - * width?: float|null, - * } $data - * @param Request|array{transformation: string, xRequestID: string} $request + * @param DataShape $data + * @param RequestShape $request */ public static function with( string $id, @@ -172,33 +144,7 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self /** * Object containing details of a successful upload. * - * @param Data|array{ - * aiTags?: list|null, - * audioCodec?: string|null, - * bitRate?: int|null, - * customCoordinates?: string|null, - * customMetadata?: array|null, - * description?: string|null, - * duration?: int|null, - * embeddedMetadata?: array|null, - * extensionStatus?: ExtensionStatus|null, - * fileID?: string|null, - * filePath?: string|null, - * fileType?: string|null, - * height?: float|null, - * isPrivateFile?: bool|null, - * isPublished?: bool|null, - * metadata?: Metadata|null, - * name?: string|null, - * selectedFieldsSchema?: array|null, - * size?: float|null, - * tags?: list|null, - * thumbnailURL?: string|null, - * url?: string|null, - * versionInfo?: VersionInfo|null, - * videoCodec?: string|null, - * width?: float|null, - * } $data + * @param DataShape $data */ public function withData(Data|array $data): self { @@ -209,7 +155,7 @@ public function withData(Data|array $data): self } /** - * @param Request|array{transformation: string, xRequestID: string} $request + * @param RequestShape $request */ public function withRequest(Request|array $request): self { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php index 43345ec5..a34f5b45 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php @@ -8,22 +8,22 @@ use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Files\Metadata; -use Imagekit\Files\Metadata\Exif; use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\AITag; use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\AIAutoDescription; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\AwsAutoTagging; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\GoogleAutoTagging; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\RemoveBg; use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\Type; use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\VersionInfo; /** * Object containing details of a successful upload. * + * @phpstan-import-type AITagShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\AITag + * @phpstan-import-type ExtensionStatusShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus + * @phpstan-import-type MetadataShape from \Imagekit\Files\Metadata + * @phpstan-import-type SelectedFieldsSchemaShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema + * @phpstan-import-type VersionInfoShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\VersionInfo + * * @phpstan-type DataShape = array{ - * aiTags?: list|null, + * aiTags?: list|null, * audioCodec?: string|null, * bitRate?: int|null, * customCoordinates?: string|null, @@ -31,21 +31,21 @@ * description?: string|null, * duration?: int|null, * embeddedMetadata?: array|null, - * extensionStatus?: ExtensionStatus|null, + * extensionStatus?: null|ExtensionStatus|ExtensionStatusShape, * fileID?: string|null, * filePath?: string|null, * fileType?: string|null, * height?: float|null, * isPrivateFile?: bool|null, * isPublished?: bool|null, - * metadata?: Metadata|null, + * metadata?: null|Metadata|MetadataShape, * name?: string|null, - * selectedFieldsSchema?: array|null, + * selectedFieldsSchema?: array|null, * size?: float|null, * tags?: list|null, * thumbnailURL?: string|null, * url?: string|null, - * versionInfo?: VersionInfo|null, + * versionInfo?: null|VersionInfo|VersionInfoShape, * videoCodec?: string|null, * width?: float|null, * } @@ -235,47 +235,14 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list|null $aiTags + * @param list|null $aiTags * @param array $customMetadata * @param array $embeddedMetadata - * @param ExtensionStatus|array{ - * aiAutoDescription?: value-of|null, - * awsAutoTagging?: value-of|null, - * googleAutoTagging?: value-of|null, - * removeBg?: value-of|null, - * } $extensionStatus - * @param Metadata|array{ - * audioCodec?: string|null, - * bitRate?: int|null, - * density?: int|null, - * duration?: int|null, - * exif?: Exif|null, - * format?: string|null, - * hasColorProfile?: bool|null, - * hasTransparency?: bool|null, - * height?: int|null, - * pHash?: string|null, - * quality?: int|null, - * size?: int|null, - * videoCodec?: string|null, - * width?: int|null, - * } $metadata - * @param array, - * defaultValue?: string|float|bool|list|null, - * isValueRequired?: bool|null, - * maxLength?: float|null, - * maxValue?: string|float|null, - * minLength?: float|null, - * minValue?: string|float|null, - * readOnly?: bool|null, - * selectOptions?: list|null, - * selectOptionsTruncated?: bool|null, - * }> $selectedFieldsSchema + * @param ExtensionStatusShape $extensionStatus + * @param MetadataShape $metadata + * @param array $selectedFieldsSchema * @param list|null $tags - * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo + * @param VersionInfoShape $versionInfo */ public static function with( ?array $aiTags = null, @@ -338,9 +305,7 @@ public static function with( /** * An array of tags assigned to the uploaded file by auto tagging. * - * @param list|null $aiTags + * @param list|null $aiTags */ public function withAITags(?array $aiTags): self { @@ -440,12 +405,7 @@ public function withEmbeddedMetadata(array $embeddedMetadata): self * * If no extension was requested, then this parameter is not returned. * - * @param ExtensionStatus|array{ - * aiAutoDescription?: value-of|null, - * awsAutoTagging?: value-of|null, - * googleAutoTagging?: value-of|null, - * removeBg?: value-of|null, - * } $extensionStatus + * @param ExtensionStatusShape $extensionStatus */ public function withExtensionStatus( ExtensionStatus|array $extensionStatus @@ -525,22 +485,7 @@ public function withIsPublished(bool $isPublished): self /** * Legacy metadata. Send `metadata` in `responseFields` in API request to get metadata in the upload API response. * - * @param Metadata|array{ - * audioCodec?: string|null, - * bitRate?: int|null, - * density?: int|null, - * duration?: int|null, - * exif?: Exif|null, - * format?: string|null, - * hasColorProfile?: bool|null, - * hasTransparency?: bool|null, - * height?: int|null, - * pHash?: string|null, - * quality?: int|null, - * size?: int|null, - * videoCodec?: string|null, - * width?: int|null, - * } $metadata + * @param MetadataShape $metadata */ public function withMetadata(Metadata|array $metadata): self { @@ -568,18 +513,7 @@ public function withName(string $name): self * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @param array, - * defaultValue?: string|float|bool|list|null, - * isValueRequired?: bool|null, - * maxLength?: float|null, - * maxValue?: string|float|null, - * minLength?: float|null, - * minValue?: string|float|null, - * readOnly?: bool|null, - * selectOptions?: list|null, - * selectOptionsTruncated?: bool|null, - * }> $selectedFieldsSchema + * @param array $selectedFieldsSchema */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { @@ -638,7 +572,7 @@ public function withURL(string $url): self /** * An object containing the file or file version's `id` (versionId) and `name`. * - * @param VersionInfo|array{id?: string|null, name?: string|null} $versionInfo + * @param VersionInfoShape $versionInfo */ public function withVersionInfo(VersionInfo|array $versionInfo): self { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php index 8b6252cc..e4c2805e 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php @@ -22,10 +22,10 @@ * If no extension was requested, then this parameter is not returned. * * @phpstan-type ExtensionStatusShape = array{ - * aiAutoDescription?: value-of|null, - * awsAutoTagging?: value-of|null, - * googleAutoTagging?: value-of|null, - * removeBg?: value-of|null, + * aiAutoDescription?: null|AIAutoDescription|value-of, + * awsAutoTagging?: null|AwsAutoTagging|value-of, + * googleAutoTagging?: null|GoogleAutoTagging|value-of, + * removeBg?: null|RemoveBg|value-of, * } */ final class ExtensionStatus implements BaseModel diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php index 9d8ca6c0..f0ddb8b6 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php @@ -13,16 +13,21 @@ use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\Type; /** + * @phpstan-import-type DefaultValueShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue + * @phpstan-import-type MaxValueShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\MaxValue + * @phpstan-import-type MinValueShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\MinValue + * @phpstan-import-type SelectOptionShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\SelectOption + * * @phpstan-type SelectedFieldsSchemaShape = array{ - * type: value-of, - * defaultValue?: string|float|bool|null|list, + * type: Type|value-of, + * defaultValue?: DefaultValueShape|null, * isValueRequired?: bool|null, * maxLength?: float|null, - * maxValue?: string|float|null, + * maxValue?: MaxValueShape|null, * minLength?: float|null, - * minValue?: string|float|null, + * minValue?: MinValueShape|null, * readOnly?: bool|null, - * selectOptions?: list|null, + * selectOptions?: list|null, * selectOptionsTruncated?: bool|null, * } */ @@ -122,8 +127,10 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Type|value-of $type - * @param string|float|bool|list $defaultValue - * @param list $selectOptions + * @param DefaultValueShape $defaultValue + * @param MaxValueShape $maxValue + * @param MinValueShape $minValue + * @param list $selectOptions */ public static function with( Type|string $type, @@ -170,7 +177,7 @@ public function withType(Type|string $type): self /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. * - * @param string|float|bool|list $defaultValue + * @param DefaultValueShape $defaultValue */ public function withDefaultValue( string|float|bool|array $defaultValue @@ -205,6 +212,8 @@ public function withMaxLength(float $maxLength): self /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @param MaxValueShape $maxValue */ public function withMaxValue(string|float $maxValue): self { @@ -227,6 +236,8 @@ public function withMinLength(float $minLength): self /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @param MinValueShape $minValue */ public function withMinValue(string|float $minValue): self { @@ -250,7 +261,7 @@ public function withReadOnly(bool $readOnly): self /** * An array of allowed values when field type is `SingleSelect` or `MultiSelect`. * - * @param list $selectOptions + * @param list $selectOptions */ public function withSelectOptions(array $selectOptions): self { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php index b302081d..be2ac75d 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php @@ -12,6 +12,10 @@ /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. + * + * @phpstan-import-type MixedShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue\Mixed_ + * + * @phpstan-type DefaultValueShape = string|float|bool|list */ final class DefaultValue implements ConverterSource { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed_.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed_.php index 05ce9049..5763e6cb 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed_.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed_.php @@ -8,6 +8,9 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; +/** + * @phpstan-type MixedShape = string|float|bool + */ final class Mixed_ implements ConverterSource { use SdkUnion; diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MaxValue.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MaxValue.php index bf369aac..5eb735f4 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MaxValue.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MaxValue.php @@ -10,6 +10,8 @@ /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @phpstan-type MaxValueShape = string|float */ final class MaxValue implements ConverterSource { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MinValue.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MinValue.php index ea2af27b..a6aee500 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MinValue.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MinValue.php @@ -10,6 +10,8 @@ /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @phpstan-type MinValueShape = string|float */ final class MinValue implements ConverterSource { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/SelectOption.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/SelectOption.php index 3c5b4970..74e25155 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/SelectOption.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/SelectOption.php @@ -8,6 +8,9 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; +/** + * @phpstan-type SelectOptionShape = string|float|bool + */ final class SelectOption implements ConverterSource { use SdkUnion; diff --git a/src/Webhooks/VideoTransformationAcceptedEvent.php b/src/Webhooks/VideoTransformationAcceptedEvent.php index ad68d071..eff775ad 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent.php @@ -8,19 +8,20 @@ use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data; -use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Asset; -use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation; use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Request; /** * Triggered when a new video transformation request is accepted for processing. This event confirms that ImageKit has received and queued your transformation request. Use this for debugging and tracking transformation lifecycle. * + * @phpstan-import-type DataShape from \Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data + * @phpstan-import-type RequestShape from \Imagekit\Webhooks\VideoTransformationAcceptedEvent\Request + * * @phpstan-type VideoTransformationAcceptedEventShape = array{ * id: string, * type: string, * createdAt: \DateTimeInterface, - * data: Data, - * request: Request, + * data: Data|DataShape, + * request: Request|RequestShape, * } */ final class VideoTransformationAcceptedEvent implements BaseModel @@ -86,10 +87,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Data|array{asset: Asset, transformation: Transformation} $data - * @param Request|array{ - * url: string, xRequestID: string, userAgent?: string|null - * } $request + * @param DataShape $data + * @param RequestShape $request */ public static function with( string $id, @@ -143,7 +142,7 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self } /** - * @param Data|array{asset: Asset, transformation: Transformation} $data + * @param DataShape $data */ public function withData(Data|array $data): self { @@ -156,9 +155,7 @@ public function withData(Data|array $data): self /** * Information about the original request that triggered the video transformation. * - * @param Request|array{ - * url: string, xRequestID: string, userAgent?: string|null - * } $request + * @param RequestShape $request */ public function withRequest(Request|array $request): self { diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data.php index dee503cc..cf6bf777 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data.php @@ -9,11 +9,14 @@ use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Asset; use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation; -use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; -use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Type; /** - * @phpstan-type DataShape = array{asset: Asset, transformation: Transformation} + * @phpstan-import-type AssetShape from \Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Asset + * @phpstan-import-type TransformationShape from \Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation + * + * @phpstan-type DataShape = array{ + * asset: Asset|AssetShape, transformation: Transformation|TransformationShape + * } */ final class Data implements BaseModel { @@ -56,10 +59,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Asset|array{url: string} $asset - * @param Transformation|array{ - * type: value-of, options?: Options|null - * } $transformation + * @param AssetShape $asset + * @param TransformationShape $transformation */ public static function with( Asset|array $asset, @@ -76,7 +77,7 @@ public static function with( /** * Information about the source video asset being transformed. * - * @param Asset|array{url: string} $asset + * @param AssetShape $asset */ public function withAsset(Asset|array $asset): self { @@ -89,9 +90,7 @@ public function withAsset(Asset|array $asset): self /** * Base information about a video transformation request. * - * @param Transformation|array{ - * type: value-of, options?: Options|null - * } $transformation + * @param TransformationShape $transformation */ public function withTransformation( Transformation|array $transformation diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php index 48b7fc55..2ad501f3 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php @@ -9,17 +9,15 @@ use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; -use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\AudioCodec; -use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\Format; -use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\StreamProtocol; -use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\VideoCodec; use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Type; /** * Base information about a video transformation request. * + * @phpstan-import-type OptionsShape from \Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options + * * @phpstan-type TransformationShape = array{ - * type: value-of, options?: Options|null + * type: Type|value-of, options?: null|Options|OptionsShape * } */ final class Transformation implements BaseModel @@ -69,15 +67,7 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Type|value-of $type - * @param Options|array{ - * audioCodec?: value-of|null, - * autoRotate?: bool|null, - * format?: value-of|null, - * quality?: int|null, - * streamProtocol?: value-of|null, - * variants?: list|null, - * videoCodec?: value-of|null, - * } $options + * @param OptionsShape $options */ public static function with( Type|string $type, @@ -111,15 +101,7 @@ public function withType(Type|string $type): self /** * Configuration options for video transformations. * - * @param Options|array{ - * audioCodec?: value-of|null, - * autoRotate?: bool|null, - * format?: value-of|null, - * quality?: int|null, - * streamProtocol?: value-of|null, - * variants?: list|null, - * videoCodec?: value-of|null, - * } $options + * @param OptionsShape $options */ public function withOptions(Options|array $options): self { diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php index 6a990514..b29996bb 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php @@ -16,13 +16,13 @@ * Configuration options for video transformations. * * @phpstan-type OptionsShape = array{ - * audioCodec?: value-of|null, + * audioCodec?: null|AudioCodec|value-of, * autoRotate?: bool|null, - * format?: value-of|null, + * format?: null|Format|value-of, * quality?: int|null, - * streamProtocol?: value-of|null, + * streamProtocol?: null|StreamProtocol|value-of, * variants?: list|null, - * videoCodec?: value-of|null, + * videoCodec?: null|VideoCodec|value-of, * } */ final class Options implements BaseModel diff --git a/src/Webhooks/VideoTransformationErrorEvent.php b/src/Webhooks/VideoTransformationErrorEvent.php index e27901ed..2d2cb38d 100644 --- a/src/Webhooks/VideoTransformationErrorEvent.php +++ b/src/Webhooks/VideoTransformationErrorEvent.php @@ -8,19 +8,20 @@ use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\VideoTransformationErrorEvent\Data; -use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Asset; -use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; use Imagekit\Webhooks\VideoTransformationErrorEvent\Request; /** * Triggered when an error occurs during video encoding. Listen to this webhook to log error reasons and debug issues. Check your origin and URL endpoint settings if the reason is related to download failure. For other errors, contact ImageKit support. * + * @phpstan-import-type DataShape from \Imagekit\Webhooks\VideoTransformationErrorEvent\Data + * @phpstan-import-type RequestShape from \Imagekit\Webhooks\VideoTransformationErrorEvent\Request + * * @phpstan-type VideoTransformationErrorEventShape = array{ * id: string, * type: string, * createdAt: \DateTimeInterface, - * data: Data, - * request: Request, + * data: Data|DataShape, + * request: Request|RequestShape, * } */ final class VideoTransformationErrorEvent implements BaseModel @@ -86,10 +87,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Data|array{asset: Asset, transformation: Transformation} $data - * @param Request|array{ - * url: string, xRequestID: string, userAgent?: string|null - * } $request + * @param DataShape $data + * @param RequestShape $request */ public static function with( string $id, @@ -143,7 +142,7 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self } /** - * @param Data|array{asset: Asset, transformation: Transformation} $data + * @param DataShape $data */ public function withData(Data|array $data): self { @@ -156,9 +155,7 @@ public function withData(Data|array $data): self /** * Information about the original request that triggered the video transformation. * - * @param Request|array{ - * url: string, xRequestID: string, userAgent?: string|null - * } $request + * @param RequestShape $request */ public function withRequest(Request|array $request): self { diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data.php b/src/Webhooks/VideoTransformationErrorEvent/Data.php index a2f9d10c..577496b2 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data.php @@ -9,12 +9,14 @@ use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Asset; use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; -use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error; -use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; -use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Type; /** - * @phpstan-type DataShape = array{asset: Asset, transformation: Transformation} + * @phpstan-import-type AssetShape from \Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Asset + * @phpstan-import-type TransformationShape from \Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation + * + * @phpstan-type DataShape = array{ + * asset: Asset|AssetShape, transformation: Transformation|TransformationShape + * } */ final class Data implements BaseModel { @@ -54,10 +56,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Asset|array{url: string} $asset - * @param Transformation|array{ - * type: value-of, error?: Error|null, options?: Options|null - * } $transformation + * @param AssetShape $asset + * @param TransformationShape $transformation */ public static function with( Asset|array $asset, @@ -74,7 +74,7 @@ public static function with( /** * Information about the source video asset being transformed. * - * @param Asset|array{url: string} $asset + * @param AssetShape $asset */ public function withAsset(Asset|array $asset): self { @@ -85,9 +85,7 @@ public function withAsset(Asset|array $asset): self } /** - * @param Transformation|array{ - * type: value-of, error?: Error|null, options?: Options|null - * } $transformation + * @param TransformationShape $transformation */ public function withTransformation( Transformation|array $transformation diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php index a9af038d..c54846c6 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php @@ -9,17 +9,17 @@ use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error; -use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error\Reason; use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; -use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\AudioCodec; -use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\Format; -use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\StreamProtocol; -use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\VideoCodec; use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Type; /** + * @phpstan-import-type ErrorShape from \Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error + * @phpstan-import-type OptionsShape from \Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options + * * @phpstan-type TransformationShape = array{ - * type: value-of, error?: Error|null, options?: Options|null + * type: Type|value-of, + * error?: null|Error|ErrorShape, + * options?: null|Options|OptionsShape, * } */ final class Transformation implements BaseModel @@ -75,16 +75,8 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Type|value-of $type - * @param Error|array{reason: value-of} $error - * @param Options|array{ - * audioCodec?: value-of|null, - * autoRotate?: bool|null, - * format?: value-of|null, - * quality?: int|null, - * streamProtocol?: value-of|null, - * variants?: list|null, - * videoCodec?: value-of|null, - * } $options + * @param ErrorShape $error + * @param OptionsShape $options */ public static function with( Type|string $type, @@ -120,7 +112,7 @@ public function withType(Type|string $type): self /** * Details about the transformation error. * - * @param Error|array{reason: value-of} $error + * @param ErrorShape $error */ public function withError(Error|array $error): self { @@ -133,15 +125,7 @@ public function withError(Error|array $error): self /** * Configuration options for video transformations. * - * @param Options|array{ - * audioCodec?: value-of|null, - * autoRotate?: bool|null, - * format?: value-of|null, - * quality?: int|null, - * streamProtocol?: value-of|null, - * variants?: list|null, - * videoCodec?: value-of|null, - * } $options + * @param OptionsShape $options */ public function withOptions(Options|array $options): self { diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php index 1c3af45d..09480994 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php @@ -12,7 +12,7 @@ /** * Details about the transformation error. * - * @phpstan-type ErrorShape = array{reason: value-of} + * @phpstan-type ErrorShape = array{reason: Reason|value-of} */ final class Error implements BaseModel { diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php index b7574a62..7ec7cdff 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php @@ -16,13 +16,13 @@ * Configuration options for video transformations. * * @phpstan-type OptionsShape = array{ - * audioCodec?: value-of|null, + * audioCodec?: null|AudioCodec|value-of, * autoRotate?: bool|null, - * format?: value-of|null, + * format?: null|Format|value-of, * quality?: int|null, - * streamProtocol?: value-of|null, + * streamProtocol?: null|StreamProtocol|value-of, * variants?: list|null, - * videoCodec?: value-of|null, + * videoCodec?: null|VideoCodec|value-of, * } */ final class Options implements BaseModel diff --git a/src/Webhooks/VideoTransformationReadyEvent.php b/src/Webhooks/VideoTransformationReadyEvent.php index 45d4a85c..0b589acb 100644 --- a/src/Webhooks/VideoTransformationReadyEvent.php +++ b/src/Webhooks/VideoTransformationReadyEvent.php @@ -9,21 +9,23 @@ use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\VideoTransformationReadyEvent\Data; -use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Asset; -use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; use Imagekit\Webhooks\VideoTransformationReadyEvent\Request; use Imagekit\Webhooks\VideoTransformationReadyEvent\Timings; /** * Triggered when video encoding is finished and the transformed resource is ready to be served. This is the key event to listen for - update your database or CMS flags when you receive this so your application can start showing the transformed video to users. * + * @phpstan-import-type DataShape from \Imagekit\Webhooks\VideoTransformationReadyEvent\Data + * @phpstan-import-type RequestShape from \Imagekit\Webhooks\VideoTransformationReadyEvent\Request + * @phpstan-import-type TimingsShape from \Imagekit\Webhooks\VideoTransformationReadyEvent\Timings + * * @phpstan-type VideoTransformationReadyEventShape = array{ * id: string, * type: string, * createdAt: \DateTimeInterface, - * data: Data, - * request: Request, - * timings?: Timings|null, + * data: Data|DataShape, + * request: Request|RequestShape, + * timings?: null|Timings|TimingsShape, * } */ final class VideoTransformationReadyEvent implements BaseModel @@ -95,13 +97,9 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Data|array{asset: Asset, transformation: Transformation} $data - * @param Request|array{ - * url: string, xRequestID: string, userAgent?: string|null - * } $request - * @param Timings|array{ - * downloadDuration?: int|null, encodingDuration?: int|null - * } $timings + * @param DataShape $data + * @param RequestShape $request + * @param TimingsShape $timings */ public static function with( string $id, @@ -158,7 +156,7 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self } /** - * @param Data|array{asset: Asset, transformation: Transformation} $data + * @param DataShape $data */ public function withData(Data|array $data): self { @@ -171,9 +169,7 @@ public function withData(Data|array $data): self /** * Information about the original request that triggered the video transformation. * - * @param Request|array{ - * url: string, xRequestID: string, userAgent?: string|null - * } $request + * @param RequestShape $request */ public function withRequest(Request|array $request): self { @@ -186,9 +182,7 @@ public function withRequest(Request|array $request): self /** * Performance metrics for the transformation process. * - * @param Timings|array{ - * downloadDuration?: int|null, encodingDuration?: int|null - * } $timings + * @param TimingsShape $timings */ public function withTimings(Timings|array $timings): self { diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data.php b/src/Webhooks/VideoTransformationReadyEvent/Data.php index 6dc7d3b8..f71c9a42 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data.php @@ -9,12 +9,14 @@ use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Asset; use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; -use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; -use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output; -use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Type; /** - * @phpstan-type DataShape = array{asset: Asset, transformation: Transformation} + * @phpstan-import-type AssetShape from \Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Asset + * @phpstan-import-type TransformationShape from \Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation + * + * @phpstan-type DataShape = array{ + * asset: Asset|AssetShape, transformation: Transformation|TransformationShape + * } */ final class Data implements BaseModel { @@ -54,10 +56,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Asset|array{url: string} $asset - * @param Transformation|array{ - * type: value-of, options?: Options|null, output?: Output|null - * } $transformation + * @param AssetShape $asset + * @param TransformationShape $transformation */ public static function with( Asset|array $asset, @@ -74,7 +74,7 @@ public static function with( /** * Information about the source video asset being transformed. * - * @param Asset|array{url: string} $asset + * @param AssetShape $asset */ public function withAsset(Asset|array $asset): self { @@ -85,9 +85,7 @@ public function withAsset(Asset|array $asset): self } /** - * @param Transformation|array{ - * type: value-of, options?: Options|null, output?: Output|null - * } $transformation + * @param TransformationShape $transformation */ public function withTransformation( Transformation|array $transformation diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php index 4f11ea05..cc810c82 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php @@ -9,17 +9,17 @@ use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; -use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\AudioCodec; -use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\Format; -use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\StreamProtocol; -use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\VideoCodec; use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output; -use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output\VideoMetadata; use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Type; /** + * @phpstan-import-type OptionsShape from \Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options + * @phpstan-import-type OutputShape from \Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output + * * @phpstan-type TransformationShape = array{ - * type: value-of, options?: Options|null, output?: Output|null + * type: Type|value-of, + * options?: null|Options|OptionsShape, + * output?: null|Output|OutputShape, * } */ final class Transformation implements BaseModel @@ -75,16 +75,8 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Type|value-of $type - * @param Options|array{ - * audioCodec?: value-of|null, - * autoRotate?: bool|null, - * format?: value-of|null, - * quality?: int|null, - * streamProtocol?: value-of|null, - * variants?: list|null, - * videoCodec?: value-of|null, - * } $options - * @param Output|array{url: string, videoMetadata?: VideoMetadata|null} $output + * @param OptionsShape $options + * @param OutputShape $output */ public static function with( Type|string $type, @@ -120,15 +112,7 @@ public function withType(Type|string $type): self /** * Configuration options for video transformations. * - * @param Options|array{ - * audioCodec?: value-of|null, - * autoRotate?: bool|null, - * format?: value-of|null, - * quality?: int|null, - * streamProtocol?: value-of|null, - * variants?: list|null, - * videoCodec?: value-of|null, - * } $options + * @param OptionsShape $options */ public function withOptions(Options|array $options): self { @@ -141,7 +125,7 @@ public function withOptions(Options|array $options): self /** * Information about the transformed output video. * - * @param Output|array{url: string, videoMetadata?: VideoMetadata|null} $output + * @param OutputShape $output */ public function withOutput(Output|array $output): self { diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php index bf94b65c..25a4e17d 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php @@ -16,13 +16,13 @@ * Configuration options for video transformations. * * @phpstan-type OptionsShape = array{ - * audioCodec?: value-of|null, + * audioCodec?: null|AudioCodec|value-of, * autoRotate?: bool|null, - * format?: value-of|null, + * format?: null|Format|value-of, * quality?: int|null, - * streamProtocol?: value-of|null, + * streamProtocol?: null|StreamProtocol|value-of, * variants?: list|null, - * videoCodec?: value-of|null, + * videoCodec?: null|VideoCodec|value-of, * } */ final class Options implements BaseModel diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php index c7eeab7a..681e80ad 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php @@ -13,8 +13,10 @@ /** * Information about the transformed output video. * + * @phpstan-import-type VideoMetadataShape from \Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output\VideoMetadata + * * @phpstan-type OutputShape = array{ - * url: string, videoMetadata?: VideoMetadata|null + * url: string, videoMetadata?: null|VideoMetadata|VideoMetadataShape * } */ final class Output implements BaseModel @@ -58,9 +60,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param VideoMetadata|array{ - * bitrate: int, duration: float, height: int, width: int - * } $videoMetadata + * @param VideoMetadataShape $videoMetadata */ public static function with( string $url, @@ -89,9 +89,7 @@ public function withURL(string $url): self /** * Metadata of the output video file. * - * @param VideoMetadata|array{ - * bitrate: int, duration: float, height: int, width: int - * } $videoMetadata + * @param VideoMetadataShape $videoMetadata */ public function withVideoMetadata(VideoMetadata|array $videoMetadata): self { From 6f1f9dd3d46c7122dd103a6d721e51c20066a142 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 16 Dec 2025 19:14:54 +0000 Subject: [PATCH 104/193] fix: support arrays in query param construction --- src/Core/Util.php | 35 ++++++++++++++---------- tests/Core/ModelTest.php | 59 ++++++++-------------------------------- tests/Core/UtilTest.php | 57 ++++++++++++++++++++++++++++++++++++-- 3 files changed, 85 insertions(+), 66 deletions(-) diff --git a/src/Core/Util.php b/src/Core/Util.php index 1da08e39..3467905f 100644 --- a/src/Core/Util.php +++ b/src/Core/Util.php @@ -87,6 +87,20 @@ public static function array_filter_omit(array $arr): array return array_filter($arr, fn ($v, $_) => OMIT !== $v, mode: ARRAY_FILTER_USE_BOTH); } + public static function strVal(mixed $value): string + { + if (is_bool($value)) { + return $value ? 'true' : 'false'; + } + + if (is_object($value) && is_a($value, class: \DateTimeInterface::class)) { + return date_format($value, format: \DateTimeInterface::RFC3339); + } + + // @phpstan-ignore-next-line argument.type + return strval($value); + } + /** * @param callable $callback */ @@ -185,7 +199,12 @@ public static function joinUri( parse_str($parsed['query'] ?? '', $q2); $mergedQuery = array_merge_recursive($q1, $q2, $query); - $normalizedQuery = array_map(static fn ($v) => self::strVal($v), array: $mergedQuery); + + /** @var array */ + $normalizedQuery = self::mapRecursive( + static fn ($v) => is_bool($v) || is_numeric($v) ? self::strVal($v) : $v, + value: $mergedQuery + ); $qs = http_build_query($normalizedQuery, encoding_type: PHP_QUERY_RFC3986); return $base->withQuery($qs); @@ -409,20 +428,6 @@ public static function prettyEncodeJson(mixed $obj): string return json_encode($obj, flags: JSON_UNESCAPED_UNICODE | JSON_PRETTY_PRINT) ?: ''; } - private static function strVal(mixed $value): string - { - if (is_bool($value)) { - return $value ? 'true' : 'false'; - } - - if (is_object($value) && is_a($value, class: \DateTimeInterface::class)) { - return date_format($value, format: \DateTimeInterface::RFC3339); - } - - // @phpstan-ignore-next-line argument.type - return strval($value); - } - /** * @param list $closing * diff --git a/tests/Core/ModelTest.php b/tests/Core/ModelTest.php index 54c81fab..7260e691 100644 --- a/tests/Core/ModelTest.php +++ b/tests/Core/ModelTest.php @@ -10,7 +10,7 @@ use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; -class Model implements BaseModel +class Dog implements BaseModel { /** @use SdkModel> */ use SdkModel; @@ -43,7 +43,7 @@ public function __construct( $this->ageYears = $ageYears; $this->owner = $owner; - null != $friends && $this->friends = $friends; + null !== $friends && $this['friends'] = $friends; } } @@ -58,11 +58,7 @@ class ModelTest extends TestCase #[Test] public function testBasicGetAndSet(): void { - $model = new Model( - name: 'Bob', - ageYears: 12, - owner: null, - ); + $model = new Dog(name: 'Bob', ageYears: 12, owner: null); $this->assertEquals(12, $model->ageYears); ++$model->ageYears; @@ -72,11 +68,7 @@ public function testBasicGetAndSet(): void #[Test] public function testNullAccess(): void { - $model = new Model( - name: 'Bob', - ageYears: 12, - owner: null, - ); + $model = new Dog(name: 'Bob', ageYears: 12, owner: null); $this->assertNull($model->owner); $this->assertNull($model->friends); } @@ -84,11 +76,7 @@ public function testNullAccess(): void #[Test] public function testArrayGetAndSet(): void { - $model = new Model( - name: 'Bob', - ageYears: 12, - owner: null, - ); + $model = new Dog(name: 'Bob', ageYears: 12, owner: null); $model->friends ??= []; $this->assertEquals([], $model->friends); $model->friends[] = 'Alice'; @@ -98,16 +86,8 @@ public function testArrayGetAndSet(): void #[Test] public function testDiscernsBetweenNullAndUnset(): void { - $modelUnsetFriends = new Model( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $modelNullFriends = new Model( - name: 'bob', - ageYears: 12, - owner: null, - ); + $modelUnsetFriends = new Dog(name: 'Bob', ageYears: 12, owner: null); + $modelNullFriends = new Dog(name: 'bob', ageYears: 12, owner: null); $modelNullFriends->friends = null; $this->assertEquals(12, $modelUnsetFriends->ageYears); @@ -126,11 +106,7 @@ public function testDiscernsBetweenNullAndUnset(): void #[Test] public function testIssetOnOmittedProperties(): void { - $model = new Model( - name: 'Bob', - ageYears: 12, - owner: null, - ); + $model = new Dog(name: 'Bob', ageYears: 12, owner: null); $this->assertFalse(isset($model->owner)); $this->assertFalse(isset($model->friends)); } @@ -138,12 +114,7 @@ public function testIssetOnOmittedProperties(): void #[Test] public function testSerializeBasicModel(): void { - $model = new Model( - name: 'Bob', - ageYears: 12, - owner: 'Eve', - friends: ['Alice', 'Charlie'], - ); + $model = new Dog(name: 'Bob', ageYears: 12, owner: 'Eve', friends: ['Alice', 'Charlie']); $this->assertEquals( '{"name":"Bob","age_years":12,"friends":["Alice","Charlie"],"owner":"Eve"}', json_encode($model) @@ -153,11 +124,7 @@ public function testSerializeBasicModel(): void #[Test] public function testSerializeModelWithOmittedProperties(): void { - $model = new Model( - name: 'Bob', - ageYears: 12, - owner: null, - ); + $model = new Dog(name: 'Bob', ageYears: 12, owner: null); $this->assertEquals( '{"name":"Bob","age_years":12,"owner":null}', json_encode($model) @@ -167,11 +134,7 @@ public function testSerializeModelWithOmittedProperties(): void #[Test] public function testSerializeModelWithExplicitNull(): void { - $model = new Model( - name: 'Bob', - ageYears: 12, - owner: null, - ); + $model = new Dog(name: 'Bob', ageYears: 12, owner: null); $model->friends = null; $this->assertEquals( '{"name":"Bob","age_years":12,"friends":null,"owner":null}', diff --git a/tests/Core/UtilTest.php b/tests/Core/UtilTest.php index 088effef..fd2be56b 100644 --- a/tests/Core/UtilTest.php +++ b/tests/Core/UtilTest.php @@ -2,6 +2,7 @@ namespace Tests\Core; +use Http\Discovery\Psr17FactoryDiscovery; use Imagekit\Core\Util; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; @@ -29,11 +30,61 @@ public function testMapRecursive(): void ['b' => [null, null], 'c' => ['e' => 0], 'f' => []], static fn ($vs) => is_array($vs) && !array_is_list($vs) ? array_filter($vs, callback: static fn ($v) => !is_null($v)) : $vs, ], + [ + ['a' => null, 'b' => 2, 'c' => true, 'd' => [1, 2]], + ['a' => null, 'b' => '2', 'c' => true, 'd' => ['1', '2']], + static fn ($v) => is_bool($v) || is_numeric($v) ? Util::strVal($v) : $v, + ], + ]; + + foreach ($cases as [$input, $expected, $xform]) { + $actual = Util::mapRecursive($xform, value: $input); + $this->assertEquals($expected, $actual); + } + } + + #[Test] + public function testJoinUri(): void + { + $factory = Psr17FactoryDiscovery::findUriFactory(); + $base = $factory->createUri('http://localhost'); + $cases = [ + [ + '', + [], + 'http://localhost', + ], + [ + 'dog', + [], + 'http://localhost/dog', + ], + [ + '', + ['dog' => 'dog'], + 'http://localhost?dog=dog', + ], + [ + '', + ['dog' => ['dog']], + 'http://localhost?dog[0]=dog', + ], + [ + '', + ['dog' => [true, false]], + 'http://localhost?dog[0]=true&dog[1]=false', + ], + [ + '', + ['dog' => ['dog' => ['dog']]], + 'http://localhost?dog[dog][0]=dog', + ], ]; - foreach ($cases as [$input, $output, $xform]) { - $mapped = Util::mapRecursive($xform, value: $input); - $this->assertEquals($mapped, $output); + foreach ($cases as [$path, $query, $output]) { + $expected = $factory->createUri($output); + $actual = Util::joinUri($base, path: $path, query: $query); + $this->assertEquals($expected, $actual); } } } From 65e8d5ff7c465323eb396caaab93870c09f94e84 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Dec 2025 15:04:06 +0000 Subject: [PATCH 105/193] chore(internal): codegen related update --- src/Core/Attributes/Api.php | 66 +++++++ src/Core/Concerns/SdkResponse.php | 29 +++ .../Contracts/ResponseConverter.php | 18 ++ tests/Core/TestModel.php | 181 ++++++++++++++++++ 4 files changed, 294 insertions(+) create mode 100644 src/Core/Attributes/Api.php create mode 100644 src/Core/Concerns/SdkResponse.php create mode 100644 src/Core/Conversion/Contracts/ResponseConverter.php create mode 100644 tests/Core/TestModel.php diff --git a/src/Core/Attributes/Api.php b/src/Core/Attributes/Api.php new file mode 100644 index 00000000..3ed05474 --- /dev/null +++ b/src/Core/Attributes/Api.php @@ -0,0 +1,66 @@ +|Converter|string|null */ + public readonly Converter|string|null $type; + + /** @var array */ + private static array $enumConverters = []; + + /** + * @param class-string|Converter|string|null $type + * @param class-string<\BackedEnum>|Converter|null $enum + * @param class-string|Converter|null $union + * @param class-string|Converter|string|null $list + * @param class-string|Converter|string|null $map + */ + public function __construct( + public readonly ?string $apiName = null, + Converter|string|null $type = null, + Converter|string|null $enum = null, + Converter|string|null $union = null, + Converter|string|null $list = null, + Converter|string|null $map = null, + public readonly bool $nullable = false, + public readonly bool $optional = false, + ) { + $type ??= $union; + if (null !== $list) { + $type ??= new ListOf($list); + } + if (null !== $map) { + $type ??= new MapOf($map); + } + if (null !== $enum) { + $type ??= $enum instanceof Converter ? $enum : $this->getEnumConverter($enum); + } + + $this->type = $type; + } + + /** @property class-string<\BackedEnum> $enum */ + private function getEnumConverter(string $enum): Converter + { + if (!isset(self::$enumConverters[$enum])) { + $converter = new EnumOf(array_column($enum::cases(), 'value')); // @phpstan-ignore-line + self::$enumConverters[$enum] = $converter; + } + + return self::$enumConverters[$enum]; + } +} diff --git a/src/Core/Concerns/SdkResponse.php b/src/Core/Concerns/SdkResponse.php new file mode 100644 index 00000000..ddc05f1f --- /dev/null +++ b/src/Core/Concerns/SdkResponse.php @@ -0,0 +1,29 @@ +_rawResponse = $response; + $instance->__unserialize(Util::decodeContent($response)); // @phpstan-ignore-line + + return $instance; + } + + public function getRawResponse(): ?ResponseInterface + { + return $this->_rawResponse; + } +} diff --git a/src/Core/Conversion/Contracts/ResponseConverter.php b/src/Core/Conversion/Contracts/ResponseConverter.php new file mode 100644 index 00000000..593282df --- /dev/null +++ b/src/Core/Conversion/Contracts/ResponseConverter.php @@ -0,0 +1,18 @@ +> */ + use SdkModel; + + #[Required] + public string $name; + + #[Required('age_years')] + public int $ageYears; + + /** @var list|null */ + #[Optional] + public ?array $friends; + + #[Required] + public ?string $owner; + + /** + * @param list|null $friends + */ + public function __construct( + string $name, + int $ageYears, + ?string $owner, + ?array $friends = null, + ) { + $this->initialize(); + + $this->name = $name; + $this->ageYears = $ageYears; + $this->owner = $owner; + + null != $friends && $this->friends = $friends; + } +} + +/** + * @internal + * + * @coversNothing + */ +#[CoversNothing] +class TestModelTest extends TestCase +{ + #[Test] + public function testBasicGetAndSet(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertEquals(12, $model->ageYears); + + ++$model->ageYears; + $this->assertEquals(13, $model->ageYears); + } + + #[Test] + public function testNullAccess(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertNull($model->owner); + $this->assertNull($model->friends); + } + + #[Test] + public function testArrayGetAndSet(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $model->friends ??= []; + $this->assertEquals([], $model->friends); + $model->friends[] = 'Alice'; + $this->assertEquals(['Alice'], $model->friends); + } + + #[Test] + public function testDiscernsBetweenNullAndUnset(): void + { + $modelUnsetFriends = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $modelNullFriends = new TestModel( + name: 'bob', + ageYears: 12, + owner: null, + ); + $modelNullFriends->friends = null; + + $this->assertEquals(12, $modelUnsetFriends->ageYears); + $this->assertEquals(12, $modelNullFriends->ageYears); + + $this->assertTrue($modelUnsetFriends->offsetExists('ageYears')); + $this->assertTrue($modelNullFriends->offsetExists('ageYears')); + + $this->assertNull($modelUnsetFriends->friends); + $this->assertNull($modelNullFriends->friends); + + $this->assertFalse($modelUnsetFriends->offsetExists('friends')); + $this->assertTrue($modelNullFriends->offsetExists('friends')); + } + + #[Test] + public function testIssetOnOmittedProperties(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertFalse(isset($model->owner)); + $this->assertFalse(isset($model->friends)); + } + + #[Test] + public function testSerializeBasicModel(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: 'Eve', + friends: ['Alice', 'Charlie'], + ); + $this->assertEquals( + '{"name":"Bob","age_years":12,"friends":["Alice","Charlie"],"owner":"Eve"}', + json_encode($model) + ); + } + + #[Test] + public function testSerializeModelWithOmittedProperties(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertEquals( + '{"name":"Bob","age_years":12,"owner":null}', + json_encode($model) + ); + } + + #[Test] + public function testSerializeModelWithExplicitNull(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $model->friends = null; + $this->assertEquals( + '{"name":"Bob","age_years":12,"friends":null,"owner":null}', + json_encode($model) + ); + } +} From 7d97124eff55d2d54e6b1877174bc2eb7206665c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Dec 2025 15:20:14 +0000 Subject: [PATCH 106/193] chore(internal): codegen related update --- src/Core/Attributes/Api.php | 66 ------- src/Core/Concerns/SdkResponse.php | 29 --- .../Contracts/ResponseConverter.php | 18 -- tests/Core/TestModel.php | 181 ------------------ 4 files changed, 294 deletions(-) delete mode 100644 src/Core/Attributes/Api.php delete mode 100644 src/Core/Concerns/SdkResponse.php delete mode 100644 src/Core/Conversion/Contracts/ResponseConverter.php delete mode 100644 tests/Core/TestModel.php diff --git a/src/Core/Attributes/Api.php b/src/Core/Attributes/Api.php deleted file mode 100644 index 3ed05474..00000000 --- a/src/Core/Attributes/Api.php +++ /dev/null @@ -1,66 +0,0 @@ -|Converter|string|null */ - public readonly Converter|string|null $type; - - /** @var array */ - private static array $enumConverters = []; - - /** - * @param class-string|Converter|string|null $type - * @param class-string<\BackedEnum>|Converter|null $enum - * @param class-string|Converter|null $union - * @param class-string|Converter|string|null $list - * @param class-string|Converter|string|null $map - */ - public function __construct( - public readonly ?string $apiName = null, - Converter|string|null $type = null, - Converter|string|null $enum = null, - Converter|string|null $union = null, - Converter|string|null $list = null, - Converter|string|null $map = null, - public readonly bool $nullable = false, - public readonly bool $optional = false, - ) { - $type ??= $union; - if (null !== $list) { - $type ??= new ListOf($list); - } - if (null !== $map) { - $type ??= new MapOf($map); - } - if (null !== $enum) { - $type ??= $enum instanceof Converter ? $enum : $this->getEnumConverter($enum); - } - - $this->type = $type; - } - - /** @property class-string<\BackedEnum> $enum */ - private function getEnumConverter(string $enum): Converter - { - if (!isset(self::$enumConverters[$enum])) { - $converter = new EnumOf(array_column($enum::cases(), 'value')); // @phpstan-ignore-line - self::$enumConverters[$enum] = $converter; - } - - return self::$enumConverters[$enum]; - } -} diff --git a/src/Core/Concerns/SdkResponse.php b/src/Core/Concerns/SdkResponse.php deleted file mode 100644 index ddc05f1f..00000000 --- a/src/Core/Concerns/SdkResponse.php +++ /dev/null @@ -1,29 +0,0 @@ -_rawResponse = $response; - $instance->__unserialize(Util::decodeContent($response)); // @phpstan-ignore-line - - return $instance; - } - - public function getRawResponse(): ?ResponseInterface - { - return $this->_rawResponse; - } -} diff --git a/src/Core/Conversion/Contracts/ResponseConverter.php b/src/Core/Conversion/Contracts/ResponseConverter.php deleted file mode 100644 index 593282df..00000000 --- a/src/Core/Conversion/Contracts/ResponseConverter.php +++ /dev/null @@ -1,18 +0,0 @@ -> */ - use SdkModel; - - #[Required] - public string $name; - - #[Required('age_years')] - public int $ageYears; - - /** @var list|null */ - #[Optional] - public ?array $friends; - - #[Required] - public ?string $owner; - - /** - * @param list|null $friends - */ - public function __construct( - string $name, - int $ageYears, - ?string $owner, - ?array $friends = null, - ) { - $this->initialize(); - - $this->name = $name; - $this->ageYears = $ageYears; - $this->owner = $owner; - - null != $friends && $this->friends = $friends; - } -} - -/** - * @internal - * - * @coversNothing - */ -#[CoversNothing] -class TestModelTest extends TestCase -{ - #[Test] - public function testBasicGetAndSet(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $this->assertEquals(12, $model->ageYears); - - ++$model->ageYears; - $this->assertEquals(13, $model->ageYears); - } - - #[Test] - public function testNullAccess(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $this->assertNull($model->owner); - $this->assertNull($model->friends); - } - - #[Test] - public function testArrayGetAndSet(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $model->friends ??= []; - $this->assertEquals([], $model->friends); - $model->friends[] = 'Alice'; - $this->assertEquals(['Alice'], $model->friends); - } - - #[Test] - public function testDiscernsBetweenNullAndUnset(): void - { - $modelUnsetFriends = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $modelNullFriends = new TestModel( - name: 'bob', - ageYears: 12, - owner: null, - ); - $modelNullFriends->friends = null; - - $this->assertEquals(12, $modelUnsetFriends->ageYears); - $this->assertEquals(12, $modelNullFriends->ageYears); - - $this->assertTrue($modelUnsetFriends->offsetExists('ageYears')); - $this->assertTrue($modelNullFriends->offsetExists('ageYears')); - - $this->assertNull($modelUnsetFriends->friends); - $this->assertNull($modelNullFriends->friends); - - $this->assertFalse($modelUnsetFriends->offsetExists('friends')); - $this->assertTrue($modelNullFriends->offsetExists('friends')); - } - - #[Test] - public function testIssetOnOmittedProperties(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $this->assertFalse(isset($model->owner)); - $this->assertFalse(isset($model->friends)); - } - - #[Test] - public function testSerializeBasicModel(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: 'Eve', - friends: ['Alice', 'Charlie'], - ); - $this->assertEquals( - '{"name":"Bob","age_years":12,"friends":["Alice","Charlie"],"owner":"Eve"}', - json_encode($model) - ); - } - - #[Test] - public function testSerializeModelWithOmittedProperties(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $this->assertEquals( - '{"name":"Bob","age_years":12,"owner":null}', - json_encode($model) - ); - } - - #[Test] - public function testSerializeModelWithExplicitNull(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $model->friends = null; - $this->assertEquals( - '{"name":"Bob","age_years":12,"friends":null,"owner":null}', - json_encode($model) - ); - } -} From 29c564459ff158230f1efcfd80115ff911022c86 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 17 Dec 2025 15:26:54 +0000 Subject: [PATCH 107/193] feat: improved phpstan type annotations --- .../URLEndpoints/URLEndpointCreateParams.php | 4 +- .../URLEndpoints/URLEndpointRequest.php | 6 +- .../URLEndpoints/URLEndpointResponse.php | 4 +- .../URLEndpoints/URLEndpointUpdateParams.php | 4 +- src/Assets/AssetListParams.php | 6 +- src/BaseOverlay.php | 8 +-- src/Beta/V2/Files/FileUploadParams.php | 14 ++--- .../Files/FileUploadParams/Transformation.php | 2 +- src/Beta/V2/Files/FileUploadResponse.php | 18 +++--- .../FileUploadResponse/ExtensionStatus.php | 8 +-- .../SelectedFieldsSchema.php | 8 +-- .../Invalidation/InvalidationGetResponse.php | 2 +- .../CustomMetadataField.php | 4 +- .../CustomMetadataField/Schema.php | 8 +-- .../CustomMetadataFieldCreateParams.php | 6 +- .../Schema.php | 8 +-- .../CustomMetadataFieldUpdateParams.php | 6 +- .../Schema.php | 8 +-- src/ExtensionItem/RemovedotBgExtension.php | 4 +- src/Files/Bulk/BulkAddTagsResponse.php | 2 +- src/Files/Bulk/BulkDeleteResponse.php | 2 +- src/Files/Bulk/BulkRemoveAITagsResponse.php | 2 +- src/Files/Bulk/BulkRemoveTagsResponse.php | 2 +- src/Files/File.php | 10 ++-- src/Files/File/SelectedFieldsSchema.php | 8 +-- src/Files/FileUpdateParams.php | 12 ++-- src/Files/FileUpdateResponse.php | 14 ++--- .../FileUpdateResponse/ExtensionStatus.php | 8 +-- src/Files/FileUploadParams.php | 14 ++--- src/Files/FileUploadParams/Transformation.php | 2 +- src/Files/FileUploadResponse.php | 18 +++--- .../FileUploadResponse/ExtensionStatus.php | 8 +-- .../SelectedFieldsSchema.php | 8 +-- src/Files/Folder.php | 2 +- src/Files/Metadata.php | 4 +- src/Files/Metadata/Exif.php | 22 +++---- src/Files/Metadata/Exif/Gps.php | 2 +- .../ChangePublicationStatus.php | 4 +- .../UpdateFileRequest/UpdateFileDetails.php | 6 +- src/Folders/Job/JobGetResponse.php | 4 +- src/GetImageAttributesOptions.php | 10 ++-- src/ImageOverlay.php | 12 ++-- src/OverlayPosition.php | 6 +- src/OverlayTiming.php | 6 +- src/SolidColorOverlay.php | 10 ++-- src/SolidColorOverlayTransformation.php | 8 +-- src/SrcOptions.php | 6 +- src/SubtitleOverlay.php | 12 ++-- src/SubtitleOverlayTransformation.php | 2 +- src/TextOverlay.php | 12 ++-- src/TextOverlayTransformation.php | 16 +++--- src/Transformation.php | 57 ++++++++++--------- src/VideoOverlay.php | 12 ++-- .../UploadPostTransformErrorEvent.php | 8 +-- .../UploadPostTransformErrorEvent/Data.php | 4 +- .../Data/Transformation.php | 4 +- .../UploadPostTransformErrorEvent/Request.php | 4 +- .../Request/Transformation.php | 2 +- .../UploadPostTransformSuccessEvent.php | 8 +-- .../Request.php | 4 +- .../Request/Transformation.php | 2 +- src/Webhooks/UploadPreTransformErrorEvent.php | 8 +-- .../UploadPreTransformErrorEvent/Data.php | 4 +- .../Data/Transformation.php | 4 +- .../UploadPreTransformSuccessEvent.php | 8 +-- .../UploadPreTransformSuccessEvent/Data.php | 18 +++--- .../Data/ExtensionStatus.php | 8 +-- .../Data/SelectedFieldsSchema.php | 8 +-- .../VideoTransformationAcceptedEvent.php | 8 +-- .../VideoTransformationAcceptedEvent/Data.php | 8 +-- .../Data/Transformation.php | 4 +- .../Data/Transformation/Options.php | 10 ++-- .../VideoTransformationErrorEvent.php | 8 +-- .../VideoTransformationErrorEvent/Data.php | 8 +-- .../Data/Transformation.php | 8 +-- .../Data/Transformation/Options.php | 10 ++-- .../VideoTransformationReadyEvent.php | 12 ++-- .../VideoTransformationReadyEvent/Data.php | 8 +-- .../Data/Transformation.php | 8 +-- .../Data/Transformation/Options.php | 10 ++-- .../Data/Transformation/Output.php | 4 +- 81 files changed, 327 insertions(+), 324 deletions(-) diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php index ff96a971..485aac23 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php @@ -85,8 +85,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $origins - * @param URLRewriterShape $urlRewriter + * @param list|null $origins + * @param URLRewriterShape|null $urlRewriter */ public static function with( string $description, diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest.php b/src/Accounts/URLEndpoints/URLEndpointRequest.php index c6dbd0fe..3b69a0d9 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest.php @@ -22,7 +22,7 @@ * description: string, * origins?: list|null, * urlPrefix?: string|null, - * urlRewriter?: null|URLRewriterShape|CloudinaryURLRewriter|ImgixURLRewriter|AkamaiURLRewriter, + * urlRewriter?: URLRewriterShape|null, * } */ final class URLEndpointRequest implements BaseModel @@ -80,8 +80,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $origins - * @param URLRewriterShape $urlRewriter + * @param list|null $origins + * @param URLRewriterShape|null $urlRewriter */ public static function with( string $description, diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse.php b/src/Accounts/URLEndpoints/URLEndpointResponse.php index b6ae1858..39688ade 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse.php @@ -23,7 +23,7 @@ * description: string, * origins: list, * urlPrefix: string, - * urlRewriter?: null|URLRewriterShape|CloudinaryURLRewriter|ImgixURLRewriter|AkamaiURLRewriter, + * urlRewriter?: URLRewriterShape|null, * } */ final class URLEndpointResponse implements BaseModel @@ -94,7 +94,7 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param list $origins - * @param URLRewriterShape $urlRewriter + * @param URLRewriterShape|null $urlRewriter */ public static function with( string $id, diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php index a0d2b8f3..f87e9241 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php @@ -85,8 +85,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $origins - * @param URLRewriterShape $urlRewriter + * @param list|null $origins + * @param URLRewriterShape|null $urlRewriter */ public static function with( string $description, diff --git a/src/Assets/AssetListParams.php b/src/Assets/AssetListParams.php index 8cac25a6..6f105019 100644 --- a/src/Assets/AssetListParams.php +++ b/src/Assets/AssetListParams.php @@ -111,9 +111,9 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param FileType|value-of $fileType - * @param Sort|value-of $sort - * @param Type|value-of $type + * @param FileType|value-of|null $fileType + * @param Sort|value-of|null $sort + * @param Type|value-of|null $type */ public static function with( FileType|string|null $fileType = null, diff --git a/src/BaseOverlay.php b/src/BaseOverlay.php index 050dbb2f..57f722c0 100644 --- a/src/BaseOverlay.php +++ b/src/BaseOverlay.php @@ -38,8 +38,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param OverlayPositionShape $position - * @param OverlayTimingShape $timing + * @param OverlayPosition|OverlayPositionShape|null $position + * @param OverlayTiming|OverlayTimingShape|null $timing */ public static function with( OverlayPosition|array|null $position = null, @@ -54,7 +54,7 @@ public static function with( } /** - * @param OverlayPositionShape $position + * @param OverlayPosition|OverlayPositionShape $position */ public function withPosition(OverlayPosition|array $position): self { @@ -65,7 +65,7 @@ public function withPosition(OverlayPosition|array $position): self } /** - * @param OverlayTimingShape $timing + * @param OverlayTiming|OverlayTimingShape $timing */ public function withTiming(OverlayTiming|array $timing): self { diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index ab77e5ae..43e0de18 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -55,7 +55,7 @@ * overwriteTags?: bool|null, * responseFields?: list>|null, * tags?: list|null, - * transformation?: TransformationShape|null, + * transformation?: null|Transformation|TransformationShape, * useUniqueFileName?: bool|null, * webhookURL?: string|null, * } @@ -254,11 +254,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param array $customMetadata - * @param list $extensions - * @param list> $responseFields - * @param list $tags - * @param TransformationShape $transformation + * @param array|null $customMetadata + * @param list|null $extensions + * @param list>|null $responseFields + * @param list|null $tags + * @param Transformation|TransformationShape|null $transformation */ public static function with( string $file, @@ -540,7 +540,7 @@ public function withTags(array $tags): self * * You can mix and match any combination of post-processing types. * - * @param TransformationShape $transformation + * @param Transformation|TransformationShape $transformation */ public function withTransformation( Transformation|array $transformation diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation.php index 27c283e3..0ced6af6 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation.php @@ -61,7 +61,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $post + * @param list|null $post */ public static function with(?array $post = null, ?string $pre = null): self { diff --git a/src/Beta/V2/Files/FileUploadResponse.php b/src/Beta/V2/Files/FileUploadResponse.php index 0e345a9b..b8f93518 100644 --- a/src/Beta/V2/Files/FileUploadResponse.php +++ b/src/Beta/V2/Files/FileUploadResponse.php @@ -236,13 +236,13 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param list|null $aiTags - * @param array $customMetadata - * @param array $embeddedMetadata - * @param ExtensionStatusShape $extensionStatus - * @param MetadataShape $metadata - * @param array $selectedFieldsSchema + * @param array|null $customMetadata + * @param array|null $embeddedMetadata + * @param ExtensionStatus|ExtensionStatusShape|null $extensionStatus + * @param Metadata|MetadataShape|null $metadata + * @param array|null $selectedFieldsSchema * @param list|null $tags - * @param VersionInfoShape $versionInfo + * @param VersionInfo|VersionInfoShape|null $versionInfo */ public static function with( ?array $aiTags = null, @@ -405,7 +405,7 @@ public function withEmbeddedMetadata(array $embeddedMetadata): self * * If no extension was requested, then this parameter is not returned. * - * @param ExtensionStatusShape $extensionStatus + * @param ExtensionStatus|ExtensionStatusShape $extensionStatus */ public function withExtensionStatus( ExtensionStatus|array $extensionStatus @@ -485,7 +485,7 @@ public function withIsPublished(bool $isPublished): self /** * Legacy metadata. Send `metadata` in `responseFields` in API request to get metadata in the upload API response. * - * @param MetadataShape $metadata + * @param Metadata|MetadataShape $metadata */ public function withMetadata(Metadata|array $metadata): self { @@ -572,7 +572,7 @@ public function withURL(string $url): self /** * An object containing the file or file version's `id` (versionId) and `name`. * - * @param VersionInfoShape $versionInfo + * @param VersionInfo|VersionInfoShape $versionInfo */ public function withVersionInfo(VersionInfo|array $versionInfo): self { diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php index 93129fb2..de3150e5 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php @@ -59,10 +59,10 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AIAutoDescription|value-of $aiAutoDescription - * @param AwsAutoTagging|value-of $awsAutoTagging - * @param GoogleAutoTagging|value-of $googleAutoTagging - * @param RemoveBg|value-of $removeBg + * @param AIAutoDescription|value-of|null $aiAutoDescription + * @param AwsAutoTagging|value-of|null $awsAutoTagging + * @param GoogleAutoTagging|value-of|null $googleAutoTagging + * @param RemoveBg|value-of|null $removeBg */ public static function with( AIAutoDescription|string|null $aiAutoDescription = null, diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php index 7e920c01..745732cf 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php @@ -127,10 +127,10 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Type|value-of $type - * @param DefaultValueShape $defaultValue - * @param MaxValueShape $maxValue - * @param MinValueShape $minValue - * @param list $selectOptions + * @param DefaultValueShape|null $defaultValue + * @param MaxValueShape|null $maxValue + * @param MinValueShape|null $minValue + * @param list|null $selectOptions */ public static function with( Type|string $type, diff --git a/src/Cache/Invalidation/InvalidationGetResponse.php b/src/Cache/Invalidation/InvalidationGetResponse.php index c4e12c89..b2f1b131 100644 --- a/src/Cache/Invalidation/InvalidationGetResponse.php +++ b/src/Cache/Invalidation/InvalidationGetResponse.php @@ -37,7 +37,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Status|value-of $status + * @param Status|value-of|null $status */ public static function with(Status|string|null $status = null): self { diff --git a/src/CustomMetadataFields/CustomMetadataField.php b/src/CustomMetadataFields/CustomMetadataField.php index b704d594..4220326a 100644 --- a/src/CustomMetadataFields/CustomMetadataField.php +++ b/src/CustomMetadataFields/CustomMetadataField.php @@ -75,7 +75,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param SchemaShape $schema + * @param Schema|SchemaShape $schema */ public static function with( string $id, @@ -129,7 +129,7 @@ public function withName(string $name): self /** * An object that describes the rules for the custom metadata field value. * - * @param SchemaShape $schema + * @param Schema|SchemaShape $schema */ public function withSchema(Schema|array $schema): self { diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema.php b/src/CustomMetadataFields/CustomMetadataField/Schema.php index d9b012ba..d79615d3 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema.php @@ -115,10 +115,10 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Type|value-of $type - * @param DefaultValueShape $defaultValue - * @param MaxValueShape $maxValue - * @param MinValueShape $minValue - * @param list $selectOptions + * @param DefaultValueShape|null $defaultValue + * @param MaxValueShape|null $maxValue + * @param MinValueShape|null $minValue + * @param list|null $selectOptions */ public static function with( Type|string $type, diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php index 7a6f64d8..12cf2a09 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php @@ -18,7 +18,7 @@ * @phpstan-import-type SchemaShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema * * @phpstan-type CustomMetadataFieldCreateParamsShape = array{ - * label: string, name: string, schema: SchemaShape + * label: string, name: string, schema: Schema|SchemaShape * } */ final class CustomMetadataFieldCreateParams implements BaseModel @@ -69,7 +69,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param SchemaShape $schema + * @param Schema|SchemaShape $schema */ public static function with( string $label, @@ -108,7 +108,7 @@ public function withName(string $name): self } /** - * @param SchemaShape $schema + * @param Schema|SchemaShape $schema */ public function withSchema(Schema|array $schema): self { diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php index 095c2180..301005c0 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php @@ -113,10 +113,10 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Type|value-of $type - * @param DefaultValueShape $defaultValue - * @param MaxValueShape $maxValue - * @param MinValueShape $minValue - * @param list $selectOptions + * @param DefaultValueShape|null $defaultValue + * @param MaxValueShape|null $maxValue + * @param MinValueShape|null $minValue + * @param list|null $selectOptions */ public static function with( Type|string $type, diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php index bd71741f..dde5fa2e 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php @@ -18,7 +18,7 @@ * @phpstan-import-type SchemaShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema * * @phpstan-type CustomMetadataFieldUpdateParamsShape = array{ - * label?: string|null, schema?: SchemaShape|null + * label?: string|null, schema?: null|Schema|SchemaShape * } */ final class CustomMetadataFieldUpdateParams implements BaseModel @@ -49,7 +49,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param SchemaShape $schema + * @param Schema|SchemaShape|null $schema */ public static function with( ?string $label = null, @@ -77,7 +77,7 @@ public function withLabel(string $label): self /** * An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. * - * @param SchemaShape $schema + * @param Schema|SchemaShape $schema */ public function withSchema(Schema|array $schema): self { diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php index e23708bb..0d571668 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php @@ -89,10 +89,10 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param DefaultValueShape $defaultValue - * @param MaxValueShape $maxValue - * @param MinValueShape $minValue - * @param list $selectOptions + * @param DefaultValueShape|null $defaultValue + * @param MaxValueShape|null $maxValue + * @param MinValueShape|null $minValue + * @param list|null $selectOptions */ public static function with( string|float|bool|array|null $defaultValue = null, diff --git a/src/ExtensionItem/RemovedotBgExtension.php b/src/ExtensionItem/RemovedotBgExtension.php index 7c0c123c..c8c12741 100644 --- a/src/ExtensionItem/RemovedotBgExtension.php +++ b/src/ExtensionItem/RemovedotBgExtension.php @@ -43,7 +43,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param OptionsShape $options + * @param Options|OptionsShape|null $options */ public static function with(Options|array|null $options = null): self { @@ -55,7 +55,7 @@ public static function with(Options|array|null $options = null): self } /** - * @param OptionsShape $options + * @param Options|OptionsShape $options */ public function withOptions(Options|array $options): self { diff --git a/src/Files/Bulk/BulkAddTagsResponse.php b/src/Files/Bulk/BulkAddTagsResponse.php index f9391c23..b59a6216 100644 --- a/src/Files/Bulk/BulkAddTagsResponse.php +++ b/src/Files/Bulk/BulkAddTagsResponse.php @@ -36,7 +36,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $successfullyUpdatedFileIDs + * @param list|null $successfullyUpdatedFileIDs */ public static function with(?array $successfullyUpdatedFileIDs = null): self { diff --git a/src/Files/Bulk/BulkDeleteResponse.php b/src/Files/Bulk/BulkDeleteResponse.php index cfc8be84..a72bd0e4 100644 --- a/src/Files/Bulk/BulkDeleteResponse.php +++ b/src/Files/Bulk/BulkDeleteResponse.php @@ -36,7 +36,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $successfullyDeletedFileIDs + * @param list|null $successfullyDeletedFileIDs */ public static function with(?array $successfullyDeletedFileIDs = null): self { diff --git a/src/Files/Bulk/BulkRemoveAITagsResponse.php b/src/Files/Bulk/BulkRemoveAITagsResponse.php index ced66543..85aeafa2 100644 --- a/src/Files/Bulk/BulkRemoveAITagsResponse.php +++ b/src/Files/Bulk/BulkRemoveAITagsResponse.php @@ -36,7 +36,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $successfullyUpdatedFileIDs + * @param list|null $successfullyUpdatedFileIDs */ public static function with(?array $successfullyUpdatedFileIDs = null): self { diff --git a/src/Files/Bulk/BulkRemoveTagsResponse.php b/src/Files/Bulk/BulkRemoveTagsResponse.php index 97e3561f..78d55a6b 100644 --- a/src/Files/Bulk/BulkRemoveTagsResponse.php +++ b/src/Files/Bulk/BulkRemoveTagsResponse.php @@ -36,7 +36,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $successfullyUpdatedFileIDs + * @param list|null $successfullyUpdatedFileIDs */ public static function with(?array $successfullyUpdatedFileIDs = null): self { diff --git a/src/Files/File.php b/src/Files/File.php index ffe4f82d..5f021688 100644 --- a/src/Files/File.php +++ b/src/Files/File.php @@ -213,11 +213,11 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param list|null $aiTags - * @param array $customMetadata - * @param array $selectedFieldsSchema + * @param array|null $customMetadata + * @param array|null $selectedFieldsSchema * @param list|null $tags - * @param Type|value-of $type - * @param VersionInfoShape $versionInfo + * @param Type|value-of|null $type + * @param VersionInfo|VersionInfoShape|null $versionInfo */ public static function with( ?array $aiTags = null, @@ -521,7 +521,7 @@ public function withURL(string $url): self /** * An object with details of the file version. * - * @param VersionInfoShape $versionInfo + * @param VersionInfo|VersionInfoShape $versionInfo */ public function withVersionInfo(VersionInfo|array $versionInfo): self { diff --git a/src/Files/File/SelectedFieldsSchema.php b/src/Files/File/SelectedFieldsSchema.php index 971cb318..c627a20b 100644 --- a/src/Files/File/SelectedFieldsSchema.php +++ b/src/Files/File/SelectedFieldsSchema.php @@ -127,10 +127,10 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Type|value-of $type - * @param DefaultValueShape $defaultValue - * @param MaxValueShape $maxValue - * @param MinValueShape $minValue - * @param list $selectOptions + * @param DefaultValueShape|null $defaultValue + * @param MaxValueShape|null $maxValue + * @param MinValueShape|null $minValue + * @param list|null $selectOptions */ public static function with( Type|string $type, diff --git a/src/Files/FileUpdateParams.php b/src/Files/FileUpdateParams.php index 93b9b554..caf4cd8a 100644 --- a/src/Files/FileUpdateParams.php +++ b/src/Files/FileUpdateParams.php @@ -32,7 +32,7 @@ * removeAITags?: RemoveAITagsShape|null, * tags?: list|null, * webhookURL?: string|null, - * publish?: PublishShape|null, + * publish?: null|Publish|PublishShape, * } */ final class FileUpdateParams implements BaseModel @@ -111,11 +111,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param array $customMetadata - * @param list $extensions - * @param RemoveAITagsShape $removeAITags + * @param array|null $customMetadata + * @param list|null $extensions + * @param RemoveAITagsShape|null $removeAITags * @param list|null $tags - * @param PublishShape $publish + * @param Publish|PublishShape|null $publish */ public static function with( ?string $customCoordinates = null, @@ -233,7 +233,7 @@ public function withWebhookURL(string $webhookURL): self /** * Configure the publication status of a file and its versions. * - * @param PublishShape $publish + * @param Publish|PublishShape $publish */ public function withPublish(Publish|array $publish): self { diff --git a/src/Files/FileUpdateResponse.php b/src/Files/FileUpdateResponse.php index a963e663..e237419b 100644 --- a/src/Files/FileUpdateResponse.php +++ b/src/Files/FileUpdateResponse.php @@ -219,12 +219,12 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param list|null $aiTags - * @param array $customMetadata - * @param array $selectedFieldsSchema + * @param array|null $customMetadata + * @param array|null $selectedFieldsSchema * @param list|null $tags - * @param Type|value-of $type - * @param VersionInfoShape $versionInfo - * @param ExtensionStatusShape $extensionStatus + * @param Type|value-of|null $type + * @param VersionInfo|VersionInfoShape|null $versionInfo + * @param ExtensionStatus|ExtensionStatusShape|null $extensionStatus */ public static function with( ?array $aiTags = null, @@ -530,7 +530,7 @@ public function withURL(string $url): self /** * An object with details of the file version. * - * @param VersionInfoShape $versionInfo + * @param VersionInfo|VersionInfoShape $versionInfo */ public function withVersionInfo(VersionInfo|array $versionInfo): self { @@ -552,7 +552,7 @@ public function withWidth(float $width): self } /** - * @param ExtensionStatusShape $extensionStatus + * @param ExtensionStatus|ExtensionStatusShape $extensionStatus */ public function withExtensionStatus( ExtensionStatus|array $extensionStatus diff --git a/src/Files/FileUpdateResponse/ExtensionStatus.php b/src/Files/FileUpdateResponse/ExtensionStatus.php index 5b9f26d3..ab19ab31 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus.php @@ -51,10 +51,10 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AIAutoDescription|value-of $aiAutoDescription - * @param AwsAutoTagging|value-of $awsAutoTagging - * @param GoogleAutoTagging|value-of $googleAutoTagging - * @param RemoveBg|value-of $removeBg + * @param AIAutoDescription|value-of|null $aiAutoDescription + * @param AwsAutoTagging|value-of|null $awsAutoTagging + * @param GoogleAutoTagging|value-of|null $googleAutoTagging + * @param RemoveBg|value-of|null $removeBg */ public static function with( AIAutoDescription|string|null $aiAutoDescription = null, diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index f344f352..54838d6d 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -58,7 +58,7 @@ * responseFields?: list>|null, * signature?: string|null, * tags?: list|null, - * transformation?: TransformationShape|null, + * transformation?: null|Transformation|TransformationShape, * useUniqueFileName?: bool|null, * webhookURL?: string|null, * } @@ -287,11 +287,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param array $customMetadata - * @param list $extensions - * @param list> $responseFields - * @param list $tags - * @param TransformationShape $transformation + * @param array|null $customMetadata + * @param list|null $extensions + * @param list>|null $responseFields + * @param list|null $tags + * @param Transformation|TransformationShape|null $transformation */ public static function with( string $file, @@ -624,7 +624,7 @@ public function withTags(array $tags): self * * You can mix and match any combination of post-processing types. * - * @param TransformationShape $transformation + * @param Transformation|TransformationShape $transformation */ public function withTransformation( Transformation|array $transformation diff --git a/src/Files/FileUploadParams/Transformation.php b/src/Files/FileUploadParams/Transformation.php index 40421a69..b6277177 100644 --- a/src/Files/FileUploadParams/Transformation.php +++ b/src/Files/FileUploadParams/Transformation.php @@ -61,7 +61,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $post + * @param list|null $post */ public static function with(?array $post = null, ?string $pre = null): self { diff --git a/src/Files/FileUploadResponse.php b/src/Files/FileUploadResponse.php index 2aa5433b..01928a70 100644 --- a/src/Files/FileUploadResponse.php +++ b/src/Files/FileUploadResponse.php @@ -235,13 +235,13 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param list|null $aiTags - * @param array $customMetadata - * @param array $embeddedMetadata - * @param ExtensionStatusShape $extensionStatus - * @param MetadataShape $metadata - * @param array $selectedFieldsSchema + * @param array|null $customMetadata + * @param array|null $embeddedMetadata + * @param ExtensionStatus|ExtensionStatusShape|null $extensionStatus + * @param Metadata|MetadataShape|null $metadata + * @param array|null $selectedFieldsSchema * @param list|null $tags - * @param VersionInfoShape $versionInfo + * @param VersionInfo|VersionInfoShape|null $versionInfo */ public static function with( ?array $aiTags = null, @@ -404,7 +404,7 @@ public function withEmbeddedMetadata(array $embeddedMetadata): self * * If no extension was requested, then this parameter is not returned. * - * @param ExtensionStatusShape $extensionStatus + * @param ExtensionStatus|ExtensionStatusShape $extensionStatus */ public function withExtensionStatus( ExtensionStatus|array $extensionStatus @@ -484,7 +484,7 @@ public function withIsPublished(bool $isPublished): self /** * Legacy metadata. Send `metadata` in `responseFields` in API request to get metadata in the upload API response. * - * @param MetadataShape $metadata + * @param Metadata|MetadataShape $metadata */ public function withMetadata(Metadata|array $metadata): self { @@ -571,7 +571,7 @@ public function withURL(string $url): self /** * An object containing the file or file version's `id` (versionId) and `name`. * - * @param VersionInfoShape $versionInfo + * @param VersionInfo|VersionInfoShape $versionInfo */ public function withVersionInfo(VersionInfo|array $versionInfo): self { diff --git a/src/Files/FileUploadResponse/ExtensionStatus.php b/src/Files/FileUploadResponse/ExtensionStatus.php index 091a6f0e..6b7eef13 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Files/FileUploadResponse/ExtensionStatus.php @@ -59,10 +59,10 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AIAutoDescription|value-of $aiAutoDescription - * @param AwsAutoTagging|value-of $awsAutoTagging - * @param GoogleAutoTagging|value-of $googleAutoTagging - * @param RemoveBg|value-of $removeBg + * @param AIAutoDescription|value-of|null $aiAutoDescription + * @param AwsAutoTagging|value-of|null $awsAutoTagging + * @param GoogleAutoTagging|value-of|null $googleAutoTagging + * @param RemoveBg|value-of|null $removeBg */ public static function with( AIAutoDescription|string|null $aiAutoDescription = null, diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema.php b/src/Files/FileUploadResponse/SelectedFieldsSchema.php index 3545e6c8..ac516177 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema.php @@ -127,10 +127,10 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Type|value-of $type - * @param DefaultValueShape $defaultValue - * @param MaxValueShape $maxValue - * @param MinValueShape $minValue - * @param list $selectOptions + * @param DefaultValueShape|null $defaultValue + * @param MaxValueShape|null $maxValue + * @param MinValueShape|null $minValue + * @param list|null $selectOptions */ public static function with( Type|string $type, diff --git a/src/Files/Folder.php b/src/Files/Folder.php index e4de13d2..26df7c7e 100644 --- a/src/Files/Folder.php +++ b/src/Files/Folder.php @@ -72,7 +72,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Type|value-of $type + * @param Type|value-of|null $type */ public static function with( ?\DateTimeInterface $createdAt = null, diff --git a/src/Files/Metadata.php b/src/Files/Metadata.php index 06e9966e..9d22d7ed 100644 --- a/src/Files/Metadata.php +++ b/src/Files/Metadata.php @@ -127,7 +127,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param ExifShape $exif + * @param Exif|ExifShape|null $exif */ public static function with( ?string $audioCodec = null, @@ -210,7 +210,7 @@ public function withDuration(int $duration): self } /** - * @param ExifShape $exif + * @param Exif|ExifShape $exif */ public function withExif(Exif|array $exif): self { diff --git a/src/Files/Metadata/Exif.php b/src/Files/Metadata/Exif.php index 45da1f1c..3074e4e7 100644 --- a/src/Files/Metadata/Exif.php +++ b/src/Files/Metadata/Exif.php @@ -77,12 +77,12 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param ExifShape1 $exif - * @param GpsShape $gps - * @param ImageShape $image - * @param InteroperabilityShape $interoperability - * @param array $makernote - * @param ThumbnailShape $thumbnail + * @param Exif\Exif|ExifShape1|null $exif + * @param Gps|GpsShape|null $gps + * @param Image|ImageShape|null $image + * @param Interoperability|InteroperabilityShape|null $interoperability + * @param array|null $makernote + * @param Thumbnail|ThumbnailShape|null $thumbnail */ public static function with( Exif\Exif|array|null $exif = null, @@ -107,7 +107,7 @@ public static function with( /** * Object containing Exif details. * - * @param ExifShape1 $exif + * @param Exif\Exif|ExifShape1 $exif */ public function withExif( Exif\Exif|array $exif @@ -121,7 +121,7 @@ public function withExif( /** * Object containing GPS information. * - * @param GpsShape $gps + * @param Gps|GpsShape $gps */ public function withGps(Gps|array $gps): self { @@ -134,7 +134,7 @@ public function withGps(Gps|array $gps): self /** * Object containing EXIF image information. * - * @param ImageShape $image + * @param Image|ImageShape $image */ public function withImage(Image|array $image): self { @@ -147,7 +147,7 @@ public function withImage(Image|array $image): self /** * JSON object. * - * @param InteroperabilityShape $interoperability + * @param Interoperability|InteroperabilityShape $interoperability */ public function withInteroperability( Interoperability|array $interoperability @@ -172,7 +172,7 @@ public function withMakernote(array $makernote): self /** * Object containing Thumbnail information. * - * @param ThumbnailShape $thumbnail + * @param Thumbnail|ThumbnailShape $thumbnail */ public function withThumbnail(Thumbnail|array $thumbnail): self { diff --git a/src/Files/Metadata/Exif/Gps.php b/src/Files/Metadata/Exif/Gps.php index df1828ef..a215e735 100644 --- a/src/Files/Metadata/Exif/Gps.php +++ b/src/Files/Metadata/Exif/Gps.php @@ -32,7 +32,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $gpsVersionID + * @param list|null $gpsVersionID */ public static function with(?array $gpsVersionID = null): self { diff --git a/src/Files/UpdateFileRequest/ChangePublicationStatus.php b/src/Files/UpdateFileRequest/ChangePublicationStatus.php index f16861e0..69454690 100644 --- a/src/Files/UpdateFileRequest/ChangePublicationStatus.php +++ b/src/Files/UpdateFileRequest/ChangePublicationStatus.php @@ -37,7 +37,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param PublishShape $publish + * @param Publish|PublishShape|null $publish */ public static function with(Publish|array|null $publish = null): self { @@ -51,7 +51,7 @@ public static function with(Publish|array|null $publish = null): self /** * Configure the publication status of a file and its versions. * - * @param PublishShape $publish + * @param Publish|PublishShape $publish */ public function withPublish(Publish|array $publish): self { diff --git a/src/Files/UpdateFileRequest/UpdateFileDetails.php b/src/Files/UpdateFileRequest/UpdateFileDetails.php index 37821b1c..b9dff0bc 100644 --- a/src/Files/UpdateFileRequest/UpdateFileDetails.php +++ b/src/Files/UpdateFileRequest/UpdateFileDetails.php @@ -96,9 +96,9 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param array $customMetadata - * @param list $extensions - * @param RemoveAITagsShape $removeAITags + * @param array|null $customMetadata + * @param list|null $extensions + * @param RemoveAITagsShape|null $removeAITags * @param list|null $tags */ public static function with( diff --git a/src/Folders/Job/JobGetResponse.php b/src/Folders/Job/JobGetResponse.php index 5264e141..d512c378 100644 --- a/src/Folders/Job/JobGetResponse.php +++ b/src/Folders/Job/JobGetResponse.php @@ -61,8 +61,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Status|value-of $status - * @param Type|value-of $type + * @param Status|value-of|null $status + * @param Type|value-of|null $type */ public static function with( ?string $jobID = null, diff --git a/src/GetImageAttributesOptions.php b/src/GetImageAttributesOptions.php index cec4010b..dc76fc3b 100644 --- a/src/GetImageAttributesOptions.php +++ b/src/GetImageAttributesOptions.php @@ -168,11 +168,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param array $queryParameters - * @param list $transformation - * @param TransformationPosition|value-of $transformationPosition - * @param list $deviceBreakpoints - * @param list $imageBreakpoints + * @param array|null $queryParameters + * @param list|null $transformation + * @param TransformationPosition|value-of|null $transformationPosition + * @param list|null $deviceBreakpoints + * @param list|null $imageBreakpoints */ public static function with( string $src, diff --git a/src/ImageOverlay.php b/src/ImageOverlay.php index c28b14d4..8fb0f134 100644 --- a/src/ImageOverlay.php +++ b/src/ImageOverlay.php @@ -88,10 +88,10 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param OverlayPositionShape $position - * @param OverlayTimingShape $timing - * @param Encoding|value-of $encoding - * @param list $transformation + * @param OverlayPosition|OverlayPositionShape|null $position + * @param OverlayTiming|OverlayTimingShape|null $timing + * @param Encoding|value-of|null $encoding + * @param list|null $transformation */ public static function with( string $input, @@ -113,7 +113,7 @@ public static function with( } /** - * @param OverlayPositionShape $position + * @param OverlayPosition|OverlayPositionShape $position */ public function withPosition(OverlayPosition|array $position): self { @@ -124,7 +124,7 @@ public function withPosition(OverlayPosition|array $position): self } /** - * @param OverlayTimingShape $timing + * @param OverlayTiming|OverlayTimingShape $timing */ public function withTiming(OverlayTiming|array $timing): self { diff --git a/src/OverlayPosition.php b/src/OverlayPosition.php index 9217b318..85643d2a 100644 --- a/src/OverlayPosition.php +++ b/src/OverlayPosition.php @@ -59,9 +59,9 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Focus|value-of $focus - * @param XShape $x - * @param YShape $y + * @param Focus|value-of|null $focus + * @param XShape|null $x + * @param YShape|null $y */ public static function with( Focus|string|null $focus = null, diff --git a/src/OverlayTiming.php b/src/OverlayTiming.php index 73aa0430..c2e4069d 100644 --- a/src/OverlayTiming.php +++ b/src/OverlayTiming.php @@ -60,9 +60,9 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param DurationShape $duration - * @param EndShape $end - * @param StartShape $start + * @param DurationShape|null $duration + * @param EndShape|null $end + * @param StartShape|null $start */ public static function with( float|string|null $duration = null, diff --git a/src/SolidColorOverlay.php b/src/SolidColorOverlay.php index afe0b228..6d9bab73 100644 --- a/src/SolidColorOverlay.php +++ b/src/SolidColorOverlay.php @@ -77,9 +77,9 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param OverlayPositionShape $position - * @param OverlayTimingShape $timing - * @param list $transformation + * @param OverlayPosition|OverlayPositionShape|null $position + * @param OverlayTiming|OverlayTimingShape|null $timing + * @param list|null $transformation */ public static function with( string $color, @@ -99,7 +99,7 @@ public static function with( } /** - * @param OverlayPositionShape $position + * @param OverlayPosition|OverlayPositionShape $position */ public function withPosition(OverlayPosition|array $position): self { @@ -110,7 +110,7 @@ public function withPosition(OverlayPosition|array $position): self } /** - * @param OverlayTimingShape $timing + * @param OverlayTiming|OverlayTimingShape $timing */ public function withTiming(OverlayTiming|array $timing): self { diff --git a/src/SolidColorOverlayTransformation.php b/src/SolidColorOverlayTransformation.php index c058f903..dc50ecb7 100644 --- a/src/SolidColorOverlayTransformation.php +++ b/src/SolidColorOverlayTransformation.php @@ -80,10 +80,10 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param GradientShape $gradient - * @param HeightShape $height - * @param RadiusShape $radius - * @param WidthShape $width + * @param GradientShape|null $gradient + * @param HeightShape|null $height + * @param RadiusShape|null $radius + * @param WidthShape|null $width */ public static function with( ?float $alpha = null, diff --git a/src/SrcOptions.php b/src/SrcOptions.php index 81238d4e..c24f759a 100644 --- a/src/SrcOptions.php +++ b/src/SrcOptions.php @@ -115,9 +115,9 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param array $queryParameters - * @param list $transformation - * @param TransformationPosition|value-of $transformationPosition + * @param array|null $queryParameters + * @param list|null $transformation + * @param TransformationPosition|value-of|null $transformationPosition */ public static function with( string $src, diff --git a/src/SubtitleOverlay.php b/src/SubtitleOverlay.php index 8eea4b63..5748c191 100644 --- a/src/SubtitleOverlay.php +++ b/src/SubtitleOverlay.php @@ -88,10 +88,10 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param OverlayPositionShape $position - * @param OverlayTimingShape $timing - * @param Encoding|value-of $encoding - * @param list $transformation + * @param OverlayPosition|OverlayPositionShape|null $position + * @param OverlayTiming|OverlayTimingShape|null $timing + * @param Encoding|value-of|null $encoding + * @param list|null $transformation */ public static function with( string $input, @@ -113,7 +113,7 @@ public static function with( } /** - * @param OverlayPositionShape $position + * @param OverlayPosition|OverlayPositionShape $position */ public function withPosition(OverlayPosition|array $position): self { @@ -124,7 +124,7 @@ public function withPosition(OverlayPosition|array $position): self } /** - * @param OverlayTimingShape $timing + * @param OverlayTiming|OverlayTimingShape $timing */ public function withTiming(OverlayTiming|array $timing): self { diff --git a/src/SubtitleOverlayTransformation.php b/src/SubtitleOverlayTransformation.php index 375c0568..9cbd6b15 100644 --- a/src/SubtitleOverlayTransformation.php +++ b/src/SubtitleOverlayTransformation.php @@ -97,7 +97,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Typography|value-of $typography + * @param Typography|value-of|null $typography */ public static function with( ?string $background = null, diff --git a/src/TextOverlay.php b/src/TextOverlay.php index 342cf13d..66efc691 100644 --- a/src/TextOverlay.php +++ b/src/TextOverlay.php @@ -88,10 +88,10 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param OverlayPositionShape $position - * @param OverlayTimingShape $timing - * @param Encoding|value-of $encoding - * @param list $transformation + * @param OverlayPosition|OverlayPositionShape|null $position + * @param OverlayTiming|OverlayTimingShape|null $timing + * @param Encoding|value-of|null $encoding + * @param list|null $transformation */ public static function with( string $text, @@ -113,7 +113,7 @@ public static function with( } /** - * @param OverlayPositionShape $position + * @param OverlayPosition|OverlayPositionShape $position */ public function withPosition(OverlayPosition|array $position): self { @@ -124,7 +124,7 @@ public function withPosition(OverlayPosition|array $position): self } /** - * @param OverlayTimingShape $timing + * @param OverlayTiming|OverlayTimingShape $timing */ public function withTiming(OverlayTiming|array $timing): self { diff --git a/src/TextOverlayTransformation.php b/src/TextOverlayTransformation.php index 61dc7d43..e459aeae 100644 --- a/src/TextOverlayTransformation.php +++ b/src/TextOverlayTransformation.php @@ -144,14 +144,14 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param Flip|value-of $flip - * @param FontSizeShape $fontSize - * @param InnerAlignment|value-of $innerAlignment - * @param LineHeightShape $lineHeight - * @param PaddingShape $padding - * @param RadiusShape $radius - * @param RotationShape $rotation - * @param WidthShape $width + * @param Flip|value-of|null $flip + * @param FontSizeShape|null $fontSize + * @param InnerAlignment|value-of|null $innerAlignment + * @param LineHeightShape|null $lineHeight + * @param PaddingShape|null $padding + * @param RadiusShape|null $radius + * @param RotationShape|null $rotation + * @param WidthShape|null $width */ public static function with( ?float $alpha = null, diff --git a/src/Transformation.php b/src/Transformation.php index ad0e496b..64d6a82c 100644 --- a/src/Transformation.php +++ b/src/Transformation.php @@ -73,7 +73,7 @@ * named?: string|null, * opacity?: float|null, * original?: bool|null, - * overlay?: null|Overlay, + * overlay?: mixed, * page?: PageShape|null, * progressive?: bool|null, * quality?: float|null, @@ -521,32 +521,33 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AIDropShadowShape $aiDropShadow - * @param AspectRatioShape $aspectRatio - * @param AudioCodec|value-of $audioCodec - * @param Crop|value-of $crop - * @param CropMode|value-of $cropMode - * @param DurationShape $duration - * @param EndOffsetShape $endOffset - * @param Flip|value-of $flip - * @param Format|value-of $format - * @param GradientShape $gradient - * @param HeightShape $height - * @param PageShape $page - * @param RadiusShape $radius - * @param RotationShape $rotation - * @param ShadowShape $shadow - * @param SharpenShape $sharpen - * @param StartOffsetShape $startOffset - * @param list> $streamingResolutions - * @param TrimShape $trim - * @param UnsharpMaskShape $unsharpMask - * @param VideoCodec|value-of $videoCodec - * @param WidthShape $width - * @param XShape $x - * @param XCenterShape $xCenter - * @param YShape $y - * @param YCenterShape $yCenter + * @param AIDropShadowShape|null $aiDropShadow + * @param AspectRatioShape|null $aspectRatio + * @param AudioCodec|value-of|null $audioCodec + * @param Crop|value-of|null $crop + * @param CropMode|value-of|null $cropMode + * @param DurationShape|null $duration + * @param EndOffsetShape|null $endOffset + * @param Flip|value-of|null $flip + * @param Format|value-of|null $format + * @param GradientShape|null $gradient + * @param HeightShape|null $height + * @param mixed $overlay + * @param PageShape|null $page + * @param RadiusShape|null $radius + * @param RotationShape|null $rotation + * @param ShadowShape|null $shadow + * @param SharpenShape|null $sharpen + * @param StartOffsetShape|null $startOffset + * @param list>|null $streamingResolutions + * @param TrimShape|null $trim + * @param UnsharpMaskShape|null $unsharpMask + * @param VideoCodec|value-of|null $videoCodec + * @param WidthShape|null $width + * @param XShape|null $x + * @param XCenterShape|null $xCenter + * @param YShape|null $y + * @param YCenterShape|null $yCenter */ public static function with( ?string $aiChangeBackground = null, @@ -1092,6 +1093,8 @@ public function withOriginal(bool $original): self * Specifies an overlay to be applied on the parent image or video. * ImageKit supports overlays including images, text, videos, subtitles, and solid colors. * See [Overlay using layers](https://imagekit.io/docs/transformations#overlay-using-layers). + * + * @param mixed $overlay */ public function withOverlay(Overlay $overlay): self { diff --git a/src/VideoOverlay.php b/src/VideoOverlay.php index 8cffe6cd..da8e38b2 100644 --- a/src/VideoOverlay.php +++ b/src/VideoOverlay.php @@ -88,10 +88,10 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param OverlayPositionShape $position - * @param OverlayTimingShape $timing - * @param Encoding|value-of $encoding - * @param list $transformation + * @param OverlayPosition|OverlayPositionShape|null $position + * @param OverlayTiming|OverlayTimingShape|null $timing + * @param Encoding|value-of|null $encoding + * @param list|null $transformation */ public static function with( string $input, @@ -113,7 +113,7 @@ public static function with( } /** - * @param OverlayPositionShape $position + * @param OverlayPosition|OverlayPositionShape $position */ public function withPosition(OverlayPosition|array $position): self { @@ -124,7 +124,7 @@ public function withPosition(OverlayPosition|array $position): self } /** - * @param OverlayTimingShape $timing + * @param OverlayTiming|OverlayTimingShape $timing */ public function withTiming(OverlayTiming|array $timing): self { diff --git a/src/Webhooks/UploadPostTransformErrorEvent.php b/src/Webhooks/UploadPostTransformErrorEvent.php index b941f851..fcb9b748 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent.php +++ b/src/Webhooks/UploadPostTransformErrorEvent.php @@ -84,8 +84,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param DataShape $data - * @param RequestShape $request + * @param Data|DataShape $data + * @param Request|RequestShape $request */ public static function with( string $id, @@ -139,7 +139,7 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self } /** - * @param DataShape $data + * @param Data|DataShape $data */ public function withData(Data|array $data): self { @@ -150,7 +150,7 @@ public function withData(Data|array $data): self } /** - * @param RequestShape $request + * @param Request|RequestShape $request */ public function withRequest(Request|array $request): self { diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data.php b/src/Webhooks/UploadPostTransformErrorEvent/Data.php index a2266030..967ab2fc 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Data.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data.php @@ -81,7 +81,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param TransformationShape $transformation + * @param Transformation|TransformationShape $transformation */ public static function with( string $fileID, @@ -135,7 +135,7 @@ public function withPath(string $path): self } /** - * @param TransformationShape $transformation + * @param Transformation|TransformationShape $transformation */ public function withTransformation( Transformation|array $transformation diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php index eed2e59c..82e3d615 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php @@ -46,7 +46,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param ErrorShape $error + * @param Error|ErrorShape $error */ public static function with(Error|array $error): self { @@ -58,7 +58,7 @@ public static function with(Error|array $error): self } /** - * @param ErrorShape $error + * @param Error|ErrorShape $error */ public function withError(Error|array $error): self { diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request.php b/src/Webhooks/UploadPostTransformErrorEvent/Request.php index 22c9476d..8477ea9b 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request.php @@ -54,7 +54,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param TransformationShape $transformation + * @param Transformation|TransformationShape $transformation */ public static function with( Transformation|array $transformation, @@ -69,7 +69,7 @@ public static function with( } /** - * @param TransformationShape $transformation + * @param Transformation|TransformationShape $transformation */ public function withTransformation( Transformation|array $transformation diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php index 536fa6f0..7e7703d6 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php @@ -70,7 +70,7 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Type|value-of $type - * @param Protocol|value-of $protocol + * @param Protocol|value-of|null $protocol */ public static function with( Type|string $type, diff --git a/src/Webhooks/UploadPostTransformSuccessEvent.php b/src/Webhooks/UploadPostTransformSuccessEvent.php index 04a56f85..69cab6d2 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent.php @@ -84,8 +84,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param DataShape $data - * @param RequestShape $request + * @param Data|DataShape $data + * @param Request|RequestShape $request */ public static function with( string $id, @@ -139,7 +139,7 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self } /** - * @param DataShape $data + * @param Data|DataShape $data */ public function withData(Data|array $data): self { @@ -150,7 +150,7 @@ public function withData(Data|array $data): self } /** - * @param RequestShape $request + * @param Request|RequestShape $request */ public function withRequest(Request|array $request): self { diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request.php index ff57b3d5..e8bb182c 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request.php @@ -54,7 +54,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param TransformationShape $transformation + * @param Transformation|TransformationShape $transformation */ public static function with( Transformation|array $transformation, @@ -69,7 +69,7 @@ public static function with( } /** - * @param TransformationShape $transformation + * @param Transformation|TransformationShape $transformation */ public function withTransformation( Transformation|array $transformation diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php index 183e0b92..7d80090b 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php @@ -70,7 +70,7 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Type|value-of $type - * @param Protocol|value-of $protocol + * @param Protocol|value-of|null $protocol */ public static function with( Type|string $type, diff --git a/src/Webhooks/UploadPreTransformErrorEvent.php b/src/Webhooks/UploadPreTransformErrorEvent.php index a629c169..e1640ee7 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent.php +++ b/src/Webhooks/UploadPreTransformErrorEvent.php @@ -84,8 +84,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param DataShape $data - * @param RequestShape $request + * @param Data|DataShape $data + * @param Request|RequestShape $request */ public static function with( string $id, @@ -139,7 +139,7 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self } /** - * @param DataShape $data + * @param Data|DataShape $data */ public function withData(Data|array $data): self { @@ -150,7 +150,7 @@ public function withData(Data|array $data): self } /** - * @param RequestShape $request + * @param Request|RequestShape $request */ public function withRequest(Request|array $request): self { diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data.php b/src/Webhooks/UploadPreTransformErrorEvent/Data.php index 4578f42e..119b3086 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Data.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data.php @@ -60,7 +60,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param TransformationShape $transformation + * @param Transformation|TransformationShape $transformation */ public static function with( string $name, @@ -99,7 +99,7 @@ public function withPath(string $path): self } /** - * @param TransformationShape $transformation + * @param Transformation|TransformationShape $transformation */ public function withTransformation( Transformation|array $transformation diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php index b23ca38e..6ff64881 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php @@ -46,7 +46,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param ErrorShape $error + * @param Error|ErrorShape $error */ public static function with(Error|array $error): self { @@ -58,7 +58,7 @@ public static function with(Error|array $error): self } /** - * @param ErrorShape $error + * @param Error|ErrorShape $error */ public function withError(Error|array $error): self { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent.php b/src/Webhooks/UploadPreTransformSuccessEvent.php index 548d5689..ab508328 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent.php @@ -87,8 +87,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param DataShape $data - * @param RequestShape $request + * @param Data|DataShape $data + * @param Request|RequestShape $request */ public static function with( string $id, @@ -144,7 +144,7 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self /** * Object containing details of a successful upload. * - * @param DataShape $data + * @param Data|DataShape $data */ public function withData(Data|array $data): self { @@ -155,7 +155,7 @@ public function withData(Data|array $data): self } /** - * @param RequestShape $request + * @param Request|RequestShape $request */ public function withRequest(Request|array $request): self { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php index a34f5b45..0351ff48 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php @@ -236,13 +236,13 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param list|null $aiTags - * @param array $customMetadata - * @param array $embeddedMetadata - * @param ExtensionStatusShape $extensionStatus - * @param MetadataShape $metadata - * @param array $selectedFieldsSchema + * @param array|null $customMetadata + * @param array|null $embeddedMetadata + * @param ExtensionStatus|ExtensionStatusShape|null $extensionStatus + * @param Metadata|MetadataShape|null $metadata + * @param array|null $selectedFieldsSchema * @param list|null $tags - * @param VersionInfoShape $versionInfo + * @param VersionInfo|VersionInfoShape|null $versionInfo */ public static function with( ?array $aiTags = null, @@ -405,7 +405,7 @@ public function withEmbeddedMetadata(array $embeddedMetadata): self * * If no extension was requested, then this parameter is not returned. * - * @param ExtensionStatusShape $extensionStatus + * @param ExtensionStatus|ExtensionStatusShape $extensionStatus */ public function withExtensionStatus( ExtensionStatus|array $extensionStatus @@ -485,7 +485,7 @@ public function withIsPublished(bool $isPublished): self /** * Legacy metadata. Send `metadata` in `responseFields` in API request to get metadata in the upload API response. * - * @param MetadataShape $metadata + * @param Metadata|MetadataShape $metadata */ public function withMetadata(Metadata|array $metadata): self { @@ -572,7 +572,7 @@ public function withURL(string $url): self /** * An object containing the file or file version's `id` (versionId) and `name`. * - * @param VersionInfoShape $versionInfo + * @param VersionInfo|VersionInfoShape $versionInfo */ public function withVersionInfo(VersionInfo|array $versionInfo): self { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php index e4c2805e..f5c5515f 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php @@ -59,10 +59,10 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AIAutoDescription|value-of $aiAutoDescription - * @param AwsAutoTagging|value-of $awsAutoTagging - * @param GoogleAutoTagging|value-of $googleAutoTagging - * @param RemoveBg|value-of $removeBg + * @param AIAutoDescription|value-of|null $aiAutoDescription + * @param AwsAutoTagging|value-of|null $awsAutoTagging + * @param GoogleAutoTagging|value-of|null $googleAutoTagging + * @param RemoveBg|value-of|null $removeBg */ public static function with( AIAutoDescription|string|null $aiAutoDescription = null, diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php index f0ddb8b6..1bbceebd 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php @@ -127,10 +127,10 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Type|value-of $type - * @param DefaultValueShape $defaultValue - * @param MaxValueShape $maxValue - * @param MinValueShape $minValue - * @param list $selectOptions + * @param DefaultValueShape|null $defaultValue + * @param MaxValueShape|null $maxValue + * @param MinValueShape|null $minValue + * @param list|null $selectOptions */ public static function with( Type|string $type, diff --git a/src/Webhooks/VideoTransformationAcceptedEvent.php b/src/Webhooks/VideoTransformationAcceptedEvent.php index eff775ad..0708daee 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent.php @@ -87,8 +87,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param DataShape $data - * @param RequestShape $request + * @param Data|DataShape $data + * @param Request|RequestShape $request */ public static function with( string $id, @@ -142,7 +142,7 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self } /** - * @param DataShape $data + * @param Data|DataShape $data */ public function withData(Data|array $data): self { @@ -155,7 +155,7 @@ public function withData(Data|array $data): self /** * Information about the original request that triggered the video transformation. * - * @param RequestShape $request + * @param Request|RequestShape $request */ public function withRequest(Request|array $request): self { diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data.php index cf6bf777..6144343f 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data.php @@ -59,8 +59,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AssetShape $asset - * @param TransformationShape $transformation + * @param Asset|AssetShape $asset + * @param Transformation|TransformationShape $transformation */ public static function with( Asset|array $asset, @@ -77,7 +77,7 @@ public static function with( /** * Information about the source video asset being transformed. * - * @param AssetShape $asset + * @param Asset|AssetShape $asset */ public function withAsset(Asset|array $asset): self { @@ -90,7 +90,7 @@ public function withAsset(Asset|array $asset): self /** * Base information about a video transformation request. * - * @param TransformationShape $transformation + * @param Transformation|TransformationShape $transformation */ public function withTransformation( Transformation|array $transformation diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php index 2ad501f3..bbf46fd8 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php @@ -67,7 +67,7 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Type|value-of $type - * @param OptionsShape $options + * @param Options|OptionsShape|null $options */ public static function with( Type|string $type, @@ -101,7 +101,7 @@ public function withType(Type|string $type): self /** * Configuration options for video transformations. * - * @param OptionsShape $options + * @param Options|OptionsShape $options */ public function withOptions(Options|array $options): self { diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php index b29996bb..43afe77e 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php @@ -92,11 +92,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AudioCodec|value-of $audioCodec - * @param Format|value-of $format - * @param StreamProtocol|value-of $streamProtocol - * @param list $variants - * @param VideoCodec|value-of $videoCodec + * @param AudioCodec|value-of|null $audioCodec + * @param Format|value-of|null $format + * @param StreamProtocol|value-of|null $streamProtocol + * @param list|null $variants + * @param VideoCodec|value-of|null $videoCodec */ public static function with( AudioCodec|string|null $audioCodec = null, diff --git a/src/Webhooks/VideoTransformationErrorEvent.php b/src/Webhooks/VideoTransformationErrorEvent.php index 2d2cb38d..dc637214 100644 --- a/src/Webhooks/VideoTransformationErrorEvent.php +++ b/src/Webhooks/VideoTransformationErrorEvent.php @@ -87,8 +87,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param DataShape $data - * @param RequestShape $request + * @param Data|DataShape $data + * @param Request|RequestShape $request */ public static function with( string $id, @@ -142,7 +142,7 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self } /** - * @param DataShape $data + * @param Data|DataShape $data */ public function withData(Data|array $data): self { @@ -155,7 +155,7 @@ public function withData(Data|array $data): self /** * Information about the original request that triggered the video transformation. * - * @param RequestShape $request + * @param Request|RequestShape $request */ public function withRequest(Request|array $request): self { diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data.php b/src/Webhooks/VideoTransformationErrorEvent/Data.php index 577496b2..833fcc94 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data.php @@ -56,8 +56,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AssetShape $asset - * @param TransformationShape $transformation + * @param Asset|AssetShape $asset + * @param Transformation|TransformationShape $transformation */ public static function with( Asset|array $asset, @@ -74,7 +74,7 @@ public static function with( /** * Information about the source video asset being transformed. * - * @param AssetShape $asset + * @param Asset|AssetShape $asset */ public function withAsset(Asset|array $asset): self { @@ -85,7 +85,7 @@ public function withAsset(Asset|array $asset): self } /** - * @param TransformationShape $transformation + * @param Transformation|TransformationShape $transformation */ public function withTransformation( Transformation|array $transformation diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php index c54846c6..e60cdf18 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php @@ -75,8 +75,8 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Type|value-of $type - * @param ErrorShape $error - * @param OptionsShape $options + * @param Error|ErrorShape|null $error + * @param Options|OptionsShape|null $options */ public static function with( Type|string $type, @@ -112,7 +112,7 @@ public function withType(Type|string $type): self /** * Details about the transformation error. * - * @param ErrorShape $error + * @param Error|ErrorShape $error */ public function withError(Error|array $error): self { @@ -125,7 +125,7 @@ public function withError(Error|array $error): self /** * Configuration options for video transformations. * - * @param OptionsShape $options + * @param Options|OptionsShape $options */ public function withOptions(Options|array $options): self { diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php index 7ec7cdff..f5575323 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php @@ -92,11 +92,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AudioCodec|value-of $audioCodec - * @param Format|value-of $format - * @param StreamProtocol|value-of $streamProtocol - * @param list $variants - * @param VideoCodec|value-of $videoCodec + * @param AudioCodec|value-of|null $audioCodec + * @param Format|value-of|null $format + * @param StreamProtocol|value-of|null $streamProtocol + * @param list|null $variants + * @param VideoCodec|value-of|null $videoCodec */ public static function with( AudioCodec|string|null $audioCodec = null, diff --git a/src/Webhooks/VideoTransformationReadyEvent.php b/src/Webhooks/VideoTransformationReadyEvent.php index 0b589acb..9e187ed0 100644 --- a/src/Webhooks/VideoTransformationReadyEvent.php +++ b/src/Webhooks/VideoTransformationReadyEvent.php @@ -97,9 +97,9 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param DataShape $data - * @param RequestShape $request - * @param TimingsShape $timings + * @param Data|DataShape $data + * @param Request|RequestShape $request + * @param Timings|TimingsShape|null $timings */ public static function with( string $id, @@ -156,7 +156,7 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self } /** - * @param DataShape $data + * @param Data|DataShape $data */ public function withData(Data|array $data): self { @@ -169,7 +169,7 @@ public function withData(Data|array $data): self /** * Information about the original request that triggered the video transformation. * - * @param RequestShape $request + * @param Request|RequestShape $request */ public function withRequest(Request|array $request): self { @@ -182,7 +182,7 @@ public function withRequest(Request|array $request): self /** * Performance metrics for the transformation process. * - * @param TimingsShape $timings + * @param Timings|TimingsShape $timings */ public function withTimings(Timings|array $timings): self { diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data.php b/src/Webhooks/VideoTransformationReadyEvent/Data.php index f71c9a42..826fedb6 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data.php @@ -56,8 +56,8 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AssetShape $asset - * @param TransformationShape $transformation + * @param Asset|AssetShape $asset + * @param Transformation|TransformationShape $transformation */ public static function with( Asset|array $asset, @@ -74,7 +74,7 @@ public static function with( /** * Information about the source video asset being transformed. * - * @param AssetShape $asset + * @param Asset|AssetShape $asset */ public function withAsset(Asset|array $asset): self { @@ -85,7 +85,7 @@ public function withAsset(Asset|array $asset): self } /** - * @param TransformationShape $transformation + * @param Transformation|TransformationShape $transformation */ public function withTransformation( Transformation|array $transformation diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php index cc810c82..ae70d5ad 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php @@ -75,8 +75,8 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param Type|value-of $type - * @param OptionsShape $options - * @param OutputShape $output + * @param Options|OptionsShape|null $options + * @param Output|OutputShape|null $output */ public static function with( Type|string $type, @@ -112,7 +112,7 @@ public function withType(Type|string $type): self /** * Configuration options for video transformations. * - * @param OptionsShape $options + * @param Options|OptionsShape $options */ public function withOptions(Options|array $options): self { @@ -125,7 +125,7 @@ public function withOptions(Options|array $options): self /** * Information about the transformed output video. * - * @param OutputShape $output + * @param Output|OutputShape $output */ public function withOutput(Output|array $output): self { diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php index 25a4e17d..17cd66df 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php @@ -92,11 +92,11 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AudioCodec|value-of $audioCodec - * @param Format|value-of $format - * @param StreamProtocol|value-of $streamProtocol - * @param list $variants - * @param VideoCodec|value-of $videoCodec + * @param AudioCodec|value-of|null $audioCodec + * @param Format|value-of|null $format + * @param StreamProtocol|value-of|null $streamProtocol + * @param list|null $variants + * @param VideoCodec|value-of|null $videoCodec */ public static function with( AudioCodec|string|null $audioCodec = null, diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php index 681e80ad..b7bd9f68 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php @@ -60,7 +60,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param VideoMetadataShape $videoMetadata + * @param VideoMetadata|VideoMetadataShape|null $videoMetadata */ public static function with( string $url, @@ -89,7 +89,7 @@ public function withURL(string $url): self /** * Metadata of the output video file. * - * @param VideoMetadataShape $videoMetadata + * @param VideoMetadata|VideoMetadataShape $videoMetadata */ public function withVideoMetadata(VideoMetadata|array $videoMetadata): self { From e896f2bf3e12423cec0f242ab9c19eb268fd3b87 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 18 Dec 2025 10:53:07 +0000 Subject: [PATCH 108/193] chore(internal): codegen related update --- src/Core/Attributes/Api.php | 66 +++++++ src/Core/Concerns/SdkResponse.php | 29 +++ .../Contracts/ResponseConverter.php | 18 ++ tests/Core/TestModel.php | 181 ++++++++++++++++++ 4 files changed, 294 insertions(+) create mode 100644 src/Core/Attributes/Api.php create mode 100644 src/Core/Concerns/SdkResponse.php create mode 100644 src/Core/Conversion/Contracts/ResponseConverter.php create mode 100644 tests/Core/TestModel.php diff --git a/src/Core/Attributes/Api.php b/src/Core/Attributes/Api.php new file mode 100644 index 00000000..3ed05474 --- /dev/null +++ b/src/Core/Attributes/Api.php @@ -0,0 +1,66 @@ +|Converter|string|null */ + public readonly Converter|string|null $type; + + /** @var array */ + private static array $enumConverters = []; + + /** + * @param class-string|Converter|string|null $type + * @param class-string<\BackedEnum>|Converter|null $enum + * @param class-string|Converter|null $union + * @param class-string|Converter|string|null $list + * @param class-string|Converter|string|null $map + */ + public function __construct( + public readonly ?string $apiName = null, + Converter|string|null $type = null, + Converter|string|null $enum = null, + Converter|string|null $union = null, + Converter|string|null $list = null, + Converter|string|null $map = null, + public readonly bool $nullable = false, + public readonly bool $optional = false, + ) { + $type ??= $union; + if (null !== $list) { + $type ??= new ListOf($list); + } + if (null !== $map) { + $type ??= new MapOf($map); + } + if (null !== $enum) { + $type ??= $enum instanceof Converter ? $enum : $this->getEnumConverter($enum); + } + + $this->type = $type; + } + + /** @property class-string<\BackedEnum> $enum */ + private function getEnumConverter(string $enum): Converter + { + if (!isset(self::$enumConverters[$enum])) { + $converter = new EnumOf(array_column($enum::cases(), 'value')); // @phpstan-ignore-line + self::$enumConverters[$enum] = $converter; + } + + return self::$enumConverters[$enum]; + } +} diff --git a/src/Core/Concerns/SdkResponse.php b/src/Core/Concerns/SdkResponse.php new file mode 100644 index 00000000..ddc05f1f --- /dev/null +++ b/src/Core/Concerns/SdkResponse.php @@ -0,0 +1,29 @@ +_rawResponse = $response; + $instance->__unserialize(Util::decodeContent($response)); // @phpstan-ignore-line + + return $instance; + } + + public function getRawResponse(): ?ResponseInterface + { + return $this->_rawResponse; + } +} diff --git a/src/Core/Conversion/Contracts/ResponseConverter.php b/src/Core/Conversion/Contracts/ResponseConverter.php new file mode 100644 index 00000000..593282df --- /dev/null +++ b/src/Core/Conversion/Contracts/ResponseConverter.php @@ -0,0 +1,18 @@ +> */ + use SdkModel; + + #[Required] + public string $name; + + #[Required('age_years')] + public int $ageYears; + + /** @var list|null */ + #[Optional] + public ?array $friends; + + #[Required] + public ?string $owner; + + /** + * @param list|null $friends + */ + public function __construct( + string $name, + int $ageYears, + ?string $owner, + ?array $friends = null, + ) { + $this->initialize(); + + $this->name = $name; + $this->ageYears = $ageYears; + $this->owner = $owner; + + null != $friends && $this->friends = $friends; + } +} + +/** + * @internal + * + * @coversNothing + */ +#[CoversNothing] +class TestModelTest extends TestCase +{ + #[Test] + public function testBasicGetAndSet(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertEquals(12, $model->ageYears); + + ++$model->ageYears; + $this->assertEquals(13, $model->ageYears); + } + + #[Test] + public function testNullAccess(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertNull($model->owner); + $this->assertNull($model->friends); + } + + #[Test] + public function testArrayGetAndSet(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $model->friends ??= []; + $this->assertEquals([], $model->friends); + $model->friends[] = 'Alice'; + $this->assertEquals(['Alice'], $model->friends); + } + + #[Test] + public function testDiscernsBetweenNullAndUnset(): void + { + $modelUnsetFriends = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $modelNullFriends = new TestModel( + name: 'bob', + ageYears: 12, + owner: null, + ); + $modelNullFriends->friends = null; + + $this->assertEquals(12, $modelUnsetFriends->ageYears); + $this->assertEquals(12, $modelNullFriends->ageYears); + + $this->assertTrue($modelUnsetFriends->offsetExists('ageYears')); + $this->assertTrue($modelNullFriends->offsetExists('ageYears')); + + $this->assertNull($modelUnsetFriends->friends); + $this->assertNull($modelNullFriends->friends); + + $this->assertFalse($modelUnsetFriends->offsetExists('friends')); + $this->assertTrue($modelNullFriends->offsetExists('friends')); + } + + #[Test] + public function testIssetOnOmittedProperties(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertFalse(isset($model->owner)); + $this->assertFalse(isset($model->friends)); + } + + #[Test] + public function testSerializeBasicModel(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: 'Eve', + friends: ['Alice', 'Charlie'], + ); + $this->assertEquals( + '{"name":"Bob","age_years":12,"friends":["Alice","Charlie"],"owner":"Eve"}', + json_encode($model) + ); + } + + #[Test] + public function testSerializeModelWithOmittedProperties(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertEquals( + '{"name":"Bob","age_years":12,"owner":null}', + json_encode($model) + ); + } + + #[Test] + public function testSerializeModelWithExplicitNull(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $model->friends = null; + $this->assertEquals( + '{"name":"Bob","age_years":12,"friends":null,"owner":null}', + json_encode($model) + ); + } +} From 10d85fa72d5cf2e3025f7fafd495f651372ccaa0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 18 Dec 2025 14:12:52 +0000 Subject: [PATCH 109/193] chore(internal): codegen related update --- src/Core/Attributes/Api.php | 66 ------- src/Core/Concerns/SdkResponse.php | 29 --- .../Contracts/ResponseConverter.php | 18 -- tests/Core/TestModel.php | 181 ------------------ 4 files changed, 294 deletions(-) delete mode 100644 src/Core/Attributes/Api.php delete mode 100644 src/Core/Concerns/SdkResponse.php delete mode 100644 src/Core/Conversion/Contracts/ResponseConverter.php delete mode 100644 tests/Core/TestModel.php diff --git a/src/Core/Attributes/Api.php b/src/Core/Attributes/Api.php deleted file mode 100644 index 3ed05474..00000000 --- a/src/Core/Attributes/Api.php +++ /dev/null @@ -1,66 +0,0 @@ -|Converter|string|null */ - public readonly Converter|string|null $type; - - /** @var array */ - private static array $enumConverters = []; - - /** - * @param class-string|Converter|string|null $type - * @param class-string<\BackedEnum>|Converter|null $enum - * @param class-string|Converter|null $union - * @param class-string|Converter|string|null $list - * @param class-string|Converter|string|null $map - */ - public function __construct( - public readonly ?string $apiName = null, - Converter|string|null $type = null, - Converter|string|null $enum = null, - Converter|string|null $union = null, - Converter|string|null $list = null, - Converter|string|null $map = null, - public readonly bool $nullable = false, - public readonly bool $optional = false, - ) { - $type ??= $union; - if (null !== $list) { - $type ??= new ListOf($list); - } - if (null !== $map) { - $type ??= new MapOf($map); - } - if (null !== $enum) { - $type ??= $enum instanceof Converter ? $enum : $this->getEnumConverter($enum); - } - - $this->type = $type; - } - - /** @property class-string<\BackedEnum> $enum */ - private function getEnumConverter(string $enum): Converter - { - if (!isset(self::$enumConverters[$enum])) { - $converter = new EnumOf(array_column($enum::cases(), 'value')); // @phpstan-ignore-line - self::$enumConverters[$enum] = $converter; - } - - return self::$enumConverters[$enum]; - } -} diff --git a/src/Core/Concerns/SdkResponse.php b/src/Core/Concerns/SdkResponse.php deleted file mode 100644 index ddc05f1f..00000000 --- a/src/Core/Concerns/SdkResponse.php +++ /dev/null @@ -1,29 +0,0 @@ -_rawResponse = $response; - $instance->__unserialize(Util::decodeContent($response)); // @phpstan-ignore-line - - return $instance; - } - - public function getRawResponse(): ?ResponseInterface - { - return $this->_rawResponse; - } -} diff --git a/src/Core/Conversion/Contracts/ResponseConverter.php b/src/Core/Conversion/Contracts/ResponseConverter.php deleted file mode 100644 index 593282df..00000000 --- a/src/Core/Conversion/Contracts/ResponseConverter.php +++ /dev/null @@ -1,18 +0,0 @@ -> */ - use SdkModel; - - #[Required] - public string $name; - - #[Required('age_years')] - public int $ageYears; - - /** @var list|null */ - #[Optional] - public ?array $friends; - - #[Required] - public ?string $owner; - - /** - * @param list|null $friends - */ - public function __construct( - string $name, - int $ageYears, - ?string $owner, - ?array $friends = null, - ) { - $this->initialize(); - - $this->name = $name; - $this->ageYears = $ageYears; - $this->owner = $owner; - - null != $friends && $this->friends = $friends; - } -} - -/** - * @internal - * - * @coversNothing - */ -#[CoversNothing] -class TestModelTest extends TestCase -{ - #[Test] - public function testBasicGetAndSet(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $this->assertEquals(12, $model->ageYears); - - ++$model->ageYears; - $this->assertEquals(13, $model->ageYears); - } - - #[Test] - public function testNullAccess(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $this->assertNull($model->owner); - $this->assertNull($model->friends); - } - - #[Test] - public function testArrayGetAndSet(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $model->friends ??= []; - $this->assertEquals([], $model->friends); - $model->friends[] = 'Alice'; - $this->assertEquals(['Alice'], $model->friends); - } - - #[Test] - public function testDiscernsBetweenNullAndUnset(): void - { - $modelUnsetFriends = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $modelNullFriends = new TestModel( - name: 'bob', - ageYears: 12, - owner: null, - ); - $modelNullFriends->friends = null; - - $this->assertEquals(12, $modelUnsetFriends->ageYears); - $this->assertEquals(12, $modelNullFriends->ageYears); - - $this->assertTrue($modelUnsetFriends->offsetExists('ageYears')); - $this->assertTrue($modelNullFriends->offsetExists('ageYears')); - - $this->assertNull($modelUnsetFriends->friends); - $this->assertNull($modelNullFriends->friends); - - $this->assertFalse($modelUnsetFriends->offsetExists('friends')); - $this->assertTrue($modelNullFriends->offsetExists('friends')); - } - - #[Test] - public function testIssetOnOmittedProperties(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $this->assertFalse(isset($model->owner)); - $this->assertFalse(isset($model->friends)); - } - - #[Test] - public function testSerializeBasicModel(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: 'Eve', - friends: ['Alice', 'Charlie'], - ); - $this->assertEquals( - '{"name":"Bob","age_years":12,"friends":["Alice","Charlie"],"owner":"Eve"}', - json_encode($model) - ); - } - - #[Test] - public function testSerializeModelWithOmittedProperties(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $this->assertEquals( - '{"name":"Bob","age_years":12,"owner":null}', - json_encode($model) - ); - } - - #[Test] - public function testSerializeModelWithExplicitNull(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $model->friends = null; - $this->assertEquals( - '{"name":"Bob","age_years":12,"friends":null,"owner":null}', - json_encode($model) - ); - } -} From ce694eea2c03e9b50fb0055980a7789fd2fdaf63 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 5 Jan 2026 04:06:21 +0000 Subject: [PATCH 110/193] chore(internal): codegen related update --- LICENSE | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/LICENSE b/LICENSE index e7a4d160..20278610 100644 --- a/LICENSE +++ b/LICENSE @@ -186,7 +186,7 @@ same "printed page" as the copyright notice for easier identification within third-party archives. - Copyright 2025 Image Kit + Copyright 2026 Image Kit Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. From a29d53f233f62dfccfa69e7487fdf8bc79f19d57 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 7 Jan 2026 02:10:58 +0000 Subject: [PATCH 111/193] chore(internal): refactor auth by moving concern from base client into client --- src/Client.php | 32 ++++++++++++++++++++++ src/Core/BaseClient.php | 35 +++++++++---------------- src/Core/Concerns/SdkPage.php | 4 ++- src/Core/Contracts/BasePage.php | 4 +-- src/Core/Implementation/RawResponse.php | 6 ++--- src/RequestOptions.php | 8 +++--- 6 files changed, 56 insertions(+), 33 deletions(-) diff --git a/src/Client.php b/src/Client.php index 950d49e4..6a5d4c88 100644 --- a/src/Client.php +++ b/src/Client.php @@ -17,6 +17,10 @@ use Imagekit\Services\FoldersService; use Imagekit\Services\WebhooksService; +/** + * @phpstan-import-type NormalizedRequest from \Imagekit\Core\BaseClient + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ class Client extends BaseClient { public string $privateKey; @@ -123,4 +127,32 @@ protected function authHeaders(): array return ['Authorization' => "Basic {$base64_credentials}"]; } + + /** + * @internal + * + * @param string|list $path + * @param array $query + * @param array|null> $headers + * @param RequestOpts|null $opts + * + * @return array{NormalizedRequest, RequestOptions} + */ + protected function buildRequest( + string $method, + string|array $path, + array $query, + array $headers, + mixed $body, + RequestOptions|array|null $opts, + ): array { + return parent::buildRequest( + method: $method, + path: $path, + query: $query, + headers: [...$this->authHeaders(), ...$headers], + body: $body, + opts: $opts, + ); + } } diff --git a/src/Core/BaseClient.php b/src/Core/BaseClient.php index d9c469a1..7a4436d6 100644 --- a/src/Core/BaseClient.php +++ b/src/Core/BaseClient.php @@ -14,16 +14,14 @@ use Imagekit\Core\Implementation\RawResponse; use Imagekit\RequestOptions; use Psr\Http\Client\ClientExceptionInterface; -use Psr\Http\Client\ClientInterface; -use Psr\Http\Message\RequestFactoryInterface; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; -use Psr\Http\Message\StreamFactoryInterface; -use Psr\Http\Message\UriFactoryInterface; use Psr\Http\Message\UriInterface; /** - * @phpstan-type normalized_request = array{ + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * + * @phpstan-type NormalizedRequest = array{ * method: string, * path: string, * query: array, @@ -80,6 +78,7 @@ public function request( $request = $opts->requestFactory->createRequest($method, uri: $uri); $request = Util::withSetHeaders($request, headers: $headers); + $request = $this->transformRequest($request); // @phpstan-ignore-next-line argument.type $rsp = $this->sendRequest($opts, req: $request, data: $data, redirectCount: 0, retryCount: 0); @@ -88,9 +87,6 @@ public function request( return new RawResponse(client: $this, request: $request, response: $rsp, options: $opts, requestInfo: $req, unwrap: $unwrap, stream: $stream, page: $page, convert: $convert ?? 'null'); } - /** @return array */ - abstract protected function authHeaders(): array; - /** * @internal */ @@ -107,21 +103,9 @@ protected function generateIdempotencyKey(): string * @param string|list $path * @param array $query * @param array|null> $headers - * @param array{ - * timeout?: float|null, - * maxRetries?: int|null, - * initialRetryDelay?: float|null, - * maxRetryDelay?: float|null, - * extraHeaders?: array|null>|null, - * extraQueryParams?: array|null, - * extraBodyParams?: mixed, - * transporter?: ClientInterface|null, - * uriFactory?: UriFactoryInterface|null, - * streamFactory?: StreamFactoryInterface|null, - * requestFactory?: RequestFactoryInterface|null, - * }|null $opts + * @param RequestOpts|null $opts * - * @return array{normalized_request, RequestOptions} + * @return array{NormalizedRequest, RequestOptions} */ protected function buildRequest( string $method, @@ -148,7 +132,6 @@ protected function buildRequest( /** @var array|null> $mergedHeaders */ $mergedHeaders = [ ...$this->headers, - ...$this->authHeaders(), ...$headers, ...($options->extraHeaders ?? []), ...$idempotencyHeaders, @@ -159,6 +142,12 @@ protected function buildRequest( return [$req, $options]; } + protected function transformRequest( + RequestInterface $request + ): RequestInterface { + return $request; + } + /** * @internal */ diff --git a/src/Core/Concerns/SdkPage.php b/src/Core/Concerns/SdkPage.php index 557b46f6..ed45df89 100644 --- a/src/Core/Concerns/SdkPage.php +++ b/src/Core/Concerns/SdkPage.php @@ -12,6 +12,8 @@ use Imagekit\RequestOptions; /** + * @phpstan-import-type NormalizedRequest from \Imagekit\Core\BaseClient + * * @internal * * @template Item @@ -94,7 +96,7 @@ public function pagingEachItem(): \Generator /** * @internal * - * @return array{normalized_request, RequestOptions} + * @return array{NormalizedRequest, RequestOptions} */ abstract protected function nextRequest(): ?array; } diff --git a/src/Core/Contracts/BasePage.php b/src/Core/Contracts/BasePage.php index 76ad6fb2..b2a776d8 100644 --- a/src/Core/Contracts/BasePage.php +++ b/src/Core/Contracts/BasePage.php @@ -5,9 +5,9 @@ namespace Imagekit\Core\Contracts; /** - * @internal + * @phpstan-import-type NormalizedRequest from \Imagekit\Core\BaseClient * - * @phpstan-import-type normalized_request from \Imagekit\Core\BaseClient + * @internal * * @template Item * diff --git a/src/Core/Implementation/RawResponse.php b/src/Core/Implementation/RawResponse.php index 110ce25d..7fdbe87d 100644 --- a/src/Core/Implementation/RawResponse.php +++ b/src/Core/Implementation/RawResponse.php @@ -14,13 +14,13 @@ use Psr\Http\Message\ResponseInterface; /** + * @phpstan-import-type NormalizedRequest from \Imagekit\Core\BaseClient + * * @internal * * @template R * * @implements BaseResponse - * - * @phpstan-import-type normalized_request from \Imagekit\Core\BaseClient */ class RawResponse implements BaseResponse { @@ -35,7 +35,7 @@ class RawResponse implements BaseResponse private bool $coerced = false; /** - * @param normalized_request $requestInfo + * @param NormalizedRequest $requestInfo * @param list|string|int|null $unwrap */ public function __construct( diff --git a/src/RequestOptions.php b/src/RequestOptions.php index 53077bba..dd936ede 100644 --- a/src/RequestOptions.php +++ b/src/RequestOptions.php @@ -17,7 +17,7 @@ use const Imagekit\Core\OMIT as omit; /** - * @phpstan-type request_options = array{ + * @phpstan-type RequestOptionShape = array{ * timeout?: float|null, * maxRetries?: int|null, * initialRetryDelay?: float|null, @@ -30,11 +30,11 @@ * streamFactory?: StreamFactoryInterface|null, * requestFactory?: RequestFactoryInterface|null, * } - * @phpstan-type request_opts = null|RequestOptions|request_options + * @phpstan-type RequestOpts = null|RequestOptions|RequestOptionShape */ final class RequestOptions implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; #[Property] @@ -78,7 +78,7 @@ public function __construct() } /** - * @param request_opts|null $options + * @param RequestOpts|null $options */ public static function parse(RequestOptions|array|null ...$options): self { From a48eabf27bc0717621987efcace7886a9611e10b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 7 Jan 2026 08:21:21 +0000 Subject: [PATCH 112/193] feat: simplify and make the phpstan types more consistent --- src/Accounts/Origins/OriginRequest.php | 3 +- src/Accounts/Origins/OriginResponse.php | 3 +- .../URLEndpoints/URLEndpointCreateParams.php | 3 + .../URLEndpointCreateParams/URLRewriter.php | 3 +- .../URLEndpoints/URLEndpointRequest.php | 3 + .../URLEndpointRequest/URLRewriter.php | 3 +- .../URLEndpoints/URLEndpointResponse.php | 3 + .../URLEndpointResponse/URLRewriter.php | 3 +- .../URLEndpoints/URLEndpointUpdateParams.php | 3 + .../URLEndpointUpdateParams/URLRewriter.php | 3 +- src/Assets/AssetListResponseItem.php | 3 +- src/Beta/V2/Files/FileUploadParams.php | 6 +- .../Files/FileUploadParams/Transformation.php | 7 +- .../FileUploadParams/Transformation/Post.php | 3 +- src/Beta/V2/Files/FileUploadResponse.php | 12 ++-- .../SelectedFieldsSchema.php | 12 +++- .../SelectedFieldsSchema/DefaultValue.php | 3 +- .../DefaultValue/Mixed_.php | 3 +- .../SelectedFieldsSchema/MaxValue.php | 3 +- .../SelectedFieldsSchema/MinValue.php | 3 +- .../SelectedFieldsSchema/SelectOption.php | 3 +- src/Client.php | 2 +- .../CustomMetadataField/Schema.php | 12 +++- .../Schema/DefaultValue.php | 3 +- .../Schema/DefaultValue/Mixed_.php | 3 +- .../CustomMetadataField/Schema/MaxValue.php | 3 +- .../CustomMetadataField/Schema/MinValue.php | 3 +- .../Schema/SelectOption.php | 3 +- .../Schema.php | 12 +++- .../Schema/DefaultValue.php | 3 +- .../Schema/DefaultValue/Mixed_.php | 3 +- .../Schema/MaxValue.php | 3 +- .../Schema/MinValue.php | 3 +- .../Schema/SelectOption.php | 3 +- .../Schema.php | 12 +++- .../Schema/DefaultValue.php | 3 +- .../Schema/DefaultValue/Mixed_.php | 3 +- .../Schema/MaxValue.php | 3 +- .../Schema/MinValue.php | 3 +- .../Schema/SelectOption.php | 3 +- src/ExtensionItem.php | 3 +- src/Files/File.php | 12 ++-- src/Files/File/SelectedFieldsSchema.php | 12 +++- .../SelectedFieldsSchema/DefaultValue.php | 3 +- .../DefaultValue/Mixed_.php | 3 +- .../File/SelectedFieldsSchema/MaxValue.php | 3 +- .../File/SelectedFieldsSchema/MinValue.php | 3 +- .../SelectedFieldsSchema/SelectOption.php | 3 +- src/Files/FileUpdateParams.php | 9 ++- src/Files/FileUpdateParams/RemoveAITags.php | 3 +- src/Files/FileUpdateResponse.php | 12 ++-- src/Files/FileUploadParams.php | 6 +- src/Files/FileUploadParams/Transformation.php | 7 +- .../FileUploadParams/Transformation/Post.php | 3 +- src/Files/FileUploadResponse.php | 12 ++-- .../SelectedFieldsSchema.php | 12 +++- .../SelectedFieldsSchema/DefaultValue.php | 3 +- .../DefaultValue/Mixed_.php | 3 +- .../SelectedFieldsSchema/MaxValue.php | 3 +- .../SelectedFieldsSchema/MinValue.php | 3 +- .../SelectedFieldsSchema/SelectOption.php | 3 +- src/Files/UpdateFileRequest.php | 3 +- .../UpdateFileRequest/UpdateFileDetails.php | 9 ++- .../UpdateFileDetails/RemoveAITags.php | 3 +- src/Overlay.php | 5 +- src/OverlayPosition.php | 6 ++ src/OverlayPosition/X.php | 3 +- src/OverlayPosition/Y.php | 3 +- src/OverlayTiming.php | 9 +++ src/OverlayTiming/Duration.php | 3 +- src/OverlayTiming/End.php | 3 +- src/OverlayTiming/Start.php | 3 +- .../Accounts/OriginsContract.php | 21 ++++-- .../Accounts/OriginsRawContract.php | 21 ++++-- .../Accounts/URLEndpointsContract.php | 34 +++++++--- .../Accounts/URLEndpointsRawContract.php | 21 ++++-- .../Accounts/UsageContract.php | 6 +- .../Accounts/UsageRawContract.php | 6 +- src/ServiceContracts/AssetsContract.php | 18 ++++-- src/ServiceContracts/AssetsRawContract.php | 6 +- .../Beta/V2/FilesContract.php | 19 ++++-- .../Beta/V2/FilesRawContract.php | 6 +- .../Cache/InvalidationContract.php | 9 ++- .../Cache/InvalidationRawContract.php | 9 ++- .../CustomMetadataFieldsContract.php | 44 ++++++------- .../CustomMetadataFieldsRawContract.php | 15 +++-- src/ServiceContracts/Files/BulkContract.php | 15 +++-- .../Files/BulkRawContract.php | 15 +++-- .../Files/MetadataContract.php | 9 ++- .../Files/MetadataRawContract.php | 9 ++- .../Files/VersionsContract.php | 15 +++-- .../Files/VersionsRawContract.php | 15 +++-- src/ServiceContracts/FilesContract.php | 50 +++++++++------ src/ServiceContracts/FilesRawContract.php | 24 +++++-- src/ServiceContracts/Folders/JobContract.php | 6 +- .../Folders/JobRawContract.php | 6 +- src/ServiceContracts/FoldersContract.php | 18 ++++-- src/ServiceContracts/FoldersRawContract.php | 18 ++++-- src/Services/Accounts/OriginsRawService.php | 22 +++++-- src/Services/Accounts/OriginsService.php | 22 +++++-- .../Accounts/URLEndpointsRawService.php | 28 +++++--- src/Services/Accounts/URLEndpointsService.php | 35 +++++++--- src/Services/Accounts/UsageRawService.php | 6 +- src/Services/Accounts/UsageService.php | 6 +- src/Services/AssetsRawService.php | 10 ++- src/Services/AssetsService.php | 18 ++++-- src/Services/Beta/V2/FilesRawService.php | 15 +++-- src/Services/Beta/V2/FilesService.php | 19 ++++-- src/Services/Cache/InvalidationRawService.php | 9 ++- src/Services/Cache/InvalidationService.php | 9 ++- .../CustomMetadataFieldsRawService.php | 42 +++++------- src/Services/CustomMetadataFieldsService.php | 44 ++++++------- src/Services/Files/BulkRawService.php | 15 +++-- src/Services/Files/BulkService.php | 15 +++-- src/Services/Files/MetadataRawService.php | 9 ++- src/Services/Files/MetadataService.php | 9 ++- src/Services/Files/VersionsRawService.php | 15 +++-- src/Services/Files/VersionsService.php | 15 +++-- src/Services/FilesRawService.php | 42 ++++++++---- src/Services/FilesService.php | 50 +++++++++------ src/Services/Folders/JobRawService.php | 6 +- src/Services/Folders/JobService.php | 6 +- src/Services/FoldersRawService.php | 18 ++++-- src/Services/FoldersService.php | 18 ++++-- src/SolidColorOverlay.php | 6 +- src/SolidColorOverlayTransformation.php | 12 +++- .../Gradient.php | 3 +- .../Height.php | 3 +- .../Radius.php | 3 +- src/SolidColorOverlayTransformation/Width.php | 3 +- src/SubtitleOverlay.php | 6 +- src/TextOverlay.php | 6 +- src/TextOverlayTransformation.php | 18 +++++- src/TextOverlayTransformation/FontSize.php | 3 +- src/TextOverlayTransformation/LineHeight.php | 3 +- src/TextOverlayTransformation/Padding.php | 3 +- src/TextOverlayTransformation/Radius.php | 3 +- src/TextOverlayTransformation/Rotation.php | 3 +- src/TextOverlayTransformation/Width.php | 3 +- src/Transformation.php | 64 +++++++++++++++++-- src/Transformation/AIDropShadow.php | 3 +- src/Transformation/AspectRatio.php | 3 +- src/Transformation/Duration.php | 3 +- src/Transformation/EndOffset.php | 3 +- src/Transformation/Gradient.php | 3 +- src/Transformation/Height.php | 3 +- src/Transformation/Page.php | 3 +- src/Transformation/Radius.php | 3 +- src/Transformation/Rotation.php | 3 +- src/Transformation/Shadow.php | 3 +- src/Transformation/Sharpen.php | 3 +- src/Transformation/StartOffset.php | 3 +- src/Transformation/Trim.php | 3 +- src/Transformation/UnsharpMask.php | 3 +- src/Transformation/Width.php | 3 +- src/Transformation/X.php | 3 +- src/Transformation/XCenter.php | 3 +- src/Transformation/Y.php | 3 +- src/Transformation/YCenter.php | 3 +- src/Webhooks/UnsafeUnwrapWebhookEvent.php | 3 +- src/Webhooks/UnwrapWebhookEvent.php | 3 +- .../UploadPreTransformSuccessEvent/Data.php | 12 ++-- .../Data/SelectedFieldsSchema.php | 12 +++- .../SelectedFieldsSchema/DefaultValue.php | 3 +- .../DefaultValue/Mixed_.php | 3 +- .../Data/SelectedFieldsSchema/MaxValue.php | 3 +- .../Data/SelectedFieldsSchema/MinValue.php | 3 +- .../SelectedFieldsSchema/SelectOption.php | 3 +- 168 files changed, 1042 insertions(+), 482 deletions(-) diff --git a/src/Accounts/Origins/OriginRequest.php b/src/Accounts/Origins/OriginRequest.php index ddf412ca..3bcb4559 100644 --- a/src/Accounts/Origins/OriginRequest.php +++ b/src/Accounts/Origins/OriginRequest.php @@ -28,7 +28,8 @@ * @phpstan-import-type AzureBlobStorageShape from \Imagekit\Accounts\Origins\OriginRequest\AzureBlobStorage * @phpstan-import-type AkeneoPimShape from \Imagekit\Accounts\Origins\OriginRequest\AkeneoPim * - * @phpstan-type OriginRequestShape = S3Shape|S3CompatibleShape|CloudinaryBackupShape|WebFolderShape|WebProxyShape|GoogleCloudStorageGcsShape|AzureBlobStorageShape|AkeneoPimShape + * @phpstan-type OriginRequestVariants = S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|GoogleCloudStorageGcs|AzureBlobStorage|AkeneoPim + * @phpstan-type OriginRequestShape = OriginRequestVariants|S3Shape|S3CompatibleShape|CloudinaryBackupShape|WebFolderShape|WebProxyShape|GoogleCloudStorageGcsShape|AzureBlobStorageShape|AkeneoPimShape */ final class OriginRequest implements ConverterSource { diff --git a/src/Accounts/Origins/OriginResponse.php b/src/Accounts/Origins/OriginResponse.php index 0f40f023..e810c999 100644 --- a/src/Accounts/Origins/OriginResponse.php +++ b/src/Accounts/Origins/OriginResponse.php @@ -28,7 +28,8 @@ * @phpstan-import-type AzureBlobStorageShape from \Imagekit\Accounts\Origins\OriginResponse\AzureBlobStorage * @phpstan-import-type AkeneoPimShape from \Imagekit\Accounts\Origins\OriginResponse\AkeneoPim * - * @phpstan-type OriginResponseShape = S3Shape|S3CompatibleShape|CloudinaryBackupShape|WebFolderShape|WebProxyShape|GoogleCloudStorageGcsShape|AzureBlobStorageShape|AkeneoPimShape + * @phpstan-type OriginResponseVariants = S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|GoogleCloudStorageGcs|AzureBlobStorage|AkeneoPim + * @phpstan-type OriginResponseShape = OriginResponseVariants|S3Shape|S3CompatibleShape|CloudinaryBackupShape|WebFolderShape|WebProxyShape|GoogleCloudStorageGcsShape|AzureBlobStorageShape|AkeneoPimShape */ final class OriginResponse implements ConverterSource { diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php index 485aac23..6c5ef00f 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php @@ -20,6 +20,7 @@ * * @see Imagekit\Services\Accounts\URLEndpointsService::create() * + * @phpstan-import-type URLRewriterVariants from \Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter * @phpstan-import-type URLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter * * @phpstan-type URLEndpointCreateParamsShape = array{ @@ -57,6 +58,8 @@ final class URLEndpointCreateParams implements BaseModel /** * Configuration for third-party URL rewriting. + * + * @var URLRewriterVariants|null $urlRewriter */ #[Optional(union: URLRewriter::class)] public CloudinaryURLRewriter|ImgixURLRewriter|AkamaiURLRewriter|null $urlRewriter; diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php index 4a339f4d..4d43a5a8 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php @@ -18,7 +18,8 @@ * @phpstan-import-type ImgixURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\ImgixURLRewriter * @phpstan-import-type AkamaiURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\AkamaiURLRewriter * - * @phpstan-type URLRewriterShape = CloudinaryURLRewriterShape|ImgixURLRewriterShape|AkamaiURLRewriterShape + * @phpstan-type URLRewriterVariants = CloudinaryURLRewriter|ImgixURLRewriter|AkamaiURLRewriter + * @phpstan-type URLRewriterShape = URLRewriterVariants|CloudinaryURLRewriterShape|ImgixURLRewriterShape|AkamaiURLRewriterShape */ final class URLRewriter implements ConverterSource { diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest.php b/src/Accounts/URLEndpoints/URLEndpointRequest.php index 3b69a0d9..0960f890 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest.php @@ -16,6 +16,7 @@ /** * Schema for URL endpoint resource. * + * @phpstan-import-type URLRewriterVariants from \Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter * @phpstan-import-type URLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter * * @phpstan-type URLEndpointRequestShape = array{ @@ -52,6 +53,8 @@ final class URLEndpointRequest implements BaseModel /** * Configuration for third-party URL rewriting. + * + * @var URLRewriterVariants|null $urlRewriter */ #[Optional(union: URLRewriter::class)] public CloudinaryURLRewriter|ImgixURLRewriter|AkamaiURLRewriter|null $urlRewriter; diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php index 76a77e9c..a2ab8335 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php @@ -18,7 +18,8 @@ * @phpstan-import-type ImgixURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\ImgixURLRewriter * @phpstan-import-type AkamaiURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\AkamaiURLRewriter * - * @phpstan-type URLRewriterShape = CloudinaryURLRewriterShape|ImgixURLRewriterShape|AkamaiURLRewriterShape + * @phpstan-type URLRewriterVariants = CloudinaryURLRewriter|ImgixURLRewriter|AkamaiURLRewriter + * @phpstan-type URLRewriterShape = URLRewriterVariants|CloudinaryURLRewriterShape|ImgixURLRewriterShape|AkamaiURLRewriterShape */ final class URLRewriter implements ConverterSource { diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse.php b/src/Accounts/URLEndpoints/URLEndpointResponse.php index 39688ade..59467346 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse.php @@ -16,6 +16,7 @@ /** * URL‑endpoint object as returned by the API. * + * @phpstan-import-type URLRewriterVariants from \Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter * @phpstan-import-type URLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter * * @phpstan-type URLEndpointResponseShape = array{ @@ -59,6 +60,8 @@ final class URLEndpointResponse implements BaseModel /** * Configuration for third-party URL rewriting. + * + * @var URLRewriterVariants|null $urlRewriter */ #[Optional(union: URLRewriter::class)] public CloudinaryURLRewriter|ImgixURLRewriter|AkamaiURLRewriter|null $urlRewriter; diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php index 7272c75c..6a6013de 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php @@ -18,7 +18,8 @@ * @phpstan-import-type ImgixURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\ImgixURLRewriter * @phpstan-import-type AkamaiURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\AkamaiURLRewriter * - * @phpstan-type URLRewriterShape = CloudinaryURLRewriterShape|ImgixURLRewriterShape|AkamaiURLRewriterShape + * @phpstan-type URLRewriterVariants = CloudinaryURLRewriter|ImgixURLRewriter|AkamaiURLRewriter + * @phpstan-type URLRewriterShape = URLRewriterVariants|CloudinaryURLRewriterShape|ImgixURLRewriterShape|AkamaiURLRewriterShape */ final class URLRewriter implements ConverterSource { diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php index f87e9241..70da5f96 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php @@ -20,6 +20,7 @@ * * @see Imagekit\Services\Accounts\URLEndpointsService::update() * + * @phpstan-import-type URLRewriterVariants from \Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter * @phpstan-import-type URLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter * * @phpstan-type URLEndpointUpdateParamsShape = array{ @@ -57,6 +58,8 @@ final class URLEndpointUpdateParams implements BaseModel /** * Configuration for third-party URL rewriting. + * + * @var URLRewriterVariants|null $urlRewriter */ #[Optional(union: URLRewriter::class)] public CloudinaryURLRewriter|ImgixURLRewriter|AkamaiURLRewriter|null $urlRewriter; diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php index a6f04904..85afc58b 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php @@ -18,7 +18,8 @@ * @phpstan-import-type ImgixURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\ImgixURLRewriter * @phpstan-import-type AkamaiURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\AkamaiURLRewriter * - * @phpstan-type URLRewriterShape = CloudinaryURLRewriterShape|ImgixURLRewriterShape|AkamaiURLRewriterShape + * @phpstan-type URLRewriterVariants = CloudinaryURLRewriter|ImgixURLRewriter|AkamaiURLRewriter + * @phpstan-type URLRewriterShape = URLRewriterVariants|CloudinaryURLRewriterShape|ImgixURLRewriterShape|AkamaiURLRewriterShape */ final class URLRewriter implements ConverterSource { diff --git a/src/Assets/AssetListResponseItem.php b/src/Assets/AssetListResponseItem.php index 08dba554..6655acdb 100644 --- a/src/Assets/AssetListResponseItem.php +++ b/src/Assets/AssetListResponseItem.php @@ -16,7 +16,8 @@ * @phpstan-import-type FileShape from \Imagekit\Files\File * @phpstan-import-type FolderShape from \Imagekit\Files\Folder * - * @phpstan-type AssetListResponseItemShape = FileShape|FolderShape + * @phpstan-type AssetListResponseItemVariants = File|Folder + * @phpstan-type AssetListResponseItemShape = AssetListResponseItemVariants|FileShape|FolderShape */ final class AssetListResponseItem implements ConverterSource { diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index 43e0de18..7b176e0e 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -12,9 +12,6 @@ use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; use Imagekit\ExtensionItem; -use Imagekit\ExtensionItem\AutoDescriptionExtension; -use Imagekit\ExtensionItem\AutoTaggingExtension; -use Imagekit\ExtensionItem\RemovedotBgExtension; /** * The V2 API enhances security by verifying the entire payload using JWT. This API is in beta. @@ -34,6 +31,7 @@ * * @see Imagekit\Services\Beta\V2\FilesService::upload() * + * @phpstan-import-type ExtensionItemVariants from \Imagekit\ExtensionItem * @phpstan-import-type ExtensionItemShape from \Imagekit\ExtensionItem * @phpstan-import-type TransformationShape from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation * @@ -129,7 +127,7 @@ final class FileUploadParams implements BaseModel /** * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * - * @var list|null $extensions + * @var list|null $extensions */ #[Optional(list: ExtensionItem::class)] public ?array $extensions; diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation.php index 0ced6af6..ba6236ba 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation.php @@ -5,10 +5,6 @@ namespace Imagekit\Beta\V2\Files\FileUploadParams; use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\ConvertGifToVideo; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\SimplePostTransformation; use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -24,6 +20,7 @@ * * You can mix and match any combination of post-processing types. * + * @phpstan-import-type PostVariants from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post * @phpstan-import-type PostShape from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post * * @phpstan-type TransformationShape = array{ @@ -40,7 +37,7 @@ final class Transformation implements BaseModel * Each item must match one of the following types: * `transformation`, `gif-to-video`, `thumbnail`, `abs`. * - * @var list|null $post + * @var list|null $post */ #[Optional(list: Post::class)] public ?array $post; diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php index 8ef59faa..a93f365f 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php @@ -18,7 +18,8 @@ * @phpstan-import-type GenerateAThumbnailShape from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail * @phpstan-import-type AdaptiveBitrateStreamingShape from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming * - * @phpstan-type PostShape = SimplePostTransformationShape|ConvertGifToVideoShape|GenerateAThumbnailShape|AdaptiveBitrateStreamingShape + * @phpstan-type PostVariants = SimplePostTransformation|ConvertGifToVideo|GenerateAThumbnail|AdaptiveBitrateStreaming + * @phpstan-type PostShape = PostVariants|SimplePostTransformationShape|ConvertGifToVideoShape|GenerateAThumbnailShape|AdaptiveBitrateStreamingShape */ final class Post implements ConverterSource { diff --git a/src/Beta/V2/Files/FileUploadResponse.php b/src/Beta/V2/Files/FileUploadResponse.php index b8f93518..b6c1159f 100644 --- a/src/Beta/V2/Files/FileUploadResponse.php +++ b/src/Beta/V2/Files/FileUploadResponse.php @@ -23,7 +23,7 @@ * @phpstan-import-type VersionInfoShape from \Imagekit\Beta\V2\Files\FileUploadResponse\VersionInfo * * @phpstan-type FileUploadResponseShape = array{ - * aiTags?: list|null, + * aiTags?: list|null, * audioCodec?: string|null, * bitRate?: int|null, * customCoordinates?: string|null, @@ -40,7 +40,7 @@ * isPublished?: bool|null, * metadata?: null|Metadata|MetadataShape, * name?: string|null, - * selectedFieldsSchema?: array|null, + * selectedFieldsSchema?: array|null, * size?: float|null, * tags?: list|null, * thumbnailURL?: string|null, @@ -235,12 +235,12 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list|null $aiTags + * @param list|null $aiTags * @param array|null $customMetadata * @param array|null $embeddedMetadata * @param ExtensionStatus|ExtensionStatusShape|null $extensionStatus * @param Metadata|MetadataShape|null $metadata - * @param array|null $selectedFieldsSchema + * @param array|null $selectedFieldsSchema * @param list|null $tags * @param VersionInfo|VersionInfoShape|null $versionInfo */ @@ -305,7 +305,7 @@ public static function with( /** * An array of tags assigned to the uploaded file by auto tagging. * - * @param list|null $aiTags + * @param list|null $aiTags */ public function withAITags(?array $aiTags): self { @@ -513,7 +513,7 @@ public function withName(string $name): self * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @param array $selectedFieldsSchema + * @param array $selectedFieldsSchema */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php index 745732cf..2e26653f 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php @@ -13,6 +13,10 @@ use Imagekit\Core\Contracts\BaseModel; /** + * @phpstan-import-type DefaultValueVariants from \Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue + * @phpstan-import-type MaxValueVariants from \Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\MaxValue + * @phpstan-import-type MinValueVariants from \Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\MinValue + * @phpstan-import-type SelectOptionVariants from \Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\SelectOption * @phpstan-import-type DefaultValueShape from \Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue * @phpstan-import-type MaxValueShape from \Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\MaxValue * @phpstan-import-type MinValueShape from \Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\MinValue @@ -47,7 +51,7 @@ final class SelectedFieldsSchema implements BaseModel /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. * - * @var string|float|bool|list|null $defaultValue + * @var DefaultValueVariants|null $defaultValue */ #[Optional(union: DefaultValue::class)] public string|float|bool|array|null $defaultValue; @@ -66,6 +70,8 @@ final class SelectedFieldsSchema implements BaseModel /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @var MaxValueVariants|null $maxValue */ #[Optional] public string|float|null $maxValue; @@ -78,6 +84,8 @@ final class SelectedFieldsSchema implements BaseModel /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @var MinValueVariants|null $minValue */ #[Optional] public string|float|null $minValue; @@ -91,7 +99,7 @@ final class SelectedFieldsSchema implements BaseModel /** * An array of allowed values when field type is `SingleSelect` or `MultiSelect`. * - * @var list|null $selectOptions + * @var list|null $selectOptions */ #[Optional(list: SelectOption::class)] public ?array $selectOptions; diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php index e7d8babd..ae24e8a4 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php @@ -15,7 +15,8 @@ * * @phpstan-import-type MixedShape from \Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed_ * - * @phpstan-type DefaultValueShape = string|float|bool|list + * @phpstan-type DefaultValueVariants = string|float|bool|list + * @phpstan-type DefaultValueShape = DefaultValueVariants|list */ final class DefaultValue implements ConverterSource { diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php index f463a558..09ea4d35 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php @@ -9,7 +9,8 @@ use Imagekit\Core\Conversion\Contracts\ConverterSource; /** - * @phpstan-type MixedShape = string|float|bool + * @phpstan-type MixedVariants = string|float|bool + * @phpstan-type MixedShape = MixedVariants */ final class Mixed_ implements ConverterSource { diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php index c6fd7e8c..8bfc3ea0 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php @@ -11,7 +11,8 @@ /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. * - * @phpstan-type MaxValueShape = string|float + * @phpstan-type MaxValueVariants = string|float + * @phpstan-type MaxValueShape = MaxValueVariants */ final class MaxValue implements ConverterSource { diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php index 046152bc..3d95e84e 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php @@ -11,7 +11,8 @@ /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. * - * @phpstan-type MinValueShape = string|float + * @phpstan-type MinValueVariants = string|float + * @phpstan-type MinValueShape = MinValueVariants */ final class MinValue implements ConverterSource { diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php index cf02f607..0dd5ef1e 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php @@ -9,7 +9,8 @@ use Imagekit\Core\Conversion\Contracts\ConverterSource; /** - * @phpstan-type SelectOptionShape = string|float|bool + * @phpstan-type SelectOptionVariants = string|float|bool + * @phpstan-type SelectOptionShape = SelectOptionVariants */ final class SelectOption implements ConverterSource { diff --git a/src/Client.php b/src/Client.php index 6a5d4c88..3c4145d5 100644 --- a/src/Client.php +++ b/src/Client.php @@ -18,8 +18,8 @@ use Imagekit\Services\WebhooksService; /** - * @phpstan-import-type NormalizedRequest from \Imagekit\Core\BaseClient * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type NormalizedRequest from \Imagekit\Core\BaseClient */ class Client extends BaseClient { diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema.php b/src/CustomMetadataFields/CustomMetadataField/Schema.php index d79615d3..5d735627 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema.php @@ -15,6 +15,10 @@ /** * An object that describes the rules for the custom metadata field value. * + * @phpstan-import-type DefaultValueVariants from \Imagekit\CustomMetadataFields\CustomMetadataField\Schema\DefaultValue + * @phpstan-import-type MaxValueVariants from \Imagekit\CustomMetadataFields\CustomMetadataField\Schema\MaxValue + * @phpstan-import-type MinValueVariants from \Imagekit\CustomMetadataFields\CustomMetadataField\Schema\MinValue + * @phpstan-import-type SelectOptionVariants from \Imagekit\CustomMetadataFields\CustomMetadataField\Schema\SelectOption * @phpstan-import-type DefaultValueShape from \Imagekit\CustomMetadataFields\CustomMetadataField\Schema\DefaultValue * @phpstan-import-type MaxValueShape from \Imagekit\CustomMetadataFields\CustomMetadataField\Schema\MaxValue * @phpstan-import-type MinValueShape from \Imagekit\CustomMetadataFields\CustomMetadataField\Schema\MinValue @@ -47,7 +51,7 @@ final class Schema implements BaseModel /** * The default value for this custom metadata field. Data type of default value depends on the field type. * - * @var string|float|bool|list|null $defaultValue + * @var DefaultValueVariants|null $defaultValue */ #[Optional(union: DefaultValue::class)] public string|float|bool|array|null $defaultValue; @@ -66,6 +70,8 @@ final class Schema implements BaseModel /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @var MaxValueVariants|null $maxValue */ #[Optional] public string|float|null $maxValue; @@ -78,6 +84,8 @@ final class Schema implements BaseModel /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @var MinValueVariants|null $minValue */ #[Optional] public string|float|null $minValue; @@ -85,7 +93,7 @@ final class Schema implements BaseModel /** * An array of allowed values when field type is `SingleSelect` or `MultiSelect`. * - * @var list|null $selectOptions + * @var list|null $selectOptions */ #[Optional(list: SelectOption::class)] public ?array $selectOptions; diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php index a496c5be..30deb45b 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php @@ -15,7 +15,8 @@ * * @phpstan-import-type MixedShape from \Imagekit\CustomMetadataFields\CustomMetadataField\Schema\DefaultValue\Mixed_ * - * @phpstan-type DefaultValueShape = string|float|bool|list + * @phpstan-type DefaultValueVariants = string|float|bool|list + * @phpstan-type DefaultValueShape = DefaultValueVariants|list */ final class DefaultValue implements ConverterSource { diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed_.php b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed_.php index 0aac49d5..72295b59 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed_.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed_.php @@ -9,7 +9,8 @@ use Imagekit\Core\Conversion\Contracts\ConverterSource; /** - * @phpstan-type MixedShape = string|float|bool + * @phpstan-type MixedVariants = string|float|bool + * @phpstan-type MixedShape = MixedVariants */ final class Mixed_ implements ConverterSource { diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/MaxValue.php b/src/CustomMetadataFields/CustomMetadataField/Schema/MaxValue.php index c3e1a8f8..54e02e2c 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/MaxValue.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/MaxValue.php @@ -11,7 +11,8 @@ /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. * - * @phpstan-type MaxValueShape = string|float + * @phpstan-type MaxValueVariants = string|float + * @phpstan-type MaxValueShape = MaxValueVariants */ final class MaxValue implements ConverterSource { diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/MinValue.php b/src/CustomMetadataFields/CustomMetadataField/Schema/MinValue.php index 0a03e9e5..5092fa45 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/MinValue.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/MinValue.php @@ -11,7 +11,8 @@ /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. * - * @phpstan-type MinValueShape = string|float + * @phpstan-type MinValueVariants = string|float + * @phpstan-type MinValueShape = MinValueVariants */ final class MinValue implements ConverterSource { diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/SelectOption.php b/src/CustomMetadataFields/CustomMetadataField/Schema/SelectOption.php index 0b2a9469..6f518130 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/SelectOption.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/SelectOption.php @@ -9,7 +9,8 @@ use Imagekit\Core\Conversion\Contracts\ConverterSource; /** - * @phpstan-type SelectOptionShape = string|float|bool + * @phpstan-type SelectOptionVariants = string|float|bool + * @phpstan-type SelectOptionShape = SelectOptionVariants */ final class SelectOption implements ConverterSource { diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php index 301005c0..bbb64d6c 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php @@ -13,6 +13,10 @@ use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\Type; /** + * @phpstan-import-type DefaultValueVariants from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\DefaultValue + * @phpstan-import-type MaxValueVariants from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\MaxValue + * @phpstan-import-type MinValueVariants from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\MinValue + * @phpstan-import-type SelectOptionVariants from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\SelectOption * @phpstan-import-type DefaultValueShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\DefaultValue * @phpstan-import-type MaxValueShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\MaxValue * @phpstan-import-type MinValueShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\MinValue @@ -45,7 +49,7 @@ final class Schema implements BaseModel /** * The default value for this custom metadata field. This property is only required if `isValueRequired` property is set to `true`. The value should match the `type` of custom metadata field. * - * @var string|float|bool|list|null $defaultValue + * @var DefaultValueVariants|null $defaultValue */ #[Optional(union: DefaultValue::class)] public string|float|bool|array|null $defaultValue; @@ -64,6 +68,8 @@ final class Schema implements BaseModel /** * Maximum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. + * + * @var MaxValueVariants|null $maxValue */ #[Optional] public string|float|null $maxValue; @@ -76,6 +82,8 @@ final class Schema implements BaseModel /** * Minimum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. + * + * @var MinValueVariants|null $minValue */ #[Optional] public string|float|null $minValue; @@ -83,7 +91,7 @@ final class Schema implements BaseModel /** * An array of allowed values. This property is only required if `type` property is set to `SingleSelect` or `MultiSelect`. * - * @var list|null $selectOptions + * @var list|null $selectOptions */ #[Optional(list: SelectOption::class)] public ?array $selectOptions; diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php index 06e1e8ac..0f1310b5 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php @@ -15,7 +15,8 @@ * * @phpstan-import-type MixedShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\DefaultValue\Mixed_ * - * @phpstan-type DefaultValueShape = string|float|bool|list + * @phpstan-type DefaultValueVariants = string|float|bool|list + * @phpstan-type DefaultValueShape = DefaultValueVariants|list */ final class DefaultValue implements ConverterSource { diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed_.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed_.php index 092774b7..6d480919 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed_.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed_.php @@ -9,7 +9,8 @@ use Imagekit\Core\Conversion\Contracts\ConverterSource; /** - * @phpstan-type MixedShape = string|float|bool + * @phpstan-type MixedVariants = string|float|bool + * @phpstan-type MixedShape = MixedVariants */ final class Mixed_ implements ConverterSource { diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MaxValue.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MaxValue.php index 8228beff..a3d9cd53 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MaxValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MaxValue.php @@ -11,7 +11,8 @@ /** * Maximum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. * - * @phpstan-type MaxValueShape = string|float + * @phpstan-type MaxValueVariants = string|float + * @phpstan-type MaxValueShape = MaxValueVariants */ final class MaxValue implements ConverterSource { diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MinValue.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MinValue.php index 7f93ca06..5bec82f3 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MinValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MinValue.php @@ -11,7 +11,8 @@ /** * Minimum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. * - * @phpstan-type MinValueShape = string|float + * @phpstan-type MinValueVariants = string|float + * @phpstan-type MinValueShape = MinValueVariants */ final class MinValue implements ConverterSource { diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/SelectOption.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/SelectOption.php index 6b25e013..ecdfcbec 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/SelectOption.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/SelectOption.php @@ -9,7 +9,8 @@ use Imagekit\Core\Conversion\Contracts\ConverterSource; /** - * @phpstan-type SelectOptionShape = string|float|bool + * @phpstan-type SelectOptionVariants = string|float|bool + * @phpstan-type SelectOptionShape = SelectOptionVariants */ final class SelectOption implements ConverterSource { diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php index 0d571668..b1137839 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php @@ -13,6 +13,10 @@ /** * An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. * + * @phpstan-import-type DefaultValueVariants from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue + * @phpstan-import-type MaxValueVariants from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\MaxValue + * @phpstan-import-type MinValueVariants from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\MinValue + * @phpstan-import-type SelectOptionVariants from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\SelectOption * @phpstan-import-type DefaultValueShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue * @phpstan-import-type MaxValueShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\MaxValue * @phpstan-import-type MinValueShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\MinValue @@ -36,7 +40,7 @@ final class Schema implements BaseModel /** * The default value for this custom metadata field. This property is only required if `isValueRequired` property is set to `true`. The value should match the `type` of custom metadata field. * - * @var string|float|bool|list|null $defaultValue + * @var DefaultValueVariants|null $defaultValue */ #[Optional(union: DefaultValue::class)] public string|float|bool|array|null $defaultValue; @@ -55,6 +59,8 @@ final class Schema implements BaseModel /** * Maximum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. + * + * @var MaxValueVariants|null $maxValue */ #[Optional] public string|float|null $maxValue; @@ -67,6 +73,8 @@ final class Schema implements BaseModel /** * Minimum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. + * + * @var MinValueVariants|null $minValue */ #[Optional] public string|float|null $minValue; @@ -74,7 +82,7 @@ final class Schema implements BaseModel /** * An array of allowed values. This property is only required if `type` property is set to `SingleSelect` or `MultiSelect`. * - * @var list|null $selectOptions + * @var list|null $selectOptions */ #[Optional(list: SelectOption::class)] public ?array $selectOptions; diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php index d6d2ff02..b294d3ef 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php @@ -15,7 +15,8 @@ * * @phpstan-import-type MixedShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue\Mixed_ * - * @phpstan-type DefaultValueShape = string|float|bool|list + * @phpstan-type DefaultValueVariants = string|float|bool|list + * @phpstan-type DefaultValueShape = DefaultValueVariants|list */ final class DefaultValue implements ConverterSource { diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed_.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed_.php index ecc071c3..197bd44e 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed_.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed_.php @@ -9,7 +9,8 @@ use Imagekit\Core\Conversion\Contracts\ConverterSource; /** - * @phpstan-type MixedShape = string|float|bool + * @phpstan-type MixedVariants = string|float|bool + * @phpstan-type MixedShape = MixedVariants */ final class Mixed_ implements ConverterSource { diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MaxValue.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MaxValue.php index 1b9f96e5..2bfd164c 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MaxValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MaxValue.php @@ -11,7 +11,8 @@ /** * Maximum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. * - * @phpstan-type MaxValueShape = string|float + * @phpstan-type MaxValueVariants = string|float + * @phpstan-type MaxValueShape = MaxValueVariants */ final class MaxValue implements ConverterSource { diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MinValue.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MinValue.php index 5c5c66cf..17b266ea 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MinValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MinValue.php @@ -11,7 +11,8 @@ /** * Minimum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. * - * @phpstan-type MinValueShape = string|float + * @phpstan-type MinValueVariants = string|float + * @phpstan-type MinValueShape = MinValueVariants */ final class MinValue implements ConverterSource { diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/SelectOption.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/SelectOption.php index 8f4e4c8a..a54d7a04 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/SelectOption.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/SelectOption.php @@ -9,7 +9,8 @@ use Imagekit\Core\Conversion\Contracts\ConverterSource; /** - * @phpstan-type SelectOptionShape = string|float|bool + * @phpstan-type SelectOptionVariants = string|float|bool + * @phpstan-type SelectOptionShape = SelectOptionVariants */ final class SelectOption implements ConverterSource { diff --git a/src/ExtensionItem.php b/src/ExtensionItem.php index b657a164..41a1b329 100644 --- a/src/ExtensionItem.php +++ b/src/ExtensionItem.php @@ -16,7 +16,8 @@ * @phpstan-import-type AutoTaggingExtensionShape from \Imagekit\ExtensionItem\AutoTaggingExtension * @phpstan-import-type AutoDescriptionExtensionShape from \Imagekit\ExtensionItem\AutoDescriptionExtension * - * @phpstan-type ExtensionItemShape = RemovedotBgExtensionShape|AutoTaggingExtensionShape|AutoDescriptionExtensionShape + * @phpstan-type ExtensionItemVariants = RemovedotBgExtension|AutoTaggingExtension|AutoDescriptionExtension + * @phpstan-type ExtensionItemShape = ExtensionItemVariants|RemovedotBgExtensionShape|AutoTaggingExtensionShape|AutoDescriptionExtensionShape */ final class ExtensionItem implements ConverterSource { diff --git a/src/Files/File.php b/src/Files/File.php index 5f021688..224df479 100644 --- a/src/Files/File.php +++ b/src/Files/File.php @@ -20,7 +20,7 @@ * @phpstan-import-type VersionInfoShape from \Imagekit\Files\File\VersionInfo * * @phpstan-type FileShape = array{ - * aiTags?: list|null, + * aiTags?: list|null, * createdAt?: \DateTimeInterface|null, * customCoordinates?: string|null, * customMetadata?: array|null, @@ -34,7 +34,7 @@ * isPublished?: bool|null, * mime?: string|null, * name?: string|null, - * selectedFieldsSchema?: array|null, + * selectedFieldsSchema?: array|null, * size?: float|null, * tags?: list|null, * thumbnail?: string|null, @@ -212,9 +212,9 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list|null $aiTags + * @param list|null $aiTags * @param array|null $customMetadata - * @param array|null $selectedFieldsSchema + * @param array|null $selectedFieldsSchema * @param list|null $tags * @param Type|value-of|null $type * @param VersionInfo|VersionInfoShape|null $versionInfo @@ -276,7 +276,7 @@ public static function with( /** * An array of tags assigned to the file by auto tagging. * - * @param list|null $aiTags + * @param list|null $aiTags */ public function withAITags(?array $aiTags): self { @@ -438,7 +438,7 @@ public function withName(string $name): self * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @param array $selectedFieldsSchema + * @param array $selectedFieldsSchema */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { diff --git a/src/Files/File/SelectedFieldsSchema.php b/src/Files/File/SelectedFieldsSchema.php index c627a20b..4a49e87c 100644 --- a/src/Files/File/SelectedFieldsSchema.php +++ b/src/Files/File/SelectedFieldsSchema.php @@ -13,6 +13,10 @@ use Imagekit\Files\File\SelectedFieldsSchema\Type; /** + * @phpstan-import-type DefaultValueVariants from \Imagekit\Files\File\SelectedFieldsSchema\DefaultValue + * @phpstan-import-type MaxValueVariants from \Imagekit\Files\File\SelectedFieldsSchema\MaxValue + * @phpstan-import-type MinValueVariants from \Imagekit\Files\File\SelectedFieldsSchema\MinValue + * @phpstan-import-type SelectOptionVariants from \Imagekit\Files\File\SelectedFieldsSchema\SelectOption * @phpstan-import-type DefaultValueShape from \Imagekit\Files\File\SelectedFieldsSchema\DefaultValue * @phpstan-import-type MaxValueShape from \Imagekit\Files\File\SelectedFieldsSchema\MaxValue * @phpstan-import-type MinValueShape from \Imagekit\Files\File\SelectedFieldsSchema\MinValue @@ -47,7 +51,7 @@ final class SelectedFieldsSchema implements BaseModel /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. * - * @var string|float|bool|list|null $defaultValue + * @var DefaultValueVariants|null $defaultValue */ #[Optional(union: DefaultValue::class)] public string|float|bool|array|null $defaultValue; @@ -66,6 +70,8 @@ final class SelectedFieldsSchema implements BaseModel /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @var MaxValueVariants|null $maxValue */ #[Optional] public string|float|null $maxValue; @@ -78,6 +84,8 @@ final class SelectedFieldsSchema implements BaseModel /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @var MinValueVariants|null $minValue */ #[Optional] public string|float|null $minValue; @@ -91,7 +99,7 @@ final class SelectedFieldsSchema implements BaseModel /** * An array of allowed values when field type is `SingleSelect` or `MultiSelect`. * - * @var list|null $selectOptions + * @var list|null $selectOptions */ #[Optional(list: SelectOption::class)] public ?array $selectOptions; diff --git a/src/Files/File/SelectedFieldsSchema/DefaultValue.php b/src/Files/File/SelectedFieldsSchema/DefaultValue.php index ef166f57..0d0e0594 100644 --- a/src/Files/File/SelectedFieldsSchema/DefaultValue.php +++ b/src/Files/File/SelectedFieldsSchema/DefaultValue.php @@ -15,7 +15,8 @@ * * @phpstan-import-type MixedShape from \Imagekit\Files\File\SelectedFieldsSchema\DefaultValue\Mixed_ * - * @phpstan-type DefaultValueShape = string|float|bool|list + * @phpstan-type DefaultValueVariants = string|float|bool|list + * @phpstan-type DefaultValueShape = DefaultValueVariants|list */ final class DefaultValue implements ConverterSource { diff --git a/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed_.php b/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed_.php index a502fe7e..cf7c9d44 100644 --- a/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed_.php +++ b/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed_.php @@ -9,7 +9,8 @@ use Imagekit\Core\Conversion\Contracts\ConverterSource; /** - * @phpstan-type MixedShape = string|float|bool + * @phpstan-type MixedVariants = string|float|bool + * @phpstan-type MixedShape = MixedVariants */ final class Mixed_ implements ConverterSource { diff --git a/src/Files/File/SelectedFieldsSchema/MaxValue.php b/src/Files/File/SelectedFieldsSchema/MaxValue.php index 6509d2cb..7b909ebe 100644 --- a/src/Files/File/SelectedFieldsSchema/MaxValue.php +++ b/src/Files/File/SelectedFieldsSchema/MaxValue.php @@ -11,7 +11,8 @@ /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. * - * @phpstan-type MaxValueShape = string|float + * @phpstan-type MaxValueVariants = string|float + * @phpstan-type MaxValueShape = MaxValueVariants */ final class MaxValue implements ConverterSource { diff --git a/src/Files/File/SelectedFieldsSchema/MinValue.php b/src/Files/File/SelectedFieldsSchema/MinValue.php index f1130948..590c2d65 100644 --- a/src/Files/File/SelectedFieldsSchema/MinValue.php +++ b/src/Files/File/SelectedFieldsSchema/MinValue.php @@ -11,7 +11,8 @@ /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. * - * @phpstan-type MinValueShape = string|float + * @phpstan-type MinValueVariants = string|float + * @phpstan-type MinValueShape = MinValueVariants */ final class MinValue implements ConverterSource { diff --git a/src/Files/File/SelectedFieldsSchema/SelectOption.php b/src/Files/File/SelectedFieldsSchema/SelectOption.php index c54278a7..c3e0530f 100644 --- a/src/Files/File/SelectedFieldsSchema/SelectOption.php +++ b/src/Files/File/SelectedFieldsSchema/SelectOption.php @@ -9,7 +9,8 @@ use Imagekit\Core\Conversion\Contracts\ConverterSource; /** - * @phpstan-type SelectOptionShape = string|float|bool + * @phpstan-type SelectOptionVariants = string|float|bool + * @phpstan-type SelectOptionShape = SelectOptionVariants */ final class SelectOption implements ConverterSource { diff --git a/src/Files/FileUpdateParams.php b/src/Files/FileUpdateParams.php index caf4cd8a..8a6716f4 100644 --- a/src/Files/FileUpdateParams.php +++ b/src/Files/FileUpdateParams.php @@ -9,9 +9,6 @@ use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; use Imagekit\ExtensionItem; -use Imagekit\ExtensionItem\AutoDescriptionExtension; -use Imagekit\ExtensionItem\AutoTaggingExtension; -use Imagekit\ExtensionItem\RemovedotBgExtension; use Imagekit\Files\FileUpdateParams\Publish; use Imagekit\Files\FileUpdateParams\RemoveAITags; @@ -20,6 +17,8 @@ * * @see Imagekit\Services\FilesService::update() * + * @phpstan-import-type ExtensionItemVariants from \Imagekit\ExtensionItem + * @phpstan-import-type RemoveAITagsVariants from \Imagekit\Files\FileUpdateParams\RemoveAITags * @phpstan-import-type ExtensionItemShape from \Imagekit\ExtensionItem * @phpstan-import-type RemoveAITagsShape from \Imagekit\Files\FileUpdateParams\RemoveAITags * @phpstan-import-type PublishShape from \Imagekit\Files\FileUpdateParams\Publish @@ -64,7 +63,7 @@ final class FileUpdateParams implements BaseModel /** * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * - * @var list|null $extensions + * @var list|null $extensions */ #[Optional(list: ExtensionItem::class)] public ?array $extensions; @@ -76,7 +75,7 @@ final class FileUpdateParams implements BaseModel * * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. * - * @var 'all'|list|null $removeAITags + * @var RemoveAITagsVariants|null $removeAITags */ #[Optional(union: RemoveAITags::class)] public string|array|null $removeAITags; diff --git a/src/Files/FileUpdateParams/RemoveAITags.php b/src/Files/FileUpdateParams/RemoveAITags.php index 613a851c..b4ca7928 100644 --- a/src/Files/FileUpdateParams/RemoveAITags.php +++ b/src/Files/FileUpdateParams/RemoveAITags.php @@ -16,7 +16,8 @@ * * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. * - * @phpstan-type RemoveAITagsShape = 'all'|list + * @phpstan-type RemoveAITagsVariants = 'all'|list + * @phpstan-type RemoveAITagsShape = RemoveAITagsVariants */ final class RemoveAITags implements ConverterSource { diff --git a/src/Files/FileUpdateResponse.php b/src/Files/FileUpdateResponse.php index e237419b..2775198a 100644 --- a/src/Files/FileUpdateResponse.php +++ b/src/Files/FileUpdateResponse.php @@ -22,7 +22,7 @@ * @phpstan-import-type ExtensionStatusShape from \Imagekit\Files\FileUpdateResponse\ExtensionStatus * * @phpstan-type FileUpdateResponseShape = array{ - * aiTags?: list|null, + * aiTags?: list|null, * createdAt?: \DateTimeInterface|null, * customCoordinates?: string|null, * customMetadata?: array|null, @@ -36,7 +36,7 @@ * isPublished?: bool|null, * mime?: string|null, * name?: string|null, - * selectedFieldsSchema?: array|null, + * selectedFieldsSchema?: array|null, * size?: float|null, * tags?: list|null, * thumbnail?: string|null, @@ -218,9 +218,9 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list|null $aiTags + * @param list|null $aiTags * @param array|null $customMetadata - * @param array|null $selectedFieldsSchema + * @param array|null $selectedFieldsSchema * @param list|null $tags * @param Type|value-of|null $type * @param VersionInfo|VersionInfoShape|null $versionInfo @@ -285,7 +285,7 @@ public static function with( /** * An array of tags assigned to the file by auto tagging. * - * @param list|null $aiTags + * @param list|null $aiTags */ public function withAITags(?array $aiTags): self { @@ -447,7 +447,7 @@ public function withName(string $name): self * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @param array $selectedFieldsSchema + * @param array $selectedFieldsSchema */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index 54838d6d..725c4250 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -10,9 +10,6 @@ use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; use Imagekit\ExtensionItem; -use Imagekit\ExtensionItem\AutoDescriptionExtension; -use Imagekit\ExtensionItem\AutoTaggingExtension; -use Imagekit\ExtensionItem\RemovedotBgExtension; use Imagekit\Files\FileUploadParams\ResponseField; use Imagekit\Files\FileUploadParams\Transformation; @@ -34,6 +31,7 @@ * * @see Imagekit\Services\FilesService::upload() * + * @phpstan-import-type ExtensionItemVariants from \Imagekit\ExtensionItem * @phpstan-import-type ExtensionItemShape from \Imagekit\ExtensionItem * @phpstan-import-type TransformationShape from \Imagekit\Files\FileUploadParams\Transformation * @@ -141,7 +139,7 @@ final class FileUploadParams implements BaseModel /** * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * - * @var list|null $extensions + * @var list|null $extensions */ #[Optional(list: ExtensionItem::class)] public ?array $extensions; diff --git a/src/Files/FileUploadParams/Transformation.php b/src/Files/FileUploadParams/Transformation.php index b6277177..ab660c79 100644 --- a/src/Files/FileUploadParams/Transformation.php +++ b/src/Files/FileUploadParams/Transformation.php @@ -8,10 +8,6 @@ use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\Files\FileUploadParams\Transformation\Post; -use Imagekit\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming; -use Imagekit\Files\FileUploadParams\Transformation\Post\ConvertGifToVideo; -use Imagekit\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail; -use Imagekit\Files\FileUploadParams\Transformation\Post\SimplePostTransformation; /** * Configure pre-processing (`pre`) and post-processing (`post`) transformations. @@ -24,6 +20,7 @@ * * You can mix and match any combination of post-processing types. * + * @phpstan-import-type PostVariants from \Imagekit\Files\FileUploadParams\Transformation\Post * @phpstan-import-type PostShape from \Imagekit\Files\FileUploadParams\Transformation\Post * * @phpstan-type TransformationShape = array{ @@ -40,7 +37,7 @@ final class Transformation implements BaseModel * Each item must match one of the following types: * `transformation`, `gif-to-video`, `thumbnail`, `abs`. * - * @var list|null $post + * @var list|null $post */ #[Optional(list: Post::class)] public ?array $post; diff --git a/src/Files/FileUploadParams/Transformation/Post.php b/src/Files/FileUploadParams/Transformation/Post.php index 5868889e..ef793c55 100644 --- a/src/Files/FileUploadParams/Transformation/Post.php +++ b/src/Files/FileUploadParams/Transformation/Post.php @@ -18,7 +18,8 @@ * @phpstan-import-type GenerateAThumbnailShape from \Imagekit\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail * @phpstan-import-type AdaptiveBitrateStreamingShape from \Imagekit\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming * - * @phpstan-type PostShape = SimplePostTransformationShape|ConvertGifToVideoShape|GenerateAThumbnailShape|AdaptiveBitrateStreamingShape + * @phpstan-type PostVariants = SimplePostTransformation|ConvertGifToVideo|GenerateAThumbnail|AdaptiveBitrateStreaming + * @phpstan-type PostShape = PostVariants|SimplePostTransformationShape|ConvertGifToVideoShape|GenerateAThumbnailShape|AdaptiveBitrateStreamingShape */ final class Post implements ConverterSource { diff --git a/src/Files/FileUploadResponse.php b/src/Files/FileUploadResponse.php index 01928a70..60cfc020 100644 --- a/src/Files/FileUploadResponse.php +++ b/src/Files/FileUploadResponse.php @@ -22,7 +22,7 @@ * @phpstan-import-type VersionInfoShape from \Imagekit\Files\FileUploadResponse\VersionInfo * * @phpstan-type FileUploadResponseShape = array{ - * aiTags?: list|null, + * aiTags?: list|null, * audioCodec?: string|null, * bitRate?: int|null, * customCoordinates?: string|null, @@ -39,7 +39,7 @@ * isPublished?: bool|null, * metadata?: null|Metadata|MetadataShape, * name?: string|null, - * selectedFieldsSchema?: array|null, + * selectedFieldsSchema?: array|null, * size?: float|null, * tags?: list|null, * thumbnailURL?: string|null, @@ -234,12 +234,12 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list|null $aiTags + * @param list|null $aiTags * @param array|null $customMetadata * @param array|null $embeddedMetadata * @param ExtensionStatus|ExtensionStatusShape|null $extensionStatus * @param Metadata|MetadataShape|null $metadata - * @param array|null $selectedFieldsSchema + * @param array|null $selectedFieldsSchema * @param list|null $tags * @param VersionInfo|VersionInfoShape|null $versionInfo */ @@ -304,7 +304,7 @@ public static function with( /** * An array of tags assigned to the uploaded file by auto tagging. * - * @param list|null $aiTags + * @param list|null $aiTags */ public function withAITags(?array $aiTags): self { @@ -512,7 +512,7 @@ public function withName(string $name): self * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @param array $selectedFieldsSchema + * @param array $selectedFieldsSchema */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema.php b/src/Files/FileUploadResponse/SelectedFieldsSchema.php index ac516177..3abd0c2e 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema.php @@ -13,6 +13,10 @@ use Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\Type; /** + * @phpstan-import-type DefaultValueVariants from \Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue + * @phpstan-import-type MaxValueVariants from \Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\MaxValue + * @phpstan-import-type MinValueVariants from \Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\MinValue + * @phpstan-import-type SelectOptionVariants from \Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\SelectOption * @phpstan-import-type DefaultValueShape from \Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue * @phpstan-import-type MaxValueShape from \Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\MaxValue * @phpstan-import-type MinValueShape from \Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\MinValue @@ -47,7 +51,7 @@ final class SelectedFieldsSchema implements BaseModel /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. * - * @var string|float|bool|list|null $defaultValue + * @var DefaultValueVariants|null $defaultValue */ #[Optional(union: DefaultValue::class)] public string|float|bool|array|null $defaultValue; @@ -66,6 +70,8 @@ final class SelectedFieldsSchema implements BaseModel /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @var MaxValueVariants|null $maxValue */ #[Optional] public string|float|null $maxValue; @@ -78,6 +84,8 @@ final class SelectedFieldsSchema implements BaseModel /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @var MinValueVariants|null $minValue */ #[Optional] public string|float|null $minValue; @@ -91,7 +99,7 @@ final class SelectedFieldsSchema implements BaseModel /** * An array of allowed values when field type is `SingleSelect` or `MultiSelect`. * - * @var list|null $selectOptions + * @var list|null $selectOptions */ #[Optional(list: SelectOption::class)] public ?array $selectOptions; diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php index adb5481d..12b504ec 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php @@ -15,7 +15,8 @@ * * @phpstan-import-type MixedShape from \Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed_ * - * @phpstan-type DefaultValueShape = string|float|bool|list + * @phpstan-type DefaultValueVariants = string|float|bool|list + * @phpstan-type DefaultValueShape = DefaultValueVariants|list */ final class DefaultValue implements ConverterSource { diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php index 99a42cef..67aae15b 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php @@ -9,7 +9,8 @@ use Imagekit\Core\Conversion\Contracts\ConverterSource; /** - * @phpstan-type MixedShape = string|float|bool + * @phpstan-type MixedVariants = string|float|bool + * @phpstan-type MixedShape = MixedVariants */ final class Mixed_ implements ConverterSource { diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php index 0917c285..51297b62 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php @@ -11,7 +11,8 @@ /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. * - * @phpstan-type MaxValueShape = string|float + * @phpstan-type MaxValueVariants = string|float + * @phpstan-type MaxValueShape = MaxValueVariants */ final class MaxValue implements ConverterSource { diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php index b847cf35..ee6f0fc8 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php @@ -11,7 +11,8 @@ /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. * - * @phpstan-type MinValueShape = string|float + * @phpstan-type MinValueVariants = string|float + * @phpstan-type MinValueShape = MinValueVariants */ final class MinValue implements ConverterSource { diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php index 70276638..4d9d2041 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php @@ -9,7 +9,8 @@ use Imagekit\Core\Conversion\Contracts\ConverterSource; /** - * @phpstan-type SelectOptionShape = string|float|bool + * @phpstan-type SelectOptionVariants = string|float|bool + * @phpstan-type SelectOptionShape = SelectOptionVariants */ final class SelectOption implements ConverterSource { diff --git a/src/Files/UpdateFileRequest.php b/src/Files/UpdateFileRequest.php index 3ff531db..18ae1d6f 100644 --- a/src/Files/UpdateFileRequest.php +++ b/src/Files/UpdateFileRequest.php @@ -16,7 +16,8 @@ * @phpstan-import-type UpdateFileDetailsShape from \Imagekit\Files\UpdateFileRequest\UpdateFileDetails * @phpstan-import-type ChangePublicationStatusShape from \Imagekit\Files\UpdateFileRequest\ChangePublicationStatus * - * @phpstan-type UpdateFileRequestShape = UpdateFileDetailsShape|ChangePublicationStatusShape + * @phpstan-type UpdateFileRequestVariants = UpdateFileDetails|ChangePublicationStatus + * @phpstan-type UpdateFileRequestShape = UpdateFileRequestVariants|UpdateFileDetailsShape|ChangePublicationStatusShape */ final class UpdateFileRequest implements ConverterSource { diff --git a/src/Files/UpdateFileRequest/UpdateFileDetails.php b/src/Files/UpdateFileRequest/UpdateFileDetails.php index b9dff0bc..ad8f5668 100644 --- a/src/Files/UpdateFileRequest/UpdateFileDetails.php +++ b/src/Files/UpdateFileRequest/UpdateFileDetails.php @@ -8,12 +8,11 @@ use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; use Imagekit\ExtensionItem; -use Imagekit\ExtensionItem\AutoDescriptionExtension; -use Imagekit\ExtensionItem\AutoTaggingExtension; -use Imagekit\ExtensionItem\RemovedotBgExtension; use Imagekit\Files\UpdateFileRequest\UpdateFileDetails\RemoveAITags; /** + * @phpstan-import-type ExtensionItemVariants from \Imagekit\ExtensionItem + * @phpstan-import-type RemoveAITagsVariants from \Imagekit\Files\UpdateFileRequest\UpdateFileDetails\RemoveAITags * @phpstan-import-type ExtensionItemShape from \Imagekit\ExtensionItem * @phpstan-import-type RemoveAITagsShape from \Imagekit\Files\UpdateFileRequest\UpdateFileDetails\RemoveAITags * @@ -55,7 +54,7 @@ final class UpdateFileDetails implements BaseModel /** * Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * - * @var list|null $extensions + * @var list|null $extensions */ #[Optional(list: ExtensionItem::class)] public ?array $extensions; @@ -67,7 +66,7 @@ final class UpdateFileDetails implements BaseModel * * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. * - * @var 'all'|list|null $removeAITags + * @var RemoveAITagsVariants|null $removeAITags */ #[Optional(union: RemoveAITags::class)] public string|array|null $removeAITags; diff --git a/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php b/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php index 034f0f38..55a17b20 100644 --- a/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php +++ b/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php @@ -16,7 +16,8 @@ * * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. * - * @phpstan-type RemoveAITagsShape = 'all'|list + * @phpstan-type RemoveAITagsVariants = 'all'|list + * @phpstan-type RemoveAITagsShape = RemoveAITagsVariants */ final class RemoveAITags implements ConverterSource { diff --git a/src/Overlay.php b/src/Overlay.php index cc18b4d8..2bd5cc81 100644 --- a/src/Overlay.php +++ b/src/Overlay.php @@ -14,10 +14,13 @@ * See [Overlay using layers](https://imagekit.io/docs/transformations#overlay-using-layers). * * @phpstan-import-type TextOverlayShape from \Imagekit\TextOverlay + * @phpstan-import-type ImageOverlayShape from \Imagekit\ImageOverlay + * @phpstan-import-type VideoOverlayShape from \Imagekit\VideoOverlay * @phpstan-import-type SubtitleOverlayShape from \Imagekit\SubtitleOverlay * @phpstan-import-type SolidColorOverlayShape from \Imagekit\SolidColorOverlay * - * @phpstan-type OverlayShape = TextOverlayShape|ImageOverlay|VideoOverlay|SubtitleOverlayShape|SolidColorOverlayShape + * @phpstan-type OverlayVariants = mixed|TextOverlay|SubtitleOverlay|SolidColorOverlay + * @phpstan-type OverlayShape = OverlayVariants|TextOverlayShape|ImageOverlayShape|VideoOverlayShape|SubtitleOverlayShape|SolidColorOverlayShape */ final class Overlay implements ConverterSource { diff --git a/src/OverlayPosition.php b/src/OverlayPosition.php index 85643d2a..628a4e1d 100644 --- a/src/OverlayPosition.php +++ b/src/OverlayPosition.php @@ -10,6 +10,8 @@ use Imagekit\OverlayPosition\Focus; /** + * @phpstan-import-type XVariants from \Imagekit\OverlayPosition\X + * @phpstan-import-type YVariants from \Imagekit\OverlayPosition\Y * @phpstan-import-type XShape from \Imagekit\OverlayPosition\X * @phpstan-import-type YShape from \Imagekit\OverlayPosition\Y * @@ -36,6 +38,8 @@ final class OverlayPosition implements BaseModel * It also accepts arithmetic expressions such as `bw_mul_0.4` or `bw_sub_cw`. * Maps to `lx` in the URL. * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * + * @var XVariants|null $x */ #[Optional] public float|string|null $x; @@ -45,6 +49,8 @@ final class OverlayPosition implements BaseModel * It also accepts arithmetic expressions such as `bh_mul_0.4` or `bh_sub_ch`. * Maps to `ly` in the URL. * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * + * @var YVariants|null $y */ #[Optional] public float|string|null $y; diff --git a/src/OverlayPosition/X.php b/src/OverlayPosition/X.php index e961a883..395fad09 100644 --- a/src/OverlayPosition/X.php +++ b/src/OverlayPosition/X.php @@ -14,7 +14,8 @@ * Maps to `lx` in the URL. * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). * - * @phpstan-type XShape = float|string + * @phpstan-type XVariants = float|string + * @phpstan-type XShape = XVariants */ final class X implements ConverterSource { diff --git a/src/OverlayPosition/Y.php b/src/OverlayPosition/Y.php index b0241d3a..7931395c 100644 --- a/src/OverlayPosition/Y.php +++ b/src/OverlayPosition/Y.php @@ -14,7 +14,8 @@ * Maps to `ly` in the URL. * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). * - * @phpstan-type YShape = float|string + * @phpstan-type YVariants = float|string + * @phpstan-type YShape = YVariants */ final class Y implements ConverterSource { diff --git a/src/OverlayTiming.php b/src/OverlayTiming.php index c2e4069d..f19f7cb7 100644 --- a/src/OverlayTiming.php +++ b/src/OverlayTiming.php @@ -9,6 +9,9 @@ use Imagekit\Core\Contracts\BaseModel; /** + * @phpstan-import-type DurationVariants from \Imagekit\OverlayTiming\Duration + * @phpstan-import-type EndVariants from \Imagekit\OverlayTiming\End + * @phpstan-import-type StartVariants from \Imagekit\OverlayTiming\Start * @phpstan-import-type DurationShape from \Imagekit\OverlayTiming\Duration * @phpstan-import-type EndShape from \Imagekit\OverlayTiming\End * @phpstan-import-type StartShape from \Imagekit\OverlayTiming\Start @@ -27,6 +30,8 @@ final class OverlayTiming implements BaseModel * Accepts a positive number up to two decimal places (e.g., `20` or `20.50`) and arithmetic expressions such as `bdu_mul_0.4` or `bdu_sub_idu`. * Applies only if the base asset is a video. * Maps to `ldu` in the URL. + * + * @var DurationVariants|null $duration */ #[Optional] public float|string|null $duration; @@ -37,6 +42,8 @@ final class OverlayTiming implements BaseModel * Accepts a positive number up to two decimal places (e.g., `20` or `20.50`) and arithmetic expressions such as `bdu_mul_0.4` or `bdu_sub_idu`. * Applies only if the base asset is a video. * Maps to `leo` in the URL. + * + * @var EndVariants|null $end */ #[Optional] public float|string|null $end; @@ -46,6 +53,8 @@ final class OverlayTiming implements BaseModel * Accepts a positive number up to two decimal places (e.g., `20` or `20.50`) and arithmetic expressions such as `bdu_mul_0.4` or `bdu_sub_idu`. * Applies only if the base asset is a video. * Maps to `lso` in the URL. + * + * @var StartVariants|null $start */ #[Optional] public float|string|null $start; diff --git a/src/OverlayTiming/Duration.php b/src/OverlayTiming/Duration.php index 751fd5bc..39472864 100644 --- a/src/OverlayTiming/Duration.php +++ b/src/OverlayTiming/Duration.php @@ -14,7 +14,8 @@ * Applies only if the base asset is a video. * Maps to `ldu` in the URL. * - * @phpstan-type DurationShape = float|string + * @phpstan-type DurationVariants = float|string + * @phpstan-type DurationShape = DurationVariants */ final class Duration implements ConverterSource { diff --git a/src/OverlayTiming/End.php b/src/OverlayTiming/End.php index 71a70ebb..29e47218 100644 --- a/src/OverlayTiming/End.php +++ b/src/OverlayTiming/End.php @@ -15,7 +15,8 @@ * Applies only if the base asset is a video. * Maps to `leo` in the URL. * - * @phpstan-type EndShape = float|string + * @phpstan-type EndVariants = float|string + * @phpstan-type EndShape = EndVariants */ final class End implements ConverterSource { diff --git a/src/OverlayTiming/Start.php b/src/OverlayTiming/Start.php index 59ee6feb..3200ff1f 100644 --- a/src/OverlayTiming/Start.php +++ b/src/OverlayTiming/Start.php @@ -14,7 +14,8 @@ * Applies only if the base asset is a video. * Maps to `lso` in the URL. * - * @phpstan-type StartShape = float|string + * @phpstan-type StartVariants = float|string + * @phpstan-type StartShape = StartVariants */ final class Start implements ConverterSource { diff --git a/src/ServiceContracts/Accounts/OriginsContract.php b/src/ServiceContracts/Accounts/OriginsContract.php index defa79a3..1dee4893 100644 --- a/src/ServiceContracts/Accounts/OriginsContract.php +++ b/src/ServiceContracts/Accounts/OriginsContract.php @@ -15,6 +15,9 @@ use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface OriginsContract { /** @@ -34,6 +37,7 @@ interface OriginsContract * @param bool $includeCanonicalHeader whether to send a Canonical header * @param bool $s3ForcePathStyle Use path-style S3 URLs? * @param bool $forwardHostHeaderToOrigin Forward the Host header to origin? + * @param RequestOpts|null $requestOptions * * @throws APIException */ @@ -59,7 +63,7 @@ public function create( string $prefix = '', bool $s3ForcePathStyle = false, bool $forwardHostHeaderToOrigin = false, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|GoogleCloudStorageGcs|AzureBlobStorage|AkeneoPim; /** @@ -80,6 +84,7 @@ public function create( * @param bool $includeCanonicalHeader whether to send a Canonical header * @param bool $s3ForcePathStyle Use path-style S3 URLs? * @param bool $forwardHostHeaderToOrigin Forward the Host header to origin? + * @param RequestOpts|null $requestOptions * * @throws APIException */ @@ -106,39 +111,45 @@ public function update( string $prefix = '', bool $s3ForcePathStyle = false, bool $forwardHostHeaderToOrigin = false, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|GoogleCloudStorageGcs|AzureBlobStorage|AkeneoPim; /** * @api * + * @param RequestOpts|null $requestOptions + * * @return list * * @throws APIException */ - public function list(?RequestOptions $requestOptions = null): array; + public function list( + RequestOptions|array|null $requestOptions = null + ): array; /** * @api * * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function delete( string $id, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): mixed; /** * @api * * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function get( string $id, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|GoogleCloudStorageGcs|AzureBlobStorage|AkeneoPim; } diff --git a/src/ServiceContracts/Accounts/OriginsRawContract.php b/src/ServiceContracts/Accounts/OriginsRawContract.php index f8cb7608..66f09a58 100644 --- a/src/ServiceContracts/Accounts/OriginsRawContract.php +++ b/src/ServiceContracts/Accounts/OriginsRawContract.php @@ -18,12 +18,16 @@ use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface OriginsRawContract { /** * @api * * @param array|OriginCreateParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -31,7 +35,7 @@ interface OriginsRawContract */ public function create( array|OriginCreateParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse; /** @@ -39,6 +43,7 @@ public function create( * * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. * @param array|OriginUpdateParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -47,22 +52,27 @@ public function create( public function update( string $id, array|OriginUpdateParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse; /** * @api * + * @param RequestOpts|null $requestOptions + * * @return BaseResponse,> * * @throws APIException */ - public function list(?RequestOptions $requestOptions = null): BaseResponse; + public function list( + RequestOptions|array|null $requestOptions = null + ): BaseResponse; /** * @api * * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -70,13 +80,14 @@ public function list(?RequestOptions $requestOptions = null): BaseResponse; */ public function delete( string $id, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): BaseResponse; /** * @api * * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -84,6 +95,6 @@ public function delete( */ public function get( string $id, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): BaseResponse; } diff --git a/src/ServiceContracts/Accounts/URLEndpointsContract.php b/src/ServiceContracts/Accounts/URLEndpointsContract.php index b7ef282a..1589a2de 100644 --- a/src/ServiceContracts/Accounts/URLEndpointsContract.php +++ b/src/ServiceContracts/Accounts/URLEndpointsContract.php @@ -4,10 +4,18 @@ namespace Imagekit\ServiceContracts\Accounts; +use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\AkamaiURLRewriter; +use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\CloudinaryURLRewriter; +use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\ImgixURLRewriter; use Imagekit\Accounts\URLEndpoints\URLEndpointResponse; use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; +/** + * @phpstan-import-type URLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter + * @phpstan-import-type URLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter as URLRewriterShape1 + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface URLEndpointsContract { /** @@ -16,7 +24,8 @@ interface URLEndpointsContract * @param string $description description of the URL endpoint * @param list $origins Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) - * @param array $urlRewriter configuration for third-party URL rewriting + * @param URLRewriterShape $urlRewriter configuration for third-party URL rewriting + * @param RequestOpts|null $requestOptions * * @throws APIException */ @@ -24,8 +33,8 @@ public function create( string $description, array $origins = [], string $urlPrefix = '', - ?array $urlRewriter = null, - ?RequestOptions $requestOptions = null, + CloudinaryURLRewriter|array|ImgixURLRewriter|AkamaiURLRewriter|null $urlRewriter = null, + RequestOptions|array|null $requestOptions = null, ): URLEndpointResponse; /** @@ -35,7 +44,8 @@ public function create( * @param string $description description of the URL endpoint * @param list $origins Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) - * @param array $urlRewriter configuration for third-party URL rewriting + * @param URLRewriterShape1 $urlRewriter configuration for third-party URL rewriting + * @param RequestOpts|null $requestOptions * * @throws APIException */ @@ -44,40 +54,46 @@ public function update( string $description, array $origins = [], string $urlPrefix = '', - ?array $urlRewriter = null, - ?RequestOptions $requestOptions = null, + \Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\CloudinaryURLRewriter|array|\Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\ImgixURLRewriter|\Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\AkamaiURLRewriter|null $urlRewriter = null, + RequestOptions|array|null $requestOptions = null, ): URLEndpointResponse; /** * @api * + * @param RequestOpts|null $requestOptions + * * @return list * * @throws APIException */ - public function list(?RequestOptions $requestOptions = null): array; + public function list( + RequestOptions|array|null $requestOptions = null + ): array; /** * @api * * @param string $id Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function delete( string $id, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): mixed; /** * @api * * @param string $id Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function get( string $id, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): URLEndpointResponse; } diff --git a/src/ServiceContracts/Accounts/URLEndpointsRawContract.php b/src/ServiceContracts/Accounts/URLEndpointsRawContract.php index 161b6f29..31d3615d 100644 --- a/src/ServiceContracts/Accounts/URLEndpointsRawContract.php +++ b/src/ServiceContracts/Accounts/URLEndpointsRawContract.php @@ -11,12 +11,16 @@ use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface URLEndpointsRawContract { /** * @api * * @param array|URLEndpointCreateParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -24,7 +28,7 @@ interface URLEndpointsRawContract */ public function create( array|URLEndpointCreateParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse; /** @@ -32,6 +36,7 @@ public function create( * * @param string $id Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. * @param array|URLEndpointUpdateParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -40,22 +45,27 @@ public function create( public function update( string $id, array|URLEndpointUpdateParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse; /** * @api * + * @param RequestOpts|null $requestOptions + * * @return BaseResponse> * * @throws APIException */ - public function list(?RequestOptions $requestOptions = null): BaseResponse; + public function list( + RequestOptions|array|null $requestOptions = null + ): BaseResponse; /** * @api * * @param string $id Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -63,13 +73,14 @@ public function list(?RequestOptions $requestOptions = null): BaseResponse; */ public function delete( string $id, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): BaseResponse; /** * @api * * @param string $id Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -77,6 +88,6 @@ public function delete( */ public function get( string $id, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): BaseResponse; } diff --git a/src/ServiceContracts/Accounts/UsageContract.php b/src/ServiceContracts/Accounts/UsageContract.php index 3ef31ff4..5a77662a 100644 --- a/src/ServiceContracts/Accounts/UsageContract.php +++ b/src/ServiceContracts/Accounts/UsageContract.php @@ -8,6 +8,9 @@ use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface UsageContract { /** @@ -15,12 +18,13 @@ interface UsageContract * * @param string $endDate Specify a `endDate` in `YYYY-MM-DD` format. It should be after the `startDate`. The difference between `startDate` and `endDate` should be less than 90 days. * @param string $startDate Specify a `startDate` in `YYYY-MM-DD` format. It should be before the `endDate`. The difference between `startDate` and `endDate` should be less than 90 days. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function get( string $endDate, string $startDate, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): UsageGetResponse; } diff --git a/src/ServiceContracts/Accounts/UsageRawContract.php b/src/ServiceContracts/Accounts/UsageRawContract.php index bdbc53ad..a1f1809e 100644 --- a/src/ServiceContracts/Accounts/UsageRawContract.php +++ b/src/ServiceContracts/Accounts/UsageRawContract.php @@ -10,12 +10,16 @@ use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface UsageRawContract { /** * @api * * @param array|UsageGetParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -23,6 +27,6 @@ interface UsageRawContract */ public function get( array|UsageGetParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse; } diff --git a/src/ServiceContracts/AssetsContract.php b/src/ServiceContracts/AssetsContract.php index b4dd6741..0c3aac67 100644 --- a/src/ServiceContracts/AssetsContract.php +++ b/src/ServiceContracts/AssetsContract.php @@ -12,12 +12,15 @@ use Imagekit\Files\Folder; use Imagekit\RequestOptions; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface AssetsContract { /** * @api * - * @param 'all'|'image'|'non-image'|FileType $fileType Filter results by file type. + * @param FileType|value-of $fileType Filter results by file type. * * - `all` — include all file types * - `image` — include only image files @@ -37,26 +40,27 @@ interface AssetsContract * * [Learn more](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#advanced-search-queries) from examples. * @param int $skip the number of results to skip before returning results - * @param 'ASC_NAME'|'DESC_NAME'|'ASC_CREATED'|'DESC_CREATED'|'ASC_UPDATED'|'DESC_UPDATED'|'ASC_HEIGHT'|'DESC_HEIGHT'|'ASC_WIDTH'|'DESC_WIDTH'|'ASC_SIZE'|'DESC_SIZE'|'ASC_RELEVANCE'|'DESC_RELEVANCE'|Sort $sort sort the results by one of the supported fields in ascending or descending order - * @param 'file'|'file-version'|'folder'|'all'|Type $type Filter results by asset type. + * @param Sort|value-of $sort sort the results by one of the supported fields in ascending or descending order + * @param Type|value-of $type Filter results by asset type. * * - `file` — returns only files * - `file-version` — returns specific file versions * - `folder` — returns only folders * - `all` — returns both files and folders (excludes `file-version`) + * @param RequestOpts|null $requestOptions * * @return list * * @throws APIException */ public function list( - string|FileType $fileType = 'all', + FileType|string $fileType = 'all', int $limit = 1000, ?string $path = null, ?string $searchQuery = null, int $skip = 0, - string|Sort $sort = 'ASC_CREATED', - string|Type $type = 'file', - ?RequestOptions $requestOptions = null, + Sort|string $sort = 'ASC_CREATED', + Type|string $type = 'file', + RequestOptions|array|null $requestOptions = null, ): array; } diff --git a/src/ServiceContracts/AssetsRawContract.php b/src/ServiceContracts/AssetsRawContract.php index 35df741a..378f145b 100644 --- a/src/ServiceContracts/AssetsRawContract.php +++ b/src/ServiceContracts/AssetsRawContract.php @@ -11,12 +11,16 @@ use Imagekit\Files\Folder; use Imagekit\RequestOptions; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface AssetsRawContract { /** * @api * * @param array|AssetListParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse> * @@ -24,6 +28,6 @@ interface AssetsRawContract */ public function list( array|AssetListParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse; } diff --git a/src/ServiceContracts/Beta/V2/FilesContract.php b/src/ServiceContracts/Beta/V2/FilesContract.php index 12dfb7a9..2a3eb774 100644 --- a/src/ServiceContracts/Beta/V2/FilesContract.php +++ b/src/ServiceContracts/Beta/V2/FilesContract.php @@ -5,10 +5,16 @@ namespace Imagekit\ServiceContracts\Beta\V2; use Imagekit\Beta\V2\Files\FileUploadParams\ResponseField; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation; use Imagekit\Beta\V2\Files\FileUploadResponse; use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; +/** + * @phpstan-import-type ExtensionItemShape from \Imagekit\ExtensionItem + * @phpstan-import-type TransformationShape from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface FilesContract { /** @@ -32,7 +38,7 @@ interface FilesContract * - If this field is not specified and the file is overwritten, then customCoordinates will be removed. * @param array $customMetadata JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. * @param string $description optional text to describe the contents of the file - * @param list> $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. + * @param list $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * @param string $folder The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. Using multiple `/` creates a nested folder. * @param bool $isPrivateFile Whether to mark the file as private or not. * @@ -46,13 +52,11 @@ interface FilesContract * @param bool $overwriteCustomMetadata if the request does not have `customMetadata`, and a file already exists at the exact location, existing customMetadata will be removed * @param bool $overwriteFile if `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed - * @param list<'tags'|'customCoordinates'|'isPrivateFile'|'embeddedMetadata'|'isPublished'|'customMetadata'|'metadata'|'selectedFieldsSchema'|ResponseField> $responseFields array of response field keys to include in the API response body + * @param list> $responseFields array of response field keys to include in the API response body * @param list $tags Set the tags while uploading the file. * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. * If this field is not specified and the file is overwritten, the existing tags will be removed. - * @param array{ - * post?: list>, pre?: string - * } $transformation Configure pre-processing (`pre`) and post-processing (`post`) transformations. + * @param Transformation|TransformationShape $transformation Configure pre-processing (`pre`) and post-processing (`post`) transformations. * * - `pre` — applied before the file is uploaded to the Media Library. * Useful for reducing file size or applying basic optimizations upfront (e.g., resize, compress). @@ -67,6 +71,7 @@ interface FilesContract * * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + * @param RequestOpts|null $requestOptions * * @throws APIException */ @@ -88,9 +93,9 @@ public function upload( bool $overwriteTags = true, ?array $responseFields = null, ?array $tags = null, - ?array $transformation = null, + Transformation|array|null $transformation = null, bool $useUniqueFileName = true, ?string $webhookURL = null, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): FileUploadResponse; } diff --git a/src/ServiceContracts/Beta/V2/FilesRawContract.php b/src/ServiceContracts/Beta/V2/FilesRawContract.php index f0b61a2d..29c5de52 100644 --- a/src/ServiceContracts/Beta/V2/FilesRawContract.php +++ b/src/ServiceContracts/Beta/V2/FilesRawContract.php @@ -10,12 +10,16 @@ use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface FilesRawContract { /** * @api * * @param array|FileUploadParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -23,6 +27,6 @@ interface FilesRawContract */ public function upload( array|FileUploadParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse; } diff --git a/src/ServiceContracts/Cache/InvalidationContract.php b/src/ServiceContracts/Cache/InvalidationContract.php index e5072e0b..18c88763 100644 --- a/src/ServiceContracts/Cache/InvalidationContract.php +++ b/src/ServiceContracts/Cache/InvalidationContract.php @@ -9,29 +9,34 @@ use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface InvalidationContract { /** * @api * * @param string $url the full URL of the file to be purged + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function create( string $url, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): InvalidationNewResponse; /** * @api * * @param string $requestID should be a valid requestId + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function get( string $requestID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): InvalidationGetResponse; } diff --git a/src/ServiceContracts/Cache/InvalidationRawContract.php b/src/ServiceContracts/Cache/InvalidationRawContract.php index 3b4a65f1..ecf3270e 100644 --- a/src/ServiceContracts/Cache/InvalidationRawContract.php +++ b/src/ServiceContracts/Cache/InvalidationRawContract.php @@ -11,12 +11,16 @@ use Imagekit\Core\Exceptions\APIException; use Imagekit\RequestOptions; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface InvalidationRawContract { /** * @api * * @param array|InvalidationCreateParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -24,13 +28,14 @@ interface InvalidationRawContract */ public function create( array|InvalidationCreateParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse; /** * @api * * @param string $requestID should be a valid requestId + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -38,6 +43,6 @@ public function create( */ public function get( string $requestID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): BaseResponse; } diff --git a/src/ServiceContracts/CustomMetadataFieldsContract.php b/src/ServiceContracts/CustomMetadataFieldsContract.php index 07b85650..5614e767 100644 --- a/src/ServiceContracts/CustomMetadataFieldsContract.php +++ b/src/ServiceContracts/CustomMetadataFieldsContract.php @@ -6,10 +6,15 @@ use Imagekit\Core\Exceptions\APIException; use Imagekit\CustomMetadataFields\CustomMetadataField; -use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\Type; +use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; use Imagekit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; use Imagekit\RequestOptions; +/** + * @phpstan-import-type SchemaShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema + * @phpstan-import-type SchemaShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema as SchemaShape1 + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface CustomMetadataFieldsContract { /** @@ -17,24 +22,16 @@ interface CustomMetadataFieldsContract * * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. * @param string $name API name of the custom metadata field. This should be unique across all (including deleted) custom metadata fields. - * @param array{ - * type: 'Text'|'Textarea'|'Number'|'Date'|'Boolean'|'SingleSelect'|'MultiSelect'|Type, - * defaultValue?: mixed, - * isValueRequired?: bool, - * maxLength?: float, - * maxValue?: string|float, - * minLength?: float, - * minValue?: string|float, - * selectOptions?: list, - * } $schema + * @param Schema|SchemaShape $schema + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function create( string $label, string $name, - array $schema, - ?RequestOptions $requestOptions = null, + Schema|array $schema, + RequestOptions|array|null $requestOptions = null, ): CustomMetadataField; /** @@ -42,23 +39,16 @@ public function create( * * @param string $id should be a valid custom metadata field id * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. This parameter is required if `schema` is not provided. - * @param array{ - * defaultValue?: mixed, - * isValueRequired?: bool, - * maxLength?: float, - * maxValue?: string|float, - * minLength?: float, - * minValue?: string|float, - * selectOptions?: list, - * } $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. + * @param \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema|SchemaShape1 $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function update( string $id, ?string $label = null, - ?array $schema = null, - ?RequestOptions $requestOptions = null, + \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema|array|null $schema = null, + RequestOptions|array|null $requestOptions = null, ): CustomMetadataField; /** @@ -66,6 +56,7 @@ public function update( * * @param string $folderPath The folder path (e.g., `/path/to/folder`) for which to retrieve applicable custom metadata fields. Useful for determining path-specific field selections when the [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in use. * @param bool $includeDeleted set it to `true` to include deleted field objects in the API response + * @param RequestOpts|null $requestOptions * * @return list * @@ -74,18 +65,19 @@ public function update( public function list( ?string $folderPath = null, bool $includeDeleted = false, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): array; /** * @api * * @param string $id should be a valid custom metadata field id + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function delete( string $id, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): CustomMetadataFieldDeleteResponse; } diff --git a/src/ServiceContracts/CustomMetadataFieldsRawContract.php b/src/ServiceContracts/CustomMetadataFieldsRawContract.php index b423f7d0..b28c430e 100644 --- a/src/ServiceContracts/CustomMetadataFieldsRawContract.php +++ b/src/ServiceContracts/CustomMetadataFieldsRawContract.php @@ -13,12 +13,16 @@ use Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams; use Imagekit\RequestOptions; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface CustomMetadataFieldsRawContract { /** * @api * * @param array|CustomMetadataFieldCreateParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -26,7 +30,7 @@ interface CustomMetadataFieldsRawContract */ public function create( array|CustomMetadataFieldCreateParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse; /** @@ -34,6 +38,7 @@ public function create( * * @param string $id should be a valid custom metadata field id * @param array|CustomMetadataFieldUpdateParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -42,13 +47,14 @@ public function create( public function update( string $id, array|CustomMetadataFieldUpdateParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse; /** * @api * * @param array|CustomMetadataFieldListParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse> * @@ -56,13 +62,14 @@ public function update( */ public function list( array|CustomMetadataFieldListParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse; /** * @api * * @param string $id should be a valid custom metadata field id + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -70,6 +77,6 @@ public function list( */ public function delete( string $id, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): BaseResponse; } diff --git a/src/ServiceContracts/Files/BulkContract.php b/src/ServiceContracts/Files/BulkContract.php index fdcecd47..35954c92 100644 --- a/src/ServiceContracts/Files/BulkContract.php +++ b/src/ServiceContracts/Files/BulkContract.php @@ -11,18 +11,22 @@ use Imagekit\Files\Bulk\BulkRemoveTagsResponse; use Imagekit\RequestOptions; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface BulkContract { /** * @api * * @param list $fileIDs an array of fileIds which you want to delete + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function delete( array $fileIDs, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): BulkDeleteResponse; /** @@ -30,13 +34,14 @@ public function delete( * * @param list $fileIDs an array of fileIds to which you want to add tags * @param list $tags an array of tags that you want to add to the files + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function addTags( array $fileIDs, array $tags, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BulkAddTagsResponse; /** @@ -44,13 +49,14 @@ public function addTags( * * @param list $aiTags an array of AITags that you want to remove from the files * @param list $fileIDs an array of fileIds from which you want to remove AITags + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function removeAITags( array $aiTags, array $fileIDs, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BulkRemoveAITagsResponse; /** @@ -58,12 +64,13 @@ public function removeAITags( * * @param list $fileIDs an array of fileIds from which you want to remove tags * @param list $tags an array of tags that you want to remove from the files + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function removeTags( array $fileIDs, array $tags, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BulkRemoveTagsResponse; } diff --git a/src/ServiceContracts/Files/BulkRawContract.php b/src/ServiceContracts/Files/BulkRawContract.php index 2c90b25c..f4d0f74d 100644 --- a/src/ServiceContracts/Files/BulkRawContract.php +++ b/src/ServiceContracts/Files/BulkRawContract.php @@ -16,12 +16,16 @@ use Imagekit\Files\Bulk\BulkRemoveTagsResponse; use Imagekit\RequestOptions; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface BulkRawContract { /** * @api * * @param array|BulkDeleteParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -29,13 +33,14 @@ interface BulkRawContract */ public function delete( array|BulkDeleteParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse; /** * @api * * @param array|BulkAddTagsParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -43,13 +48,14 @@ public function delete( */ public function addTags( array|BulkAddTagsParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse; /** * @api * * @param array|BulkRemoveAITagsParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -57,13 +63,14 @@ public function addTags( */ public function removeAITags( array|BulkRemoveAITagsParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse; /** * @api * * @param array|BulkRemoveTagsParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -71,6 +78,6 @@ public function removeAITags( */ public function removeTags( array|BulkRemoveTagsParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse; } diff --git a/src/ServiceContracts/Files/MetadataContract.php b/src/ServiceContracts/Files/MetadataContract.php index 692aa5d2..6590f24c 100644 --- a/src/ServiceContracts/Files/MetadataContract.php +++ b/src/ServiceContracts/Files/MetadataContract.php @@ -8,29 +8,34 @@ use Imagekit\Files\Metadata; use Imagekit\RequestOptions; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface MetadataContract { /** * @api * * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in the list and search assets API and upload API. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function get( string $fileID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): Metadata; /** * @api * * @param string $url Should be a valid file URL. It should be accessible using your ImageKit.io account. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function getFromURL( string $url, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): Metadata; } diff --git a/src/ServiceContracts/Files/MetadataRawContract.php b/src/ServiceContracts/Files/MetadataRawContract.php index 199f24bc..d13cb89b 100644 --- a/src/ServiceContracts/Files/MetadataRawContract.php +++ b/src/ServiceContracts/Files/MetadataRawContract.php @@ -10,12 +10,16 @@ use Imagekit\Files\Metadata\MetadataGetFromURLParams; use Imagekit\RequestOptions; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface MetadataRawContract { /** * @api * * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in the list and search assets API and upload API. + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -23,13 +27,14 @@ interface MetadataRawContract */ public function get( string $fileID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): BaseResponse; /** * @api * * @param array|MetadataGetFromURLParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -37,6 +42,6 @@ public function get( */ public function getFromURL( array|MetadataGetFromURLParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse; } diff --git a/src/ServiceContracts/Files/VersionsContract.php b/src/ServiceContracts/Files/VersionsContract.php index 315db822..7165daf9 100644 --- a/src/ServiceContracts/Files/VersionsContract.php +++ b/src/ServiceContracts/Files/VersionsContract.php @@ -9,12 +9,16 @@ use Imagekit\Files\Versions\VersionDeleteResponse; use Imagekit\RequestOptions; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface VersionsContract { /** * @api * * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. + * @param RequestOpts|null $requestOptions * * @return list * @@ -22,7 +26,7 @@ interface VersionsContract */ public function list( string $fileID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): array; /** @@ -30,13 +34,14 @@ public function list( * * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function delete( string $versionID, string $fileID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): VersionDeleteResponse; /** @@ -44,13 +49,14 @@ public function delete( * * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function get( string $versionID, string $fileID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): File; /** @@ -58,12 +64,13 @@ public function get( * * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function restore( string $versionID, string $fileID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): File; } diff --git a/src/ServiceContracts/Files/VersionsRawContract.php b/src/ServiceContracts/Files/VersionsRawContract.php index e683e6f9..188e7681 100644 --- a/src/ServiceContracts/Files/VersionsRawContract.php +++ b/src/ServiceContracts/Files/VersionsRawContract.php @@ -13,12 +13,16 @@ use Imagekit\Files\Versions\VersionRestoreParams; use Imagekit\RequestOptions; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface VersionsRawContract { /** * @api * * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. + * @param RequestOpts|null $requestOptions * * @return BaseResponse> * @@ -26,7 +30,7 @@ interface VersionsRawContract */ public function list( string $fileID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): BaseResponse; /** @@ -34,6 +38,7 @@ public function list( * * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. * @param array|VersionDeleteParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -42,7 +47,7 @@ public function list( public function delete( string $versionID, array|VersionDeleteParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse; /** @@ -50,6 +55,7 @@ public function delete( * * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. * @param array|VersionGetParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -58,7 +64,7 @@ public function delete( public function get( string $versionID, array|VersionGetParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse; /** @@ -66,6 +72,7 @@ public function get( * * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. * @param array|VersionRestoreParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -74,6 +81,6 @@ public function get( public function restore( string $versionID, array|VersionRestoreParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse; } diff --git a/src/ServiceContracts/FilesContract.php b/src/ServiceContracts/FilesContract.php index 993da2a1..18aa18cf 100644 --- a/src/ServiceContracts/FilesContract.php +++ b/src/ServiceContracts/FilesContract.php @@ -9,11 +9,20 @@ use Imagekit\Files\FileCopyResponse; use Imagekit\Files\FileMoveResponse; use Imagekit\Files\FileRenameResponse; +use Imagekit\Files\FileUpdateParams\Publish; use Imagekit\Files\FileUpdateResponse; use Imagekit\Files\FileUploadParams\ResponseField; +use Imagekit\Files\FileUploadParams\Transformation; use Imagekit\Files\FileUploadResponse; use Imagekit\RequestOptions; +/** + * @phpstan-import-type RemoveAITagsShape from \Imagekit\Files\FileUpdateParams\RemoveAITags + * @phpstan-import-type PublishShape from \Imagekit\Files\FileUpdateParams\Publish + * @phpstan-import-type TransformationShape from \Imagekit\Files\FileUploadParams\Transformation + * @phpstan-import-type ExtensionItemShape from \Imagekit\ExtensionItem + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface FilesContract { /** @@ -23,17 +32,16 @@ interface FilesContract * @param string|null $customCoordinates Define an important area in the image in the format `x,y,width,height` e.g. `10,10,100,100`. Send `null` to unset this value. * @param array $customMetadata A key-value data to be associated with the asset. To unset a key, send `null` value for that key. Before setting any custom metadata on an asset you have to create the field using custom metadata fields API. * @param string $description optional text to describe the contents of the file - * @param list> $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. - * @param 'all'|list $removeAITags An array of AITags associated with the file that you want to remove, e.g. `["car", "vehicle", "motorsports"]`. + * @param list $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. + * @param RemoveAITagsShape $removeAITags An array of AITags associated with the file that you want to remove, e.g. `["car", "vehicle", "motorsports"]`. * * If you want to remove all AITags associated with the file, send a string - "all". * * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. * @param list|null $tags An array of tags associated with the file, such as `["tag1", "tag2"]`. Send `null` to unset all tags associated with the file. * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. - * @param array{ - * isPublished: bool, includeFileVersions?: bool - * } $publish Configure the publication status of a file and its versions + * @param Publish|PublishShape $publish configure the publication status of a file and its versions + * @param RequestOpts|null $requestOptions * * @throws APIException */ @@ -46,20 +54,21 @@ public function update( string|array|null $removeAITags = null, ?array $tags = null, ?string $webhookURL = null, - ?array $publish = null, - ?RequestOptions $requestOptions = null, + Publish|array|null $publish = null, + RequestOptions|array|null $requestOptions = null, ): FileUpdateResponse; /** * @api * * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function delete( string $fileID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): mixed; /** @@ -68,6 +77,7 @@ public function delete( * @param string $destinationPath full path to the folder you want to copy the above file into * @param string $sourceFilePath the full path of the file you want to copy * @param bool $includeFileVersions Option to copy all versions of a file. By default, only the current version of the file is copied. When set to true, all versions of the file will be copied. Default value - `false`. + * @param RequestOpts|null $requestOptions * * @throws APIException */ @@ -75,19 +85,20 @@ public function copy( string $destinationPath, string $sourceFilePath, ?bool $includeFileVersions = null, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): FileCopyResponse; /** * @api * * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in the list and search assets API and upload API. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function get( string $fileID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): File; /** @@ -95,13 +106,14 @@ public function get( * * @param string $destinationPath full path to the folder you want to move the above file into * @param string $sourceFilePath the full path of the file you want to move + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function move( string $destinationPath, string $sourceFilePath, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): FileMoveResponse; /** @@ -119,6 +131,7 @@ public function move( * When set to true, it will internally issue a purge cache request on CDN to remove cached content of old file and its versions. This purge request is counted against your monthly purge quota. * * Note: If the old file were accessible at `https://ik.imagekit.io/demo/old-filename.jpg`, a purge cache request would be issued against `https://ik.imagekit.io/demo/old-filename.jpg*` (with a wildcard at the end). It will remove the file and its versions' URLs and any transformations made using query parameters on this file or its versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. + * @param RequestOpts|null $requestOptions * * @throws APIException */ @@ -126,7 +139,7 @@ public function rename( string $filePath, string $newFileName, ?bool $purgeCache = null, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): FileRenameResponse; /** @@ -159,7 +172,7 @@ public function rename( * @param array $customMetadata JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. * @param string $description optional text to describe the contents of the file * @param int $expire The time until your signature is valid. It must be a [Unix time](https://en.wikipedia.org/wiki/Unix_time) in less than 1 hour into the future. It should be in seconds. This field is only required for authentication when uploading a file from the client side. - * @param list> $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. + * @param list $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * @param string $folder The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. * * The folder name can contain: @@ -181,16 +194,14 @@ public function rename( * @param bool $overwriteFile if `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed * @param string $publicKey Your ImageKit.io public key. This field is only required for authentication when uploading a file from the client side. - * @param list<'tags'|'customCoordinates'|'isPrivateFile'|'embeddedMetadata'|'isPublished'|'customMetadata'|'metadata'|'selectedFieldsSchema'|ResponseField> $responseFields array of response field keys to include in the API response body + * @param list> $responseFields array of response field keys to include in the API response body * @param string $signature HMAC-SHA1 digest of the token+expire using your ImageKit.io private API key as a key. Learn how to create a signature on the page below. This should be in lowercase. * * Signature must be calculated on the server-side. This field is only required for authentication when uploading a file from the client side. * @param list $tags Set the tags while uploading the file. * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. * If this field is not specified and the file is overwritten, the existing tags will be removed. - * @param array{ - * post?: list>, pre?: string - * } $transformation Configure pre-processing (`pre`) and post-processing (`post`) transformations. + * @param Transformation|TransformationShape $transformation Configure pre-processing (`pre`) and post-processing (`post`) transformations. * * - `pre` — applied before the file is uploaded to the Media Library. * Useful for reducing file size or applying basic optimizations upfront (e.g., resize, compress). @@ -205,6 +216,7 @@ public function rename( * * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + * @param RequestOpts|null $requestOptions * * @throws APIException */ @@ -229,9 +241,9 @@ public function upload( ?array $responseFields = null, ?string $signature = null, ?array $tags = null, - ?array $transformation = null, + Transformation|array|null $transformation = null, bool $useUniqueFileName = true, ?string $webhookURL = null, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): FileUploadResponse; } diff --git a/src/ServiceContracts/FilesRawContract.php b/src/ServiceContracts/FilesRawContract.php index 01097e73..9b7501c7 100644 --- a/src/ServiceContracts/FilesRawContract.php +++ b/src/ServiceContracts/FilesRawContract.php @@ -19,6 +19,9 @@ use Imagekit\Files\FileUploadResponse; use Imagekit\RequestOptions; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface FilesRawContract { /** @@ -26,6 +29,7 @@ interface FilesRawContract * * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. * @param array|FileUpdateParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -34,13 +38,14 @@ interface FilesRawContract public function update( string $fileID, array|FileUpdateParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse; /** * @api * * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -48,13 +53,14 @@ public function update( */ public function delete( string $fileID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): BaseResponse; /** * @api * * @param array|FileCopyParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -62,13 +68,14 @@ public function delete( */ public function copy( array|FileCopyParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse; /** * @api * * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in the list and search assets API and upload API. + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -76,13 +83,14 @@ public function copy( */ public function get( string $fileID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): BaseResponse; /** * @api * * @param array|FileMoveParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -90,13 +98,14 @@ public function get( */ public function move( array|FileMoveParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse; /** * @api * * @param array|FileRenameParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -104,13 +113,14 @@ public function move( */ public function rename( array|FileRenameParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse; /** * @api * * @param array|FileUploadParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -118,6 +128,6 @@ public function rename( */ public function upload( array|FileUploadParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse; } diff --git a/src/ServiceContracts/Folders/JobContract.php b/src/ServiceContracts/Folders/JobContract.php index 01a2e7a8..1362f086 100644 --- a/src/ServiceContracts/Folders/JobContract.php +++ b/src/ServiceContracts/Folders/JobContract.php @@ -8,17 +8,21 @@ use Imagekit\Folders\Job\JobGetResponse; use Imagekit\RequestOptions; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface JobContract { /** * @api * * @param string $jobID The `jobId` is returned in the response of bulk job API e.g. copy folder or move folder API. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function get( string $jobID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): JobGetResponse; } diff --git a/src/ServiceContracts/Folders/JobRawContract.php b/src/ServiceContracts/Folders/JobRawContract.php index 16bd5b31..f46ff737 100644 --- a/src/ServiceContracts/Folders/JobRawContract.php +++ b/src/ServiceContracts/Folders/JobRawContract.php @@ -9,12 +9,16 @@ use Imagekit\Folders\Job\JobGetResponse; use Imagekit\RequestOptions; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface JobRawContract { /** * @api * * @param string $jobID The `jobId` is returned in the response of bulk job API e.g. copy folder or move folder API. + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -22,6 +26,6 @@ interface JobRawContract */ public function get( string $jobID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): BaseResponse; } diff --git a/src/ServiceContracts/FoldersContract.php b/src/ServiceContracts/FoldersContract.php index 421a7770..87ef5b64 100644 --- a/src/ServiceContracts/FoldersContract.php +++ b/src/ServiceContracts/FoldersContract.php @@ -12,6 +12,9 @@ use Imagekit\Folders\FolderRenameResponse; use Imagekit\RequestOptions; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface FoldersContract { /** @@ -23,25 +26,27 @@ interface FoldersContract * @param string $parentFolderPath The folder where the new folder should be created, for root use `/` else the path e.g. `containing/folder/`. * * Note: If any folder(s) is not present in the parentFolderPath parameter, it will be automatically created. For example, if you pass `/product/images/summer`, then `product`, `images`, and `summer` folders will be created if they don't already exist. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function create( string $folderName, string $parentFolderPath, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): FolderNewResponse; /** * @api * * @param string $folderPath Full path to the folder you want to delete. For example `/folder/to/delete/`. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function delete( string $folderPath, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): FolderDeleteResponse; /** @@ -50,6 +55,7 @@ public function delete( * @param string $destinationPath full path to the destination folder where you want to copy the source folder into * @param string $sourceFolderPath the full path to the source folder you want to copy * @param bool $includeVersions Option to copy all versions of files that are nested inside the selected folder. By default, only the current version of each file will be copied. When set to true, all versions of each file will be copied. Default value - `false`. + * @param RequestOpts|null $requestOptions * * @throws APIException */ @@ -57,7 +63,7 @@ public function copy( string $destinationPath, string $sourceFolderPath, ?bool $includeVersions = null, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): FolderCopyResponse; /** @@ -65,13 +71,14 @@ public function copy( * * @param string $destinationPath full path to the destination folder where you want to move the source folder into * @param string $sourceFolderPath the full path to the source folder you want to move + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function move( string $destinationPath, string $sourceFolderPath, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): FolderMoveResponse; /** @@ -88,6 +95,7 @@ public function move( * Note: A purge cache request will be issued against `https://ik.imagekit.io/old/folder/path*` (with a wildcard at the end). This will remove all nested files, their versions' URLs, and any transformations made using query parameters on these files or their versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. * * Default value - `false` + * @param RequestOpts|null $requestOptions * * @throws APIException */ @@ -95,6 +103,6 @@ public function rename( string $folderPath, string $newFolderName, ?bool $purgeCache = null, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): FolderRenameResponse; } diff --git a/src/ServiceContracts/FoldersRawContract.php b/src/ServiceContracts/FoldersRawContract.php index b1413611..973814f7 100644 --- a/src/ServiceContracts/FoldersRawContract.php +++ b/src/ServiceContracts/FoldersRawContract.php @@ -18,12 +18,16 @@ use Imagekit\Folders\FolderRenameResponse; use Imagekit\RequestOptions; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ interface FoldersRawContract { /** * @api * * @param array|FolderCreateParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -31,13 +35,14 @@ interface FoldersRawContract */ public function create( array|FolderCreateParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse; /** * @api * * @param array|FolderDeleteParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -45,13 +50,14 @@ public function create( */ public function delete( array|FolderDeleteParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse; /** * @api * * @param array|FolderCopyParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -59,13 +65,14 @@ public function delete( */ public function copy( array|FolderCopyParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse; /** * @api * * @param array|FolderMoveParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -73,13 +80,14 @@ public function copy( */ public function move( array|FolderMoveParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse; /** * @api * * @param array|FolderRenameParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -87,6 +95,6 @@ public function move( */ public function rename( array|FolderRenameParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse; } diff --git a/src/Services/Accounts/OriginsRawService.php b/src/Services/Accounts/OriginsRawService.php index 7cbdaeef..d4d6c37f 100644 --- a/src/Services/Accounts/OriginsRawService.php +++ b/src/Services/Accounts/OriginsRawService.php @@ -22,6 +22,9 @@ use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Accounts\OriginsRawContract; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class OriginsRawService implements OriginsRawContract { // @phpstan-ignore-next-line @@ -59,6 +62,7 @@ public function __construct(private Client $client) {} * password: string, * username: string, * }|OriginCreateParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -66,7 +70,7 @@ public function __construct(private Client $client) {} */ public function create( array|OriginCreateParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = OriginCreateParams::parseRequest( $params, @@ -113,6 +117,7 @@ public function create( * password: string, * username: string, * }|OriginUpdateParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -121,7 +126,7 @@ public function create( public function update( string $id, array|OriginUpdateParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = OriginUpdateParams::parseRequest( $params, @@ -144,12 +149,15 @@ public function update( * **Note:** This API is currently in beta. * Returns an array of all configured origins for the current account. * + * @param RequestOpts|null $requestOptions + * * @return BaseResponse,> * * @throws APIException */ - public function list(?RequestOptions $requestOptions = null): BaseResponse - { + public function list( + RequestOptions|array|null $requestOptions = null + ): BaseResponse { // @phpstan-ignore-next-line return.type return $this->client->request( method: 'get', @@ -166,6 +174,7 @@ public function list(?RequestOptions $requestOptions = null): BaseResponse * Permanently removes the origin identified by `id`. If the origin is in use by any URL‑endpoints, the API will return an error. * * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -173,7 +182,7 @@ public function list(?RequestOptions $requestOptions = null): BaseResponse */ public function delete( string $id, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): BaseResponse { // @phpstan-ignore-next-line return.type return $this->client->request( @@ -191,6 +200,7 @@ public function delete( * Retrieves the origin identified by `id`. * * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -198,7 +208,7 @@ public function delete( */ public function get( string $id, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): BaseResponse { // @phpstan-ignore-next-line return.type return $this->client->request( diff --git a/src/Services/Accounts/OriginsService.php b/src/Services/Accounts/OriginsService.php index e1ce9b04..f38b5eef 100644 --- a/src/Services/Accounts/OriginsService.php +++ b/src/Services/Accounts/OriginsService.php @@ -18,6 +18,9 @@ use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Accounts\OriginsContract; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class OriginsService implements OriginsContract { /** @@ -53,6 +56,7 @@ public function __construct(private Client $client) * @param bool $includeCanonicalHeader whether to send a Canonical header * @param bool $s3ForcePathStyle Use path-style S3 URLs? * @param bool $forwardHostHeaderToOrigin Forward the Host header to origin? + * @param RequestOpts|null $requestOptions * * @throws APIException */ @@ -78,7 +82,7 @@ public function create( string $prefix = '', bool $s3ForcePathStyle = false, bool $forwardHostHeaderToOrigin = false, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|GoogleCloudStorageGcs|AzureBlobStorage|AkeneoPim { $params = Util::removeNulls( [ @@ -133,6 +137,7 @@ public function create( * @param bool $includeCanonicalHeader whether to send a Canonical header * @param bool $s3ForcePathStyle Use path-style S3 URLs? * @param bool $forwardHostHeaderToOrigin Forward the Host header to origin? + * @param RequestOpts|null $requestOptions * * @throws APIException */ @@ -159,7 +164,7 @@ public function update( string $prefix = '', bool $s3ForcePathStyle = false, bool $forwardHostHeaderToOrigin = false, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|GoogleCloudStorageGcs|AzureBlobStorage|AkeneoPim { $params = Util::removeNulls( [ @@ -199,12 +204,15 @@ public function update( * **Note:** This API is currently in beta. * Returns an array of all configured origins for the current account. * + * @param RequestOpts|null $requestOptions + * * @return list * * @throws APIException */ - public function list(?RequestOptions $requestOptions = null): array - { + public function list( + RequestOptions|array|null $requestOptions = null + ): array { // @phpstan-ignore-next-line argument.type $response = $this->raw->list(requestOptions: $requestOptions); @@ -218,12 +226,13 @@ public function list(?RequestOptions $requestOptions = null): array * Permanently removes the origin identified by `id`. If the origin is in use by any URL‑endpoints, the API will return an error. * * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function delete( string $id, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): mixed { // @phpstan-ignore-next-line argument.type $response = $this->raw->delete($id, requestOptions: $requestOptions); @@ -238,12 +247,13 @@ public function delete( * Retrieves the origin identified by `id`. * * @param string $id Unique identifier for the origin. This is generated by ImageKit when you create a new origin. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function get( string $id, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|GoogleCloudStorageGcs|AzureBlobStorage|AkeneoPim { // @phpstan-ignore-next-line argument.type $response = $this->raw->get($id, requestOptions: $requestOptions); diff --git a/src/Services/Accounts/URLEndpointsRawService.php b/src/Services/Accounts/URLEndpointsRawService.php index 4db052e2..2dadaa3a 100644 --- a/src/Services/Accounts/URLEndpointsRawService.php +++ b/src/Services/Accounts/URLEndpointsRawService.php @@ -14,6 +14,11 @@ use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Accounts\URLEndpointsRawContract; +/** + * @phpstan-import-type URLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter + * @phpstan-import-type URLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter as URLRewriterShape1 + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class URLEndpointsRawService implements URLEndpointsRawContract { // @phpstan-ignore-next-line @@ -32,8 +37,9 @@ public function __construct(private Client $client) {} * description: string, * origins?: list, * urlPrefix?: string, - * urlRewriter?: array, + * urlRewriter?: URLRewriterShape, * }|URLEndpointCreateParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -41,7 +47,7 @@ public function __construct(private Client $client) {} */ public function create( array|URLEndpointCreateParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = URLEndpointCreateParams::parseRequest( $params, @@ -69,8 +75,9 @@ public function create( * description: string, * origins?: list, * urlPrefix?: string, - * urlRewriter?: array, + * urlRewriter?: URLRewriterShape1, * }|URLEndpointUpdateParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -79,7 +86,7 @@ public function create( public function update( string $id, array|URLEndpointUpdateParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = URLEndpointUpdateParams::parseRequest( $params, @@ -102,12 +109,15 @@ public function update( * **Note:** This API is currently in beta. * Returns an array of all URL‑endpoints configured including the default URL-endpoint generated by ImageKit during account creation. * + * @param RequestOpts|null $requestOptions + * * @return BaseResponse> * * @throws APIException */ - public function list(?RequestOptions $requestOptions = null): BaseResponse - { + public function list( + RequestOptions|array|null $requestOptions = null + ): BaseResponse { // @phpstan-ignore-next-line return.type return $this->client->request( method: 'get', @@ -124,6 +134,7 @@ public function list(?RequestOptions $requestOptions = null): BaseResponse * Deletes the URL‑endpoint identified by `id`. You cannot delete the default URL‑endpoint created by ImageKit during account creation. * * @param string $id Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -131,7 +142,7 @@ public function list(?RequestOptions $requestOptions = null): BaseResponse */ public function delete( string $id, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): BaseResponse { // @phpstan-ignore-next-line return.type return $this->client->request( @@ -149,6 +160,7 @@ public function delete( * Retrieves the URL‑endpoint identified by `id`. * * @param string $id Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -156,7 +168,7 @@ public function delete( */ public function get( string $id, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): BaseResponse { // @phpstan-ignore-next-line return.type return $this->client->request( diff --git a/src/Services/Accounts/URLEndpointsService.php b/src/Services/Accounts/URLEndpointsService.php index e2578f03..5637058d 100644 --- a/src/Services/Accounts/URLEndpointsService.php +++ b/src/Services/Accounts/URLEndpointsService.php @@ -4,6 +4,9 @@ namespace Imagekit\Services\Accounts; +use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\AkamaiURLRewriter; +use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\CloudinaryURLRewriter; +use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\ImgixURLRewriter; use Imagekit\Accounts\URLEndpoints\URLEndpointResponse; use Imagekit\Client; use Imagekit\Core\Exceptions\APIException; @@ -11,6 +14,11 @@ use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Accounts\URLEndpointsContract; +/** + * @phpstan-import-type URLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter + * @phpstan-import-type URLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter as URLRewriterShape1 + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class URLEndpointsService implements URLEndpointsContract { /** @@ -35,7 +43,8 @@ public function __construct(private Client $client) * @param string $description description of the URL endpoint * @param list $origins Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) - * @param array $urlRewriter configuration for third-party URL rewriting + * @param URLRewriterShape $urlRewriter configuration for third-party URL rewriting + * @param RequestOpts|null $requestOptions * * @throws APIException */ @@ -43,8 +52,8 @@ public function create( string $description, array $origins = [], string $urlPrefix = '', - ?array $urlRewriter = null, - ?RequestOptions $requestOptions = null, + CloudinaryURLRewriter|array|ImgixURLRewriter|AkamaiURLRewriter|null $urlRewriter = null, + RequestOptions|array|null $requestOptions = null, ): URLEndpointResponse { $params = Util::removeNulls( [ @@ -71,7 +80,8 @@ public function create( * @param string $description description of the URL endpoint * @param list $origins Ordered list of origin IDs to try when the file isn’t in the Media Library; ImageKit checks them in the sequence provided. Origin must be created before it can be used in a URL endpoint. * @param string $urlPrefix path segment appended to your base URL to form the endpoint (letters, digits, and hyphens only — or empty for the default endpoint) - * @param array $urlRewriter configuration for third-party URL rewriting + * @param URLRewriterShape1 $urlRewriter configuration for third-party URL rewriting + * @param RequestOpts|null $requestOptions * * @throws APIException */ @@ -80,8 +90,8 @@ public function update( string $description, array $origins = [], string $urlPrefix = '', - ?array $urlRewriter = null, - ?RequestOptions $requestOptions = null, + \Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\CloudinaryURLRewriter|array|\Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\ImgixURLRewriter|\Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\AkamaiURLRewriter|null $urlRewriter = null, + RequestOptions|array|null $requestOptions = null, ): URLEndpointResponse { $params = Util::removeNulls( [ @@ -104,12 +114,15 @@ public function update( * **Note:** This API is currently in beta. * Returns an array of all URL‑endpoints configured including the default URL-endpoint generated by ImageKit during account creation. * + * @param RequestOpts|null $requestOptions + * * @return list * * @throws APIException */ - public function list(?RequestOptions $requestOptions = null): array - { + public function list( + RequestOptions|array|null $requestOptions = null + ): array { // @phpstan-ignore-next-line argument.type $response = $this->raw->list(requestOptions: $requestOptions); @@ -123,12 +136,13 @@ public function list(?RequestOptions $requestOptions = null): array * Deletes the URL‑endpoint identified by `id`. You cannot delete the default URL‑endpoint created by ImageKit during account creation. * * @param string $id Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function delete( string $id, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): mixed { // @phpstan-ignore-next-line argument.type $response = $this->raw->delete($id, requestOptions: $requestOptions); @@ -143,12 +157,13 @@ public function delete( * Retrieves the URL‑endpoint identified by `id`. * * @param string $id Unique identifier for the URL-endpoint. This is generated by ImageKit when you create a new URL-endpoint. For the default URL-endpoint, this is always `default`. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function get( string $id, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): URLEndpointResponse { // @phpstan-ignore-next-line argument.type $response = $this->raw->get($id, requestOptions: $requestOptions); diff --git a/src/Services/Accounts/UsageRawService.php b/src/Services/Accounts/UsageRawService.php index f24c089a..43933f7a 100644 --- a/src/Services/Accounts/UsageRawService.php +++ b/src/Services/Accounts/UsageRawService.php @@ -12,6 +12,9 @@ use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Accounts\UsageRawContract; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class UsageRawService implements UsageRawContract { // @phpstan-ignore-next-line @@ -26,6 +29,7 @@ public function __construct(private Client $client) {} * Get the account usage information between two dates. Note that the API response includes data from the start date while excluding data from the end date. In other words, the data covers the period starting from the specified start date up to, but not including, the end date. * * @param array{endDate: string, startDate: string}|UsageGetParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -33,7 +37,7 @@ public function __construct(private Client $client) {} */ public function get( array|UsageGetParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = UsageGetParams::parseRequest( $params, diff --git a/src/Services/Accounts/UsageService.php b/src/Services/Accounts/UsageService.php index 589ee275..8d74cbf2 100644 --- a/src/Services/Accounts/UsageService.php +++ b/src/Services/Accounts/UsageService.php @@ -11,6 +11,9 @@ use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Accounts\UsageContract; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class UsageService implements UsageContract { /** @@ -33,13 +36,14 @@ public function __construct(private Client $client) * * @param string $endDate Specify a `endDate` in `YYYY-MM-DD` format. It should be after the `startDate`. The difference between `startDate` and `endDate` should be less than 90 days. * @param string $startDate Specify a `startDate` in `YYYY-MM-DD` format. It should be before the `endDate`. The difference between `startDate` and `endDate` should be less than 90 days. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function get( string $endDate, string $startDate, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): UsageGetResponse { $params = Util::removeNulls( ['endDate' => $endDate, 'startDate' => $startDate] diff --git a/src/Services/AssetsRawService.php b/src/Services/AssetsRawService.php index 98e88d7a..37332460 100644 --- a/src/Services/AssetsRawService.php +++ b/src/Services/AssetsRawService.php @@ -18,6 +18,9 @@ use Imagekit\RequestOptions; use Imagekit\ServiceContracts\AssetsRawContract; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class AssetsRawService implements AssetsRawContract { // @phpstan-ignore-next-line @@ -32,14 +35,15 @@ public function __construct(private Client $client) {} * This API can list all the uploaded files and folders in your ImageKit.io media library. In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and provide this generated string as the value of the `searchQuery`. * * @param array{ - * fileType?: 'all'|'image'|'non-image'|FileType, + * fileType?: FileType|value-of, * limit?: int, * path?: string, * searchQuery?: string, * skip?: int, * sort?: value-of, - * type?: 'file'|'file-version'|'folder'|'all'|Type, + * type?: Type|value-of, * }|AssetListParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse> * @@ -47,7 +51,7 @@ public function __construct(private Client $client) {} */ public function list( array|AssetListParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = AssetListParams::parseRequest( $params, diff --git a/src/Services/AssetsService.php b/src/Services/AssetsService.php index 66aba91f..e437ce59 100644 --- a/src/Services/AssetsService.php +++ b/src/Services/AssetsService.php @@ -15,6 +15,9 @@ use Imagekit\RequestOptions; use Imagekit\ServiceContracts\AssetsContract; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class AssetsService implements AssetsContract { /** @@ -35,7 +38,7 @@ public function __construct(private Client $client) * * This API can list all the uploaded files and folders in your ImageKit.io media library. In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and provide this generated string as the value of the `searchQuery`. * - * @param 'all'|'image'|'non-image'|FileType $fileType Filter results by file type. + * @param FileType|value-of $fileType Filter results by file type. * * - `all` — include all file types * - `image` — include only image files @@ -55,27 +58,28 @@ public function __construct(private Client $client) * * [Learn more](/docs/api-reference/digital-asset-management-dam/list-and-search-assets#advanced-search-queries) from examples. * @param int $skip the number of results to skip before returning results - * @param 'ASC_NAME'|'DESC_NAME'|'ASC_CREATED'|'DESC_CREATED'|'ASC_UPDATED'|'DESC_UPDATED'|'ASC_HEIGHT'|'DESC_HEIGHT'|'ASC_WIDTH'|'DESC_WIDTH'|'ASC_SIZE'|'DESC_SIZE'|'ASC_RELEVANCE'|'DESC_RELEVANCE'|Sort $sort sort the results by one of the supported fields in ascending or descending order - * @param 'file'|'file-version'|'folder'|'all'|Type $type Filter results by asset type. + * @param Sort|value-of $sort sort the results by one of the supported fields in ascending or descending order + * @param Type|value-of $type Filter results by asset type. * * - `file` — returns only files * - `file-version` — returns specific file versions * - `folder` — returns only folders * - `all` — returns both files and folders (excludes `file-version`) + * @param RequestOpts|null $requestOptions * * @return list * * @throws APIException */ public function list( - string|FileType $fileType = 'all', + FileType|string $fileType = 'all', int $limit = 1000, ?string $path = null, ?string $searchQuery = null, int $skip = 0, - string|Sort $sort = 'ASC_CREATED', - string|Type $type = 'file', - ?RequestOptions $requestOptions = null, + Sort|string $sort = 'ASC_CREATED', + Type|string $type = 'file', + RequestOptions|array|null $requestOptions = null, ): array { $params = Util::removeNulls( [ diff --git a/src/Services/Beta/V2/FilesRawService.php b/src/Services/Beta/V2/FilesRawService.php index 17b7fc92..d63153f7 100644 --- a/src/Services/Beta/V2/FilesRawService.php +++ b/src/Services/Beta/V2/FilesRawService.php @@ -6,6 +6,7 @@ use Imagekit\Beta\V2\Files\FileUploadParams; use Imagekit\Beta\V2\Files\FileUploadParams\ResponseField; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation; use Imagekit\Beta\V2\Files\FileUploadResponse; use Imagekit\Client; use Imagekit\Core\Contracts\BaseResponse; @@ -13,6 +14,11 @@ use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Beta\V2\FilesRawContract; +/** + * @phpstan-import-type ExtensionItemShape from \Imagekit\ExtensionItem + * @phpstan-import-type TransformationShape from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class FilesRawService implements FilesRawContract { // @phpstan-ignore-next-line @@ -47,7 +53,7 @@ public function __construct(private Client $client) {} * customCoordinates?: string, * customMetadata?: array, * description?: string, - * extensions?: list>, + * extensions?: list, * folder?: string, * isPrivateFile?: bool, * isPublished?: bool, @@ -55,12 +61,13 @@ public function __construct(private Client $client) {} * overwriteCustomMetadata?: bool, * overwriteFile?: bool, * overwriteTags?: bool, - * responseFields?: list<'tags'|'customCoordinates'|'isPrivateFile'|'embeddedMetadata'|'isPublished'|'customMetadata'|'metadata'|'selectedFieldsSchema'|ResponseField>, + * responseFields?: list>, * tags?: list, - * transformation?: array{post?: list>, pre?: string}, + * transformation?: Transformation|TransformationShape, * useUniqueFileName?: bool, * webhookURL?: string, * }|FileUploadParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -68,7 +75,7 @@ public function __construct(private Client $client) {} */ public function upload( array|FileUploadParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = FileUploadParams::parseRequest( $params, diff --git a/src/Services/Beta/V2/FilesService.php b/src/Services/Beta/V2/FilesService.php index f7bcf38d..63e57f4b 100644 --- a/src/Services/Beta/V2/FilesService.php +++ b/src/Services/Beta/V2/FilesService.php @@ -5,6 +5,7 @@ namespace Imagekit\Services\Beta\V2; use Imagekit\Beta\V2\Files\FileUploadParams\ResponseField; +use Imagekit\Beta\V2\Files\FileUploadParams\Transformation; use Imagekit\Beta\V2\Files\FileUploadResponse; use Imagekit\Client; use Imagekit\Core\Exceptions\APIException; @@ -12,6 +13,11 @@ use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Beta\V2\FilesContract; +/** + * @phpstan-import-type ExtensionItemShape from \Imagekit\ExtensionItem + * @phpstan-import-type TransformationShape from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class FilesService implements FilesContract { /** @@ -63,7 +69,7 @@ public function __construct(private Client $client) * - If this field is not specified and the file is overwritten, then customCoordinates will be removed. * @param array $customMetadata JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. * @param string $description optional text to describe the contents of the file - * @param list> $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. + * @param list $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * @param string $folder The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. Using multiple `/` creates a nested folder. * @param bool $isPrivateFile Whether to mark the file as private or not. * @@ -77,13 +83,11 @@ public function __construct(private Client $client) * @param bool $overwriteCustomMetadata if the request does not have `customMetadata`, and a file already exists at the exact location, existing customMetadata will be removed * @param bool $overwriteFile if `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed - * @param list<'tags'|'customCoordinates'|'isPrivateFile'|'embeddedMetadata'|'isPublished'|'customMetadata'|'metadata'|'selectedFieldsSchema'|ResponseField> $responseFields array of response field keys to include in the API response body + * @param list> $responseFields array of response field keys to include in the API response body * @param list $tags Set the tags while uploading the file. * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. * If this field is not specified and the file is overwritten, the existing tags will be removed. - * @param array{ - * post?: list>, pre?: string - * } $transformation Configure pre-processing (`pre`) and post-processing (`post`) transformations. + * @param Transformation|TransformationShape $transformation Configure pre-processing (`pre`) and post-processing (`post`) transformations. * * - `pre` — applied before the file is uploaded to the Media Library. * Useful for reducing file size or applying basic optimizations upfront (e.g., resize, compress). @@ -98,6 +102,7 @@ public function __construct(private Client $client) * * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + * @param RequestOpts|null $requestOptions * * @throws APIException */ @@ -119,10 +124,10 @@ public function upload( bool $overwriteTags = true, ?array $responseFields = null, ?array $tags = null, - ?array $transformation = null, + Transformation|array|null $transformation = null, bool $useUniqueFileName = true, ?string $webhookURL = null, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): FileUploadResponse { $params = Util::removeNulls( [ diff --git a/src/Services/Cache/InvalidationRawService.php b/src/Services/Cache/InvalidationRawService.php index 4fe31ebd..91d5267c 100644 --- a/src/Services/Cache/InvalidationRawService.php +++ b/src/Services/Cache/InvalidationRawService.php @@ -13,6 +13,9 @@ use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Cache\InvalidationRawContract; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class InvalidationRawService implements InvalidationRawContract { // @phpstan-ignore-next-line @@ -27,6 +30,7 @@ public function __construct(private Client $client) {} * This API will purge CDN cache and ImageKit.io's internal cache for a file. Note: Purge cache is an asynchronous process and it may take some time to reflect the changes. * * @param array{url: string}|InvalidationCreateParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -34,7 +38,7 @@ public function __construct(private Client $client) {} */ public function create( array|InvalidationCreateParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = InvalidationCreateParams::parseRequest( $params, @@ -57,6 +61,7 @@ public function create( * This API returns the status of a purge cache request. * * @param string $requestID should be a valid requestId + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -64,7 +69,7 @@ public function create( */ public function get( string $requestID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): BaseResponse { // @phpstan-ignore-next-line return.type return $this->client->request( diff --git a/src/Services/Cache/InvalidationService.php b/src/Services/Cache/InvalidationService.php index f887234e..0caa2ee1 100644 --- a/src/Services/Cache/InvalidationService.php +++ b/src/Services/Cache/InvalidationService.php @@ -12,6 +12,9 @@ use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Cache\InvalidationContract; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class InvalidationService implements InvalidationContract { /** @@ -33,12 +36,13 @@ public function __construct(private Client $client) * This API will purge CDN cache and ImageKit.io's internal cache for a file. Note: Purge cache is an asynchronous process and it may take some time to reflect the changes. * * @param string $url the full URL of the file to be purged + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function create( string $url, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): InvalidationNewResponse { $params = Util::removeNulls(['url' => $url]); @@ -54,12 +58,13 @@ public function create( * This API returns the status of a purge cache request. * * @param string $requestID should be a valid requestId + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function get( string $requestID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): InvalidationGetResponse { // @phpstan-ignore-next-line argument.type $response = $this->raw->get($requestID, requestOptions: $requestOptions); diff --git a/src/Services/CustomMetadataFieldsRawService.php b/src/Services/CustomMetadataFieldsRawService.php index 5650c84b..6a93b197 100644 --- a/src/Services/CustomMetadataFieldsRawService.php +++ b/src/Services/CustomMetadataFieldsRawService.php @@ -10,13 +10,18 @@ use Imagekit\Core\Exceptions\APIException; use Imagekit\CustomMetadataFields\CustomMetadataField; use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams; -use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\Type; +use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; use Imagekit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; use Imagekit\CustomMetadataFields\CustomMetadataFieldListParams; use Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\CustomMetadataFieldsRawContract; +/** + * @phpstan-import-type SchemaShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema + * @phpstan-import-type SchemaShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema as SchemaShape1 + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class CustomMetadataFieldsRawService implements CustomMetadataFieldsRawContract { // @phpstan-ignore-next-line @@ -31,19 +36,9 @@ public function __construct(private Client $client) {} * This API creates a new custom metadata field. Once a custom metadata field is created either through this API or using the dashboard UI, its value can be set on the assets. The value of a field for an asset can be set using the media library UI or programmatically through upload or update assets API. * * @param array{ - * label: string, - * name: string, - * schema: array{ - * type: 'Text'|'Textarea'|'Number'|'Date'|'Boolean'|'SingleSelect'|'MultiSelect'|Type, - * defaultValue?: mixed, - * isValueRequired?: bool, - * maxLength?: float, - * maxValue?: string|float, - * minLength?: float, - * minValue?: string|float, - * selectOptions?: list, - * }, + * label: string, name: string, schema: Schema|SchemaShape * }|CustomMetadataFieldCreateParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -51,7 +46,7 @@ public function __construct(private Client $client) {} */ public function create( array|CustomMetadataFieldCreateParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = CustomMetadataFieldCreateParams::parseRequest( $params, @@ -76,16 +71,9 @@ public function create( * @param string $id should be a valid custom metadata field id * @param array{ * label?: string, - * schema?: array{ - * defaultValue?: mixed, - * isValueRequired?: bool, - * maxLength?: float, - * maxValue?: string|float, - * minLength?: float, - * minValue?: string|float, - * selectOptions?: list, - * }, + * schema?: CustomMetadataFieldUpdateParams\Schema|SchemaShape1, * }|CustomMetadataFieldUpdateParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -94,7 +82,7 @@ public function create( public function update( string $id, array|CustomMetadataFieldUpdateParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = CustomMetadataFieldUpdateParams::parseRequest( $params, @@ -121,6 +109,7 @@ public function update( * @param array{ * folderPath?: string, includeDeleted?: bool * }|CustomMetadataFieldListParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse> * @@ -128,7 +117,7 @@ public function update( */ public function list( array|CustomMetadataFieldListParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = CustomMetadataFieldListParams::parseRequest( $params, @@ -151,6 +140,7 @@ public function list( * This API deletes a custom metadata field. Even after deleting a custom metadata field, you cannot create any new custom metadata field with the same name. * * @param string $id should be a valid custom metadata field id + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -158,7 +148,7 @@ public function list( */ public function delete( string $id, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): BaseResponse { // @phpstan-ignore-next-line return.type return $this->client->request( diff --git a/src/Services/CustomMetadataFieldsService.php b/src/Services/CustomMetadataFieldsService.php index eccbbae3..d0e03ec1 100644 --- a/src/Services/CustomMetadataFieldsService.php +++ b/src/Services/CustomMetadataFieldsService.php @@ -8,11 +8,16 @@ use Imagekit\Core\Exceptions\APIException; use Imagekit\Core\Util; use Imagekit\CustomMetadataFields\CustomMetadataField; -use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\Type; +use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; use Imagekit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\CustomMetadataFieldsContract; +/** + * @phpstan-import-type SchemaShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema + * @phpstan-import-type SchemaShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema as SchemaShape1 + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class CustomMetadataFieldsService implements CustomMetadataFieldsContract { /** @@ -35,24 +40,16 @@ public function __construct(private Client $client) * * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. * @param string $name API name of the custom metadata field. This should be unique across all (including deleted) custom metadata fields. - * @param array{ - * type: 'Text'|'Textarea'|'Number'|'Date'|'Boolean'|'SingleSelect'|'MultiSelect'|Type, - * defaultValue?: mixed, - * isValueRequired?: bool, - * maxLength?: float, - * maxValue?: string|float, - * minLength?: float, - * minValue?: string|float, - * selectOptions?: list, - * } $schema + * @param Schema|SchemaShape $schema + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function create( string $label, string $name, - array $schema, - ?RequestOptions $requestOptions = null, + Schema|array $schema, + RequestOptions|array|null $requestOptions = null, ): CustomMetadataField { $params = Util::removeNulls( ['label' => $label, 'name' => $name, 'schema' => $schema] @@ -71,23 +68,16 @@ public function create( * * @param string $id should be a valid custom metadata field id * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. This parameter is required if `schema` is not provided. - * @param array{ - * defaultValue?: mixed, - * isValueRequired?: bool, - * maxLength?: float, - * maxValue?: string|float, - * minLength?: float, - * minValue?: string|float, - * selectOptions?: list, - * } $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. + * @param \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema|SchemaShape1 $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function update( string $id, ?string $label = null, - ?array $schema = null, - ?RequestOptions $requestOptions = null, + \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema|array|null $schema = null, + RequestOptions|array|null $requestOptions = null, ): CustomMetadataField { $params = Util::removeNulls(['label' => $label, 'schema' => $schema]); @@ -106,6 +96,7 @@ public function update( * * @param string $folderPath The folder path (e.g., `/path/to/folder`) for which to retrieve applicable custom metadata fields. Useful for determining path-specific field selections when the [Path policy](https://imagekit.io/docs/dam/path-policy) feature is in use. * @param bool $includeDeleted set it to `true` to include deleted field objects in the API response + * @param RequestOpts|null $requestOptions * * @return list * @@ -114,7 +105,7 @@ public function update( public function list( ?string $folderPath = null, bool $includeDeleted = false, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): array { $params = Util::removeNulls( ['folderPath' => $folderPath, 'includeDeleted' => $includeDeleted] @@ -132,12 +123,13 @@ public function list( * This API deletes a custom metadata field. Even after deleting a custom metadata field, you cannot create any new custom metadata field with the same name. * * @param string $id should be a valid custom metadata field id + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function delete( string $id, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): CustomMetadataFieldDeleteResponse { // @phpstan-ignore-next-line argument.type $response = $this->raw->delete($id, requestOptions: $requestOptions); diff --git a/src/Services/Files/BulkRawService.php b/src/Services/Files/BulkRawService.php index a9aa5c0b..02f07fdc 100644 --- a/src/Services/Files/BulkRawService.php +++ b/src/Services/Files/BulkRawService.php @@ -18,6 +18,9 @@ use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Files\BulkRawContract; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class BulkRawService implements BulkRawContract { // @phpstan-ignore-next-line @@ -36,6 +39,7 @@ public function __construct(private Client $client) {} * A maximum of 100 files can be deleted at a time. * * @param array{fileIDs: list}|BulkDeleteParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -43,7 +47,7 @@ public function __construct(private Client $client) {} */ public function delete( array|BulkDeleteParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = BulkDeleteParams::parseRequest( $params, @@ -68,6 +72,7 @@ public function delete( * @param array{ * fileIDs: list, tags: list * }|BulkAddTagsParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -75,7 +80,7 @@ public function delete( */ public function addTags( array|BulkAddTagsParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = BulkAddTagsParams::parseRequest( $params, @@ -100,6 +105,7 @@ public function addTags( * @param array{ * aiTags: list, fileIDs: list * }|BulkRemoveAITagsParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -107,7 +113,7 @@ public function addTags( */ public function removeAITags( array|BulkRemoveAITagsParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = BulkRemoveAITagsParams::parseRequest( $params, @@ -132,6 +138,7 @@ public function removeAITags( * @param array{ * fileIDs: list, tags: list * }|BulkRemoveTagsParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -139,7 +146,7 @@ public function removeAITags( */ public function removeTags( array|BulkRemoveTagsParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = BulkRemoveTagsParams::parseRequest( $params, diff --git a/src/Services/Files/BulkService.php b/src/Services/Files/BulkService.php index d189276a..b3562409 100644 --- a/src/Services/Files/BulkService.php +++ b/src/Services/Files/BulkService.php @@ -14,6 +14,9 @@ use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Files\BulkContract; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class BulkService implements BulkContract { /** @@ -39,12 +42,13 @@ public function __construct(private Client $client) * A maximum of 100 files can be deleted at a time. * * @param list $fileIDs an array of fileIds which you want to delete + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function delete( array $fileIDs, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): BulkDeleteResponse { $params = Util::removeNulls(['fileIDs' => $fileIDs]); @@ -61,13 +65,14 @@ public function delete( * * @param list $fileIDs an array of fileIds to which you want to add tags * @param list $tags an array of tags that you want to add to the files + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function addTags( array $fileIDs, array $tags, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BulkAddTagsResponse { $params = Util::removeNulls(['fileIDs' => $fileIDs, 'tags' => $tags]); @@ -84,13 +89,14 @@ public function addTags( * * @param list $aiTags an array of AITags that you want to remove from the files * @param list $fileIDs an array of fileIds from which you want to remove AITags + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function removeAITags( array $aiTags, array $fileIDs, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BulkRemoveAITagsResponse { $params = Util::removeNulls(['aiTags' => $aiTags, 'fileIDs' => $fileIDs]); @@ -107,13 +113,14 @@ public function removeAITags( * * @param list $fileIDs an array of fileIds from which you want to remove tags * @param list $tags an array of tags that you want to remove from the files + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function removeTags( array $fileIDs, array $tags, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BulkRemoveTagsResponse { $params = Util::removeNulls(['fileIDs' => $fileIDs, 'tags' => $tags]); diff --git a/src/Services/Files/MetadataRawService.php b/src/Services/Files/MetadataRawService.php index 2c17c681..400544f4 100644 --- a/src/Services/Files/MetadataRawService.php +++ b/src/Services/Files/MetadataRawService.php @@ -12,6 +12,9 @@ use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Files\MetadataRawContract; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class MetadataRawService implements MetadataRawContract { // @phpstan-ignore-next-line @@ -28,6 +31,7 @@ public function __construct(private Client $client) {} * You can also get the metadata in upload API response by passing `metadata` in `responseFields` parameter. * * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in the list and search assets API and upload API. + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -35,7 +39,7 @@ public function __construct(private Client $client) {} */ public function get( string $fileID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): BaseResponse { // @phpstan-ignore-next-line return.type return $this->client->request( @@ -52,6 +56,7 @@ public function get( * Get image EXIF, pHash, and other metadata from ImageKit.io powered remote URL using this API. * * @param array{url: string}|MetadataGetFromURLParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -59,7 +64,7 @@ public function get( */ public function getFromURL( array|MetadataGetFromURLParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = MetadataGetFromURLParams::parseRequest( $params, diff --git a/src/Services/Files/MetadataService.php b/src/Services/Files/MetadataService.php index be94b31f..5440854c 100644 --- a/src/Services/Files/MetadataService.php +++ b/src/Services/Files/MetadataService.php @@ -11,6 +11,9 @@ use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Files\MetadataContract; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class MetadataService implements MetadataContract { /** @@ -34,12 +37,13 @@ public function __construct(private Client $client) * You can also get the metadata in upload API response by passing `metadata` in `responseFields` parameter. * * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in the list and search assets API and upload API. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function get( string $fileID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): Metadata { // @phpstan-ignore-next-line argument.type $response = $this->raw->get($fileID, requestOptions: $requestOptions); @@ -53,12 +57,13 @@ public function get( * Get image EXIF, pHash, and other metadata from ImageKit.io powered remote URL using this API. * * @param string $url Should be a valid file URL. It should be accessible using your ImageKit.io account. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function getFromURL( string $url, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): Metadata { $params = Util::removeNulls(['url' => $url]); diff --git a/src/Services/Files/VersionsRawService.php b/src/Services/Files/VersionsRawService.php index d4e91400..652aa608 100644 --- a/src/Services/Files/VersionsRawService.php +++ b/src/Services/Files/VersionsRawService.php @@ -16,6 +16,9 @@ use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Files\VersionsRawContract; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class VersionsRawService implements VersionsRawContract { // @phpstan-ignore-next-line @@ -30,6 +33,7 @@ public function __construct(private Client $client) {} * This API returns details of all versions of a file. * * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. + * @param RequestOpts|null $requestOptions * * @return BaseResponse> * @@ -37,7 +41,7 @@ public function __construct(private Client $client) {} */ public function list( string $fileID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): BaseResponse { // @phpstan-ignore-next-line return.type return $this->client->request( @@ -57,6 +61,7 @@ public function list( * * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. * @param array{fileID: string}|VersionDeleteParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -65,7 +70,7 @@ public function list( public function delete( string $versionID, array|VersionDeleteParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = VersionDeleteParams::parseRequest( $params, @@ -90,6 +95,7 @@ public function delete( * * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. * @param array{fileID: string}|VersionGetParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -98,7 +104,7 @@ public function delete( public function get( string $versionID, array|VersionGetParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = VersionGetParams::parseRequest( $params, @@ -123,6 +129,7 @@ public function get( * * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. * @param array{fileID: string}|VersionRestoreParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -131,7 +138,7 @@ public function get( public function restore( string $versionID, array|VersionRestoreParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = VersionRestoreParams::parseRequest( $params, diff --git a/src/Services/Files/VersionsService.php b/src/Services/Files/VersionsService.php index d898cdba..0d0007a8 100644 --- a/src/Services/Files/VersionsService.php +++ b/src/Services/Files/VersionsService.php @@ -12,6 +12,9 @@ use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Files\VersionsContract; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class VersionsService implements VersionsContract { /** @@ -33,6 +36,7 @@ public function __construct(private Client $client) * This API returns details of all versions of a file. * * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. + * @param RequestOpts|null $requestOptions * * @return list * @@ -40,7 +44,7 @@ public function __construct(private Client $client) */ public function list( string $fileID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): array { // @phpstan-ignore-next-line argument.type $response = $this->raw->list($fileID, requestOptions: $requestOptions); @@ -57,13 +61,14 @@ public function list( * * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function delete( string $versionID, string $fileID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): VersionDeleteResponse { $params = Util::removeNulls(['fileID' => $fileID]); @@ -80,13 +85,14 @@ public function delete( * * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function get( string $versionID, string $fileID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): File { $params = Util::removeNulls(['fileID' => $fileID]); @@ -103,13 +109,14 @@ public function get( * * @param string $versionID The unique `versionId` of the uploaded file. `versionId` is returned in list and search assets API and upload API. * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function restore( string $versionID, string $fileID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): File { $params = Util::removeNulls(['fileID' => $fileID]); diff --git a/src/Services/FilesRawService.php b/src/Services/FilesRawService.php index 1029efa2..1cf5ca96 100644 --- a/src/Services/FilesRawService.php +++ b/src/Services/FilesRawService.php @@ -15,13 +15,22 @@ use Imagekit\Files\FileRenameParams; use Imagekit\Files\FileRenameResponse; use Imagekit\Files\FileUpdateParams; +use Imagekit\Files\FileUpdateParams\Publish; use Imagekit\Files\FileUpdateResponse; use Imagekit\Files\FileUploadParams; use Imagekit\Files\FileUploadParams\ResponseField; +use Imagekit\Files\FileUploadParams\Transformation; use Imagekit\Files\FileUploadResponse; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\FilesRawContract; +/** + * @phpstan-import-type RemoveAITagsShape from \Imagekit\Files\FileUpdateParams\RemoveAITags + * @phpstan-import-type PublishShape from \Imagekit\Files\FileUpdateParams\Publish + * @phpstan-import-type TransformationShape from \Imagekit\Files\FileUploadParams\Transformation + * @phpstan-import-type ExtensionItemShape from \Imagekit\ExtensionItem + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class FilesRawService implements FilesRawContract { // @phpstan-ignore-next-line @@ -40,12 +49,13 @@ public function __construct(private Client $client) {} * customCoordinates?: string|null, * customMetadata?: array, * description?: string, - * extensions?: list>, - * removeAITags?: 'all'|list, + * extensions?: list, + * removeAITags?: RemoveAITagsShape, * tags?: list|null, * webhookURL?: string, - * publish?: array{isPublished: bool, includeFileVersions?: bool}, + * publish?: Publish|PublishShape, * }|FileUpdateParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -54,7 +64,7 @@ public function __construct(private Client $client) {} public function update( string $fileID, array|FileUpdateParams $params, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = FileUpdateParams::parseRequest( $params, @@ -79,6 +89,7 @@ public function update( * Note: If a file or specific transformation has been requested in the past, then the response is cached. Deleting a file does not purge the cache. You can purge the cache using purge cache API. * * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -86,7 +97,7 @@ public function update( */ public function delete( string $fileID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): BaseResponse { // @phpstan-ignore-next-line return.type return $this->client->request( @@ -107,6 +118,7 @@ public function delete( * @param array{ * destinationPath: string, sourceFilePath: string, includeFileVersions?: bool * }|FileCopyParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -114,7 +126,7 @@ public function delete( */ public function copy( array|FileCopyParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = FileCopyParams::parseRequest( $params, @@ -137,6 +149,7 @@ public function copy( * This API returns an object with details or attributes about the current version of the file. * * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in the list and search assets API and upload API. + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -144,7 +157,7 @@ public function copy( */ public function get( string $fileID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): BaseResponse { // @phpstan-ignore-next-line return.type return $this->client->request( @@ -165,6 +178,7 @@ public function get( * @param array{ * destinationPath: string, sourceFilePath: string * }|FileMoveParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -172,7 +186,7 @@ public function get( */ public function move( array|FileMoveParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = FileMoveParams::parseRequest( $params, @@ -199,6 +213,7 @@ public function move( * @param array{ * filePath: string, newFileName: string, purgeCache?: bool * }|FileRenameParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -206,7 +221,7 @@ public function move( */ public function rename( array|FileRenameParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = FileRenameParams::parseRequest( $params, @@ -250,7 +265,7 @@ public function rename( * customMetadata?: array, * description?: string, * expire?: int, - * extensions?: list>, + * extensions?: list, * folder?: string, * isPrivateFile?: bool, * isPublished?: bool, @@ -259,13 +274,14 @@ public function rename( * overwriteFile?: bool, * overwriteTags?: bool, * publicKey?: string, - * responseFields?: list<'tags'|'customCoordinates'|'isPrivateFile'|'embeddedMetadata'|'isPublished'|'customMetadata'|'metadata'|'selectedFieldsSchema'|ResponseField>, + * responseFields?: list>, * signature?: string, * tags?: list, - * transformation?: array{post?: list>, pre?: string}, + * transformation?: Transformation|TransformationShape, * useUniqueFileName?: bool, * webhookURL?: string, * }|FileUploadParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -273,7 +289,7 @@ public function rename( */ public function upload( array|FileUploadParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = FileUploadParams::parseRequest( $params, diff --git a/src/Services/FilesService.php b/src/Services/FilesService.php index 46f5d504..e92983fc 100644 --- a/src/Services/FilesService.php +++ b/src/Services/FilesService.php @@ -11,8 +11,10 @@ use Imagekit\Files\FileCopyResponse; use Imagekit\Files\FileMoveResponse; use Imagekit\Files\FileRenameResponse; +use Imagekit\Files\FileUpdateParams\Publish; use Imagekit\Files\FileUpdateResponse; use Imagekit\Files\FileUploadParams\ResponseField; +use Imagekit\Files\FileUploadParams\Transformation; use Imagekit\Files\FileUploadResponse; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\FilesContract; @@ -20,6 +22,13 @@ use Imagekit\Services\Files\MetadataService; use Imagekit\Services\Files\VersionsService; +/** + * @phpstan-import-type RemoveAITagsShape from \Imagekit\Files\FileUpdateParams\RemoveAITags + * @phpstan-import-type PublishShape from \Imagekit\Files\FileUpdateParams\Publish + * @phpstan-import-type TransformationShape from \Imagekit\Files\FileUploadParams\Transformation + * @phpstan-import-type ExtensionItemShape from \Imagekit\ExtensionItem + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class FilesService implements FilesContract { /** @@ -62,17 +71,16 @@ public function __construct(private Client $client) * @param string|null $customCoordinates Define an important area in the image in the format `x,y,width,height` e.g. `10,10,100,100`. Send `null` to unset this value. * @param array $customMetadata A key-value data to be associated with the asset. To unset a key, send `null` value for that key. Before setting any custom metadata on an asset you have to create the field using custom metadata fields API. * @param string $description optional text to describe the contents of the file - * @param list> $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. - * @param 'all'|list $removeAITags An array of AITags associated with the file that you want to remove, e.g. `["car", "vehicle", "motorsports"]`. + * @param list $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. + * @param RemoveAITagsShape $removeAITags An array of AITags associated with the file that you want to remove, e.g. `["car", "vehicle", "motorsports"]`. * * If you want to remove all AITags associated with the file, send a string - "all". * * Note: The remove operation for `AITags` executes before any of the `extensions` are processed. * @param list|null $tags An array of tags associated with the file, such as `["tag1", "tag2"]`. Send `null` to unset all tags associated with the file. * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. - * @param array{ - * isPublished: bool, includeFileVersions?: bool - * } $publish Configure the publication status of a file and its versions + * @param Publish|PublishShape $publish configure the publication status of a file and its versions + * @param RequestOpts|null $requestOptions * * @throws APIException */ @@ -85,8 +93,8 @@ public function update( string|array|null $removeAITags = null, ?array $tags = null, ?string $webhookURL = null, - ?array $publish = null, - ?RequestOptions $requestOptions = null, + Publish|array|null $publish = null, + RequestOptions|array|null $requestOptions = null, ): FileUpdateResponse { $params = Util::removeNulls( [ @@ -115,12 +123,13 @@ public function update( * Note: If a file or specific transformation has been requested in the past, then the response is cached. Deleting a file does not purge the cache. You can purge the cache using purge cache API. * * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in list and search assets API and upload API. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function delete( string $fileID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): mixed { // @phpstan-ignore-next-line argument.type $response = $this->raw->delete($fileID, requestOptions: $requestOptions); @@ -138,6 +147,7 @@ public function delete( * @param string $destinationPath full path to the folder you want to copy the above file into * @param string $sourceFilePath the full path of the file you want to copy * @param bool $includeFileVersions Option to copy all versions of a file. By default, only the current version of the file is copied. When set to true, all versions of the file will be copied. Default value - `false`. + * @param RequestOpts|null $requestOptions * * @throws APIException */ @@ -145,7 +155,7 @@ public function copy( string $destinationPath, string $sourceFilePath, ?bool $includeFileVersions = null, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): FileCopyResponse { $params = Util::removeNulls( [ @@ -167,12 +177,13 @@ public function copy( * This API returns an object with details or attributes about the current version of the file. * * @param string $fileID The unique `fileId` of the uploaded file. `fileId` is returned in the list and search assets API and upload API. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function get( string $fileID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): File { // @phpstan-ignore-next-line argument.type $response = $this->raw->get($fileID, requestOptions: $requestOptions); @@ -189,13 +200,14 @@ public function get( * * @param string $destinationPath full path to the folder you want to move the above file into * @param string $sourceFilePath the full path of the file you want to move + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function move( string $destinationPath, string $sourceFilePath, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): FileMoveResponse { $params = Util::removeNulls( [ @@ -229,6 +241,7 @@ public function move( * When set to true, it will internally issue a purge cache request on CDN to remove cached content of old file and its versions. This purge request is counted against your monthly purge quota. * * Note: If the old file were accessible at `https://ik.imagekit.io/demo/old-filename.jpg`, a purge cache request would be issued against `https://ik.imagekit.io/demo/old-filename.jpg*` (with a wildcard at the end). It will remove the file and its versions' URLs and any transformations made using query parameters on this file or its versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. + * @param RequestOpts|null $requestOptions * * @throws APIException */ @@ -236,7 +249,7 @@ public function rename( string $filePath, string $newFileName, ?bool $purgeCache = null, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): FileRenameResponse { $params = Util::removeNulls( [ @@ -297,7 +310,7 @@ public function rename( * @param array $customMetadata JSON key-value pairs to associate with the asset. Create the custom metadata fields before setting these values. * @param string $description optional text to describe the contents of the file * @param int $expire The time until your signature is valid. It must be a [Unix time](https://en.wikipedia.org/wiki/Unix_time) in less than 1 hour into the future. It should be in seconds. This field is only required for authentication when uploading a file from the client side. - * @param list> $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. + * @param list $extensions Array of extensions to be applied to the asset. Each extension can be configured with specific parameters based on the extension type. * @param string $folder The folder path in which the image has to be uploaded. If the folder(s) didn't exist before, a new folder(s) is created. * * The folder name can contain: @@ -319,16 +332,14 @@ public function rename( * @param bool $overwriteFile if `false` and `useUniqueFileName` is also `false`, and a file already exists at the exact location, upload API will return an error immediately * @param bool $overwriteTags if the request does not have `tags`, and a file already exists at the exact location, existing tags will be removed * @param string $publicKey Your ImageKit.io public key. This field is only required for authentication when uploading a file from the client side. - * @param list<'tags'|'customCoordinates'|'isPrivateFile'|'embeddedMetadata'|'isPublished'|'customMetadata'|'metadata'|'selectedFieldsSchema'|ResponseField> $responseFields array of response field keys to include in the API response body + * @param list> $responseFields array of response field keys to include in the API response body * @param string $signature HMAC-SHA1 digest of the token+expire using your ImageKit.io private API key as a key. Learn how to create a signature on the page below. This should be in lowercase. * * Signature must be calculated on the server-side. This field is only required for authentication when uploading a file from the client side. * @param list $tags Set the tags while uploading the file. * Provide an array of tag strings (e.g. `["tag1", "tag2", "tag3"]`). The combined length of all tag characters must not exceed 500, and the `%` character is not allowed. * If this field is not specified and the file is overwritten, the existing tags will be removed. - * @param array{ - * post?: list>, pre?: string - * } $transformation Configure pre-processing (`pre`) and post-processing (`post`) transformations. + * @param Transformation|TransformationShape $transformation Configure pre-processing (`pre`) and post-processing (`post`) transformations. * * - `pre` — applied before the file is uploaded to the Media Library. * Useful for reducing file size or applying basic optimizations upfront (e.g., resize, compress). @@ -343,6 +354,7 @@ public function rename( * * If `false`, then the image is uploaded with the provided filename parameter, and any existing file with the same name is replaced. * @param string $webhookURL The final status of extensions after they have completed execution will be delivered to this endpoint as a POST request. [Learn more](/docs/api-reference/digital-asset-management-dam/managing-assets/update-file-details#webhook-payload-structure) about the webhook payload structure. + * @param RequestOpts|null $requestOptions * * @throws APIException */ @@ -367,10 +379,10 @@ public function upload( ?array $responseFields = null, ?string $signature = null, ?array $tags = null, - ?array $transformation = null, + Transformation|array|null $transformation = null, bool $useUniqueFileName = true, ?string $webhookURL = null, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): FileUploadResponse { $params = Util::removeNulls( [ diff --git a/src/Services/Folders/JobRawService.php b/src/Services/Folders/JobRawService.php index f0e7fc19..9f64052f 100644 --- a/src/Services/Folders/JobRawService.php +++ b/src/Services/Folders/JobRawService.php @@ -11,6 +11,9 @@ use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Folders\JobRawContract; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class JobRawService implements JobRawContract { // @phpstan-ignore-next-line @@ -25,6 +28,7 @@ public function __construct(private Client $client) {} * This API returns the status of a bulk job like copy and move folder operations. * * @param string $jobID The `jobId` is returned in the response of bulk job API e.g. copy folder or move folder API. + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -32,7 +36,7 @@ public function __construct(private Client $client) {} */ public function get( string $jobID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): BaseResponse { // @phpstan-ignore-next-line return.type return $this->client->request( diff --git a/src/Services/Folders/JobService.php b/src/Services/Folders/JobService.php index 0944e899..18442f06 100644 --- a/src/Services/Folders/JobService.php +++ b/src/Services/Folders/JobService.php @@ -10,6 +10,9 @@ use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Folders\JobContract; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class JobService implements JobContract { /** @@ -31,12 +34,13 @@ public function __construct(private Client $client) * This API returns the status of a bulk job like copy and move folder operations. * * @param string $jobID The `jobId` is returned in the response of bulk job API e.g. copy folder or move folder API. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function get( string $jobID, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): JobGetResponse { // @phpstan-ignore-next-line argument.type $response = $this->raw->get($jobID, requestOptions: $requestOptions); diff --git a/src/Services/FoldersRawService.php b/src/Services/FoldersRawService.php index 04747927..c88e08b9 100644 --- a/src/Services/FoldersRawService.php +++ b/src/Services/FoldersRawService.php @@ -20,6 +20,9 @@ use Imagekit\RequestOptions; use Imagekit\ServiceContracts\FoldersRawContract; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class FoldersRawService implements FoldersRawContract { // @phpstan-ignore-next-line @@ -36,6 +39,7 @@ public function __construct(private Client $client) {} * @param array{ * folderName: string, parentFolderPath: string * }|FolderCreateParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -43,7 +47,7 @@ public function __construct(private Client $client) {} */ public function create( array|FolderCreateParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = FolderCreateParams::parseRequest( $params, @@ -66,6 +70,7 @@ public function create( * This will delete a folder and all its contents permanently. The API returns an empty response. * * @param array{folderPath: string}|FolderDeleteParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -73,7 +78,7 @@ public function create( */ public function delete( array|FolderDeleteParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = FolderDeleteParams::parseRequest( $params, @@ -98,6 +103,7 @@ public function delete( * @param array{ * destinationPath: string, sourceFolderPath: string, includeVersions?: bool * }|FolderCopyParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -105,7 +111,7 @@ public function delete( */ public function copy( array|FolderCopyParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = FolderCopyParams::parseRequest( $params, @@ -130,6 +136,7 @@ public function copy( * @param array{ * destinationPath: string, sourceFolderPath: string * }|FolderMoveParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -137,7 +144,7 @@ public function copy( */ public function move( array|FolderMoveParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = FolderMoveParams::parseRequest( $params, @@ -162,6 +169,7 @@ public function move( * @param array{ * folderPath: string, newFolderName: string, purgeCache?: bool * }|FolderRenameParams $params + * @param RequestOpts|null $requestOptions * * @return BaseResponse * @@ -169,7 +177,7 @@ public function move( */ public function rename( array|FolderRenameParams $params, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null, ): BaseResponse { [$parsed, $options] = FolderRenameParams::parseRequest( $params, diff --git a/src/Services/FoldersService.php b/src/Services/FoldersService.php index 786c8fe3..4ceabed1 100644 --- a/src/Services/FoldersService.php +++ b/src/Services/FoldersService.php @@ -16,6 +16,9 @@ use Imagekit\ServiceContracts\FoldersContract; use Imagekit\Services\Folders\JobService; +/** + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + */ final class FoldersService implements FoldersContract { /** @@ -48,13 +51,14 @@ public function __construct(private Client $client) * @param string $parentFolderPath The folder where the new folder should be created, for root use `/` else the path e.g. `containing/folder/`. * * Note: If any folder(s) is not present in the parentFolderPath parameter, it will be automatically created. For example, if you pass `/product/images/summer`, then `product`, `images`, and `summer` folders will be created if they don't already exist. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function create( string $folderName, string $parentFolderPath, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): FolderNewResponse { $params = Util::removeNulls( ['folderName' => $folderName, 'parentFolderPath' => $parentFolderPath] @@ -72,12 +76,13 @@ public function create( * This will delete a folder and all its contents permanently. The API returns an empty response. * * @param string $folderPath Full path to the folder you want to delete. For example `/folder/to/delete/`. + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function delete( string $folderPath, - ?RequestOptions $requestOptions = null + RequestOptions|array|null $requestOptions = null ): FolderDeleteResponse { $params = Util::removeNulls(['folderPath' => $folderPath]); @@ -95,6 +100,7 @@ public function delete( * @param string $destinationPath full path to the destination folder where you want to copy the source folder into * @param string $sourceFolderPath the full path to the source folder you want to copy * @param bool $includeVersions Option to copy all versions of files that are nested inside the selected folder. By default, only the current version of each file will be copied. When set to true, all versions of each file will be copied. Default value - `false`. + * @param RequestOpts|null $requestOptions * * @throws APIException */ @@ -102,7 +108,7 @@ public function copy( string $destinationPath, string $sourceFolderPath, ?bool $includeVersions = null, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): FolderCopyResponse { $params = Util::removeNulls( [ @@ -125,13 +131,14 @@ public function copy( * * @param string $destinationPath full path to the destination folder where you want to move the source folder into * @param string $sourceFolderPath the full path to the source folder you want to move + * @param RequestOpts|null $requestOptions * * @throws APIException */ public function move( string $destinationPath, string $sourceFolderPath, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): FolderMoveResponse { $params = Util::removeNulls( [ @@ -162,6 +169,7 @@ public function move( * Note: A purge cache request will be issued against `https://ik.imagekit.io/old/folder/path*` (with a wildcard at the end). This will remove all nested files, their versions' URLs, and any transformations made using query parameters on these files or their versions. However, the cache for file transformations made using path parameters will persist. You can purge them using the purge API. For more details, refer to the purge API documentation. * * Default value - `false` + * @param RequestOpts|null $requestOptions * * @throws APIException */ @@ -169,7 +177,7 @@ public function rename( string $folderPath, string $newFolderName, ?bool $purgeCache = null, - ?RequestOptions $requestOptions = null, + RequestOptions|array|null $requestOptions = null, ): FolderRenameResponse { $params = Util::removeNulls( [ diff --git a/src/SolidColorOverlay.php b/src/SolidColorOverlay.php index 6d9bab73..6c85beba 100644 --- a/src/SolidColorOverlay.php +++ b/src/SolidColorOverlay.php @@ -19,7 +19,7 @@ * timing?: null|OverlayTiming|OverlayTimingShape, * color: string, * type: 'solidColor', - * transformation?: list|null, + * transformation?: list|null, * } */ final class SolidColorOverlay implements BaseModel @@ -79,7 +79,7 @@ public function __construct() * * @param OverlayPosition|OverlayPositionShape|null $position * @param OverlayTiming|OverlayTimingShape|null $timing - * @param list|null $transformation + * @param list|null $transformation */ public static function with( string $color, @@ -136,7 +136,7 @@ public function withColor(string $color): self * Control width and height of the solid color overlay. Supported transformations depend on the base/parent asset. * See overlays on [Images](https://imagekit.io/docs/add-overlays-on-images#apply-transformation-on-solid-color-overlay) and [Videos](https://imagekit.io/docs/add-overlays-on-videos#apply-transformations-on-solid-color-block-overlay). * - * @param list $transformation + * @param list $transformation */ public function withTransformation(array $transformation): self { diff --git a/src/SolidColorOverlayTransformation.php b/src/SolidColorOverlayTransformation.php index dc50ecb7..b4723171 100644 --- a/src/SolidColorOverlayTransformation.php +++ b/src/SolidColorOverlayTransformation.php @@ -9,6 +9,10 @@ use Imagekit\Core\Contracts\BaseModel; /** + * @phpstan-import-type GradientVariants from \Imagekit\SolidColorOverlayTransformation\Gradient + * @phpstan-import-type HeightVariants from \Imagekit\SolidColorOverlayTransformation\Height + * @phpstan-import-type RadiusVariants from \Imagekit\SolidColorOverlayTransformation\Radius + * @phpstan-import-type WidthVariants from \Imagekit\SolidColorOverlayTransformation\Width * @phpstan-import-type GradientShape from \Imagekit\SolidColorOverlayTransformation\Gradient * @phpstan-import-type HeightShape from \Imagekit\SolidColorOverlayTransformation\Height * @phpstan-import-type RadiusShape from \Imagekit\SolidColorOverlayTransformation\Radius @@ -43,6 +47,8 @@ final class SolidColorOverlayTransformation implements BaseModel /** * Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. * Only works if the base asset is an image. See [gradient](https://imagekit.io/docs/effects-and-enhancements#gradient---e-gradient). + * + * @var GradientVariants|null $gradient */ #[Optional] public string|bool|null $gradient; @@ -50,6 +56,8 @@ final class SolidColorOverlayTransformation implements BaseModel /** * Controls the height of the solid color overlay. Accepts a numeric value or an arithmetic expression. * Learn about [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * + * @var HeightVariants|null $height */ #[Optional] public float|string|null $height; @@ -58,7 +66,7 @@ final class SolidColorOverlayTransformation implements BaseModel * Specifies the corner radius of the solid color overlay. Set to `max` for circular or oval shape. * See [radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). * - * @var float|'max'|null $radius + * @var RadiusVariants|null $radius */ #[Optional] public float|string|null $radius; @@ -66,6 +74,8 @@ final class SolidColorOverlayTransformation implements BaseModel /** * Controls the width of the solid color overlay. Accepts a numeric value or an arithmetic expression (e.g., `bw_mul_0.2` or `bh_div_2`). * Learn about [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * + * @var WidthVariants|null $width */ #[Optional] public float|string|null $width; diff --git a/src/SolidColorOverlayTransformation/Gradient.php b/src/SolidColorOverlayTransformation/Gradient.php index b29fdad5..7091649a 100644 --- a/src/SolidColorOverlayTransformation/Gradient.php +++ b/src/SolidColorOverlayTransformation/Gradient.php @@ -12,7 +12,8 @@ * Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. * Only works if the base asset is an image. See [gradient](https://imagekit.io/docs/effects-and-enhancements#gradient---e-gradient). * - * @phpstan-type GradientShape = string|bool + * @phpstan-type GradientVariants = string|bool + * @phpstan-type GradientShape = GradientVariants */ final class Gradient implements ConverterSource { diff --git a/src/SolidColorOverlayTransformation/Height.php b/src/SolidColorOverlayTransformation/Height.php index 4e866ae5..15fac418 100644 --- a/src/SolidColorOverlayTransformation/Height.php +++ b/src/SolidColorOverlayTransformation/Height.php @@ -12,7 +12,8 @@ * Controls the height of the solid color overlay. Accepts a numeric value or an arithmetic expression. * Learn about [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). * - * @phpstan-type HeightShape = float|string + * @phpstan-type HeightVariants = float|string + * @phpstan-type HeightShape = HeightVariants */ final class Height implements ConverterSource { diff --git a/src/SolidColorOverlayTransformation/Radius.php b/src/SolidColorOverlayTransformation/Radius.php index 6f2790da..a4379239 100644 --- a/src/SolidColorOverlayTransformation/Radius.php +++ b/src/SolidColorOverlayTransformation/Radius.php @@ -12,7 +12,8 @@ * Specifies the corner radius of the solid color overlay. Set to `max` for circular or oval shape. * See [radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). * - * @phpstan-type RadiusShape = float|'max' + * @phpstan-type RadiusVariants = float|'max' + * @phpstan-type RadiusShape = RadiusVariants */ final class Radius implements ConverterSource { diff --git a/src/SolidColorOverlayTransformation/Width.php b/src/SolidColorOverlayTransformation/Width.php index 556d8dcd..9c3880b9 100644 --- a/src/SolidColorOverlayTransformation/Width.php +++ b/src/SolidColorOverlayTransformation/Width.php @@ -12,7 +12,8 @@ * Controls the width of the solid color overlay. Accepts a numeric value or an arithmetic expression (e.g., `bw_mul_0.2` or `bh_div_2`). * Learn about [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). * - * @phpstan-type WidthShape = float|string + * @phpstan-type WidthVariants = float|string + * @phpstan-type WidthShape = WidthVariants */ final class Width implements ConverterSource { diff --git a/src/SubtitleOverlay.php b/src/SubtitleOverlay.php index 5748c191..7d610a7b 100644 --- a/src/SubtitleOverlay.php +++ b/src/SubtitleOverlay.php @@ -21,7 +21,7 @@ * input: string, * type: 'subtitle', * encoding?: null|Encoding|value-of, - * transformation?: list|null, + * transformation?: list|null, * } */ final class SubtitleOverlay implements BaseModel @@ -91,7 +91,7 @@ public function __construct() * @param OverlayPosition|OverlayPositionShape|null $position * @param OverlayTiming|OverlayTimingShape|null $timing * @param Encoding|value-of|null $encoding - * @param list|null $transformation + * @param list|null $transformation */ public static function with( string $input, @@ -164,7 +164,7 @@ public function withEncoding(Encoding|string $encoding): self /** * Control styling of the subtitle. See [Styling subtitles](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer). * - * @param list $transformation + * @param list $transformation */ public function withTransformation(array $transformation): self { diff --git a/src/TextOverlay.php b/src/TextOverlay.php index 66efc691..14260f7c 100644 --- a/src/TextOverlay.php +++ b/src/TextOverlay.php @@ -21,7 +21,7 @@ * text: string, * type: 'text', * encoding?: null|Encoding|value-of, - * transformation?: list|null, + * transformation?: list|null, * } */ final class TextOverlay implements BaseModel @@ -91,7 +91,7 @@ public function __construct() * @param OverlayPosition|OverlayPositionShape|null $position * @param OverlayTiming|OverlayTimingShape|null $timing * @param Encoding|value-of|null $encoding - * @param list|null $transformation + * @param list|null $transformation */ public static function with( string $text, @@ -164,7 +164,7 @@ public function withEncoding(Encoding|string $encoding): self /** * Control styling of the text overlay. See [Text overlays](https://imagekit.io/docs/add-overlays-on-images#text-overlay). * - * @param list $transformation + * @param list $transformation */ public function withTransformation(array $transformation): self { diff --git a/src/TextOverlayTransformation.php b/src/TextOverlayTransformation.php index e459aeae..3a25bf97 100644 --- a/src/TextOverlayTransformation.php +++ b/src/TextOverlayTransformation.php @@ -11,6 +11,12 @@ use Imagekit\TextOverlayTransformation\InnerAlignment; /** + * @phpstan-import-type FontSizeVariants from \Imagekit\TextOverlayTransformation\FontSize + * @phpstan-import-type LineHeightVariants from \Imagekit\TextOverlayTransformation\LineHeight + * @phpstan-import-type PaddingVariants from \Imagekit\TextOverlayTransformation\Padding + * @phpstan-import-type RadiusVariants from \Imagekit\TextOverlayTransformation\Radius + * @phpstan-import-type RotationVariants from \Imagekit\TextOverlayTransformation\Rotation + * @phpstan-import-type WidthVariants from \Imagekit\TextOverlayTransformation\Width * @phpstan-import-type FontSizeShape from \Imagekit\TextOverlayTransformation\FontSize * @phpstan-import-type LineHeightShape from \Imagekit\TextOverlayTransformation\LineHeight * @phpstan-import-type PaddingShape from \Imagekit\TextOverlayTransformation\Padding @@ -75,6 +81,8 @@ final class TextOverlayTransformation implements BaseModel /** * Specifies the font size of the overlaid text. Accepts a numeric value or an arithmetic expression. + * + * @var FontSizeVariants|null $fontSize */ #[Optional] public float|string|null $fontSize; @@ -90,6 +98,8 @@ final class TextOverlayTransformation implements BaseModel /** * Specifies the line height of the text overlay. * Accepts integer values representing line height in points. It can also accept [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations) such as `bw_mul_0.2`, or `bh_div_20`. + * + * @var LineHeightVariants|null $lineHeight */ #[Optional] public float|string|null $lineHeight; @@ -98,6 +108,8 @@ final class TextOverlayTransformation implements BaseModel * Specifies the padding around the overlaid text. * Can be provided as a single positive integer or multiple values separated by underscores (following CSS shorthand order). * Arithmetic expressions are also accepted. + * + * @var PaddingVariants|null $padding */ #[Optional] public float|string|null $padding; @@ -106,7 +118,7 @@ final class TextOverlayTransformation implements BaseModel * Specifies the corner radius of the text overlay. * Set to `max` to achieve a circular or oval shape. * - * @var float|'max'|null $radius + * @var RadiusVariants|null $radius */ #[Optional] public float|string|null $radius; @@ -114,6 +126,8 @@ final class TextOverlayTransformation implements BaseModel /** * Specifies the rotation angle of the text overlay. * Accepts a numeric value for clockwise rotation or a string prefixed with "N" for counter-clockwise rotation. + * + * @var RotationVariants|null $rotation */ #[Optional] public float|string|null $rotation; @@ -130,6 +144,8 @@ final class TextOverlayTransformation implements BaseModel /** * Specifies the maximum width (in pixels) of the overlaid text. The text wraps automatically, and arithmetic expressions (e.g., `bw_mul_0.2` or `bh_div_2`) are supported. Useful when used in conjunction with the `background`. * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * + * @var WidthVariants|null $width */ #[Optional] public float|string|null $width; diff --git a/src/TextOverlayTransformation/FontSize.php b/src/TextOverlayTransformation/FontSize.php index eb920b34..eb8bb573 100644 --- a/src/TextOverlayTransformation/FontSize.php +++ b/src/TextOverlayTransformation/FontSize.php @@ -11,7 +11,8 @@ /** * Specifies the font size of the overlaid text. Accepts a numeric value or an arithmetic expression. * - * @phpstan-type FontSizeShape = float|string + * @phpstan-type FontSizeVariants = float|string + * @phpstan-type FontSizeShape = FontSizeVariants */ final class FontSize implements ConverterSource { diff --git a/src/TextOverlayTransformation/LineHeight.php b/src/TextOverlayTransformation/LineHeight.php index 091381d1..8ae3be18 100644 --- a/src/TextOverlayTransformation/LineHeight.php +++ b/src/TextOverlayTransformation/LineHeight.php @@ -12,7 +12,8 @@ * Specifies the line height of the text overlay. * Accepts integer values representing line height in points. It can also accept [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations) such as `bw_mul_0.2`, or `bh_div_20`. * - * @phpstan-type LineHeightShape = float|string + * @phpstan-type LineHeightVariants = float|string + * @phpstan-type LineHeightShape = LineHeightVariants */ final class LineHeight implements ConverterSource { diff --git a/src/TextOverlayTransformation/Padding.php b/src/TextOverlayTransformation/Padding.php index d3d21c2a..50da4639 100644 --- a/src/TextOverlayTransformation/Padding.php +++ b/src/TextOverlayTransformation/Padding.php @@ -13,7 +13,8 @@ * Can be provided as a single positive integer or multiple values separated by underscores (following CSS shorthand order). * Arithmetic expressions are also accepted. * - * @phpstan-type PaddingShape = float|string + * @phpstan-type PaddingVariants = float|string + * @phpstan-type PaddingShape = PaddingVariants */ final class Padding implements ConverterSource { diff --git a/src/TextOverlayTransformation/Radius.php b/src/TextOverlayTransformation/Radius.php index 058fb00c..adec7c79 100644 --- a/src/TextOverlayTransformation/Radius.php +++ b/src/TextOverlayTransformation/Radius.php @@ -12,7 +12,8 @@ * Specifies the corner radius of the text overlay. * Set to `max` to achieve a circular or oval shape. * - * @phpstan-type RadiusShape = float|'max' + * @phpstan-type RadiusVariants = float|'max' + * @phpstan-type RadiusShape = RadiusVariants */ final class Radius implements ConverterSource { diff --git a/src/TextOverlayTransformation/Rotation.php b/src/TextOverlayTransformation/Rotation.php index 84f3c988..d62ee898 100644 --- a/src/TextOverlayTransformation/Rotation.php +++ b/src/TextOverlayTransformation/Rotation.php @@ -12,7 +12,8 @@ * Specifies the rotation angle of the text overlay. * Accepts a numeric value for clockwise rotation or a string prefixed with "N" for counter-clockwise rotation. * - * @phpstan-type RotationShape = float|string + * @phpstan-type RotationVariants = float|string + * @phpstan-type RotationShape = RotationVariants */ final class Rotation implements ConverterSource { diff --git a/src/TextOverlayTransformation/Width.php b/src/TextOverlayTransformation/Width.php index 8f4b12b5..bd54a319 100644 --- a/src/TextOverlayTransformation/Width.php +++ b/src/TextOverlayTransformation/Width.php @@ -12,7 +12,8 @@ * Specifies the maximum width (in pixels) of the overlaid text. The text wraps automatically, and arithmetic expressions (e.g., `bw_mul_0.2` or `bh_div_2`) are supported. Useful when used in conjunction with the `background`. * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). * - * @phpstan-type WidthShape = float|string + * @phpstan-type WidthVariants = float|string + * @phpstan-type WidthShape = WidthVariants */ final class Width implements ConverterSource { diff --git a/src/Transformation.php b/src/Transformation.php index 64d6a82c..b0fc96a9 100644 --- a/src/Transformation.php +++ b/src/Transformation.php @@ -20,6 +20,25 @@ * You can use the `raw` parameter to pass the transformation string directly. * See the [Transformations documentation](https://imagekit.io/docs/transformations). * + * @phpstan-import-type AIDropShadowVariants from \Imagekit\Transformation\AIDropShadow + * @phpstan-import-type AspectRatioVariants from \Imagekit\Transformation\AspectRatio + * @phpstan-import-type DurationVariants from \Imagekit\Transformation\Duration + * @phpstan-import-type EndOffsetVariants from \Imagekit\Transformation\EndOffset + * @phpstan-import-type GradientVariants from \Imagekit\Transformation\Gradient + * @phpstan-import-type HeightVariants from \Imagekit\Transformation\Height + * @phpstan-import-type PageVariants from \Imagekit\Transformation\Page + * @phpstan-import-type RadiusVariants from \Imagekit\Transformation\Radius + * @phpstan-import-type RotationVariants from \Imagekit\Transformation\Rotation + * @phpstan-import-type ShadowVariants from \Imagekit\Transformation\Shadow + * @phpstan-import-type SharpenVariants from \Imagekit\Transformation\Sharpen + * @phpstan-import-type StartOffsetVariants from \Imagekit\Transformation\StartOffset + * @phpstan-import-type TrimVariants from \Imagekit\Transformation\Trim + * @phpstan-import-type UnsharpMaskVariants from \Imagekit\Transformation\UnsharpMask + * @phpstan-import-type WidthVariants from \Imagekit\Transformation\Width + * @phpstan-import-type XVariants from \Imagekit\Transformation\X + * @phpstan-import-type XCenterVariants from \Imagekit\Transformation\XCenter + * @phpstan-import-type YVariants from \Imagekit\Transformation\Y + * @phpstan-import-type YCenterVariants from \Imagekit\Transformation\YCenter * @phpstan-import-type AIDropShadowShape from \Imagekit\Transformation\AIDropShadow * @phpstan-import-type AspectRatioShape from \Imagekit\Transformation\AspectRatio * @phpstan-import-type DurationShape from \Imagekit\Transformation\Duration @@ -115,6 +134,8 @@ final class Transformation implements BaseModel * Pass `true` for the default drop shadow, or provide a string for a custom drop shadow. * Supported inside overlay. * See [AI Drop Shadow](https://imagekit.io/docs/ai-transformations#ai-drop-shadow-e-dropshadow). + * + * @var AIDropShadowVariants|null $aiDropShadow */ #[Optional] public string|bool|null $aiDropShadow; @@ -171,6 +192,8 @@ final class Transformation implements BaseModel * Specifies the aspect ratio for the output, e.g., "ar-4-3". Typically used with either width or height (but not both). * For example: aspectRatio = `4:3`, `4_3`, or an expression like `iar_div_2`. * See [Image resize and crop – Aspect ratio](https://imagekit.io/docs/image-resize-and-crop#aspect-ratio---ar). + * + * @var AspectRatioVariants|null $aspectRatio */ #[Optional] public float|string|null $aspectRatio; @@ -256,6 +279,8 @@ final class Transformation implements BaseModel * Specifies the duration (in seconds) for trimming videos, e.g., `5` or `10.5`. * Typically used with startOffset to indicate the length from the start offset. Arithmetic expressions are supported. * See [Trim videos – Duration](https://imagekit.io/docs/trim-videos#duration---du). + * + * @var DurationVariants|null $duration */ #[Optional] public float|string|null $duration; @@ -264,6 +289,8 @@ final class Transformation implements BaseModel * Specifies the end offset (in seconds) for trimming videos, e.g., `5` or `10.5`. * Typically used with startOffset to define a time window. Arithmetic expressions are supported. * See [Trim videos – End offset](https://imagekit.io/docs/trim-videos#end-offset---eo). + * + * @var EndOffsetVariants|null $endOffset */ #[Optional] public float|string|null $endOffset; @@ -303,6 +330,8 @@ final class Transformation implements BaseModel /** * Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. * See [Gradient](https://imagekit.io/docs/effects-and-enhancements#gradient---e-gradient). + * + * @var GradientVariants|null $gradient */ #[Optional] public string|bool|null $gradient; @@ -317,6 +346,8 @@ final class Transformation implements BaseModel * Specifies the height of the output. If a value between 0 and 1 is provided, it is treated as a percentage (e.g., `0.5` represents 50% of the original height). * You can also supply arithmetic expressions (e.g., `ih_mul_0.5`). * Height transformation – [Images](https://imagekit.io/docs/image-resize-and-crop#height---h) · [Videos](https://imagekit.io/docs/video-resize-and-crop#height---h). + * + * @var HeightVariants|null $height */ #[Optional] public float|string|null $height; @@ -368,6 +399,8 @@ final class Transformation implements BaseModel * For example, specify by number (e.g., `2`), a range (e.g., `3-4` for the 2nd and 3rd layers), * or by name (e.g., `name-layer-4` for a PSD layer). * See [Thumbnail extraction](https://imagekit.io/docs/vector-and-animated-images#get-thumbnail-from-psd-pdf-ai-eps-and-animated-files). + * + * @var PageVariants|null $page */ #[Optional] public float|string|null $page; @@ -392,7 +425,7 @@ final class Transformation implements BaseModel * Specifies the corner radius for rounded corners (e.g., 20) or `max` for circular or oval shape. * See [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). * - * @var float|'max'|null $radius + * @var RadiusVariants|null $radius */ #[Optional] public float|string|null $radius; @@ -409,6 +442,8 @@ final class Transformation implements BaseModel * or `auto` to use the orientation specified in the image's EXIF data. * For videos, only the following values are supported: 0, 90, 180, 270, or 360. * See [Rotate](https://imagekit.io/docs/effects-and-enhancements#rotate---rt). + * + * @var RotationVariants|null $rotation */ #[Optional] public float|string|null $rotation; @@ -418,6 +453,8 @@ final class Transformation implements BaseModel * For AI-based drop shadows, refer to aiDropShadow. * Pass `true` for a default shadow, or provide a string for a custom shadow. * See [Shadow](https://imagekit.io/docs/effects-and-enhancements#shadow---e-shadow). + * + * @var ShadowVariants|null $shadow */ #[Optional] public string|bool|null $shadow; @@ -426,6 +463,8 @@ final class Transformation implements BaseModel * Sharpens the input image, highlighting edges and finer details. * Pass `true` for default sharpening, or provide a numeric value for custom sharpening. * See [Sharpen](https://imagekit.io/docs/effects-and-enhancements#sharpen---e-sharpen). + * + * @var SharpenVariants|null $sharpen */ #[Optional] public float|bool|null $sharpen; @@ -434,6 +473,8 @@ final class Transformation implements BaseModel * Specifies the start offset (in seconds) for trimming videos, e.g., `5` or `10.5`. * Arithmetic expressions are also supported. * See [Trim videos – Start offset](https://imagekit.io/docs/trim-videos#start-offset---so). + * + * @var StartOffsetVariants|null $startOffset */ #[Optional] public float|string|null $startOffset; @@ -451,6 +492,8 @@ final class Transformation implements BaseModel * Useful for images with a solid or nearly solid background and a central object. This parameter trims the background, * leaving only the central object in the output image. * See [Trim edges](https://imagekit.io/docs/effects-and-enhancements#trim-edges---t). + * + * @var TrimVariants|null $trim */ #[Optional] public float|bool|null $trim; @@ -459,6 +502,8 @@ final class Transformation implements BaseModel * Applies Unsharp Masking (USM), an image sharpening technique. * Pass `true` for a default unsharp mask, or provide a string for a custom unsharp mask. * See [Unsharp Mask](https://imagekit.io/docs/effects-and-enhancements#unsharp-mask---e-usm). + * + * @var UnsharpMaskVariants|null $unsharpMask */ #[Optional] public string|bool|null $unsharpMask; @@ -475,30 +520,40 @@ final class Transformation implements BaseModel * Specifies the width of the output. If a value between 0 and 1 is provided, it is treated as a percentage (e.g., `0.4` represents 40% of the original width). * You can also supply arithmetic expressions (e.g., `iw_div_2`). * Width transformation – [Images](https://imagekit.io/docs/image-resize-and-crop#width---w) · [Videos](https://imagekit.io/docs/video-resize-and-crop#width---w). + * + * @var WidthVariants|null $width */ #[Optional] public float|string|null $width; /** * Focus using cropped image coordinates - X coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). + * + * @var XVariants|null $x */ #[Optional] public float|string|null $x; /** * Focus using cropped image coordinates - X center coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). + * + * @var XCenterVariants|null $xCenter */ #[Optional] public float|string|null $xCenter; /** * Focus using cropped image coordinates - Y coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). + * + * @var YVariants|null $y */ #[Optional] public float|string|null $y; /** * Focus using cropped image coordinates - Y center coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). + * + * @var YCenterVariants|null $yCenter */ #[Optional] public float|string|null $yCenter; @@ -532,7 +587,6 @@ public function __construct() * @param Format|value-of|null $format * @param GradientShape|null $gradient * @param HeightShape|null $height - * @param mixed $overlay * @param PageShape|null $page * @param RadiusShape|null $radius * @param RotationShape|null $rotation @@ -582,7 +636,7 @@ public static function with( ?string $named = null, ?float $opacity = null, ?bool $original = null, - ?Overlay $overlay = null, + mixed $overlay = null, float|string|null $page = null, ?bool $progressive = null, ?float $quality = null, @@ -1093,10 +1147,8 @@ public function withOriginal(bool $original): self * Specifies an overlay to be applied on the parent image or video. * ImageKit supports overlays including images, text, videos, subtitles, and solid colors. * See [Overlay using layers](https://imagekit.io/docs/transformations#overlay-using-layers). - * - * @param mixed $overlay */ - public function withOverlay(Overlay $overlay): self + public function withOverlay(mixed $overlay): self { $self = clone $this; $self['overlay'] = $overlay; diff --git a/src/Transformation/AIDropShadow.php b/src/Transformation/AIDropShadow.php index d4a09d58..6637b5ca 100644 --- a/src/Transformation/AIDropShadow.php +++ b/src/Transformation/AIDropShadow.php @@ -15,7 +15,8 @@ * Supported inside overlay. * See [AI Drop Shadow](https://imagekit.io/docs/ai-transformations#ai-drop-shadow-e-dropshadow). * - * @phpstan-type AIDropShadowShape = string|bool + * @phpstan-type AIDropShadowVariants = string|bool + * @phpstan-type AIDropShadowShape = AIDropShadowVariants */ final class AIDropShadow implements ConverterSource { diff --git a/src/Transformation/AspectRatio.php b/src/Transformation/AspectRatio.php index 77fa78fc..10ff17b1 100644 --- a/src/Transformation/AspectRatio.php +++ b/src/Transformation/AspectRatio.php @@ -13,7 +13,8 @@ * For example: aspectRatio = `4:3`, `4_3`, or an expression like `iar_div_2`. * See [Image resize and crop – Aspect ratio](https://imagekit.io/docs/image-resize-and-crop#aspect-ratio---ar). * - * @phpstan-type AspectRatioShape = float|string + * @phpstan-type AspectRatioVariants = float|string + * @phpstan-type AspectRatioShape = AspectRatioVariants */ final class AspectRatio implements ConverterSource { diff --git a/src/Transformation/Duration.php b/src/Transformation/Duration.php index cf9505dd..11cc614a 100644 --- a/src/Transformation/Duration.php +++ b/src/Transformation/Duration.php @@ -13,7 +13,8 @@ * Typically used with startOffset to indicate the length from the start offset. Arithmetic expressions are supported. * See [Trim videos – Duration](https://imagekit.io/docs/trim-videos#duration---du). * - * @phpstan-type DurationShape = float|string + * @phpstan-type DurationVariants = float|string + * @phpstan-type DurationShape = DurationVariants */ final class Duration implements ConverterSource { diff --git a/src/Transformation/EndOffset.php b/src/Transformation/EndOffset.php index 1fa42643..fbe021f3 100644 --- a/src/Transformation/EndOffset.php +++ b/src/Transformation/EndOffset.php @@ -13,7 +13,8 @@ * Typically used with startOffset to define a time window. Arithmetic expressions are supported. * See [Trim videos – End offset](https://imagekit.io/docs/trim-videos#end-offset---eo). * - * @phpstan-type EndOffsetShape = float|string + * @phpstan-type EndOffsetVariants = float|string + * @phpstan-type EndOffsetShape = EndOffsetVariants */ final class EndOffset implements ConverterSource { diff --git a/src/Transformation/Gradient.php b/src/Transformation/Gradient.php index 2766197a..956bf4f8 100644 --- a/src/Transformation/Gradient.php +++ b/src/Transformation/Gradient.php @@ -12,7 +12,8 @@ * Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. * See [Gradient](https://imagekit.io/docs/effects-and-enhancements#gradient---e-gradient). * - * @phpstan-type GradientShape = string|bool + * @phpstan-type GradientVariants = string|bool + * @phpstan-type GradientShape = GradientVariants */ final class Gradient implements ConverterSource { diff --git a/src/Transformation/Height.php b/src/Transformation/Height.php index 9ca197cf..858b23b1 100644 --- a/src/Transformation/Height.php +++ b/src/Transformation/Height.php @@ -13,7 +13,8 @@ * You can also supply arithmetic expressions (e.g., `ih_mul_0.5`). * Height transformation – [Images](https://imagekit.io/docs/image-resize-and-crop#height---h) · [Videos](https://imagekit.io/docs/video-resize-and-crop#height---h). * - * @phpstan-type HeightShape = float|string + * @phpstan-type HeightVariants = float|string + * @phpstan-type HeightShape = HeightVariants */ final class Height implements ConverterSource { diff --git a/src/Transformation/Page.php b/src/Transformation/Page.php index 76780fb2..8db1194e 100644 --- a/src/Transformation/Page.php +++ b/src/Transformation/Page.php @@ -14,7 +14,8 @@ * or by name (e.g., `name-layer-4` for a PSD layer). * See [Thumbnail extraction](https://imagekit.io/docs/vector-and-animated-images#get-thumbnail-from-psd-pdf-ai-eps-and-animated-files). * - * @phpstan-type PageShape = float|string + * @phpstan-type PageVariants = float|string + * @phpstan-type PageShape = PageVariants */ final class Page implements ConverterSource { diff --git a/src/Transformation/Radius.php b/src/Transformation/Radius.php index d047429e..3e51c43a 100644 --- a/src/Transformation/Radius.php +++ b/src/Transformation/Radius.php @@ -12,7 +12,8 @@ * Specifies the corner radius for rounded corners (e.g., 20) or `max` for circular or oval shape. * See [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). * - * @phpstan-type RadiusShape = float|'max' + * @phpstan-type RadiusVariants = float|'max' + * @phpstan-type RadiusShape = RadiusVariants */ final class Radius implements ConverterSource { diff --git a/src/Transformation/Rotation.php b/src/Transformation/Rotation.php index be98783b..e0e4a71d 100644 --- a/src/Transformation/Rotation.php +++ b/src/Transformation/Rotation.php @@ -14,7 +14,8 @@ * For videos, only the following values are supported: 0, 90, 180, 270, or 360. * See [Rotate](https://imagekit.io/docs/effects-and-enhancements#rotate---rt). * - * @phpstan-type RotationShape = float|string + * @phpstan-type RotationVariants = float|string + * @phpstan-type RotationShape = RotationVariants */ final class Rotation implements ConverterSource { diff --git a/src/Transformation/Shadow.php b/src/Transformation/Shadow.php index df2238ee..765b7716 100644 --- a/src/Transformation/Shadow.php +++ b/src/Transformation/Shadow.php @@ -14,7 +14,8 @@ * Pass `true` for a default shadow, or provide a string for a custom shadow. * See [Shadow](https://imagekit.io/docs/effects-and-enhancements#shadow---e-shadow). * - * @phpstan-type ShadowShape = string|bool + * @phpstan-type ShadowVariants = string|bool + * @phpstan-type ShadowShape = ShadowVariants */ final class Shadow implements ConverterSource { diff --git a/src/Transformation/Sharpen.php b/src/Transformation/Sharpen.php index 9732a6e8..102e1302 100644 --- a/src/Transformation/Sharpen.php +++ b/src/Transformation/Sharpen.php @@ -13,7 +13,8 @@ * Pass `true` for default sharpening, or provide a numeric value for custom sharpening. * See [Sharpen](https://imagekit.io/docs/effects-and-enhancements#sharpen---e-sharpen). * - * @phpstan-type SharpenShape = float|bool + * @phpstan-type SharpenVariants = float|bool + * @phpstan-type SharpenShape = SharpenVariants */ final class Sharpen implements ConverterSource { diff --git a/src/Transformation/StartOffset.php b/src/Transformation/StartOffset.php index 478533fb..7fd2e50a 100644 --- a/src/Transformation/StartOffset.php +++ b/src/Transformation/StartOffset.php @@ -13,7 +13,8 @@ * Arithmetic expressions are also supported. * See [Trim videos – Start offset](https://imagekit.io/docs/trim-videos#start-offset---so). * - * @phpstan-type StartOffsetShape = float|string + * @phpstan-type StartOffsetVariants = float|string + * @phpstan-type StartOffsetShape = StartOffsetVariants */ final class StartOffset implements ConverterSource { diff --git a/src/Transformation/Trim.php b/src/Transformation/Trim.php index 3b0a64e7..a807cc2d 100644 --- a/src/Transformation/Trim.php +++ b/src/Transformation/Trim.php @@ -13,7 +13,8 @@ * leaving only the central object in the output image. * See [Trim edges](https://imagekit.io/docs/effects-and-enhancements#trim-edges---t). * - * @phpstan-type TrimShape = float|bool + * @phpstan-type TrimVariants = float|bool + * @phpstan-type TrimShape = TrimVariants */ final class Trim implements ConverterSource { diff --git a/src/Transformation/UnsharpMask.php b/src/Transformation/UnsharpMask.php index b63f558c..26bdf4c3 100644 --- a/src/Transformation/UnsharpMask.php +++ b/src/Transformation/UnsharpMask.php @@ -13,7 +13,8 @@ * Pass `true` for a default unsharp mask, or provide a string for a custom unsharp mask. * See [Unsharp Mask](https://imagekit.io/docs/effects-and-enhancements#unsharp-mask---e-usm). * - * @phpstan-type UnsharpMaskShape = string|bool + * @phpstan-type UnsharpMaskVariants = string|bool + * @phpstan-type UnsharpMaskShape = UnsharpMaskVariants */ final class UnsharpMask implements ConverterSource { diff --git a/src/Transformation/Width.php b/src/Transformation/Width.php index 85d93a67..1a96f183 100644 --- a/src/Transformation/Width.php +++ b/src/Transformation/Width.php @@ -13,7 +13,8 @@ * You can also supply arithmetic expressions (e.g., `iw_div_2`). * Width transformation – [Images](https://imagekit.io/docs/image-resize-and-crop#width---w) · [Videos](https://imagekit.io/docs/video-resize-and-crop#width---w). * - * @phpstan-type WidthShape = float|string + * @phpstan-type WidthVariants = float|string + * @phpstan-type WidthShape = WidthVariants */ final class Width implements ConverterSource { diff --git a/src/Transformation/X.php b/src/Transformation/X.php index 609419df..14a30b38 100644 --- a/src/Transformation/X.php +++ b/src/Transformation/X.php @@ -11,7 +11,8 @@ /** * Focus using cropped image coordinates - X coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). * - * @phpstan-type XShape = float|string + * @phpstan-type XVariants = float|string + * @phpstan-type XShape = XVariants */ final class X implements ConverterSource { diff --git a/src/Transformation/XCenter.php b/src/Transformation/XCenter.php index 1acf7305..594bae0c 100644 --- a/src/Transformation/XCenter.php +++ b/src/Transformation/XCenter.php @@ -11,7 +11,8 @@ /** * Focus using cropped image coordinates - X center coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). * - * @phpstan-type XCenterShape = float|string + * @phpstan-type XCenterVariants = float|string + * @phpstan-type XCenterShape = XCenterVariants */ final class XCenter implements ConverterSource { diff --git a/src/Transformation/Y.php b/src/Transformation/Y.php index 80a5dc57..8aa1ef1f 100644 --- a/src/Transformation/Y.php +++ b/src/Transformation/Y.php @@ -11,7 +11,8 @@ /** * Focus using cropped image coordinates - Y coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). * - * @phpstan-type YShape = float|string + * @phpstan-type YVariants = float|string + * @phpstan-type YShape = YVariants */ final class Y implements ConverterSource { diff --git a/src/Transformation/YCenter.php b/src/Transformation/YCenter.php index c7f8eea5..5080ae6e 100644 --- a/src/Transformation/YCenter.php +++ b/src/Transformation/YCenter.php @@ -11,7 +11,8 @@ /** * Focus using cropped image coordinates - Y center coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). * - * @phpstan-type YCenterShape = float|string + * @phpstan-type YCenterVariants = float|string + * @phpstan-type YCenterShape = YCenterVariants */ final class YCenter implements ConverterSource { diff --git a/src/Webhooks/UnsafeUnwrapWebhookEvent.php b/src/Webhooks/UnsafeUnwrapWebhookEvent.php index ee556e98..b678dd03 100644 --- a/src/Webhooks/UnsafeUnwrapWebhookEvent.php +++ b/src/Webhooks/UnsafeUnwrapWebhookEvent.php @@ -19,7 +19,8 @@ * @phpstan-import-type UploadPostTransformSuccessEventShape from \Imagekit\Webhooks\UploadPostTransformSuccessEvent * @phpstan-import-type UploadPostTransformErrorEventShape from \Imagekit\Webhooks\UploadPostTransformErrorEvent * - * @phpstan-type UnsafeUnwrapWebhookEventShape = VideoTransformationAcceptedEventShape|VideoTransformationReadyEventShape|VideoTransformationErrorEventShape|UploadPreTransformSuccessEventShape|UploadPreTransformErrorEventShape|UploadPostTransformSuccessEventShape|UploadPostTransformErrorEventShape + * @phpstan-type UnsafeUnwrapWebhookEventVariants = VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent + * @phpstan-type UnsafeUnwrapWebhookEventShape = UnsafeUnwrapWebhookEventVariants|VideoTransformationAcceptedEventShape|VideoTransformationReadyEventShape|VideoTransformationErrorEventShape|UploadPreTransformSuccessEventShape|UploadPreTransformErrorEventShape|UploadPostTransformSuccessEventShape|UploadPostTransformErrorEventShape */ final class UnsafeUnwrapWebhookEvent implements ConverterSource { diff --git a/src/Webhooks/UnwrapWebhookEvent.php b/src/Webhooks/UnwrapWebhookEvent.php index cbef825d..387ba594 100644 --- a/src/Webhooks/UnwrapWebhookEvent.php +++ b/src/Webhooks/UnwrapWebhookEvent.php @@ -19,7 +19,8 @@ * @phpstan-import-type UploadPostTransformSuccessEventShape from \Imagekit\Webhooks\UploadPostTransformSuccessEvent * @phpstan-import-type UploadPostTransformErrorEventShape from \Imagekit\Webhooks\UploadPostTransformErrorEvent * - * @phpstan-type UnwrapWebhookEventShape = VideoTransformationAcceptedEventShape|VideoTransformationReadyEventShape|VideoTransformationErrorEventShape|UploadPreTransformSuccessEventShape|UploadPreTransformErrorEventShape|UploadPostTransformSuccessEventShape|UploadPostTransformErrorEventShape + * @phpstan-type UnwrapWebhookEventVariants = VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent + * @phpstan-type UnwrapWebhookEventShape = UnwrapWebhookEventVariants|VideoTransformationAcceptedEventShape|VideoTransformationReadyEventShape|VideoTransformationErrorEventShape|UploadPreTransformSuccessEventShape|UploadPreTransformErrorEventShape|UploadPostTransformSuccessEventShape|UploadPostTransformErrorEventShape */ final class UnwrapWebhookEvent implements ConverterSource { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php index 0351ff48..6d06b25d 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php @@ -23,7 +23,7 @@ * @phpstan-import-type VersionInfoShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\VersionInfo * * @phpstan-type DataShape = array{ - * aiTags?: list|null, + * aiTags?: list|null, * audioCodec?: string|null, * bitRate?: int|null, * customCoordinates?: string|null, @@ -40,7 +40,7 @@ * isPublished?: bool|null, * metadata?: null|Metadata|MetadataShape, * name?: string|null, - * selectedFieldsSchema?: array|null, + * selectedFieldsSchema?: array|null, * size?: float|null, * tags?: list|null, * thumbnailURL?: string|null, @@ -235,12 +235,12 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list|null $aiTags + * @param list|null $aiTags * @param array|null $customMetadata * @param array|null $embeddedMetadata * @param ExtensionStatus|ExtensionStatusShape|null $extensionStatus * @param Metadata|MetadataShape|null $metadata - * @param array|null $selectedFieldsSchema + * @param array|null $selectedFieldsSchema * @param list|null $tags * @param VersionInfo|VersionInfoShape|null $versionInfo */ @@ -305,7 +305,7 @@ public static function with( /** * An array of tags assigned to the uploaded file by auto tagging. * - * @param list|null $aiTags + * @param list|null $aiTags */ public function withAITags(?array $aiTags): self { @@ -513,7 +513,7 @@ public function withName(string $name): self * * Keys are the names of the custom metadata fields; the value object has details about the custom metadata schema. * - * @param array $selectedFieldsSchema + * @param array $selectedFieldsSchema */ public function withSelectedFieldsSchema(array $selectedFieldsSchema): self { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php index 1bbceebd..0ae6f2a9 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php @@ -13,6 +13,10 @@ use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\Type; /** + * @phpstan-import-type DefaultValueVariants from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue + * @phpstan-import-type MaxValueVariants from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\MaxValue + * @phpstan-import-type MinValueVariants from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\MinValue + * @phpstan-import-type SelectOptionVariants from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\SelectOption * @phpstan-import-type DefaultValueShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue * @phpstan-import-type MaxValueShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\MaxValue * @phpstan-import-type MinValueShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\MinValue @@ -47,7 +51,7 @@ final class SelectedFieldsSchema implements BaseModel /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. * - * @var string|float|bool|list|null $defaultValue + * @var DefaultValueVariants|null $defaultValue */ #[Optional(union: DefaultValue::class)] public string|float|bool|array|null $defaultValue; @@ -66,6 +70,8 @@ final class SelectedFieldsSchema implements BaseModel /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @var MaxValueVariants|null $maxValue */ #[Optional] public string|float|null $maxValue; @@ -78,6 +84,8 @@ final class SelectedFieldsSchema implements BaseModel /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. + * + * @var MinValueVariants|null $minValue */ #[Optional] public string|float|null $minValue; @@ -91,7 +99,7 @@ final class SelectedFieldsSchema implements BaseModel /** * An array of allowed values when field type is `SingleSelect` or `MultiSelect`. * - * @var list|null $selectOptions + * @var list|null $selectOptions */ #[Optional(list: SelectOption::class)] public ?array $selectOptions; diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php index be2ac75d..f489d39f 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php @@ -15,7 +15,8 @@ * * @phpstan-import-type MixedShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue\Mixed_ * - * @phpstan-type DefaultValueShape = string|float|bool|list + * @phpstan-type DefaultValueVariants = string|float|bool|list + * @phpstan-type DefaultValueShape = DefaultValueVariants|list */ final class DefaultValue implements ConverterSource { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed_.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed_.php index 5763e6cb..db130b3f 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed_.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed_.php @@ -9,7 +9,8 @@ use Imagekit\Core\Conversion\Contracts\ConverterSource; /** - * @phpstan-type MixedShape = string|float|bool + * @phpstan-type MixedVariants = string|float|bool + * @phpstan-type MixedShape = MixedVariants */ final class Mixed_ implements ConverterSource { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MaxValue.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MaxValue.php index 5eb735f4..bde99e35 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MaxValue.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MaxValue.php @@ -11,7 +11,8 @@ /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. * - * @phpstan-type MaxValueShape = string|float + * @phpstan-type MaxValueVariants = string|float + * @phpstan-type MaxValueShape = MaxValueVariants */ final class MaxValue implements ConverterSource { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MinValue.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MinValue.php index a6aee500..066cb052 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MinValue.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MinValue.php @@ -11,7 +11,8 @@ /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. * - * @phpstan-type MinValueShape = string|float + * @phpstan-type MinValueVariants = string|float + * @phpstan-type MinValueShape = MinValueVariants */ final class MinValue implements ConverterSource { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/SelectOption.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/SelectOption.php index 74e25155..a53ca9e6 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/SelectOption.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/SelectOption.php @@ -9,7 +9,8 @@ use Imagekit\Core\Conversion\Contracts\ConverterSource; /** - * @phpstan-type SelectOptionShape = string|float|bool + * @phpstan-type SelectOptionVariants = string|float|bool + * @phpstan-type SelectOptionShape = SelectOptionVariants */ final class SelectOption implements ConverterSource { From 2994f2d6f65889a67ceccfb274944b517f86793f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 7 Jan 2026 13:18:07 +0000 Subject: [PATCH 113/193] chore(internal): add a basic client test --- composer.json | 1 + src/Client.php | 19 +++++++++++++------ tests/ClientTest.php | 45 ++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 59 insertions(+), 6 deletions(-) create mode 100644 tests/ClientTest.php diff --git a/composer.json b/composer.json index 287b791d..03175df9 100644 --- a/composer.json +++ b/composer.json @@ -42,6 +42,7 @@ "friendsofphp/php-cs-fixer": "^3", "nyholm/psr7": "^1", "pestphp/pest": "^3", + "php-http/mock-client": "^1", "phpstan/extension-installer": "^1", "phpstan/phpstan": "^2", "phpstan/phpstan-phpunit": "^2", diff --git a/src/Client.php b/src/Client.php index 3c4145d5..85e4ed9f 100644 --- a/src/Client.php +++ b/src/Client.php @@ -18,8 +18,8 @@ use Imagekit\Services\WebhooksService; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions * @phpstan-import-type NormalizedRequest from \Imagekit\Core\BaseClient + * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions */ class Client extends BaseClient { @@ -69,10 +69,14 @@ class Client extends BaseClient */ public WebhooksService $webhooks; + /** + * @param RequestOpts|null $requestOptions + */ public function __construct( ?string $privateKey = null, ?string $password = null, ?string $baseUrl = null, + RequestOptions|array|null $requestOptions = null, ) { $this->privateKey = (string) ($privateKey ?? getenv('IMAGEKIT_PRIVATE_KEY')); $this->password = (string) ($password ?? getenv('OPTIONAL_IMAGEKIT_IGNORES_THIS') ?: 'do_not_set'); @@ -81,11 +85,14 @@ public function __construct( $baseUrl ??= getenv('IMAGE_KIT_BASE_URL') ?: 'https://api.imagekit.io'; - $options = RequestOptions::with( - uriFactory: Psr17FactoryDiscovery::findUriFactory(), - streamFactory: Psr17FactoryDiscovery::findStreamFactory(), - requestFactory: Psr17FactoryDiscovery::findRequestFactory(), - transporter: Psr18ClientDiscovery::find(), + $options = RequestOptions::parse( + RequestOptions::with( + uriFactory: Psr17FactoryDiscovery::findUriFactory(), + streamFactory: Psr17FactoryDiscovery::findStreamFactory(), + requestFactory: Psr17FactoryDiscovery::findRequestFactory(), + transporter: Psr18ClientDiscovery::find(), + ), + $requestOptions, ); parent::__construct( diff --git a/tests/ClientTest.php b/tests/ClientTest.php new file mode 100644 index 00000000..5c16f737 --- /dev/null +++ b/tests/ClientTest.php @@ -0,0 +1,45 @@ +createResponse() + ->withStatus(200) + ->withHeader('Content-Type', 'application/json') + ->withBody(Psr17FactoryDiscovery::findStreamFactory()->createStream(json_encode([], flags: Util::JSON_ENCODE_FLAGS) ?: '')) + ; + + $transporter->setDefaultResponse($mockRsp); + + $client = new \Imagekit\Client( + baseUrl: 'http://localhost', + privateKey: 'My Private Key', + password: 'My Password', + requestOptions: ['transporter' => $transporter], + ); + + $client->files->upload(file: 'file', fileName: 'fileName'); + + $this->assertNotFalse($requested = $transporter->getRequests()[0] ?? false); + + foreach (['accept', 'content-type'] as $header) { + $sent = $requested->getHeaderLine($header); + $this->assertNotEmpty($sent); + } + } +} From 37f7fdabd844ff3bef85aae719b02ded1da5aadf Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 8 Jan 2026 17:20:20 +0000 Subject: [PATCH 114/193] feat!: replace special flag type `omittable` with just `null` --- README.md | 19 +++++++------------ composer.json | 4 +--- src/Core.php | 4 ---- src/Core/Concerns/SdkParams.php | 4 +--- src/Core/Implementation/Omit.php | 13 ------------- src/Core/Util.php | 10 ---------- src/RequestOptions.php | 8 ++------ 7 files changed, 11 insertions(+), 51 deletions(-) delete mode 100644 src/Core/Implementation/Omit.php diff --git a/README.md b/README.md index dd816440..d0dea342 100644 --- a/README.md +++ b/README.md @@ -108,16 +108,13 @@ You can use the `maxRetries` option to configure or disable this: 0]); // Or, configure per-request: $result = $client->files->upload( - file: 'file', - fileName: 'file-name.jpg', - requestOptions: RequestOptions::with(maxRetries: 5), + file: 'file', fileName: 'file-name.jpg', requestOptions: ['maxRetries' => 5] ); ``` @@ -134,16 +131,14 @@ Note: the `extra*` parameters of the same name overrides the documented paramete ```php files->upload( file: 'file', fileName: 'file-name.jpg', - requestOptions: RequestOptions::with( - extraQueryParams: ['my_query_parameter' => 'value'], - extraBodyParams: ['my_body_parameter' => 'value'], - extraHeaders: ['my-header' => 'value'], - ), + requestOptions: [ + 'extraQueryParams' => ['my_query_parameter' => 'value'], + 'extraBodyParams' => ['my_body_parameter' => 'value'], + 'extraHeaders' => ['my-header' => 'value'], + ], ); ``` diff --git a/composer.json b/composer.json index 03175df9..48a595ce 100644 --- a/composer.json +++ b/composer.json @@ -3,9 +3,7 @@ "license": "Apache-2.0", "autoload": { "files": [ - "src/Core.php", - "src/Version.php", - "src/Client.php" + "src/Version.php" ], "psr-4": { "Imagekit\\": "src/" diff --git a/src/Core.php b/src/Core.php index b3ab37f1..18db36d5 100644 --- a/src/Core.php +++ b/src/Core.php @@ -3,7 +3,3 @@ declare(strict_types=1); namespace Imagekit\Core; - -use Imagekit\Core\Implementation\Omit; - -const OMIT = Omit::omit; diff --git a/src/Core/Concerns/SdkParams.php b/src/Core/Concerns/SdkParams.php index 6a5601d4..5c25615e 100644 --- a/src/Core/Concerns/SdkParams.php +++ b/src/Core/Concerns/SdkParams.php @@ -6,7 +6,6 @@ use Imagekit\Core\Conversion; use Imagekit\Core\Conversion\DumpState; -use Imagekit\Core\Util; use Imagekit\RequestOptions; /** @@ -21,10 +20,9 @@ trait SdkParams */ public static function parseRequest(mixed $params, array|RequestOptions|null $options): array { - $value = is_array($params) ? Util::array_filter_omit($params) : $params; $converter = self::converter(); $state = new DumpState; - $dumped = (array) Conversion::dump($converter, value: $value, state: $state); + $dumped = (array) Conversion::dump($converter, value: $params, state: $state); // @phpstan-ignore-next-line argument.type $opts = RequestOptions::parse($options); diff --git a/src/Core/Implementation/Omit.php b/src/Core/Implementation/Omit.php deleted file mode 100644 index 17a551df..00000000 --- a/src/Core/Implementation/Omit.php +++ /dev/null @@ -1,13 +0,0 @@ - $arr - * - * @return array - */ - public static function array_filter_omit(array $arr): array - { - return array_filter($arr, fn ($v, $_) => OMIT !== $v, mode: ARRAY_FILTER_USE_BOTH); - } - public static function strVal(mixed $value): string { if (is_bool($value)) { diff --git a/src/RequestOptions.php b/src/RequestOptions.php index dd936ede..b5e82cff 100644 --- a/src/RequestOptions.php +++ b/src/RequestOptions.php @@ -8,14 +8,11 @@ use Imagekit\Core\Attributes\Required as Property; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Implementation\Omit; use Psr\Http\Client\ClientInterface; use Psr\Http\Message\RequestFactoryInterface; use Psr\Http\Message\StreamFactoryInterface; use Psr\Http\Message\UriFactoryInterface; -use const Imagekit\Core\OMIT as omit; - /** * @phpstan-type RequestOptionShape = array{ * timeout?: float|null, @@ -91,7 +88,6 @@ public static function parse(RequestOptions|array|null ...$options): self /** * @param array|null>|null $extraHeaders * @param array|null $extraQueryParams - * @param mixed|Omit $extraBodyParams */ public static function with( ?float $timeout = null, @@ -100,7 +96,7 @@ public static function with( ?float $maxRetryDelay = null, ?array $extraHeaders = null, ?array $extraQueryParams = null, - mixed $extraBodyParams = omit, + mixed $extraBodyParams = null, ?ClientInterface $transporter = null, ?UriFactoryInterface $uriFactory = null, ?StreamFactoryInterface $streamFactory = null, @@ -116,7 +112,7 @@ public static function with( null !== $maxRetryDelay && $self->maxRetryDelay = $maxRetryDelay; null !== $extraHeaders && $self->extraHeaders = $extraHeaders; null !== $extraQueryParams && $self->extraQueryParams = $extraQueryParams; - omit !== $extraBodyParams && $self->extraBodyParams = $extraBodyParams; + null !== $extraBodyParams && $self->extraBodyParams = $extraBodyParams; null !== $transporter && $self->transporter = $transporter; null !== $uriFactory && $self->uriFactory = $uriFactory; null !== $streamFactory && $self->streamFactory = $streamFactory; From 40f7b97fa95c8c82feb267e006872c5107a0a26c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 9 Jan 2026 21:45:39 +0000 Subject: [PATCH 115/193] chore: add git attributes and composer lock file --- .gitattributes | 16 + .gitignore | 1 - .php-cs-fixer.dist.php | 2 +- composer.lock | 6672 ++++++++++++++++++++++++++++++++++++++++ 4 files changed, 6689 insertions(+), 2 deletions(-) create mode 100644 composer.lock diff --git a/.gitattributes b/.gitattributes index e69de29b..3e7d094a 100644 --- a/.gitattributes +++ b/.gitattributes @@ -0,0 +1,16 @@ +*.php diff=php + +/.github export-ignore +/bin export-ignore +/scripts export-ignore +/tests export-ignore + +/.gitattributes export-ignore +/.gitignore export-ignore +/.php-cs-fixer.dist.php export-ignore +/.phpactor.json export-ignore +/.release-please-manifest.json export-ignore +/.stats.yml export-ignore +/phpstan.dist.neon export-ignore +/phpunit.xml.dist export-ignore +/release-please-config.json export-ignore diff --git a/.gitignore b/.gitignore index 6739884e..08cb4798 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ -composer.lock docs/ .idea/ .php-cs-fixer.cache diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index a2b062b9..e01ea3ba 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -4,7 +4,7 @@ use PhpCsFixer\Finder; use PhpCsFixer\Runner\Parallel\ParallelConfigFactory; -return (new Config()) +return (new Config) ->setParallelConfig(ParallelConfigFactory::detect()) ->setFinder(Finder::create()->in([__DIR__.'/src', __DIR__.'/tests'])) ->setRules([ diff --git a/composer.lock b/composer.lock new file mode 100644 index 00000000..3f6c209a --- /dev/null +++ b/composer.lock @@ -0,0 +1,6672 @@ +{ + "_readme": [ + "This file locks the dependencies of your project to a known state", + "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", + "This file is @generated automatically" + ], + "content-hash": "5fc63f7c84d94b42416689723c547f69", + "packages": [ + { + "name": "php-http/discovery", + "version": "1.20.0", + "source": { + "type": "git", + "url": "https://github.com/php-http/discovery.git", + "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/discovery/zipball/82fe4c73ef3363caed49ff8dd1539ba06044910d", + "reference": "82fe4c73ef3363caed49ff8dd1539ba06044910d", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^1.0|^2.0", + "php": "^7.1 || ^8.0" + }, + "conflict": { + "nyholm/psr7": "<1.0", + "zendframework/zend-diactoros": "*" + }, + "provide": { + "php-http/async-client-implementation": "*", + "php-http/client-implementation": "*", + "psr/http-client-implementation": "*", + "psr/http-factory-implementation": "*", + "psr/http-message-implementation": "*" + }, + "require-dev": { + "composer/composer": "^1.0.2|^2.0", + "graham-campbell/phpspec-skip-example-extension": "^5.0", + "php-http/httplug": "^1.0 || ^2.0", + "php-http/message-factory": "^1.0", + "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3", + "sebastian/comparator": "^3.0.5 || ^4.0.8", + "symfony/phpunit-bridge": "^6.4.4 || ^7.0.1" + }, + "type": "composer-plugin", + "extra": { + "class": "Http\\Discovery\\Composer\\Plugin", + "plugin-optional": true + }, + "autoload": { + "psr-4": { + "Http\\Discovery\\": "src/" + }, + "exclude-from-classmap": [ + "src/Composer/Plugin.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Finds and installs PSR-7, PSR-17, PSR-18 and HTTPlug implementations", + "homepage": "http://php-http.org", + "keywords": [ + "adapter", + "client", + "discovery", + "factory", + "http", + "message", + "psr17", + "psr7" + ], + "support": { + "issues": "https://github.com/php-http/discovery/issues", + "source": "https://github.com/php-http/discovery/tree/1.20.0" + }, + "time": "2024-10-02T11:20:13+00:00" + }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" + }, + { + "name": "psr/http-message", + "version": "2.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-message.git", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP messages", + "homepage": "https://github.com/php-fig/http-message", + "keywords": [ + "http", + "http-message", + "psr", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-message/tree/2.0" + }, + "time": "2023-04-04T09:54:51+00:00" + } + ], + "packages-dev": [ + { + "name": "brianium/paratest", + "version": "v7.8.4", + "source": { + "type": "git", + "url": "https://github.com/paratestphp/paratest.git", + "reference": "130a9bf0e269ee5f5b320108f794ad03e275cad4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/130a9bf0e269ee5f5b320108f794ad03e275cad4", + "reference": "130a9bf0e269ee5f5b320108f794ad03e275cad4", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-pcre": "*", + "ext-reflection": "*", + "ext-simplexml": "*", + "fidry/cpu-core-counter": "^1.2.0", + "jean85/pretty-package-versions": "^2.1.1", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0", + "phpunit/php-code-coverage": "^11.0.10", + "phpunit/php-file-iterator": "^5.1.0", + "phpunit/php-timer": "^7.0.1", + "phpunit/phpunit": "^11.5.24", + "sebastian/environment": "^7.2.1", + "symfony/console": "^6.4.22 || ^7.3.0", + "symfony/process": "^6.4.20 || ^7.3.0" + }, + "require-dev": { + "doctrine/coding-standard": "^12.0.0", + "ext-pcov": "*", + "ext-posix": "*", + "phpstan/phpstan": "^2.1.17", + "phpstan/phpstan-deprecation-rules": "^2.0.3", + "phpstan/phpstan-phpunit": "^2.0.6", + "phpstan/phpstan-strict-rules": "^2.0.4", + "squizlabs/php_codesniffer": "^3.13.2", + "symfony/filesystem": "^6.4.13 || ^7.3.0" + }, + "bin": [ + "bin/paratest", + "bin/paratest_for_phpstorm" + ], + "type": "library", + "autoload": { + "psr-4": { + "ParaTest\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Brian Scaturro", + "email": "scaturrob@gmail.com", + "role": "Developer" + }, + { + "name": "Filippo Tessarotto", + "email": "zoeslam@gmail.com", + "role": "Developer" + } + ], + "description": "Parallel testing for PHP", + "homepage": "https://github.com/paratestphp/paratest", + "keywords": [ + "concurrent", + "parallel", + "phpunit", + "testing" + ], + "support": { + "issues": "https://github.com/paratestphp/paratest/issues", + "source": "https://github.com/paratestphp/paratest/tree/v7.8.4" + }, + "funding": [ + { + "url": "https://github.com/sponsors/Slamdunk", + "type": "github" + }, + { + "url": "https://paypal.me/filippotessarotto", + "type": "paypal" + } + ], + "time": "2025-06-23T06:07:21+00:00" + }, + { + "name": "clue/ndjson-react", + "version": "v1.3.0", + "source": { + "type": "git", + "url": "https://github.com/clue/reactphp-ndjson.git", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/reactphp-ndjson/zipball/392dc165fce93b5bb5c637b67e59619223c931b0", + "reference": "392dc165fce93b5bb5c637b67e59619223c931b0", + "shasum": "" + }, + "require": { + "php": ">=5.3", + "react/stream": "^1.2" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35", + "react/event-loop": "^1.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Clue\\React\\NDJson\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + } + ], + "description": "Streaming newline-delimited JSON (NDJSON) parser and encoder for ReactPHP.", + "homepage": "https://github.com/clue/reactphp-ndjson", + "keywords": [ + "NDJSON", + "json", + "jsonlines", + "newline", + "reactphp", + "streaming" + ], + "support": { + "issues": "https://github.com/clue/reactphp-ndjson/issues", + "source": "https://github.com/clue/reactphp-ndjson/tree/v1.3.0" + }, + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2022-12-23T10:58:28+00:00" + }, + { + "name": "clue/stream-filter", + "version": "v1.7.0", + "source": { + "type": "git", + "url": "https://github.com/clue/stream-filter.git", + "reference": "049509fef80032cb3f051595029ab75b49a3c2f7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/clue/stream-filter/zipball/049509fef80032cb3f051595029ab75b49a3c2f7", + "reference": "049509fef80032cb3f051595029ab75b49a3c2f7", + "shasum": "" + }, + "require": { + "php": ">=5.3" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "Clue\\StreamFilter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering" + } + ], + "description": "A simple and modern approach to stream filtering in PHP", + "homepage": "https://github.com/clue/stream-filter", + "keywords": [ + "bucket brigade", + "callback", + "filter", + "php_user_filter", + "stream", + "stream_filter_append", + "stream_filter_register" + ], + "support": { + "issues": "https://github.com/clue/stream-filter/issues", + "source": "https://github.com/clue/stream-filter/tree/v1.7.0" + }, + "funding": [ + { + "url": "https://clue.engineering/support", + "type": "custom" + }, + { + "url": "https://github.com/clue", + "type": "github" + } + ], + "time": "2023-12-20T15:40:13+00:00" + }, + { + "name": "composer/pcre", + "version": "3.3.2", + "source": { + "type": "git", + "url": "https://github.com/composer/pcre.git", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/pcre/zipball/b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "reference": "b2bed4734f0cc156ee1fe9c0da2550420d99a21e", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "conflict": { + "phpstan/phpstan": "<1.11.10" + }, + "require-dev": { + "phpstan/phpstan": "^1.12 || ^2", + "phpstan/phpstan-strict-rules": "^1 || ^2", + "phpunit/phpunit": "^8 || ^9" + }, + "type": "library", + "extra": { + "phpstan": { + "includes": [ + "extension.neon" + ] + }, + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Pcre\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + } + ], + "description": "PCRE wrapping library that offers type-safe preg_* replacements.", + "keywords": [ + "PCRE", + "preg", + "regex", + "regular expression" + ], + "support": { + "issues": "https://github.com/composer/pcre/issues", + "source": "https://github.com/composer/pcre/tree/3.3.2" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-11-12T16:29:46+00:00" + }, + { + "name": "composer/semver", + "version": "3.4.4", + "source": { + "type": "git", + "url": "https://github.com/composer/semver.git", + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/semver/zipball/198166618906cb2de69b95d7d47e5fa8aa1b2b95", + "reference": "198166618906cb2de69b95d7d47e5fa8aa1b2b95", + "shasum": "" + }, + "require": { + "php": "^5.3.2 || ^7.0 || ^8.0" + }, + "require-dev": { + "phpstan/phpstan": "^1.11", + "symfony/phpunit-bridge": "^3 || ^7" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Composer\\Semver\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nils Adermann", + "email": "naderman@naderman.de", + "homepage": "http://www.naderman.de" + }, + { + "name": "Jordi Boggiano", + "email": "j.boggiano@seld.be", + "homepage": "http://seld.be" + }, + { + "name": "Rob Bast", + "email": "rob.bast@gmail.com", + "homepage": "http://robbast.nl" + } + ], + "description": "Semver library that offers utilities, version constraint parsing and validation.", + "keywords": [ + "semantic", + "semver", + "validation", + "versioning" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/semver/issues", + "source": "https://github.com/composer/semver/tree/3.4.4" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + } + ], + "time": "2025-08-20T19:15:30+00:00" + }, + { + "name": "composer/xdebug-handler", + "version": "3.0.5", + "source": { + "type": "git", + "url": "https://github.com/composer/xdebug-handler.git", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", + "shasum": "" + }, + "require": { + "composer/pcre": "^1 || ^2 || ^3", + "php": "^7.2.5 || ^8.0", + "psr/log": "^1 || ^2 || ^3" + }, + "require-dev": { + "phpstan/phpstan": "^1.0", + "phpstan/phpstan-strict-rules": "^1.1", + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Composer\\XdebugHandler\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "John Stevenson", + "email": "john-stevenson@blueyonder.co.uk" + } + ], + "description": "Restarts a process without Xdebug.", + "keywords": [ + "Xdebug", + "performance" + ], + "support": { + "irc": "ircs://irc.libera.chat:6697/composer", + "issues": "https://github.com/composer/xdebug-handler/issues", + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" + }, + "funding": [ + { + "url": "https://packagist.com", + "type": "custom" + }, + { + "url": "https://github.com/composer", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/composer/composer", + "type": "tidelift" + } + ], + "time": "2024-05-06T16:37:16+00:00" + }, + { + "name": "doctrine/deprecations", + "version": "1.1.5", + "source": { + "type": "git", + "url": "https://github.com/doctrine/deprecations.git", + "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/doctrine/deprecations/zipball/459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", + "reference": "459c2f5dd3d6a4633d3b5f46ee2b1c40f57d3f38", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "phpunit/phpunit": "<=7.5 || >=13" + }, + "require-dev": { + "doctrine/coding-standard": "^9 || ^12 || ^13", + "phpstan/phpstan": "1.4.10 || 2.1.11", + "phpstan/phpstan-phpunit": "^1.0 || ^2", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.6 || ^10.5 || ^11.5 || ^12", + "psr/log": "^1 || ^2 || ^3" + }, + "suggest": { + "psr/log": "Allows logging deprecations via PSR-3 logger implementation" + }, + "type": "library", + "autoload": { + "psr-4": { + "Doctrine\\Deprecations\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A small layer on top of trigger_error(E_USER_DEPRECATED) or PSR-3 logging with options to disable all deprecations or selectively for packages.", + "homepage": "https://www.doctrine-project.org/", + "support": { + "issues": "https://github.com/doctrine/deprecations/issues", + "source": "https://github.com/doctrine/deprecations/tree/1.1.5" + }, + "time": "2025-04-07T20:06:18+00:00" + }, + { + "name": "evenement/evenement", + "version": "v3.0.2", + "source": { + "type": "git", + "url": "https://github.com/igorw/evenement.git", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/igorw/evenement/zipball/0a16b0d71ab13284339abb99d9d2bd813640efbc", + "reference": "0a16b0d71ab13284339abb99d9d2bd813640efbc", + "shasum": "" + }, + "require": { + "php": ">=7.0" + }, + "require-dev": { + "phpunit/phpunit": "^9 || ^6" + }, + "type": "library", + "autoload": { + "psr-4": { + "Evenement\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Igor Wiedler", + "email": "igor@wiedler.ch" + } + ], + "description": "Événement is a very simple event dispatching library for PHP", + "keywords": [ + "event-dispatcher", + "event-emitter" + ], + "support": { + "issues": "https://github.com/igorw/evenement/issues", + "source": "https://github.com/igorw/evenement/tree/v3.0.2" + }, + "time": "2023-08-08T05:53:35+00:00" + }, + { + "name": "fidry/cpu-core-counter", + "version": "1.3.0", + "source": { + "type": "git", + "url": "https://github.com/theofidry/cpu-core-counter.git", + "reference": "db9508f7b1474469d9d3c53b86f817e344732678" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theofidry/cpu-core-counter/zipball/db9508f7b1474469d9d3c53b86f817e344732678", + "reference": "db9508f7b1474469d9d3c53b86f817e344732678", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "require-dev": { + "fidry/makefile": "^0.2.0", + "fidry/php-cs-fixer-config": "^1.1.2", + "phpstan/extension-installer": "^1.2.0", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-deprecation-rules": "^2.0.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^8.5.31 || ^9.5.26", + "webmozarts/strict-phpunit": "^7.5" + }, + "type": "library", + "autoload": { + "psr-4": { + "Fidry\\CpuCoreCounter\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Théo FIDRY", + "email": "theo.fidry@gmail.com" + } + ], + "description": "Tiny utility to get the number of CPU cores.", + "keywords": [ + "CPU", + "core" + ], + "support": { + "issues": "https://github.com/theofidry/cpu-core-counter/issues", + "source": "https://github.com/theofidry/cpu-core-counter/tree/1.3.0" + }, + "funding": [ + { + "url": "https://github.com/theofidry", + "type": "github" + } + ], + "time": "2025-08-14T07:29:31+00:00" + }, + { + "name": "filp/whoops", + "version": "2.18.4", + "source": { + "type": "git", + "url": "https://github.com/filp/whoops.git", + "reference": "d2102955e48b9fd9ab24280a7ad12ed552752c4d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/filp/whoops/zipball/d2102955e48b9fd9ab24280a7ad12ed552752c4d", + "reference": "d2102955e48b9fd9ab24280a7ad12ed552752c4d", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "psr/log": "^1.0.1 || ^2.0 || ^3.0" + }, + "require-dev": { + "mockery/mockery": "^1.0", + "phpunit/phpunit": "^7.5.20 || ^8.5.8 || ^9.3.3", + "symfony/var-dumper": "^4.0 || ^5.0" + }, + "suggest": { + "symfony/var-dumper": "Pretty print complex values better with var-dumper available", + "whoops/soap": "Formats errors as SOAP responses" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.7-dev" + } + }, + "autoload": { + "psr-4": { + "Whoops\\": "src/Whoops/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Filipe Dobreira", + "homepage": "https://github.com/filp", + "role": "Developer" + } + ], + "description": "php error handling for cool kids", + "homepage": "https://filp.github.io/whoops/", + "keywords": [ + "error", + "exception", + "handling", + "library", + "throwable", + "whoops" + ], + "support": { + "issues": "https://github.com/filp/whoops/issues", + "source": "https://github.com/filp/whoops/tree/2.18.4" + }, + "funding": [ + { + "url": "https://github.com/denis-sokolov", + "type": "github" + } + ], + "time": "2025-08-08T12:00:00+00:00" + }, + { + "name": "friendsofphp/php-cs-fixer", + "version": "v3.92.5", + "source": { + "type": "git", + "url": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer.git", + "reference": "260cc8c4a1d2f6d2f22cd4f9c70aa72e55ebac58" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/PHP-CS-Fixer/PHP-CS-Fixer/zipball/260cc8c4a1d2f6d2f22cd4f9c70aa72e55ebac58", + "reference": "260cc8c4a1d2f6d2f22cd4f9c70aa72e55ebac58", + "shasum": "" + }, + "require": { + "clue/ndjson-react": "^1.3", + "composer/semver": "^3.4", + "composer/xdebug-handler": "^3.0.5", + "ext-filter": "*", + "ext-hash": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "fidry/cpu-core-counter": "^1.3", + "php": "^7.4 || ^8.0", + "react/child-process": "^0.6.6", + "react/event-loop": "^1.5", + "react/socket": "^1.16", + "react/stream": "^1.4", + "sebastian/diff": "^4.0.6 || ^5.1.1 || ^6.0.2 || ^7.0", + "symfony/console": "^5.4.47 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/event-dispatcher": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/filesystem": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/finder": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/options-resolver": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0", + "symfony/polyfill-mbstring": "^1.33", + "symfony/polyfill-php80": "^1.33", + "symfony/polyfill-php81": "^1.33", + "symfony/polyfill-php84": "^1.33", + "symfony/process": "^5.4.47 || ^6.4.24 || ^7.2 || ^8.0", + "symfony/stopwatch": "^5.4.45 || ^6.4.24 || ^7.0 || ^8.0" + }, + "require-dev": { + "facile-it/paraunit": "^1.3.1 || ^2.7", + "infection/infection": "^0.31", + "justinrainbow/json-schema": "^6.6", + "keradus/cli-executor": "^2.3", + "mikey179/vfsstream": "^1.6.12", + "php-coveralls/php-coveralls": "^2.9", + "php-cs-fixer/phpunit-constraint-isidenticalstring": "^1.6", + "php-cs-fixer/phpunit-constraint-xmlmatchesxsd": "^1.6", + "phpunit/phpunit": "^9.6.31 || ^10.5.60 || ^11.5.46", + "symfony/polyfill-php85": "^1.33", + "symfony/var-dumper": "^5.4.48 || ^6.4.26 || ^7.4.0 || ^8.0", + "symfony/yaml": "^5.4.45 || ^6.4.30 || ^7.4.1 || ^8.0" + }, + "suggest": { + "ext-dom": "For handling output formats in XML", + "ext-mbstring": "For handling non-UTF8 characters." + }, + "bin": [ + "php-cs-fixer" + ], + "type": "application", + "autoload": { + "psr-4": { + "PhpCsFixer\\": "src/" + }, + "exclude-from-classmap": [ + "src/**/Internal/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Dariusz Rumiński", + "email": "dariusz.ruminski@gmail.com" + } + ], + "description": "A tool to automatically fix PHP code style", + "keywords": [ + "Static code analysis", + "fixer", + "standards", + "static analysis" + ], + "support": { + "issues": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/issues", + "source": "https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/tree/v3.92.5" + }, + "funding": [ + { + "url": "https://github.com/keradus", + "type": "github" + } + ], + "time": "2026-01-08T21:57:37+00:00" + }, + { + "name": "jean85/pretty-package-versions", + "version": "2.1.1", + "source": { + "type": "git", + "url": "https://github.com/Jean85/pretty-package-versions.git", + "reference": "4d7aa5dab42e2a76d99559706022885de0e18e1a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Jean85/pretty-package-versions/zipball/4d7aa5dab42e2a76d99559706022885de0e18e1a", + "reference": "4d7aa5dab42e2a76d99559706022885de0e18e1a", + "shasum": "" + }, + "require": { + "composer-runtime-api": "^2.1.0", + "php": "^7.4|^8.0" + }, + "require-dev": { + "friendsofphp/php-cs-fixer": "^3.2", + "jean85/composer-provided-replaced-stub-package": "^1.0", + "phpstan/phpstan": "^2.0", + "phpunit/phpunit": "^7.5|^8.5|^9.6", + "rector/rector": "^2.0", + "vimeo/psalm": "^4.3 || ^5.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "Jean85\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Alessandro Lai", + "email": "alessandro.lai85@gmail.com" + } + ], + "description": "A library to get pretty versions strings of installed dependencies", + "keywords": [ + "composer", + "package", + "release", + "versions" + ], + "support": { + "issues": "https://github.com/Jean85/pretty-package-versions/issues", + "source": "https://github.com/Jean85/pretty-package-versions/tree/2.1.1" + }, + "time": "2025-03-19T14:43:43+00:00" + }, + { + "name": "myclabs/deep-copy", + "version": "1.13.4", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "reference": "07d290f0c47959fd5eed98c95ee5602db07e0b6a", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "conflict": { + "doctrine/collections": "<1.6.8", + "doctrine/common": "<2.13.3 || >=3 <3.2.2" + }, + "require-dev": { + "doctrine/collections": "^1.6.8", + "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", + "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" + }, + "type": "library", + "autoload": { + "files": [ + "src/DeepCopy/deep_copy.php" + ], + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "support": { + "issues": "https://github.com/myclabs/DeepCopy/issues", + "source": "https://github.com/myclabs/DeepCopy/tree/1.13.4" + }, + "funding": [ + { + "url": "https://tidelift.com/funding/github/packagist/myclabs/deep-copy", + "type": "tidelift" + } + ], + "time": "2025-08-01T08:46:24+00:00" + }, + { + "name": "nikic/php-parser", + "version": "v5.7.0", + "source": { + "type": "git", + "url": "https://github.com/nikic/PHP-Parser.git", + "reference": "dca41cd15c2ac9d055ad70dbfd011130757d1f82" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/dca41cd15c2ac9d055ad70dbfd011130757d1f82", + "reference": "dca41cd15c2ac9d055ad70dbfd011130757d1f82", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-json": "*", + "ext-tokenizer": "*", + "php": ">=7.4" + }, + "require-dev": { + "ircmaxell/php-yacc": "^0.0.7", + "phpunit/phpunit": "^9.0" + }, + "bin": [ + "bin/php-parse" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "PhpParser\\": "lib/PhpParser" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Nikita Popov" + } + ], + "description": "A PHP parser written in PHP", + "keywords": [ + "parser", + "php" + ], + "support": { + "issues": "https://github.com/nikic/PHP-Parser/issues", + "source": "https://github.com/nikic/PHP-Parser/tree/v5.7.0" + }, + "time": "2025-12-06T11:56:16+00:00" + }, + { + "name": "nunomaduro/collision", + "version": "v8.8.3", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/collision.git", + "reference": "1dc9e88d105699d0fee8bb18890f41b274f6b4c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/collision/zipball/1dc9e88d105699d0fee8bb18890f41b274f6b4c4", + "reference": "1dc9e88d105699d0fee8bb18890f41b274f6b4c4", + "shasum": "" + }, + "require": { + "filp/whoops": "^2.18.1", + "nunomaduro/termwind": "^2.3.1", + "php": "^8.2.0", + "symfony/console": "^7.3.0" + }, + "conflict": { + "laravel/framework": "<11.44.2 || >=13.0.0", + "phpunit/phpunit": "<11.5.15 || >=13.0.0" + }, + "require-dev": { + "brianium/paratest": "^7.8.3", + "larastan/larastan": "^3.4.2", + "laravel/framework": "^11.44.2 || ^12.18", + "laravel/pint": "^1.22.1", + "laravel/sail": "^1.43.1", + "laravel/sanctum": "^4.1.1", + "laravel/tinker": "^2.10.1", + "orchestra/testbench-core": "^9.12.0 || ^10.4", + "pestphp/pest": "^3.8.2 || ^4.0.0", + "sebastian/environment": "^7.2.1 || ^8.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "NunoMaduro\\Collision\\Adapters\\Laravel\\CollisionServiceProvider" + ] + }, + "branch-alias": { + "dev-8.x": "8.x-dev" + } + }, + "autoload": { + "files": [ + "./src/Adapters/Phpunit/Autoload.php" + ], + "psr-4": { + "NunoMaduro\\Collision\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Cli error handling for console/command-line PHP applications.", + "keywords": [ + "artisan", + "cli", + "command-line", + "console", + "dev", + "error", + "handling", + "laravel", + "laravel-zero", + "php", + "symfony" + ], + "support": { + "issues": "https://github.com/nunomaduro/collision/issues", + "source": "https://github.com/nunomaduro/collision" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2025-11-20T02:55:25+00:00" + }, + { + "name": "nunomaduro/termwind", + "version": "v2.3.3", + "source": { + "type": "git", + "url": "https://github.com/nunomaduro/termwind.git", + "reference": "6fb2a640ff502caace8e05fd7be3b503a7e1c017" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/nunomaduro/termwind/zipball/6fb2a640ff502caace8e05fd7be3b503a7e1c017", + "reference": "6fb2a640ff502caace8e05fd7be3b503a7e1c017", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": "^8.2", + "symfony/console": "^7.3.6" + }, + "require-dev": { + "illuminate/console": "^11.46.1", + "laravel/pint": "^1.25.1", + "mockery/mockery": "^1.6.12", + "pestphp/pest": "^2.36.0 || ^3.8.4 || ^4.1.3", + "phpstan/phpstan": "^1.12.32", + "phpstan/phpstan-strict-rules": "^1.6.2", + "symfony/var-dumper": "^7.3.5", + "thecodingmachine/phpstan-strict-rules": "^1.0.0" + }, + "type": "library", + "extra": { + "laravel": { + "providers": [ + "Termwind\\Laravel\\TermwindServiceProvider" + ] + }, + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "files": [ + "src/Functions.php" + ], + "psr-4": { + "Termwind\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Its like Tailwind CSS, but for the console.", + "keywords": [ + "cli", + "console", + "css", + "package", + "php", + "style" + ], + "support": { + "issues": "https://github.com/nunomaduro/termwind/issues", + "source": "https://github.com/nunomaduro/termwind/tree/v2.3.3" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://github.com/xiCO2k", + "type": "github" + } + ], + "time": "2025-11-20T02:34:59+00:00" + }, + { + "name": "nyholm/psr7", + "version": "1.8.2", + "source": { + "type": "git", + "url": "https://github.com/Nyholm/psr7.git", + "reference": "a71f2b11690f4b24d099d6b16690a90ae14fc6f3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/Nyholm/psr7/zipball/a71f2b11690f4b24d099d6b16690a90ae14fc6f3", + "reference": "a71f2b11690f4b24d099d6b16690a90ae14fc6f3", + "shasum": "" + }, + "require": { + "php": ">=7.2", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0" + }, + "provide": { + "php-http/message-factory-implementation": "1.0", + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "http-interop/http-factory-tests": "^0.9", + "php-http/message-factory": "^1.0", + "php-http/psr7-integration-tests": "^1.0", + "phpunit/phpunit": "^7.5 || ^8.5 || ^9.4", + "symfony/error-handler": "^4.4" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.8-dev" + } + }, + "autoload": { + "psr-4": { + "Nyholm\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com" + }, + { + "name": "Martijn van der Ven", + "email": "martijn@vanderven.se" + } + ], + "description": "A fast PHP7 implementation of PSR-7", + "homepage": "https://tnyholm.se", + "keywords": [ + "psr-17", + "psr-7" + ], + "support": { + "issues": "https://github.com/Nyholm/psr7/issues", + "source": "https://github.com/Nyholm/psr7/tree/1.8.2" + }, + "funding": [ + { + "url": "https://github.com/Zegnat", + "type": "github" + }, + { + "url": "https://github.com/nyholm", + "type": "github" + } + ], + "time": "2024-09-09T07:06:30+00:00" + }, + { + "name": "pestphp/pest", + "version": "v3.8.4", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest.git", + "reference": "72cf695554420e21858cda831d5db193db102574" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest/zipball/72cf695554420e21858cda831d5db193db102574", + "reference": "72cf695554420e21858cda831d5db193db102574", + "shasum": "" + }, + "require": { + "brianium/paratest": "^7.8.4", + "nunomaduro/collision": "^8.8.2", + "nunomaduro/termwind": "^2.3.1", + "pestphp/pest-plugin": "^3.0.0", + "pestphp/pest-plugin-arch": "^3.1.1", + "pestphp/pest-plugin-mutate": "^3.0.5", + "php": "^8.2.0", + "phpunit/phpunit": "^11.5.33" + }, + "conflict": { + "filp/whoops": "<2.16.0", + "phpunit/phpunit": ">11.5.33", + "sebastian/exporter": "<6.0.0", + "webmozart/assert": "<1.11.0" + }, + "require-dev": { + "pestphp/pest-dev-tools": "^3.4.0", + "pestphp/pest-plugin-type-coverage": "^3.6.1", + "symfony/process": "^7.3.0" + }, + "bin": [ + "bin/pest" + ], + "type": "library", + "extra": { + "pest": { + "plugins": [ + "Pest\\Mutate\\Plugins\\Mutate", + "Pest\\Plugins\\Configuration", + "Pest\\Plugins\\Bail", + "Pest\\Plugins\\Cache", + "Pest\\Plugins\\Coverage", + "Pest\\Plugins\\Init", + "Pest\\Plugins\\Environment", + "Pest\\Plugins\\Help", + "Pest\\Plugins\\Memory", + "Pest\\Plugins\\Only", + "Pest\\Plugins\\Printer", + "Pest\\Plugins\\ProcessIsolation", + "Pest\\Plugins\\Profile", + "Pest\\Plugins\\Retry", + "Pest\\Plugins\\Snapshot", + "Pest\\Plugins\\Verbose", + "Pest\\Plugins\\Version", + "Pest\\Plugins\\Parallel" + ] + }, + "phpstan": { + "includes": [ + "extension.neon" + ] + } + }, + "autoload": { + "files": [ + "src/Functions.php", + "src/Pest.php" + ], + "psr-4": { + "Pest\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "The elegant PHP Testing Framework.", + "keywords": [ + "framework", + "pest", + "php", + "test", + "testing", + "unit" + ], + "support": { + "issues": "https://github.com/pestphp/pest/issues", + "source": "https://github.com/pestphp/pest/tree/v3.8.4" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + } + ], + "time": "2025-08-20T19:12:42+00:00" + }, + { + "name": "pestphp/pest-plugin", + "version": "v3.0.0", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin.git", + "reference": "e79b26c65bc11c41093b10150c1341cc5cdbea83" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin/zipball/e79b26c65bc11c41093b10150c1341cc5cdbea83", + "reference": "e79b26c65bc11c41093b10150c1341cc5cdbea83", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.0.0", + "composer-runtime-api": "^2.2.2", + "php": "^8.2" + }, + "conflict": { + "pestphp/pest": "<3.0.0" + }, + "require-dev": { + "composer/composer": "^2.7.9", + "pestphp/pest": "^3.0.0", + "pestphp/pest-dev-tools": "^3.0.0" + }, + "type": "composer-plugin", + "extra": { + "class": "Pest\\Plugin\\Manager" + }, + "autoload": { + "psr-4": { + "Pest\\Plugin\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The Pest plugin manager", + "keywords": [ + "framework", + "manager", + "pest", + "php", + "plugin", + "test", + "testing", + "unit" + ], + "support": { + "source": "https://github.com/pestphp/pest-plugin/tree/v3.0.0" + }, + "funding": [ + { + "url": "https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=66BYDWAT92N6L", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + }, + { + "url": "https://www.patreon.com/nunomaduro", + "type": "patreon" + } + ], + "time": "2024-09-08T23:21:41+00:00" + }, + { + "name": "pestphp/pest-plugin-arch", + "version": "v3.1.1", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin-arch.git", + "reference": "db7bd9cb1612b223e16618d85475c6f63b9c8daa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin-arch/zipball/db7bd9cb1612b223e16618d85475c6f63b9c8daa", + "reference": "db7bd9cb1612b223e16618d85475c6f63b9c8daa", + "shasum": "" + }, + "require": { + "pestphp/pest-plugin": "^3.0.0", + "php": "^8.2", + "ta-tikoma/phpunit-architecture-test": "^0.8.4" + }, + "require-dev": { + "pestphp/pest": "^3.8.1", + "pestphp/pest-dev-tools": "^3.4.0" + }, + "type": "library", + "extra": { + "pest": { + "plugins": [ + "Pest\\Arch\\Plugin" + ] + } + }, + "autoload": { + "files": [ + "src/Autoload.php" + ], + "psr-4": { + "Pest\\Arch\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "The Arch plugin for Pest PHP.", + "keywords": [ + "arch", + "architecture", + "framework", + "pest", + "php", + "plugin", + "test", + "testing", + "unit" + ], + "support": { + "source": "https://github.com/pestphp/pest-plugin-arch/tree/v3.1.1" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + } + ], + "time": "2025-04-16T22:59:48+00:00" + }, + { + "name": "pestphp/pest-plugin-mutate", + "version": "v3.0.5", + "source": { + "type": "git", + "url": "https://github.com/pestphp/pest-plugin-mutate.git", + "reference": "e10dbdc98c9e2f3890095b4fe2144f63a5717e08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/pestphp/pest-plugin-mutate/zipball/e10dbdc98c9e2f3890095b4fe2144f63a5717e08", + "reference": "e10dbdc98c9e2f3890095b4fe2144f63a5717e08", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^5.2.0", + "pestphp/pest-plugin": "^3.0.0", + "php": "^8.2", + "psr/simple-cache": "^3.0.0" + }, + "require-dev": { + "pestphp/pest": "^3.0.8", + "pestphp/pest-dev-tools": "^3.0.0", + "pestphp/pest-plugin-type-coverage": "^3.0.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Pest\\Mutate\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Sandro Gehri", + "email": "sandrogehri@gmail.com" + } + ], + "description": "Mutates your code to find untested cases", + "keywords": [ + "framework", + "mutate", + "mutation", + "pest", + "php", + "plugin", + "test", + "testing", + "unit" + ], + "support": { + "source": "https://github.com/pestphp/pest-plugin-mutate/tree/v3.0.5" + }, + "funding": [ + { + "url": "https://www.paypal.com/paypalme/enunomaduro", + "type": "custom" + }, + { + "url": "https://github.com/gehrisandro", + "type": "github" + }, + { + "url": "https://github.com/nunomaduro", + "type": "github" + } + ], + "time": "2024-09-22T07:54:40+00:00" + }, + { + "name": "phar-io/manifest", + "version": "2.0.4", + "source": { + "type": "git", + "url": "https://github.com/phar-io/manifest.git", + "reference": "54750ef60c58e43759730615a392c31c80e23176" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-phar": "*", + "ext-xmlwriter": "*", + "phar-io/version": "^3.0.1", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", + "support": { + "issues": "https://github.com/phar-io/manifest/issues", + "source": "https://github.com/phar-io/manifest/tree/2.0.4" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" + }, + { + "name": "phar-io/version", + "version": "3.2.1", + "source": { + "type": "git", + "url": "https://github.com/phar-io/version.git", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phar-io/version/zipball/4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "reference": "4f7fd7836c6f332bb2933569e566a0d6c4cbed74", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + }, + { + "name": "Sebastian Heuer", + "email": "sebastian@phpeople.de", + "role": "Developer" + }, + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "Developer" + } + ], + "description": "Library for handling version information and constraints", + "support": { + "issues": "https://github.com/phar-io/version/issues", + "source": "https://github.com/phar-io/version/tree/3.2.1" + }, + "time": "2022-02-21T01:04:05+00:00" + }, + { + "name": "php-http/client-common", + "version": "2.7.3", + "source": { + "type": "git", + "url": "https://github.com/php-http/client-common.git", + "reference": "dcc6de29c90dd74faab55f71b79d89409c4bf0c1" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/client-common/zipball/dcc6de29c90dd74faab55f71b79d89409c4bf0c1", + "reference": "dcc6de29c90dd74faab55f71b79d89409c4bf0c1", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "php-http/httplug": "^2.0", + "php-http/message": "^1.6", + "psr/http-client": "^1.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.0 || ^2.0", + "symfony/options-resolver": "~4.0.15 || ~4.1.9 || ^4.2.1 || ^5.0 || ^6.0 || ^7.0 || ^8.0", + "symfony/polyfill-php80": "^1.17" + }, + "require-dev": { + "doctrine/instantiator": "^1.1", + "guzzlehttp/psr7": "^1.4", + "nyholm/psr7": "^1.2", + "phpunit/phpunit": "^7.5.20 || ^8.5.33 || ^9.6.7" + }, + "suggest": { + "ext-json": "To detect JSON responses with the ContentTypePlugin", + "ext-libxml": "To detect XML responses with the ContentTypePlugin", + "php-http/cache-plugin": "PSR-6 Cache plugin", + "php-http/logger-plugin": "PSR-3 Logger plugin", + "php-http/stopwatch-plugin": "Symfony Stopwatch plugin" + }, + "type": "library", + "autoload": { + "psr-4": { + "Http\\Client\\Common\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Common HTTP Client implementations and tools for HTTPlug", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "common", + "http", + "httplug" + ], + "support": { + "issues": "https://github.com/php-http/client-common/issues", + "source": "https://github.com/php-http/client-common/tree/2.7.3" + }, + "time": "2025-11-29T19:12:34+00:00" + }, + { + "name": "php-http/httplug", + "version": "2.4.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/httplug.git", + "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/httplug/zipball/5cad731844891a4c282f3f3e1b582c46839d22f4", + "reference": "5cad731844891a4c282f3f3e1b582c46839d22f4", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "php-http/promise": "^1.1", + "psr/http-client": "^1.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "require-dev": { + "friends-of-phpspec/phpspec-code-coverage": "^4.1 || ^5.0 || ^6.0", + "phpspec/phpspec": "^5.1 || ^6.0 || ^7.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Eric GELOEN", + "email": "geloen.eric@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "HTTPlug, the HTTP client abstraction for PHP", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "http" + ], + "support": { + "issues": "https://github.com/php-http/httplug/issues", + "source": "https://github.com/php-http/httplug/tree/2.4.1" + }, + "time": "2024-09-23T11:39:58+00:00" + }, + { + "name": "php-http/message", + "version": "1.16.2", + "source": { + "type": "git", + "url": "https://github.com/php-http/message.git", + "reference": "06dd5e8562f84e641bf929bfe699ee0f5ce8080a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/message/zipball/06dd5e8562f84e641bf929bfe699ee0f5ce8080a", + "reference": "06dd5e8562f84e641bf929bfe699ee0f5ce8080a", + "shasum": "" + }, + "require": { + "clue/stream-filter": "^1.5", + "php": "^7.2 || ^8.0", + "psr/http-message": "^1.1 || ^2.0" + }, + "provide": { + "php-http/message-factory-implementation": "1.0" + }, + "require-dev": { + "ergebnis/composer-normalize": "^2.6", + "ext-zlib": "*", + "guzzlehttp/psr7": "^1.0 || ^2.0", + "laminas/laminas-diactoros": "^2.0 || ^3.0", + "php-http/message-factory": "^1.0.2", + "phpspec/phpspec": "^5.1 || ^6.3 || ^7.1", + "slim/slim": "^3.0" + }, + "suggest": { + "ext-zlib": "Used with compressor/decompressor streams", + "guzzlehttp/psr7": "Used with Guzzle PSR-7 Factories", + "laminas/laminas-diactoros": "Used with Diactoros Factories", + "slim/slim": "Used with Slim Framework PSR-7 implementation" + }, + "type": "library", + "autoload": { + "files": [ + "src/filters.php" + ], + "psr-4": { + "Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "HTTP Message related tools", + "homepage": "http://php-http.org", + "keywords": [ + "http", + "message", + "psr-7" + ], + "support": { + "issues": "https://github.com/php-http/message/issues", + "source": "https://github.com/php-http/message/tree/1.16.2" + }, + "time": "2024-10-02T11:34:13+00:00" + }, + { + "name": "php-http/mock-client", + "version": "1.6.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/mock-client.git", + "reference": "81f558234421f7da58ed015604a03808996017d0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/mock-client/zipball/81f558234421f7da58ed015604a03808996017d0", + "reference": "81f558234421f7da58ed015604a03808996017d0", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0", + "php-http/client-common": "^2.0", + "php-http/discovery": "^1.16", + "php-http/httplug": "^2.0", + "psr/http-client": "^1.0", + "psr/http-factory-implementation": "^1.0", + "psr/http-message": "^1.0 || ^2.0", + "symfony/polyfill-php80": "^1.17" + }, + "provide": { + "php-http/async-client-implementation": "1.0", + "php-http/client-implementation": "1.0", + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "phpspec/phpspec": "^5.1 || ^6.1 || ^7.3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Http\\Mock\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "David de Boer", + "email": "david@ddeboer.nl" + } + ], + "description": "Mock HTTP client", + "homepage": "http://httplug.io", + "keywords": [ + "client", + "http", + "mock", + "psr7" + ], + "support": { + "issues": "https://github.com/php-http/mock-client/issues", + "source": "https://github.com/php-http/mock-client/tree/1.6.1" + }, + "time": "2024-10-31T10:30:18+00:00" + }, + { + "name": "php-http/promise", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/php-http/promise.git", + "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-http/promise/zipball/fc85b1fba37c169a69a07ef0d5a8075770cc1f83", + "reference": "fc85b1fba37c169a69a07ef0d5a8075770cc1f83", + "shasum": "" + }, + "require": { + "php": "^7.1 || ^8.0" + }, + "require-dev": { + "friends-of-phpspec/phpspec-code-coverage": "^4.3.2 || ^6.3", + "phpspec/phpspec": "^5.1.2 || ^6.2 || ^7.4" + }, + "type": "library", + "autoload": { + "psr-4": { + "Http\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Joel Wurtz", + "email": "joel.wurtz@gmail.com" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com" + } + ], + "description": "Promise used for asynchronous HTTP requests", + "homepage": "http://httplug.io", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/php-http/promise/issues", + "source": "https://github.com/php-http/promise/tree/1.3.1" + }, + "time": "2024-03-15T13:55:21+00:00" + }, + { + "name": "phpdocumentor/reflection-common", + "version": "2.2.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionCommon.git", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionCommon/zipball/1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "reference": "1d01c49d4ed62f25aa84a747ad35d5a16924662b", + "shasum": "" + }, + "require": { + "php": "^7.2 || ^8.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-2.x": "2.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "Common reflection classes used by phpdocumentor to reflect the code structure", + "homepage": "http://www.phpdoc.org", + "keywords": [ + "FQSEN", + "phpDocumentor", + "phpdoc", + "reflection", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionCommon/issues", + "source": "https://github.com/phpDocumentor/ReflectionCommon/tree/2.x" + }, + "time": "2020-06-27T09:03:43+00:00" + }, + { + "name": "phpdocumentor/reflection-docblock", + "version": "5.6.6", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/ReflectionDocBlock.git", + "reference": "5cee1d3dfc2d2aa6599834520911d246f656bcb8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/ReflectionDocBlock/zipball/5cee1d3dfc2d2aa6599834520911d246f656bcb8", + "reference": "5cee1d3dfc2d2aa6599834520911d246f656bcb8", + "shasum": "" + }, + "require": { + "doctrine/deprecations": "^1.1", + "ext-filter": "*", + "php": "^7.4 || ^8.0", + "phpdocumentor/reflection-common": "^2.2", + "phpdocumentor/type-resolver": "^1.7", + "phpstan/phpdoc-parser": "^1.7|^2.0", + "webmozart/assert": "^1.9.1 || ^2" + }, + "require-dev": { + "mockery/mockery": "~1.3.5 || ~1.6.0", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-mockery": "^1.1", + "phpstan/phpstan-webmozart-assert": "^1.2", + "phpunit/phpunit": "^9.5", + "psalm/phar": "^5.26" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "5.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + }, + { + "name": "Jaap van Otterdijk", + "email": "opensource@ijaap.nl" + } + ], + "description": "With this component, a library can provide support for annotations via DocBlocks or otherwise retrieve information that is embedded in a DocBlock.", + "support": { + "issues": "https://github.com/phpDocumentor/ReflectionDocBlock/issues", + "source": "https://github.com/phpDocumentor/ReflectionDocBlock/tree/5.6.6" + }, + "time": "2025-12-22T21:13:58+00:00" + }, + { + "name": "phpdocumentor/type-resolver", + "version": "1.12.0", + "source": { + "type": "git", + "url": "https://github.com/phpDocumentor/TypeResolver.git", + "reference": "92a98ada2b93d9b201a613cb5a33584dde25f195" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpDocumentor/TypeResolver/zipball/92a98ada2b93d9b201a613cb5a33584dde25f195", + "reference": "92a98ada2b93d9b201a613cb5a33584dde25f195", + "shasum": "" + }, + "require": { + "doctrine/deprecations": "^1.0", + "php": "^7.3 || ^8.0", + "phpdocumentor/reflection-common": "^2.0", + "phpstan/phpdoc-parser": "^1.18|^2.0" + }, + "require-dev": { + "ext-tokenizer": "*", + "phpbench/phpbench": "^1.2", + "phpstan/extension-installer": "^1.1", + "phpstan/phpstan": "^1.8", + "phpstan/phpstan-phpunit": "^1.1", + "phpunit/phpunit": "^9.5", + "rector/rector": "^0.13.9", + "vimeo/psalm": "^4.25" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-1.x": "1.x-dev" + } + }, + "autoload": { + "psr-4": { + "phpDocumentor\\Reflection\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Mike van Riel", + "email": "me@mikevanriel.com" + } + ], + "description": "A PSR-5 based resolver of Class names, Types and Structural Element Names", + "support": { + "issues": "https://github.com/phpDocumentor/TypeResolver/issues", + "source": "https://github.com/phpDocumentor/TypeResolver/tree/1.12.0" + }, + "time": "2025-11-21T15:09:14+00:00" + }, + { + "name": "phpstan/extension-installer", + "version": "1.4.3", + "source": { + "type": "git", + "url": "https://github.com/phpstan/extension-installer.git", + "reference": "85e90b3942d06b2326fba0403ec24fe912372936" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/extension-installer/zipball/85e90b3942d06b2326fba0403ec24fe912372936", + "reference": "85e90b3942d06b2326fba0403ec24fe912372936", + "shasum": "" + }, + "require": { + "composer-plugin-api": "^2.0", + "php": "^7.2 || ^8.0", + "phpstan/phpstan": "^1.9.0 || ^2.0" + }, + "require-dev": { + "composer/composer": "^2.0", + "php-parallel-lint/php-parallel-lint": "^1.2.0", + "phpstan/phpstan-strict-rules": "^0.11 || ^0.12 || ^1.0" + }, + "type": "composer-plugin", + "extra": { + "class": "PHPStan\\ExtensionInstaller\\Plugin" + }, + "autoload": { + "psr-4": { + "PHPStan\\ExtensionInstaller\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Composer plugin for automatic installation of PHPStan extensions", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "issues": "https://github.com/phpstan/extension-installer/issues", + "source": "https://github.com/phpstan/extension-installer/tree/1.4.3" + }, + "time": "2024-09-04T20:21:43+00:00" + }, + { + "name": "phpstan/phpdoc-parser", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpdoc-parser.git", + "reference": "1e0cd5370df5dd2e556a36b9c62f62e555870495" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpdoc-parser/zipball/1e0cd5370df5dd2e556a36b9c62f62e555870495", + "reference": "1e0cd5370df5dd2e556a36b9c62f62e555870495", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "doctrine/annotations": "^2.0", + "nikic/php-parser": "^5.3.0", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/extension-installer": "^1.0", + "phpstan/phpstan": "^2.0", + "phpstan/phpstan-phpunit": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6", + "symfony/process": "^5.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPStan\\PhpDocParser\\": [ + "src/" + ] + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPDoc parser with support for nullable, intersection and generic types", + "support": { + "issues": "https://github.com/phpstan/phpdoc-parser/issues", + "source": "https://github.com/phpstan/phpdoc-parser/tree/2.3.0" + }, + "time": "2025-08-30T15:50:23+00:00" + }, + { + "name": "phpstan/phpstan", + "version": "2.1.33", + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan/zipball/9e800e6bee7d5bd02784d4c6069b48032d16224f", + "reference": "9e800e6bee7d5bd02784d4c6069b48032d16224f", + "shasum": "" + }, + "require": { + "php": "^7.4|^8.0" + }, + "conflict": { + "phpstan/phpstan-shim": "*" + }, + "bin": [ + "phpstan", + "phpstan.phar" + ], + "type": "library", + "autoload": { + "files": [ + "bootstrap.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPStan - PHP Static Analysis Tool", + "keywords": [ + "dev", + "static analysis" + ], + "support": { + "docs": "https://phpstan.org/user-guide/getting-started", + "forum": "https://github.com/phpstan/phpstan/discussions", + "issues": "https://github.com/phpstan/phpstan/issues", + "security": "https://github.com/phpstan/phpstan/security/policy", + "source": "https://github.com/phpstan/phpstan-src" + }, + "funding": [ + { + "url": "https://github.com/ondrejmirtes", + "type": "github" + }, + { + "url": "https://github.com/phpstan", + "type": "github" + } + ], + "time": "2025-12-05T10:24:31+00:00" + }, + { + "name": "phpstan/phpstan-phpunit", + "version": "2.0.11", + "source": { + "type": "git", + "url": "https://github.com/phpstan/phpstan-phpunit.git", + "reference": "5e30669bef866eff70db8b58d72a5c185aa82414" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/phpstan/phpstan-phpunit/zipball/5e30669bef866eff70db8b58d72a5c185aa82414", + "reference": "5e30669bef866eff70db8b58d72a5c185aa82414", + "shasum": "" + }, + "require": { + "php": "^7.4 || ^8.0", + "phpstan/phpstan": "^2.1.32" + }, + "conflict": { + "phpunit/phpunit": "<7.0" + }, + "require-dev": { + "nikic/php-parser": "^5", + "php-parallel-lint/php-parallel-lint": "^1.2", + "phpstan/phpstan-deprecation-rules": "^2.0", + "phpstan/phpstan-strict-rules": "^2.0", + "phpunit/phpunit": "^9.6" + }, + "type": "phpstan-extension", + "extra": { + "phpstan": { + "includes": [ + "extension.neon", + "rules.neon" + ] + } + }, + "autoload": { + "psr-4": { + "PHPStan\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "PHPUnit extensions and rules for PHPStan", + "support": { + "issues": "https://github.com/phpstan/phpstan-phpunit/issues", + "source": "https://github.com/phpstan/phpstan-phpunit/tree/2.0.11" + }, + "time": "2025-12-19T09:05:35+00:00" + }, + { + "name": "phpunit/php-code-coverage", + "version": "11.0.12", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-code-coverage.git", + "reference": "2c1ed04922802c15e1de5d7447b4856de949cf56" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/2c1ed04922802c15e1de5d7447b4856de949cf56", + "reference": "2c1ed04922802c15e1de5d7447b4856de949cf56", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-libxml": "*", + "ext-xmlwriter": "*", + "nikic/php-parser": "^5.7.0", + "php": ">=8.2", + "phpunit/php-file-iterator": "^5.1.0", + "phpunit/php-text-template": "^4.0.1", + "sebastian/code-unit-reverse-lookup": "^4.0.1", + "sebastian/complexity": "^4.0.1", + "sebastian/environment": "^7.2.1", + "sebastian/lines-of-code": "^3.0.1", + "sebastian/version": "^5.0.2", + "theseer/tokenizer": "^1.3.1" + }, + "require-dev": { + "phpunit/phpunit": "^11.5.46" + }, + "suggest": { + "ext-pcov": "PHP extension that provides line coverage", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "11.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that provides collection, processing, and rendering functionality for PHP code coverage information.", + "homepage": "https://github.com/sebastianbergmann/php-code-coverage", + "keywords": [ + "coverage", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", + "security": "https://github.com/sebastianbergmann/php-code-coverage/security/policy", + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/11.0.12" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-code-coverage", + "type": "tidelift" + } + ], + "time": "2025-12-24T07:01:01+00:00" + }, + { + "name": "phpunit/php-file-iterator", + "version": "5.1.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-file-iterator.git", + "reference": "118cfaaa8bc5aef3287bf315b6060b1174754af6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/118cfaaa8bc5aef3287bf315b6060b1174754af6", + "reference": "118cfaaa8bc5aef3287bf315b6060b1174754af6", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "FilterIterator implementation that filters files based on a list of suffixes.", + "homepage": "https://github.com/sebastianbergmann/php-file-iterator/", + "keywords": [ + "filesystem", + "iterator" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", + "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/5.1.0" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-08-27T05:02:59+00:00" + }, + { + "name": "phpunit/php-invoker", + "version": "5.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-invoker.git", + "reference": "c1ca3814734c07492b3d4c5f794f4b0995333da2" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-invoker/zipball/c1ca3814734c07492b3d4c5f794f4b0995333da2", + "reference": "c1ca3814734c07492b3d4c5f794f4b0995333da2", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "ext-pcntl": "*", + "phpunit/phpunit": "^11.0" + }, + "suggest": { + "ext-pcntl": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Invoke callables with a timeout", + "homepage": "https://github.com/sebastianbergmann/php-invoker/", + "keywords": [ + "process" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-invoker/issues", + "security": "https://github.com/sebastianbergmann/php-invoker/security/policy", + "source": "https://github.com/sebastianbergmann/php-invoker/tree/5.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:07:44+00:00" + }, + { + "name": "phpunit/php-text-template", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-text-template.git", + "reference": "3e0404dc6b300e6bf56415467ebcb3fe4f33e964" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/3e0404dc6b300e6bf56415467ebcb3fe4f33e964", + "reference": "3e0404dc6b300e6bf56415467ebcb3fe4f33e964", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Simple template engine.", + "homepage": "https://github.com/sebastianbergmann/php-text-template/", + "keywords": [ + "template" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-text-template/issues", + "security": "https://github.com/sebastianbergmann/php-text-template/security/policy", + "source": "https://github.com/sebastianbergmann/php-text-template/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:08:43+00:00" + }, + { + "name": "phpunit/php-timer", + "version": "7.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/php-timer.git", + "reference": "3b415def83fbcb41f991d9ebf16ae4ad8b7837b3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/3b415def83fbcb41f991d9ebf16ae4ad8b7837b3", + "reference": "3b415def83fbcb41f991d9ebf16ae4ad8b7837b3", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "7.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Utility class for timing", + "homepage": "https://github.com/sebastianbergmann/php-timer/", + "keywords": [ + "timer" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/php-timer/issues", + "security": "https://github.com/sebastianbergmann/php-timer/security/policy", + "source": "https://github.com/sebastianbergmann/php-timer/tree/7.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:09:35+00:00" + }, + { + "name": "phpunit/phpunit", + "version": "11.5.33", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/phpunit.git", + "reference": "5965e9ff57546cb9137c0ff6aa78cb7442b05cf6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5965e9ff57546cb9137c0ff6aa78cb7442b05cf6", + "reference": "5965e9ff57546cb9137c0ff6aa78cb7442b05cf6", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-json": "*", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "ext-xmlwriter": "*", + "myclabs/deep-copy": "^1.13.4", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", + "php": ">=8.2", + "phpunit/php-code-coverage": "^11.0.10", + "phpunit/php-file-iterator": "^5.1.0", + "phpunit/php-invoker": "^5.0.1", + "phpunit/php-text-template": "^4.0.1", + "phpunit/php-timer": "^7.0.1", + "sebastian/cli-parser": "^3.0.2", + "sebastian/code-unit": "^3.0.3", + "sebastian/comparator": "^6.3.2", + "sebastian/diff": "^6.0.2", + "sebastian/environment": "^7.2.1", + "sebastian/exporter": "^6.3.0", + "sebastian/global-state": "^7.0.2", + "sebastian/object-enumerator": "^6.0.1", + "sebastian/type": "^5.1.3", + "sebastian/version": "^5.0.2", + "staabm/side-effects-detector": "^1.0.5" + }, + "suggest": { + "ext-soap": "To be able to generate mocks based on WSDL files" + }, + "bin": [ + "phpunit" + ], + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "11.5-dev" + } + }, + "autoload": { + "files": [ + "src/Framework/Assert/Functions.php" + ], + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "The PHP Unit Testing framework.", + "homepage": "https://phpunit.de/", + "keywords": [ + "phpunit", + "testing", + "xunit" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/phpunit/issues", + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.33" + }, + "funding": [ + { + "url": "https://phpunit.de/sponsors.html", + "type": "custom" + }, + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit", + "type": "tidelift" + } + ], + "time": "2025-08-16T05:19:02+00:00" + }, + { + "name": "psr/container", + "version": "2.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/container.git", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/container/zipball/c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "reference": "c71ecc56dfe541dbd90c5360474fbc405f8d5963", + "shasum": "" + }, + "require": { + "php": ">=7.4.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Container\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common Container Interface (PHP FIG PSR-11)", + "homepage": "https://github.com/php-fig/container", + "keywords": [ + "PSR-11", + "container", + "container-interface", + "container-interop", + "psr" + ], + "support": { + "issues": "https://github.com/php-fig/container/issues", + "source": "https://github.com/php-fig/container/tree/2.0.2" + }, + "time": "2021-11-05T16:47:00+00:00" + }, + { + "name": "psr/event-dispatcher", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/event-dispatcher.git", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/event-dispatcher/zipball/dbefd12671e8a14ec7f180cab83036ed26714bb0", + "reference": "dbefd12671e8a14ec7f180cab83036ed26714bb0", + "shasum": "" + }, + "require": { + "php": ">=7.2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\EventDispatcher\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "http://www.php-fig.org/" + } + ], + "description": "Standard interfaces for event handling.", + "keywords": [ + "events", + "psr", + "psr-14" + ], + "support": { + "issues": "https://github.com/php-fig/event-dispatcher/issues", + "source": "https://github.com/php-fig/event-dispatcher/tree/1.0.0" + }, + "time": "2019-01-08T18:20:26+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory" + }, + "time": "2024-04-15T12:06:14+00:00" + }, + { + "name": "psr/log", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/php-fig/log.git", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/log/zipball/f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "reference": "f16e1d5863e37f8d8c2a01719f5b34baa2b714d3", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Log\\": "src" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", + "keywords": [ + "log", + "psr", + "psr-3" + ], + "support": { + "source": "https://github.com/php-fig/log/tree/3.0.2" + }, + "time": "2024-09-11T13:17:53+00:00" + }, + { + "name": "psr/simple-cache", + "version": "3.0.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/simple-cache.git", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/simple-cache/zipball/764e0b3939f5ca87cb904f570ef9be2d78a07865", + "reference": "764e0b3939f5ca87cb904f570ef9be2d78a07865", + "shasum": "" + }, + "require": { + "php": ">=8.0.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\SimpleCache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interfaces for simple caching", + "keywords": [ + "cache", + "caching", + "psr", + "psr-16", + "simple-cache" + ], + "support": { + "source": "https://github.com/php-fig/simple-cache/tree/3.0.0" + }, + "time": "2021-10-29T13:26:27+00:00" + }, + { + "name": "react/cache", + "version": "v1.2.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/cache.git", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/cache/zipball/d47c472b64aa5608225f47965a484b75c7817d5b", + "reference": "d47c472b64aa5608225f47965a484b75c7817d5b", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/promise": "^3.0 || ^2.0 || ^1.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.5 || ^5.7 || ^4.8.35" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Cache\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, Promise-based cache interface for ReactPHP", + "keywords": [ + "cache", + "caching", + "promise", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/cache/issues", + "source": "https://github.com/reactphp/cache/tree/v1.2.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2022-11-30T15:59:55+00:00" + }, + { + "name": "react/child-process", + "version": "v0.6.7", + "source": { + "type": "git", + "url": "https://github.com/reactphp/child-process.git", + "reference": "970f0e71945556422ee4570ccbabaedc3cf04ad3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/child-process/zipball/970f0e71945556422ee4570ccbabaedc3cf04ad3", + "reference": "970f0e71945556422ee4570ccbabaedc3cf04ad3", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/event-loop": "^1.2", + "react/stream": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/socket": "^1.16", + "sebastian/environment": "^5.0 || ^3.0 || ^2.0 || ^1.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\ChildProcess\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven library for executing child processes with ReactPHP.", + "keywords": [ + "event-driven", + "process", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/child-process/issues", + "source": "https://github.com/reactphp/child-process/tree/v0.6.7" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-12-23T15:25:20+00:00" + }, + { + "name": "react/dns", + "version": "v1.14.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/dns.git", + "reference": "7562c05391f42701c1fccf189c8225fece1cd7c3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/dns/zipball/7562c05391f42701c1fccf189c8225fece1cd7c3", + "reference": "7562c05391f42701c1fccf189c8225fece1cd7c3", + "shasum": "" + }, + "require": { + "php": ">=5.3.0", + "react/cache": "^1.0 || ^0.6 || ^0.5", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.7 || ^1.2.1" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3 || ^2", + "react/promise-timer": "^1.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Dns\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async DNS resolver for ReactPHP", + "keywords": [ + "async", + "dns", + "dns-resolver", + "reactphp" + ], + "support": { + "issues": "https://github.com/reactphp/dns/issues", + "source": "https://github.com/reactphp/dns/tree/v1.14.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-11-18T19:34:28+00:00" + }, + { + "name": "react/event-loop", + "version": "v1.6.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/event-loop.git", + "reference": "ba276bda6083df7e0050fd9b33f66ad7a4ac747a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/event-loop/zipball/ba276bda6083df7e0050fd9b33f66ad7a4ac747a", + "reference": "ba276bda6083df7e0050fd9b33f66ad7a4ac747a", + "shasum": "" + }, + "require": { + "php": ">=5.3.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "suggest": { + "ext-pcntl": "For signal handling support when using the StreamSelectLoop" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\EventLoop\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "ReactPHP's core reactor event loop that libraries can use for evented I/O.", + "keywords": [ + "asynchronous", + "event-loop" + ], + "support": { + "issues": "https://github.com/reactphp/event-loop/issues", + "source": "https://github.com/reactphp/event-loop/tree/v1.6.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-11-17T20:46:25+00:00" + }, + { + "name": "react/promise", + "version": "v3.3.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/promise.git", + "reference": "23444f53a813a3296c1368bb104793ce8d88f04a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/promise/zipball/23444f53a813a3296c1368bb104793ce8d88f04a", + "reference": "23444f53a813a3296c1368bb104793ce8d88f04a", + "shasum": "" + }, + "require": { + "php": ">=7.1.0" + }, + "require-dev": { + "phpstan/phpstan": "1.12.28 || 1.4.10", + "phpunit/phpunit": "^9.6 || ^7.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "React\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "A lightweight implementation of CommonJS Promises/A for PHP", + "keywords": [ + "promise", + "promises" + ], + "support": { + "issues": "https://github.com/reactphp/promise/issues", + "source": "https://github.com/reactphp/promise/tree/v3.3.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-08-19T18:57:03+00:00" + }, + { + "name": "react/socket", + "version": "v1.17.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/socket.git", + "reference": "ef5b17b81f6f60504c539313f94f2d826c5faa08" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/socket/zipball/ef5b17b81f6f60504c539313f94f2d826c5faa08", + "reference": "ef5b17b81f6f60504c539313f94f2d826c5faa08", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.0", + "react/dns": "^1.13", + "react/event-loop": "^1.2", + "react/promise": "^3.2 || ^2.6 || ^1.2.1", + "react/stream": "^1.4" + }, + "require-dev": { + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36", + "react/async": "^4.3 || ^3.3 || ^2", + "react/promise-stream": "^1.4", + "react/promise-timer": "^1.11" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Socket\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Async, streaming plaintext TCP/IP and secure TLS socket server and client connections for ReactPHP", + "keywords": [ + "Connection", + "Socket", + "async", + "reactphp", + "stream" + ], + "support": { + "issues": "https://github.com/reactphp/socket/issues", + "source": "https://github.com/reactphp/socket/tree/v1.17.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2025-11-19T20:47:34+00:00" + }, + { + "name": "react/stream", + "version": "v1.4.0", + "source": { + "type": "git", + "url": "https://github.com/reactphp/stream.git", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/reactphp/stream/zipball/1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "reference": "1e5b0acb8fe55143b5b426817155190eb6f5b18d", + "shasum": "" + }, + "require": { + "evenement/evenement": "^3.0 || ^2.0 || ^1.0", + "php": ">=5.3.8", + "react/event-loop": "^1.2" + }, + "require-dev": { + "clue/stream-filter": "~1.2", + "phpunit/phpunit": "^9.6 || ^5.7 || ^4.8.36" + }, + "type": "library", + "autoload": { + "psr-4": { + "React\\Stream\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Christian Lück", + "email": "christian@clue.engineering", + "homepage": "https://clue.engineering/" + }, + { + "name": "Cees-Jan Kiewiet", + "email": "reactphp@ceesjankiewiet.nl", + "homepage": "https://wyrihaximus.net/" + }, + { + "name": "Jan Sorgalla", + "email": "jsorgalla@gmail.com", + "homepage": "https://sorgalla.com/" + }, + { + "name": "Chris Boden", + "email": "cboden@gmail.com", + "homepage": "https://cboden.dev/" + } + ], + "description": "Event-driven readable and writable streams for non-blocking I/O in ReactPHP", + "keywords": [ + "event-driven", + "io", + "non-blocking", + "pipe", + "reactphp", + "readable", + "stream", + "writable" + ], + "support": { + "issues": "https://github.com/reactphp/stream/issues", + "source": "https://github.com/reactphp/stream/tree/v1.4.0" + }, + "funding": [ + { + "url": "https://opencollective.com/reactphp", + "type": "open_collective" + } + ], + "time": "2024-06-11T12:45:25+00:00" + }, + { + "name": "sebastian/cli-parser", + "version": "3.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/cli-parser.git", + "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/cli-parser/zipball/15c5dd40dc4f38794d383bb95465193f5e0ae180", + "reference": "15c5dd40dc4f38794d383bb95465193f5e0ae180", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for parsing CLI options", + "homepage": "https://github.com/sebastianbergmann/cli-parser", + "support": { + "issues": "https://github.com/sebastianbergmann/cli-parser/issues", + "security": "https://github.com/sebastianbergmann/cli-parser/security/policy", + "source": "https://github.com/sebastianbergmann/cli-parser/tree/3.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:41:36+00:00" + }, + { + "name": "sebastian/code-unit", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit.git", + "reference": "54391c61e4af8078e5b276ab082b6d3c54c9ad64" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit/zipball/54391c61e4af8078e5b276ab082b6d3c54c9ad64", + "reference": "54391c61e4af8078e5b276ab082b6d3c54c9ad64", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the PHP code units", + "homepage": "https://github.com/sebastianbergmann/code-unit", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit/issues", + "security": "https://github.com/sebastianbergmann/code-unit/security/policy", + "source": "https://github.com/sebastianbergmann/code-unit/tree/3.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2025-03-19T07:56:08+00:00" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "183a9b2632194febd219bb9246eee421dad8d45e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/183a9b2632194febd219bb9246eee421dad8d45e", + "reference": "183a9b2632194febd219bb9246eee421dad8d45e", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "support": { + "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", + "security": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/security/policy", + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:45:54+00:00" + }, + { + "name": "sebastian/comparator", + "version": "6.3.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/comparator.git", + "reference": "85c77556683e6eee4323e4c5468641ca0237e2e8" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/85c77556683e6eee4323e4c5468641ca0237e2e8", + "reference": "85c77556683e6eee4323e4c5468641ca0237e2e8", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-mbstring": "*", + "php": ">=8.2", + "sebastian/diff": "^6.0", + "sebastian/exporter": "^6.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.4" + }, + "suggest": { + "ext-bcmath": "For comparing BcMath\\Number objects" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@2bepublished.at" + } + ], + "description": "Provides the functionality to compare PHP values for equality", + "homepage": "https://github.com/sebastianbergmann/comparator", + "keywords": [ + "comparator", + "compare", + "equality" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/comparator/issues", + "security": "https://github.com/sebastianbergmann/comparator/security/policy", + "source": "https://github.com/sebastianbergmann/comparator/tree/6.3.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/comparator", + "type": "tidelift" + } + ], + "time": "2025-08-10T08:07:46+00:00" + }, + { + "name": "sebastian/complexity", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/complexity.git", + "reference": "ee41d384ab1906c68852636b6de493846e13e5a0" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/complexity/zipball/ee41d384ab1906c68852636b6de493846e13e5a0", + "reference": "ee41d384ab1906c68852636b6de493846e13e5a0", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^5.0", + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for calculating the complexity of PHP code units", + "homepage": "https://github.com/sebastianbergmann/complexity", + "support": { + "issues": "https://github.com/sebastianbergmann/complexity/issues", + "security": "https://github.com/sebastianbergmann/complexity/security/policy", + "source": "https://github.com/sebastianbergmann/complexity/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:49:50+00:00" + }, + { + "name": "sebastian/diff", + "version": "6.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/diff.git", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/b4ccd857127db5d41a5b676f24b51371d76d8544", + "reference": "b4ccd857127db5d41a5b676f24b51371d76d8544", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0", + "symfony/process": "^4.2 || ^5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Kore Nordmann", + "email": "mail@kore-nordmann.de" + } + ], + "description": "Diff implementation", + "homepage": "https://github.com/sebastianbergmann/diff", + "keywords": [ + "diff", + "udiff", + "unidiff", + "unified diff" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/diff/issues", + "security": "https://github.com/sebastianbergmann/diff/security/policy", + "source": "https://github.com/sebastianbergmann/diff/tree/6.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:53:05+00:00" + }, + { + "name": "sebastian/environment", + "version": "7.2.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/environment.git", + "reference": "a5c75038693ad2e8d4b6c15ba2403532647830c4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/a5c75038693ad2e8d4b6c15ba2403532647830c4", + "reference": "a5c75038693ad2e8d4b6c15ba2403532647830c4", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.3" + }, + "suggest": { + "ext-posix": "*" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "7.2-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides functionality to handle HHVM/PHP environments", + "homepage": "https://github.com/sebastianbergmann/environment", + "keywords": [ + "Xdebug", + "environment", + "hhvm" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/environment/issues", + "security": "https://github.com/sebastianbergmann/environment/security/policy", + "source": "https://github.com/sebastianbergmann/environment/tree/7.2.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/environment", + "type": "tidelift" + } + ], + "time": "2025-05-21T11:55:47+00:00" + }, + { + "name": "sebastian/exporter", + "version": "6.3.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/exporter.git", + "reference": "70a298763b40b213ec087c51c739efcaa90bcd74" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/70a298763b40b213ec087c51c739efcaa90bcd74", + "reference": "70a298763b40b213ec087c51c739efcaa90bcd74", + "shasum": "" + }, + "require": { + "ext-mbstring": "*", + "php": ">=8.2", + "sebastian/recursion-context": "^6.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.3-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Volker Dusch", + "email": "github@wallbash.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + }, + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + } + ], + "description": "Provides the functionality to export PHP variables for visualization", + "homepage": "https://www.github.com/sebastianbergmann/exporter", + "keywords": [ + "export", + "exporter" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/exporter/issues", + "security": "https://github.com/sebastianbergmann/exporter/security/policy", + "source": "https://github.com/sebastianbergmann/exporter/tree/6.3.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/exporter", + "type": "tidelift" + } + ], + "time": "2025-09-24T06:12:51+00:00" + }, + { + "name": "sebastian/global-state", + "version": "7.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/global-state.git", + "reference": "3be331570a721f9a4b5917f4209773de17f747d7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/3be331570a721f9a4b5917f4209773de17f747d7", + "reference": "3be331570a721f9a4b5917f4209773de17f747d7", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "sebastian/object-reflector": "^4.0", + "sebastian/recursion-context": "^6.0" + }, + "require-dev": { + "ext-dom": "*", + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "7.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Snapshotting of global state", + "homepage": "https://www.github.com/sebastianbergmann/global-state", + "keywords": [ + "global state" + ], + "support": { + "issues": "https://github.com/sebastianbergmann/global-state/issues", + "security": "https://github.com/sebastianbergmann/global-state/security/policy", + "source": "https://github.com/sebastianbergmann/global-state/tree/7.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:57:36+00:00" + }, + { + "name": "sebastian/lines-of-code", + "version": "3.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/lines-of-code.git", + "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/lines-of-code/zipball/d36ad0d782e5756913e42ad87cb2890f4ffe467a", + "reference": "d36ad0d782e5756913e42ad87cb2890f4ffe467a", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^5.0", + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "3.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library for counting the lines of code in PHP source code", + "homepage": "https://github.com/sebastianbergmann/lines-of-code", + "support": { + "issues": "https://github.com/sebastianbergmann/lines-of-code/issues", + "security": "https://github.com/sebastianbergmann/lines-of-code/security/policy", + "source": "https://github.com/sebastianbergmann/lines-of-code/tree/3.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T04:58:38+00:00" + }, + { + "name": "sebastian/object-enumerator", + "version": "6.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "f5b498e631a74204185071eb41f33f38d64608aa" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/f5b498e631a74204185071eb41f33f38d64608aa", + "reference": "f5b498e631a74204185071eb41f33f38d64608aa", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "sebastian/object-reflector": "^4.0", + "sebastian/recursion-context": "^6.0" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", + "security": "https://github.com/sebastianbergmann/object-enumerator/security/policy", + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/6.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:00:13+00:00" + }, + { + "name": "sebastian/object-reflector", + "version": "4.0.1", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-reflector.git", + "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/6e1a43b411b2ad34146dee7524cb13a068bb35f9", + "reference": "6e1a43b411b2ad34146dee7524cb13a068bb35f9", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "4.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Allows reflection of object attributes, including inherited and non-public ones", + "homepage": "https://github.com/sebastianbergmann/object-reflector/", + "support": { + "issues": "https://github.com/sebastianbergmann/object-reflector/issues", + "security": "https://github.com/sebastianbergmann/object-reflector/security/policy", + "source": "https://github.com/sebastianbergmann/object-reflector/tree/4.0.1" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-07-03T05:01:32+00:00" + }, + { + "name": "sebastian/recursion-context", + "version": "6.0.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/recursion-context.git", + "reference": "f6458abbf32a6c8174f8f26261475dc133b3d9dc" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/f6458abbf32a6c8174f8f26261475dc133b3d9dc", + "reference": "f6458abbf32a6c8174f8f26261475dc133b3d9dc", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "6.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + }, + { + "name": "Jeff Welch", + "email": "whatthejeff@gmail.com" + }, + { + "name": "Adam Harvey", + "email": "aharvey@php.net" + } + ], + "description": "Provides functionality to recursively process PHP variables", + "homepage": "https://github.com/sebastianbergmann/recursion-context", + "support": { + "issues": "https://github.com/sebastianbergmann/recursion-context/issues", + "security": "https://github.com/sebastianbergmann/recursion-context/security/policy", + "source": "https://github.com/sebastianbergmann/recursion-context/tree/6.0.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/recursion-context", + "type": "tidelift" + } + ], + "time": "2025-08-13T04:42:22+00:00" + }, + { + "name": "sebastian/type", + "version": "5.1.3", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/type.git", + "reference": "f77d2d4e78738c98d9a68d2596fe5e8fa380f449" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/f77d2d4e78738c98d9a68d2596fe5e8fa380f449", + "reference": "f77d2d4e78738c98d9a68d2596fe5e8fa380f449", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "phpunit/phpunit": "^11.3" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.1-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Collection of value objects that represent the types of the PHP type system", + "homepage": "https://github.com/sebastianbergmann/type", + "support": { + "issues": "https://github.com/sebastianbergmann/type/issues", + "security": "https://github.com/sebastianbergmann/type/security/policy", + "source": "https://github.com/sebastianbergmann/type/tree/5.1.3" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/sebastian/type", + "type": "tidelift" + } + ], + "time": "2025-08-09T06:55:48+00:00" + }, + { + "name": "sebastian/version", + "version": "5.0.2", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c687e3387b99f5b03b6caa64c74b63e2936ff874", + "reference": "c687e3387b99f5b03b6caa64c74b63e2936ff874", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-main": "5.0-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de", + "role": "lead" + } + ], + "description": "Library that helps with managing the version number of Git-hosted PHP projects", + "homepage": "https://github.com/sebastianbergmann/version", + "support": { + "issues": "https://github.com/sebastianbergmann/version/issues", + "security": "https://github.com/sebastianbergmann/version/security/policy", + "source": "https://github.com/sebastianbergmann/version/tree/5.0.2" + }, + "funding": [ + { + "url": "https://github.com/sebastianbergmann", + "type": "github" + } + ], + "time": "2024-10-09T05:16:32+00:00" + }, + { + "name": "staabm/side-effects-detector", + "version": "1.0.5", + "source": { + "type": "git", + "url": "https://github.com/staabm/side-effects-detector.git", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/staabm/side-effects-detector/zipball/d8334211a140ce329c13726d4a715adbddd0a163", + "reference": "d8334211a140ce329c13726d4a715adbddd0a163", + "shasum": "" + }, + "require": { + "ext-tokenizer": "*", + "php": "^7.4 || ^8.0" + }, + "require-dev": { + "phpstan/extension-installer": "^1.4.3", + "phpstan/phpstan": "^1.12.6", + "phpunit/phpunit": "^9.6.21", + "symfony/var-dumper": "^5.4.43", + "tomasvotruba/type-coverage": "1.0.0", + "tomasvotruba/unused-public": "1.0.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "lib/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "A static analysis tool to detect side effects in PHP code", + "keywords": [ + "static analysis" + ], + "support": { + "issues": "https://github.com/staabm/side-effects-detector/issues", + "source": "https://github.com/staabm/side-effects-detector/tree/1.0.5" + }, + "funding": [ + { + "url": "https://github.com/staabm", + "type": "github" + } + ], + "time": "2024-10-20T05:08:20+00:00" + }, + { + "name": "symfony/console", + "version": "v7.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/console.git", + "reference": "732a9ca6cd9dfd940c639062d5edbde2f6727fb6" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/console/zipball/732a9ca6cd9dfd940c639062d5edbde2f6727fb6", + "reference": "732a9ca6cd9dfd940c639062d5edbde2f6727fb6", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/polyfill-mbstring": "~1.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/string": "^7.2|^8.0" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/dotenv": "<6.4", + "symfony/event-dispatcher": "<6.4", + "symfony/lock": "<6.4", + "symfony/process": "<6.4" + }, + "provide": { + "psr/log-implementation": "1.0|2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0|^8.0", + "symfony/dependency-injection": "^6.4|^7.0|^8.0", + "symfony/event-dispatcher": "^6.4|^7.0|^8.0", + "symfony/http-foundation": "^6.4|^7.0|^8.0", + "symfony/http-kernel": "^6.4|^7.0|^8.0", + "symfony/lock": "^6.4|^7.0|^8.0", + "symfony/messenger": "^6.4|^7.0|^8.0", + "symfony/process": "^6.4|^7.0|^8.0", + "symfony/stopwatch": "^6.4|^7.0|^8.0", + "symfony/var-dumper": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Console\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Eases the creation of beautiful and testable command line interfaces", + "homepage": "https://symfony.com", + "keywords": [ + "cli", + "command-line", + "console", + "terminal" + ], + "support": { + "source": "https://github.com/symfony/console/tree/v7.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-12-23T14:50:43+00:00" + }, + { + "name": "symfony/deprecation-contracts", + "version": "v3.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/deprecation-contracts.git", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/63afe740e99a13ba87ec199bb07bbdee937a5b62", + "reference": "63afe740e99a13ba87ec199bb07bbdee937a5b62", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "autoload": { + "files": [ + "function.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "A generic function and convention to trigger deprecation notices", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/deprecation-contracts/tree/v3.6.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:21:43+00:00" + }, + { + "name": "symfony/event-dispatcher", + "version": "v7.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher.git", + "reference": "9dddcddff1ef974ad87b3708e4b442dc38b2261d" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher/zipball/9dddcddff1ef974ad87b3708e4b442dc38b2261d", + "reference": "9dddcddff1ef974ad87b3708e4b442dc38b2261d", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/event-dispatcher-contracts": "^2.5|^3" + }, + "conflict": { + "symfony/dependency-injection": "<6.4", + "symfony/service-contracts": "<2.5" + }, + "provide": { + "psr/event-dispatcher-implementation": "1.0", + "symfony/event-dispatcher-implementation": "2.0|3.0" + }, + "require-dev": { + "psr/log": "^1|^2|^3", + "symfony/config": "^6.4|^7.0|^8.0", + "symfony/dependency-injection": "^6.4|^7.0|^8.0", + "symfony/error-handler": "^6.4|^7.0|^8.0", + "symfony/expression-language": "^6.4|^7.0|^8.0", + "symfony/framework-bundle": "^6.4|^7.0|^8.0", + "symfony/http-foundation": "^6.4|^7.0|^8.0", + "symfony/service-contracts": "^2.5|^3", + "symfony/stopwatch": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\EventDispatcher\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides tools that allow your application components to communicate with each other by dispatching events and listening to them", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/event-dispatcher/tree/v7.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-10-28T09:38:46+00:00" + }, + { + "name": "symfony/event-dispatcher-contracts", + "version": "v3.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/event-dispatcher-contracts.git", + "reference": "59eb412e93815df44f05f342958efa9f46b1e586" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/event-dispatcher-contracts/zipball/59eb412e93815df44f05f342958efa9f46b1e586", + "reference": "59eb412e93815df44f05f342958efa9f46b1e586", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/event-dispatcher": "^1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\EventDispatcher\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to dispatching event", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/event-dispatcher-contracts/tree/v3.6.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-25T14:21:43+00:00" + }, + { + "name": "symfony/filesystem", + "version": "v7.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/filesystem.git", + "reference": "d551b38811096d0be9c4691d406991b47c0c630a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/filesystem/zipball/d551b38811096d0be9c4691d406991b47c0c630a", + "reference": "d551b38811096d0be9c4691d406991b47c0c630a", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-mbstring": "~1.8" + }, + "require-dev": { + "symfony/process": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Filesystem\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides basic utilities for the filesystem", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/filesystem/tree/v7.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-11-27T13:27:24+00:00" + }, + { + "name": "symfony/finder", + "version": "v7.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/finder.git", + "reference": "fffe05569336549b20a1be64250b40516d6e8d06" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/finder/zipball/fffe05569336549b20a1be64250b40516d6e8d06", + "reference": "fffe05569336549b20a1be64250b40516d6e8d06", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "require-dev": { + "symfony/filesystem": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Finder\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Finds files and directories via an intuitive fluent interface", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/finder/tree/v7.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-12-23T14:50:43+00:00" + }, + { + "name": "symfony/http-client", + "version": "v7.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-client.git", + "reference": "d01dfac1e0dc99f18da48b18101c23ce57929616" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-client/zipball/d01dfac1e0dc99f18da48b18101c23ce57929616", + "reference": "d01dfac1e0dc99f18da48b18101c23ce57929616", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "psr/log": "^1|^2|^3", + "symfony/deprecation-contracts": "^2.5|^3", + "symfony/http-client-contracts": "~3.4.4|^3.5.2", + "symfony/polyfill-php83": "^1.29", + "symfony/service-contracts": "^2.5|^3" + }, + "conflict": { + "amphp/amp": "<2.5", + "amphp/socket": "<1.1", + "php-http/discovery": "<1.15", + "symfony/http-foundation": "<6.4" + }, + "provide": { + "php-http/async-client-implementation": "*", + "php-http/client-implementation": "*", + "psr/http-client-implementation": "1.0", + "symfony/http-client-implementation": "3.0" + }, + "require-dev": { + "amphp/http-client": "^4.2.1|^5.0", + "amphp/http-tunnel": "^1.0|^2.0", + "guzzlehttp/promises": "^1.4|^2.0", + "nyholm/psr7": "^1.0", + "php-http/httplug": "^1.0|^2.0", + "psr/http-client": "^1.0", + "symfony/amphp-http-client-meta": "^1.0|^2.0", + "symfony/cache": "^6.4|^7.0|^8.0", + "symfony/dependency-injection": "^6.4|^7.0|^8.0", + "symfony/http-kernel": "^6.4|^7.0|^8.0", + "symfony/messenger": "^6.4|^7.0|^8.0", + "symfony/process": "^6.4|^7.0|^8.0", + "symfony/rate-limiter": "^6.4|^7.0|^8.0", + "symfony/stopwatch": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\HttpClient\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides powerful methods to fetch HTTP resources synchronously or asynchronously", + "homepage": "https://symfony.com", + "keywords": [ + "http" + ], + "support": { + "source": "https://github.com/symfony/http-client/tree/v7.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-12-23T14:50:43+00:00" + }, + { + "name": "symfony/http-client-contracts", + "version": "v3.6.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/http-client-contracts.git", + "reference": "75d7043853a42837e68111812f4d964b01e5101c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/http-client-contracts/zipball/75d7043853a42837e68111812f4d964b01e5101c", + "reference": "75d7043853a42837e68111812f4d964b01e5101c", + "shasum": "" + }, + "require": { + "php": ">=8.1" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\HttpClient\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to HTTP clients", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/http-client-contracts/tree/v3.6.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-04-29T11:18:49+00:00" + }, + { + "name": "symfony/options-resolver", + "version": "v7.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/options-resolver.git", + "reference": "b38026df55197f9e39a44f3215788edf83187b80" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/options-resolver/zipball/b38026df55197f9e39a44f3215788edf83187b80", + "reference": "b38026df55197f9e39a44f3215788edf83187b80", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\OptionsResolver\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an improved replacement for the array_replace PHP function", + "homepage": "https://symfony.com", + "keywords": [ + "config", + "configuration", + "options" + ], + "support": { + "source": "https://github.com/symfony/options-resolver/tree/v7.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-11-12T15:39:26+00:00" + }, + { + "name": "symfony/polyfill-ctype", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-ctype.git", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/a3cc8b044a6ea513310cbd48ef7333b384945638", + "reference": "a3cc8b044a6ea513310cbd48ef7333b384945638", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "provide": { + "ext-ctype": "*" + }, + "suggest": { + "ext-ctype": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Ctype\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Gert de Pagter", + "email": "BackEndTea@gmail.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for ctype functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "ctype", + "polyfill", + "portable" + ], + "support": { + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-intl-grapheme", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-grapheme.git", + "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/380872130d3a5dd3ace2f4010d95125fde5d5c70", + "reference": "380872130d3a5dd3ace2f4010d95125fde5d5c70", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Grapheme\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's grapheme_* functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "grapheme", + "intl", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-06-27T09:58:17+00:00" + }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "3833d7255cc303546435cb650316bff708a1c75c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-mbstring", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-mbstring.git", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/6d857f4d76bd4b343eac26d6b539585d2bc56493", + "reference": "6d857f4d76bd4b343eac26d6b539585d2bc56493", + "shasum": "" + }, + "require": { + "ext-iconv": "*", + "php": ">=7.2" + }, + "provide": { + "ext-mbstring": "*" + }, + "suggest": { + "ext-mbstring": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Mbstring\\": "" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for the Mbstring extension", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "mbstring", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-12-23T08:48:59+00:00" + }, + { + "name": "symfony/polyfill-php80", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php80.git", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "reference": "0cc9dd0f17f61d8131e7df6b84bd344899fe2608", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php80\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ion Bazan", + "email": "ion.bazan@gmail.com" + }, + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php80/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-01-02T08:10:11+00:00" + }, + { + "name": "symfony/polyfill-php81", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php81.git", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php81/zipball/4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "reference": "4a4cfc2d253c21a5ad0e53071df248ed48c6ce5c", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php81\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.1+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php81/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, + { + "name": "symfony/polyfill-php83", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php83.git", + "reference": "17f6f9a6b1735c0f163024d959f700cfbc5155e5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php83/zipball/17f6f9a6b1735c0f163024d959f700cfbc5155e5", + "reference": "17f6f9a6b1735c0f163024d959f700cfbc5155e5", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php83\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.3+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php83/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-07-08T02:45:35+00:00" + }, + { + "name": "symfony/polyfill-php84", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-php84.git", + "reference": "d8ced4d875142b6a7426000426b8abc631d6b191" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-php84/zipball/d8ced4d875142b6a7426000426b8abc631d6b191", + "reference": "d8ced4d875142b6a7426000426b8abc631d6b191", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Php84\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill backporting some PHP 8.4+ features to lower PHP versions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-php84/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-06-24T13:30:11+00:00" + }, + { + "name": "symfony/process", + "version": "v7.4.3", + "source": { + "type": "git", + "url": "https://github.com/symfony/process.git", + "reference": "2f8e1a6cdf590ca63715da4d3a7a3327404a523f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/process/zipball/2f8e1a6cdf590ca63715da4d3a7a3327404a523f", + "reference": "2f8e1a6cdf590ca63715da4d3a7a3327404a523f", + "shasum": "" + }, + "require": { + "php": ">=8.2" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Process\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Executes commands in sub-processes", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/process/tree/v7.4.3" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-12-19T10:00:43+00:00" + }, + { + "name": "symfony/service-contracts", + "version": "v3.6.1", + "source": { + "type": "git", + "url": "https://github.com/symfony/service-contracts.git", + "reference": "45112560a3ba2d715666a509a0bc9521d10b6c43" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/service-contracts/zipball/45112560a3ba2d715666a509a0bc9521d10b6c43", + "reference": "45112560a3ba2d715666a509a0bc9521d10b6c43", + "shasum": "" + }, + "require": { + "php": ">=8.1", + "psr/container": "^1.1|^2.0", + "symfony/deprecation-contracts": "^2.5|^3" + }, + "conflict": { + "ext-psr": "<1.1|>=2" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/contracts", + "name": "symfony/contracts" + }, + "branch-alias": { + "dev-main": "3.6-dev" + } + }, + "autoload": { + "psr-4": { + "Symfony\\Contracts\\Service\\": "" + }, + "exclude-from-classmap": [ + "/Test/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Generic abstractions related to writing services", + "homepage": "https://symfony.com", + "keywords": [ + "abstractions", + "contracts", + "decoupling", + "interfaces", + "interoperability", + "standards" + ], + "support": { + "source": "https://github.com/symfony/service-contracts/tree/v3.6.1" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-07-15T11:30:57+00:00" + }, + { + "name": "symfony/stopwatch", + "version": "v7.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/stopwatch.git", + "reference": "8a24af0a2e8a872fb745047180649b8418303084" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/stopwatch/zipball/8a24af0a2e8a872fb745047180649b8418303084", + "reference": "8a24af0a2e8a872fb745047180649b8418303084", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/service-contracts": "^2.5|^3" + }, + "type": "library", + "autoload": { + "psr-4": { + "Symfony\\Component\\Stopwatch\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Fabien Potencier", + "email": "fabien@symfony.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides a way to profile code", + "homepage": "https://symfony.com", + "support": { + "source": "https://github.com/symfony/stopwatch/tree/v7.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-08-04T07:05:15+00:00" + }, + { + "name": "symfony/string", + "version": "v7.4.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/string.git", + "reference": "d50e862cb0a0e0886f73ca1f31b865efbb795003" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/string/zipball/d50e862cb0a0e0886f73ca1f31b865efbb795003", + "reference": "d50e862cb0a0e0886f73ca1f31b865efbb795003", + "shasum": "" + }, + "require": { + "php": ">=8.2", + "symfony/deprecation-contracts": "^2.5|^3.0", + "symfony/polyfill-ctype": "~1.8", + "symfony/polyfill-intl-grapheme": "~1.33", + "symfony/polyfill-intl-normalizer": "~1.0", + "symfony/polyfill-mbstring": "~1.0" + }, + "conflict": { + "symfony/translation-contracts": "<2.5" + }, + "require-dev": { + "symfony/emoji": "^7.1|^8.0", + "symfony/http-client": "^6.4|^7.0|^8.0", + "symfony/intl": "^6.4|^7.0|^8.0", + "symfony/translation-contracts": "^2.5|^3.0", + "symfony/var-exporter": "^6.4|^7.0|^8.0" + }, + "type": "library", + "autoload": { + "files": [ + "Resources/functions.php" + ], + "psr-4": { + "Symfony\\Component\\String\\": "" + }, + "exclude-from-classmap": [ + "/Tests/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Provides an object-oriented API to strings and deals with bytes, UTF-8 code points and grapheme clusters in a unified way", + "homepage": "https://symfony.com", + "keywords": [ + "grapheme", + "i18n", + "string", + "unicode", + "utf-8", + "utf8" + ], + "support": { + "source": "https://github.com/symfony/string/tree/v7.4.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2025-11-27T13:27:24+00:00" + }, + { + "name": "ta-tikoma/phpunit-architecture-test", + "version": "0.8.5", + "source": { + "type": "git", + "url": "https://github.com/ta-tikoma/phpunit-architecture-test.git", + "reference": "cf6fb197b676ba716837c886baca842e4db29005" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ta-tikoma/phpunit-architecture-test/zipball/cf6fb197b676ba716837c886baca842e4db29005", + "reference": "cf6fb197b676ba716837c886baca842e4db29005", + "shasum": "" + }, + "require": { + "nikic/php-parser": "^4.18.0 || ^5.0.0", + "php": "^8.1.0", + "phpdocumentor/reflection-docblock": "^5.3.0", + "phpunit/phpunit": "^10.5.5 || ^11.0.0 || ^12.0.0", + "symfony/finder": "^6.4.0 || ^7.0.0" + }, + "require-dev": { + "laravel/pint": "^1.13.7", + "phpstan/phpstan": "^1.10.52" + }, + "type": "library", + "autoload": { + "psr-4": { + "PHPUnit\\Architecture\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ni Shi", + "email": "futik0ma011@gmail.com" + }, + { + "name": "Nuno Maduro", + "email": "enunomaduro@gmail.com" + } + ], + "description": "Methods for testing application architecture", + "keywords": [ + "architecture", + "phpunit", + "stucture", + "test", + "testing" + ], + "support": { + "issues": "https://github.com/ta-tikoma/phpunit-architecture-test/issues", + "source": "https://github.com/ta-tikoma/phpunit-architecture-test/tree/0.8.5" + }, + "time": "2025-04-20T20:23:40+00:00" + }, + { + "name": "theseer/tokenizer", + "version": "1.3.1", + "source": { + "type": "git", + "url": "https://github.com/theseer/tokenizer.git", + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/b7489ce515e168639d17feec34b8847c326b0b3c", + "reference": "b7489ce515e168639d17feec34b8847c326b0b3c", + "shasum": "" + }, + "require": { + "ext-dom": "*", + "ext-tokenizer": "*", + "ext-xmlwriter": "*", + "php": "^7.2 || ^8.0" + }, + "type": "library", + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Arne Blankerts", + "email": "arne@blankerts.de", + "role": "Developer" + } + ], + "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", + "support": { + "issues": "https://github.com/theseer/tokenizer/issues", + "source": "https://github.com/theseer/tokenizer/tree/1.3.1" + }, + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2025-11-17T20:03:58+00:00" + }, + { + "name": "webmozart/assert", + "version": "2.1.1", + "source": { + "type": "git", + "url": "https://github.com/webmozarts/assert.git", + "reference": "bdbabc199a7ba9965484e4725d66170e5711323b" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/webmozarts/assert/zipball/bdbabc199a7ba9965484e4725d66170e5711323b", + "reference": "bdbabc199a7ba9965484e4725d66170e5711323b", + "shasum": "" + }, + "require": { + "ext-ctype": "*", + "ext-date": "*", + "ext-filter": "*", + "php": "^8.2" + }, + "suggest": { + "ext-intl": "", + "ext-simplexml": "", + "ext-spl": "" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-feature/2-0": "2.0-dev" + } + }, + "autoload": { + "psr-4": { + "Webmozart\\Assert\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Bernhard Schussek", + "email": "bschussek@gmail.com" + }, + { + "name": "Woody Gilk", + "email": "woody.gilk@gmail.com" + } + ], + "description": "Assertions to validate method input/output with nice error messages.", + "keywords": [ + "assert", + "check", + "validate" + ], + "support": { + "issues": "https://github.com/webmozarts/assert/issues", + "source": "https://github.com/webmozarts/assert/tree/2.1.1" + }, + "time": "2026-01-08T11:28:40+00:00" + } + ], + "aliases": [], + "minimum-stability": "stable", + "stability-flags": {}, + "prefer-stable": false, + "prefer-lowest": false, + "platform": { + "php": "^8.1" + }, + "platform-dev": {}, + "platform-overrides": { + "php": "8.3" + }, + "plugin-api-version": "2.6.0" +} From c91e31405811b0ec13c47d6640c80e4ac988bca4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 12 Jan 2026 02:10:31 +0000 Subject: [PATCH 116/193] chore(internal): codegen related update --- src/Core/Attributes/Api.php | 66 +++++++ src/Core/Concerns/SdkResponse.php | 29 +++ .../Contracts/ResponseConverter.php | 18 ++ src/Core/Implementation/Omit.php | 13 ++ tests/Core/TestModel.php | 181 ++++++++++++++++++ 5 files changed, 307 insertions(+) create mode 100644 src/Core/Attributes/Api.php create mode 100644 src/Core/Concerns/SdkResponse.php create mode 100644 src/Core/Conversion/Contracts/ResponseConverter.php create mode 100644 src/Core/Implementation/Omit.php create mode 100644 tests/Core/TestModel.php diff --git a/src/Core/Attributes/Api.php b/src/Core/Attributes/Api.php new file mode 100644 index 00000000..3ed05474 --- /dev/null +++ b/src/Core/Attributes/Api.php @@ -0,0 +1,66 @@ +|Converter|string|null */ + public readonly Converter|string|null $type; + + /** @var array */ + private static array $enumConverters = []; + + /** + * @param class-string|Converter|string|null $type + * @param class-string<\BackedEnum>|Converter|null $enum + * @param class-string|Converter|null $union + * @param class-string|Converter|string|null $list + * @param class-string|Converter|string|null $map + */ + public function __construct( + public readonly ?string $apiName = null, + Converter|string|null $type = null, + Converter|string|null $enum = null, + Converter|string|null $union = null, + Converter|string|null $list = null, + Converter|string|null $map = null, + public readonly bool $nullable = false, + public readonly bool $optional = false, + ) { + $type ??= $union; + if (null !== $list) { + $type ??= new ListOf($list); + } + if (null !== $map) { + $type ??= new MapOf($map); + } + if (null !== $enum) { + $type ??= $enum instanceof Converter ? $enum : $this->getEnumConverter($enum); + } + + $this->type = $type; + } + + /** @property class-string<\BackedEnum> $enum */ + private function getEnumConverter(string $enum): Converter + { + if (!isset(self::$enumConverters[$enum])) { + $converter = new EnumOf(array_column($enum::cases(), 'value')); // @phpstan-ignore-line + self::$enumConverters[$enum] = $converter; + } + + return self::$enumConverters[$enum]; + } +} diff --git a/src/Core/Concerns/SdkResponse.php b/src/Core/Concerns/SdkResponse.php new file mode 100644 index 00000000..ddc05f1f --- /dev/null +++ b/src/Core/Concerns/SdkResponse.php @@ -0,0 +1,29 @@ +_rawResponse = $response; + $instance->__unserialize(Util::decodeContent($response)); // @phpstan-ignore-line + + return $instance; + } + + public function getRawResponse(): ?ResponseInterface + { + return $this->_rawResponse; + } +} diff --git a/src/Core/Conversion/Contracts/ResponseConverter.php b/src/Core/Conversion/Contracts/ResponseConverter.php new file mode 100644 index 00000000..593282df --- /dev/null +++ b/src/Core/Conversion/Contracts/ResponseConverter.php @@ -0,0 +1,18 @@ +> */ + use SdkModel; + + #[Required] + public string $name; + + #[Required('age_years')] + public int $ageYears; + + /** @var list|null */ + #[Optional] + public ?array $friends; + + #[Required] + public ?string $owner; + + /** + * @param list|null $friends + */ + public function __construct( + string $name, + int $ageYears, + ?string $owner, + ?array $friends = null, + ) { + $this->initialize(); + + $this->name = $name; + $this->ageYears = $ageYears; + $this->owner = $owner; + + null != $friends && $this->friends = $friends; + } +} + +/** + * @internal + * + * @coversNothing + */ +#[CoversNothing] +class TestModelTest extends TestCase +{ + #[Test] + public function testBasicGetAndSet(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertEquals(12, $model->ageYears); + + ++$model->ageYears; + $this->assertEquals(13, $model->ageYears); + } + + #[Test] + public function testNullAccess(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertNull($model->owner); + $this->assertNull($model->friends); + } + + #[Test] + public function testArrayGetAndSet(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $model->friends ??= []; + $this->assertEquals([], $model->friends); + $model->friends[] = 'Alice'; + $this->assertEquals(['Alice'], $model->friends); + } + + #[Test] + public function testDiscernsBetweenNullAndUnset(): void + { + $modelUnsetFriends = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $modelNullFriends = new TestModel( + name: 'bob', + ageYears: 12, + owner: null, + ); + $modelNullFriends->friends = null; + + $this->assertEquals(12, $modelUnsetFriends->ageYears); + $this->assertEquals(12, $modelNullFriends->ageYears); + + $this->assertTrue($modelUnsetFriends->offsetExists('ageYears')); + $this->assertTrue($modelNullFriends->offsetExists('ageYears')); + + $this->assertNull($modelUnsetFriends->friends); + $this->assertNull($modelNullFriends->friends); + + $this->assertFalse($modelUnsetFriends->offsetExists('friends')); + $this->assertTrue($modelNullFriends->offsetExists('friends')); + } + + #[Test] + public function testIssetOnOmittedProperties(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertFalse(isset($model->owner)); + $this->assertFalse(isset($model->friends)); + } + + #[Test] + public function testSerializeBasicModel(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: 'Eve', + friends: ['Alice', 'Charlie'], + ); + $this->assertEquals( + '{"name":"Bob","age_years":12,"friends":["Alice","Charlie"],"owner":"Eve"}', + json_encode($model) + ); + } + + #[Test] + public function testSerializeModelWithOmittedProperties(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertEquals( + '{"name":"Bob","age_years":12,"owner":null}', + json_encode($model) + ); + } + + #[Test] + public function testSerializeModelWithExplicitNull(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $model->friends = null; + $this->assertEquals( + '{"name":"Bob","age_years":12,"friends":null,"owner":null}', + json_encode($model) + ); + } +} From 0215531088e798a7ffbb41fc92afdba93e615305 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 12 Jan 2026 02:28:06 +0000 Subject: [PATCH 117/193] chore(internal): codegen related update --- src/Core/Attributes/Api.php | 66 ------- src/Core/Concerns/SdkResponse.php | 29 --- .../Contracts/ResponseConverter.php | 18 -- src/Core/Implementation/Omit.php | 13 -- tests/Core/TestModel.php | 181 ------------------ 5 files changed, 307 deletions(-) delete mode 100644 src/Core/Attributes/Api.php delete mode 100644 src/Core/Concerns/SdkResponse.php delete mode 100644 src/Core/Conversion/Contracts/ResponseConverter.php delete mode 100644 src/Core/Implementation/Omit.php delete mode 100644 tests/Core/TestModel.php diff --git a/src/Core/Attributes/Api.php b/src/Core/Attributes/Api.php deleted file mode 100644 index 3ed05474..00000000 --- a/src/Core/Attributes/Api.php +++ /dev/null @@ -1,66 +0,0 @@ -|Converter|string|null */ - public readonly Converter|string|null $type; - - /** @var array */ - private static array $enumConverters = []; - - /** - * @param class-string|Converter|string|null $type - * @param class-string<\BackedEnum>|Converter|null $enum - * @param class-string|Converter|null $union - * @param class-string|Converter|string|null $list - * @param class-string|Converter|string|null $map - */ - public function __construct( - public readonly ?string $apiName = null, - Converter|string|null $type = null, - Converter|string|null $enum = null, - Converter|string|null $union = null, - Converter|string|null $list = null, - Converter|string|null $map = null, - public readonly bool $nullable = false, - public readonly bool $optional = false, - ) { - $type ??= $union; - if (null !== $list) { - $type ??= new ListOf($list); - } - if (null !== $map) { - $type ??= new MapOf($map); - } - if (null !== $enum) { - $type ??= $enum instanceof Converter ? $enum : $this->getEnumConverter($enum); - } - - $this->type = $type; - } - - /** @property class-string<\BackedEnum> $enum */ - private function getEnumConverter(string $enum): Converter - { - if (!isset(self::$enumConverters[$enum])) { - $converter = new EnumOf(array_column($enum::cases(), 'value')); // @phpstan-ignore-line - self::$enumConverters[$enum] = $converter; - } - - return self::$enumConverters[$enum]; - } -} diff --git a/src/Core/Concerns/SdkResponse.php b/src/Core/Concerns/SdkResponse.php deleted file mode 100644 index ddc05f1f..00000000 --- a/src/Core/Concerns/SdkResponse.php +++ /dev/null @@ -1,29 +0,0 @@ -_rawResponse = $response; - $instance->__unserialize(Util::decodeContent($response)); // @phpstan-ignore-line - - return $instance; - } - - public function getRawResponse(): ?ResponseInterface - { - return $this->_rawResponse; - } -} diff --git a/src/Core/Conversion/Contracts/ResponseConverter.php b/src/Core/Conversion/Contracts/ResponseConverter.php deleted file mode 100644 index 593282df..00000000 --- a/src/Core/Conversion/Contracts/ResponseConverter.php +++ /dev/null @@ -1,18 +0,0 @@ -> */ - use SdkModel; - - #[Required] - public string $name; - - #[Required('age_years')] - public int $ageYears; - - /** @var list|null */ - #[Optional] - public ?array $friends; - - #[Required] - public ?string $owner; - - /** - * @param list|null $friends - */ - public function __construct( - string $name, - int $ageYears, - ?string $owner, - ?array $friends = null, - ) { - $this->initialize(); - - $this->name = $name; - $this->ageYears = $ageYears; - $this->owner = $owner; - - null != $friends && $this->friends = $friends; - } -} - -/** - * @internal - * - * @coversNothing - */ -#[CoversNothing] -class TestModelTest extends TestCase -{ - #[Test] - public function testBasicGetAndSet(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $this->assertEquals(12, $model->ageYears); - - ++$model->ageYears; - $this->assertEquals(13, $model->ageYears); - } - - #[Test] - public function testNullAccess(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $this->assertNull($model->owner); - $this->assertNull($model->friends); - } - - #[Test] - public function testArrayGetAndSet(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $model->friends ??= []; - $this->assertEquals([], $model->friends); - $model->friends[] = 'Alice'; - $this->assertEquals(['Alice'], $model->friends); - } - - #[Test] - public function testDiscernsBetweenNullAndUnset(): void - { - $modelUnsetFriends = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $modelNullFriends = new TestModel( - name: 'bob', - ageYears: 12, - owner: null, - ); - $modelNullFriends->friends = null; - - $this->assertEquals(12, $modelUnsetFriends->ageYears); - $this->assertEquals(12, $modelNullFriends->ageYears); - - $this->assertTrue($modelUnsetFriends->offsetExists('ageYears')); - $this->assertTrue($modelNullFriends->offsetExists('ageYears')); - - $this->assertNull($modelUnsetFriends->friends); - $this->assertNull($modelNullFriends->friends); - - $this->assertFalse($modelUnsetFriends->offsetExists('friends')); - $this->assertTrue($modelNullFriends->offsetExists('friends')); - } - - #[Test] - public function testIssetOnOmittedProperties(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $this->assertFalse(isset($model->owner)); - $this->assertFalse(isset($model->friends)); - } - - #[Test] - public function testSerializeBasicModel(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: 'Eve', - friends: ['Alice', 'Charlie'], - ); - $this->assertEquals( - '{"name":"Bob","age_years":12,"friends":["Alice","Charlie"],"owner":"Eve"}', - json_encode($model) - ); - } - - #[Test] - public function testSerializeModelWithOmittedProperties(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $this->assertEquals( - '{"name":"Bob","age_years":12,"owner":null}', - json_encode($model) - ); - } - - #[Test] - public function testSerializeModelWithExplicitNull(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $model->friends = null; - $this->assertEquals( - '{"name":"Bob","age_years":12,"friends":null,"owner":null}', - json_encode($model) - ); - } -} From d731ff1d6f21a3ac47c758e87e8219664962f1fb Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 12 Jan 2026 16:28:24 +0000 Subject: [PATCH 118/193] fix: typos in README.md --- README.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index d0dea342..304763c5 100644 --- a/README.md +++ b/README.md @@ -66,15 +66,17 @@ When the library is unable to connect to the API, or if the API returns a non-su files->upload(file: 'file', fileName: 'file-name.jpg'); } catch (APIConnectionException $e) { echo "The server could not be reached", PHP_EOL; var_dump($e->getPrevious()); -} catch (RateLimitError $e) { +} catch (RateLimitException $e) { echo "A 429 status code was received; we should back off a bit.", PHP_EOL; -} catch (APIStatusError $e) { +} catch (APIStatusException $e) { echo "Another non-200-range status code was received", PHP_EOL; echo $e->getMessage(); } From 87b1637ba7e0943ebd19f65cbadd9857cc6deb80 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 12 Jan 2026 17:58:15 +0000 Subject: [PATCH 119/193] chore(internal): codegen related update --- src/Core/Attributes/Api.php | 66 +++++++ src/Core/Concerns/SdkResponse.php | 29 +++ .../Contracts/ResponseConverter.php | 18 ++ src/Core/Implementation/Omit.php | 13 ++ tests/Core/TestModel.php | 180 ++++++++++++++++++ 5 files changed, 306 insertions(+) create mode 100644 src/Core/Attributes/Api.php create mode 100644 src/Core/Concerns/SdkResponse.php create mode 100644 src/Core/Conversion/Contracts/ResponseConverter.php create mode 100644 src/Core/Implementation/Omit.php create mode 100644 tests/Core/TestModel.php diff --git a/src/Core/Attributes/Api.php b/src/Core/Attributes/Api.php new file mode 100644 index 00000000..3ed05474 --- /dev/null +++ b/src/Core/Attributes/Api.php @@ -0,0 +1,66 @@ +|Converter|string|null */ + public readonly Converter|string|null $type; + + /** @var array */ + private static array $enumConverters = []; + + /** + * @param class-string|Converter|string|null $type + * @param class-string<\BackedEnum>|Converter|null $enum + * @param class-string|Converter|null $union + * @param class-string|Converter|string|null $list + * @param class-string|Converter|string|null $map + */ + public function __construct( + public readonly ?string $apiName = null, + Converter|string|null $type = null, + Converter|string|null $enum = null, + Converter|string|null $union = null, + Converter|string|null $list = null, + Converter|string|null $map = null, + public readonly bool $nullable = false, + public readonly bool $optional = false, + ) { + $type ??= $union; + if (null !== $list) { + $type ??= new ListOf($list); + } + if (null !== $map) { + $type ??= new MapOf($map); + } + if (null !== $enum) { + $type ??= $enum instanceof Converter ? $enum : $this->getEnumConverter($enum); + } + + $this->type = $type; + } + + /** @property class-string<\BackedEnum> $enum */ + private function getEnumConverter(string $enum): Converter + { + if (!isset(self::$enumConverters[$enum])) { + $converter = new EnumOf(array_column($enum::cases(), 'value')); // @phpstan-ignore-line + self::$enumConverters[$enum] = $converter; + } + + return self::$enumConverters[$enum]; + } +} diff --git a/src/Core/Concerns/SdkResponse.php b/src/Core/Concerns/SdkResponse.php new file mode 100644 index 00000000..ddc05f1f --- /dev/null +++ b/src/Core/Concerns/SdkResponse.php @@ -0,0 +1,29 @@ +_rawResponse = $response; + $instance->__unserialize(Util::decodeContent($response)); // @phpstan-ignore-line + + return $instance; + } + + public function getRawResponse(): ?ResponseInterface + { + return $this->_rawResponse; + } +} diff --git a/src/Core/Conversion/Contracts/ResponseConverter.php b/src/Core/Conversion/Contracts/ResponseConverter.php new file mode 100644 index 00000000..593282df --- /dev/null +++ b/src/Core/Conversion/Contracts/ResponseConverter.php @@ -0,0 +1,18 @@ +> */ + use SdkModel; + + #[Api] + public string $name; + + #[Api('age_years')] + public int $ageYears; + + /** @var list|null */ + #[Api(optional: true)] + public ?array $friends; + + #[Api] + public ?string $owner; + + /** + * @param list|null $friends + */ + public function __construct( + string $name, + int $ageYears, + ?string $owner, + ?array $friends = null, + ) { + $this->initialize(); + + $this->name = $name; + $this->ageYears = $ageYears; + $this->owner = $owner; + + null != $friends && $this->friends = $friends; + } +} + +/** + * @internal + * + * @coversNothing + */ +#[CoversNothing] +class TestModelTest extends TestCase +{ + #[Test] + public function testBasicGetAndSet(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertEquals(12, $model->ageYears); + + ++$model->ageYears; + $this->assertEquals(13, $model->ageYears); + } + + #[Test] + public function testNullAccess(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertNull($model->owner); + $this->assertNull($model->friends); + } + + #[Test] + public function testArrayGetAndSet(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $model->friends ??= []; + $this->assertEquals([], $model->friends); + $model->friends[] = 'Alice'; + $this->assertEquals(['Alice'], $model->friends); + } + + #[Test] + public function testDiscernsBetweenNullAndUnset(): void + { + $modelUnsetFriends = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $modelNullFriends = new TestModel( + name: 'bob', + ageYears: 12, + owner: null, + ); + $modelNullFriends->friends = null; + + $this->assertEquals(12, $modelUnsetFriends->ageYears); + $this->assertEquals(12, $modelNullFriends->ageYears); + + $this->assertTrue($modelUnsetFriends->offsetExists('ageYears')); + $this->assertTrue($modelNullFriends->offsetExists('ageYears')); + + $this->assertNull($modelUnsetFriends->friends); + $this->assertNull($modelNullFriends->friends); + + $this->assertFalse($modelUnsetFriends->offsetExists('friends')); + $this->assertTrue($modelNullFriends->offsetExists('friends')); + } + + #[Test] + public function testIssetOnOmittedProperties(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertFalse(isset($model->owner)); + $this->assertFalse(isset($model->friends)); + } + + #[Test] + public function testSerializeBasicModel(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: 'Eve', + friends: ['Alice', 'Charlie'], + ); + $this->assertEquals( + '{"name":"Bob","age_years":12,"friends":["Alice","Charlie"],"owner":"Eve"}', + json_encode($model) + ); + } + + #[Test] + public function testSerializeModelWithOmittedProperties(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertEquals( + '{"name":"Bob","age_years":12,"owner":null}', + json_encode($model) + ); + } + + #[Test] + public function testSerializeModelWithExplicitNull(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $model->friends = null; + $this->assertEquals( + '{"name":"Bob","age_years":12,"friends":null,"owner":null}', + json_encode($model) + ); + } +} From cc9408e49527807fd3a91d07c226d380b52247de Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 12 Jan 2026 19:14:08 +0000 Subject: [PATCH 120/193] chore(internal): codegen related update --- src/Core/Attributes/Api.php | 66 ------- src/Core/Concerns/SdkResponse.php | 29 --- .../Contracts/ResponseConverter.php | 18 -- src/Core/Implementation/Omit.php | 13 -- tests/Core/TestModel.php | 180 ------------------ 5 files changed, 306 deletions(-) delete mode 100644 src/Core/Attributes/Api.php delete mode 100644 src/Core/Concerns/SdkResponse.php delete mode 100644 src/Core/Conversion/Contracts/ResponseConverter.php delete mode 100644 src/Core/Implementation/Omit.php delete mode 100644 tests/Core/TestModel.php diff --git a/src/Core/Attributes/Api.php b/src/Core/Attributes/Api.php deleted file mode 100644 index 3ed05474..00000000 --- a/src/Core/Attributes/Api.php +++ /dev/null @@ -1,66 +0,0 @@ -|Converter|string|null */ - public readonly Converter|string|null $type; - - /** @var array */ - private static array $enumConverters = []; - - /** - * @param class-string|Converter|string|null $type - * @param class-string<\BackedEnum>|Converter|null $enum - * @param class-string|Converter|null $union - * @param class-string|Converter|string|null $list - * @param class-string|Converter|string|null $map - */ - public function __construct( - public readonly ?string $apiName = null, - Converter|string|null $type = null, - Converter|string|null $enum = null, - Converter|string|null $union = null, - Converter|string|null $list = null, - Converter|string|null $map = null, - public readonly bool $nullable = false, - public readonly bool $optional = false, - ) { - $type ??= $union; - if (null !== $list) { - $type ??= new ListOf($list); - } - if (null !== $map) { - $type ??= new MapOf($map); - } - if (null !== $enum) { - $type ??= $enum instanceof Converter ? $enum : $this->getEnumConverter($enum); - } - - $this->type = $type; - } - - /** @property class-string<\BackedEnum> $enum */ - private function getEnumConverter(string $enum): Converter - { - if (!isset(self::$enumConverters[$enum])) { - $converter = new EnumOf(array_column($enum::cases(), 'value')); // @phpstan-ignore-line - self::$enumConverters[$enum] = $converter; - } - - return self::$enumConverters[$enum]; - } -} diff --git a/src/Core/Concerns/SdkResponse.php b/src/Core/Concerns/SdkResponse.php deleted file mode 100644 index ddc05f1f..00000000 --- a/src/Core/Concerns/SdkResponse.php +++ /dev/null @@ -1,29 +0,0 @@ -_rawResponse = $response; - $instance->__unserialize(Util::decodeContent($response)); // @phpstan-ignore-line - - return $instance; - } - - public function getRawResponse(): ?ResponseInterface - { - return $this->_rawResponse; - } -} diff --git a/src/Core/Conversion/Contracts/ResponseConverter.php b/src/Core/Conversion/Contracts/ResponseConverter.php deleted file mode 100644 index 593282df..00000000 --- a/src/Core/Conversion/Contracts/ResponseConverter.php +++ /dev/null @@ -1,18 +0,0 @@ -> */ - use SdkModel; - - #[Api] - public string $name; - - #[Api('age_years')] - public int $ageYears; - - /** @var list|null */ - #[Api(optional: true)] - public ?array $friends; - - #[Api] - public ?string $owner; - - /** - * @param list|null $friends - */ - public function __construct( - string $name, - int $ageYears, - ?string $owner, - ?array $friends = null, - ) { - $this->initialize(); - - $this->name = $name; - $this->ageYears = $ageYears; - $this->owner = $owner; - - null != $friends && $this->friends = $friends; - } -} - -/** - * @internal - * - * @coversNothing - */ -#[CoversNothing] -class TestModelTest extends TestCase -{ - #[Test] - public function testBasicGetAndSet(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $this->assertEquals(12, $model->ageYears); - - ++$model->ageYears; - $this->assertEquals(13, $model->ageYears); - } - - #[Test] - public function testNullAccess(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $this->assertNull($model->owner); - $this->assertNull($model->friends); - } - - #[Test] - public function testArrayGetAndSet(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $model->friends ??= []; - $this->assertEquals([], $model->friends); - $model->friends[] = 'Alice'; - $this->assertEquals(['Alice'], $model->friends); - } - - #[Test] - public function testDiscernsBetweenNullAndUnset(): void - { - $modelUnsetFriends = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $modelNullFriends = new TestModel( - name: 'bob', - ageYears: 12, - owner: null, - ); - $modelNullFriends->friends = null; - - $this->assertEquals(12, $modelUnsetFriends->ageYears); - $this->assertEquals(12, $modelNullFriends->ageYears); - - $this->assertTrue($modelUnsetFriends->offsetExists('ageYears')); - $this->assertTrue($modelNullFriends->offsetExists('ageYears')); - - $this->assertNull($modelUnsetFriends->friends); - $this->assertNull($modelNullFriends->friends); - - $this->assertFalse($modelUnsetFriends->offsetExists('friends')); - $this->assertTrue($modelNullFriends->offsetExists('friends')); - } - - #[Test] - public function testIssetOnOmittedProperties(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $this->assertFalse(isset($model->owner)); - $this->assertFalse(isset($model->friends)); - } - - #[Test] - public function testSerializeBasicModel(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: 'Eve', - friends: ['Alice', 'Charlie'], - ); - $this->assertEquals( - '{"name":"Bob","age_years":12,"friends":["Alice","Charlie"],"owner":"Eve"}', - json_encode($model) - ); - } - - #[Test] - public function testSerializeModelWithOmittedProperties(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $this->assertEquals( - '{"name":"Bob","age_years":12,"owner":null}', - json_encode($model) - ); - } - - #[Test] - public function testSerializeModelWithExplicitNull(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $model->friends = null; - $this->assertEquals( - '{"name":"Bob","age_years":12,"friends":null,"owner":null}', - json_encode($model) - ); - } -} From 1c52ed5f2b1cadca880e71230a475077e9fc749a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 12 Jan 2026 22:53:28 +0000 Subject: [PATCH 121/193] chore(readme): remove beta warning now that we're in ga --- README.md | 7 ------- 1 file changed, 7 deletions(-) diff --git a/README.md b/README.md index 304763c5..81583e5f 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,5 @@ # Image Kit PHP API library -> [!NOTE] -> The Image Kit PHP API Library is currently in **beta** and we're excited for you to experiment with it! -> -> This library has not yet been exhaustively tested in production environments and may be missing some features you'd expect in a stable release. As we continue development, there may be breaking changes that require updates to your code. -> -> **We'd love your feedback!** Please share any suggestions, bug reports, feature requests, or general thoughts by [filing an issue](https://www.github.com/stainless-sdks/imagekit-php/issues/new). - The Image Kit PHP library provides convenient access to the Image Kit REST API from any PHP 8.1.0+ application. ## Documentation From 229940265d3a5e7ba42bf3fd5ecaec92d67c1e6d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 15 Jan 2026 06:52:39 +0000 Subject: [PATCH 122/193] feat(api): Add saved extensions API and enhance transformation options MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added complete CRUD API endpoints for saved extensions, allowing users to save complex extension configurations and reuse them across multiple assets Fixed metadata endpoint path: /v1/files/metadata → /v1/metadata Added and improved transformation options e.g. color replace, layer modes, distort effect, gradient background etc. --- .stats.yml | 8 +- src/BaseOverlay.php | 54 +++++- src/BaseOverlay/LayerMode.php | 25 +++ src/Client.php | 7 + src/ExtensionConfig.php | 47 +++++ src/ExtensionConfig/AITasksExtension.php | 88 +++++++++ src/ExtensionConfig/AITasksExtension/Task.php | 42 +++++ .../Task/AITaskSelectMetadata.php | 172 +++++++++++++++++ .../Task/AITaskSelectMetadata/Vocabulary.php | 26 +++ .../Task/AITaskSelectTags.php | 148 +++++++++++++++ .../AITasksExtension/Task/AITaskYesNo.php | 159 ++++++++++++++++ .../Task/AITaskYesNo/OnNo.php | 145 +++++++++++++++ .../Task/AITaskYesNo/OnNo/SetMetadata.php | 98 ++++++++++ .../AITaskYesNo/OnNo/SetMetadata/Value.php | 32 ++++ .../OnNo/SetMetadata/Value/Mixed_.php | 26 +++ .../Task/AITaskYesNo/OnNo/UnsetMetadata.php | 68 +++++++ .../Task/AITaskYesNo/OnUnknown.php | 145 +++++++++++++++ .../AITaskYesNo/OnUnknown/SetMetadata.php | 98 ++++++++++ .../OnUnknown/SetMetadata/Value.php | 32 ++++ .../OnUnknown/SetMetadata/Value/Mixed_.php | 26 +++ .../AITaskYesNo/OnUnknown/UnsetMetadata.php | 68 +++++++ .../Task/AITaskYesNo/OnYes.php | 145 +++++++++++++++ .../Task/AITaskYesNo/OnYes/SetMetadata.php | 98 ++++++++++ .../AITaskYesNo/OnYes/SetMetadata/Value.php | 32 ++++ .../OnYes/SetMetadata/Value/Mixed_.php | 26 +++ .../Task/AITaskYesNo/OnYes/UnsetMetadata.php | 68 +++++++ .../AutoDescriptionExtension.php | 41 +++++ src/ExtensionConfig/AutoTaggingExtension.php | 119 ++++++++++++ .../AutoTaggingExtension/Name.php | 15 ++ src/ExtensionConfig/RemovedotBgExtension.php | 67 +++++++ .../RemovedotBgExtension/Options.php | 117 ++++++++++++ src/ExtensionItem.php | 10 +- src/ExtensionItem/AITasksExtension.php | 88 +++++++++ src/ExtensionItem/AITasksExtension/Task.php | 42 +++++ .../Task/AITaskSelectMetadata.php | 172 +++++++++++++++++ .../Task/AITaskSelectMetadata/Vocabulary.php | 26 +++ .../Task/AITaskSelectTags.php | 148 +++++++++++++++ .../AITasksExtension/Task/AITaskYesNo.php | 159 ++++++++++++++++ .../Task/AITaskYesNo/OnNo.php | 145 +++++++++++++++ .../Task/AITaskYesNo/OnNo/SetMetadata.php | 98 ++++++++++ .../AITaskYesNo/OnNo/SetMetadata/Value.php | 32 ++++ .../OnNo/SetMetadata/Value/Mixed_.php | 26 +++ .../Task/AITaskYesNo/OnNo/UnsetMetadata.php | 68 +++++++ .../Task/AITaskYesNo/OnUnknown.php | 145 +++++++++++++++ .../AITaskYesNo/OnUnknown/SetMetadata.php | 98 ++++++++++ .../OnUnknown/SetMetadata/Value.php | 32 ++++ .../OnUnknown/SetMetadata/Value/Mixed_.php | 26 +++ .../AITaskYesNo/OnUnknown/UnsetMetadata.php | 68 +++++++ .../Task/AITaskYesNo/OnYes.php | 145 +++++++++++++++ .../Task/AITaskYesNo/OnYes/SetMetadata.php | 98 ++++++++++ .../AITaskYesNo/OnYes/SetMetadata/Value.php | 32 ++++ .../OnYes/SetMetadata/Value/Mixed_.php | 26 +++ .../Task/AITaskYesNo/OnYes/UnsetMetadata.php | 68 +++++++ src/ExtensionItem/SavedExtensionReference.php | 78 ++++++++ src/ImageOverlay.php | 46 +++++ src/ImageOverlay/Encoding.php | 4 + src/SavedExtension.php | 173 ++++++++++++++++++ .../SavedExtensionCreateParams.php | 136 ++++++++++++++ .../SavedExtensionUpdateParams.php | 118 ++++++++++++ .../SavedExtensionsContract.php | 95 ++++++++++ .../SavedExtensionsRawContract.php | 93 ++++++++++ src/Services/Files/MetadataRawService.php | 2 +- src/Services/SavedExtensionsRawService.php | 172 +++++++++++++++++ src/Services/SavedExtensionsService.php | 157 ++++++++++++++++ src/SolidColorOverlay.php | 38 ++++ src/SolidColorOverlayTransformation.php | 18 +- .../Radius.php | 11 +- src/SubtitleOverlay.php | 46 +++++ src/SubtitleOverlay/Encoding.php | 4 + src/SubtitleOverlayTransformation.php | 6 +- src/TextOverlay.php | 42 +++++ src/TextOverlay/Encoding.php | 2 + src/TextOverlayTransformation.php | 28 ++- src/TextOverlayTransformation/Flip.php | 3 +- src/TextOverlayTransformation/LineHeight.php | 4 +- src/TextOverlayTransformation/Radius.php | 11 +- src/Transformation.php | 80 +++++++- src/Transformation/Radius.php | 9 +- src/VideoOverlay.php | 46 +++++ src/VideoOverlay/Encoding.php | 4 + tests/Services/Beta/V2/FilesTest.php | 43 +++++ tests/Services/FilesTest.php | 43 +++++ tests/Services/SavedExtensionsTest.php | 127 +++++++++++++ 83 files changed, 5587 insertions(+), 46 deletions(-) create mode 100644 src/BaseOverlay/LayerMode.php create mode 100644 src/ExtensionConfig.php create mode 100644 src/ExtensionConfig/AITasksExtension.php create mode 100644 src/ExtensionConfig/AITasksExtension/Task.php create mode 100644 src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata.php create mode 100644 src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata/Vocabulary.php create mode 100644 src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php create mode 100644 src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo.php create mode 100644 src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo.php create mode 100644 src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata.php create mode 100644 src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value.php create mode 100644 src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value/Mixed_.php create mode 100644 src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/UnsetMetadata.php create mode 100644 src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown.php create mode 100644 src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata.php create mode 100644 src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value.php create mode 100644 src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value/Mixed_.php create mode 100644 src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/UnsetMetadata.php create mode 100644 src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes.php create mode 100644 src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata.php create mode 100644 src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value.php create mode 100644 src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value/Mixed_.php create mode 100644 src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/UnsetMetadata.php create mode 100644 src/ExtensionConfig/AutoDescriptionExtension.php create mode 100644 src/ExtensionConfig/AutoTaggingExtension.php create mode 100644 src/ExtensionConfig/AutoTaggingExtension/Name.php create mode 100644 src/ExtensionConfig/RemovedotBgExtension.php create mode 100644 src/ExtensionConfig/RemovedotBgExtension/Options.php create mode 100644 src/ExtensionItem/AITasksExtension.php create mode 100644 src/ExtensionItem/AITasksExtension/Task.php create mode 100644 src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata.php create mode 100644 src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata/Vocabulary.php create mode 100644 src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php create mode 100644 src/ExtensionItem/AITasksExtension/Task/AITaskYesNo.php create mode 100644 src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo.php create mode 100644 src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata.php create mode 100644 src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value.php create mode 100644 src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value/Mixed_.php create mode 100644 src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/UnsetMetadata.php create mode 100644 src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown.php create mode 100644 src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata.php create mode 100644 src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value.php create mode 100644 src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value/Mixed_.php create mode 100644 src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/UnsetMetadata.php create mode 100644 src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes.php create mode 100644 src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata.php create mode 100644 src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value.php create mode 100644 src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value/Mixed_.php create mode 100644 src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/UnsetMetadata.php create mode 100644 src/ExtensionItem/SavedExtensionReference.php create mode 100644 src/SavedExtension.php create mode 100644 src/SavedExtensions/SavedExtensionCreateParams.php create mode 100644 src/SavedExtensions/SavedExtensionUpdateParams.php create mode 100644 src/ServiceContracts/SavedExtensionsContract.php create mode 100644 src/ServiceContracts/SavedExtensionsRawContract.php create mode 100644 src/Services/SavedExtensionsRawService.php create mode 100644 src/Services/SavedExtensionsService.php create mode 100644 tests/Services/SavedExtensionsTest.php diff --git a/.stats.yml b/.stats.yml index e75a1bc7..fdbd8925 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ -configured_endpoints: 42 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-9d184cb502ab32a85db2889c796cdfebe812f2a55a604df79c85dd4b5e7e2add.yml -openapi_spec_hash: a9aa620376fce66532c84f9364209b0b -config_hash: 71cab8223bb5610c6c7ca6e9c4cc1f89 +configured_endpoints: 47 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-7a3257eb171467b637c8d72877f201c2e6038c71ed447a9453230b7309ce7416.yml +openapi_spec_hash: 87b000a9989ad5c9526f28d91b8a1749 +config_hash: aeb6eb949d73382270bbd8bbf2e4cf2a diff --git a/src/BaseOverlay.php b/src/BaseOverlay.php index 57f722c0..e9f25b00 100644 --- a/src/BaseOverlay.php +++ b/src/BaseOverlay.php @@ -4,6 +4,7 @@ namespace Imagekit; +use Imagekit\BaseOverlay\LayerMode; use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; @@ -13,6 +14,7 @@ * @phpstan-import-type OverlayTimingShape from \Imagekit\OverlayTiming * * @phpstan-type BaseOverlayShape = array{ + * layerMode?: null|LayerMode|value-of, * position?: null|OverlayPosition|OverlayPositionShape, * timing?: null|OverlayTiming|OverlayTimingShape, * } @@ -22,9 +24,31 @@ final class BaseOverlay implements BaseModel /** @use SdkModel */ use SdkModel; + /** + * Controls how the layer blends with the base image or underlying content. Maps to `lm` in the URL. + * By default, layers completely cover the base image beneath them. Layer modes change this behavior: + * - `multiply`: Multiplies the pixel values of the layer with the base image. The result is always darker than the original images. This is ideal for applying shadows or color tints. + * - `displace`: Uses the layer as a displacement map to distort pixels in the base image. The red channel controls horizontal displacement, and the green channel controls vertical displacement. Requires `x` or `y` parameter to control displacement magnitude. + * - `cutout`: Acts as an inverse mask where opaque areas of the layer turn the base image transparent, while transparent areas leave the base image unchanged. This mode functions like a hole-punch, effectively cutting the shape of the layer out of the underlying image. + * - `cutter`: Acts as a shape mask where only the parts of the base image that fall inside the opaque area of the layer are preserved. This mode functions like a cookie-cutter, trimming the base image to match the specific dimensions and shape of the layer. + * See [Layer modes](https://imagekit.io/docs/add-overlays-on-images#layer-modes). + * + * @var value-of|null $layerMode + */ + #[Optional(enum: LayerMode::class)] + public ?string $layerMode; + + /** + * Specifies the overlay's position relative to the parent asset. + * See [Position of Layer](https://imagekit.io/docs/transformations#position-of-layer). + */ #[Optional] public ?OverlayPosition $position; + /** + * Specifies timing information for the overlay (only applicable if the base asset is a video). + * See [Position of Layer](https://imagekit.io/docs/transformations#position-of-layer). + */ #[Optional] public ?OverlayTiming $timing; @@ -38,15 +62,18 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * + * @param LayerMode|value-of|null $layerMode * @param OverlayPosition|OverlayPositionShape|null $position * @param OverlayTiming|OverlayTimingShape|null $timing */ public static function with( + LayerMode|string|null $layerMode = null, OverlayPosition|array|null $position = null, - OverlayTiming|array|null $timing = null + OverlayTiming|array|null $timing = null, ): self { $self = new self; + null !== $layerMode && $self['layerMode'] = $layerMode; null !== $position && $self['position'] = $position; null !== $timing && $self['timing'] = $timing; @@ -54,6 +81,28 @@ public static function with( } /** + * Controls how the layer blends with the base image or underlying content. Maps to `lm` in the URL. + * By default, layers completely cover the base image beneath them. Layer modes change this behavior: + * - `multiply`: Multiplies the pixel values of the layer with the base image. The result is always darker than the original images. This is ideal for applying shadows or color tints. + * - `displace`: Uses the layer as a displacement map to distort pixels in the base image. The red channel controls horizontal displacement, and the green channel controls vertical displacement. Requires `x` or `y` parameter to control displacement magnitude. + * - `cutout`: Acts as an inverse mask where opaque areas of the layer turn the base image transparent, while transparent areas leave the base image unchanged. This mode functions like a hole-punch, effectively cutting the shape of the layer out of the underlying image. + * - `cutter`: Acts as a shape mask where only the parts of the base image that fall inside the opaque area of the layer are preserved. This mode functions like a cookie-cutter, trimming the base image to match the specific dimensions and shape of the layer. + * See [Layer modes](https://imagekit.io/docs/add-overlays-on-images#layer-modes). + * + * @param LayerMode|value-of $layerMode + */ + public function withLayerMode(LayerMode|string $layerMode): self + { + $self = clone $this; + $self['layerMode'] = $layerMode; + + return $self; + } + + /** + * Specifies the overlay's position relative to the parent asset. + * See [Position of Layer](https://imagekit.io/docs/transformations#position-of-layer). + * * @param OverlayPosition|OverlayPositionShape $position */ public function withPosition(OverlayPosition|array $position): self @@ -65,6 +114,9 @@ public function withPosition(OverlayPosition|array $position): self } /** + * Specifies timing information for the overlay (only applicable if the base asset is a video). + * See [Position of Layer](https://imagekit.io/docs/transformations#position-of-layer). + * * @param OverlayTiming|OverlayTimingShape $timing */ public function withTiming(OverlayTiming|array $timing): self diff --git a/src/BaseOverlay/LayerMode.php b/src/BaseOverlay/LayerMode.php new file mode 100644 index 00000000..98d1080c --- /dev/null +++ b/src/BaseOverlay/LayerMode.php @@ -0,0 +1,25 @@ +customMetadataFields = new CustomMetadataFieldsService($this); $this->files = new FilesService($this); + $this->savedExtensions = new SavedExtensionsService($this); $this->assets = new AssetsService($this); $this->cache = new CacheService($this); $this->folders = new FoldersService($this); diff --git a/src/ExtensionConfig.php b/src/ExtensionConfig.php new file mode 100644 index 00000000..962a6f97 --- /dev/null +++ b/src/ExtensionConfig.php @@ -0,0 +1,47 @@ +|array + */ + public static function variants(): array + { + return [ + AutoTaggingExtension::class, + 'remove-bg' => RemovedotBgExtension::class, + 'ai-auto-description' => AutoDescriptionExtension::class, + 'ai-tasks' => AITasksExtension::class, + ]; + } +} diff --git a/src/ExtensionConfig/AITasksExtension.php b/src/ExtensionConfig/AITasksExtension.php new file mode 100644 index 00000000..f952bcfc --- /dev/null +++ b/src/ExtensionConfig/AITasksExtension.php @@ -0,0 +1,88 @@ + + * } + */ +final class AITasksExtension implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Specifies the AI tasks extension for automated image analysis using AI models. + * + * @var 'ai-tasks' $name + */ + #[Required] + public string $name = 'ai-tasks'; + + /** + * Array of task objects defining AI operations to perform on the asset. + * + * @var list $tasks + */ + #[Required(list: Task::class)] + public array $tasks; + + /** + * `new AITasksExtension()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AITasksExtension::with(tasks: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AITasksExtension)->withTasks(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $tasks + */ + public static function with(array $tasks): self + { + $self = new self; + + $self['tasks'] = $tasks; + + return $self; + } + + /** + * Array of task objects defining AI operations to perform on the asset. + * + * @param list $tasks + */ + public function withTasks(array $tasks): self + { + $self = clone $this; + $self['tasks'] = $tasks; + + return $self; + } +} diff --git a/src/ExtensionConfig/AITasksExtension/Task.php b/src/ExtensionConfig/AITasksExtension/Task.php new file mode 100644 index 00000000..ff5cf9dc --- /dev/null +++ b/src/ExtensionConfig/AITasksExtension/Task.php @@ -0,0 +1,42 @@ +|array + */ + public static function variants(): array + { + return [ + 'select_tags' => AITaskSelectTags::class, + 'select_metadata' => AITaskSelectMetadata::class, + 'yes_no' => AITaskYesNo::class, + ]; + } +} diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata.php new file mode 100644 index 00000000..c6cbd13d --- /dev/null +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata.php @@ -0,0 +1,172 @@ +|null, + * } + */ +final class AITaskSelectMetadata implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Task type that analyzes the image and sets a custom metadata field value from a vocabulary. + * + * @var 'select_metadata' $type + */ + #[Required] + public string $type = 'select_metadata'; + + /** + * Name of the custom metadata field to set. The field must exist in your account. + */ + #[Required] + public string $field; + + /** + * The question or instruction for the AI to analyze the image. + */ + #[Required] + public string $instruction; + + /** + * Maximum number of values to select from the vocabulary. + */ + #[Optional('max_selections')] + public ?int $maxSelections; + + /** + * Minimum number of values to select from the vocabulary. + */ + #[Optional('min_selections')] + public ?int $minSelections; + + /** + * Array of possible values matching the custom metadata field type. + * + * @var list|null $vocabulary + */ + #[Optional(list: Vocabulary::class)] + public ?array $vocabulary; + + /** + * `new AITaskSelectMetadata()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AITaskSelectMetadata::with(field: ..., instruction: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AITaskSelectMetadata)->withField(...)->withInstruction(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list|null $vocabulary + */ + public static function with( + string $field, + string $instruction, + ?int $maxSelections = null, + ?int $minSelections = null, + ?array $vocabulary = null, + ): self { + $self = new self; + + $self['field'] = $field; + $self['instruction'] = $instruction; + + null !== $maxSelections && $self['maxSelections'] = $maxSelections; + null !== $minSelections && $self['minSelections'] = $minSelections; + null !== $vocabulary && $self['vocabulary'] = $vocabulary; + + return $self; + } + + /** + * Name of the custom metadata field to set. The field must exist in your account. + */ + public function withField(string $field): self + { + $self = clone $this; + $self['field'] = $field; + + return $self; + } + + /** + * The question or instruction for the AI to analyze the image. + */ + public function withInstruction(string $instruction): self + { + $self = clone $this; + $self['instruction'] = $instruction; + + return $self; + } + + /** + * Maximum number of values to select from the vocabulary. + */ + public function withMaxSelections(int $maxSelections): self + { + $self = clone $this; + $self['maxSelections'] = $maxSelections; + + return $self; + } + + /** + * Minimum number of values to select from the vocabulary. + */ + public function withMinSelections(int $minSelections): self + { + $self = clone $this; + $self['minSelections'] = $minSelections; + + return $self; + } + + /** + * Array of possible values matching the custom metadata field type. + * + * @param list $vocabulary + */ + public function withVocabulary(array $vocabulary): self + { + $self = clone $this; + $self['vocabulary'] = $vocabulary; + + return $self; + } +} diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata/Vocabulary.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata/Vocabulary.php new file mode 100644 index 00000000..539a0d96 --- /dev/null +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata/Vocabulary.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool']; + } +} diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php new file mode 100644 index 00000000..0a0eb35d --- /dev/null +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php @@ -0,0 +1,148 @@ +, + * maxSelections?: int|null, + * minSelections?: int|null, + * } + */ +final class AITaskSelectTags implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Task type that analyzes the image and adds matching tags from a vocabulary. + * + * @var 'select_tags' $type + */ + #[Required] + public string $type = 'select_tags'; + + /** + * The question or instruction for the AI to analyze the image. + */ + #[Required] + public string $instruction; + + /** + * Array of possible tag values. Combined length of all strings must not exceed 500 characters. Cannot contain the `%` character. + * + * @var list $vocabulary + */ + #[Required(list: 'string')] + public array $vocabulary; + + /** + * Maximum number of tags to select from the vocabulary. + */ + #[Optional('max_selections')] + public ?int $maxSelections; + + /** + * Minimum number of tags to select from the vocabulary. + */ + #[Optional('min_selections')] + public ?int $minSelections; + + /** + * `new AITaskSelectTags()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AITaskSelectTags::with(instruction: ..., vocabulary: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AITaskSelectTags)->withInstruction(...)->withVocabulary(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $vocabulary + */ + public static function with( + string $instruction, + array $vocabulary, + ?int $maxSelections = null, + ?int $minSelections = null, + ): self { + $self = new self; + + $self['instruction'] = $instruction; + $self['vocabulary'] = $vocabulary; + + null !== $maxSelections && $self['maxSelections'] = $maxSelections; + null !== $minSelections && $self['minSelections'] = $minSelections; + + return $self; + } + + /** + * The question or instruction for the AI to analyze the image. + */ + public function withInstruction(string $instruction): self + { + $self = clone $this; + $self['instruction'] = $instruction; + + return $self; + } + + /** + * Array of possible tag values. Combined length of all strings must not exceed 500 characters. Cannot contain the `%` character. + * + * @param list $vocabulary + */ + public function withVocabulary(array $vocabulary): self + { + $self = clone $this; + $self['vocabulary'] = $vocabulary; + + return $self; + } + + /** + * Maximum number of tags to select from the vocabulary. + */ + public function withMaxSelections(int $maxSelections): self + { + $self = clone $this; + $self['maxSelections'] = $maxSelections; + + return $self; + } + + /** + * Minimum number of tags to select from the vocabulary. + */ + public function withMinSelections(int $minSelections): self + { + $self = clone $this; + $self['minSelections'] = $minSelections; + + return $self; + } +} diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo.php new file mode 100644 index 00000000..bda0c8bd --- /dev/null +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo.php @@ -0,0 +1,159 @@ + */ + use SdkModel; + + /** + * Task type that asks a yes/no question and executes actions based on the answer. + * + * @var 'yes_no' $type + */ + #[Required] + public string $type = 'yes_no'; + + /** + * The yes/no question for the AI to answer about the image. + */ + #[Required] + public string $instruction; + + /** + * Actions to execute if the AI answers no. + */ + #[Optional('on_no')] + public ?OnNo $onNo; + + /** + * Actions to execute if the AI cannot determine the answer. + */ + #[Optional('on_unknown')] + public ?OnUnknown $onUnknown; + + /** + * Actions to execute if the AI answers yes. + */ + #[Optional('on_yes')] + public ?OnYes $onYes; + + /** + * `new AITaskYesNo()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AITaskYesNo::with(instruction: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AITaskYesNo)->withInstruction(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param OnNo|OnNoShape|null $onNo + * @param OnUnknown|OnUnknownShape|null $onUnknown + * @param OnYes|OnYesShape|null $onYes + */ + public static function with( + string $instruction, + OnNo|array|null $onNo = null, + OnUnknown|array|null $onUnknown = null, + OnYes|array|null $onYes = null, + ): self { + $self = new self; + + $self['instruction'] = $instruction; + + null !== $onNo && $self['onNo'] = $onNo; + null !== $onUnknown && $self['onUnknown'] = $onUnknown; + null !== $onYes && $self['onYes'] = $onYes; + + return $self; + } + + /** + * The yes/no question for the AI to answer about the image. + */ + public function withInstruction(string $instruction): self + { + $self = clone $this; + $self['instruction'] = $instruction; + + return $self; + } + + /** + * Actions to execute if the AI answers no. + * + * @param OnNo|OnNoShape $onNo + */ + public function withOnNo(OnNo|array $onNo): self + { + $self = clone $this; + $self['onNo'] = $onNo; + + return $self; + } + + /** + * Actions to execute if the AI cannot determine the answer. + * + * @param OnUnknown|OnUnknownShape $onUnknown + */ + public function withOnUnknown(OnUnknown|array $onUnknown): self + { + $self = clone $this; + $self['onUnknown'] = $onUnknown; + + return $self; + } + + /** + * Actions to execute if the AI answers yes. + * + * @param OnYes|OnYesShape $onYes + */ + public function withOnYes(OnYes|array $onYes): self + { + $self = clone $this; + $self['onYes'] = $onYes; + + return $self; + } +} diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo.php new file mode 100644 index 00000000..0d23c60e --- /dev/null +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo.php @@ -0,0 +1,145 @@ +|null, + * removeTags?: list|null, + * setMetadata?: list|null, + * unsetMetadata?: list|null, + * } + */ +final class OnNo implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Array of tag strings to add to the asset. + * + * @var list|null $addTags + */ + #[Optional('add_tags', list: 'string')] + public ?array $addTags; + + /** + * Array of tag strings to remove from the asset. + * + * @var list|null $removeTags + */ + #[Optional('remove_tags', list: 'string')] + public ?array $removeTags; + + /** + * Array of custom metadata field updates. + * + * @var list|null $setMetadata + */ + #[Optional('set_metadata', list: SetMetadata::class)] + public ?array $setMetadata; + + /** + * Array of custom metadata fields to remove. + * + * @var list|null $unsetMetadata + */ + #[Optional('unset_metadata', list: UnsetMetadata::class)] + public ?array $unsetMetadata; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list|null $addTags + * @param list|null $removeTags + * @param list|null $setMetadata + * @param list|null $unsetMetadata + */ + public static function with( + ?array $addTags = null, + ?array $removeTags = null, + ?array $setMetadata = null, + ?array $unsetMetadata = null, + ): self { + $self = new self; + + null !== $addTags && $self['addTags'] = $addTags; + null !== $removeTags && $self['removeTags'] = $removeTags; + null !== $setMetadata && $self['setMetadata'] = $setMetadata; + null !== $unsetMetadata && $self['unsetMetadata'] = $unsetMetadata; + + return $self; + } + + /** + * Array of tag strings to add to the asset. + * + * @param list $addTags + */ + public function withAddTags(array $addTags): self + { + $self = clone $this; + $self['addTags'] = $addTags; + + return $self; + } + + /** + * Array of tag strings to remove from the asset. + * + * @param list $removeTags + */ + public function withRemoveTags(array $removeTags): self + { + $self = clone $this; + $self['removeTags'] = $removeTags; + + return $self; + } + + /** + * Array of custom metadata field updates. + * + * @param list $setMetadata + */ + public function withSetMetadata(array $setMetadata): self + { + $self = clone $this; + $self['setMetadata'] = $setMetadata; + + return $self; + } + + /** + * Array of custom metadata fields to remove. + * + * @param list $unsetMetadata + */ + public function withUnsetMetadata(array $unsetMetadata): self + { + $self = clone $this; + $self['unsetMetadata'] = $unsetMetadata; + + return $self; + } +} diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata.php new file mode 100644 index 00000000..d9f94992 --- /dev/null +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata.php @@ -0,0 +1,98 @@ + */ + use SdkModel; + + /** + * Name of the custom metadata field to set. + */ + #[Required] + public string $field; + + /** + * Value to set for the custom metadata field. The value type should match the custom metadata field type. + * + * @var ValueVariants $value + */ + #[Required(union: Value::class)] + public string|float|bool|array $value; + + /** + * `new SetMetadata()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SetMetadata::with(field: ..., value: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SetMetadata)->withField(...)->withValue(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param ValueShape $value + */ + public static function with( + string $field, + string|float|bool|array $value + ): self { + $self = new self; + + $self['field'] = $field; + $self['value'] = $value; + + return $self; + } + + /** + * Name of the custom metadata field to set. + */ + public function withField(string $field): self + { + $self = clone $this; + $self['field'] = $field; + + return $self; + } + + /** + * Value to set for the custom metadata field. The value type should match the custom metadata field type. + * + * @param ValueShape $value + */ + public function withValue(string|float|bool|array $value): self + { + $self = clone $this; + $self['value'] = $value; + + return $self; + } +} diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value.php new file mode 100644 index 00000000..d675dc7a --- /dev/null +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value.php @@ -0,0 +1,32 @@ + + * @phpstan-type ValueShape = ValueVariants|list + */ +final class Value implements ConverterSource +{ + use SdkUnion; + + /** + * @return list|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool', new ListOf(Mixed_::class)]; + } +} diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value/Mixed_.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value/Mixed_.php new file mode 100644 index 00000000..ad001d4e --- /dev/null +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value/Mixed_.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool']; + } +} diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/UnsetMetadata.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/UnsetMetadata.php new file mode 100644 index 00000000..cef7e924 --- /dev/null +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/UnsetMetadata.php @@ -0,0 +1,68 @@ + */ + use SdkModel; + + /** + * Name of the custom metadata field to remove. + */ + #[Required] + public string $field; + + /** + * `new UnsetMetadata()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * UnsetMetadata::with(field: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new UnsetMetadata)->withField(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $field): self + { + $self = new self; + + $self['field'] = $field; + + return $self; + } + + /** + * Name of the custom metadata field to remove. + */ + public function withField(string $field): self + { + $self = clone $this; + $self['field'] = $field; + + return $self; + } +} diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown.php new file mode 100644 index 00000000..609552bf --- /dev/null +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown.php @@ -0,0 +1,145 @@ +|null, + * removeTags?: list|null, + * setMetadata?: list|null, + * unsetMetadata?: list|null, + * } + */ +final class OnUnknown implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Array of tag strings to add to the asset. + * + * @var list|null $addTags + */ + #[Optional('add_tags', list: 'string')] + public ?array $addTags; + + /** + * Array of tag strings to remove from the asset. + * + * @var list|null $removeTags + */ + #[Optional('remove_tags', list: 'string')] + public ?array $removeTags; + + /** + * Array of custom metadata field updates. + * + * @var list|null $setMetadata + */ + #[Optional('set_metadata', list: SetMetadata::class)] + public ?array $setMetadata; + + /** + * Array of custom metadata fields to remove. + * + * @var list|null $unsetMetadata + */ + #[Optional('unset_metadata', list: UnsetMetadata::class)] + public ?array $unsetMetadata; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list|null $addTags + * @param list|null $removeTags + * @param list|null $setMetadata + * @param list|null $unsetMetadata + */ + public static function with( + ?array $addTags = null, + ?array $removeTags = null, + ?array $setMetadata = null, + ?array $unsetMetadata = null, + ): self { + $self = new self; + + null !== $addTags && $self['addTags'] = $addTags; + null !== $removeTags && $self['removeTags'] = $removeTags; + null !== $setMetadata && $self['setMetadata'] = $setMetadata; + null !== $unsetMetadata && $self['unsetMetadata'] = $unsetMetadata; + + return $self; + } + + /** + * Array of tag strings to add to the asset. + * + * @param list $addTags + */ + public function withAddTags(array $addTags): self + { + $self = clone $this; + $self['addTags'] = $addTags; + + return $self; + } + + /** + * Array of tag strings to remove from the asset. + * + * @param list $removeTags + */ + public function withRemoveTags(array $removeTags): self + { + $self = clone $this; + $self['removeTags'] = $removeTags; + + return $self; + } + + /** + * Array of custom metadata field updates. + * + * @param list $setMetadata + */ + public function withSetMetadata(array $setMetadata): self + { + $self = clone $this; + $self['setMetadata'] = $setMetadata; + + return $self; + } + + /** + * Array of custom metadata fields to remove. + * + * @param list $unsetMetadata + */ + public function withUnsetMetadata(array $unsetMetadata): self + { + $self = clone $this; + $self['unsetMetadata'] = $unsetMetadata; + + return $self; + } +} diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata.php new file mode 100644 index 00000000..6f4df422 --- /dev/null +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata.php @@ -0,0 +1,98 @@ + */ + use SdkModel; + + /** + * Name of the custom metadata field to set. + */ + #[Required] + public string $field; + + /** + * Value to set for the custom metadata field. The value type should match the custom metadata field type. + * + * @var ValueVariants $value + */ + #[Required(union: Value::class)] + public string|float|bool|array $value; + + /** + * `new SetMetadata()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SetMetadata::with(field: ..., value: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SetMetadata)->withField(...)->withValue(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param ValueShape $value + */ + public static function with( + string $field, + string|float|bool|array $value + ): self { + $self = new self; + + $self['field'] = $field; + $self['value'] = $value; + + return $self; + } + + /** + * Name of the custom metadata field to set. + */ + public function withField(string $field): self + { + $self = clone $this; + $self['field'] = $field; + + return $self; + } + + /** + * Value to set for the custom metadata field. The value type should match the custom metadata field type. + * + * @param ValueShape $value + */ + public function withValue(string|float|bool|array $value): self + { + $self = clone $this; + $self['value'] = $value; + + return $self; + } +} diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value.php new file mode 100644 index 00000000..619ad140 --- /dev/null +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value.php @@ -0,0 +1,32 @@ + + * @phpstan-type ValueShape = ValueVariants|list + */ +final class Value implements ConverterSource +{ + use SdkUnion; + + /** + * @return list|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool', new ListOf(Mixed_::class)]; + } +} diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value/Mixed_.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value/Mixed_.php new file mode 100644 index 00000000..6df05fea --- /dev/null +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value/Mixed_.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool']; + } +} diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/UnsetMetadata.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/UnsetMetadata.php new file mode 100644 index 00000000..82f06e46 --- /dev/null +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/UnsetMetadata.php @@ -0,0 +1,68 @@ + */ + use SdkModel; + + /** + * Name of the custom metadata field to remove. + */ + #[Required] + public string $field; + + /** + * `new UnsetMetadata()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * UnsetMetadata::with(field: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new UnsetMetadata)->withField(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $field): self + { + $self = new self; + + $self['field'] = $field; + + return $self; + } + + /** + * Name of the custom metadata field to remove. + */ + public function withField(string $field): self + { + $self = clone $this; + $self['field'] = $field; + + return $self; + } +} diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes.php new file mode 100644 index 00000000..63a20a37 --- /dev/null +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes.php @@ -0,0 +1,145 @@ +|null, + * removeTags?: list|null, + * setMetadata?: list|null, + * unsetMetadata?: list|null, + * } + */ +final class OnYes implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Array of tag strings to add to the asset. + * + * @var list|null $addTags + */ + #[Optional('add_tags', list: 'string')] + public ?array $addTags; + + /** + * Array of tag strings to remove from the asset. + * + * @var list|null $removeTags + */ + #[Optional('remove_tags', list: 'string')] + public ?array $removeTags; + + /** + * Array of custom metadata field updates. + * + * @var list|null $setMetadata + */ + #[Optional('set_metadata', list: SetMetadata::class)] + public ?array $setMetadata; + + /** + * Array of custom metadata fields to remove. + * + * @var list|null $unsetMetadata + */ + #[Optional('unset_metadata', list: UnsetMetadata::class)] + public ?array $unsetMetadata; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list|null $addTags + * @param list|null $removeTags + * @param list|null $setMetadata + * @param list|null $unsetMetadata + */ + public static function with( + ?array $addTags = null, + ?array $removeTags = null, + ?array $setMetadata = null, + ?array $unsetMetadata = null, + ): self { + $self = new self; + + null !== $addTags && $self['addTags'] = $addTags; + null !== $removeTags && $self['removeTags'] = $removeTags; + null !== $setMetadata && $self['setMetadata'] = $setMetadata; + null !== $unsetMetadata && $self['unsetMetadata'] = $unsetMetadata; + + return $self; + } + + /** + * Array of tag strings to add to the asset. + * + * @param list $addTags + */ + public function withAddTags(array $addTags): self + { + $self = clone $this; + $self['addTags'] = $addTags; + + return $self; + } + + /** + * Array of tag strings to remove from the asset. + * + * @param list $removeTags + */ + public function withRemoveTags(array $removeTags): self + { + $self = clone $this; + $self['removeTags'] = $removeTags; + + return $self; + } + + /** + * Array of custom metadata field updates. + * + * @param list $setMetadata + */ + public function withSetMetadata(array $setMetadata): self + { + $self = clone $this; + $self['setMetadata'] = $setMetadata; + + return $self; + } + + /** + * Array of custom metadata fields to remove. + * + * @param list $unsetMetadata + */ + public function withUnsetMetadata(array $unsetMetadata): self + { + $self = clone $this; + $self['unsetMetadata'] = $unsetMetadata; + + return $self; + } +} diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata.php new file mode 100644 index 00000000..5cb7196b --- /dev/null +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata.php @@ -0,0 +1,98 @@ + */ + use SdkModel; + + /** + * Name of the custom metadata field to set. + */ + #[Required] + public string $field; + + /** + * Value to set for the custom metadata field. The value type should match the custom metadata field type. + * + * @var ValueVariants $value + */ + #[Required(union: Value::class)] + public string|float|bool|array $value; + + /** + * `new SetMetadata()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SetMetadata::with(field: ..., value: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SetMetadata)->withField(...)->withValue(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param ValueShape $value + */ + public static function with( + string $field, + string|float|bool|array $value + ): self { + $self = new self; + + $self['field'] = $field; + $self['value'] = $value; + + return $self; + } + + /** + * Name of the custom metadata field to set. + */ + public function withField(string $field): self + { + $self = clone $this; + $self['field'] = $field; + + return $self; + } + + /** + * Value to set for the custom metadata field. The value type should match the custom metadata field type. + * + * @param ValueShape $value + */ + public function withValue(string|float|bool|array $value): self + { + $self = clone $this; + $self['value'] = $value; + + return $self; + } +} diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value.php new file mode 100644 index 00000000..2b20098f --- /dev/null +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value.php @@ -0,0 +1,32 @@ + + * @phpstan-type ValueShape = ValueVariants|list + */ +final class Value implements ConverterSource +{ + use SdkUnion; + + /** + * @return list|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool', new ListOf(Mixed_::class)]; + } +} diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value/Mixed_.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value/Mixed_.php new file mode 100644 index 00000000..b462627f --- /dev/null +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value/Mixed_.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool']; + } +} diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/UnsetMetadata.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/UnsetMetadata.php new file mode 100644 index 00000000..09a6a90f --- /dev/null +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/UnsetMetadata.php @@ -0,0 +1,68 @@ + */ + use SdkModel; + + /** + * Name of the custom metadata field to remove. + */ + #[Required] + public string $field; + + /** + * `new UnsetMetadata()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * UnsetMetadata::with(field: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new UnsetMetadata)->withField(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $field): self + { + $self = new self; + + $self['field'] = $field; + + return $self; + } + + /** + * Name of the custom metadata field to remove. + */ + public function withField(string $field): self + { + $self = clone $this; + $self['field'] = $field; + + return $self; + } +} diff --git a/src/ExtensionConfig/AutoDescriptionExtension.php b/src/ExtensionConfig/AutoDescriptionExtension.php new file mode 100644 index 00000000..07177824 --- /dev/null +++ b/src/ExtensionConfig/AutoDescriptionExtension.php @@ -0,0 +1,41 @@ + */ + use SdkModel; + + /** + * Specifies the auto description extension. + * + * @var 'ai-auto-description' $name + */ + #[Required] + public string $name = 'ai-auto-description'; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(): self + { + return new self; + } +} diff --git a/src/ExtensionConfig/AutoTaggingExtension.php b/src/ExtensionConfig/AutoTaggingExtension.php new file mode 100644 index 00000000..93226423 --- /dev/null +++ b/src/ExtensionConfig/AutoTaggingExtension.php @@ -0,0 +1,119 @@ + + * } + */ +final class AutoTaggingExtension implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Maximum number of tags to attach to the asset. + */ + #[Required] + public int $maxTags; + + /** + * Minimum confidence level for tags to be considered valid. + */ + #[Required] + public int $minConfidence; + + /** + * Specifies the auto-tagging extension used. + * + * @var value-of $name + */ + #[Required(enum: Name::class)] + public string $name; + + /** + * `new AutoTaggingExtension()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AutoTaggingExtension::with(maxTags: ..., minConfidence: ..., name: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AutoTaggingExtension) + * ->withMaxTags(...) + * ->withMinConfidence(...) + * ->withName(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Name|value-of $name + */ + public static function with( + int $maxTags, + int $minConfidence, + Name|string $name + ): self { + $self = new self; + + $self['maxTags'] = $maxTags; + $self['minConfidence'] = $minConfidence; + $self['name'] = $name; + + return $self; + } + + /** + * Maximum number of tags to attach to the asset. + */ + public function withMaxTags(int $maxTags): self + { + $self = clone $this; + $self['maxTags'] = $maxTags; + + return $self; + } + + /** + * Minimum confidence level for tags to be considered valid. + */ + public function withMinConfidence(int $minConfidence): self + { + $self = clone $this; + $self['minConfidence'] = $minConfidence; + + return $self; + } + + /** + * Specifies the auto-tagging extension used. + * + * @param Name|value-of $name + */ + public function withName(Name|string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/ExtensionConfig/AutoTaggingExtension/Name.php b/src/ExtensionConfig/AutoTaggingExtension/Name.php new file mode 100644 index 00000000..688cb35f --- /dev/null +++ b/src/ExtensionConfig/AutoTaggingExtension/Name.php @@ -0,0 +1,15 @@ + */ + use SdkModel; + + /** + * Specifies the background removal extension. + * + * @var 'remove-bg' $name + */ + #[Required] + public string $name = 'remove-bg'; + + #[Optional] + public ?Options $options; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Options|OptionsShape|null $options + */ + public static function with(Options|array|null $options = null): self + { + $self = new self; + + null !== $options && $self['options'] = $options; + + return $self; + } + + /** + * @param Options|OptionsShape $options + */ + public function withOptions(Options|array $options): self + { + $self = clone $this; + $self['options'] = $options; + + return $self; + } +} diff --git a/src/ExtensionConfig/RemovedotBgExtension/Options.php b/src/ExtensionConfig/RemovedotBgExtension/Options.php new file mode 100644 index 00000000..b5a9e808 --- /dev/null +++ b/src/ExtensionConfig/RemovedotBgExtension/Options.php @@ -0,0 +1,117 @@ + */ + use SdkModel; + + /** + * Whether to add an artificial shadow to the result. Default is false. Note: Adding shadows is currently only supported for car photos. + */ + #[Optional('add_shadow')] + public ?bool $addShadow; + + /** + * Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or color name (e.g., "green"). If this parameter is set, `bg_image_url` must be empty. + */ + #[Optional('bg_color')] + public ?string $bgColor; + + /** + * Sets a background image from a URL. If this parameter is set, `bg_color` must be empty. + */ + #[Optional('bg_image_url')] + public ?string $bgImageURL; + + /** + * Allows semi-transparent regions in the result. Default is true. Note: Semitransparency is currently only supported for car windows. + */ + #[Optional] + public ?bool $semitransparency; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + ?bool $addShadow = null, + ?string $bgColor = null, + ?string $bgImageURL = null, + ?bool $semitransparency = null, + ): self { + $self = new self; + + null !== $addShadow && $self['addShadow'] = $addShadow; + null !== $bgColor && $self['bgColor'] = $bgColor; + null !== $bgImageURL && $self['bgImageURL'] = $bgImageURL; + null !== $semitransparency && $self['semitransparency'] = $semitransparency; + + return $self; + } + + /** + * Whether to add an artificial shadow to the result. Default is false. Note: Adding shadows is currently only supported for car photos. + */ + public function withAddShadow(bool $addShadow): self + { + $self = clone $this; + $self['addShadow'] = $addShadow; + + return $self; + } + + /** + * Specifies a solid color background using hex code (e.g., "81d4fa", "fff") or color name (e.g., "green"). If this parameter is set, `bg_image_url` must be empty. + */ + public function withBgColor(string $bgColor): self + { + $self = clone $this; + $self['bgColor'] = $bgColor; + + return $self; + } + + /** + * Sets a background image from a URL. If this parameter is set, `bg_color` must be empty. + */ + public function withBgImageURL(string $bgImageURL): self + { + $self = clone $this; + $self['bgImageURL'] = $bgImageURL; + + return $self; + } + + /** + * Allows semi-transparent regions in the result. Default is true. Note: Semitransparency is currently only supported for car windows. + */ + public function withSemitransparency(bool $semitransparency): self + { + $self = clone $this; + $self['semitransparency'] = $semitransparency; + + return $self; + } +} diff --git a/src/ExtensionItem.php b/src/ExtensionItem.php index 41a1b329..6c538fdb 100644 --- a/src/ExtensionItem.php +++ b/src/ExtensionItem.php @@ -7,17 +7,21 @@ use Imagekit\Core\Concerns\SdkUnion; use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; +use Imagekit\ExtensionItem\AITasksExtension; use Imagekit\ExtensionItem\AutoDescriptionExtension; use Imagekit\ExtensionItem\AutoTaggingExtension; use Imagekit\ExtensionItem\RemovedotBgExtension; +use Imagekit\ExtensionItem\SavedExtensionReference; /** * @phpstan-import-type RemovedotBgExtensionShape from \Imagekit\ExtensionItem\RemovedotBgExtension * @phpstan-import-type AutoTaggingExtensionShape from \Imagekit\ExtensionItem\AutoTaggingExtension * @phpstan-import-type AutoDescriptionExtensionShape from \Imagekit\ExtensionItem\AutoDescriptionExtension + * @phpstan-import-type AITasksExtensionShape from \Imagekit\ExtensionItem\AITasksExtension + * @phpstan-import-type SavedExtensionReferenceShape from \Imagekit\ExtensionItem\SavedExtensionReference * - * @phpstan-type ExtensionItemVariants = RemovedotBgExtension|AutoTaggingExtension|AutoDescriptionExtension - * @phpstan-type ExtensionItemShape = ExtensionItemVariants|RemovedotBgExtensionShape|AutoTaggingExtensionShape|AutoDescriptionExtensionShape + * @phpstan-type ExtensionItemVariants = RemovedotBgExtension|AutoTaggingExtension|AutoDescriptionExtension|AITasksExtension|SavedExtensionReference + * @phpstan-type ExtensionItemShape = ExtensionItemVariants|RemovedotBgExtensionShape|AutoTaggingExtensionShape|AutoDescriptionExtensionShape|AITasksExtensionShape|SavedExtensionReferenceShape */ final class ExtensionItem implements ConverterSource { @@ -37,6 +41,8 @@ public static function variants(): array AutoTaggingExtension::class, 'remove-bg' => RemovedotBgExtension::class, 'ai-auto-description' => AutoDescriptionExtension::class, + 'ai-tasks' => AITasksExtension::class, + 'saved-extension' => SavedExtensionReference::class, ]; } } diff --git a/src/ExtensionItem/AITasksExtension.php b/src/ExtensionItem/AITasksExtension.php new file mode 100644 index 00000000..92516c5e --- /dev/null +++ b/src/ExtensionItem/AITasksExtension.php @@ -0,0 +1,88 @@ + + * } + */ +final class AITasksExtension implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Specifies the AI tasks extension for automated image analysis using AI models. + * + * @var 'ai-tasks' $name + */ + #[Required] + public string $name = 'ai-tasks'; + + /** + * Array of task objects defining AI operations to perform on the asset. + * + * @var list $tasks + */ + #[Required(list: Task::class)] + public array $tasks; + + /** + * `new AITasksExtension()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AITasksExtension::with(tasks: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AITasksExtension)->withTasks(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $tasks + */ + public static function with(array $tasks): self + { + $self = new self; + + $self['tasks'] = $tasks; + + return $self; + } + + /** + * Array of task objects defining AI operations to perform on the asset. + * + * @param list $tasks + */ + public function withTasks(array $tasks): self + { + $self = clone $this; + $self['tasks'] = $tasks; + + return $self; + } +} diff --git a/src/ExtensionItem/AITasksExtension/Task.php b/src/ExtensionItem/AITasksExtension/Task.php new file mode 100644 index 00000000..8bc4b169 --- /dev/null +++ b/src/ExtensionItem/AITasksExtension/Task.php @@ -0,0 +1,42 @@ +|array + */ + public static function variants(): array + { + return [ + 'select_tags' => AITaskSelectTags::class, + 'select_metadata' => AITaskSelectMetadata::class, + 'yes_no' => AITaskYesNo::class, + ]; + } +} diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata.php b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata.php new file mode 100644 index 00000000..20bf5a69 --- /dev/null +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata.php @@ -0,0 +1,172 @@ +|null, + * } + */ +final class AITaskSelectMetadata implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Task type that analyzes the image and sets a custom metadata field value from a vocabulary. + * + * @var 'select_metadata' $type + */ + #[Required] + public string $type = 'select_metadata'; + + /** + * Name of the custom metadata field to set. The field must exist in your account. + */ + #[Required] + public string $field; + + /** + * The question or instruction for the AI to analyze the image. + */ + #[Required] + public string $instruction; + + /** + * Maximum number of values to select from the vocabulary. + */ + #[Optional('max_selections')] + public ?int $maxSelections; + + /** + * Minimum number of values to select from the vocabulary. + */ + #[Optional('min_selections')] + public ?int $minSelections; + + /** + * Array of possible values matching the custom metadata field type. + * + * @var list|null $vocabulary + */ + #[Optional(list: Vocabulary::class)] + public ?array $vocabulary; + + /** + * `new AITaskSelectMetadata()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AITaskSelectMetadata::with(field: ..., instruction: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AITaskSelectMetadata)->withField(...)->withInstruction(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list|null $vocabulary + */ + public static function with( + string $field, + string $instruction, + ?int $maxSelections = null, + ?int $minSelections = null, + ?array $vocabulary = null, + ): self { + $self = new self; + + $self['field'] = $field; + $self['instruction'] = $instruction; + + null !== $maxSelections && $self['maxSelections'] = $maxSelections; + null !== $minSelections && $self['minSelections'] = $minSelections; + null !== $vocabulary && $self['vocabulary'] = $vocabulary; + + return $self; + } + + /** + * Name of the custom metadata field to set. The field must exist in your account. + */ + public function withField(string $field): self + { + $self = clone $this; + $self['field'] = $field; + + return $self; + } + + /** + * The question or instruction for the AI to analyze the image. + */ + public function withInstruction(string $instruction): self + { + $self = clone $this; + $self['instruction'] = $instruction; + + return $self; + } + + /** + * Maximum number of values to select from the vocabulary. + */ + public function withMaxSelections(int $maxSelections): self + { + $self = clone $this; + $self['maxSelections'] = $maxSelections; + + return $self; + } + + /** + * Minimum number of values to select from the vocabulary. + */ + public function withMinSelections(int $minSelections): self + { + $self = clone $this; + $self['minSelections'] = $minSelections; + + return $self; + } + + /** + * Array of possible values matching the custom metadata field type. + * + * @param list $vocabulary + */ + public function withVocabulary(array $vocabulary): self + { + $self = clone $this; + $self['vocabulary'] = $vocabulary; + + return $self; + } +} diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata/Vocabulary.php b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata/Vocabulary.php new file mode 100644 index 00000000..74737a8a --- /dev/null +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata/Vocabulary.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool']; + } +} diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php new file mode 100644 index 00000000..2cc93ed1 --- /dev/null +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php @@ -0,0 +1,148 @@ +, + * maxSelections?: int|null, + * minSelections?: int|null, + * } + */ +final class AITaskSelectTags implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Task type that analyzes the image and adds matching tags from a vocabulary. + * + * @var 'select_tags' $type + */ + #[Required] + public string $type = 'select_tags'; + + /** + * The question or instruction for the AI to analyze the image. + */ + #[Required] + public string $instruction; + + /** + * Array of possible tag values. Combined length of all strings must not exceed 500 characters. Cannot contain the `%` character. + * + * @var list $vocabulary + */ + #[Required(list: 'string')] + public array $vocabulary; + + /** + * Maximum number of tags to select from the vocabulary. + */ + #[Optional('max_selections')] + public ?int $maxSelections; + + /** + * Minimum number of tags to select from the vocabulary. + */ + #[Optional('min_selections')] + public ?int $minSelections; + + /** + * `new AITaskSelectTags()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AITaskSelectTags::with(instruction: ..., vocabulary: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AITaskSelectTags)->withInstruction(...)->withVocabulary(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list $vocabulary + */ + public static function with( + string $instruction, + array $vocabulary, + ?int $maxSelections = null, + ?int $minSelections = null, + ): self { + $self = new self; + + $self['instruction'] = $instruction; + $self['vocabulary'] = $vocabulary; + + null !== $maxSelections && $self['maxSelections'] = $maxSelections; + null !== $minSelections && $self['minSelections'] = $minSelections; + + return $self; + } + + /** + * The question or instruction for the AI to analyze the image. + */ + public function withInstruction(string $instruction): self + { + $self = clone $this; + $self['instruction'] = $instruction; + + return $self; + } + + /** + * Array of possible tag values. Combined length of all strings must not exceed 500 characters. Cannot contain the `%` character. + * + * @param list $vocabulary + */ + public function withVocabulary(array $vocabulary): self + { + $self = clone $this; + $self['vocabulary'] = $vocabulary; + + return $self; + } + + /** + * Maximum number of tags to select from the vocabulary. + */ + public function withMaxSelections(int $maxSelections): self + { + $self = clone $this; + $self['maxSelections'] = $maxSelections; + + return $self; + } + + /** + * Minimum number of tags to select from the vocabulary. + */ + public function withMinSelections(int $minSelections): self + { + $self = clone $this; + $self['minSelections'] = $minSelections; + + return $self; + } +} diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo.php new file mode 100644 index 00000000..8f896e20 --- /dev/null +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo.php @@ -0,0 +1,159 @@ + */ + use SdkModel; + + /** + * Task type that asks a yes/no question and executes actions based on the answer. + * + * @var 'yes_no' $type + */ + #[Required] + public string $type = 'yes_no'; + + /** + * The yes/no question for the AI to answer about the image. + */ + #[Required] + public string $instruction; + + /** + * Actions to execute if the AI answers no. + */ + #[Optional('on_no')] + public ?OnNo $onNo; + + /** + * Actions to execute if the AI cannot determine the answer. + */ + #[Optional('on_unknown')] + public ?OnUnknown $onUnknown; + + /** + * Actions to execute if the AI answers yes. + */ + #[Optional('on_yes')] + public ?OnYes $onYes; + + /** + * `new AITaskYesNo()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * AITaskYesNo::with(instruction: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new AITaskYesNo)->withInstruction(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param OnNo|OnNoShape|null $onNo + * @param OnUnknown|OnUnknownShape|null $onUnknown + * @param OnYes|OnYesShape|null $onYes + */ + public static function with( + string $instruction, + OnNo|array|null $onNo = null, + OnUnknown|array|null $onUnknown = null, + OnYes|array|null $onYes = null, + ): self { + $self = new self; + + $self['instruction'] = $instruction; + + null !== $onNo && $self['onNo'] = $onNo; + null !== $onUnknown && $self['onUnknown'] = $onUnknown; + null !== $onYes && $self['onYes'] = $onYes; + + return $self; + } + + /** + * The yes/no question for the AI to answer about the image. + */ + public function withInstruction(string $instruction): self + { + $self = clone $this; + $self['instruction'] = $instruction; + + return $self; + } + + /** + * Actions to execute if the AI answers no. + * + * @param OnNo|OnNoShape $onNo + */ + public function withOnNo(OnNo|array $onNo): self + { + $self = clone $this; + $self['onNo'] = $onNo; + + return $self; + } + + /** + * Actions to execute if the AI cannot determine the answer. + * + * @param OnUnknown|OnUnknownShape $onUnknown + */ + public function withOnUnknown(OnUnknown|array $onUnknown): self + { + $self = clone $this; + $self['onUnknown'] = $onUnknown; + + return $self; + } + + /** + * Actions to execute if the AI answers yes. + * + * @param OnYes|OnYesShape $onYes + */ + public function withOnYes(OnYes|array $onYes): self + { + $self = clone $this; + $self['onYes'] = $onYes; + + return $self; + } +} diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo.php new file mode 100644 index 00000000..eab59743 --- /dev/null +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo.php @@ -0,0 +1,145 @@ +|null, + * removeTags?: list|null, + * setMetadata?: list|null, + * unsetMetadata?: list|null, + * } + */ +final class OnNo implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Array of tag strings to add to the asset. + * + * @var list|null $addTags + */ + #[Optional('add_tags', list: 'string')] + public ?array $addTags; + + /** + * Array of tag strings to remove from the asset. + * + * @var list|null $removeTags + */ + #[Optional('remove_tags', list: 'string')] + public ?array $removeTags; + + /** + * Array of custom metadata field updates. + * + * @var list|null $setMetadata + */ + #[Optional('set_metadata', list: SetMetadata::class)] + public ?array $setMetadata; + + /** + * Array of custom metadata fields to remove. + * + * @var list|null $unsetMetadata + */ + #[Optional('unset_metadata', list: UnsetMetadata::class)] + public ?array $unsetMetadata; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list|null $addTags + * @param list|null $removeTags + * @param list|null $setMetadata + * @param list|null $unsetMetadata + */ + public static function with( + ?array $addTags = null, + ?array $removeTags = null, + ?array $setMetadata = null, + ?array $unsetMetadata = null, + ): self { + $self = new self; + + null !== $addTags && $self['addTags'] = $addTags; + null !== $removeTags && $self['removeTags'] = $removeTags; + null !== $setMetadata && $self['setMetadata'] = $setMetadata; + null !== $unsetMetadata && $self['unsetMetadata'] = $unsetMetadata; + + return $self; + } + + /** + * Array of tag strings to add to the asset. + * + * @param list $addTags + */ + public function withAddTags(array $addTags): self + { + $self = clone $this; + $self['addTags'] = $addTags; + + return $self; + } + + /** + * Array of tag strings to remove from the asset. + * + * @param list $removeTags + */ + public function withRemoveTags(array $removeTags): self + { + $self = clone $this; + $self['removeTags'] = $removeTags; + + return $self; + } + + /** + * Array of custom metadata field updates. + * + * @param list $setMetadata + */ + public function withSetMetadata(array $setMetadata): self + { + $self = clone $this; + $self['setMetadata'] = $setMetadata; + + return $self; + } + + /** + * Array of custom metadata fields to remove. + * + * @param list $unsetMetadata + */ + public function withUnsetMetadata(array $unsetMetadata): self + { + $self = clone $this; + $self['unsetMetadata'] = $unsetMetadata; + + return $self; + } +} diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata.php new file mode 100644 index 00000000..d95c47fc --- /dev/null +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata.php @@ -0,0 +1,98 @@ + */ + use SdkModel; + + /** + * Name of the custom metadata field to set. + */ + #[Required] + public string $field; + + /** + * Value to set for the custom metadata field. The value type should match the custom metadata field type. + * + * @var ValueVariants $value + */ + #[Required(union: Value::class)] + public string|float|bool|array $value; + + /** + * `new SetMetadata()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SetMetadata::with(field: ..., value: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SetMetadata)->withField(...)->withValue(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param ValueShape $value + */ + public static function with( + string $field, + string|float|bool|array $value + ): self { + $self = new self; + + $self['field'] = $field; + $self['value'] = $value; + + return $self; + } + + /** + * Name of the custom metadata field to set. + */ + public function withField(string $field): self + { + $self = clone $this; + $self['field'] = $field; + + return $self; + } + + /** + * Value to set for the custom metadata field. The value type should match the custom metadata field type. + * + * @param ValueShape $value + */ + public function withValue(string|float|bool|array $value): self + { + $self = clone $this; + $self['value'] = $value; + + return $self; + } +} diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value.php new file mode 100644 index 00000000..6c6adb76 --- /dev/null +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value.php @@ -0,0 +1,32 @@ + + * @phpstan-type ValueShape = ValueVariants|list + */ +final class Value implements ConverterSource +{ + use SdkUnion; + + /** + * @return list|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool', new ListOf(Mixed_::class)]; + } +} diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value/Mixed_.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value/Mixed_.php new file mode 100644 index 00000000..5620cc2b --- /dev/null +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value/Mixed_.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool']; + } +} diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/UnsetMetadata.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/UnsetMetadata.php new file mode 100644 index 00000000..91198047 --- /dev/null +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/UnsetMetadata.php @@ -0,0 +1,68 @@ + */ + use SdkModel; + + /** + * Name of the custom metadata field to remove. + */ + #[Required] + public string $field; + + /** + * `new UnsetMetadata()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * UnsetMetadata::with(field: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new UnsetMetadata)->withField(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $field): self + { + $self = new self; + + $self['field'] = $field; + + return $self; + } + + /** + * Name of the custom metadata field to remove. + */ + public function withField(string $field): self + { + $self = clone $this; + $self['field'] = $field; + + return $self; + } +} diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown.php new file mode 100644 index 00000000..82a274a6 --- /dev/null +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown.php @@ -0,0 +1,145 @@ +|null, + * removeTags?: list|null, + * setMetadata?: list|null, + * unsetMetadata?: list|null, + * } + */ +final class OnUnknown implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Array of tag strings to add to the asset. + * + * @var list|null $addTags + */ + #[Optional('add_tags', list: 'string')] + public ?array $addTags; + + /** + * Array of tag strings to remove from the asset. + * + * @var list|null $removeTags + */ + #[Optional('remove_tags', list: 'string')] + public ?array $removeTags; + + /** + * Array of custom metadata field updates. + * + * @var list|null $setMetadata + */ + #[Optional('set_metadata', list: SetMetadata::class)] + public ?array $setMetadata; + + /** + * Array of custom metadata fields to remove. + * + * @var list|null $unsetMetadata + */ + #[Optional('unset_metadata', list: UnsetMetadata::class)] + public ?array $unsetMetadata; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list|null $addTags + * @param list|null $removeTags + * @param list|null $setMetadata + * @param list|null $unsetMetadata + */ + public static function with( + ?array $addTags = null, + ?array $removeTags = null, + ?array $setMetadata = null, + ?array $unsetMetadata = null, + ): self { + $self = new self; + + null !== $addTags && $self['addTags'] = $addTags; + null !== $removeTags && $self['removeTags'] = $removeTags; + null !== $setMetadata && $self['setMetadata'] = $setMetadata; + null !== $unsetMetadata && $self['unsetMetadata'] = $unsetMetadata; + + return $self; + } + + /** + * Array of tag strings to add to the asset. + * + * @param list $addTags + */ + public function withAddTags(array $addTags): self + { + $self = clone $this; + $self['addTags'] = $addTags; + + return $self; + } + + /** + * Array of tag strings to remove from the asset. + * + * @param list $removeTags + */ + public function withRemoveTags(array $removeTags): self + { + $self = clone $this; + $self['removeTags'] = $removeTags; + + return $self; + } + + /** + * Array of custom metadata field updates. + * + * @param list $setMetadata + */ + public function withSetMetadata(array $setMetadata): self + { + $self = clone $this; + $self['setMetadata'] = $setMetadata; + + return $self; + } + + /** + * Array of custom metadata fields to remove. + * + * @param list $unsetMetadata + */ + public function withUnsetMetadata(array $unsetMetadata): self + { + $self = clone $this; + $self['unsetMetadata'] = $unsetMetadata; + + return $self; + } +} diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata.php new file mode 100644 index 00000000..da15abd5 --- /dev/null +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata.php @@ -0,0 +1,98 @@ + */ + use SdkModel; + + /** + * Name of the custom metadata field to set. + */ + #[Required] + public string $field; + + /** + * Value to set for the custom metadata field. The value type should match the custom metadata field type. + * + * @var ValueVariants $value + */ + #[Required(union: Value::class)] + public string|float|bool|array $value; + + /** + * `new SetMetadata()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SetMetadata::with(field: ..., value: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SetMetadata)->withField(...)->withValue(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param ValueShape $value + */ + public static function with( + string $field, + string|float|bool|array $value + ): self { + $self = new self; + + $self['field'] = $field; + $self['value'] = $value; + + return $self; + } + + /** + * Name of the custom metadata field to set. + */ + public function withField(string $field): self + { + $self = clone $this; + $self['field'] = $field; + + return $self; + } + + /** + * Value to set for the custom metadata field. The value type should match the custom metadata field type. + * + * @param ValueShape $value + */ + public function withValue(string|float|bool|array $value): self + { + $self = clone $this; + $self['value'] = $value; + + return $self; + } +} diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value.php new file mode 100644 index 00000000..59d525b3 --- /dev/null +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value.php @@ -0,0 +1,32 @@ + + * @phpstan-type ValueShape = ValueVariants|list + */ +final class Value implements ConverterSource +{ + use SdkUnion; + + /** + * @return list|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool', new ListOf(Mixed_::class)]; + } +} diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value/Mixed_.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value/Mixed_.php new file mode 100644 index 00000000..4e5457c1 --- /dev/null +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value/Mixed_.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool']; + } +} diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/UnsetMetadata.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/UnsetMetadata.php new file mode 100644 index 00000000..3fe870d9 --- /dev/null +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/UnsetMetadata.php @@ -0,0 +1,68 @@ + */ + use SdkModel; + + /** + * Name of the custom metadata field to remove. + */ + #[Required] + public string $field; + + /** + * `new UnsetMetadata()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * UnsetMetadata::with(field: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new UnsetMetadata)->withField(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $field): self + { + $self = new self; + + $self['field'] = $field; + + return $self; + } + + /** + * Name of the custom metadata field to remove. + */ + public function withField(string $field): self + { + $self = clone $this; + $self['field'] = $field; + + return $self; + } +} diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes.php new file mode 100644 index 00000000..e2f9c6c5 --- /dev/null +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes.php @@ -0,0 +1,145 @@ +|null, + * removeTags?: list|null, + * setMetadata?: list|null, + * unsetMetadata?: list|null, + * } + */ +final class OnYes implements BaseModel +{ + /** @use SdkModel */ + use SdkModel; + + /** + * Array of tag strings to add to the asset. + * + * @var list|null $addTags + */ + #[Optional('add_tags', list: 'string')] + public ?array $addTags; + + /** + * Array of tag strings to remove from the asset. + * + * @var list|null $removeTags + */ + #[Optional('remove_tags', list: 'string')] + public ?array $removeTags; + + /** + * Array of custom metadata field updates. + * + * @var list|null $setMetadata + */ + #[Optional('set_metadata', list: SetMetadata::class)] + public ?array $setMetadata; + + /** + * Array of custom metadata fields to remove. + * + * @var list|null $unsetMetadata + */ + #[Optional('unset_metadata', list: UnsetMetadata::class)] + public ?array $unsetMetadata; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param list|null $addTags + * @param list|null $removeTags + * @param list|null $setMetadata + * @param list|null $unsetMetadata + */ + public static function with( + ?array $addTags = null, + ?array $removeTags = null, + ?array $setMetadata = null, + ?array $unsetMetadata = null, + ): self { + $self = new self; + + null !== $addTags && $self['addTags'] = $addTags; + null !== $removeTags && $self['removeTags'] = $removeTags; + null !== $setMetadata && $self['setMetadata'] = $setMetadata; + null !== $unsetMetadata && $self['unsetMetadata'] = $unsetMetadata; + + return $self; + } + + /** + * Array of tag strings to add to the asset. + * + * @param list $addTags + */ + public function withAddTags(array $addTags): self + { + $self = clone $this; + $self['addTags'] = $addTags; + + return $self; + } + + /** + * Array of tag strings to remove from the asset. + * + * @param list $removeTags + */ + public function withRemoveTags(array $removeTags): self + { + $self = clone $this; + $self['removeTags'] = $removeTags; + + return $self; + } + + /** + * Array of custom metadata field updates. + * + * @param list $setMetadata + */ + public function withSetMetadata(array $setMetadata): self + { + $self = clone $this; + $self['setMetadata'] = $setMetadata; + + return $self; + } + + /** + * Array of custom metadata fields to remove. + * + * @param list $unsetMetadata + */ + public function withUnsetMetadata(array $unsetMetadata): self + { + $self = clone $this; + $self['unsetMetadata'] = $unsetMetadata; + + return $self; + } +} diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata.php new file mode 100644 index 00000000..80171d37 --- /dev/null +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata.php @@ -0,0 +1,98 @@ + */ + use SdkModel; + + /** + * Name of the custom metadata field to set. + */ + #[Required] + public string $field; + + /** + * Value to set for the custom metadata field. The value type should match the custom metadata field type. + * + * @var ValueVariants $value + */ + #[Required(union: Value::class)] + public string|float|bool|array $value; + + /** + * `new SetMetadata()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SetMetadata::with(field: ..., value: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SetMetadata)->withField(...)->withValue(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param ValueShape $value + */ + public static function with( + string $field, + string|float|bool|array $value + ): self { + $self = new self; + + $self['field'] = $field; + $self['value'] = $value; + + return $self; + } + + /** + * Name of the custom metadata field to set. + */ + public function withField(string $field): self + { + $self = clone $this; + $self['field'] = $field; + + return $self; + } + + /** + * Value to set for the custom metadata field. The value type should match the custom metadata field type. + * + * @param ValueShape $value + */ + public function withValue(string|float|bool|array $value): self + { + $self = clone $this; + $self['value'] = $value; + + return $self; + } +} diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value.php new file mode 100644 index 00000000..808ac5cd --- /dev/null +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value.php @@ -0,0 +1,32 @@ + + * @phpstan-type ValueShape = ValueVariants|list + */ +final class Value implements ConverterSource +{ + use SdkUnion; + + /** + * @return list|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool', new ListOf(Mixed_::class)]; + } +} diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value/Mixed_.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value/Mixed_.php new file mode 100644 index 00000000..42dd6a8a --- /dev/null +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value/Mixed_.php @@ -0,0 +1,26 @@ +|array + */ + public static function variants(): array + { + return ['string', 'float', 'bool']; + } +} diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/UnsetMetadata.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/UnsetMetadata.php new file mode 100644 index 00000000..c1f5e1de --- /dev/null +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/UnsetMetadata.php @@ -0,0 +1,68 @@ + */ + use SdkModel; + + /** + * Name of the custom metadata field to remove. + */ + #[Required] + public string $field; + + /** + * `new UnsetMetadata()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * UnsetMetadata::with(field: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new UnsetMetadata)->withField(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $field): self + { + $self = new self; + + $self['field'] = $field; + + return $self; + } + + /** + * Name of the custom metadata field to remove. + */ + public function withField(string $field): self + { + $self = clone $this; + $self['field'] = $field; + + return $self; + } +} diff --git a/src/ExtensionItem/SavedExtensionReference.php b/src/ExtensionItem/SavedExtensionReference.php new file mode 100644 index 00000000..77de5995 --- /dev/null +++ b/src/ExtensionItem/SavedExtensionReference.php @@ -0,0 +1,78 @@ + */ + use SdkModel; + + /** + * Indicates this is a reference to a saved extension. + * + * @var 'saved-extension' $name + */ + #[Required] + public string $name = 'saved-extension'; + + /** + * The unique ID of the saved extension to apply. + */ + #[Required] + public string $id; + + /** + * `new SavedExtensionReference()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SavedExtensionReference::with(id: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SavedExtensionReference)->withID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $id): self + { + $self = new self; + + $self['id'] = $id; + + return $self; + } + + /** + * The unique ID of the saved extension to apply. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } +} diff --git a/src/ImageOverlay.php b/src/ImageOverlay.php index 8fb0f134..7e769dbc 100644 --- a/src/ImageOverlay.php +++ b/src/ImageOverlay.php @@ -4,6 +4,7 @@ namespace Imagekit; +use Imagekit\BaseOverlay\LayerMode; use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; @@ -15,6 +16,7 @@ * @phpstan-import-type OverlayTimingShape from \Imagekit\OverlayTiming * * @phpstan-type ImageOverlayShape = array{ + * layerMode?: null|LayerMode|value-of, * position?: null|OverlayPosition|OverlayPositionShape, * timing?: null|OverlayTiming|OverlayTimingShape, * input: string, @@ -32,6 +34,20 @@ final class ImageOverlay implements BaseModel #[Required] public string $type = 'image'; + /** + * Controls how the layer blends with the base image or underlying content. Maps to `lm` in the URL. + * By default, layers completely cover the base image beneath them. Layer modes change this behavior: + * - `multiply`: Multiplies the pixel values of the layer with the base image. The result is always darker than the original images. This is ideal for applying shadows or color tints. + * - `displace`: Uses the layer as a displacement map to distort pixels in the base image. The red channel controls horizontal displacement, and the green channel controls vertical displacement. Requires `x` or `y` parameter to control displacement magnitude. + * - `cutout`: Acts as an inverse mask where opaque areas of the layer turn the base image transparent, while transparent areas leave the base image unchanged. This mode functions like a hole-punch, effectively cutting the shape of the layer out of the underlying image. + * - `cutter`: Acts as a shape mask where only the parts of the base image that fall inside the opaque area of the layer are preserved. This mode functions like a cookie-cutter, trimming the base image to match the specific dimensions and shape of the layer. + * See [Layer modes](https://imagekit.io/docs/add-overlays-on-images#layer-modes). + * + * @var value-of|null $layerMode + */ + #[Optional(enum: LayerMode::class)] + public ?string $layerMode; + #[Optional] public ?OverlayPosition $position; @@ -50,6 +66,10 @@ final class ImageOverlay implements BaseModel * To always use base64 encoding (`ie-{base64}`), set this parameter to `base64`. * To always use plain text (`i-{input}`), set it to `plain`. * + * Regardless of the encoding method: + * - Leading and trailing slashes are removed. + * - Remaining slashes within the path are replaced with `@@` when using plain text. + * * @var value-of|null $encoding */ #[Optional(enum: Encoding::class)] @@ -88,6 +108,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * + * @param LayerMode|value-of|null $layerMode * @param OverlayPosition|OverlayPositionShape|null $position * @param OverlayTiming|OverlayTimingShape|null $timing * @param Encoding|value-of|null $encoding @@ -95,6 +116,7 @@ public function __construct() */ public static function with( string $input, + LayerMode|string|null $layerMode = null, OverlayPosition|array|null $position = null, OverlayTiming|array|null $timing = null, Encoding|string|null $encoding = null, @@ -104,6 +126,7 @@ public static function with( $self['input'] = $input; + null !== $layerMode && $self['layerMode'] = $layerMode; null !== $position && $self['position'] = $position; null !== $timing && $self['timing'] = $timing; null !== $encoding && $self['encoding'] = $encoding; @@ -112,6 +135,25 @@ public static function with( return $self; } + /** + * Controls how the layer blends with the base image or underlying content. Maps to `lm` in the URL. + * By default, layers completely cover the base image beneath them. Layer modes change this behavior: + * - `multiply`: Multiplies the pixel values of the layer with the base image. The result is always darker than the original images. This is ideal for applying shadows or color tints. + * - `displace`: Uses the layer as a displacement map to distort pixels in the base image. The red channel controls horizontal displacement, and the green channel controls vertical displacement. Requires `x` or `y` parameter to control displacement magnitude. + * - `cutout`: Acts as an inverse mask where opaque areas of the layer turn the base image transparent, while transparent areas leave the base image unchanged. This mode functions like a hole-punch, effectively cutting the shape of the layer out of the underlying image. + * - `cutter`: Acts as a shape mask where only the parts of the base image that fall inside the opaque area of the layer are preserved. This mode functions like a cookie-cutter, trimming the base image to match the specific dimensions and shape of the layer. + * See [Layer modes](https://imagekit.io/docs/add-overlays-on-images#layer-modes). + * + * @param LayerMode|value-of $layerMode + */ + public function withLayerMode(LayerMode|string $layerMode): self + { + $self = clone $this; + $self['layerMode'] = $layerMode; + + return $self; + } + /** * @param OverlayPosition|OverlayPositionShape $position */ @@ -151,6 +193,10 @@ public function withInput(string $input): self * To always use base64 encoding (`ie-{base64}`), set this parameter to `base64`. * To always use plain text (`i-{input}`), set it to `plain`. * + * Regardless of the encoding method: + * - Leading and trailing slashes are removed. + * - Remaining slashes within the path are replaced with `@@` when using plain text. + * * @param Encoding|value-of $encoding */ public function withEncoding(Encoding|string $encoding): self diff --git a/src/ImageOverlay/Encoding.php b/src/ImageOverlay/Encoding.php index c3c9e781..9a3ef436 100644 --- a/src/ImageOverlay/Encoding.php +++ b/src/ImageOverlay/Encoding.php @@ -9,6 +9,10 @@ * By default, the SDK determines the appropriate format automatically. * To always use base64 encoding (`ie-{base64}`), set this parameter to `base64`. * To always use plain text (`i-{input}`), set it to `plain`. + * + * Regardless of the encoding method: + * - Leading and trailing slashes are removed. + * - Remaining slashes within the path are replaced with `@@` when using plain text. */ enum Encoding: string { diff --git a/src/SavedExtension.php b/src/SavedExtension.php new file mode 100644 index 00000000..18561209 --- /dev/null +++ b/src/SavedExtension.php @@ -0,0 +1,173 @@ + */ + use SdkModel; + + /** + * Unique identifier of the saved extension. + */ + #[Optional] + public ?string $id; + + /** + * Configuration object for an extension (base extensions only, not saved extension references). + * + * @var ExtensionConfigVariants|null $config + */ + #[Optional(union: ExtensionConfig::class)] + public RemovedotBgExtension|AutoTaggingExtension|AutoDescriptionExtension|AITasksExtension|null $config; + + /** + * Timestamp when the saved extension was created. + */ + #[Optional] + public ?\DateTimeInterface $createdAt; + + /** + * Description of the saved extension. + */ + #[Optional] + public ?string $description; + + /** + * Name of the saved extension. + */ + #[Optional] + public ?string $name; + + /** + * Timestamp when the saved extension was last updated. + */ + #[Optional] + public ?\DateTimeInterface $updatedAt; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param ExtensionConfigShape|null $config + */ + public static function with( + ?string $id = null, + RemovedotBgExtension|array|AutoTaggingExtension|AutoDescriptionExtension|AITasksExtension|null $config = null, + ?\DateTimeInterface $createdAt = null, + ?string $description = null, + ?string $name = null, + ?\DateTimeInterface $updatedAt = null, + ): self { + $self = new self; + + null !== $id && $self['id'] = $id; + null !== $config && $self['config'] = $config; + null !== $createdAt && $self['createdAt'] = $createdAt; + null !== $description && $self['description'] = $description; + null !== $name && $self['name'] = $name; + null !== $updatedAt && $self['updatedAt'] = $updatedAt; + + return $self; + } + + /** + * Unique identifier of the saved extension. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * Configuration object for an extension (base extensions only, not saved extension references). + * + * @param ExtensionConfigShape $config + */ + public function withConfig( + RemovedotBgExtension|array|AutoTaggingExtension|AutoDescriptionExtension|AITasksExtension $config, + ): self { + $self = clone $this; + $self['config'] = $config; + + return $self; + } + + /** + * Timestamp when the saved extension was created. + */ + public function withCreatedAt(\DateTimeInterface $createdAt): self + { + $self = clone $this; + $self['createdAt'] = $createdAt; + + return $self; + } + + /** + * Description of the saved extension. + */ + public function withDescription(string $description): self + { + $self = clone $this; + $self['description'] = $description; + + return $self; + } + + /** + * Name of the saved extension. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } + + /** + * Timestamp when the saved extension was last updated. + */ + public function withUpdatedAt(\DateTimeInterface $updatedAt): self + { + $self = clone $this; + $self['updatedAt'] = $updatedAt; + + return $self; + } +} diff --git a/src/SavedExtensions/SavedExtensionCreateParams.php b/src/SavedExtensions/SavedExtensionCreateParams.php new file mode 100644 index 00000000..24194204 --- /dev/null +++ b/src/SavedExtensions/SavedExtensionCreateParams.php @@ -0,0 +1,136 @@ + */ + use SdkModel; + use SdkParams; + + /** + * Configuration object for an extension (base extensions only, not saved extension references). + * + * @var ExtensionConfigVariants $config + */ + #[Required(union: ExtensionConfig::class)] + public RemovedotBgExtension|AutoTaggingExtension|AutoDescriptionExtension|AITasksExtension $config; + + /** + * Description of what the saved extension does. + */ + #[Required] + public string $description; + + /** + * Name of the saved extension. + */ + #[Required] + public string $name; + + /** + * `new SavedExtensionCreateParams()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * SavedExtensionCreateParams::with(config: ..., description: ..., name: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new SavedExtensionCreateParams) + * ->withConfig(...) + * ->withDescription(...) + * ->withName(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param ExtensionConfigShape $config + */ + public static function with( + RemovedotBgExtension|array|AutoTaggingExtension|AutoDescriptionExtension|AITasksExtension $config, + string $description, + string $name, + ): self { + $self = new self; + + $self['config'] = $config; + $self['description'] = $description; + $self['name'] = $name; + + return $self; + } + + /** + * Configuration object for an extension (base extensions only, not saved extension references). + * + * @param ExtensionConfigShape $config + */ + public function withConfig( + RemovedotBgExtension|array|AutoTaggingExtension|AutoDescriptionExtension|AITasksExtension $config, + ): self { + $self = clone $this; + $self['config'] = $config; + + return $self; + } + + /** + * Description of what the saved extension does. + */ + public function withDescription(string $description): self + { + $self = clone $this; + $self['description'] = $description; + + return $self; + } + + /** + * Name of the saved extension. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/SavedExtensions/SavedExtensionUpdateParams.php b/src/SavedExtensions/SavedExtensionUpdateParams.php new file mode 100644 index 00000000..c1a0e6bb --- /dev/null +++ b/src/SavedExtensions/SavedExtensionUpdateParams.php @@ -0,0 +1,118 @@ + */ + use SdkModel; + use SdkParams; + + /** + * Configuration object for an extension (base extensions only, not saved extension references). + * + * @var ExtensionConfigVariants|null $config + */ + #[Optional(union: ExtensionConfig::class)] + public RemovedotBgExtension|AutoTaggingExtension|AutoDescriptionExtension|AITasksExtension|null $config; + + /** + * Updated description of the saved extension. + */ + #[Optional] + public ?string $description; + + /** + * Updated name of the saved extension. + */ + #[Optional] + public ?string $name; + + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param ExtensionConfigShape|null $config + */ + public static function with( + RemovedotBgExtension|array|AutoTaggingExtension|AutoDescriptionExtension|AITasksExtension|null $config = null, + ?string $description = null, + ?string $name = null, + ): self { + $self = new self; + + null !== $config && $self['config'] = $config; + null !== $description && $self['description'] = $description; + null !== $name && $self['name'] = $name; + + return $self; + } + + /** + * Configuration object for an extension (base extensions only, not saved extension references). + * + * @param ExtensionConfigShape $config + */ + public function withConfig( + RemovedotBgExtension|array|AutoTaggingExtension|AutoDescriptionExtension|AITasksExtension $config, + ): self { + $self = clone $this; + $self['config'] = $config; + + return $self; + } + + /** + * Updated description of the saved extension. + */ + public function withDescription(string $description): self + { + $self = clone $this; + $self['description'] = $description; + + return $self; + } + + /** + * Updated name of the saved extension. + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } +} diff --git a/src/ServiceContracts/SavedExtensionsContract.php b/src/ServiceContracts/SavedExtensionsContract.php new file mode 100644 index 00000000..7aedcd36 --- /dev/null +++ b/src/ServiceContracts/SavedExtensionsContract.php @@ -0,0 +1,95 @@ + + * + * @throws APIException + */ + public function list( + RequestOptions|array|null $requestOptions = null + ): array; + + /** + * @api + * + * @param string $id the unique ID of the saved extension + * @param RequestOpts|null $requestOptions + * + * @throws APIException + */ + public function delete( + string $id, + RequestOptions|array|null $requestOptions = null + ): mixed; + + /** + * @api + * + * @param string $id the unique ID of the saved extension + * @param RequestOpts|null $requestOptions + * + * @throws APIException + */ + public function get( + string $id, + RequestOptions|array|null $requestOptions = null + ): SavedExtension; +} diff --git a/src/ServiceContracts/SavedExtensionsRawContract.php b/src/ServiceContracts/SavedExtensionsRawContract.php new file mode 100644 index 00000000..ccdb8a05 --- /dev/null +++ b/src/ServiceContracts/SavedExtensionsRawContract.php @@ -0,0 +1,93 @@ +|SavedExtensionCreateParams $params + * @param RequestOpts|null $requestOptions + * + * @return BaseResponse + * + * @throws APIException + */ + public function create( + array|SavedExtensionCreateParams $params, + RequestOptions|array|null $requestOptions = null, + ): BaseResponse; + + /** + * @api + * + * @param string $id the unique ID of the saved extension + * @param array|SavedExtensionUpdateParams $params + * @param RequestOpts|null $requestOptions + * + * @return BaseResponse + * + * @throws APIException + */ + public function update( + string $id, + array|SavedExtensionUpdateParams $params, + RequestOptions|array|null $requestOptions = null, + ): BaseResponse; + + /** + * @api + * + * @param RequestOpts|null $requestOptions + * + * @return BaseResponse> + * + * @throws APIException + */ + public function list( + RequestOptions|array|null $requestOptions = null + ): BaseResponse; + + /** + * @api + * + * @param string $id the unique ID of the saved extension + * @param RequestOpts|null $requestOptions + * + * @return BaseResponse + * + * @throws APIException + */ + public function delete( + string $id, + RequestOptions|array|null $requestOptions = null + ): BaseResponse; + + /** + * @api + * + * @param string $id the unique ID of the saved extension + * @param RequestOpts|null $requestOptions + * + * @return BaseResponse + * + * @throws APIException + */ + public function get( + string $id, + RequestOptions|array|null $requestOptions = null + ): BaseResponse; +} diff --git a/src/Services/Files/MetadataRawService.php b/src/Services/Files/MetadataRawService.php index 400544f4..9defe1ad 100644 --- a/src/Services/Files/MetadataRawService.php +++ b/src/Services/Files/MetadataRawService.php @@ -74,7 +74,7 @@ public function getFromURL( // @phpstan-ignore-next-line return.type return $this->client->request( method: 'get', - path: 'v1/files/metadata', + path: 'v1/metadata', query: $parsed, options: $options, convert: Metadata::class, diff --git a/src/Services/SavedExtensionsRawService.php b/src/Services/SavedExtensionsRawService.php new file mode 100644 index 00000000..f641d0f6 --- /dev/null +++ b/src/Services/SavedExtensionsRawService.php @@ -0,0 +1,172 @@ + + * + * @throws APIException + */ + public function create( + array|SavedExtensionCreateParams $params, + RequestOptions|array|null $requestOptions = null, + ): BaseResponse { + [$parsed, $options] = SavedExtensionCreateParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'post', + path: 'v1/saved-extensions', + body: (object) $parsed, + options: $options, + convert: SavedExtension::class, + ); + } + + /** + * @api + * + * This API updates an existing saved extension. You can update the name, description, or config. + * + * @param string $id the unique ID of the saved extension + * @param array{ + * config?: ExtensionConfigShape, description?: string, name?: string + * }|SavedExtensionUpdateParams $params + * @param RequestOpts|null $requestOptions + * + * @return BaseResponse + * + * @throws APIException + */ + public function update( + string $id, + array|SavedExtensionUpdateParams $params, + RequestOptions|array|null $requestOptions = null, + ): BaseResponse { + [$parsed, $options] = SavedExtensionUpdateParams::parseRequest( + $params, + $requestOptions, + ); + + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'patch', + path: ['v1/saved-extensions/%1$s', $id], + body: (object) $parsed, + options: $options, + convert: SavedExtension::class, + ); + } + + /** + * @api + * + * This API returns an array of all saved extensions for your account. Saved extensions allow you to save complex extension configurations and reuse them by referencing them by ID in upload or update file APIs. + * + * @param RequestOpts|null $requestOptions + * + * @return BaseResponse> + * + * @throws APIException + */ + public function list( + RequestOptions|array|null $requestOptions = null + ): BaseResponse { + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'get', + path: 'v1/saved-extensions', + options: $requestOptions, + convert: new ListOf(SavedExtension::class), + ); + } + + /** + * @api + * + * This API deletes a saved extension permanently. + * + * @param string $id the unique ID of the saved extension + * @param RequestOpts|null $requestOptions + * + * @return BaseResponse + * + * @throws APIException + */ + public function delete( + string $id, + RequestOptions|array|null $requestOptions = null + ): BaseResponse { + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'delete', + path: ['v1/saved-extensions/%1$s', $id], + options: $requestOptions, + convert: null, + ); + } + + /** + * @api + * + * This API returns details of a specific saved extension by ID. + * + * @param string $id the unique ID of the saved extension + * @param RequestOpts|null $requestOptions + * + * @return BaseResponse + * + * @throws APIException + */ + public function get( + string $id, + RequestOptions|array|null $requestOptions = null + ): BaseResponse { + // @phpstan-ignore-next-line return.type + return $this->client->request( + method: 'get', + path: ['v1/saved-extensions/%1$s', $id], + options: $requestOptions, + convert: SavedExtension::class, + ); + } +} diff --git a/src/Services/SavedExtensionsService.php b/src/Services/SavedExtensionsService.php new file mode 100644 index 00000000..0be0dfa8 --- /dev/null +++ b/src/Services/SavedExtensionsService.php @@ -0,0 +1,157 @@ +raw = new SavedExtensionsRawService($client); + } + + /** + * @api + * + * This API creates a new saved extension. Saved extensions allow you to save complex extension configurations (like AI tasks) and reuse them by referencing the ID in upload or update file APIs. + * + * **Saved extension limit** \ + * You can create a maximum of 100 saved extensions per account. + * + * @param ExtensionConfigShape $config configuration object for an extension (base extensions only, not saved extension references) + * @param string $description description of what the saved extension does + * @param string $name name of the saved extension + * @param RequestOpts|null $requestOptions + * + * @throws APIException + */ + public function create( + RemovedotBgExtension|array|AutoTaggingExtension|AutoDescriptionExtension|AITasksExtension $config, + string $description, + string $name, + RequestOptions|array|null $requestOptions = null, + ): SavedExtension { + $params = Util::removeNulls( + ['config' => $config, 'description' => $description, 'name' => $name] + ); + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->create(params: $params, requestOptions: $requestOptions); + + return $response->parse(); + } + + /** + * @api + * + * This API updates an existing saved extension. You can update the name, description, or config. + * + * @param string $id the unique ID of the saved extension + * @param ExtensionConfigShape $config configuration object for an extension (base extensions only, not saved extension references) + * @param string $description updated description of the saved extension + * @param string $name updated name of the saved extension + * @param RequestOpts|null $requestOptions + * + * @throws APIException + */ + public function update( + string $id, + RemovedotBgExtension|array|AutoTaggingExtension|AutoDescriptionExtension|AITasksExtension|null $config = null, + ?string $description = null, + ?string $name = null, + RequestOptions|array|null $requestOptions = null, + ): SavedExtension { + $params = Util::removeNulls( + ['config' => $config, 'description' => $description, 'name' => $name] + ); + + // @phpstan-ignore-next-line argument.type + $response = $this->raw->update($id, params: $params, requestOptions: $requestOptions); + + return $response->parse(); + } + + /** + * @api + * + * This API returns an array of all saved extensions for your account. Saved extensions allow you to save complex extension configurations and reuse them by referencing them by ID in upload or update file APIs. + * + * @param RequestOpts|null $requestOptions + * + * @return list + * + * @throws APIException + */ + public function list( + RequestOptions|array|null $requestOptions = null + ): array { + // @phpstan-ignore-next-line argument.type + $response = $this->raw->list(requestOptions: $requestOptions); + + return $response->parse(); + } + + /** + * @api + * + * This API deletes a saved extension permanently. + * + * @param string $id the unique ID of the saved extension + * @param RequestOpts|null $requestOptions + * + * @throws APIException + */ + public function delete( + string $id, + RequestOptions|array|null $requestOptions = null + ): mixed { + // @phpstan-ignore-next-line argument.type + $response = $this->raw->delete($id, requestOptions: $requestOptions); + + return $response->parse(); + } + + /** + * @api + * + * This API returns details of a specific saved extension by ID. + * + * @param string $id the unique ID of the saved extension + * @param RequestOpts|null $requestOptions + * + * @throws APIException + */ + public function get( + string $id, + RequestOptions|array|null $requestOptions = null + ): SavedExtension { + // @phpstan-ignore-next-line argument.type + $response = $this->raw->get($id, requestOptions: $requestOptions); + + return $response->parse(); + } +} diff --git a/src/SolidColorOverlay.php b/src/SolidColorOverlay.php index 6c85beba..69e6f281 100644 --- a/src/SolidColorOverlay.php +++ b/src/SolidColorOverlay.php @@ -4,6 +4,7 @@ namespace Imagekit; +use Imagekit\BaseOverlay\LayerMode; use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; @@ -15,6 +16,7 @@ * @phpstan-import-type SolidColorOverlayTransformationShape from \Imagekit\SolidColorOverlayTransformation * * @phpstan-type SolidColorOverlayShape = array{ + * layerMode?: null|LayerMode|value-of, * position?: null|OverlayPosition|OverlayPositionShape, * timing?: null|OverlayTiming|OverlayTimingShape, * color: string, @@ -31,6 +33,20 @@ final class SolidColorOverlay implements BaseModel #[Required] public string $type = 'solidColor'; + /** + * Controls how the layer blends with the base image or underlying content. Maps to `lm` in the URL. + * By default, layers completely cover the base image beneath them. Layer modes change this behavior: + * - `multiply`: Multiplies the pixel values of the layer with the base image. The result is always darker than the original images. This is ideal for applying shadows or color tints. + * - `displace`: Uses the layer as a displacement map to distort pixels in the base image. The red channel controls horizontal displacement, and the green channel controls vertical displacement. Requires `x` or `y` parameter to control displacement magnitude. + * - `cutout`: Acts as an inverse mask where opaque areas of the layer turn the base image transparent, while transparent areas leave the base image unchanged. This mode functions like a hole-punch, effectively cutting the shape of the layer out of the underlying image. + * - `cutter`: Acts as a shape mask where only the parts of the base image that fall inside the opaque area of the layer are preserved. This mode functions like a cookie-cutter, trimming the base image to match the specific dimensions and shape of the layer. + * See [Layer modes](https://imagekit.io/docs/add-overlays-on-images#layer-modes). + * + * @var value-of|null $layerMode + */ + #[Optional(enum: LayerMode::class)] + public ?string $layerMode; + #[Optional] public ?OverlayPosition $position; @@ -77,12 +93,14 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * + * @param LayerMode|value-of|null $layerMode * @param OverlayPosition|OverlayPositionShape|null $position * @param OverlayTiming|OverlayTimingShape|null $timing * @param list|null $transformation */ public static function with( string $color, + LayerMode|string|null $layerMode = null, OverlayPosition|array|null $position = null, OverlayTiming|array|null $timing = null, ?array $transformation = null, @@ -91,6 +109,7 @@ public static function with( $self['color'] = $color; + null !== $layerMode && $self['layerMode'] = $layerMode; null !== $position && $self['position'] = $position; null !== $timing && $self['timing'] = $timing; null !== $transformation && $self['transformation'] = $transformation; @@ -98,6 +117,25 @@ public static function with( return $self; } + /** + * Controls how the layer blends with the base image or underlying content. Maps to `lm` in the URL. + * By default, layers completely cover the base image beneath them. Layer modes change this behavior: + * - `multiply`: Multiplies the pixel values of the layer with the base image. The result is always darker than the original images. This is ideal for applying shadows or color tints. + * - `displace`: Uses the layer as a displacement map to distort pixels in the base image. The red channel controls horizontal displacement, and the green channel controls vertical displacement. Requires `x` or `y` parameter to control displacement magnitude. + * - `cutout`: Acts as an inverse mask where opaque areas of the layer turn the base image transparent, while transparent areas leave the base image unchanged. This mode functions like a hole-punch, effectively cutting the shape of the layer out of the underlying image. + * - `cutter`: Acts as a shape mask where only the parts of the base image that fall inside the opaque area of the layer are preserved. This mode functions like a cookie-cutter, trimming the base image to match the specific dimensions and shape of the layer. + * See [Layer modes](https://imagekit.io/docs/add-overlays-on-images#layer-modes). + * + * @param LayerMode|value-of $layerMode + */ + public function withLayerMode(LayerMode|string $layerMode): self + { + $self = clone $this; + $self['layerMode'] = $layerMode; + + return $self; + } + /** * @param OverlayPosition|OverlayPositionShape $position */ diff --git a/src/SolidColorOverlayTransformation.php b/src/SolidColorOverlayTransformation.php index b4723171..707ed85b 100644 --- a/src/SolidColorOverlayTransformation.php +++ b/src/SolidColorOverlayTransformation.php @@ -33,7 +33,7 @@ final class SolidColorOverlayTransformation implements BaseModel use SdkModel; /** - * Specifies the transparency level of the solid color overlay. Accepts integers from `1` to `9`. + * Specifies the transparency level of the overlaid solid color layer. Supports integers from `1` to `9`. */ #[Optional] public ?float $alpha; @@ -63,8 +63,11 @@ final class SolidColorOverlayTransformation implements BaseModel public float|string|null $height; /** - * Specifies the corner radius of the solid color overlay. Set to `max` for circular or oval shape. - * See [radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). + * Specifies the corner radius of the solid color overlay. + * - Single value (positive integer): Applied to all corners (e.g., `20`). + * - `max`: Creates a circular or oval shape. + * - Per-corner array: Provide four underscore-separated values representing top-left, top-right, bottom-right, and bottom-left corners respectively (e.g., `10_20_30_40`). + * See [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). * * @var RadiusVariants|null $radius */ @@ -116,7 +119,7 @@ public static function with( } /** - * Specifies the transparency level of the solid color overlay. Accepts integers from `1` to `9`. + * Specifies the transparency level of the overlaid solid color layer. Supports integers from `1` to `9`. */ public function withAlpha(float $alpha): self { @@ -166,8 +169,11 @@ public function withHeight(float|string $height): self } /** - * Specifies the corner radius of the solid color overlay. Set to `max` for circular or oval shape. - * See [radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). + * Specifies the corner radius of the solid color overlay. + * - Single value (positive integer): Applied to all corners (e.g., `20`). + * - `max`: Creates a circular or oval shape. + * - Per-corner array: Provide four underscore-separated values representing top-left, top-right, bottom-right, and bottom-left corners respectively (e.g., `10_20_30_40`). + * See [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). * * @param RadiusShape $radius */ diff --git a/src/SolidColorOverlayTransformation/Radius.php b/src/SolidColorOverlayTransformation/Radius.php index a4379239..4f575ec1 100644 --- a/src/SolidColorOverlayTransformation/Radius.php +++ b/src/SolidColorOverlayTransformation/Radius.php @@ -9,10 +9,13 @@ use Imagekit\Core\Conversion\Contracts\ConverterSource; /** - * Specifies the corner radius of the solid color overlay. Set to `max` for circular or oval shape. - * See [radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). + * Specifies the corner radius of the solid color overlay. + * - Single value (positive integer): Applied to all corners (e.g., `20`). + * - `max`: Creates a circular or oval shape. + * - Per-corner array: Provide four underscore-separated values representing top-left, top-right, bottom-right, and bottom-left corners respectively (e.g., `10_20_30_40`). + * See [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). * - * @phpstan-type RadiusVariants = float|'max' + * @phpstan-type RadiusVariants = float|string|'max' * @phpstan-type RadiusShape = RadiusVariants */ final class Radius implements ConverterSource @@ -24,6 +27,6 @@ final class Radius implements ConverterSource */ public static function variants(): array { - return ['float', 'string']; + return ['float', 'string', 'string']; } } diff --git a/src/SubtitleOverlay.php b/src/SubtitleOverlay.php index 7d610a7b..dd415ae0 100644 --- a/src/SubtitleOverlay.php +++ b/src/SubtitleOverlay.php @@ -4,6 +4,7 @@ namespace Imagekit; +use Imagekit\BaseOverlay\LayerMode; use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; @@ -16,6 +17,7 @@ * @phpstan-import-type SubtitleOverlayTransformationShape from \Imagekit\SubtitleOverlayTransformation * * @phpstan-type SubtitleOverlayShape = array{ + * layerMode?: null|LayerMode|value-of, * position?: null|OverlayPosition|OverlayPositionShape, * timing?: null|OverlayTiming|OverlayTimingShape, * input: string, @@ -33,6 +35,20 @@ final class SubtitleOverlay implements BaseModel #[Required] public string $type = 'subtitle'; + /** + * Controls how the layer blends with the base image or underlying content. Maps to `lm` in the URL. + * By default, layers completely cover the base image beneath them. Layer modes change this behavior: + * - `multiply`: Multiplies the pixel values of the layer with the base image. The result is always darker than the original images. This is ideal for applying shadows or color tints. + * - `displace`: Uses the layer as a displacement map to distort pixels in the base image. The red channel controls horizontal displacement, and the green channel controls vertical displacement. Requires `x` or `y` parameter to control displacement magnitude. + * - `cutout`: Acts as an inverse mask where opaque areas of the layer turn the base image transparent, while transparent areas leave the base image unchanged. This mode functions like a hole-punch, effectively cutting the shape of the layer out of the underlying image. + * - `cutter`: Acts as a shape mask where only the parts of the base image that fall inside the opaque area of the layer are preserved. This mode functions like a cookie-cutter, trimming the base image to match the specific dimensions and shape of the layer. + * See [Layer modes](https://imagekit.io/docs/add-overlays-on-images#layer-modes). + * + * @var value-of|null $layerMode + */ + #[Optional(enum: LayerMode::class)] + public ?string $layerMode; + #[Optional] public ?OverlayPosition $position; @@ -51,6 +67,10 @@ final class SubtitleOverlay implements BaseModel * To always use base64 encoding (`ie-{base64}`), set this parameter to `base64`. * To always use plain text (`i-{input}`), set it to `plain`. * + * Regardless of the encoding method: + * - Leading and trailing slashes are removed. + * - Remaining slashes within the path are replaced with `@@` when using plain text. + * * @var value-of|null $encoding */ #[Optional(enum: Encoding::class)] @@ -88,6 +108,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * + * @param LayerMode|value-of|null $layerMode * @param OverlayPosition|OverlayPositionShape|null $position * @param OverlayTiming|OverlayTimingShape|null $timing * @param Encoding|value-of|null $encoding @@ -95,6 +116,7 @@ public function __construct() */ public static function with( string $input, + LayerMode|string|null $layerMode = null, OverlayPosition|array|null $position = null, OverlayTiming|array|null $timing = null, Encoding|string|null $encoding = null, @@ -104,6 +126,7 @@ public static function with( $self['input'] = $input; + null !== $layerMode && $self['layerMode'] = $layerMode; null !== $position && $self['position'] = $position; null !== $timing && $self['timing'] = $timing; null !== $encoding && $self['encoding'] = $encoding; @@ -112,6 +135,25 @@ public static function with( return $self; } + /** + * Controls how the layer blends with the base image or underlying content. Maps to `lm` in the URL. + * By default, layers completely cover the base image beneath them. Layer modes change this behavior: + * - `multiply`: Multiplies the pixel values of the layer with the base image. The result is always darker than the original images. This is ideal for applying shadows or color tints. + * - `displace`: Uses the layer as a displacement map to distort pixels in the base image. The red channel controls horizontal displacement, and the green channel controls vertical displacement. Requires `x` or `y` parameter to control displacement magnitude. + * - `cutout`: Acts as an inverse mask where opaque areas of the layer turn the base image transparent, while transparent areas leave the base image unchanged. This mode functions like a hole-punch, effectively cutting the shape of the layer out of the underlying image. + * - `cutter`: Acts as a shape mask where only the parts of the base image that fall inside the opaque area of the layer are preserved. This mode functions like a cookie-cutter, trimming the base image to match the specific dimensions and shape of the layer. + * See [Layer modes](https://imagekit.io/docs/add-overlays-on-images#layer-modes). + * + * @param LayerMode|value-of $layerMode + */ + public function withLayerMode(LayerMode|string $layerMode): self + { + $self = clone $this; + $self['layerMode'] = $layerMode; + + return $self; + } + /** * @param OverlayPosition|OverlayPositionShape $position */ @@ -151,6 +193,10 @@ public function withInput(string $input): self * To always use base64 encoding (`ie-{base64}`), set this parameter to `base64`. * To always use plain text (`i-{input}`), set it to `plain`. * + * Regardless of the encoding method: + * - Leading and trailing slashes are removed. + * - Remaining slashes within the path are replaced with `@@` when using plain text. + * * @param Encoding|value-of $encoding */ public function withEncoding(Encoding|string $encoding): self diff --git a/src/SubtitleOverlay/Encoding.php b/src/SubtitleOverlay/Encoding.php index 0967c288..8d5e3627 100644 --- a/src/SubtitleOverlay/Encoding.php +++ b/src/SubtitleOverlay/Encoding.php @@ -9,6 +9,10 @@ * By default, the SDK determines the appropriate format automatically. * To always use base64 encoding (`ie-{base64}`), set this parameter to `base64`. * To always use plain text (`i-{input}`), set it to `plain`. + * + * Regardless of the encoding method: + * - Leading and trailing slashes are removed. + * - Remaining slashes within the path are replaced with `@@` when using plain text. */ enum Encoding: string { diff --git a/src/SubtitleOverlayTransformation.php b/src/SubtitleOverlayTransformation.php index 9cbd6b15..33415b6f 100644 --- a/src/SubtitleOverlayTransformation.php +++ b/src/SubtitleOverlayTransformation.php @@ -44,7 +44,8 @@ final class SubtitleOverlayTransformation implements BaseModel public ?string $color; /** - * Font family for subtitles. Refer to the [supported fonts](https://imagekit.io/docs/add-overlays-on-images#supported-text-font-list). + * Sets the font family of subtitle text. + * Refer to the [supported fonts documented](https://imagekit.io/docs/add-overlays-on-images#supported-text-font-list) in the ImageKit transformations guide. */ #[Optional] public ?string $fontFamily; @@ -148,7 +149,8 @@ public function withColor(string $color): self } /** - * Font family for subtitles. Refer to the [supported fonts](https://imagekit.io/docs/add-overlays-on-images#supported-text-font-list). + * Sets the font family of subtitle text. + * Refer to the [supported fonts documented](https://imagekit.io/docs/add-overlays-on-images#supported-text-font-list) in the ImageKit transformations guide. */ public function withFontFamily(string $fontFamily): self { diff --git a/src/TextOverlay.php b/src/TextOverlay.php index 14260f7c..94896784 100644 --- a/src/TextOverlay.php +++ b/src/TextOverlay.php @@ -4,6 +4,7 @@ namespace Imagekit; +use Imagekit\BaseOverlay\LayerMode; use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; @@ -16,6 +17,7 @@ * @phpstan-import-type TextOverlayTransformationShape from \Imagekit\TextOverlayTransformation * * @phpstan-type TextOverlayShape = array{ + * layerMode?: null|LayerMode|value-of, * position?: null|OverlayPosition|OverlayPositionShape, * timing?: null|OverlayTiming|OverlayTimingShape, * text: string, @@ -33,6 +35,20 @@ final class TextOverlay implements BaseModel #[Required] public string $type = 'text'; + /** + * Controls how the layer blends with the base image or underlying content. Maps to `lm` in the URL. + * By default, layers completely cover the base image beneath them. Layer modes change this behavior: + * - `multiply`: Multiplies the pixel values of the layer with the base image. The result is always darker than the original images. This is ideal for applying shadows or color tints. + * - `displace`: Uses the layer as a displacement map to distort pixels in the base image. The red channel controls horizontal displacement, and the green channel controls vertical displacement. Requires `x` or `y` parameter to control displacement magnitude. + * - `cutout`: Acts as an inverse mask where opaque areas of the layer turn the base image transparent, while transparent areas leave the base image unchanged. This mode functions like a hole-punch, effectively cutting the shape of the layer out of the underlying image. + * - `cutter`: Acts as a shape mask where only the parts of the base image that fall inside the opaque area of the layer are preserved. This mode functions like a cookie-cutter, trimming the base image to match the specific dimensions and shape of the layer. + * See [Layer modes](https://imagekit.io/docs/add-overlays-on-images#layer-modes). + * + * @var value-of|null $layerMode + */ + #[Optional(enum: LayerMode::class)] + public ?string $layerMode; + #[Optional] public ?OverlayPosition $position; @@ -51,6 +67,8 @@ final class TextOverlay implements BaseModel * To always use base64 (`ie-{base64}`), set this parameter to `base64`. * To always use plain text (`i-{input}`), set it to `plain`. * + * Regardless of the encoding method, the input text is always percent-encoded to ensure it is URL-safe. + * * @var value-of|null $encoding */ #[Optional(enum: Encoding::class)] @@ -88,6 +106,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * + * @param LayerMode|value-of|null $layerMode * @param OverlayPosition|OverlayPositionShape|null $position * @param OverlayTiming|OverlayTimingShape|null $timing * @param Encoding|value-of|null $encoding @@ -95,6 +114,7 @@ public function __construct() */ public static function with( string $text, + LayerMode|string|null $layerMode = null, OverlayPosition|array|null $position = null, OverlayTiming|array|null $timing = null, Encoding|string|null $encoding = null, @@ -104,6 +124,7 @@ public static function with( $self['text'] = $text; + null !== $layerMode && $self['layerMode'] = $layerMode; null !== $position && $self['position'] = $position; null !== $timing && $self['timing'] = $timing; null !== $encoding && $self['encoding'] = $encoding; @@ -112,6 +133,25 @@ public static function with( return $self; } + /** + * Controls how the layer blends with the base image or underlying content. Maps to `lm` in the URL. + * By default, layers completely cover the base image beneath them. Layer modes change this behavior: + * - `multiply`: Multiplies the pixel values of the layer with the base image. The result is always darker than the original images. This is ideal for applying shadows or color tints. + * - `displace`: Uses the layer as a displacement map to distort pixels in the base image. The red channel controls horizontal displacement, and the green channel controls vertical displacement. Requires `x` or `y` parameter to control displacement magnitude. + * - `cutout`: Acts as an inverse mask where opaque areas of the layer turn the base image transparent, while transparent areas leave the base image unchanged. This mode functions like a hole-punch, effectively cutting the shape of the layer out of the underlying image. + * - `cutter`: Acts as a shape mask where only the parts of the base image that fall inside the opaque area of the layer are preserved. This mode functions like a cookie-cutter, trimming the base image to match the specific dimensions and shape of the layer. + * See [Layer modes](https://imagekit.io/docs/add-overlays-on-images#layer-modes). + * + * @param LayerMode|value-of $layerMode + */ + public function withLayerMode(LayerMode|string $layerMode): self + { + $self = clone $this; + $self['layerMode'] = $layerMode; + + return $self; + } + /** * @param OverlayPosition|OverlayPositionShape $position */ @@ -151,6 +191,8 @@ public function withText(string $text): self * To always use base64 (`ie-{base64}`), set this parameter to `base64`. * To always use plain text (`i-{input}`), set it to `plain`. * + * Regardless of the encoding method, the input text is always percent-encoded to ensure it is URL-safe. + * * @param Encoding|value-of $encoding */ public function withEncoding(Encoding|string $encoding): self diff --git a/src/TextOverlay/Encoding.php b/src/TextOverlay/Encoding.php index daecef98..5d9cec1e 100644 --- a/src/TextOverlay/Encoding.php +++ b/src/TextOverlay/Encoding.php @@ -9,6 +9,8 @@ * By default, the SDK selects the appropriate format based on the input text. * To always use base64 (`ie-{base64}`), set this parameter to `base64`. * To always use plain text (`i-{input}`), set it to `plain`. + * + * Regardless of the encoding method, the input text is always percent-encoded to ensure it is URL-safe. */ enum Encoding: string { diff --git a/src/TextOverlayTransformation.php b/src/TextOverlayTransformation.php index 3a25bf97..7bbfeabb 100644 --- a/src/TextOverlayTransformation.php +++ b/src/TextOverlayTransformation.php @@ -59,7 +59,8 @@ final class TextOverlayTransformation implements BaseModel public ?string $background; /** - * Flip the text overlay horizontally, vertically, or both. + * Flip/mirror the text horizontally, vertically, or in both directions. + * Acceptable values: `h` (horizontal), `v` (vertical), `h_v` (horizontal and vertical), or `v_h`. * * @var value-of|null $flip */ @@ -96,8 +97,8 @@ final class TextOverlayTransformation implements BaseModel public ?string $innerAlignment; /** - * Specifies the line height of the text overlay. - * Accepts integer values representing line height in points. It can also accept [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations) such as `bw_mul_0.2`, or `bh_div_20`. + * Specifies the line height for multi-line text overlays. It will come into effect only if the text wraps over multiple lines. + * Accepts either an integer value or an arithmetic expression. * * @var LineHeightVariants|null $lineHeight */ @@ -115,8 +116,11 @@ final class TextOverlayTransformation implements BaseModel public float|string|null $padding; /** - * Specifies the corner radius of the text overlay. - * Set to `max` to achieve a circular or oval shape. + * Specifies the corner radius: + * - Single value (positive integer): Applied to all corners (e.g., `20`). + * - `max`: Creates a circular or oval shape. + * - Per-corner array: Provide four underscore-separated values representing top-left, top-right, bottom-right, and bottom-left corners respectively (e.g., `10_20_30_40`). + * See [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). * * @var RadiusVariants|null $radius */ @@ -227,7 +231,8 @@ public function withBackground(string $background): self } /** - * Flip the text overlay horizontally, vertically, or both. + * Flip/mirror the text horizontally, vertically, or in both directions. + * Acceptable values: `h` (horizontal), `v` (vertical), `h_v` (horizontal and vertical), or `v_h`. * * @param Flip|value-of $flip */ @@ -290,8 +295,8 @@ public function withInnerAlignment( } /** - * Specifies the line height of the text overlay. - * Accepts integer values representing line height in points. It can also accept [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations) such as `bw_mul_0.2`, or `bh_div_20`. + * Specifies the line height for multi-line text overlays. It will come into effect only if the text wraps over multiple lines. + * Accepts either an integer value or an arithmetic expression. * * @param LineHeightShape $lineHeight */ @@ -319,8 +324,11 @@ public function withPadding(float|string $padding): self } /** - * Specifies the corner radius of the text overlay. - * Set to `max` to achieve a circular or oval shape. + * Specifies the corner radius: + * - Single value (positive integer): Applied to all corners (e.g., `20`). + * - `max`: Creates a circular or oval shape. + * - Per-corner array: Provide four underscore-separated values representing top-left, top-right, bottom-right, and bottom-left corners respectively (e.g., `10_20_30_40`). + * See [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). * * @param RadiusShape $radius */ diff --git a/src/TextOverlayTransformation/Flip.php b/src/TextOverlayTransformation/Flip.php index 7b665809..e99fb624 100644 --- a/src/TextOverlayTransformation/Flip.php +++ b/src/TextOverlayTransformation/Flip.php @@ -5,7 +5,8 @@ namespace Imagekit\TextOverlayTransformation; /** - * Flip the text overlay horizontally, vertically, or both. + * Flip/mirror the text horizontally, vertically, or in both directions. + * Acceptable values: `h` (horizontal), `v` (vertical), `h_v` (horizontal and vertical), or `v_h`. */ enum Flip: string { diff --git a/src/TextOverlayTransformation/LineHeight.php b/src/TextOverlayTransformation/LineHeight.php index 8ae3be18..e3e6eb9e 100644 --- a/src/TextOverlayTransformation/LineHeight.php +++ b/src/TextOverlayTransformation/LineHeight.php @@ -9,8 +9,8 @@ use Imagekit\Core\Conversion\Contracts\ConverterSource; /** - * Specifies the line height of the text overlay. - * Accepts integer values representing line height in points. It can also accept [arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations) such as `bw_mul_0.2`, or `bh_div_20`. + * Specifies the line height for multi-line text overlays. It will come into effect only if the text wraps over multiple lines. + * Accepts either an integer value or an arithmetic expression. * * @phpstan-type LineHeightVariants = float|string * @phpstan-type LineHeightShape = LineHeightVariants diff --git a/src/TextOverlayTransformation/Radius.php b/src/TextOverlayTransformation/Radius.php index adec7c79..aee44853 100644 --- a/src/TextOverlayTransformation/Radius.php +++ b/src/TextOverlayTransformation/Radius.php @@ -9,10 +9,13 @@ use Imagekit\Core\Conversion\Contracts\ConverterSource; /** - * Specifies the corner radius of the text overlay. - * Set to `max` to achieve a circular or oval shape. + * Specifies the corner radius: + * - Single value (positive integer): Applied to all corners (e.g., `20`). + * - `max`: Creates a circular or oval shape. + * - Per-corner array: Provide four underscore-separated values representing top-left, top-right, bottom-right, and bottom-left corners respectively (e.g., `10_20_30_40`). + * See [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). * - * @phpstan-type RadiusVariants = float|'max' + * @phpstan-type RadiusVariants = float|string|'max' * @phpstan-type RadiusShape = RadiusVariants */ final class Radius implements ConverterSource @@ -24,6 +27,6 @@ final class Radius implements ConverterSource */ public static function variants(): array { - return ['float', 'string']; + return ['float', 'string', 'string']; } } diff --git a/src/Transformation.php b/src/Transformation.php index b0fc96a9..9981b85e 100644 --- a/src/Transformation.php +++ b/src/Transformation.php @@ -74,10 +74,12 @@ * blur?: float|null, * border?: string|null, * colorProfile?: bool|null, + * colorReplace?: string|null, * contrastStretch?: bool|null, * crop?: null|Crop|value-of, * cropMode?: null|CropMode|value-of, * defaultImage?: string|null, + * distort?: string|null, * dpr?: float|null, * duration?: DurationShape|null, * endOffset?: EndOffsetShape|null, @@ -209,6 +211,8 @@ final class Transformation implements BaseModel /** * Specifies the background to be used in conjunction with certain cropping strategies when resizing an image. * - A solid color: e.g., `red`, `F3F3F3`, `AAFF0010`. See [Solid color background](https://imagekit.io/docs/effects-and-enhancements#solid-color-background). + * - Dominant color: `dominant` extracts the dominant color from the image. See [Dominant color background](https://imagekit.io/docs/effects-and-enhancements#dominant-color-background). + * - Gradient: `gradient_dominant` or `gradient_dominant_2` creates a gradient using the dominant colors. Optionally specify palette size (2 or 4), e.g., `gradient_dominant_4`. See [Gradient background](https://imagekit.io/docs/effects-and-enhancements#gradient-background). * - A blurred background: e.g., `blurred`, `blurred_25_N15`, etc. See [Blurred background](https://imagekit.io/docs/effects-and-enhancements#blurred-background). * - Expand the image boundaries using generative fill: `genfill`. Not supported inside overlay. Optionally, control the background scene by passing a text prompt: * `genfill[:-prompt-${text}]` or `genfill[:-prompte-${urlencoded_base64_encoded_text}]`. See [Generative fill background](https://imagekit.io/docs/ai-transformations#generative-fill-bg-genfill). @@ -238,6 +242,17 @@ final class Transformation implements BaseModel #[Optional] public ?bool $colorProfile; + /** + * Replaces colors in the image. Supports three formats: + * - `toColor` - Replace dominant color with the specified color. + * - `toColor_tolerance` - Replace dominant color with specified tolerance (0-100). + * - `toColor_tolerance_fromColor` - Replace a specific color with another within tolerance range. + * Colors can be hex codes (e.g., `FF0022`) or names (e.g., `red`, `blue`). + * See [Color replacement](https://imagekit.io/docs/effects-and-enhancements#color-replace---cr). + */ + #[Optional] + public ?string $colorReplace; + /** * Automatically enhances the contrast of an image (contrast stretch). * See [Contrast Stretch](https://imagekit.io/docs/effects-and-enhancements#contrast-stretch---e-contrast). @@ -269,8 +284,18 @@ final class Transformation implements BaseModel public ?string $defaultImage; /** - * Accepts values between 0.1 and 5, or `auto` for automatic device pixel ratio (DPR) calculation. - * See [DPR](https://imagekit.io/docs/image-resize-and-crop#dpr---dpr). + * Distorts the shape of an image. Supports two modes: + * - Perspective distortion: `p-x1_y1_x2_y2_x3_y3_x4_y4` changes the position of the four corners starting clockwise from top-left. + * - Arc distortion: `a-degrees` curves the image upwards (positive values) or downwards (negative values). + * See [Distort effect](https://imagekit.io/docs/effects-and-enhancements#distort---e-distort). + */ + #[Optional] + public ?string $distort; + + /** + * Accepts values between 0.1 and 5, or `auto` for automatic device pixel ratio (DPR) calculation. Also accepts arithmetic expressions. + * - Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * - See [DPR](https://imagekit.io/docs/image-resize-and-crop#dpr---dpr). */ #[Optional] public ?float $dpr; @@ -422,7 +447,10 @@ final class Transformation implements BaseModel public ?float $quality; /** - * Specifies the corner radius for rounded corners (e.g., 20) or `max` for circular or oval shape. + * Specifies the corner radius for rounded corners. + * - Single value (positive integer): Applied to all corners (e.g., `20`). + * - `max`: Creates a circular or oval shape. + * - Per-corner array: Provide four underscore-separated values representing top-left, top-right, bottom-right, and bottom-left corners respectively (e.g., `10_20_30_40`). * See [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). * * @var RadiusVariants|null $radius @@ -618,10 +646,12 @@ public static function with( ?float $blur = null, ?string $border = null, ?bool $colorProfile = null, + ?string $colorReplace = null, ?bool $contrastStretch = null, Crop|string|null $crop = null, CropMode|string|null $cropMode = null, ?string $defaultImage = null, + ?string $distort = null, ?float $dpr = null, float|string|null $duration = null, float|string|null $endOffset = null, @@ -673,10 +703,12 @@ public static function with( null !== $blur && $self['blur'] = $blur; null !== $border && $self['border'] = $border; null !== $colorProfile && $self['colorProfile'] = $colorProfile; + null !== $colorReplace && $self['colorReplace'] = $colorReplace; null !== $contrastStretch && $self['contrastStretch'] = $contrastStretch; null !== $crop && $self['crop'] = $crop; null !== $cropMode && $self['cropMode'] = $cropMode; null !== $defaultImage && $self['defaultImage'] = $defaultImage; + null !== $distort && $self['distort'] = $distort; null !== $dpr && $self['dpr'] = $dpr; null !== $duration && $self['duration'] = $duration; null !== $endOffset && $self['endOffset'] = $endOffset; @@ -856,6 +888,8 @@ public function withAudioCodec(AudioCodec|string $audioCodec): self /** * Specifies the background to be used in conjunction with certain cropping strategies when resizing an image. * - A solid color: e.g., `red`, `F3F3F3`, `AAFF0010`. See [Solid color background](https://imagekit.io/docs/effects-and-enhancements#solid-color-background). + * - Dominant color: `dominant` extracts the dominant color from the image. See [Dominant color background](https://imagekit.io/docs/effects-and-enhancements#dominant-color-background). + * - Gradient: `gradient_dominant` or `gradient_dominant_2` creates a gradient using the dominant colors. Optionally specify palette size (2 or 4), e.g., `gradient_dominant_4`. See [Gradient background](https://imagekit.io/docs/effects-and-enhancements#gradient-background). * - A blurred background: e.g., `blurred`, `blurred_25_N15`, etc. See [Blurred background](https://imagekit.io/docs/effects-and-enhancements#blurred-background). * - Expand the image boundaries using generative fill: `genfill`. Not supported inside overlay. Optionally, control the background scene by passing a text prompt: * `genfill[:-prompt-${text}]` or `genfill[:-prompte-${urlencoded_base64_encoded_text}]`. See [Generative fill background](https://imagekit.io/docs/ai-transformations#generative-fill-bg-genfill). @@ -905,6 +939,22 @@ public function withColorProfile(bool $colorProfile): self return $self; } + /** + * Replaces colors in the image. Supports three formats: + * - `toColor` - Replace dominant color with the specified color. + * - `toColor_tolerance` - Replace dominant color with specified tolerance (0-100). + * - `toColor_tolerance_fromColor` - Replace a specific color with another within tolerance range. + * Colors can be hex codes (e.g., `FF0022`) or names (e.g., `red`, `blue`). + * See [Color replacement](https://imagekit.io/docs/effects-and-enhancements#color-replace---cr). + */ + public function withColorReplace(string $colorReplace): self + { + $self = clone $this; + $self['colorReplace'] = $colorReplace; + + return $self; + } + /** * Automatically enhances the contrast of an image (contrast stretch). * See [Contrast Stretch](https://imagekit.io/docs/effects-and-enhancements#contrast-stretch---e-contrast). @@ -956,8 +1006,23 @@ public function withDefaultImage(string $defaultImage): self } /** - * Accepts values between 0.1 and 5, or `auto` for automatic device pixel ratio (DPR) calculation. - * See [DPR](https://imagekit.io/docs/image-resize-and-crop#dpr---dpr). + * Distorts the shape of an image. Supports two modes: + * - Perspective distortion: `p-x1_y1_x2_y2_x3_y3_x4_y4` changes the position of the four corners starting clockwise from top-left. + * - Arc distortion: `a-degrees` curves the image upwards (positive values) or downwards (negative values). + * See [Distort effect](https://imagekit.io/docs/effects-and-enhancements#distort---e-distort). + */ + public function withDistort(string $distort): self + { + $self = clone $this; + $self['distort'] = $distort; + + return $self; + } + + /** + * Accepts values between 0.1 and 5, or `auto` for automatic device pixel ratio (DPR) calculation. Also accepts arithmetic expressions. + * - Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * - See [DPR](https://imagekit.io/docs/image-resize-and-crop#dpr---dpr). */ public function withDpr(float $dpr): self { @@ -1199,7 +1264,10 @@ public function withQuality(float $quality): self } /** - * Specifies the corner radius for rounded corners (e.g., 20) or `max` for circular or oval shape. + * Specifies the corner radius for rounded corners. + * - Single value (positive integer): Applied to all corners (e.g., `20`). + * - `max`: Creates a circular or oval shape. + * - Per-corner array: Provide four underscore-separated values representing top-left, top-right, bottom-right, and bottom-left corners respectively (e.g., `10_20_30_40`). * See [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). * * @param RadiusShape $radius diff --git a/src/Transformation/Radius.php b/src/Transformation/Radius.php index 3e51c43a..1c78c440 100644 --- a/src/Transformation/Radius.php +++ b/src/Transformation/Radius.php @@ -9,10 +9,13 @@ use Imagekit\Core\Conversion\Contracts\ConverterSource; /** - * Specifies the corner radius for rounded corners (e.g., 20) or `max` for circular or oval shape. + * Specifies the corner radius for rounded corners. + * - Single value (positive integer): Applied to all corners (e.g., `20`). + * - `max`: Creates a circular or oval shape. + * - Per-corner array: Provide four underscore-separated values representing top-left, top-right, bottom-right, and bottom-left corners respectively (e.g., `10_20_30_40`). * See [Radius](https://imagekit.io/docs/effects-and-enhancements#radius---r). * - * @phpstan-type RadiusVariants = float|'max' + * @phpstan-type RadiusVariants = float|string|'max' * @phpstan-type RadiusShape = RadiusVariants */ final class Radius implements ConverterSource @@ -24,6 +27,6 @@ final class Radius implements ConverterSource */ public static function variants(): array { - return ['float', 'string']; + return ['float', 'string', 'string']; } } diff --git a/src/VideoOverlay.php b/src/VideoOverlay.php index da8e38b2..270be2d5 100644 --- a/src/VideoOverlay.php +++ b/src/VideoOverlay.php @@ -4,6 +4,7 @@ namespace Imagekit; +use Imagekit\BaseOverlay\LayerMode; use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; @@ -15,6 +16,7 @@ * @phpstan-import-type OverlayTimingShape from \Imagekit\OverlayTiming * * @phpstan-type VideoOverlayShape = array{ + * layerMode?: null|LayerMode|value-of, * position?: null|OverlayPosition|OverlayPositionShape, * timing?: null|OverlayTiming|OverlayTimingShape, * input: string, @@ -32,6 +34,20 @@ final class VideoOverlay implements BaseModel #[Required] public string $type = 'video'; + /** + * Controls how the layer blends with the base image or underlying content. Maps to `lm` in the URL. + * By default, layers completely cover the base image beneath them. Layer modes change this behavior: + * - `multiply`: Multiplies the pixel values of the layer with the base image. The result is always darker than the original images. This is ideal for applying shadows or color tints. + * - `displace`: Uses the layer as a displacement map to distort pixels in the base image. The red channel controls horizontal displacement, and the green channel controls vertical displacement. Requires `x` or `y` parameter to control displacement magnitude. + * - `cutout`: Acts as an inverse mask where opaque areas of the layer turn the base image transparent, while transparent areas leave the base image unchanged. This mode functions like a hole-punch, effectively cutting the shape of the layer out of the underlying image. + * - `cutter`: Acts as a shape mask where only the parts of the base image that fall inside the opaque area of the layer are preserved. This mode functions like a cookie-cutter, trimming the base image to match the specific dimensions and shape of the layer. + * See [Layer modes](https://imagekit.io/docs/add-overlays-on-images#layer-modes). + * + * @var value-of|null $layerMode + */ + #[Optional(enum: LayerMode::class)] + public ?string $layerMode; + #[Optional] public ?OverlayPosition $position; @@ -50,6 +66,10 @@ final class VideoOverlay implements BaseModel * To always use base64 encoding (`ie-{base64}`), set this parameter to `base64`. * To always use plain text (`i-{input}`), set it to `plain`. * + * Regardless of the encoding method: + * - Leading and trailing slashes are removed. + * - Remaining slashes within the path are replaced with `@@` when using plain text. + * * @var value-of|null $encoding */ #[Optional(enum: Encoding::class)] @@ -88,6 +108,7 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * + * @param LayerMode|value-of|null $layerMode * @param OverlayPosition|OverlayPositionShape|null $position * @param OverlayTiming|OverlayTimingShape|null $timing * @param Encoding|value-of|null $encoding @@ -95,6 +116,7 @@ public function __construct() */ public static function with( string $input, + LayerMode|string|null $layerMode = null, OverlayPosition|array|null $position = null, OverlayTiming|array|null $timing = null, Encoding|string|null $encoding = null, @@ -104,6 +126,7 @@ public static function with( $self['input'] = $input; + null !== $layerMode && $self['layerMode'] = $layerMode; null !== $position && $self['position'] = $position; null !== $timing && $self['timing'] = $timing; null !== $encoding && $self['encoding'] = $encoding; @@ -112,6 +135,25 @@ public static function with( return $self; } + /** + * Controls how the layer blends with the base image or underlying content. Maps to `lm` in the URL. + * By default, layers completely cover the base image beneath them. Layer modes change this behavior: + * - `multiply`: Multiplies the pixel values of the layer with the base image. The result is always darker than the original images. This is ideal for applying shadows or color tints. + * - `displace`: Uses the layer as a displacement map to distort pixels in the base image. The red channel controls horizontal displacement, and the green channel controls vertical displacement. Requires `x` or `y` parameter to control displacement magnitude. + * - `cutout`: Acts as an inverse mask where opaque areas of the layer turn the base image transparent, while transparent areas leave the base image unchanged. This mode functions like a hole-punch, effectively cutting the shape of the layer out of the underlying image. + * - `cutter`: Acts as a shape mask where only the parts of the base image that fall inside the opaque area of the layer are preserved. This mode functions like a cookie-cutter, trimming the base image to match the specific dimensions and shape of the layer. + * See [Layer modes](https://imagekit.io/docs/add-overlays-on-images#layer-modes). + * + * @param LayerMode|value-of $layerMode + */ + public function withLayerMode(LayerMode|string $layerMode): self + { + $self = clone $this; + $self['layerMode'] = $layerMode; + + return $self; + } + /** * @param OverlayPosition|OverlayPositionShape $position */ @@ -151,6 +193,10 @@ public function withInput(string $input): self * To always use base64 encoding (`ie-{base64}`), set this parameter to `base64`. * To always use plain text (`i-{input}`), set it to `plain`. * + * Regardless of the encoding method: + * - Leading and trailing slashes are removed. + * - Remaining slashes within the path are replaced with `@@` when using plain text. + * * @param Encoding|value-of $encoding */ public function withEncoding(Encoding|string $encoding): self diff --git a/src/VideoOverlay/Encoding.php b/src/VideoOverlay/Encoding.php index 395722e3..6ad40fae 100644 --- a/src/VideoOverlay/Encoding.php +++ b/src/VideoOverlay/Encoding.php @@ -9,6 +9,10 @@ * By default, the SDK determines the appropriate format automatically. * To always use base64 encoding (`ie-{base64}`), set this parameter to `base64`. * To always use plain text (`i-{input}`), set it to `plain`. + * + * Regardless of the encoding method: + * - Leading and trailing slashes are removed. + * - Remaining slashes within the path are replaced with `@@` when using plain text. */ enum Encoding: string { diff --git a/tests/Services/Beta/V2/FilesTest.php b/tests/Services/Beta/V2/FilesTest.php index 704a6c92..2a96394a 100644 --- a/tests/Services/Beta/V2/FilesTest.php +++ b/tests/Services/Beta/V2/FilesTest.php @@ -76,6 +76,49 @@ public function testUploadWithOptionalParams(): void 'maxTags' => 5, 'minConfidence' => 95, 'name' => 'google-auto-tagging', ], ['name' => 'ai-auto-description'], + [ + 'name' => 'ai-tasks', + 'tasks' => [ + [ + 'instruction' => 'What types of clothing items are visible in this image?', + 'type' => 'select_tags', + 'vocabulary' => [ + 'shirt', 'tshirt', 'dress', 'trousers', 'jacket', + ], + 'maxSelections' => 1, + 'minSelections' => 0, + ], + [ + 'instruction' => 'Is this a luxury or high-end fashion item?', + 'type' => 'yes_no', + 'onNo' => [ + 'addTags' => ['luxury', 'premium'], + 'removeTags' => ['budget', 'affordable'], + 'setMetadata' => [ + ['field' => 'price_range', 'value' => 'premium'], + ], + 'unsetMetadata' => [['field' => 'price_range']], + ], + 'onUnknown' => [ + 'addTags' => ['luxury', 'premium'], + 'removeTags' => ['budget', 'affordable'], + 'setMetadata' => [ + ['field' => 'price_range', 'value' => 'premium'], + ], + 'unsetMetadata' => [['field' => 'price_range']], + ], + 'onYes' => [ + 'addTags' => ['luxury', 'premium'], + 'removeTags' => ['budget', 'affordable'], + 'setMetadata' => [ + ['field' => 'price_range', 'value' => 'premium'], + ], + 'unsetMetadata' => [['field' => 'price_range']], + ], + ], + ], + ], + ['id' => 'ext_abc123', 'name' => 'saved-extension'], ], folder: 'folder', isPrivateFile: true, diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index 57d121b2..e9b53aea 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -216,6 +216,49 @@ public function testUploadWithOptionalParams(): void 'maxTags' => 5, 'minConfidence' => 95, 'name' => 'google-auto-tagging', ], ['name' => 'ai-auto-description'], + [ + 'name' => 'ai-tasks', + 'tasks' => [ + [ + 'instruction' => 'What types of clothing items are visible in this image?', + 'type' => 'select_tags', + 'vocabulary' => [ + 'shirt', 'tshirt', 'dress', 'trousers', 'jacket', + ], + 'maxSelections' => 1, + 'minSelections' => 0, + ], + [ + 'instruction' => 'Is this a luxury or high-end fashion item?', + 'type' => 'yes_no', + 'onNo' => [ + 'addTags' => ['luxury', 'premium'], + 'removeTags' => ['budget', 'affordable'], + 'setMetadata' => [ + ['field' => 'price_range', 'value' => 'premium'], + ], + 'unsetMetadata' => [['field' => 'price_range']], + ], + 'onUnknown' => [ + 'addTags' => ['luxury', 'premium'], + 'removeTags' => ['budget', 'affordable'], + 'setMetadata' => [ + ['field' => 'price_range', 'value' => 'premium'], + ], + 'unsetMetadata' => [['field' => 'price_range']], + ], + 'onYes' => [ + 'addTags' => ['luxury', 'premium'], + 'removeTags' => ['budget', 'affordable'], + 'setMetadata' => [ + ['field' => 'price_range', 'value' => 'premium'], + ], + 'unsetMetadata' => [['field' => 'price_range']], + ], + ], + ], + ], + ['id' => 'ext_abc123', 'name' => 'saved-extension'], ], folder: 'folder', isPrivateFile: true, diff --git a/tests/Services/SavedExtensionsTest.php b/tests/Services/SavedExtensionsTest.php new file mode 100644 index 00000000..6abe8fda --- /dev/null +++ b/tests/Services/SavedExtensionsTest.php @@ -0,0 +1,127 @@ +client = $client; + } + + #[Test] + public function testCreate(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->savedExtensions->create( + config: ['name' => 'remove-bg'], + description: 'Analyzes vehicle images for type, condition, and quality assessment', + name: 'Car Quality Analysis', + ); + + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(SavedExtension::class, $result); + } + + #[Test] + public function testCreateWithOptionalParams(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->savedExtensions->create( + config: [ + 'name' => 'remove-bg', + 'options' => [ + 'addShadow' => true, + 'bgColor' => 'bg_color', + 'bgImageURL' => 'bg_image_url', + 'semitransparency' => true, + ], + ], + description: 'Analyzes vehicle images for type, condition, and quality assessment', + name: 'Car Quality Analysis', + ); + + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(SavedExtension::class, $result); + } + + #[Test] + public function testUpdate(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->savedExtensions->update('id'); + + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(SavedExtension::class, $result); + } + + #[Test] + public function testList(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->savedExtensions->list(); + + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertIsList($result); + } + + #[Test] + public function testDelete(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->savedExtensions->delete('id'); + + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertNull($result); + } + + #[Test] + public function testGet(): void + { + if (UnsupportedMockTests::$skip) { + $this->markTestSkipped('Prism tests are disabled'); + } + + $result = $this->client->savedExtensions->get('id'); + + // @phpstan-ignore-next-line method.alreadyNarrowedType + $this->assertInstanceOf(SavedExtension::class, $result); + } +} From 0650e35f4556feb702fd622450c303e523c3335f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 15 Jan 2026 10:10:16 +0000 Subject: [PATCH 123/193] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index fdbd8925..f7feecbe 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-7a3257eb171467b637c8d72877f201c2e6038c71ed447a9453230b7309ce7416.yml -openapi_spec_hash: 87b000a9989ad5c9526f28d91b8a1749 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-606f0e2a6ecb6c36557e166764d39b8f619a74904db6bb5ed8bb348ed451b337.yml +openapi_spec_hash: 1d5f5cdb3f7992a183c368ecd009316e config_hash: aeb6eb949d73382270bbd8bbf2e4cf2a From 4694d7135602bdbac9d7ad210f4bba10fa5a3693 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 15 Jan 2026 11:22:01 +0000 Subject: [PATCH 124/193] fix: add ai-tasks property to response schemas with enum values --- .stats.yml | 4 ++-- .../FileUploadResponse/ExtensionStatus.php | 20 +++++++++++++++++++ .../ExtensionStatus/AITasks.php | 14 +++++++++++++ .../FileUpdateResponse/ExtensionStatus.php | 20 +++++++++++++++++++ .../ExtensionStatus/AITasks.php | 14 +++++++++++++ .../FileUploadResponse/ExtensionStatus.php | 20 +++++++++++++++++++ .../ExtensionStatus/AITasks.php | 14 +++++++++++++ .../Data/ExtensionStatus.php | 20 +++++++++++++++++++ .../Data/ExtensionStatus/AITasks.php | 14 +++++++++++++ 9 files changed, 138 insertions(+), 2 deletions(-) create mode 100644 src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AITasks.php create mode 100644 src/Files/FileUpdateResponse/ExtensionStatus/AITasks.php create mode 100644 src/Files/FileUploadResponse/ExtensionStatus/AITasks.php create mode 100644 src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AITasks.php diff --git a/.stats.yml b/.stats.yml index f7feecbe..dc3fb535 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-606f0e2a6ecb6c36557e166764d39b8f619a74904db6bb5ed8bb348ed451b337.yml -openapi_spec_hash: 1d5f5cdb3f7992a183c368ecd009316e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-c028a7584d3508f268ce5c5b824b50af88eaa140620dd03a1b35f409f510603c.yml +openapi_spec_hash: f9b780b2398a87678a13355e48cd515f config_hash: aeb6eb949d73382270bbd8bbf2e4cf2a diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php index de3150e5..7e3d926f 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php @@ -5,6 +5,7 @@ namespace Imagekit\Beta\V2\Files\FileUploadResponse; use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\AIAutoDescription; +use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\AITasks; use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\AwsAutoTagging; use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\GoogleAutoTagging; use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\RemoveBg; @@ -23,6 +24,7 @@ * * @phpstan-type ExtensionStatusShape = array{ * aiAutoDescription?: null|AIAutoDescription|value-of, + * aiTasks?: null|AITasks|value-of, * awsAutoTagging?: null|AwsAutoTagging|value-of, * googleAutoTagging?: null|GoogleAutoTagging|value-of, * removeBg?: null|RemoveBg|value-of, @@ -37,6 +39,10 @@ final class ExtensionStatus implements BaseModel #[Optional('ai-auto-description', enum: AIAutoDescription::class)] public ?string $aiAutoDescription; + /** @var value-of|null $aiTasks */ + #[Optional('ai-tasks', enum: AITasks::class)] + public ?string $aiTasks; + /** @var value-of|null $awsAutoTagging */ #[Optional('aws-auto-tagging', enum: AwsAutoTagging::class)] public ?string $awsAutoTagging; @@ -60,12 +66,14 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param AIAutoDescription|value-of|null $aiAutoDescription + * @param AITasks|value-of|null $aiTasks * @param AwsAutoTagging|value-of|null $awsAutoTagging * @param GoogleAutoTagging|value-of|null $googleAutoTagging * @param RemoveBg|value-of|null $removeBg */ public static function with( AIAutoDescription|string|null $aiAutoDescription = null, + AITasks|string|null $aiTasks = null, AwsAutoTagging|string|null $awsAutoTagging = null, GoogleAutoTagging|string|null $googleAutoTagging = null, RemoveBg|string|null $removeBg = null, @@ -73,6 +81,7 @@ public static function with( $self = new self; null !== $aiAutoDescription && $self['aiAutoDescription'] = $aiAutoDescription; + null !== $aiTasks && $self['aiTasks'] = $aiTasks; null !== $awsAutoTagging && $self['awsAutoTagging'] = $awsAutoTagging; null !== $googleAutoTagging && $self['googleAutoTagging'] = $googleAutoTagging; null !== $removeBg && $self['removeBg'] = $removeBg; @@ -92,6 +101,17 @@ public function withAIAutoDescription( return $self; } + /** + * @param AITasks|value-of $aiTasks + */ + public function withAITasks(AITasks|string $aiTasks): self + { + $self = clone $this; + $self['aiTasks'] = $aiTasks; + + return $self; + } + /** * @param AwsAutoTagging|value-of $awsAutoTagging */ diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AITasks.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AITasks.php new file mode 100644 index 00000000..55a806b6 --- /dev/null +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AITasks.php @@ -0,0 +1,14 @@ +, + * aiTasks?: null|AITasks|value-of, * awsAutoTagging?: null|AwsAutoTagging|value-of, * googleAutoTagging?: null|GoogleAutoTagging|value-of, * removeBg?: null|RemoveBg|value-of, @@ -29,6 +31,10 @@ final class ExtensionStatus implements BaseModel #[Optional('ai-auto-description', enum: AIAutoDescription::class)] public ?string $aiAutoDescription; + /** @var value-of|null $aiTasks */ + #[Optional('ai-tasks', enum: AITasks::class)] + public ?string $aiTasks; + /** @var value-of|null $awsAutoTagging */ #[Optional('aws-auto-tagging', enum: AwsAutoTagging::class)] public ?string $awsAutoTagging; @@ -52,12 +58,14 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param AIAutoDescription|value-of|null $aiAutoDescription + * @param AITasks|value-of|null $aiTasks * @param AwsAutoTagging|value-of|null $awsAutoTagging * @param GoogleAutoTagging|value-of|null $googleAutoTagging * @param RemoveBg|value-of|null $removeBg */ public static function with( AIAutoDescription|string|null $aiAutoDescription = null, + AITasks|string|null $aiTasks = null, AwsAutoTagging|string|null $awsAutoTagging = null, GoogleAutoTagging|string|null $googleAutoTagging = null, RemoveBg|string|null $removeBg = null, @@ -65,6 +73,7 @@ public static function with( $self = new self; null !== $aiAutoDescription && $self['aiAutoDescription'] = $aiAutoDescription; + null !== $aiTasks && $self['aiTasks'] = $aiTasks; null !== $awsAutoTagging && $self['awsAutoTagging'] = $awsAutoTagging; null !== $googleAutoTagging && $self['googleAutoTagging'] = $googleAutoTagging; null !== $removeBg && $self['removeBg'] = $removeBg; @@ -84,6 +93,17 @@ public function withAIAutoDescription( return $self; } + /** + * @param AITasks|value-of $aiTasks + */ + public function withAITasks(AITasks|string $aiTasks): self + { + $self = clone $this; + $self['aiTasks'] = $aiTasks; + + return $self; + } + /** * @param AwsAutoTagging|value-of $awsAutoTagging */ diff --git a/src/Files/FileUpdateResponse/ExtensionStatus/AITasks.php b/src/Files/FileUpdateResponse/ExtensionStatus/AITasks.php new file mode 100644 index 00000000..44cf01a0 --- /dev/null +++ b/src/Files/FileUpdateResponse/ExtensionStatus/AITasks.php @@ -0,0 +1,14 @@ +, + * aiTasks?: null|AITasks|value-of, * awsAutoTagging?: null|AwsAutoTagging|value-of, * googleAutoTagging?: null|GoogleAutoTagging|value-of, * removeBg?: null|RemoveBg|value-of, @@ -37,6 +39,10 @@ final class ExtensionStatus implements BaseModel #[Optional('ai-auto-description', enum: AIAutoDescription::class)] public ?string $aiAutoDescription; + /** @var value-of|null $aiTasks */ + #[Optional('ai-tasks', enum: AITasks::class)] + public ?string $aiTasks; + /** @var value-of|null $awsAutoTagging */ #[Optional('aws-auto-tagging', enum: AwsAutoTagging::class)] public ?string $awsAutoTagging; @@ -60,12 +66,14 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param AIAutoDescription|value-of|null $aiAutoDescription + * @param AITasks|value-of|null $aiTasks * @param AwsAutoTagging|value-of|null $awsAutoTagging * @param GoogleAutoTagging|value-of|null $googleAutoTagging * @param RemoveBg|value-of|null $removeBg */ public static function with( AIAutoDescription|string|null $aiAutoDescription = null, + AITasks|string|null $aiTasks = null, AwsAutoTagging|string|null $awsAutoTagging = null, GoogleAutoTagging|string|null $googleAutoTagging = null, RemoveBg|string|null $removeBg = null, @@ -73,6 +81,7 @@ public static function with( $self = new self; null !== $aiAutoDescription && $self['aiAutoDescription'] = $aiAutoDescription; + null !== $aiTasks && $self['aiTasks'] = $aiTasks; null !== $awsAutoTagging && $self['awsAutoTagging'] = $awsAutoTagging; null !== $googleAutoTagging && $self['googleAutoTagging'] = $googleAutoTagging; null !== $removeBg && $self['removeBg'] = $removeBg; @@ -92,6 +101,17 @@ public function withAIAutoDescription( return $self; } + /** + * @param AITasks|value-of $aiTasks + */ + public function withAITasks(AITasks|string $aiTasks): self + { + $self = clone $this; + $self['aiTasks'] = $aiTasks; + + return $self; + } + /** * @param AwsAutoTagging|value-of $awsAutoTagging */ diff --git a/src/Files/FileUploadResponse/ExtensionStatus/AITasks.php b/src/Files/FileUploadResponse/ExtensionStatus/AITasks.php new file mode 100644 index 00000000..be837d2b --- /dev/null +++ b/src/Files/FileUploadResponse/ExtensionStatus/AITasks.php @@ -0,0 +1,14 @@ +, + * aiTasks?: null|AITasks|value-of, * awsAutoTagging?: null|AwsAutoTagging|value-of, * googleAutoTagging?: null|GoogleAutoTagging|value-of, * removeBg?: null|RemoveBg|value-of, @@ -37,6 +39,10 @@ final class ExtensionStatus implements BaseModel #[Optional('ai-auto-description', enum: AIAutoDescription::class)] public ?string $aiAutoDescription; + /** @var value-of|null $aiTasks */ + #[Optional('ai-tasks', enum: AITasks::class)] + public ?string $aiTasks; + /** @var value-of|null $awsAutoTagging */ #[Optional('aws-auto-tagging', enum: AwsAutoTagging::class)] public ?string $awsAutoTagging; @@ -60,12 +66,14 @@ public function __construct() * You must use named parameters to construct any parameters with a default value. * * @param AIAutoDescription|value-of|null $aiAutoDescription + * @param AITasks|value-of|null $aiTasks * @param AwsAutoTagging|value-of|null $awsAutoTagging * @param GoogleAutoTagging|value-of|null $googleAutoTagging * @param RemoveBg|value-of|null $removeBg */ public static function with( AIAutoDescription|string|null $aiAutoDescription = null, + AITasks|string|null $aiTasks = null, AwsAutoTagging|string|null $awsAutoTagging = null, GoogleAutoTagging|string|null $googleAutoTagging = null, RemoveBg|string|null $removeBg = null, @@ -73,6 +81,7 @@ public static function with( $self = new self; null !== $aiAutoDescription && $self['aiAutoDescription'] = $aiAutoDescription; + null !== $aiTasks && $self['aiTasks'] = $aiTasks; null !== $awsAutoTagging && $self['awsAutoTagging'] = $awsAutoTagging; null !== $googleAutoTagging && $self['googleAutoTagging'] = $googleAutoTagging; null !== $removeBg && $self['removeBg'] = $removeBg; @@ -92,6 +101,17 @@ public function withAIAutoDescription( return $self; } + /** + * @param AITasks|value-of $aiTasks + */ + public function withAITasks(AITasks|string $aiTasks): self + { + $self = clone $this; + $self['aiTasks'] = $aiTasks; + + return $self; + } + /** * @param AwsAutoTagging|value-of $awsAutoTagging */ diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AITasks.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AITasks.php new file mode 100644 index 00000000..cd735a06 --- /dev/null +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AITasks.php @@ -0,0 +1,14 @@ + Date: Thu, 15 Jan 2026 11:38:42 +0000 Subject: [PATCH 125/193] chore(internal): minor test script reformatting --- scripts/test | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/test b/scripts/test index a8dc7cd3..4b777e01 100755 --- a/scripts/test +++ b/scripts/test @@ -10,7 +10,7 @@ YELLOW='\033[0;33m' NC='\033[0m' # No Color function prism_is_running() { - curl --silent "http://localhost:4010" > /dev/null 2>&1 + curl --silent "http://localhost:4010" >/dev/null 2>&1 } kill_server_on_port() { @@ -25,7 +25,7 @@ function is_overriding_api_base_url() { [ -n "$TEST_API_BASE_URL" ] } -if ! is_overriding_api_base_url && ! prism_is_running; then +if ! is_overriding_api_base_url && ! prism_is_running ; then # When we exit this script, make sure to kill the background mock server process trap 'kill_server_on_port 4010' EXIT @@ -33,10 +33,10 @@ if ! is_overriding_api_base_url && ! prism_is_running; then ./scripts/mock --daemon fi -if is_overriding_api_base_url; then +if is_overriding_api_base_url ; then echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" echo -elif ! prism_is_running; then +elif ! prism_is_running ; then echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" echo -e "running against your OpenAPI spec." echo From a08609804375fcbb528ca08b82cf935d7f6dddf5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 16 Jan 2026 18:32:40 +0000 Subject: [PATCH 126/193] chore(internal): update `actions/checkout` version --- .github/workflows/ci.yml | 4 ++-- .github/workflows/release-doctor.yml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index aed6777f..fb9e4769 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,7 @@ jobs: if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up PHP uses: 'shivammathur/setup-php@v2' @@ -38,7 +38,7 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/imagekit-php' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Set up PHP uses: 'shivammathur/setup-php@v2' diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index a4dc8763..1b0856b4 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -12,7 +12,7 @@ jobs: if: github.repository == 'stainless-sdks/imagekit-php' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@v6 - name: Check release environment run: | From a1f0a2c5c1867b9b6101d39eea7e8b70d32e34b9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 20 Jan 2026 06:11:34 +0000 Subject: [PATCH 127/193] fix: vocab field is required --- .stats.yml | 4 +- .../Task/AITaskSelectTags.php | 50 +++++++++---------- .../Task/AITaskSelectTags.php | 50 +++++++++---------- tests/Services/Beta/V2/FilesTest.php | 4 +- tests/Services/FilesTest.php | 4 +- 5 files changed, 56 insertions(+), 56 deletions(-) diff --git a/.stats.yml b/.stats.yml index dc3fb535..751099cf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-c028a7584d3508f268ce5c5b824b50af88eaa140620dd03a1b35f409f510603c.yml -openapi_spec_hash: f9b780b2398a87678a13355e48cd515f +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-84f0d75048a9268981a84800b4190e3691997ce57dcfc0876f38a5b3fce6bacd.yml +openapi_spec_hash: 35607d4e850c8a60524223ff632c83bb config_hash: aeb6eb949d73382270bbd8bbf2e4cf2a diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php index 0a0eb35d..2bbe6e7a 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php @@ -13,9 +13,9 @@ * @phpstan-type AITaskSelectTagsShape = array{ * instruction: string, * type: 'select_tags', - * vocabulary: list, * maxSelections?: int|null, * minSelections?: int|null, + * vocabulary?: list|null, * } */ final class AITaskSelectTags implements BaseModel @@ -37,14 +37,6 @@ final class AITaskSelectTags implements BaseModel #[Required] public string $instruction; - /** - * Array of possible tag values. Combined length of all strings must not exceed 500 characters. Cannot contain the `%` character. - * - * @var list $vocabulary - */ - #[Required(list: 'string')] - public array $vocabulary; - /** * Maximum number of tags to select from the vocabulary. */ @@ -57,18 +49,26 @@ final class AITaskSelectTags implements BaseModel #[Optional('min_selections')] public ?int $minSelections; + /** + * Array of possible tag values. Combined length of all strings must not exceed 500 characters. Cannot contain the `%` character. + * + * @var list|null $vocabulary + */ + #[Optional(list: 'string')] + public ?array $vocabulary; + /** * `new AITaskSelectTags()` is missing required properties by the API. * * To enforce required parameters use * ``` - * AITaskSelectTags::with(instruction: ..., vocabulary: ...) + * AITaskSelectTags::with(instruction: ...) * ``` * * Otherwise ensure the following setters are called * * ``` - * (new AITaskSelectTags)->withInstruction(...)->withVocabulary(...) + * (new AITaskSelectTags)->withInstruction(...) * ``` */ public function __construct() @@ -81,21 +81,21 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $vocabulary + * @param list|null $vocabulary */ public static function with( string $instruction, - array $vocabulary, ?int $maxSelections = null, ?int $minSelections = null, + ?array $vocabulary = null, ): self { $self = new self; $self['instruction'] = $instruction; - $self['vocabulary'] = $vocabulary; null !== $maxSelections && $self['maxSelections'] = $maxSelections; null !== $minSelections && $self['minSelections'] = $minSelections; + null !== $vocabulary && $self['vocabulary'] = $vocabulary; return $self; } @@ -112,36 +112,36 @@ public function withInstruction(string $instruction): self } /** - * Array of possible tag values. Combined length of all strings must not exceed 500 characters. Cannot contain the `%` character. - * - * @param list $vocabulary + * Maximum number of tags to select from the vocabulary. */ - public function withVocabulary(array $vocabulary): self + public function withMaxSelections(int $maxSelections): self { $self = clone $this; - $self['vocabulary'] = $vocabulary; + $self['maxSelections'] = $maxSelections; return $self; } /** - * Maximum number of tags to select from the vocabulary. + * Minimum number of tags to select from the vocabulary. */ - public function withMaxSelections(int $maxSelections): self + public function withMinSelections(int $minSelections): self { $self = clone $this; - $self['maxSelections'] = $maxSelections; + $self['minSelections'] = $minSelections; return $self; } /** - * Minimum number of tags to select from the vocabulary. + * Array of possible tag values. Combined length of all strings must not exceed 500 characters. Cannot contain the `%` character. + * + * @param list $vocabulary */ - public function withMinSelections(int $minSelections): self + public function withVocabulary(array $vocabulary): self { $self = clone $this; - $self['minSelections'] = $minSelections; + $self['vocabulary'] = $vocabulary; return $self; } diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php index 2cc93ed1..81c091fc 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php @@ -13,9 +13,9 @@ * @phpstan-type AITaskSelectTagsShape = array{ * instruction: string, * type: 'select_tags', - * vocabulary: list, * maxSelections?: int|null, * minSelections?: int|null, + * vocabulary?: list|null, * } */ final class AITaskSelectTags implements BaseModel @@ -37,14 +37,6 @@ final class AITaskSelectTags implements BaseModel #[Required] public string $instruction; - /** - * Array of possible tag values. Combined length of all strings must not exceed 500 characters. Cannot contain the `%` character. - * - * @var list $vocabulary - */ - #[Required(list: 'string')] - public array $vocabulary; - /** * Maximum number of tags to select from the vocabulary. */ @@ -57,18 +49,26 @@ final class AITaskSelectTags implements BaseModel #[Optional('min_selections')] public ?int $minSelections; + /** + * Array of possible tag values. Combined length of all strings must not exceed 500 characters. Cannot contain the `%` character. + * + * @var list|null $vocabulary + */ + #[Optional(list: 'string')] + public ?array $vocabulary; + /** * `new AITaskSelectTags()` is missing required properties by the API. * * To enforce required parameters use * ``` - * AITaskSelectTags::with(instruction: ..., vocabulary: ...) + * AITaskSelectTags::with(instruction: ...) * ``` * * Otherwise ensure the following setters are called * * ``` - * (new AITaskSelectTags)->withInstruction(...)->withVocabulary(...) + * (new AITaskSelectTags)->withInstruction(...) * ``` */ public function __construct() @@ -81,21 +81,21 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param list $vocabulary + * @param list|null $vocabulary */ public static function with( string $instruction, - array $vocabulary, ?int $maxSelections = null, ?int $minSelections = null, + ?array $vocabulary = null, ): self { $self = new self; $self['instruction'] = $instruction; - $self['vocabulary'] = $vocabulary; null !== $maxSelections && $self['maxSelections'] = $maxSelections; null !== $minSelections && $self['minSelections'] = $minSelections; + null !== $vocabulary && $self['vocabulary'] = $vocabulary; return $self; } @@ -112,36 +112,36 @@ public function withInstruction(string $instruction): self } /** - * Array of possible tag values. Combined length of all strings must not exceed 500 characters. Cannot contain the `%` character. - * - * @param list $vocabulary + * Maximum number of tags to select from the vocabulary. */ - public function withVocabulary(array $vocabulary): self + public function withMaxSelections(int $maxSelections): self { $self = clone $this; - $self['vocabulary'] = $vocabulary; + $self['maxSelections'] = $maxSelections; return $self; } /** - * Maximum number of tags to select from the vocabulary. + * Minimum number of tags to select from the vocabulary. */ - public function withMaxSelections(int $maxSelections): self + public function withMinSelections(int $minSelections): self { $self = clone $this; - $self['maxSelections'] = $maxSelections; + $self['minSelections'] = $minSelections; return $self; } /** - * Minimum number of tags to select from the vocabulary. + * Array of possible tag values. Combined length of all strings must not exceed 500 characters. Cannot contain the `%` character. + * + * @param list $vocabulary */ - public function withMinSelections(int $minSelections): self + public function withVocabulary(array $vocabulary): self { $self = clone $this; - $self['minSelections'] = $minSelections; + $self['vocabulary'] = $vocabulary; return $self; } diff --git a/tests/Services/Beta/V2/FilesTest.php b/tests/Services/Beta/V2/FilesTest.php index 2a96394a..bde2ece7 100644 --- a/tests/Services/Beta/V2/FilesTest.php +++ b/tests/Services/Beta/V2/FilesTest.php @@ -82,11 +82,11 @@ public function testUploadWithOptionalParams(): void [ 'instruction' => 'What types of clothing items are visible in this image?', 'type' => 'select_tags', + 'maxSelections' => 1, + 'minSelections' => 0, 'vocabulary' => [ 'shirt', 'tshirt', 'dress', 'trousers', 'jacket', ], - 'maxSelections' => 1, - 'minSelections' => 0, ], [ 'instruction' => 'Is this a luxury or high-end fashion item?', diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index e9b53aea..61b545ed 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -222,11 +222,11 @@ public function testUploadWithOptionalParams(): void [ 'instruction' => 'What types of clothing items are visible in this image?', 'type' => 'select_tags', + 'maxSelections' => 1, + 'minSelections' => 0, 'vocabulary' => [ 'shirt', 'tshirt', 'dress', 'trousers', 'jacket', ], - 'maxSelections' => 1, - 'minSelections' => 0, ], [ 'instruction' => 'Is this a luxury or high-end fashion item?', From 5b9a60764c121078ddebc742a9f1787b8d5dac1a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 20 Jan 2026 11:35:53 +0000 Subject: [PATCH 128/193] chore(internal): update phpstan comments --- src/Core/BaseClient.php | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/Core/BaseClient.php b/src/Core/BaseClient.php index 7a4436d6..30bef2e3 100644 --- a/src/Core/BaseClient.php +++ b/src/Core/BaseClient.php @@ -71,8 +71,17 @@ public function request( ?string $stream = null, RequestOptions|array|null $options = [], ): BaseResponse { - // @phpstan-ignore-next-line - [$req, $opts] = $this->buildRequest(method: $method, path: $path, query: $query, headers: $headers, body: $body, opts: $options); + [$req, $opts] = $this->buildRequest( + method: $method, + // @phpstan-ignore argument.type + path: $path, + query: $query, + // @phpstan-ignore argument.type + headers: $headers, + body: $body, + // @phpstan-ignore argument.type + opts: $options, + ); ['method' => $method, 'path' => $uri, 'headers' => $headers, 'body' => $data] = $req; assert(!is_null($opts->requestFactory)); From 65b995aa83c6cf09fa55f784cf06fd3c8f95c0ff Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 20 Jan 2026 15:46:40 +0000 Subject: [PATCH 129/193] chore(internal): codegen related update --- src/Core/Attributes/Api.php | 66 +++++++ src/Core/Concerns/SdkResponse.php | 29 +++ .../Contracts/ResponseConverter.php | 18 ++ src/Core/Implementation/Omit.php | 13 ++ tests/Core/TestModel.php | 181 ++++++++++++++++++ 5 files changed, 307 insertions(+) create mode 100644 src/Core/Attributes/Api.php create mode 100644 src/Core/Concerns/SdkResponse.php create mode 100644 src/Core/Conversion/Contracts/ResponseConverter.php create mode 100644 src/Core/Implementation/Omit.php create mode 100644 tests/Core/TestModel.php diff --git a/src/Core/Attributes/Api.php b/src/Core/Attributes/Api.php new file mode 100644 index 00000000..3ed05474 --- /dev/null +++ b/src/Core/Attributes/Api.php @@ -0,0 +1,66 @@ +|Converter|string|null */ + public readonly Converter|string|null $type; + + /** @var array */ + private static array $enumConverters = []; + + /** + * @param class-string|Converter|string|null $type + * @param class-string<\BackedEnum>|Converter|null $enum + * @param class-string|Converter|null $union + * @param class-string|Converter|string|null $list + * @param class-string|Converter|string|null $map + */ + public function __construct( + public readonly ?string $apiName = null, + Converter|string|null $type = null, + Converter|string|null $enum = null, + Converter|string|null $union = null, + Converter|string|null $list = null, + Converter|string|null $map = null, + public readonly bool $nullable = false, + public readonly bool $optional = false, + ) { + $type ??= $union; + if (null !== $list) { + $type ??= new ListOf($list); + } + if (null !== $map) { + $type ??= new MapOf($map); + } + if (null !== $enum) { + $type ??= $enum instanceof Converter ? $enum : $this->getEnumConverter($enum); + } + + $this->type = $type; + } + + /** @property class-string<\BackedEnum> $enum */ + private function getEnumConverter(string $enum): Converter + { + if (!isset(self::$enumConverters[$enum])) { + $converter = new EnumOf(array_column($enum::cases(), 'value')); // @phpstan-ignore-line + self::$enumConverters[$enum] = $converter; + } + + return self::$enumConverters[$enum]; + } +} diff --git a/src/Core/Concerns/SdkResponse.php b/src/Core/Concerns/SdkResponse.php new file mode 100644 index 00000000..ddc05f1f --- /dev/null +++ b/src/Core/Concerns/SdkResponse.php @@ -0,0 +1,29 @@ +_rawResponse = $response; + $instance->__unserialize(Util::decodeContent($response)); // @phpstan-ignore-line + + return $instance; + } + + public function getRawResponse(): ?ResponseInterface + { + return $this->_rawResponse; + } +} diff --git a/src/Core/Conversion/Contracts/ResponseConverter.php b/src/Core/Conversion/Contracts/ResponseConverter.php new file mode 100644 index 00000000..593282df --- /dev/null +++ b/src/Core/Conversion/Contracts/ResponseConverter.php @@ -0,0 +1,18 @@ +> */ + use SdkModel; + + #[Required] + public string $name; + + #[Required('age_years')] + public int $ageYears; + + /** @var list|null */ + #[Optional] + public ?array $friends; + + #[Required] + public ?string $owner; + + /** + * @param list|null $friends + */ + public function __construct( + string $name, + int $ageYears, + ?string $owner, + ?array $friends = null, + ) { + $this->initialize(); + + $this->name = $name; + $this->ageYears = $ageYears; + $this->owner = $owner; + + null != $friends && $this->friends = $friends; + } +} + +/** + * @internal + * + * @coversNothing + */ +#[CoversNothing] +class TestModelTest extends TestCase +{ + #[Test] + public function testBasicGetAndSet(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertEquals(12, $model->ageYears); + + ++$model->ageYears; + $this->assertEquals(13, $model->ageYears); + } + + #[Test] + public function testNullAccess(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertNull($model->owner); + $this->assertNull($model->friends); + } + + #[Test] + public function testArrayGetAndSet(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $model->friends ??= []; + $this->assertEquals([], $model->friends); + $model->friends[] = 'Alice'; + $this->assertEquals(['Alice'], $model->friends); + } + + #[Test] + public function testDiscernsBetweenNullAndUnset(): void + { + $modelUnsetFriends = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $modelNullFriends = new TestModel( + name: 'bob', + ageYears: 12, + owner: null, + ); + $modelNullFriends->friends = null; + + $this->assertEquals(12, $modelUnsetFriends->ageYears); + $this->assertEquals(12, $modelNullFriends->ageYears); + + $this->assertTrue($modelUnsetFriends->offsetExists('ageYears')); + $this->assertTrue($modelNullFriends->offsetExists('ageYears')); + + $this->assertNull($modelUnsetFriends->friends); + $this->assertNull($modelNullFriends->friends); + + $this->assertFalse($modelUnsetFriends->offsetExists('friends')); + $this->assertTrue($modelNullFriends->offsetExists('friends')); + } + + #[Test] + public function testIssetOnOmittedProperties(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertFalse(isset($model->owner)); + $this->assertFalse(isset($model->friends)); + } + + #[Test] + public function testSerializeBasicModel(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: 'Eve', + friends: ['Alice', 'Charlie'], + ); + $this->assertEquals( + '{"name":"Bob","age_years":12,"friends":["Alice","Charlie"],"owner":"Eve"}', + json_encode($model) + ); + } + + #[Test] + public function testSerializeModelWithOmittedProperties(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $this->assertEquals( + '{"name":"Bob","age_years":12,"owner":null}', + json_encode($model) + ); + } + + #[Test] + public function testSerializeModelWithExplicitNull(): void + { + $model = new TestModel( + name: 'Bob', + ageYears: 12, + owner: null, + ); + $model->friends = null; + $this->assertEquals( + '{"name":"Bob","age_years":12,"friends":null,"owner":null}', + json_encode($model) + ); + } +} From 32cccc6bf639fb685938afb689b46f5b65106c12 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 20 Jan 2026 18:09:52 +0000 Subject: [PATCH 130/193] chore(internal): codegen related update --- src/Core/Attributes/Api.php | 66 ------- src/Core/Concerns/SdkResponse.php | 29 --- .../Contracts/ResponseConverter.php | 18 -- src/Core/Implementation/Omit.php | 13 -- tests/Core/TestModel.php | 181 ------------------ 5 files changed, 307 deletions(-) delete mode 100644 src/Core/Attributes/Api.php delete mode 100644 src/Core/Concerns/SdkResponse.php delete mode 100644 src/Core/Conversion/Contracts/ResponseConverter.php delete mode 100644 src/Core/Implementation/Omit.php delete mode 100644 tests/Core/TestModel.php diff --git a/src/Core/Attributes/Api.php b/src/Core/Attributes/Api.php deleted file mode 100644 index 3ed05474..00000000 --- a/src/Core/Attributes/Api.php +++ /dev/null @@ -1,66 +0,0 @@ -|Converter|string|null */ - public readonly Converter|string|null $type; - - /** @var array */ - private static array $enumConverters = []; - - /** - * @param class-string|Converter|string|null $type - * @param class-string<\BackedEnum>|Converter|null $enum - * @param class-string|Converter|null $union - * @param class-string|Converter|string|null $list - * @param class-string|Converter|string|null $map - */ - public function __construct( - public readonly ?string $apiName = null, - Converter|string|null $type = null, - Converter|string|null $enum = null, - Converter|string|null $union = null, - Converter|string|null $list = null, - Converter|string|null $map = null, - public readonly bool $nullable = false, - public readonly bool $optional = false, - ) { - $type ??= $union; - if (null !== $list) { - $type ??= new ListOf($list); - } - if (null !== $map) { - $type ??= new MapOf($map); - } - if (null !== $enum) { - $type ??= $enum instanceof Converter ? $enum : $this->getEnumConverter($enum); - } - - $this->type = $type; - } - - /** @property class-string<\BackedEnum> $enum */ - private function getEnumConverter(string $enum): Converter - { - if (!isset(self::$enumConverters[$enum])) { - $converter = new EnumOf(array_column($enum::cases(), 'value')); // @phpstan-ignore-line - self::$enumConverters[$enum] = $converter; - } - - return self::$enumConverters[$enum]; - } -} diff --git a/src/Core/Concerns/SdkResponse.php b/src/Core/Concerns/SdkResponse.php deleted file mode 100644 index ddc05f1f..00000000 --- a/src/Core/Concerns/SdkResponse.php +++ /dev/null @@ -1,29 +0,0 @@ -_rawResponse = $response; - $instance->__unserialize(Util::decodeContent($response)); // @phpstan-ignore-line - - return $instance; - } - - public function getRawResponse(): ?ResponseInterface - { - return $this->_rawResponse; - } -} diff --git a/src/Core/Conversion/Contracts/ResponseConverter.php b/src/Core/Conversion/Contracts/ResponseConverter.php deleted file mode 100644 index 593282df..00000000 --- a/src/Core/Conversion/Contracts/ResponseConverter.php +++ /dev/null @@ -1,18 +0,0 @@ -> */ - use SdkModel; - - #[Required] - public string $name; - - #[Required('age_years')] - public int $ageYears; - - /** @var list|null */ - #[Optional] - public ?array $friends; - - #[Required] - public ?string $owner; - - /** - * @param list|null $friends - */ - public function __construct( - string $name, - int $ageYears, - ?string $owner, - ?array $friends = null, - ) { - $this->initialize(); - - $this->name = $name; - $this->ageYears = $ageYears; - $this->owner = $owner; - - null != $friends && $this->friends = $friends; - } -} - -/** - * @internal - * - * @coversNothing - */ -#[CoversNothing] -class TestModelTest extends TestCase -{ - #[Test] - public function testBasicGetAndSet(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $this->assertEquals(12, $model->ageYears); - - ++$model->ageYears; - $this->assertEquals(13, $model->ageYears); - } - - #[Test] - public function testNullAccess(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $this->assertNull($model->owner); - $this->assertNull($model->friends); - } - - #[Test] - public function testArrayGetAndSet(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $model->friends ??= []; - $this->assertEquals([], $model->friends); - $model->friends[] = 'Alice'; - $this->assertEquals(['Alice'], $model->friends); - } - - #[Test] - public function testDiscernsBetweenNullAndUnset(): void - { - $modelUnsetFriends = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $modelNullFriends = new TestModel( - name: 'bob', - ageYears: 12, - owner: null, - ); - $modelNullFriends->friends = null; - - $this->assertEquals(12, $modelUnsetFriends->ageYears); - $this->assertEquals(12, $modelNullFriends->ageYears); - - $this->assertTrue($modelUnsetFriends->offsetExists('ageYears')); - $this->assertTrue($modelNullFriends->offsetExists('ageYears')); - - $this->assertNull($modelUnsetFriends->friends); - $this->assertNull($modelNullFriends->friends); - - $this->assertFalse($modelUnsetFriends->offsetExists('friends')); - $this->assertTrue($modelNullFriends->offsetExists('friends')); - } - - #[Test] - public function testIssetOnOmittedProperties(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $this->assertFalse(isset($model->owner)); - $this->assertFalse(isset($model->friends)); - } - - #[Test] - public function testSerializeBasicModel(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: 'Eve', - friends: ['Alice', 'Charlie'], - ); - $this->assertEquals( - '{"name":"Bob","age_years":12,"friends":["Alice","Charlie"],"owner":"Eve"}', - json_encode($model) - ); - } - - #[Test] - public function testSerializeModelWithOmittedProperties(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $this->assertEquals( - '{"name":"Bob","age_years":12,"owner":null}', - json_encode($model) - ); - } - - #[Test] - public function testSerializeModelWithExplicitNull(): void - { - $model = new TestModel( - name: 'Bob', - ageYears: 12, - owner: null, - ); - $model->friends = null; - $this->assertEquals( - '{"name":"Bob","age_years":12,"friends":null,"owner":null}', - json_encode($model) - ); - } -} From b4e1ec501e891d24764896f3d70a259e2abfd076 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 28 Jan 2026 07:55:25 +0000 Subject: [PATCH 131/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 751099cf..011cf609 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-84f0d75048a9268981a84800b4190e3691997ce57dcfc0876f38a5b3fce6bacd.yml openapi_spec_hash: 35607d4e850c8a60524223ff632c83bb -config_hash: aeb6eb949d73382270bbd8bbf2e4cf2a +config_hash: 47cb702ee2cb52c58d803ae39ade9b44 From 8e06db7959b044ab844db8eb2ca530740f01b084 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 29 Jan 2026 19:21:52 +0000 Subject: [PATCH 132/193] chore(internal): ignore stainless-internal artifacts --- .gitignore | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.gitignore b/.gitignore index 08cb4798..71d6d159 100644 --- a/.gitignore +++ b/.gitignore @@ -8,3 +8,6 @@ playground/ *.swo *.swp vendor/ + +# do not edit! excludes generated files used internally +.artifacts/ From 2a1cdf802ce25941729d92632ac88ec11d708fda Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 18:12:43 +0000 Subject: [PATCH 133/193] feat: add setters to constant parameters --- src/Accounts/Origins/OriginCreateParams.php | 11 +++++++++++ src/Accounts/Origins/OriginRequest/AkeneoPim.php | 11 +++++++++++ .../Origins/OriginRequest/AzureBlobStorage.php | 11 +++++++++++ .../Origins/OriginRequest/CloudinaryBackup.php | 11 +++++++++++ .../Origins/OriginRequest/GoogleCloudStorageGcs.php | 11 +++++++++++ src/Accounts/Origins/OriginRequest/S3.php | 11 +++++++++++ src/Accounts/Origins/OriginRequest/S3Compatible.php | 11 +++++++++++ src/Accounts/Origins/OriginRequest/WebFolder.php | 11 +++++++++++ src/Accounts/Origins/OriginRequest/WebProxy.php | 11 +++++++++++ src/Accounts/Origins/OriginResponse/AkeneoPim.php | 11 +++++++++++ .../Origins/OriginResponse/AzureBlobStorage.php | 11 +++++++++++ .../Origins/OriginResponse/CloudinaryBackup.php | 11 +++++++++++ .../OriginResponse/GoogleCloudStorageGcs.php | 11 +++++++++++ src/Accounts/Origins/OriginResponse/S3.php | 11 +++++++++++ .../Origins/OriginResponse/S3Compatible.php | 11 +++++++++++ src/Accounts/Origins/OriginResponse/WebFolder.php | 11 +++++++++++ src/Accounts/Origins/OriginResponse/WebProxy.php | 11 +++++++++++ src/Accounts/Origins/OriginUpdateParams.php | 11 +++++++++++ .../URLRewriter/AkamaiURLRewriter.php | 11 +++++++++++ .../URLRewriter/CloudinaryURLRewriter.php | 11 +++++++++++ .../URLRewriter/ImgixURLRewriter.php | 11 +++++++++++ .../URLRewriter/AkamaiURLRewriter.php | 11 +++++++++++ .../URLRewriter/CloudinaryURLRewriter.php | 11 +++++++++++ .../URLRewriter/ImgixURLRewriter.php | 11 +++++++++++ .../URLRewriter/AkamaiURLRewriter.php | 11 +++++++++++ .../URLRewriter/CloudinaryURLRewriter.php | 11 +++++++++++ .../URLRewriter/ImgixURLRewriter.php | 11 +++++++++++ .../URLRewriter/AkamaiURLRewriter.php | 11 +++++++++++ .../URLRewriter/CloudinaryURLRewriter.php | 11 +++++++++++ .../URLRewriter/ImgixURLRewriter.php | 11 +++++++++++ .../Post/AdaptiveBitrateStreaming.php | 13 +++++++++++++ .../Transformation/Post/ConvertGifToVideo.php | 13 +++++++++++++ .../Transformation/Post/GenerateAThumbnail.php | 13 +++++++++++++ .../Post/SimplePostTransformation.php | 13 +++++++++++++ src/ExtensionConfig/AITasksExtension.php | 13 +++++++++++++ .../AITasksExtension/Task/AITaskSelectMetadata.php | 13 +++++++++++++ .../AITasksExtension/Task/AITaskSelectTags.php | 13 +++++++++++++ .../AITasksExtension/Task/AITaskYesNo.php | 13 +++++++++++++ src/ExtensionConfig/AutoDescriptionExtension.php | 13 +++++++++++++ src/ExtensionConfig/RemovedotBgExtension.php | 13 +++++++++++++ src/ExtensionItem/AITasksExtension.php | 13 +++++++++++++ .../AITasksExtension/Task/AITaskSelectMetadata.php | 13 +++++++++++++ .../AITasksExtension/Task/AITaskSelectTags.php | 13 +++++++++++++ .../AITasksExtension/Task/AITaskYesNo.php | 13 +++++++++++++ src/ExtensionItem/AutoDescriptionExtension.php | 13 +++++++++++++ src/ExtensionItem/RemovedotBgExtension.php | 13 +++++++++++++ src/ExtensionItem/SavedExtensionReference.php | 13 +++++++++++++ .../Post/AdaptiveBitrateStreaming.php | 13 +++++++++++++ .../Transformation/Post/ConvertGifToVideo.php | 13 +++++++++++++ .../Transformation/Post/GenerateAThumbnail.php | 13 +++++++++++++ .../Post/SimplePostTransformation.php | 13 +++++++++++++ src/ImageOverlay.php | 11 +++++++++++ src/SolidColorOverlay.php | 11 +++++++++++ src/SubtitleOverlay.php | 11 +++++++++++ src/TextOverlay.php | 11 +++++++++++ src/VideoOverlay.php | 11 +++++++++++ 56 files changed, 658 insertions(+) diff --git a/src/Accounts/Origins/OriginCreateParams.php b/src/Accounts/Origins/OriginCreateParams.php index 6225eaab..46e443f8 100644 --- a/src/Accounts/Origins/OriginCreateParams.php +++ b/src/Accounts/Origins/OriginCreateParams.php @@ -253,6 +253,17 @@ public static function with( return $self; } + /** + * @param 'AKENEO_PIM' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * Access key for the bucket. */ diff --git a/src/Accounts/Origins/OriginRequest/AkeneoPim.php b/src/Accounts/Origins/OriginRequest/AkeneoPim.php index 7e474089..4712b85a 100644 --- a/src/Accounts/Origins/OriginRequest/AkeneoPim.php +++ b/src/Accounts/Origins/OriginRequest/AkeneoPim.php @@ -196,6 +196,17 @@ public function withPassword(string $password): self return $self; } + /** + * @param 'AKENEO_PIM' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * Akeneo API username. */ diff --git a/src/Accounts/Origins/OriginRequest/AzureBlobStorage.php b/src/Accounts/Origins/OriginRequest/AzureBlobStorage.php index c15c2428..dd94f496 100644 --- a/src/Accounts/Origins/OriginRequest/AzureBlobStorage.php +++ b/src/Accounts/Origins/OriginRequest/AzureBlobStorage.php @@ -148,6 +148,17 @@ public function withSasToken(string $sasToken): self return $self; } + /** + * @param 'AZURE_BLOB' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * URL used in the Canonical header (if enabled). */ diff --git a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php index 1be1b7ba..a61e3d98 100644 --- a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php @@ -167,6 +167,17 @@ public function withSecretKey(string $secretKey): self return $self; } + /** + * @param 'CLOUDINARY_BACKUP' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * URL used in the Canonical header (if enabled). */ diff --git a/src/Accounts/Origins/OriginRequest/GoogleCloudStorageGcs.php b/src/Accounts/Origins/OriginRequest/GoogleCloudStorageGcs.php index deb33ed1..1e66df4f 100644 --- a/src/Accounts/Origins/OriginRequest/GoogleCloudStorageGcs.php +++ b/src/Accounts/Origins/OriginRequest/GoogleCloudStorageGcs.php @@ -148,6 +148,17 @@ public function withPrivateKey(string $privateKey): self return $self; } + /** + * @param 'GCS' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * URL used in the Canonical header (if enabled). */ diff --git a/src/Accounts/Origins/OriginRequest/S3.php b/src/Accounts/Origins/OriginRequest/S3.php index f7e25b5d..53896f45 100644 --- a/src/Accounts/Origins/OriginRequest/S3.php +++ b/src/Accounts/Origins/OriginRequest/S3.php @@ -163,6 +163,17 @@ public function withSecretKey(string $secretKey): self return $self; } + /** + * @param 'S3' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * URL used in the Canonical header (if enabled). */ diff --git a/src/Accounts/Origins/OriginRequest/S3Compatible.php b/src/Accounts/Origins/OriginRequest/S3Compatible.php index 6ea62486..3daec53e 100644 --- a/src/Accounts/Origins/OriginRequest/S3Compatible.php +++ b/src/Accounts/Origins/OriginRequest/S3Compatible.php @@ -199,6 +199,17 @@ public function withSecretKey(string $secretKey): self return $self; } + /** + * @param 'S3_COMPATIBLE' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * URL used in the Canonical header (if enabled). */ diff --git a/src/Accounts/Origins/OriginRequest/WebFolder.php b/src/Accounts/Origins/OriginRequest/WebFolder.php index 50dd74f5..658aa97e 100644 --- a/src/Accounts/Origins/OriginRequest/WebFolder.php +++ b/src/Accounts/Origins/OriginRequest/WebFolder.php @@ -123,6 +123,17 @@ public function withName(string $name): self return $self; } + /** + * @param 'WEB_FOLDER' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * URL used in the Canonical header (if enabled). */ diff --git a/src/Accounts/Origins/OriginRequest/WebProxy.php b/src/Accounts/Origins/OriginRequest/WebProxy.php index 9b0c48bd..d6d78325 100644 --- a/src/Accounts/Origins/OriginRequest/WebProxy.php +++ b/src/Accounts/Origins/OriginRequest/WebProxy.php @@ -94,6 +94,17 @@ public function withName(string $name): self return $self; } + /** + * @param 'WEB_PROXY' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * URL used in the Canonical header (if enabled). */ diff --git a/src/Accounts/Origins/OriginResponse/AkeneoPim.php b/src/Accounts/Origins/OriginResponse/AkeneoPim.php index 0420eb23..cd4e3964 100644 --- a/src/Accounts/Origins/OriginResponse/AkeneoPim.php +++ b/src/Accounts/Origins/OriginResponse/AkeneoPim.php @@ -150,6 +150,17 @@ public function withName(string $name): self return $self; } + /** + * @param 'AKENEO_PIM' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * URL used in the Canonical header (if enabled). */ diff --git a/src/Accounts/Origins/OriginResponse/AzureBlobStorage.php b/src/Accounts/Origins/OriginResponse/AzureBlobStorage.php index 2e59f273..d3d9890b 100644 --- a/src/Accounts/Origins/OriginResponse/AzureBlobStorage.php +++ b/src/Accounts/Origins/OriginResponse/AzureBlobStorage.php @@ -181,6 +181,17 @@ public function withPrefix(string $prefix): self return $self; } + /** + * @param 'AZURE_BLOB' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * URL used in the Canonical header (if enabled). */ diff --git a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php index ee8073a2..8d3e82ab 100644 --- a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php @@ -173,6 +173,17 @@ public function withPrefix(string $prefix): self return $self; } + /** + * @param 'CLOUDINARY_BACKUP' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * URL used in the Canonical header (if enabled). */ diff --git a/src/Accounts/Origins/OriginResponse/GoogleCloudStorageGcs.php b/src/Accounts/Origins/OriginResponse/GoogleCloudStorageGcs.php index 9603dafc..f68266f6 100644 --- a/src/Accounts/Origins/OriginResponse/GoogleCloudStorageGcs.php +++ b/src/Accounts/Origins/OriginResponse/GoogleCloudStorageGcs.php @@ -181,6 +181,17 @@ public function withPrefix(string $prefix): self return $self; } + /** + * @param 'GCS' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * URL used in the Canonical header (if enabled). */ diff --git a/src/Accounts/Origins/OriginResponse/S3.php b/src/Accounts/Origins/OriginResponse/S3.php index 5f3a092c..2482bae3 100644 --- a/src/Accounts/Origins/OriginResponse/S3.php +++ b/src/Accounts/Origins/OriginResponse/S3.php @@ -173,6 +173,17 @@ public function withPrefix(string $prefix): self return $self; } + /** + * @param 'S3' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * URL used in the Canonical header (if enabled). */ diff --git a/src/Accounts/Origins/OriginResponse/S3Compatible.php b/src/Accounts/Origins/OriginResponse/S3Compatible.php index c38b8eb5..392e79d6 100644 --- a/src/Accounts/Origins/OriginResponse/S3Compatible.php +++ b/src/Accounts/Origins/OriginResponse/S3Compatible.php @@ -221,6 +221,17 @@ public function withS3ForcePathStyle(bool $s3ForcePathStyle): self return $self; } + /** + * @param 'S3_COMPATIBLE' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * URL used in the Canonical header (if enabled). */ diff --git a/src/Accounts/Origins/OriginResponse/WebFolder.php b/src/Accounts/Origins/OriginResponse/WebFolder.php index 6698f921..d04074f4 100644 --- a/src/Accounts/Origins/OriginResponse/WebFolder.php +++ b/src/Accounts/Origins/OriginResponse/WebFolder.php @@ -178,6 +178,17 @@ public function withName(string $name): self return $self; } + /** + * @param 'WEB_FOLDER' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * URL used in the Canonical header (if enabled). */ diff --git a/src/Accounts/Origins/OriginResponse/WebProxy.php b/src/Accounts/Origins/OriginResponse/WebProxy.php index bb914556..cc92822d 100644 --- a/src/Accounts/Origins/OriginResponse/WebProxy.php +++ b/src/Accounts/Origins/OriginResponse/WebProxy.php @@ -126,6 +126,17 @@ public function withName(string $name): self return $self; } + /** + * @param 'WEB_PROXY' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * URL used in the Canonical header (if enabled). */ diff --git a/src/Accounts/Origins/OriginUpdateParams.php b/src/Accounts/Origins/OriginUpdateParams.php index 854f7834..eca8811e 100644 --- a/src/Accounts/Origins/OriginUpdateParams.php +++ b/src/Accounts/Origins/OriginUpdateParams.php @@ -253,6 +253,17 @@ public static function with( return $self; } + /** + * @param 'AKENEO_PIM' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * Access key for the bucket. */ diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/AkamaiURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/AkamaiURLRewriter.php index 9c5f02f5..ce09c4a1 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/AkamaiURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/AkamaiURLRewriter.php @@ -34,4 +34,15 @@ public static function with(): self { return new self; } + + /** + * @param 'AKAMAI' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } } diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/CloudinaryURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/CloudinaryURLRewriter.php index ea434fc5..47303cef 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/CloudinaryURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/CloudinaryURLRewriter.php @@ -48,6 +48,17 @@ public static function with(?bool $preserveAssetDeliveryTypes = null): self return $self; } + /** + * @param 'CLOUDINARY' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * Whether to preserve `/` in the rewritten URL. */ diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/ImgixURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/ImgixURLRewriter.php index d8c4c34c..9972235f 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/ImgixURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/ImgixURLRewriter.php @@ -34,4 +34,15 @@ public static function with(): self { return new self; } + + /** + * @param 'IMGIX' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } } diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/AkamaiURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/AkamaiURLRewriter.php index 02464861..4b254a04 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/AkamaiURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/AkamaiURLRewriter.php @@ -34,4 +34,15 @@ public static function with(): self { return new self; } + + /** + * @param 'AKAMAI' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } } diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/CloudinaryURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/CloudinaryURLRewriter.php index 51c78f1d..d2c51792 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/CloudinaryURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/CloudinaryURLRewriter.php @@ -48,6 +48,17 @@ public static function with(?bool $preserveAssetDeliveryTypes = null): self return $self; } + /** + * @param 'CLOUDINARY' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * Whether to preserve `/` in the rewritten URL. */ diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/ImgixURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/ImgixURLRewriter.php index 805c184d..5990df7b 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/ImgixURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/ImgixURLRewriter.php @@ -34,4 +34,15 @@ public static function with(): self { return new self; } + + /** + * @param 'IMGIX' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } } diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/AkamaiURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/AkamaiURLRewriter.php index 49c6e64a..bb12c17e 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/AkamaiURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/AkamaiURLRewriter.php @@ -34,4 +34,15 @@ public static function with(): self { return new self; } + + /** + * @param 'AKAMAI' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } } diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/CloudinaryURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/CloudinaryURLRewriter.php index eb118b3d..bc03162f 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/CloudinaryURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/CloudinaryURLRewriter.php @@ -72,4 +72,15 @@ public function withPreserveAssetDeliveryTypes( return $self; } + + /** + * @param 'CLOUDINARY' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } } diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/ImgixURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/ImgixURLRewriter.php index 0f122330..a0acd6d7 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/ImgixURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/ImgixURLRewriter.php @@ -34,4 +34,15 @@ public static function with(): self { return new self; } + + /** + * @param 'IMGIX' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } } diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/AkamaiURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/AkamaiURLRewriter.php index fc24126c..36724a05 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/AkamaiURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/AkamaiURLRewriter.php @@ -34,4 +34,15 @@ public static function with(): self { return new self; } + + /** + * @param 'AKAMAI' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } } diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/CloudinaryURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/CloudinaryURLRewriter.php index a973fd8e..fd9829b7 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/CloudinaryURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/CloudinaryURLRewriter.php @@ -48,6 +48,17 @@ public static function with(?bool $preserveAssetDeliveryTypes = null): self return $self; } + /** + * @param 'CLOUDINARY' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * Whether to preserve `/` in the rewritten URL. */ diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/ImgixURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/ImgixURLRewriter.php index 02872eeb..d538c3fc 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/ImgixURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/ImgixURLRewriter.php @@ -34,4 +34,15 @@ public static function with(): self { return new self; } + + /** + * @param 'IMGIX' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } } diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php index 1c2df6dc..98267546 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php @@ -90,6 +90,19 @@ public function withProtocol(Protocol|string $protocol): self return $self; } + /** + * Adaptive Bitrate Streaming (ABS) setup. + * + * @param 'abs' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * List of different representations you want to create separated by an underscore. */ diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php index 613ac667..c3c1b4fc 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php @@ -53,6 +53,19 @@ public static function with(?string $value = null): self return $self; } + /** + * Converts an animated GIF into an MP4. + * + * @param 'gif-to-video' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * Optional transformation string to apply to the output video. * **Example**: `q-80`. diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php index 09321e61..d1ebd5fa 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php @@ -53,6 +53,19 @@ public static function with(?string $value = null): self return $self; } + /** + * Generates a thumbnail image. + * + * @param 'thumbnail' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * Optional transformation string. * **Example**: `w-150,h-150`. diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php index d30dd815..d8038387 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php @@ -66,6 +66,19 @@ public static function with(string $value): self return $self; } + /** + * Transformation type. + * + * @param 'transformation' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * Transformation string (e.g. `w-200,h-200`). * Same syntax as ImageKit URL-based transformations. diff --git a/src/ExtensionConfig/AITasksExtension.php b/src/ExtensionConfig/AITasksExtension.php index f952bcfc..5a808c61 100644 --- a/src/ExtensionConfig/AITasksExtension.php +++ b/src/ExtensionConfig/AITasksExtension.php @@ -73,6 +73,19 @@ public static function with(array $tasks): self return $self; } + /** + * Specifies the AI tasks extension for automated image analysis using AI models. + * + * @param 'ai-tasks' $name + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } + /** * Array of task objects defining AI operations to perform on the asset. * diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata.php index c6cbd13d..2ca98efa 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata.php @@ -135,6 +135,19 @@ public function withInstruction(string $instruction): self return $self; } + /** + * Task type that analyzes the image and sets a custom metadata field value from a vocabulary. + * + * @param 'select_metadata' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * Maximum number of values to select from the vocabulary. */ diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php index 2bbe6e7a..4586451e 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php @@ -111,6 +111,19 @@ public function withInstruction(string $instruction): self return $self; } + /** + * Task type that analyzes the image and adds matching tags from a vocabulary. + * + * @param 'select_tags' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * Maximum number of tags to select from the vocabulary. */ diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo.php index bda0c8bd..75d68bdd 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo.php @@ -118,6 +118,19 @@ public function withInstruction(string $instruction): self return $self; } + /** + * Task type that asks a yes/no question and executes actions based on the answer. + * + * @param 'yes_no' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * Actions to execute if the AI answers no. * diff --git a/src/ExtensionConfig/AutoDescriptionExtension.php b/src/ExtensionConfig/AutoDescriptionExtension.php index 07177824..bf2c9937 100644 --- a/src/ExtensionConfig/AutoDescriptionExtension.php +++ b/src/ExtensionConfig/AutoDescriptionExtension.php @@ -38,4 +38,17 @@ public static function with(): self { return new self; } + + /** + * Specifies the auto description extension. + * + * @param 'ai-auto-description' $name + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } } diff --git a/src/ExtensionConfig/RemovedotBgExtension.php b/src/ExtensionConfig/RemovedotBgExtension.php index 2f47fcc9..bc23307b 100644 --- a/src/ExtensionConfig/RemovedotBgExtension.php +++ b/src/ExtensionConfig/RemovedotBgExtension.php @@ -54,6 +54,19 @@ public static function with(Options|array|null $options = null): self return $self; } + /** + * Specifies the background removal extension. + * + * @param 'remove-bg' $name + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } + /** * @param Options|OptionsShape $options */ diff --git a/src/ExtensionItem/AITasksExtension.php b/src/ExtensionItem/AITasksExtension.php index 92516c5e..abcbf473 100644 --- a/src/ExtensionItem/AITasksExtension.php +++ b/src/ExtensionItem/AITasksExtension.php @@ -73,6 +73,19 @@ public static function with(array $tasks): self return $self; } + /** + * Specifies the AI tasks extension for automated image analysis using AI models. + * + * @param 'ai-tasks' $name + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } + /** * Array of task objects defining AI operations to perform on the asset. * diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata.php b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata.php index 20bf5a69..7c67430e 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata.php @@ -135,6 +135,19 @@ public function withInstruction(string $instruction): self return $self; } + /** + * Task type that analyzes the image and sets a custom metadata field value from a vocabulary. + * + * @param 'select_metadata' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * Maximum number of values to select from the vocabulary. */ diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php index 81c091fc..6026b95c 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php @@ -111,6 +111,19 @@ public function withInstruction(string $instruction): self return $self; } + /** + * Task type that analyzes the image and adds matching tags from a vocabulary. + * + * @param 'select_tags' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * Maximum number of tags to select from the vocabulary. */ diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo.php index 8f896e20..c095ef0e 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo.php @@ -118,6 +118,19 @@ public function withInstruction(string $instruction): self return $self; } + /** + * Task type that asks a yes/no question and executes actions based on the answer. + * + * @param 'yes_no' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * Actions to execute if the AI answers no. * diff --git a/src/ExtensionItem/AutoDescriptionExtension.php b/src/ExtensionItem/AutoDescriptionExtension.php index 624dd839..4905cf99 100644 --- a/src/ExtensionItem/AutoDescriptionExtension.php +++ b/src/ExtensionItem/AutoDescriptionExtension.php @@ -38,4 +38,17 @@ public static function with(): self { return new self; } + + /** + * Specifies the auto description extension. + * + * @param 'ai-auto-description' $name + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } } diff --git a/src/ExtensionItem/RemovedotBgExtension.php b/src/ExtensionItem/RemovedotBgExtension.php index c8c12741..4913bb31 100644 --- a/src/ExtensionItem/RemovedotBgExtension.php +++ b/src/ExtensionItem/RemovedotBgExtension.php @@ -54,6 +54,19 @@ public static function with(Options|array|null $options = null): self return $self; } + /** + * Specifies the background removal extension. + * + * @param 'remove-bg' $name + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } + /** * @param Options|OptionsShape $options */ diff --git a/src/ExtensionItem/SavedExtensionReference.php b/src/ExtensionItem/SavedExtensionReference.php index 77de5995..3803028e 100644 --- a/src/ExtensionItem/SavedExtensionReference.php +++ b/src/ExtensionItem/SavedExtensionReference.php @@ -75,4 +75,17 @@ public function withID(string $id): self return $self; } + + /** + * Indicates this is a reference to a saved extension. + * + * @param 'saved-extension' $name + */ + public function withName(string $name): self + { + $self = clone $this; + $self['name'] = $name; + + return $self; + } } diff --git a/src/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php b/src/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php index 371c6231..1e516704 100644 --- a/src/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php +++ b/src/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php @@ -90,6 +90,19 @@ public function withProtocol(Protocol|string $protocol): self return $self; } + /** + * Adaptive Bitrate Streaming (ABS) setup. + * + * @param 'abs' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * List of different representations you want to create separated by an underscore. */ diff --git a/src/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php b/src/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php index dd2af96a..3455e76b 100644 --- a/src/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php +++ b/src/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php @@ -53,6 +53,19 @@ public static function with(?string $value = null): self return $self; } + /** + * Converts an animated GIF into an MP4. + * + * @param 'gif-to-video' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * Optional transformation string to apply to the output video. * **Example**: `q-80`. diff --git a/src/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php b/src/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php index eac46b05..f16a6220 100644 --- a/src/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php +++ b/src/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php @@ -53,6 +53,19 @@ public static function with(?string $value = null): self return $self; } + /** + * Generates a thumbnail image. + * + * @param 'thumbnail' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * Optional transformation string. * **Example**: `w-150,h-150`. diff --git a/src/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php b/src/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php index 29fa252e..923a885e 100644 --- a/src/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php +++ b/src/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php @@ -66,6 +66,19 @@ public static function with(string $value): self return $self; } + /** + * Transformation type. + * + * @param 'transformation' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * Transformation string (e.g. `w-200,h-200`). * Same syntax as ImageKit URL-based transformations. diff --git a/src/ImageOverlay.php b/src/ImageOverlay.php index 7e769dbc..2fb56ad2 100644 --- a/src/ImageOverlay.php +++ b/src/ImageOverlay.php @@ -187,6 +187,17 @@ public function withInput(string $input): self return $self; } + /** + * @param 'image' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * The input path can be included in the layer as either `i-{input}` or `ie-{base64_encoded_input}`. * By default, the SDK determines the appropriate format automatically. diff --git a/src/SolidColorOverlay.php b/src/SolidColorOverlay.php index 69e6f281..3991721e 100644 --- a/src/SolidColorOverlay.php +++ b/src/SolidColorOverlay.php @@ -170,6 +170,17 @@ public function withColor(string $color): self return $self; } + /** + * @param 'solidColor' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * Control width and height of the solid color overlay. Supported transformations depend on the base/parent asset. * See overlays on [Images](https://imagekit.io/docs/add-overlays-on-images#apply-transformation-on-solid-color-overlay) and [Videos](https://imagekit.io/docs/add-overlays-on-videos#apply-transformations-on-solid-color-block-overlay). diff --git a/src/SubtitleOverlay.php b/src/SubtitleOverlay.php index dd415ae0..4b756d76 100644 --- a/src/SubtitleOverlay.php +++ b/src/SubtitleOverlay.php @@ -187,6 +187,17 @@ public function withInput(string $input): self return $self; } + /** + * @param 'subtitle' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * The input path can be included in the layer as either `i-{input}` or `ie-{base64_encoded_input}`. * By default, the SDK determines the appropriate format automatically. diff --git a/src/TextOverlay.php b/src/TextOverlay.php index 94896784..f501cb3c 100644 --- a/src/TextOverlay.php +++ b/src/TextOverlay.php @@ -185,6 +185,17 @@ public function withText(string $text): self return $self; } + /** + * @param 'text' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * Text can be included in the layer as either `i-{input}` (plain text) or `ie-{base64_encoded_input}` (base64). * By default, the SDK selects the appropriate format based on the input text. diff --git a/src/VideoOverlay.php b/src/VideoOverlay.php index 270be2d5..7dde0986 100644 --- a/src/VideoOverlay.php +++ b/src/VideoOverlay.php @@ -187,6 +187,17 @@ public function withInput(string $input): self return $self; } + /** + * @param 'video' $type + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + /** * The input path can be included in the layer as either `i-{input}` or `ie-{base64_encoded_input}`. * By default, the SDK determines the appropriate format automatically. From c8864b87a493e4d51647f4efc6ae5320102d955d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 30 Jan 2026 18:33:48 +0000 Subject: [PATCH 134/193] fix: used redirect count instead of retry count in base client --- src/Core/BaseClient.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Core/BaseClient.php b/src/Core/BaseClient.php index 30bef2e3..12130b2e 100644 --- a/src/Core/BaseClient.php +++ b/src/Core/BaseClient.php @@ -271,7 +271,7 @@ protected function sendRequest( throw $exn; } - $seconds = $this->retryDelay($opts, retryCount: $redirectCount, rsp: $rsp); + $seconds = $this->retryDelay($opts, retryCount: $retryCount, rsp: $rsp); $floor = floor($seconds); time_nanosleep((int) $floor, nanoseconds: (int) ($seconds - $floor) * 10 ** 9); From d42768bef461fd55c7e45213518caadadbc77c4c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 2 Feb 2026 03:51:53 +0000 Subject: [PATCH 135/193] fix(api): add missing embeddedMetadata and video properties to FileDetails --- .stats.yml | 4 +- src/Files/File.php | 105 +++++++++++++++++++++++++++++++ src/Files/FileUpdateResponse.php | 105 +++++++++++++++++++++++++++++++ 3 files changed, 212 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 011cf609..db4fc3c8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-84f0d75048a9268981a84800b4190e3691997ce57dcfc0876f38a5b3fce6bacd.yml -openapi_spec_hash: 35607d4e850c8a60524223ff632c83bb +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-f2eb530f43b355f7ddab66187e45e4ca6da195825b66ea193bbf38acd3deb055.yml +openapi_spec_hash: 2137c56fcf6ae4c09fcac2891b35f789 config_hash: 47cb702ee2cb52c58d803ae39ade9b44 diff --git a/src/Files/File.php b/src/Files/File.php index 224df479..e3a09657 100644 --- a/src/Files/File.php +++ b/src/Files/File.php @@ -21,10 +21,14 @@ * * @phpstan-type FileShape = array{ * aiTags?: list|null, + * audioCodec?: string|null, + * bitRate?: int|null, * createdAt?: \DateTimeInterface|null, * customCoordinates?: string|null, * customMetadata?: array|null, * description?: string|null, + * duration?: int|null, + * embeddedMetadata?: array|null, * fileID?: string|null, * filePath?: string|null, * fileType?: string|null, @@ -42,6 +46,7 @@ * updatedAt?: \DateTimeInterface|null, * url?: string|null, * versionInfo?: null|VersionInfo|VersionInfoShape, + * videoCodec?: string|null, * width?: float|null, * } */ @@ -58,6 +63,18 @@ final class File implements BaseModel #[Optional('AITags', list: AITag::class, nullable: true)] public ?array $aiTags; + /** + * The audio codec used in the video (only for video/audio). + */ + #[Optional] + public ?string $audioCodec; + + /** + * The bit rate of the video in kbps (only for video). + */ + #[Optional] + public ?int $bitRate; + /** * Date and time when the file was uploaded. The date and time is in ISO8601 format. */ @@ -84,6 +101,20 @@ final class File implements BaseModel #[Optional] public ?string $description; + /** + * The duration of the video in seconds (only for video). + */ + #[Optional] + public ?int $duration; + + /** + * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. + * + * @var array|null $embeddedMetadata + */ + #[Optional(map: 'mixed')] + public ?array $embeddedMetadata; + /** * Unique identifier of the asset. */ @@ -196,6 +227,12 @@ final class File implements BaseModel #[Optional] public ?VersionInfo $versionInfo; + /** + * The video codec used in the video (only for video). + */ + #[Optional] + public ?string $videoCodec; + /** * Width of the file. */ @@ -214,6 +251,7 @@ public function __construct() * * @param list|null $aiTags * @param array|null $customMetadata + * @param array|null $embeddedMetadata * @param array|null $selectedFieldsSchema * @param list|null $tags * @param Type|value-of|null $type @@ -221,10 +259,14 @@ public function __construct() */ public static function with( ?array $aiTags = null, + ?string $audioCodec = null, + ?int $bitRate = null, ?\DateTimeInterface $createdAt = null, ?string $customCoordinates = null, ?array $customMetadata = null, ?string $description = null, + ?int $duration = null, + ?array $embeddedMetadata = null, ?string $fileID = null, ?string $filePath = null, ?string $fileType = null, @@ -242,15 +284,20 @@ public static function with( ?\DateTimeInterface $updatedAt = null, ?string $url = null, VersionInfo|array|null $versionInfo = null, + ?string $videoCodec = null, ?float $width = null, ): self { $self = new self; null !== $aiTags && $self['aiTags'] = $aiTags; + null !== $audioCodec && $self['audioCodec'] = $audioCodec; + null !== $bitRate && $self['bitRate'] = $bitRate; null !== $createdAt && $self['createdAt'] = $createdAt; null !== $customCoordinates && $self['customCoordinates'] = $customCoordinates; null !== $customMetadata && $self['customMetadata'] = $customMetadata; null !== $description && $self['description'] = $description; + null !== $duration && $self['duration'] = $duration; + null !== $embeddedMetadata && $self['embeddedMetadata'] = $embeddedMetadata; null !== $fileID && $self['fileID'] = $fileID; null !== $filePath && $self['filePath'] = $filePath; null !== $fileType && $self['fileType'] = $fileType; @@ -268,6 +315,7 @@ public static function with( null !== $updatedAt && $self['updatedAt'] = $updatedAt; null !== $url && $self['url'] = $url; null !== $versionInfo && $self['versionInfo'] = $versionInfo; + null !== $videoCodec && $self['videoCodec'] = $videoCodec; null !== $width && $self['width'] = $width; return $self; @@ -286,6 +334,28 @@ public function withAITags(?array $aiTags): self return $self; } + /** + * The audio codec used in the video (only for video/audio). + */ + public function withAudioCodec(string $audioCodec): self + { + $self = clone $this; + $self['audioCodec'] = $audioCodec; + + return $self; + } + + /** + * The bit rate of the video in kbps (only for video). + */ + public function withBitRate(int $bitRate): self + { + $self = clone $this; + $self['bitRate'] = $bitRate; + + return $self; + } + /** * Date and time when the file was uploaded. The date and time is in ISO8601 format. */ @@ -332,6 +402,30 @@ public function withDescription(string $description): self return $self; } + /** + * The duration of the video in seconds (only for video). + */ + public function withDuration(int $duration): self + { + $self = clone $this; + $self['duration'] = $duration; + + return $self; + } + + /** + * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. + * + * @param array $embeddedMetadata + */ + public function withEmbeddedMetadata(array $embeddedMetadata): self + { + $self = clone $this; + $self['embeddedMetadata'] = $embeddedMetadata; + + return $self; + } + /** * Unique identifier of the asset. */ @@ -531,6 +625,17 @@ public function withVersionInfo(VersionInfo|array $versionInfo): self return $self; } + /** + * The video codec used in the video (only for video). + */ + public function withVideoCodec(string $videoCodec): self + { + $self = clone $this; + $self['videoCodec'] = $videoCodec; + + return $self; + } + /** * Width of the file. */ diff --git a/src/Files/FileUpdateResponse.php b/src/Files/FileUpdateResponse.php index 2775198a..94ac82a2 100644 --- a/src/Files/FileUpdateResponse.php +++ b/src/Files/FileUpdateResponse.php @@ -23,10 +23,14 @@ * * @phpstan-type FileUpdateResponseShape = array{ * aiTags?: list|null, + * audioCodec?: string|null, + * bitRate?: int|null, * createdAt?: \DateTimeInterface|null, * customCoordinates?: string|null, * customMetadata?: array|null, * description?: string|null, + * duration?: int|null, + * embeddedMetadata?: array|null, * fileID?: string|null, * filePath?: string|null, * fileType?: string|null, @@ -44,6 +48,7 @@ * updatedAt?: \DateTimeInterface|null, * url?: string|null, * versionInfo?: null|VersionInfo|VersionInfoShape, + * videoCodec?: string|null, * width?: float|null, * extensionStatus?: null|ExtensionStatus|ExtensionStatusShape, * } @@ -61,6 +66,18 @@ final class FileUpdateResponse implements BaseModel #[Optional('AITags', list: AITag::class, nullable: true)] public ?array $aiTags; + /** + * The audio codec used in the video (only for video/audio). + */ + #[Optional] + public ?string $audioCodec; + + /** + * The bit rate of the video in kbps (only for video). + */ + #[Optional] + public ?int $bitRate; + /** * Date and time when the file was uploaded. The date and time is in ISO8601 format. */ @@ -87,6 +104,20 @@ final class FileUpdateResponse implements BaseModel #[Optional] public ?string $description; + /** + * The duration of the video in seconds (only for video). + */ + #[Optional] + public ?int $duration; + + /** + * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. + * + * @var array|null $embeddedMetadata + */ + #[Optional(map: 'mixed')] + public ?array $embeddedMetadata; + /** * Unique identifier of the asset. */ @@ -199,6 +230,12 @@ final class FileUpdateResponse implements BaseModel #[Optional] public ?VersionInfo $versionInfo; + /** + * The video codec used in the video (only for video). + */ + #[Optional] + public ?string $videoCodec; + /** * Width of the file. */ @@ -220,6 +257,7 @@ public function __construct() * * @param list|null $aiTags * @param array|null $customMetadata + * @param array|null $embeddedMetadata * @param array|null $selectedFieldsSchema * @param list|null $tags * @param Type|value-of|null $type @@ -228,10 +266,14 @@ public function __construct() */ public static function with( ?array $aiTags = null, + ?string $audioCodec = null, + ?int $bitRate = null, ?\DateTimeInterface $createdAt = null, ?string $customCoordinates = null, ?array $customMetadata = null, ?string $description = null, + ?int $duration = null, + ?array $embeddedMetadata = null, ?string $fileID = null, ?string $filePath = null, ?string $fileType = null, @@ -249,16 +291,21 @@ public static function with( ?\DateTimeInterface $updatedAt = null, ?string $url = null, VersionInfo|array|null $versionInfo = null, + ?string $videoCodec = null, ?float $width = null, ExtensionStatus|array|null $extensionStatus = null, ): self { $self = new self; null !== $aiTags && $self['aiTags'] = $aiTags; + null !== $audioCodec && $self['audioCodec'] = $audioCodec; + null !== $bitRate && $self['bitRate'] = $bitRate; null !== $createdAt && $self['createdAt'] = $createdAt; null !== $customCoordinates && $self['customCoordinates'] = $customCoordinates; null !== $customMetadata && $self['customMetadata'] = $customMetadata; null !== $description && $self['description'] = $description; + null !== $duration && $self['duration'] = $duration; + null !== $embeddedMetadata && $self['embeddedMetadata'] = $embeddedMetadata; null !== $fileID && $self['fileID'] = $fileID; null !== $filePath && $self['filePath'] = $filePath; null !== $fileType && $self['fileType'] = $fileType; @@ -276,6 +323,7 @@ public static function with( null !== $updatedAt && $self['updatedAt'] = $updatedAt; null !== $url && $self['url'] = $url; null !== $versionInfo && $self['versionInfo'] = $versionInfo; + null !== $videoCodec && $self['videoCodec'] = $videoCodec; null !== $width && $self['width'] = $width; null !== $extensionStatus && $self['extensionStatus'] = $extensionStatus; @@ -295,6 +343,28 @@ public function withAITags(?array $aiTags): self return $self; } + /** + * The audio codec used in the video (only for video/audio). + */ + public function withAudioCodec(string $audioCodec): self + { + $self = clone $this; + $self['audioCodec'] = $audioCodec; + + return $self; + } + + /** + * The bit rate of the video in kbps (only for video). + */ + public function withBitRate(int $bitRate): self + { + $self = clone $this; + $self['bitRate'] = $bitRate; + + return $self; + } + /** * Date and time when the file was uploaded. The date and time is in ISO8601 format. */ @@ -341,6 +411,30 @@ public function withDescription(string $description): self return $self; } + /** + * The duration of the video in seconds (only for video). + */ + public function withDuration(int $duration): self + { + $self = clone $this; + $self['duration'] = $duration; + + return $self; + } + + /** + * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. + * + * @param array $embeddedMetadata + */ + public function withEmbeddedMetadata(array $embeddedMetadata): self + { + $self = clone $this; + $self['embeddedMetadata'] = $embeddedMetadata; + + return $self; + } + /** * Unique identifier of the asset. */ @@ -540,6 +634,17 @@ public function withVersionInfo(VersionInfo|array $versionInfo): self return $self; } + /** + * The video codec used in the video (only for video). + */ + public function withVideoCodec(string $videoCodec): self + { + $self = clone $this; + $self['videoCodec'] = $videoCodec; + + return $self; + } + /** * Width of the file. */ From 2b8763e03a721ac880ff51dc41a0b5a075916bf2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 2 Feb 2026 04:48:04 +0000 Subject: [PATCH 136/193] feat(api): add customMetadata property to folder schema --- .stats.yml | 4 ++-- src/Files/Folder.php | 25 +++++++++++++++++++++++++ 2 files changed, 27 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index db4fc3c8..dbc39e12 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-f2eb530f43b355f7ddab66187e45e4ca6da195825b66ea193bbf38acd3deb055.yml -openapi_spec_hash: 2137c56fcf6ae4c09fcac2891b35f789 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-13fc3d7cafdea492f62eef7c1d63424d6d9d8adbff74b9f6ca6fd3fc12a36840.yml +openapi_spec_hash: a1fe6fa48207791657a1ea2d60a6dfcc config_hash: 47cb702ee2cb52c58d803ae39ade9b44 diff --git a/src/Files/Folder.php b/src/Files/Folder.php index 26df7c7e..a6c62665 100644 --- a/src/Files/Folder.php +++ b/src/Files/Folder.php @@ -12,6 +12,7 @@ /** * @phpstan-type FolderShape = array{ * createdAt?: \DateTimeInterface|null, + * customMetadata?: array|null, * folderID?: string|null, * folderPath?: string|null, * name?: string|null, @@ -30,6 +31,14 @@ final class Folder implements BaseModel #[Optional] public ?\DateTimeInterface $createdAt; + /** + * An object with custom metadata for the folder. Returns empty object if no custom metadata is set. + * + * @var array|null $customMetadata + */ + #[Optional(map: 'mixed')] + public ?array $customMetadata; + /** * Unique identifier of the asset. */ @@ -72,10 +81,12 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * + * @param array|null $customMetadata * @param Type|value-of|null $type */ public static function with( ?\DateTimeInterface $createdAt = null, + ?array $customMetadata = null, ?string $folderID = null, ?string $folderPath = null, ?string $name = null, @@ -85,6 +96,7 @@ public static function with( $self = new self; null !== $createdAt && $self['createdAt'] = $createdAt; + null !== $customMetadata && $self['customMetadata'] = $customMetadata; null !== $folderID && $self['folderID'] = $folderID; null !== $folderPath && $self['folderPath'] = $folderPath; null !== $name && $self['name'] = $name; @@ -105,6 +117,19 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self return $self; } + /** + * An object with custom metadata for the folder. Returns empty object if no custom metadata is set. + * + * @param array $customMetadata + */ + public function withCustomMetadata(array $customMetadata): self + { + $self = clone $this; + $self['customMetadata'] = $customMetadata; + + return $self; + } + /** * Unique identifier of the asset. */ From ffce92feb7a761600be48db66c357ac4be6a27b4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 2 Feb 2026 20:27:28 +0000 Subject: [PATCH 137/193] chore(internal): php cs fixer should not be memory limited --- .php-cs-fixer.dist.php | 2 ++ src/Transformation.php | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php index e01ea3ba..d46a37f9 100644 --- a/.php-cs-fixer.dist.php +++ b/.php-cs-fixer.dist.php @@ -4,6 +4,8 @@ use PhpCsFixer\Finder; use PhpCsFixer\Runner\Parallel\ParallelConfigFactory; +ini_set('memory_limit', -1); + return (new Config) ->setParallelConfig(ParallelConfigFactory::detect()) ->setFinder(Finder::create()->in([__DIR__.'/src', __DIR__.'/tests'])) diff --git a/src/Transformation.php b/src/Transformation.php index 9981b85e..2f93557f 100644 --- a/src/Transformation.php +++ b/src/Transformation.php @@ -417,7 +417,7 @@ final class Transformation implements BaseModel * See [Overlay using layers](https://imagekit.io/docs/transformations#overlay-using-layers). */ #[Optional(union: Overlay::class)] - public ?Overlay $overlay; + public mixed $overlay; /** * Extracts a specific page or frame from multi-page or layered files (PDF, PSD, AI). From ad42299eeecb6784d17adf834fa522d03a62d801 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 3 Feb 2026 02:19:44 +0000 Subject: [PATCH 138/193] feat: use `$_ENV` aware getenv helper --- src/Client.php | 12 +++++++++--- src/Core/Util.php | 17 +++++++++++++++++ tests/Services/Accounts/OriginsTest.php | 3 ++- tests/Services/Accounts/URLEndpointsTest.php | 3 ++- tests/Services/Accounts/UsageTest.php | 3 ++- tests/Services/AssetsTest.php | 3 ++- tests/Services/Beta/V2/FilesTest.php | 3 ++- tests/Services/Cache/InvalidationTest.php | 3 ++- tests/Services/CustomMetadataFieldsTest.php | 3 ++- tests/Services/Files/BulkTest.php | 3 ++- tests/Services/Files/MetadataTest.php | 3 ++- tests/Services/Files/VersionsTest.php | 3 ++- tests/Services/FilesTest.php | 3 ++- tests/Services/Folders/JobTest.php | 3 ++- tests/Services/FoldersTest.php | 3 ++- tests/Services/SavedExtensionsTest.php | 3 ++- tests/Services/WebhooksTest.php | 3 ++- 17 files changed, 56 insertions(+), 18 deletions(-) diff --git a/src/Client.php b/src/Client.php index 4a0a2e35..ca43a498 100644 --- a/src/Client.php +++ b/src/Client.php @@ -84,12 +84,18 @@ public function __construct( ?string $baseUrl = null, RequestOptions|array|null $requestOptions = null, ) { - $this->privateKey = (string) ($privateKey ?? getenv('IMAGEKIT_PRIVATE_KEY')); - $this->password = (string) ($password ?? getenv('OPTIONAL_IMAGEKIT_IGNORES_THIS') ?: 'do_not_set'); + $this->privateKey = (string) ($privateKey ?? Util::getenv( + 'IMAGEKIT_PRIVATE_KEY' + )); + $this->password = (string) ($password ?? Util::getenv( + 'OPTIONAL_IMAGEKIT_IGNORES_THIS' + ) ?: 'do_not_set'); $this->baseUrlOverridden = !is_null($baseUrl); - $baseUrl ??= getenv('IMAGE_KIT_BASE_URL') ?: 'https://api.imagekit.io'; + $baseUrl ??= Util::getenv( + 'IMAGE_KIT_BASE_URL' + ) ?: 'https://api.imagekit.io'; $options = RequestOptions::parse( RequestOptions::with( diff --git a/src/Core/Util.php b/src/Core/Util.php index 7ce78bf8..2f5e05ec 100644 --- a/src/Core/Util.php +++ b/src/Core/Util.php @@ -25,6 +25,23 @@ final class Util public const JSONL_CONTENT_TYPE = '/^application\/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)/'; + public static function getenv(string $key): ?string + { + if (array_key_exists($key, array: $_ENV)) { + if (!is_string($value = $_ENV[$key])) { + throw new \InvalidArgumentException; + } + + return $value; + } + + if (is_string($value = getenv($key))) { + return $value; + } + + return null; + } + /** * @return array */ diff --git a/tests/Services/Accounts/OriginsTest.php b/tests/Services/Accounts/OriginsTest.php index 1ac45a75..af8485ee 100644 --- a/tests/Services/Accounts/OriginsTest.php +++ b/tests/Services/Accounts/OriginsTest.php @@ -3,6 +3,7 @@ namespace Tests\Services\Accounts; use Imagekit\Client; +use Imagekit\Core\Util; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; @@ -20,7 +21,7 @@ protected function setUp(): void { parent::setUp(); - $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; + $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( privateKey: 'My Private Key', password: 'My Password', diff --git a/tests/Services/Accounts/URLEndpointsTest.php b/tests/Services/Accounts/URLEndpointsTest.php index cd56ff93..9c914013 100644 --- a/tests/Services/Accounts/URLEndpointsTest.php +++ b/tests/Services/Accounts/URLEndpointsTest.php @@ -4,6 +4,7 @@ use Imagekit\Accounts\URLEndpoints\URLEndpointResponse; use Imagekit\Client; +use Imagekit\Core\Util; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; @@ -21,7 +22,7 @@ protected function setUp(): void { parent::setUp(); - $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; + $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( privateKey: 'My Private Key', password: 'My Password', diff --git a/tests/Services/Accounts/UsageTest.php b/tests/Services/Accounts/UsageTest.php index 49e8dd20..14b9812b 100644 --- a/tests/Services/Accounts/UsageTest.php +++ b/tests/Services/Accounts/UsageTest.php @@ -4,6 +4,7 @@ use Imagekit\Accounts\Usage\UsageGetResponse; use Imagekit\Client; +use Imagekit\Core\Util; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; @@ -21,7 +22,7 @@ protected function setUp(): void { parent::setUp(); - $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; + $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( privateKey: 'My Private Key', password: 'My Password', diff --git a/tests/Services/AssetsTest.php b/tests/Services/AssetsTest.php index bd886fd6..3b161f42 100644 --- a/tests/Services/AssetsTest.php +++ b/tests/Services/AssetsTest.php @@ -3,6 +3,7 @@ namespace Tests\Services; use Imagekit\Client; +use Imagekit\Core\Util; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; @@ -20,7 +21,7 @@ protected function setUp(): void { parent::setUp(); - $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; + $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( privateKey: 'My Private Key', password: 'My Password', diff --git a/tests/Services/Beta/V2/FilesTest.php b/tests/Services/Beta/V2/FilesTest.php index bde2ece7..8c701f43 100644 --- a/tests/Services/Beta/V2/FilesTest.php +++ b/tests/Services/Beta/V2/FilesTest.php @@ -4,6 +4,7 @@ use Imagekit\Beta\V2\Files\FileUploadResponse; use Imagekit\Client; +use Imagekit\Core\Util; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; @@ -21,7 +22,7 @@ protected function setUp(): void { parent::setUp(); - $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; + $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( privateKey: 'My Private Key', password: 'My Password', diff --git a/tests/Services/Cache/InvalidationTest.php b/tests/Services/Cache/InvalidationTest.php index f488e694..b6435691 100644 --- a/tests/Services/Cache/InvalidationTest.php +++ b/tests/Services/Cache/InvalidationTest.php @@ -5,6 +5,7 @@ use Imagekit\Cache\Invalidation\InvalidationGetResponse; use Imagekit\Cache\Invalidation\InvalidationNewResponse; use Imagekit\Client; +use Imagekit\Core\Util; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; @@ -22,7 +23,7 @@ protected function setUp(): void { parent::setUp(); - $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; + $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( privateKey: 'My Private Key', password: 'My Password', diff --git a/tests/Services/CustomMetadataFieldsTest.php b/tests/Services/CustomMetadataFieldsTest.php index 5333467e..187cf2fd 100644 --- a/tests/Services/CustomMetadataFieldsTest.php +++ b/tests/Services/CustomMetadataFieldsTest.php @@ -3,6 +3,7 @@ namespace Tests\Services; use Imagekit\Client; +use Imagekit\Core\Util; use Imagekit\CustomMetadataFields\CustomMetadataField; use Imagekit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; use PHPUnit\Framework\Attributes\CoversNothing; @@ -22,7 +23,7 @@ protected function setUp(): void { parent::setUp(); - $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; + $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( privateKey: 'My Private Key', password: 'My Password', diff --git a/tests/Services/Files/BulkTest.php b/tests/Services/Files/BulkTest.php index a1bef5d1..9aee1d4b 100644 --- a/tests/Services/Files/BulkTest.php +++ b/tests/Services/Files/BulkTest.php @@ -3,6 +3,7 @@ namespace Tests\Services\Files; use Imagekit\Client; +use Imagekit\Core\Util; use Imagekit\Files\Bulk\BulkAddTagsResponse; use Imagekit\Files\Bulk\BulkDeleteResponse; use Imagekit\Files\Bulk\BulkRemoveAITagsResponse; @@ -24,7 +25,7 @@ protected function setUp(): void { parent::setUp(); - $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; + $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( privateKey: 'My Private Key', password: 'My Password', diff --git a/tests/Services/Files/MetadataTest.php b/tests/Services/Files/MetadataTest.php index 59f43f7a..36fad573 100644 --- a/tests/Services/Files/MetadataTest.php +++ b/tests/Services/Files/MetadataTest.php @@ -3,6 +3,7 @@ namespace Tests\Services\Files; use Imagekit\Client; +use Imagekit\Core\Util; use Imagekit\Files\Metadata; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; @@ -21,7 +22,7 @@ protected function setUp(): void { parent::setUp(); - $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; + $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( privateKey: 'My Private Key', password: 'My Password', diff --git a/tests/Services/Files/VersionsTest.php b/tests/Services/Files/VersionsTest.php index c1d85c36..a90fdbfd 100644 --- a/tests/Services/Files/VersionsTest.php +++ b/tests/Services/Files/VersionsTest.php @@ -3,6 +3,7 @@ namespace Tests\Services\Files; use Imagekit\Client; +use Imagekit\Core\Util; use Imagekit\Files\File; use Imagekit\Files\Versions\VersionDeleteResponse; use PHPUnit\Framework\Attributes\CoversNothing; @@ -22,7 +23,7 @@ protected function setUp(): void { parent::setUp(); - $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; + $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( privateKey: 'My Private Key', password: 'My Password', diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index 61b545ed..20580156 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -3,6 +3,7 @@ namespace Tests\Services; use Imagekit\Client; +use Imagekit\Core\Util; use Imagekit\Files\File; use Imagekit\Files\FileCopyResponse; use Imagekit\Files\FileMoveResponse; @@ -26,7 +27,7 @@ protected function setUp(): void { parent::setUp(); - $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; + $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( privateKey: 'My Private Key', password: 'My Password', diff --git a/tests/Services/Folders/JobTest.php b/tests/Services/Folders/JobTest.php index 99acdc36..ceac6e13 100644 --- a/tests/Services/Folders/JobTest.php +++ b/tests/Services/Folders/JobTest.php @@ -3,6 +3,7 @@ namespace Tests\Services\Folders; use Imagekit\Client; +use Imagekit\Core\Util; use Imagekit\Folders\Job\JobGetResponse; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; @@ -21,7 +22,7 @@ protected function setUp(): void { parent::setUp(); - $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; + $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( privateKey: 'My Private Key', password: 'My Password', diff --git a/tests/Services/FoldersTest.php b/tests/Services/FoldersTest.php index 217bbbd9..dc02af32 100644 --- a/tests/Services/FoldersTest.php +++ b/tests/Services/FoldersTest.php @@ -3,6 +3,7 @@ namespace Tests\Services; use Imagekit\Client; +use Imagekit\Core\Util; use Imagekit\Folders\FolderCopyResponse; use Imagekit\Folders\FolderDeleteResponse; use Imagekit\Folders\FolderMoveResponse; @@ -25,7 +26,7 @@ protected function setUp(): void { parent::setUp(); - $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; + $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( privateKey: 'My Private Key', password: 'My Password', diff --git a/tests/Services/SavedExtensionsTest.php b/tests/Services/SavedExtensionsTest.php index 6abe8fda..883becbc 100644 --- a/tests/Services/SavedExtensionsTest.php +++ b/tests/Services/SavedExtensionsTest.php @@ -3,6 +3,7 @@ namespace Tests\Services; use Imagekit\Client; +use Imagekit\Core\Util; use Imagekit\SavedExtension; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; @@ -21,7 +22,7 @@ protected function setUp(): void { parent::setUp(); - $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; + $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( privateKey: 'My Private Key', password: 'My Password', diff --git a/tests/Services/WebhooksTest.php b/tests/Services/WebhooksTest.php index 6a10e26d..dbe5ae26 100644 --- a/tests/Services/WebhooksTest.php +++ b/tests/Services/WebhooksTest.php @@ -3,6 +3,7 @@ namespace Tests\Services; use Imagekit\Client; +use Imagekit\Core\Util; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\TestCase; @@ -18,7 +19,7 @@ protected function setUp(): void { parent::setUp(); - $testUrl = getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; + $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; $client = new Client( privateKey: 'My Private Key', password: 'My Password', From bc5a3ed131b03c042fa8020f0b85d8d0ab70546a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Feb 2026 16:03:15 +0000 Subject: [PATCH 139/193] chore(internal): remove mock server code --- scripts/mock | 41 ----------------------------------------- scripts/test | 46 ---------------------------------------------- 2 files changed, 87 deletions(-) delete mode 100755 scripts/mock diff --git a/scripts/mock b/scripts/mock deleted file mode 100755 index 0b28f6ea..00000000 --- a/scripts/mock +++ /dev/null @@ -1,41 +0,0 @@ -#!/usr/bin/env bash - -set -e - -cd "$(dirname "$0")/.." - -if [[ -n "$1" && "$1" != '--'* ]]; then - URL="$1" - shift -else - URL="$(grep 'openapi_spec_url' .stats.yml | cut -d' ' -f2)" -fi - -# Check if the URL is empty -if [ -z "$URL" ]; then - echo "Error: No OpenAPI spec path/url provided or found in .stats.yml" - exit 1 -fi - -echo "==> Starting mock server with URL ${URL}" - -# Run prism mock on the given spec -if [ "$1" == "--daemon" ]; then - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" &> .prism.log & - - # Wait for server to come online - echo -n "Waiting for server" - while ! grep -q "✖ fatal\|Prism is listening" ".prism.log" ; do - echo -n "." - sleep 0.1 - done - - if grep -q "✖ fatal" ".prism.log"; then - cat .prism.log - exit 1 - fi - - echo -else - npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock "$URL" -fi diff --git a/scripts/test b/scripts/test index 4b777e01..63df1370 100755 --- a/scripts/test +++ b/scripts/test @@ -4,52 +4,6 @@ set -e cd "$(dirname "$0")/.." -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[0;33m' -NC='\033[0m' # No Color -function prism_is_running() { - curl --silent "http://localhost:4010" >/dev/null 2>&1 -} - -kill_server_on_port() { - pids=$(lsof -t -i tcp:"$1" || echo "") - if [ "$pids" != "" ]; then - kill "$pids" - echo "Stopped $pids." - fi -} - -function is_overriding_api_base_url() { - [ -n "$TEST_API_BASE_URL" ] -} - -if ! is_overriding_api_base_url && ! prism_is_running ; then - # When we exit this script, make sure to kill the background mock server process - trap 'kill_server_on_port 4010' EXIT - - # Start the dev server - ./scripts/mock --daemon -fi - -if is_overriding_api_base_url ; then - echo -e "${GREEN}✔ Running tests against ${TEST_API_BASE_URL}${NC}" - echo -elif ! prism_is_running ; then - echo -e "${RED}ERROR:${NC} The test suite will not run without a mock Prism server" - echo -e "running against your OpenAPI spec." - echo - echo -e "To run the server, pass in the path or url of your OpenAPI" - echo -e "spec to the prism command:" - echo - echo -e " \$ ${YELLOW}npm exec --package=@stainless-api/prism-cli@5.15.0 -- prism mock path/to/your.openapi.yml${NC}" - echo - - exit 1 -else - echo -e "${GREEN}✔ Mock prism server is running with your OpenAPI spec${NC}" - echo -fi exec -- ./vendor/bin/pest --colors=always From d02f1aa5f9b7dbe551ae0822943ea38c0622a825 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 19 Feb 2026 16:33:38 +0000 Subject: [PATCH 140/193] chore: update mock server docs --- tests/Services/Accounts/OriginsTest.php | 14 ++++++------- tests/Services/Accounts/URLEndpointsTest.php | 14 ++++++------- tests/Services/Accounts/UsageTest.php | 4 ++-- tests/Services/AssetsTest.php | 2 +- tests/Services/Beta/V2/FilesTest.php | 4 ++-- tests/Services/Cache/InvalidationTest.php | 6 +++--- tests/Services/CustomMetadataFieldsTest.php | 10 ++++----- tests/Services/Files/BulkTest.php | 16 +++++++------- tests/Services/Files/MetadataTest.php | 6 +++--- tests/Services/Files/VersionsTest.php | 14 ++++++------- tests/Services/FilesTest.php | 22 ++++++++++---------- tests/Services/Folders/JobTest.php | 2 +- tests/Services/FoldersTest.php | 20 +++++++++--------- tests/Services/SavedExtensionsTest.php | 12 +++++------ 14 files changed, 73 insertions(+), 73 deletions(-) diff --git a/tests/Services/Accounts/OriginsTest.php b/tests/Services/Accounts/OriginsTest.php index af8485ee..a1b1c1ef 100644 --- a/tests/Services/Accounts/OriginsTest.php +++ b/tests/Services/Accounts/OriginsTest.php @@ -35,7 +35,7 @@ protected function setUp(): void public function testCreate(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->accounts->origins->create( @@ -64,7 +64,7 @@ public function testCreate(): void public function testCreateWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->accounts->origins->create( @@ -99,7 +99,7 @@ public function testCreateWithOptionalParams(): void public function testUpdate(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->accounts->origins->update( @@ -129,7 +129,7 @@ public function testUpdate(): void public function testUpdateWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->accounts->origins->update( @@ -165,7 +165,7 @@ public function testUpdateWithOptionalParams(): void public function testList(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->accounts->origins->list(); @@ -178,7 +178,7 @@ public function testList(): void public function testDelete(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->accounts->origins->delete('id'); @@ -191,7 +191,7 @@ public function testDelete(): void public function testGet(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->accounts->origins->get('id'); diff --git a/tests/Services/Accounts/URLEndpointsTest.php b/tests/Services/Accounts/URLEndpointsTest.php index 9c914013..0d2e8dbc 100644 --- a/tests/Services/Accounts/URLEndpointsTest.php +++ b/tests/Services/Accounts/URLEndpointsTest.php @@ -36,7 +36,7 @@ protected function setUp(): void public function testCreate(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->accounts->urlEndpoints->create( @@ -51,7 +51,7 @@ public function testCreate(): void public function testCreateWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->accounts->urlEndpoints->create( @@ -71,7 +71,7 @@ public function testCreateWithOptionalParams(): void public function testUpdate(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->accounts->urlEndpoints->update( @@ -87,7 +87,7 @@ public function testUpdate(): void public function testUpdateWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->accounts->urlEndpoints->update( @@ -108,7 +108,7 @@ public function testUpdateWithOptionalParams(): void public function testList(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->accounts->urlEndpoints->list(); @@ -121,7 +121,7 @@ public function testList(): void public function testDelete(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->accounts->urlEndpoints->delete('id'); @@ -134,7 +134,7 @@ public function testDelete(): void public function testGet(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->accounts->urlEndpoints->get('id'); diff --git a/tests/Services/Accounts/UsageTest.php b/tests/Services/Accounts/UsageTest.php index 14b9812b..7ada415c 100644 --- a/tests/Services/Accounts/UsageTest.php +++ b/tests/Services/Accounts/UsageTest.php @@ -36,7 +36,7 @@ protected function setUp(): void public function testGet(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->accounts->usage->get( @@ -52,7 +52,7 @@ public function testGet(): void public function testGetWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->accounts->usage->get( diff --git a/tests/Services/AssetsTest.php b/tests/Services/AssetsTest.php index 3b161f42..13b220e6 100644 --- a/tests/Services/AssetsTest.php +++ b/tests/Services/AssetsTest.php @@ -35,7 +35,7 @@ protected function setUp(): void public function testList(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->assets->list(); diff --git a/tests/Services/Beta/V2/FilesTest.php b/tests/Services/Beta/V2/FilesTest.php index 8c701f43..b923d1ea 100644 --- a/tests/Services/Beta/V2/FilesTest.php +++ b/tests/Services/Beta/V2/FilesTest.php @@ -36,7 +36,7 @@ protected function setUp(): void public function testUpload(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->beta->v2->files->upload( @@ -52,7 +52,7 @@ public function testUpload(): void public function testUploadWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->beta->v2->files->upload( diff --git a/tests/Services/Cache/InvalidationTest.php b/tests/Services/Cache/InvalidationTest.php index b6435691..e1101cef 100644 --- a/tests/Services/Cache/InvalidationTest.php +++ b/tests/Services/Cache/InvalidationTest.php @@ -37,7 +37,7 @@ protected function setUp(): void public function testCreate(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->cache->invalidation->create( @@ -52,7 +52,7 @@ public function testCreate(): void public function testCreateWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->cache->invalidation->create( @@ -67,7 +67,7 @@ public function testCreateWithOptionalParams(): void public function testGet(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->cache->invalidation->get('requestId'); diff --git a/tests/Services/CustomMetadataFieldsTest.php b/tests/Services/CustomMetadataFieldsTest.php index 187cf2fd..6e3ea292 100644 --- a/tests/Services/CustomMetadataFieldsTest.php +++ b/tests/Services/CustomMetadataFieldsTest.php @@ -37,7 +37,7 @@ protected function setUp(): void public function testCreate(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->customMetadataFields->create( @@ -54,7 +54,7 @@ public function testCreate(): void public function testCreateWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->customMetadataFields->create( @@ -80,7 +80,7 @@ public function testCreateWithOptionalParams(): void public function testUpdate(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->customMetadataFields->update('id'); @@ -93,7 +93,7 @@ public function testUpdate(): void public function testList(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->customMetadataFields->list(); @@ -106,7 +106,7 @@ public function testList(): void public function testDelete(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->customMetadataFields->delete('id'); diff --git a/tests/Services/Files/BulkTest.php b/tests/Services/Files/BulkTest.php index 9aee1d4b..144ce9ef 100644 --- a/tests/Services/Files/BulkTest.php +++ b/tests/Services/Files/BulkTest.php @@ -39,7 +39,7 @@ protected function setUp(): void public function testDelete(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->bulk->delete( @@ -54,7 +54,7 @@ public function testDelete(): void public function testDeleteWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->bulk->delete( @@ -69,7 +69,7 @@ public function testDeleteWithOptionalParams(): void public function testAddTags(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->bulk->addTags( @@ -85,7 +85,7 @@ public function testAddTags(): void public function testAddTagsWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->bulk->addTags( @@ -101,7 +101,7 @@ public function testAddTagsWithOptionalParams(): void public function testRemoveAITags(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->bulk->removeAITags( @@ -117,7 +117,7 @@ public function testRemoveAITags(): void public function testRemoveAITagsWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->bulk->removeAITags( @@ -133,7 +133,7 @@ public function testRemoveAITagsWithOptionalParams(): void public function testRemoveTags(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->bulk->removeTags( @@ -149,7 +149,7 @@ public function testRemoveTags(): void public function testRemoveTagsWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->bulk->removeTags( diff --git a/tests/Services/Files/MetadataTest.php b/tests/Services/Files/MetadataTest.php index 36fad573..6702265a 100644 --- a/tests/Services/Files/MetadataTest.php +++ b/tests/Services/Files/MetadataTest.php @@ -36,7 +36,7 @@ protected function setUp(): void public function testGet(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->metadata->get('fileId'); @@ -49,7 +49,7 @@ public function testGet(): void public function testGetFromURL(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->metadata->getFromURL( @@ -64,7 +64,7 @@ public function testGetFromURL(): void public function testGetFromURLWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->metadata->getFromURL( diff --git a/tests/Services/Files/VersionsTest.php b/tests/Services/Files/VersionsTest.php index a90fdbfd..ca5e2ba9 100644 --- a/tests/Services/Files/VersionsTest.php +++ b/tests/Services/Files/VersionsTest.php @@ -37,7 +37,7 @@ protected function setUp(): void public function testList(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->versions->list('fileId'); @@ -50,7 +50,7 @@ public function testList(): void public function testDelete(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->versions->delete( @@ -66,7 +66,7 @@ public function testDelete(): void public function testDeleteWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->versions->delete( @@ -82,7 +82,7 @@ public function testDeleteWithOptionalParams(): void public function testGet(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->versions->get( @@ -98,7 +98,7 @@ public function testGet(): void public function testGetWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->versions->get( @@ -114,7 +114,7 @@ public function testGetWithOptionalParams(): void public function testRestore(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->versions->restore( @@ -130,7 +130,7 @@ public function testRestore(): void public function testRestoreWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->versions->restore( diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index 20580156..17a01b27 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -41,7 +41,7 @@ protected function setUp(): void public function testUpdate(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->update('fileId'); @@ -54,7 +54,7 @@ public function testUpdate(): void public function testDelete(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->delete('fileId'); @@ -67,7 +67,7 @@ public function testDelete(): void public function testCopy(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->copy( @@ -83,7 +83,7 @@ public function testCopy(): void public function testCopyWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->copy( @@ -100,7 +100,7 @@ public function testCopyWithOptionalParams(): void public function testGet(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->get('fileId'); @@ -113,7 +113,7 @@ public function testGet(): void public function testMove(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->move( @@ -129,7 +129,7 @@ public function testMove(): void public function testMoveWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->move( @@ -145,7 +145,7 @@ public function testMoveWithOptionalParams(): void public function testRename(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->rename( @@ -161,7 +161,7 @@ public function testRename(): void public function testRenameWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->rename( @@ -178,7 +178,7 @@ public function testRenameWithOptionalParams(): void public function testUpload(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->upload(file: 'file', fileName: 'fileName'); @@ -191,7 +191,7 @@ public function testUpload(): void public function testUploadWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->files->upload( diff --git a/tests/Services/Folders/JobTest.php b/tests/Services/Folders/JobTest.php index ceac6e13..88748fae 100644 --- a/tests/Services/Folders/JobTest.php +++ b/tests/Services/Folders/JobTest.php @@ -36,7 +36,7 @@ protected function setUp(): void public function testGet(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->folders->job->get('jobId'); diff --git a/tests/Services/FoldersTest.php b/tests/Services/FoldersTest.php index dc02af32..5251a59a 100644 --- a/tests/Services/FoldersTest.php +++ b/tests/Services/FoldersTest.php @@ -40,7 +40,7 @@ protected function setUp(): void public function testCreate(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->folders->create( @@ -56,7 +56,7 @@ public function testCreate(): void public function testCreateWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->folders->create( @@ -72,7 +72,7 @@ public function testCreateWithOptionalParams(): void public function testDelete(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->folders->delete(folderPath: '/folder/to/delete/'); @@ -85,7 +85,7 @@ public function testDelete(): void public function testDeleteWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->folders->delete(folderPath: '/folder/to/delete/'); @@ -98,7 +98,7 @@ public function testDeleteWithOptionalParams(): void public function testCopy(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->folders->copy( @@ -114,7 +114,7 @@ public function testCopy(): void public function testCopyWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->folders->copy( @@ -131,7 +131,7 @@ public function testCopyWithOptionalParams(): void public function testMove(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->folders->move( @@ -147,7 +147,7 @@ public function testMove(): void public function testMoveWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->folders->move( @@ -163,7 +163,7 @@ public function testMoveWithOptionalParams(): void public function testRename(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->folders->rename( @@ -179,7 +179,7 @@ public function testRename(): void public function testRenameWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->folders->rename( diff --git a/tests/Services/SavedExtensionsTest.php b/tests/Services/SavedExtensionsTest.php index 883becbc..8b54e333 100644 --- a/tests/Services/SavedExtensionsTest.php +++ b/tests/Services/SavedExtensionsTest.php @@ -36,7 +36,7 @@ protected function setUp(): void public function testCreate(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->savedExtensions->create( @@ -53,7 +53,7 @@ public function testCreate(): void public function testCreateWithOptionalParams(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->savedExtensions->create( @@ -78,7 +78,7 @@ public function testCreateWithOptionalParams(): void public function testUpdate(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->savedExtensions->update('id'); @@ -91,7 +91,7 @@ public function testUpdate(): void public function testList(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->savedExtensions->list(); @@ -104,7 +104,7 @@ public function testList(): void public function testDelete(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->savedExtensions->delete('id'); @@ -117,7 +117,7 @@ public function testDelete(): void public function testGet(): void { if (UnsupportedMockTests::$skip) { - $this->markTestSkipped('Prism tests are disabled'); + $this->markTestSkipped('Mock server tests are disabled'); } $result = $this->client->savedExtensions->get('id'); From ee5e13b4b0776354070b0fb51a6acd56743bb680 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 26 Feb 2026 11:23:55 +0000 Subject: [PATCH 141/193] feat(api): dpr type update --- .stats.yml | 4 ++-- src/Beta/V2/Files/FileUploadParams.php | 2 +- src/Files/FileUploadParams.php | 2 +- src/Services/Beta/V2/FilesRawService.php | 2 +- src/Services/Beta/V2/FilesService.php | 2 +- src/Services/FilesRawService.php | 2 +- src/Services/FilesService.php | 2 +- src/Transformation.php | 15 ++++++++---- src/Transformation/Dpr.php | 30 ++++++++++++++++++++++++ 9 files changed, 49 insertions(+), 12 deletions(-) create mode 100644 src/Transformation/Dpr.php diff --git a/.stats.yml b/.stats.yml index dbc39e12..7401c19f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-13fc3d7cafdea492f62eef7c1d63424d6d9d8adbff74b9f6ca6fd3fc12a36840.yml -openapi_spec_hash: a1fe6fa48207791657a1ea2d60a6dfcc +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-e5b5a158784fff63311ceef956e8d5ce9e87c6b557d23ab737270040eb39adcd.yml +openapi_spec_hash: b0293985a8806f367319af573d1b418c config_hash: 47cb702ee2cb52c58d803ae39ade9b44 diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index 7b176e0e..cffda1b5 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -19,7 +19,7 @@ * ImageKit.io allows you to upload files directly from both the server and client sides. For server-side uploads, private API key authentication is used. For client-side uploads, generate a one-time `token` from your secure backend using private API. [Learn more](/docs/api-reference/upload-file/upload-file-v2#how-to-implement-secure-client-side-file-upload) about how to implement secure client-side file upload. * * **File size limit** \ - * On the free plan, the maximum upload file sizes are 20MB for images, audio, and raw files, and 100MB for videos. On the paid plan, these limits increase to 40MB for images, audio, and raw files, and 2GB for videos. These limits can be further increased with higher-tier plans. + * On the free plan, the maximum upload file sizes are 25MB for images, audio, and raw files, and 100MB for videos. On the Lite paid plan, these limits increase to 40MB for images, audio, and raw files and 300MB for videos, whereas on the Pro paid plan, these limits increase to 50MB for images, audio, and raw files and 2GB for videos. These limits can be further increased with enterprise plans. * * **Version limit** \ * A file can have a maximum of 100 versions. diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index 725c4250..309ba54d 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -19,7 +19,7 @@ * The [V2 API](/docs/api-reference/upload-file/upload-file-v2) enhances security by verifying the entire payload using JWT. * * **File size limit** \ - * On the free plan, the maximum upload file sizes are 20MB for images, audio, and raw files and 100MB for videos. On the paid plan, these limits increase to 40MB for images, audio, and raw files and 2GB for videos. These limits can be further increased with higher-tier plans. + * On the free plan, the maximum upload file sizes are 25MB for images, audio, and raw files and 100MB for videos. On the Lite paid plan, these limits increase to 40MB for images, audio, and raw files and 300MB for videos, whereas on the Pro paid plan, these limits increase to 50MB for images, audio, and raw files and 2GB for videos. These limits can be further increased with enterprise plans. * * **Version limit** \ * A file can have a maximum of 100 versions. diff --git a/src/Services/Beta/V2/FilesRawService.php b/src/Services/Beta/V2/FilesRawService.php index d63153f7..a73c356f 100644 --- a/src/Services/Beta/V2/FilesRawService.php +++ b/src/Services/Beta/V2/FilesRawService.php @@ -35,7 +35,7 @@ public function __construct(private Client $client) {} * ImageKit.io allows you to upload files directly from both the server and client sides. For server-side uploads, private API key authentication is used. For client-side uploads, generate a one-time `token` from your secure backend using private API. [Learn more](/docs/api-reference/upload-file/upload-file-v2#how-to-implement-secure-client-side-file-upload) about how to implement secure client-side file upload. * * **File size limit** \ - * On the free plan, the maximum upload file sizes are 20MB for images, audio, and raw files, and 100MB for videos. On the paid plan, these limits increase to 40MB for images, audio, and raw files, and 2GB for videos. These limits can be further increased with higher-tier plans. + * On the free plan, the maximum upload file sizes are 25MB for images, audio, and raw files, and 100MB for videos. On the Lite paid plan, these limits increase to 40MB for images, audio, and raw files and 300MB for videos, whereas on the Pro paid plan, these limits increase to 50MB for images, audio, and raw files and 2GB for videos. These limits can be further increased with enterprise plans. * * **Version limit** \ * A file can have a maximum of 100 versions. diff --git a/src/Services/Beta/V2/FilesService.php b/src/Services/Beta/V2/FilesService.php index 63e57f4b..4688fc5e 100644 --- a/src/Services/Beta/V2/FilesService.php +++ b/src/Services/Beta/V2/FilesService.php @@ -41,7 +41,7 @@ public function __construct(private Client $client) * ImageKit.io allows you to upload files directly from both the server and client sides. For server-side uploads, private API key authentication is used. For client-side uploads, generate a one-time `token` from your secure backend using private API. [Learn more](/docs/api-reference/upload-file/upload-file-v2#how-to-implement-secure-client-side-file-upload) about how to implement secure client-side file upload. * * **File size limit** \ - * On the free plan, the maximum upload file sizes are 20MB for images, audio, and raw files, and 100MB for videos. On the paid plan, these limits increase to 40MB for images, audio, and raw files, and 2GB for videos. These limits can be further increased with higher-tier plans. + * On the free plan, the maximum upload file sizes are 25MB for images, audio, and raw files, and 100MB for videos. On the Lite paid plan, these limits increase to 40MB for images, audio, and raw files and 300MB for videos, whereas on the Pro paid plan, these limits increase to 50MB for images, audio, and raw files and 2GB for videos. These limits can be further increased with enterprise plans. * * **Version limit** \ * A file can have a maximum of 100 versions. diff --git a/src/Services/FilesRawService.php b/src/Services/FilesRawService.php index 1cf5ca96..e729ebed 100644 --- a/src/Services/FilesRawService.php +++ b/src/Services/FilesRawService.php @@ -246,7 +246,7 @@ public function rename( * The [V2 API](/docs/api-reference/upload-file/upload-file-v2) enhances security by verifying the entire payload using JWT. * * **File size limit** \ - * On the free plan, the maximum upload file sizes are 20MB for images, audio, and raw files and 100MB for videos. On the paid plan, these limits increase to 40MB for images, audio, and raw files and 2GB for videos. These limits can be further increased with higher-tier plans. + * On the free plan, the maximum upload file sizes are 25MB for images, audio, and raw files and 100MB for videos. On the Lite paid plan, these limits increase to 40MB for images, audio, and raw files and 300MB for videos, whereas on the Pro paid plan, these limits increase to 50MB for images, audio, and raw files and 2GB for videos. These limits can be further increased with enterprise plans. * * **Version limit** \ * A file can have a maximum of 100 versions. diff --git a/src/Services/FilesService.php b/src/Services/FilesService.php index e92983fc..32ccb73e 100644 --- a/src/Services/FilesService.php +++ b/src/Services/FilesService.php @@ -273,7 +273,7 @@ public function rename( * The [V2 API](/docs/api-reference/upload-file/upload-file-v2) enhances security by verifying the entire payload using JWT. * * **File size limit** \ - * On the free plan, the maximum upload file sizes are 20MB for images, audio, and raw files and 100MB for videos. On the paid plan, these limits increase to 40MB for images, audio, and raw files and 2GB for videos. These limits can be further increased with higher-tier plans. + * On the free plan, the maximum upload file sizes are 25MB for images, audio, and raw files and 100MB for videos. On the Lite paid plan, these limits increase to 40MB for images, audio, and raw files and 300MB for videos, whereas on the Pro paid plan, these limits increase to 50MB for images, audio, and raw files and 2GB for videos. These limits can be further increased with enterprise plans. * * **Version limit** \ * A file can have a maximum of 100 versions. diff --git a/src/Transformation.php b/src/Transformation.php index 2f93557f..d26672fd 100644 --- a/src/Transformation.php +++ b/src/Transformation.php @@ -22,6 +22,7 @@ * * @phpstan-import-type AIDropShadowVariants from \Imagekit\Transformation\AIDropShadow * @phpstan-import-type AspectRatioVariants from \Imagekit\Transformation\AspectRatio + * @phpstan-import-type DprVariants from \Imagekit\Transformation\Dpr * @phpstan-import-type DurationVariants from \Imagekit\Transformation\Duration * @phpstan-import-type EndOffsetVariants from \Imagekit\Transformation\EndOffset * @phpstan-import-type GradientVariants from \Imagekit\Transformation\Gradient @@ -41,6 +42,7 @@ * @phpstan-import-type YCenterVariants from \Imagekit\Transformation\YCenter * @phpstan-import-type AIDropShadowShape from \Imagekit\Transformation\AIDropShadow * @phpstan-import-type AspectRatioShape from \Imagekit\Transformation\AspectRatio + * @phpstan-import-type DprShape from \Imagekit\Transformation\Dpr * @phpstan-import-type DurationShape from \Imagekit\Transformation\Duration * @phpstan-import-type EndOffsetShape from \Imagekit\Transformation\EndOffset * @phpstan-import-type GradientShape from \Imagekit\Transformation\Gradient @@ -80,7 +82,7 @@ * cropMode?: null|CropMode|value-of, * defaultImage?: string|null, * distort?: string|null, - * dpr?: float|null, + * dpr?: DprShape|null, * duration?: DurationShape|null, * endOffset?: EndOffsetShape|null, * flip?: null|Flip|value-of, @@ -296,9 +298,11 @@ final class Transformation implements BaseModel * Accepts values between 0.1 and 5, or `auto` for automatic device pixel ratio (DPR) calculation. Also accepts arithmetic expressions. * - Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). * - See [DPR](https://imagekit.io/docs/image-resize-and-crop#dpr---dpr). + * + * @var DprVariants|null $dpr */ #[Optional] - public ?float $dpr; + public float|string|null $dpr; /** * Specifies the duration (in seconds) for trimming videos, e.g., `5` or `10.5`. @@ -609,6 +613,7 @@ public function __construct() * @param AudioCodec|value-of|null $audioCodec * @param Crop|value-of|null $crop * @param CropMode|value-of|null $cropMode + * @param DprShape|null $dpr * @param DurationShape|null $duration * @param EndOffsetShape|null $endOffset * @param Flip|value-of|null $flip @@ -652,7 +657,7 @@ public static function with( CropMode|string|null $cropMode = null, ?string $defaultImage = null, ?string $distort = null, - ?float $dpr = null, + float|string|null $dpr = null, float|string|null $duration = null, float|string|null $endOffset = null, Flip|string|null $flip = null, @@ -1023,8 +1028,10 @@ public function withDistort(string $distort): self * Accepts values between 0.1 and 5, or `auto` for automatic device pixel ratio (DPR) calculation. Also accepts arithmetic expressions. * - Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). * - See [DPR](https://imagekit.io/docs/image-resize-and-crop#dpr---dpr). + * + * @param DprShape $dpr */ - public function withDpr(float $dpr): self + public function withDpr(float|string $dpr): self { $self = clone $this; $self['dpr'] = $dpr; diff --git a/src/Transformation/Dpr.php b/src/Transformation/Dpr.php new file mode 100644 index 00000000..7427a410 --- /dev/null +++ b/src/Transformation/Dpr.php @@ -0,0 +1,30 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} From ac20448a0f856ea1afa12b120dd59d3d33384cfc Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 01:54:23 +0000 Subject: [PATCH 142/193] chore(internal): upgrade phpunit --- composer.lock | 120 +++++++++++++++++++++++++++----------------------- 1 file changed, 66 insertions(+), 54 deletions(-) diff --git a/composer.lock b/composer.lock index 3f6c209a..7a5e63d9 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5fc63f7c84d94b42416689723c547f69", + "content-hash": "ffa287ea8babf60e021f37e62c6c207a", "packages": [ { "name": "php-http/discovery", @@ -194,16 +194,16 @@ "packages-dev": [ { "name": "brianium/paratest", - "version": "v7.8.4", + "version": "v7.8.5", "source": { "type": "git", "url": "https://github.com/paratestphp/paratest.git", - "reference": "130a9bf0e269ee5f5b320108f794ad03e275cad4" + "reference": "9b324c8fc319cf9728b581c7a90e1c8f6361c5e5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/paratestphp/paratest/zipball/130a9bf0e269ee5f5b320108f794ad03e275cad4", - "reference": "130a9bf0e269ee5f5b320108f794ad03e275cad4", + "url": "https://api.github.com/repos/paratestphp/paratest/zipball/9b324c8fc319cf9728b581c7a90e1c8f6361c5e5", + "reference": "9b324c8fc319cf9728b581c7a90e1c8f6361c5e5", "shasum": "" }, "require": { @@ -211,27 +211,27 @@ "ext-pcre": "*", "ext-reflection": "*", "ext-simplexml": "*", - "fidry/cpu-core-counter": "^1.2.0", + "fidry/cpu-core-counter": "^1.3.0", "jean85/pretty-package-versions": "^2.1.1", - "php": "~8.2.0 || ~8.3.0 || ~8.4.0", - "phpunit/php-code-coverage": "^11.0.10", + "php": "~8.2.0 || ~8.3.0 || ~8.4.0 || ~8.5.0", + "phpunit/php-code-coverage": "^11.0.12", "phpunit/php-file-iterator": "^5.1.0", "phpunit/php-timer": "^7.0.1", - "phpunit/phpunit": "^11.5.24", + "phpunit/phpunit": "^11.5.46", "sebastian/environment": "^7.2.1", - "symfony/console": "^6.4.22 || ^7.3.0", - "symfony/process": "^6.4.20 || ^7.3.0" + "symfony/console": "^6.4.22 || ^7.3.4 || ^8.0.3", + "symfony/process": "^6.4.20 || ^7.3.4 || ^8.0.3" }, "require-dev": { "doctrine/coding-standard": "^12.0.0", "ext-pcov": "*", "ext-posix": "*", - "phpstan/phpstan": "^2.1.17", + "phpstan/phpstan": "^2.1.33", "phpstan/phpstan-deprecation-rules": "^2.0.3", - "phpstan/phpstan-phpunit": "^2.0.6", - "phpstan/phpstan-strict-rules": "^2.0.4", - "squizlabs/php_codesniffer": "^3.13.2", - "symfony/filesystem": "^6.4.13 || ^7.3.0" + "phpstan/phpstan-phpunit": "^2.0.11", + "phpstan/phpstan-strict-rules": "^2.0.7", + "squizlabs/php_codesniffer": "^3.13.5", + "symfony/filesystem": "^6.4.13 || ^7.3.2 || ^8.0.1" }, "bin": [ "bin/paratest", @@ -271,7 +271,7 @@ ], "support": { "issues": "https://github.com/paratestphp/paratest/issues", - "source": "https://github.com/paratestphp/paratest/tree/v7.8.4" + "source": "https://github.com/paratestphp/paratest/tree/v7.8.5" }, "funding": [ { @@ -283,7 +283,7 @@ "type": "paypal" } ], - "time": "2025-06-23T06:07:21+00:00" + "time": "2026-01-08T08:02:38+00:00" }, { "name": "clue/ndjson-react", @@ -1412,38 +1412,38 @@ }, { "name": "pestphp/pest", - "version": "v3.8.4", + "version": "v3.8.5", "source": { "type": "git", "url": "https://github.com/pestphp/pest.git", - "reference": "72cf695554420e21858cda831d5db193db102574" + "reference": "7796630eafcfd1c02660cecdde3bc6984fbf01f4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/pestphp/pest/zipball/72cf695554420e21858cda831d5db193db102574", - "reference": "72cf695554420e21858cda831d5db193db102574", + "url": "https://api.github.com/repos/pestphp/pest/zipball/7796630eafcfd1c02660cecdde3bc6984fbf01f4", + "reference": "7796630eafcfd1c02660cecdde3bc6984fbf01f4", "shasum": "" }, "require": { - "brianium/paratest": "^7.8.4", - "nunomaduro/collision": "^8.8.2", - "nunomaduro/termwind": "^2.3.1", + "brianium/paratest": "^7.8.5", + "nunomaduro/collision": "^8.8.3", + "nunomaduro/termwind": "^2.3.3", "pestphp/pest-plugin": "^3.0.0", "pestphp/pest-plugin-arch": "^3.1.1", "pestphp/pest-plugin-mutate": "^3.0.5", "php": "^8.2.0", - "phpunit/phpunit": "^11.5.33" + "phpunit/phpunit": "^11.5.50" }, "conflict": { "filp/whoops": "<2.16.0", - "phpunit/phpunit": ">11.5.33", + "phpunit/phpunit": ">11.5.50", "sebastian/exporter": "<6.0.0", "webmozart/assert": "<1.11.0" }, "require-dev": { "pestphp/pest-dev-tools": "^3.4.0", "pestphp/pest-plugin-type-coverage": "^3.6.1", - "symfony/process": "^7.3.0" + "symfony/process": "^7.4.4" }, "bin": [ "bin/pest" @@ -1508,7 +1508,7 @@ ], "support": { "issues": "https://github.com/pestphp/pest/issues", - "source": "https://github.com/pestphp/pest/tree/v3.8.4" + "source": "https://github.com/pestphp/pest/tree/v3.8.5" }, "funding": [ { @@ -1520,7 +1520,7 @@ "type": "github" } ], - "time": "2025-08-20T19:12:42+00:00" + "time": "2026-01-28T01:33:45+00:00" }, { "name": "pestphp/pest-plugin", @@ -2627,28 +2627,28 @@ }, { "name": "phpunit/php-file-iterator", - "version": "5.1.0", + "version": "5.1.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "118cfaaa8bc5aef3287bf315b6060b1174754af6" + "reference": "2f3a64888c814fc235386b7387dd5b5ed92ad903" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/118cfaaa8bc5aef3287bf315b6060b1174754af6", - "reference": "118cfaaa8bc5aef3287bf315b6060b1174754af6", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/2f3a64888c814fc235386b7387dd5b5ed92ad903", + "reference": "2f3a64888c814fc235386b7387dd5b5ed92ad903", "shasum": "" }, "require": { "php": ">=8.2" }, "require-dev": { - "phpunit/phpunit": "^11.0" + "phpunit/phpunit": "^11.3" }, "type": "library", "extra": { "branch-alias": { - "dev-main": "5.0-dev" + "dev-main": "5.1-dev" } }, "autoload": { @@ -2676,15 +2676,27 @@ "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", "security": "https://github.com/sebastianbergmann/php-file-iterator/security/policy", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/5.1.0" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/5.1.1" }, "funding": [ { "url": "https://github.com/sebastianbergmann", "type": "github" + }, + { + "url": "https://liberapay.com/sebastianbergmann", + "type": "liberapay" + }, + { + "url": "https://thanks.dev/u/gh/sebastianbergmann", + "type": "thanks_dev" + }, + { + "url": "https://tidelift.com/funding/github/packagist/phpunit/php-file-iterator", + "type": "tidelift" } ], - "time": "2024-08-27T05:02:59+00:00" + "time": "2026-02-02T13:52:54+00:00" }, { "name": "phpunit/php-invoker", @@ -2872,16 +2884,16 @@ }, { "name": "phpunit/phpunit", - "version": "11.5.33", + "version": "11.5.50", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "5965e9ff57546cb9137c0ff6aa78cb7442b05cf6" + "reference": "fdfc727f0fcacfeb8fcb30c7e5da173125b58be3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5965e9ff57546cb9137c0ff6aa78cb7442b05cf6", - "reference": "5965e9ff57546cb9137c0ff6aa78cb7442b05cf6", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fdfc727f0fcacfeb8fcb30c7e5da173125b58be3", + "reference": "fdfc727f0fcacfeb8fcb30c7e5da173125b58be3", "shasum": "" }, "require": { @@ -2895,17 +2907,17 @@ "phar-io/manifest": "^2.0.4", "phar-io/version": "^3.2.1", "php": ">=8.2", - "phpunit/php-code-coverage": "^11.0.10", + "phpunit/php-code-coverage": "^11.0.12", "phpunit/php-file-iterator": "^5.1.0", "phpunit/php-invoker": "^5.0.1", "phpunit/php-text-template": "^4.0.1", "phpunit/php-timer": "^7.0.1", "sebastian/cli-parser": "^3.0.2", "sebastian/code-unit": "^3.0.3", - "sebastian/comparator": "^6.3.2", + "sebastian/comparator": "^6.3.3", "sebastian/diff": "^6.0.2", "sebastian/environment": "^7.2.1", - "sebastian/exporter": "^6.3.0", + "sebastian/exporter": "^6.3.2", "sebastian/global-state": "^7.0.2", "sebastian/object-enumerator": "^6.0.1", "sebastian/type": "^5.1.3", @@ -2953,7 +2965,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.33" + "source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.50" }, "funding": [ { @@ -2977,7 +2989,7 @@ "type": "tidelift" } ], - "time": "2025-08-16T05:19:02+00:00" + "time": "2026-01-27T05:59:18+00:00" }, { "name": "psr/container", @@ -3936,16 +3948,16 @@ }, { "name": "sebastian/comparator", - "version": "6.3.2", + "version": "6.3.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "85c77556683e6eee4323e4c5468641ca0237e2e8" + "reference": "2c95e1e86cb8dd41beb8d502057d1081ccc8eca9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/85c77556683e6eee4323e4c5468641ca0237e2e8", - "reference": "85c77556683e6eee4323e4c5468641ca0237e2e8", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/2c95e1e86cb8dd41beb8d502057d1081ccc8eca9", + "reference": "2c95e1e86cb8dd41beb8d502057d1081ccc8eca9", "shasum": "" }, "require": { @@ -4004,7 +4016,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", "security": "https://github.com/sebastianbergmann/comparator/security/policy", - "source": "https://github.com/sebastianbergmann/comparator/tree/6.3.2" + "source": "https://github.com/sebastianbergmann/comparator/tree/6.3.3" }, "funding": [ { @@ -4024,7 +4036,7 @@ "type": "tidelift" } ], - "time": "2025-08-10T08:07:46+00:00" + "time": "2026-01-24T09:26:40+00:00" }, { "name": "sebastian/complexity", @@ -6668,5 +6680,5 @@ "platform-overrides": { "php": "8.3" }, - "plugin-api-version": "2.6.0" + "plugin-api-version": "2.9.0" } From f229b603c92e55e54ebf745b07bc97a86ec04358 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 27 Feb 2026 20:36:47 +0000 Subject: [PATCH 143/193] feat(api): add webhook verification --- composer.json | 3 +- composer.lock | 47 ++++++- src/Client.php | 6 + src/Core/Conversion.php | 31 +++++ src/Core/Exceptions/WebhookException.php | 9 ++ src/ServiceContracts/WebhooksContract.php | 42 ++++++- src/Services/WebhooksService.php | 77 ++++++++++++ tests/Services/WebhooksTest.php | 145 ++++++++++++++++++++++ 8 files changed, 357 insertions(+), 3 deletions(-) create mode 100644 src/Core/Exceptions/WebhookException.php diff --git a/composer.json b/composer.json index 48a595ce..99de4d0c 100644 --- a/composer.json +++ b/composer.json @@ -34,7 +34,8 @@ "psr/http-client": "^1", "psr/http-client-implementation": "^1", "psr/http-factory-implementation": "^1", - "psr/http-message": "^1|^2" + "psr/http-message": "^1|^2", + "standard-webhooks/standard-webhooks": "^1" }, "require-dev": { "friendsofphp/php-cs-fixer": "^3", diff --git a/composer.lock b/composer.lock index 7a5e63d9..ba9f9683 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "ffa287ea8babf60e021f37e62c6c207a", + "content-hash": "70cc3a7109763fc87a44dd54d75f7387", "packages": [ { "name": "php-http/discovery", @@ -189,6 +189,51 @@ "source": "https://github.com/php-fig/http-message/tree/2.0" }, "time": "2023-04-04T09:54:51+00:00" + }, + { + "name": "standard-webhooks/standard-webhooks", + "version": "v1.0.0", + "source": { + "type": "git", + "url": "https://github.com/standard-webhooks/standard-webhooks.git", + "reference": "b03a68fe8b1904de92ba1df669dc8bd9c8226df3" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/standard-webhooks/standard-webhooks/zipball/b03a68fe8b1904de92ba1df669dc8bd9c8226df3", + "reference": "b03a68fe8b1904de92ba1df669dc8bd9c8226df3", + "shasum": "" + }, + "require": { + "php": "^8.0" + }, + "require-dev": { + "phpunit/phpunit": "^9.0 || ^10.0" + }, + "type": "library", + "autoload": { + "psr-4": { + "StandardWebhooks\\": "libraries/php/src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Standard Webhooks - Open source tools and guidelines for sending webhooks easily, securely, and reliably", + "homepage": "https://www.standardwebhooks.com", + "keywords": [ + "hmac", + "signature", + "standard-webhooks", + "verification", + "webhooks" + ], + "support": { + "issues": "https://github.com/standard-webhooks/standard-webhooks/issues", + "source": "https://github.com/standard-webhooks/standard-webhooks/tree/v1.0.0" + }, + "time": "2025-12-10T17:57:04+00:00" } ], "packages-dev": [ diff --git a/src/Client.php b/src/Client.php index ca43a498..4dc1af59 100644 --- a/src/Client.php +++ b/src/Client.php @@ -28,6 +28,8 @@ class Client extends BaseClient public string $password; + public string $webhookSecret; + public bool $baseUrlOverridden; /** @@ -81,6 +83,7 @@ class Client extends BaseClient public function __construct( ?string $privateKey = null, ?string $password = null, + ?string $webhookSecret = null, ?string $baseUrl = null, RequestOptions|array|null $requestOptions = null, ) { @@ -90,6 +93,9 @@ public function __construct( $this->password = (string) ($password ?? Util::getenv( 'OPTIONAL_IMAGEKIT_IGNORES_THIS' ) ?: 'do_not_set'); + $this->webhookSecret = (string) ($webhookSecret ?? Util::getenv( + 'IMAGEKIT_WEBHOOK_SECRET' + )); $this->baseUrlOverridden = !is_null($baseUrl); diff --git a/src/Core/Conversion.php b/src/Core/Conversion.php index 5cfc926f..67bc902f 100644 --- a/src/Core/Conversion.php +++ b/src/Core/Conversion.php @@ -170,6 +170,37 @@ private static function tryConvert(Converter|ConverterSource|string $target, mix return $value; + case 'DateTimeInterface': + case 'DateTimeImmutable': + if (is_string($value)) { + try { + ++$state->maybe; + + return new \DateTimeImmutable($value); + } catch (\Exception) { + --$state->maybe; + } + } + + ++$state->no; + + return $value; + + case 'DateTime': + if (is_string($value)) { + try { + ++$state->maybe; + + return new \DateTime($value); + } catch (\Exception) { + --$state->maybe; + } + } + + ++$state->no; + + return $value; + default: ++$state->no; diff --git a/src/Core/Exceptions/WebhookException.php b/src/Core/Exceptions/WebhookException.php new file mode 100644 index 00000000..3a58a39b --- /dev/null +++ b/src/Core/Exceptions/WebhookException.php @@ -0,0 +1,9 @@ +>|null $headers + * + * @throws WebhookException + */ + public function unsafeUnwrap( + string $body, + ?array $headers = null, + ?string $secret = null + ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent; + + /** + * @api + * + * Unwraps a webhook event from its JSON representation. + * + * @param array>|null $headers + * + * @throws WebhookException + */ + public function unwrap( + string $body, + ?array $headers = null, + ?string $secret = null + ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent; +} diff --git a/src/Services/WebhooksService.php b/src/Services/WebhooksService.php index 8f449290..6f5a3fc8 100644 --- a/src/Services/WebhooksService.php +++ b/src/Services/WebhooksService.php @@ -5,7 +5,21 @@ namespace Imagekit\Services; use Imagekit\Client; +use Imagekit\Core\Conversion; +use Imagekit\Core\Exceptions\WebhookException; +use Imagekit\Core\Util; use Imagekit\ServiceContracts\WebhooksContract; +use Imagekit\Webhooks\UnsafeUnwrapWebhookEvent; +use Imagekit\Webhooks\UnwrapWebhookEvent; +use Imagekit\Webhooks\UploadPostTransformErrorEvent; +use Imagekit\Webhooks\UploadPostTransformSuccessEvent; +use Imagekit\Webhooks\UploadPreTransformErrorEvent; +use Imagekit\Webhooks\UploadPreTransformSuccessEvent; +use Imagekit\Webhooks\VideoTransformationAcceptedEvent; +use Imagekit\Webhooks\VideoTransformationErrorEvent; +use Imagekit\Webhooks\VideoTransformationReadyEvent; +use StandardWebhooks\Exception\WebhookVerificationException; +use StandardWebhooks\Webhook; final class WebhooksService implements WebhooksContract { @@ -21,4 +35,67 @@ public function __construct(private Client $client) { $this->raw = new WebhooksRawService($client); } + + /** + * @api + * + * Unwraps a webhook event from its JSON representation. + * + * @param array>|null $headers + * + * @throws WebhookException + */ + public function unsafeUnwrap( + string $body, + ?array $headers = null, + ?string $secret = null + ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent { + try { + $decoded = Util::decodeJson($body); + + // @phpstan-ignore return.type + return Conversion::coerce(UnsafeUnwrapWebhookEvent::class, value: $decoded); + } catch (\Throwable $e) { + throw new WebhookException('Error parsing webhook body', previous: $e); + } + } + + /** + * @api + * + * Unwraps a webhook event from its JSON representation. + * + * @param array>|null $headers + * + * @throws WebhookException + */ + public function unwrap( + string $body, + ?array $headers = null, + ?string $secret = null + ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent { + if (null !== $headers) { + $secret = $secret ?? ($this->client->webhookSecret ?: null); + if (null === $secret) { + throw new WebhookException('Webhook key must not be null in order to unwrap'); + } + + try { + $flatHeaders = array_map(fn (string|array $v): string => is_array($v) ? $v[0] : $v, $headers); + $webhook = new Webhook($secret); + $webhook->verify($body, $flatHeaders); + } catch (WebhookVerificationException $e) { + throw new WebhookException('Could not verify webhook event signature', previous: $e); + } + } + + try { + $decoded = Util::decodeJson($body); + + // @phpstan-ignore return.type + return Conversion::coerce(UnwrapWebhookEvent::class, value: $decoded); + } catch (\Throwable $e) { + throw new WebhookException('Error parsing webhook body', previous: $e); + } + } } diff --git a/tests/Services/WebhooksTest.php b/tests/Services/WebhooksTest.php index dbe5ae26..a4e56284 100644 --- a/tests/Services/WebhooksTest.php +++ b/tests/Services/WebhooksTest.php @@ -3,9 +3,12 @@ namespace Tests\Services; use Imagekit\Client; +use Imagekit\Core\Exceptions\WebhookException; use Imagekit\Core\Util; use PHPUnit\Framework\Attributes\CoversNothing; +use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; +use StandardWebhooks\Webhook; /** * @internal @@ -28,4 +31,146 @@ protected function setUp(): void $this->client = $client; } + + #[Test] + public function testUnsafeUnwrap(): void + { + $payload = '{"id":"id","type":"video.transformation.accepted","created_at":"2019-12-27T18:11:19.117Z","data":{"asset":{"url":"https://example.com"},"transformation":{"type":"video-transformation","options":{"audio_codec":"aac","auto_rotate":true,"format":"mp4","quality":0,"stream_protocol":"HLS","variants":["string"],"video_codec":"h264"}}},"request":{"url":"https://example.com","x_request_id":"x_request_id","user_agent":"user_agent"}}'; + $this->client->webhooks->unsafeUnwrap($payload); + // unwrap successful if not error thrown, increment assertion count to avoid risky test warning + $this->addToAssertionCount(1); + } + + #[Test] + public function testUnsafeUnwrapBadJson(): void + { + $this->expectException(WebhookException::class); + + $badPayload = 'not a json string'; + $this->client->webhooks->unsafeUnwrap($badPayload); + } + + #[Test] + public function testUnwrap(): void + { + $payload = '{"id":"id","type":"video.transformation.accepted","created_at":"2019-12-27T18:11:19.117Z","data":{"asset":{"url":"https://example.com"},"transformation":{"type":"video-transformation","options":{"audio_codec":"aac","auto_rotate":true,"format":"mp4","quality":0,"stream_protocol":"HLS","variants":["string"],"video_codec":"h264"}}},"request":{"url":"https://example.com","x_request_id":"x_request_id","user_agent":"user_agent"}}'; + $this->client->webhooks->unwrap($payload); + // unwrap successful if not error thrown, increment assertion count to avoid risky test warning + $this->addToAssertionCount(1); + } + + #[Test] + public function testUnwrapBadJson(): void + { + $this->expectException(WebhookException::class); + + $badPayload = 'not a json string'; + $this->client->webhooks->unwrap($badPayload); + } + + #[Test] + public function testUnwrapWithVerification(): void + { + $payload = '{"id":"id","type":"video.transformation.accepted","created_at":"2019-12-27T18:11:19.117Z","data":{"asset":{"url":"https://example.com"},"transformation":{"type":"video-transformation","options":{"audio_codec":"aac","auto_rotate":true,"format":"mp4","quality":0,"stream_protocol":"HLS","variants":["string"],"video_codec":"h264"}}},"request":{"url":"https://example.com","x_request_id":"x_request_id","user_agent":"user_agent"}}'; + $secret = 'whsec_c2VjcmV0Cg=='; + $webhook = new Webhook($secret); + $messageId = '1'; + $timestamp = time(); + $signature = $webhook->sign($messageId, $timestamp, $payload); + + /** @var array> $headers */ + $headers = [ + 'webhook-signature' => [$signature], + 'webhook-id' => [$messageId], + 'webhook-timestamp' => [(string) $timestamp], + ]; + $this->client->webhooks->unwrap($payload, $headers, $secret); + // unwrap successful if not error thrown, increment assertion count to avoid risky test warning + $this->addToAssertionCount(1); + } + + #[Test] + public function testUnwrapWrongKey(): void + { + $this->expectException(WebhookException::class); + + $payload = '{"id":"id","type":"video.transformation.accepted","created_at":"2019-12-27T18:11:19.117Z","data":{"asset":{"url":"https://example.com"},"transformation":{"type":"video-transformation","options":{"audio_codec":"aac","auto_rotate":true,"format":"mp4","quality":0,"stream_protocol":"HLS","variants":["string"],"video_codec":"h264"}}},"request":{"url":"https://example.com","x_request_id":"x_request_id","user_agent":"user_agent"}}'; + $secret = 'whsec_c2VjcmV0Cg=='; + $webhook = new Webhook($secret); + $messageId = '1'; + $timestamp = time(); + $signature = $webhook->sign($messageId, $timestamp, $payload); + + /** @var array> $headers */ + $headers = [ + 'webhook-signature' => [$signature], + 'webhook-id' => [$messageId], + 'webhook-timestamp' => [(string) $timestamp], + ]; + $wrongKey = 'whsec_aaaaaaaaaa'; + $this->client->webhooks->unwrap($payload, $headers, $wrongKey); + } + + #[Test] + public function testUnwrapBadSignature(): void + { + $this->expectException(WebhookException::class); + + $payload = '{"id":"id","type":"video.transformation.accepted","created_at":"2019-12-27T18:11:19.117Z","data":{"asset":{"url":"https://example.com"},"transformation":{"type":"video-transformation","options":{"audio_codec":"aac","auto_rotate":true,"format":"mp4","quality":0,"stream_protocol":"HLS","variants":["string"],"video_codec":"h264"}}},"request":{"url":"https://example.com","x_request_id":"x_request_id","user_agent":"user_agent"}}'; + $secret = 'whsec_c2VjcmV0Cg=='; + $webhook = new Webhook($secret); + $messageId = '1'; + $timestamp = time(); + $badSig = $webhook->sign($messageId, $timestamp, 'some other payload'); + + /** @var array> $headers */ + $headers = [ + 'webhook-signature' => [$badSig], + 'webhook-id' => [$messageId], + 'webhook-timestamp' => [(string) $timestamp], + ]; + $this->client->webhooks->unwrap($payload, $headers, $secret); + } + + #[Test] + public function testUnwrapOldTimestamp(): void + { + $this->expectException(WebhookException::class); + + $payload = '{"id":"id","type":"video.transformation.accepted","created_at":"2019-12-27T18:11:19.117Z","data":{"asset":{"url":"https://example.com"},"transformation":{"type":"video-transformation","options":{"audio_codec":"aac","auto_rotate":true,"format":"mp4","quality":0,"stream_protocol":"HLS","variants":["string"],"video_codec":"h264"}}},"request":{"url":"https://example.com","x_request_id":"x_request_id","user_agent":"user_agent"}}'; + $secret = 'whsec_c2VjcmV0Cg=='; + $webhook = new Webhook($secret); + $messageId = '1'; + $timestamp = time(); + $signature = $webhook->sign($messageId, $timestamp, $payload); + + /** @var array> $headers */ + $headers = [ + 'webhook-signature' => [$signature], + 'webhook-id' => [$messageId], + 'webhook-timestamp' => ['5'], + ]; + $this->client->webhooks->unwrap($payload, $headers, $secret); + } + + #[Test] + public function testUnwrapWrongMessageID(): void + { + $this->expectException(WebhookException::class); + + $payload = '{"id":"id","type":"video.transformation.accepted","created_at":"2019-12-27T18:11:19.117Z","data":{"asset":{"url":"https://example.com"},"transformation":{"type":"video-transformation","options":{"audio_codec":"aac","auto_rotate":true,"format":"mp4","quality":0,"stream_protocol":"HLS","variants":["string"],"video_codec":"h264"}}},"request":{"url":"https://example.com","x_request_id":"x_request_id","user_agent":"user_agent"}}'; + $secret = 'whsec_c2VjcmV0Cg=='; + $webhook = new Webhook($secret); + $messageId = '1'; + $timestamp = time(); + $signature = $webhook->sign($messageId, $timestamp, $payload); + + /** @var array> $headers */ + $headers = [ + 'webhook-signature' => [$signature], + 'webhook-id' => ['wrong'], + 'webhook-timestamp' => [(string) $timestamp], + ]; + $this->client->webhooks->unwrap($payload, $headers, $secret); + } } From b97b7d6717de6ffcd76dff3d159081f7bfd31360 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 5 Mar 2026 03:17:10 +0000 Subject: [PATCH 144/193] feat(api): revert dpr breaking change --- .stats.yml | 4 ++-- src/Transformation.php | 15 ++++----------- src/Transformation/Dpr.php | 30 ------------------------------ 3 files changed, 6 insertions(+), 43 deletions(-) delete mode 100644 src/Transformation/Dpr.php diff --git a/.stats.yml b/.stats.yml index 7401c19f..749d6988 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-e5b5a158784fff63311ceef956e8d5ce9e87c6b557d23ab737270040eb39adcd.yml -openapi_spec_hash: b0293985a8806f367319af573d1b418c +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-83a7f3659a437113f2a79e1e72794be19eff00ec232fd0206198c80364ccfebf.yml +openapi_spec_hash: b327552548ab641eb4ea3b45e643dfce config_hash: 47cb702ee2cb52c58d803ae39ade9b44 diff --git a/src/Transformation.php b/src/Transformation.php index d26672fd..2f93557f 100644 --- a/src/Transformation.php +++ b/src/Transformation.php @@ -22,7 +22,6 @@ * * @phpstan-import-type AIDropShadowVariants from \Imagekit\Transformation\AIDropShadow * @phpstan-import-type AspectRatioVariants from \Imagekit\Transformation\AspectRatio - * @phpstan-import-type DprVariants from \Imagekit\Transformation\Dpr * @phpstan-import-type DurationVariants from \Imagekit\Transformation\Duration * @phpstan-import-type EndOffsetVariants from \Imagekit\Transformation\EndOffset * @phpstan-import-type GradientVariants from \Imagekit\Transformation\Gradient @@ -42,7 +41,6 @@ * @phpstan-import-type YCenterVariants from \Imagekit\Transformation\YCenter * @phpstan-import-type AIDropShadowShape from \Imagekit\Transformation\AIDropShadow * @phpstan-import-type AspectRatioShape from \Imagekit\Transformation\AspectRatio - * @phpstan-import-type DprShape from \Imagekit\Transformation\Dpr * @phpstan-import-type DurationShape from \Imagekit\Transformation\Duration * @phpstan-import-type EndOffsetShape from \Imagekit\Transformation\EndOffset * @phpstan-import-type GradientShape from \Imagekit\Transformation\Gradient @@ -82,7 +80,7 @@ * cropMode?: null|CropMode|value-of, * defaultImage?: string|null, * distort?: string|null, - * dpr?: DprShape|null, + * dpr?: float|null, * duration?: DurationShape|null, * endOffset?: EndOffsetShape|null, * flip?: null|Flip|value-of, @@ -298,11 +296,9 @@ final class Transformation implements BaseModel * Accepts values between 0.1 and 5, or `auto` for automatic device pixel ratio (DPR) calculation. Also accepts arithmetic expressions. * - Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). * - See [DPR](https://imagekit.io/docs/image-resize-and-crop#dpr---dpr). - * - * @var DprVariants|null $dpr */ #[Optional] - public float|string|null $dpr; + public ?float $dpr; /** * Specifies the duration (in seconds) for trimming videos, e.g., `5` or `10.5`. @@ -613,7 +609,6 @@ public function __construct() * @param AudioCodec|value-of|null $audioCodec * @param Crop|value-of|null $crop * @param CropMode|value-of|null $cropMode - * @param DprShape|null $dpr * @param DurationShape|null $duration * @param EndOffsetShape|null $endOffset * @param Flip|value-of|null $flip @@ -657,7 +652,7 @@ public static function with( CropMode|string|null $cropMode = null, ?string $defaultImage = null, ?string $distort = null, - float|string|null $dpr = null, + ?float $dpr = null, float|string|null $duration = null, float|string|null $endOffset = null, Flip|string|null $flip = null, @@ -1028,10 +1023,8 @@ public function withDistort(string $distort): self * Accepts values between 0.1 and 5, or `auto` for automatic device pixel ratio (DPR) calculation. Also accepts arithmetic expressions. * - Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). * - See [DPR](https://imagekit.io/docs/image-resize-and-crop#dpr---dpr). - * - * @param DprShape $dpr */ - public function withDpr(float|string $dpr): self + public function withDpr(float $dpr): self { $self = clone $this; $self['dpr'] = $dpr; diff --git a/src/Transformation/Dpr.php b/src/Transformation/Dpr.php deleted file mode 100644 index 7427a410..00000000 --- a/src/Transformation/Dpr.php +++ /dev/null @@ -1,30 +0,0 @@ -|array - */ - public static function variants(): array - { - return ['float', 'string']; - } -} From 497b114e1861becb85e3e6682ae6421a1a607857 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 7 Mar 2026 13:25:04 +0000 Subject: [PATCH 145/193] fix(client): handle C-style escaped characters --- tests/Services/Beta/V2/FilesTest.php | 2 +- tests/Services/FilesTest.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/Services/Beta/V2/FilesTest.php b/tests/Services/Beta/V2/FilesTest.php index b923d1ea..000a4df1 100644 --- a/tests/Services/Beta/V2/FilesTest.php +++ b/tests/Services/Beta/V2/FilesTest.php @@ -59,7 +59,7 @@ public function testUploadWithOptionalParams(): void file: 'file', fileName: 'fileName', token: 'token', - checks: '"request.folder" : "marketing/"\n', + checks: "\"request.folder\" : \"marketing/\"\n", customCoordinates: 'customCoordinates', customMetadata: ['brand' => 'bar', 'color' => 'bar'], description: 'Running shoes', diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index 17a01b27..ae755594 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -198,7 +198,7 @@ public function testUploadWithOptionalParams(): void file: 'file', fileName: 'fileName', token: 'token', - checks: '"request.folder" : "marketing/"\n', + checks: "\"request.folder\" : \"marketing/\"\n", customCoordinates: 'customCoordinates', customMetadata: ['brand' => 'bar', 'color' => 'bar'], description: 'Running shoes', From 0aea279726fe6954cfdfc84c121e45ce9342f7b4 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 11 Mar 2026 16:24:03 +0000 Subject: [PATCH 146/193] fix!: remove unused webhook params --- src/ServiceContracts/WebhooksContract.php | 6 +----- src/Services/WebhooksService.php | 6 +----- 2 files changed, 2 insertions(+), 10 deletions(-) diff --git a/src/ServiceContracts/WebhooksContract.php b/src/ServiceContracts/WebhooksContract.php index a6868b5f..92de912f 100644 --- a/src/ServiceContracts/WebhooksContract.php +++ b/src/ServiceContracts/WebhooksContract.php @@ -20,14 +20,10 @@ interface WebhooksContract * * Unwraps a webhook event from its JSON representation. * - * @param array>|null $headers - * * @throws WebhookException */ public function unsafeUnwrap( - string $body, - ?array $headers = null, - ?string $secret = null + string $body ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent; /** diff --git a/src/Services/WebhooksService.php b/src/Services/WebhooksService.php index 6f5a3fc8..db2b4f38 100644 --- a/src/Services/WebhooksService.php +++ b/src/Services/WebhooksService.php @@ -41,14 +41,10 @@ public function __construct(private Client $client) * * Unwraps a webhook event from its JSON representation. * - * @param array>|null $headers - * * @throws WebhookException */ public function unsafeUnwrap( - string $body, - ?array $headers = null, - ?string $secret = null + string $body ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent { try { $decoded = Util::decodeJson($body); From df01794af8a40d7154495cdc1c33cb51c3875cf2 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 16 Mar 2026 20:46:38 +0000 Subject: [PATCH 147/193] chore(internal): tweak CI branches --- .github/workflows/ci.yml | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fb9e4769..dffb8a6f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,12 +1,14 @@ name: CI on: push: - branches-ignore: - - 'generated' - - 'codegen/**' - - 'integrated/**' - - 'stl-preview-head/**' - - 'stl-preview-base/**' + branches: + - '**' + - '!integrated/**' + - '!stl-preview-head/**' + - '!stl-preview-base/**' + - '!generated' + - '!codegen/**' + - 'codegen/stl/**' pull_request: branches-ignore: - 'stl-preview-head/**' From 0f5776049a1c25d6d957d1f93d919db41ea3de33 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 6 Apr 2026 06:34:49 +0000 Subject: [PATCH 148/193] feat(api): Introduce lxc, lyc, lap parameters in overlays. --- .stats.yml | 4 +- .../Task/AITaskSelectMetadata.php | 4 +- .../Task/AITaskSelectTags.php | 4 +- .../Task/AITaskSelectMetadata.php | 4 +- .../Task/AITaskSelectTags.php | 4 +- src/OverlayPosition.php | 110 +++++++++++++++++- src/OverlayPosition/AnchorPoint.php | 32 +++++ src/OverlayPosition/Focus.php | 1 + src/OverlayPosition/XCenter.php | 32 +++++ src/OverlayPosition/YCenter.php | 32 +++++ 10 files changed, 215 insertions(+), 12 deletions(-) create mode 100644 src/OverlayPosition/AnchorPoint.php create mode 100644 src/OverlayPosition/XCenter.php create mode 100644 src/OverlayPosition/YCenter.php diff --git a/.stats.yml b/.stats.yml index 749d6988..df5aafb6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-83a7f3659a437113f2a79e1e72794be19eff00ec232fd0206198c80364ccfebf.yml -openapi_spec_hash: b327552548ab641eb4ea3b45e643dfce +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-63aff1629530786015da3c86131afa8a9b60545d488884b77641f1d4b89c6e9d.yml +openapi_spec_hash: 586d357bd7e5217d240a99e0d83c6d1f config_hash: 47cb702ee2cb52c58d803ae39ade9b44 diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata.php index 2ca98efa..a5962d70 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata.php @@ -61,7 +61,7 @@ final class AITaskSelectMetadata implements BaseModel public ?int $minSelections; /** - * Array of possible values matching the custom metadata field type. + * An array of possible values matching the custom metadata field type. If not provided for SingleSelect or MultiSelect field types, all values from the custom metadata field definition will be used. When providing large vocabularies (above 30 items), the AI may not strictly adhere to the list. * * @var list|null $vocabulary */ @@ -171,7 +171,7 @@ public function withMinSelections(int $minSelections): self } /** - * Array of possible values matching the custom metadata field type. + * An array of possible values matching the custom metadata field type. If not provided for SingleSelect or MultiSelect field types, all values from the custom metadata field definition will be used. When providing large vocabularies (above 30 items), the AI may not strictly adhere to the list. * * @param list $vocabulary */ diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php index 4586451e..862dba1a 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php @@ -50,7 +50,7 @@ final class AITaskSelectTags implements BaseModel public ?int $minSelections; /** - * Array of possible tag values. Combined length of all strings must not exceed 500 characters. Cannot contain the `%` character. + * Array of possible tag values. The combined length of all strings must not exceed 500 characters, and values cannot include the `%` character. When providing large vocabularies (more than 30 items), the AI may not follow the list strictly. * * @var list|null $vocabulary */ @@ -147,7 +147,7 @@ public function withMinSelections(int $minSelections): self } /** - * Array of possible tag values. Combined length of all strings must not exceed 500 characters. Cannot contain the `%` character. + * Array of possible tag values. The combined length of all strings must not exceed 500 characters, and values cannot include the `%` character. When providing large vocabularies (more than 30 items), the AI may not follow the list strictly. * * @param list $vocabulary */ diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata.php b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata.php index 7c67430e..20e502cd 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata.php @@ -61,7 +61,7 @@ final class AITaskSelectMetadata implements BaseModel public ?int $minSelections; /** - * Array of possible values matching the custom metadata field type. + * An array of possible values matching the custom metadata field type. If not provided for SingleSelect or MultiSelect field types, all values from the custom metadata field definition will be used. When providing large vocabularies (above 30 items), the AI may not strictly adhere to the list. * * @var list|null $vocabulary */ @@ -171,7 +171,7 @@ public function withMinSelections(int $minSelections): self } /** - * Array of possible values matching the custom metadata field type. + * An array of possible values matching the custom metadata field type. If not provided for SingleSelect or MultiSelect field types, all values from the custom metadata field definition will be used. When providing large vocabularies (above 30 items), the AI may not strictly adhere to the list. * * @param list $vocabulary */ diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php index 6026b95c..76a33c43 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php @@ -50,7 +50,7 @@ final class AITaskSelectTags implements BaseModel public ?int $minSelections; /** - * Array of possible tag values. Combined length of all strings must not exceed 500 characters. Cannot contain the `%` character. + * Array of possible tag values. The combined length of all strings must not exceed 500 characters, and values cannot include the `%` character. When providing large vocabularies (more than 30 items), the AI may not follow the list strictly. * * @var list|null $vocabulary */ @@ -147,7 +147,7 @@ public function withMinSelections(int $minSelections): self } /** - * Array of possible tag values. Combined length of all strings must not exceed 500 characters. Cannot contain the `%` character. + * Array of possible tag values. The combined length of all strings must not exceed 500 characters, and values cannot include the `%` character. When providing large vocabularies (more than 30 items), the AI may not follow the list strictly. * * @param list $vocabulary */ diff --git a/src/OverlayPosition.php b/src/OverlayPosition.php index 628a4e1d..1f008227 100644 --- a/src/OverlayPosition.php +++ b/src/OverlayPosition.php @@ -7,16 +7,26 @@ use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; +use Imagekit\OverlayPosition\AnchorPoint; use Imagekit\OverlayPosition\Focus; /** * @phpstan-import-type XVariants from \Imagekit\OverlayPosition\X + * @phpstan-import-type XCenterVariants from \Imagekit\OverlayPosition\XCenter * @phpstan-import-type YVariants from \Imagekit\OverlayPosition\Y + * @phpstan-import-type YCenterVariants from \Imagekit\OverlayPosition\YCenter * @phpstan-import-type XShape from \Imagekit\OverlayPosition\X + * @phpstan-import-type XCenterShape from \Imagekit\OverlayPosition\XCenter * @phpstan-import-type YShape from \Imagekit\OverlayPosition\Y + * @phpstan-import-type YCenterShape from \Imagekit\OverlayPosition\YCenter * * @phpstan-type OverlayPositionShape = array{ - * focus?: null|Focus|value-of, x?: XShape|null, y?: YShape|null + * anchorPoint?: null|AnchorPoint|value-of, + * focus?: null|Focus|value-of, + * x?: XShape|null, + * xCenter?: XCenterShape|null, + * y?: YShape|null, + * yCenter?: YCenterShape|null, * } */ final class OverlayPosition implements BaseModel @@ -24,8 +34,20 @@ final class OverlayPosition implements BaseModel /** @use SdkModel */ use SdkModel; + /** + * Sets the anchor point on the base asset from which the overlay offset is calculated. + * The default value is `top_left`. + * Maps to `lap` in the URL. + * Can only be used with one or more of `x`, `y`, `xCenter`, or `yCenter`. + * + * @var value-of|null $anchorPoint + */ + #[Optional(enum: AnchorPoint::class)] + public ?string $anchorPoint; + /** * Specifies the position of the overlay relative to the parent image or video. + * If one or more of `x`, `y`, `xCenter`, or `yCenter` parameters are specified, this parameter is ignored. * Maps to `lfo` in the URL. * * @var value-of|null $focus @@ -44,6 +66,18 @@ final class OverlayPosition implements BaseModel #[Optional] public float|string|null $x; + /** + * Specifies the x-coordinate on the base asset where the overlay's center will be positioned. + * It also accepts arithmetic expressions such as `bw_mul_0.4` or `bw_sub_cw`. + * Maps to `lxc` in the URL. + * Cannot be used together with `x`, but can be used with `y`. + * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * + * @var XCenterVariants|null $xCenter + */ + #[Optional] + public float|string|null $xCenter; + /** * Specifies the y-coordinate of the top-left corner of the base asset where the overlay's top-left corner will be positioned. * It also accepts arithmetic expressions such as `bh_mul_0.4` or `bh_sub_ch`. @@ -55,6 +89,18 @@ final class OverlayPosition implements BaseModel #[Optional] public float|string|null $y; + /** + * Specifies the y-coordinate on the base asset where the overlay's center will be positioned. + * It also accepts arithmetic expressions such as `bh_mul_0.4` or `bh_sub_ch`. + * Maps to `lyc` in the URL. + * Cannot be used together with `y`, but can be used with `x`. + * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * + * @var YCenterVariants|null $yCenter + */ + #[Optional] + public float|string|null $yCenter; + public function __construct() { $this->initialize(); @@ -65,26 +111,52 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * + * @param AnchorPoint|value-of|null $anchorPoint * @param Focus|value-of|null $focus * @param XShape|null $x + * @param XCenterShape|null $xCenter * @param YShape|null $y + * @param YCenterShape|null $yCenter */ public static function with( + AnchorPoint|string|null $anchorPoint = null, Focus|string|null $focus = null, float|string|null $x = null, - float|string|null $y = null + float|string|null $xCenter = null, + float|string|null $y = null, + float|string|null $yCenter = null, ): self { $self = new self; + null !== $anchorPoint && $self['anchorPoint'] = $anchorPoint; null !== $focus && $self['focus'] = $focus; null !== $x && $self['x'] = $x; + null !== $xCenter && $self['xCenter'] = $xCenter; null !== $y && $self['y'] = $y; + null !== $yCenter && $self['yCenter'] = $yCenter; + + return $self; + } + + /** + * Sets the anchor point on the base asset from which the overlay offset is calculated. + * The default value is `top_left`. + * Maps to `lap` in the URL. + * Can only be used with one or more of `x`, `y`, `xCenter`, or `yCenter`. + * + * @param AnchorPoint|value-of $anchorPoint + */ + public function withAnchorPoint(AnchorPoint|string $anchorPoint): self + { + $self = clone $this; + $self['anchorPoint'] = $anchorPoint; return $self; } /** * Specifies the position of the overlay relative to the parent image or video. + * If one or more of `x`, `y`, `xCenter`, or `yCenter` parameters are specified, this parameter is ignored. * Maps to `lfo` in the URL. * * @param Focus|value-of $focus @@ -113,6 +185,23 @@ public function withX(float|string $x): self return $self; } + /** + * Specifies the x-coordinate on the base asset where the overlay's center will be positioned. + * It also accepts arithmetic expressions such as `bw_mul_0.4` or `bw_sub_cw`. + * Maps to `lxc` in the URL. + * Cannot be used together with `x`, but can be used with `y`. + * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * + * @param XCenterShape $xCenter + */ + public function withXCenter(float|string $xCenter): self + { + $self = clone $this; + $self['xCenter'] = $xCenter; + + return $self; + } + /** * Specifies the y-coordinate of the top-left corner of the base asset where the overlay's top-left corner will be positioned. * It also accepts arithmetic expressions such as `bh_mul_0.4` or `bh_sub_ch`. @@ -128,4 +217,21 @@ public function withY(float|string $y): self return $self; } + + /** + * Specifies the y-coordinate on the base asset where the overlay's center will be positioned. + * It also accepts arithmetic expressions such as `bh_mul_0.4` or `bh_sub_ch`. + * Maps to `lyc` in the URL. + * Cannot be used together with `y`, but can be used with `x`. + * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * + * @param YCenterShape $yCenter + */ + public function withYCenter(float|string $yCenter): self + { + $self = clone $this; + $self['yCenter'] = $yCenter; + + return $self; + } } diff --git a/src/OverlayPosition/AnchorPoint.php b/src/OverlayPosition/AnchorPoint.php new file mode 100644 index 00000000..3558bdd6 --- /dev/null +++ b/src/OverlayPosition/AnchorPoint.php @@ -0,0 +1,32 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/OverlayPosition/YCenter.php b/src/OverlayPosition/YCenter.php new file mode 100644 index 00000000..39ac1c31 --- /dev/null +++ b/src/OverlayPosition/YCenter.php @@ -0,0 +1,32 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} From a9623d953b519a3b526dc98993a8e762459a0eae Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 06:07:52 +0000 Subject: [PATCH 149/193] feat(api): dam related webhook events --- .stats.yml | 6 +- README.md | 6 +- src/Client.php | 43 ------ .../Task/AITaskSelectMetadata.php | 4 +- .../Task/AITaskSelectTags.php | 4 +- .../Task/AITaskSelectMetadata.php | 4 +- .../Task/AITaskSelectTags.php | 4 +- src/OverlayPosition.php | 110 +------------- src/OverlayPosition/AnchorPoint.php | 32 ---- src/OverlayPosition/Focus.php | 1 - src/OverlayPosition/XCenter.php | 32 ---- src/OverlayPosition/YCenter.php | 32 ---- src/ServiceContracts/WebhooksContract.php | 9 +- src/Services/WebhooksService.php | 9 +- src/Webhooks/DamFileCreateEvent.php | 141 ++++++++++++++++++ src/Webhooks/DamFileDeleteEvent.php | 136 +++++++++++++++++ src/Webhooks/DamFileDeleteEvent/Data.php | 68 +++++++++ src/Webhooks/DamFileUpdateEvent.php | 141 ++++++++++++++++++ src/Webhooks/DamFileVersionCreateEvent.php | 128 ++++++++++++++++ src/Webhooks/DamFileVersionDeleteEvent.php | 136 +++++++++++++++++ .../DamFileVersionDeleteEvent/Data.php | 86 +++++++++++ src/Webhooks/UnsafeUnwrapWebhookEvent.php | 14 +- src/Webhooks/UnwrapWebhookEvent.php | 14 +- tests/ClientTest.php | 1 - tests/Services/Accounts/OriginsTest.php | 6 +- tests/Services/Accounts/URLEndpointsTest.php | 6 +- tests/Services/Accounts/UsageTest.php | 6 +- tests/Services/AssetsTest.php | 6 +- tests/Services/Beta/V2/FilesTest.php | 6 +- tests/Services/Cache/InvalidationTest.php | 6 +- tests/Services/CustomMetadataFieldsTest.php | 6 +- tests/Services/Files/BulkTest.php | 6 +- tests/Services/Files/MetadataTest.php | 6 +- tests/Services/Files/VersionsTest.php | 6 +- tests/Services/FilesTest.php | 6 +- tests/Services/Folders/JobTest.php | 6 +- tests/Services/FoldersTest.php | 6 +- tests/Services/SavedExtensionsTest.php | 6 +- tests/Services/WebhooksTest.php | 6 +- 39 files changed, 906 insertions(+), 345 deletions(-) delete mode 100644 src/OverlayPosition/AnchorPoint.php delete mode 100644 src/OverlayPosition/XCenter.php delete mode 100644 src/OverlayPosition/YCenter.php create mode 100644 src/Webhooks/DamFileCreateEvent.php create mode 100644 src/Webhooks/DamFileDeleteEvent.php create mode 100644 src/Webhooks/DamFileDeleteEvent/Data.php create mode 100644 src/Webhooks/DamFileUpdateEvent.php create mode 100644 src/Webhooks/DamFileVersionCreateEvent.php create mode 100644 src/Webhooks/DamFileVersionDeleteEvent.php create mode 100644 src/Webhooks/DamFileVersionDeleteEvent/Data.php diff --git a/.stats.yml b/.stats.yml index df5aafb6..3e331fe9 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-63aff1629530786015da3c86131afa8a9b60545d488884b77641f1d4b89c6e9d.yml -openapi_spec_hash: 586d357bd7e5217d240a99e0d83c6d1f -config_hash: 47cb702ee2cb52c58d803ae39ade9b44 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-1422f7513f230162270b197061e5768c2e0c803b94b8cd03a5e72544ac75a27f.yml +openapi_spec_hash: 41175e752e6f6ce900b36aecba687fa7 +config_hash: 17e408231b0b01676298010c7405f483 diff --git a/README.md b/README.md index 81583e5f..38692d19 100644 --- a/README.md +++ b/README.md @@ -35,8 +35,8 @@ Parameters with a default value must be set by name. use Imagekit\Client; $client = new Client( + privateKey: 'My Private Key', privateKey: getenv('IMAGEKIT_PRIVATE_KEY') ?: 'My Private Key', - password: getenv('OPTIONAL_IMAGEKIT_IGNORES_THIS') ?: 'do_not_set', ); $response = $client->files->upload(file: 'file', fileName: 'file-name.jpg'); @@ -105,7 +105,9 @@ You can use the `maxRetries` option to configure or disable this: use Imagekit\Client; // Configure the default for all requests: -$client = new Client(requestOptions: ['maxRetries' => 0]); +$client = new Client( + privateKey: 'My Private Key', requestOptions: ['maxRetries' => 0] +); // Or, configure per-request: $result = $client->files->upload( diff --git a/src/Client.php b/src/Client.php index 4dc1af59..ee283480 100644 --- a/src/Client.php +++ b/src/Client.php @@ -19,7 +19,6 @@ use Imagekit\Services\WebhooksService; /** - * @phpstan-import-type NormalizedRequest from \Imagekit\Core\BaseClient * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions */ class Client extends BaseClient @@ -139,46 +138,4 @@ public function __construct( $this->beta = new BetaService($this); $this->webhooks = new WebhooksService($this); } - - /** @return array */ - protected function authHeaders(): array - { - if (!$this->privateKey && !$this->password) { - return []; - } - - $base64_credentials = base64_encode( - "{$this->privateKey}:{$this->password}" - ); - - return ['Authorization' => "Basic {$base64_credentials}"]; - } - - /** - * @internal - * - * @param string|list $path - * @param array $query - * @param array|null> $headers - * @param RequestOpts|null $opts - * - * @return array{NormalizedRequest, RequestOptions} - */ - protected function buildRequest( - string $method, - string|array $path, - array $query, - array $headers, - mixed $body, - RequestOptions|array|null $opts, - ): array { - return parent::buildRequest( - method: $method, - path: $path, - query: $query, - headers: [...$this->authHeaders(), ...$headers], - body: $body, - opts: $opts, - ); - } } diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata.php index a5962d70..2ca98efa 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata.php @@ -61,7 +61,7 @@ final class AITaskSelectMetadata implements BaseModel public ?int $minSelections; /** - * An array of possible values matching the custom metadata field type. If not provided for SingleSelect or MultiSelect field types, all values from the custom metadata field definition will be used. When providing large vocabularies (above 30 items), the AI may not strictly adhere to the list. + * Array of possible values matching the custom metadata field type. * * @var list|null $vocabulary */ @@ -171,7 +171,7 @@ public function withMinSelections(int $minSelections): self } /** - * An array of possible values matching the custom metadata field type. If not provided for SingleSelect or MultiSelect field types, all values from the custom metadata field definition will be used. When providing large vocabularies (above 30 items), the AI may not strictly adhere to the list. + * Array of possible values matching the custom metadata field type. * * @param list $vocabulary */ diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php index 862dba1a..4586451e 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php @@ -50,7 +50,7 @@ final class AITaskSelectTags implements BaseModel public ?int $minSelections; /** - * Array of possible tag values. The combined length of all strings must not exceed 500 characters, and values cannot include the `%` character. When providing large vocabularies (more than 30 items), the AI may not follow the list strictly. + * Array of possible tag values. Combined length of all strings must not exceed 500 characters. Cannot contain the `%` character. * * @var list|null $vocabulary */ @@ -147,7 +147,7 @@ public function withMinSelections(int $minSelections): self } /** - * Array of possible tag values. The combined length of all strings must not exceed 500 characters, and values cannot include the `%` character. When providing large vocabularies (more than 30 items), the AI may not follow the list strictly. + * Array of possible tag values. Combined length of all strings must not exceed 500 characters. Cannot contain the `%` character. * * @param list $vocabulary */ diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata.php b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata.php index 20e502cd..7c67430e 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata.php @@ -61,7 +61,7 @@ final class AITaskSelectMetadata implements BaseModel public ?int $minSelections; /** - * An array of possible values matching the custom metadata field type. If not provided for SingleSelect or MultiSelect field types, all values from the custom metadata field definition will be used. When providing large vocabularies (above 30 items), the AI may not strictly adhere to the list. + * Array of possible values matching the custom metadata field type. * * @var list|null $vocabulary */ @@ -171,7 +171,7 @@ public function withMinSelections(int $minSelections): self } /** - * An array of possible values matching the custom metadata field type. If not provided for SingleSelect or MultiSelect field types, all values from the custom metadata field definition will be used. When providing large vocabularies (above 30 items), the AI may not strictly adhere to the list. + * Array of possible values matching the custom metadata field type. * * @param list $vocabulary */ diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php index 76a33c43..6026b95c 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php @@ -50,7 +50,7 @@ final class AITaskSelectTags implements BaseModel public ?int $minSelections; /** - * Array of possible tag values. The combined length of all strings must not exceed 500 characters, and values cannot include the `%` character. When providing large vocabularies (more than 30 items), the AI may not follow the list strictly. + * Array of possible tag values. Combined length of all strings must not exceed 500 characters. Cannot contain the `%` character. * * @var list|null $vocabulary */ @@ -147,7 +147,7 @@ public function withMinSelections(int $minSelections): self } /** - * Array of possible tag values. The combined length of all strings must not exceed 500 characters, and values cannot include the `%` character. When providing large vocabularies (more than 30 items), the AI may not follow the list strictly. + * Array of possible tag values. Combined length of all strings must not exceed 500 characters. Cannot contain the `%` character. * * @param list $vocabulary */ diff --git a/src/OverlayPosition.php b/src/OverlayPosition.php index 1f008227..628a4e1d 100644 --- a/src/OverlayPosition.php +++ b/src/OverlayPosition.php @@ -7,26 +7,16 @@ use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\OverlayPosition\AnchorPoint; use Imagekit\OverlayPosition\Focus; /** * @phpstan-import-type XVariants from \Imagekit\OverlayPosition\X - * @phpstan-import-type XCenterVariants from \Imagekit\OverlayPosition\XCenter * @phpstan-import-type YVariants from \Imagekit\OverlayPosition\Y - * @phpstan-import-type YCenterVariants from \Imagekit\OverlayPosition\YCenter * @phpstan-import-type XShape from \Imagekit\OverlayPosition\X - * @phpstan-import-type XCenterShape from \Imagekit\OverlayPosition\XCenter * @phpstan-import-type YShape from \Imagekit\OverlayPosition\Y - * @phpstan-import-type YCenterShape from \Imagekit\OverlayPosition\YCenter * * @phpstan-type OverlayPositionShape = array{ - * anchorPoint?: null|AnchorPoint|value-of, - * focus?: null|Focus|value-of, - * x?: XShape|null, - * xCenter?: XCenterShape|null, - * y?: YShape|null, - * yCenter?: YCenterShape|null, + * focus?: null|Focus|value-of, x?: XShape|null, y?: YShape|null * } */ final class OverlayPosition implements BaseModel @@ -34,20 +24,8 @@ final class OverlayPosition implements BaseModel /** @use SdkModel */ use SdkModel; - /** - * Sets the anchor point on the base asset from which the overlay offset is calculated. - * The default value is `top_left`. - * Maps to `lap` in the URL. - * Can only be used with one or more of `x`, `y`, `xCenter`, or `yCenter`. - * - * @var value-of|null $anchorPoint - */ - #[Optional(enum: AnchorPoint::class)] - public ?string $anchorPoint; - /** * Specifies the position of the overlay relative to the parent image or video. - * If one or more of `x`, `y`, `xCenter`, or `yCenter` parameters are specified, this parameter is ignored. * Maps to `lfo` in the URL. * * @var value-of|null $focus @@ -66,18 +44,6 @@ final class OverlayPosition implements BaseModel #[Optional] public float|string|null $x; - /** - * Specifies the x-coordinate on the base asset where the overlay's center will be positioned. - * It also accepts arithmetic expressions such as `bw_mul_0.4` or `bw_sub_cw`. - * Maps to `lxc` in the URL. - * Cannot be used together with `x`, but can be used with `y`. - * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). - * - * @var XCenterVariants|null $xCenter - */ - #[Optional] - public float|string|null $xCenter; - /** * Specifies the y-coordinate of the top-left corner of the base asset where the overlay's top-left corner will be positioned. * It also accepts arithmetic expressions such as `bh_mul_0.4` or `bh_sub_ch`. @@ -89,18 +55,6 @@ final class OverlayPosition implements BaseModel #[Optional] public float|string|null $y; - /** - * Specifies the y-coordinate on the base asset where the overlay's center will be positioned. - * It also accepts arithmetic expressions such as `bh_mul_0.4` or `bh_sub_ch`. - * Maps to `lyc` in the URL. - * Cannot be used together with `y`, but can be used with `x`. - * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). - * - * @var YCenterVariants|null $yCenter - */ - #[Optional] - public float|string|null $yCenter; - public function __construct() { $this->initialize(); @@ -111,52 +65,26 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * - * @param AnchorPoint|value-of|null $anchorPoint * @param Focus|value-of|null $focus * @param XShape|null $x - * @param XCenterShape|null $xCenter * @param YShape|null $y - * @param YCenterShape|null $yCenter */ public static function with( - AnchorPoint|string|null $anchorPoint = null, Focus|string|null $focus = null, float|string|null $x = null, - float|string|null $xCenter = null, - float|string|null $y = null, - float|string|null $yCenter = null, + float|string|null $y = null ): self { $self = new self; - null !== $anchorPoint && $self['anchorPoint'] = $anchorPoint; null !== $focus && $self['focus'] = $focus; null !== $x && $self['x'] = $x; - null !== $xCenter && $self['xCenter'] = $xCenter; null !== $y && $self['y'] = $y; - null !== $yCenter && $self['yCenter'] = $yCenter; - - return $self; - } - - /** - * Sets the anchor point on the base asset from which the overlay offset is calculated. - * The default value is `top_left`. - * Maps to `lap` in the URL. - * Can only be used with one or more of `x`, `y`, `xCenter`, or `yCenter`. - * - * @param AnchorPoint|value-of $anchorPoint - */ - public function withAnchorPoint(AnchorPoint|string $anchorPoint): self - { - $self = clone $this; - $self['anchorPoint'] = $anchorPoint; return $self; } /** * Specifies the position of the overlay relative to the parent image or video. - * If one or more of `x`, `y`, `xCenter`, or `yCenter` parameters are specified, this parameter is ignored. * Maps to `lfo` in the URL. * * @param Focus|value-of $focus @@ -185,23 +113,6 @@ public function withX(float|string $x): self return $self; } - /** - * Specifies the x-coordinate on the base asset where the overlay's center will be positioned. - * It also accepts arithmetic expressions such as `bw_mul_0.4` or `bw_sub_cw`. - * Maps to `lxc` in the URL. - * Cannot be used together with `x`, but can be used with `y`. - * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). - * - * @param XCenterShape $xCenter - */ - public function withXCenter(float|string $xCenter): self - { - $self = clone $this; - $self['xCenter'] = $xCenter; - - return $self; - } - /** * Specifies the y-coordinate of the top-left corner of the base asset where the overlay's top-left corner will be positioned. * It also accepts arithmetic expressions such as `bh_mul_0.4` or `bh_sub_ch`. @@ -217,21 +128,4 @@ public function withY(float|string $y): self return $self; } - - /** - * Specifies the y-coordinate on the base asset where the overlay's center will be positioned. - * It also accepts arithmetic expressions such as `bh_mul_0.4` or `bh_sub_ch`. - * Maps to `lyc` in the URL. - * Cannot be used together with `y`, but can be used with `x`. - * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). - * - * @param YCenterShape $yCenter - */ - public function withYCenter(float|string $yCenter): self - { - $self = clone $this; - $self['yCenter'] = $yCenter; - - return $self; - } } diff --git a/src/OverlayPosition/AnchorPoint.php b/src/OverlayPosition/AnchorPoint.php deleted file mode 100644 index 3558bdd6..00000000 --- a/src/OverlayPosition/AnchorPoint.php +++ /dev/null @@ -1,32 +0,0 @@ -|array - */ - public static function variants(): array - { - return ['float', 'string']; - } -} diff --git a/src/OverlayPosition/YCenter.php b/src/OverlayPosition/YCenter.php deleted file mode 100644 index 39ac1c31..00000000 --- a/src/OverlayPosition/YCenter.php +++ /dev/null @@ -1,32 +0,0 @@ -|array - */ - public static function variants(): array - { - return ['float', 'string']; - } -} diff --git a/src/ServiceContracts/WebhooksContract.php b/src/ServiceContracts/WebhooksContract.php index 92de912f..7c90b14f 100644 --- a/src/ServiceContracts/WebhooksContract.php +++ b/src/ServiceContracts/WebhooksContract.php @@ -5,6 +5,11 @@ namespace Imagekit\ServiceContracts; use Imagekit\Core\Exceptions\WebhookException; +use Imagekit\Webhooks\DamFileCreateEvent; +use Imagekit\Webhooks\DamFileDeleteEvent; +use Imagekit\Webhooks\DamFileUpdateEvent; +use Imagekit\Webhooks\DamFileVersionCreateEvent; +use Imagekit\Webhooks\DamFileVersionDeleteEvent; use Imagekit\Webhooks\UploadPostTransformErrorEvent; use Imagekit\Webhooks\UploadPostTransformSuccessEvent; use Imagekit\Webhooks\UploadPreTransformErrorEvent; @@ -24,7 +29,7 @@ interface WebhooksContract */ public function unsafeUnwrap( string $body - ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent; + ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|DamFileCreateEvent|DamFileUpdateEvent|DamFileDeleteEvent|DamFileVersionCreateEvent|DamFileVersionDeleteEvent; /** * @api @@ -39,5 +44,5 @@ public function unwrap( string $body, ?array $headers = null, ?string $secret = null - ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent; + ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|DamFileCreateEvent|DamFileUpdateEvent|DamFileDeleteEvent|DamFileVersionCreateEvent|DamFileVersionDeleteEvent; } diff --git a/src/Services/WebhooksService.php b/src/Services/WebhooksService.php index db2b4f38..80552fef 100644 --- a/src/Services/WebhooksService.php +++ b/src/Services/WebhooksService.php @@ -9,6 +9,11 @@ use Imagekit\Core\Exceptions\WebhookException; use Imagekit\Core\Util; use Imagekit\ServiceContracts\WebhooksContract; +use Imagekit\Webhooks\DamFileCreateEvent; +use Imagekit\Webhooks\DamFileDeleteEvent; +use Imagekit\Webhooks\DamFileUpdateEvent; +use Imagekit\Webhooks\DamFileVersionCreateEvent; +use Imagekit\Webhooks\DamFileVersionDeleteEvent; use Imagekit\Webhooks\UnsafeUnwrapWebhookEvent; use Imagekit\Webhooks\UnwrapWebhookEvent; use Imagekit\Webhooks\UploadPostTransformErrorEvent; @@ -45,7 +50,7 @@ public function __construct(private Client $client) */ public function unsafeUnwrap( string $body - ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent { + ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|DamFileCreateEvent|DamFileUpdateEvent|DamFileDeleteEvent|DamFileVersionCreateEvent|DamFileVersionDeleteEvent { try { $decoded = Util::decodeJson($body); @@ -69,7 +74,7 @@ public function unwrap( string $body, ?array $headers = null, ?string $secret = null - ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent { + ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|DamFileCreateEvent|DamFileUpdateEvent|DamFileDeleteEvent|DamFileVersionCreateEvent|DamFileVersionDeleteEvent { if (null !== $headers) { $secret = $secret ?? ($this->client->webhookSecret ?: null); if (null === $secret) { diff --git a/src/Webhooks/DamFileCreateEvent.php b/src/Webhooks/DamFileCreateEvent.php new file mode 100644 index 00000000..7fa7de79 --- /dev/null +++ b/src/Webhooks/DamFileCreateEvent.php @@ -0,0 +1,141 @@ + */ + use SdkModel; + + /** + * Unique identifier for the event. + */ + #[Required] + public string $id; + + /** + * The type of webhook event. + */ + #[Required] + public string $type; + + /** + * Timestamp of when the event occurred in ISO8601 format. + */ + #[Required('created_at')] + public \DateTimeInterface $createdAt; + + /** + * Object containing details of a file or file version. + */ + #[Required] + public File $data; + + /** + * `new DamFileCreateEvent()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * DamFileCreateEvent::with(id: ..., type: ..., createdAt: ..., data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new DamFileCreateEvent) + * ->withID(...) + * ->withType(...) + * ->withCreatedAt(...) + * ->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param File|FileShape $data + */ + public static function with( + string $id, + string $type, + \DateTimeInterface $createdAt, + File|array $data + ): self { + $self = new self; + + $self['id'] = $id; + $self['type'] = $type; + $self['createdAt'] = $createdAt; + $self['data'] = $data; + + return $self; + } + + /** + * Unique identifier for the event. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * The type of webhook event. + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + + /** + * Timestamp of when the event occurred in ISO8601 format. + */ + public function withCreatedAt(\DateTimeInterface $createdAt): self + { + $self = clone $this; + $self['createdAt'] = $createdAt; + + return $self; + } + + /** + * Object containing details of a file or file version. + * + * @param File|FileShape $data + */ + public function withData(File|array $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/Webhooks/DamFileDeleteEvent.php b/src/Webhooks/DamFileDeleteEvent.php new file mode 100644 index 00000000..66c90602 --- /dev/null +++ b/src/Webhooks/DamFileDeleteEvent.php @@ -0,0 +1,136 @@ + */ + use SdkModel; + + /** + * Unique identifier for the event. + */ + #[Required] + public string $id; + + /** + * The type of webhook event. + */ + #[Required] + public string $type; + + /** + * Timestamp of when the event occurred in ISO8601 format. + */ + #[Required('created_at')] + public \DateTimeInterface $createdAt; + + #[Required] + public Data $data; + + /** + * `new DamFileDeleteEvent()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * DamFileDeleteEvent::with(id: ..., type: ..., createdAt: ..., data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new DamFileDeleteEvent) + * ->withID(...) + * ->withType(...) + * ->withCreatedAt(...) + * ->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Data|DataShape $data + */ + public static function with( + string $id, + string $type, + \DateTimeInterface $createdAt, + Data|array $data + ): self { + $self = new self; + + $self['id'] = $id; + $self['type'] = $type; + $self['createdAt'] = $createdAt; + $self['data'] = $data; + + return $self; + } + + /** + * Unique identifier for the event. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * The type of webhook event. + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + + /** + * Timestamp of when the event occurred in ISO8601 format. + */ + public function withCreatedAt(\DateTimeInterface $createdAt): self + { + $self = clone $this; + $self['createdAt'] = $createdAt; + + return $self; + } + + /** + * @param Data|DataShape $data + */ + public function withData(Data|array $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/Webhooks/DamFileDeleteEvent/Data.php b/src/Webhooks/DamFileDeleteEvent/Data.php new file mode 100644 index 00000000..76d563c4 --- /dev/null +++ b/src/Webhooks/DamFileDeleteEvent/Data.php @@ -0,0 +1,68 @@ + */ + use SdkModel; + + /** + * The unique `fileId` of the deleted file. + */ + #[Required('fileId')] + public string $fileID; + + /** + * `new Data()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Data::with(fileID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Data)->withFileID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $fileID): self + { + $self = new self; + + $self['fileID'] = $fileID; + + return $self; + } + + /** + * The unique `fileId` of the deleted file. + */ + public function withFileID(string $fileID): self + { + $self = clone $this; + $self['fileID'] = $fileID; + + return $self; + } +} diff --git a/src/Webhooks/DamFileUpdateEvent.php b/src/Webhooks/DamFileUpdateEvent.php new file mode 100644 index 00000000..139af8f5 --- /dev/null +++ b/src/Webhooks/DamFileUpdateEvent.php @@ -0,0 +1,141 @@ + */ + use SdkModel; + + /** + * Unique identifier for the event. + */ + #[Required] + public string $id; + + /** + * The type of webhook event. + */ + #[Required] + public string $type; + + /** + * Timestamp of when the event occurred in ISO8601 format. + */ + #[Required('created_at')] + public \DateTimeInterface $createdAt; + + /** + * Object containing details of a file or file version. + */ + #[Required] + public File $data; + + /** + * `new DamFileUpdateEvent()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * DamFileUpdateEvent::with(id: ..., type: ..., createdAt: ..., data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new DamFileUpdateEvent) + * ->withID(...) + * ->withType(...) + * ->withCreatedAt(...) + * ->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param File|FileShape $data + */ + public static function with( + string $id, + string $type, + \DateTimeInterface $createdAt, + File|array $data + ): self { + $self = new self; + + $self['id'] = $id; + $self['type'] = $type; + $self['createdAt'] = $createdAt; + $self['data'] = $data; + + return $self; + } + + /** + * Unique identifier for the event. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * The type of webhook event. + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + + /** + * Timestamp of when the event occurred in ISO8601 format. + */ + public function withCreatedAt(\DateTimeInterface $createdAt): self + { + $self = clone $this; + $self['createdAt'] = $createdAt; + + return $self; + } + + /** + * Object containing details of a file or file version. + * + * @param File|FileShape $data + */ + public function withData(File|array $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/Webhooks/DamFileVersionCreateEvent.php b/src/Webhooks/DamFileVersionCreateEvent.php new file mode 100644 index 00000000..02bafc18 --- /dev/null +++ b/src/Webhooks/DamFileVersionCreateEvent.php @@ -0,0 +1,128 @@ + */ + use SdkModel; + + /** + * Unique identifier for the event. + */ + #[Required] + public string $id; + + /** + * The type of webhook event. + */ + #[Required] + public string $type; + + /** + * Timestamp of when the event occurred in ISO8601 format. + */ + #[Required('created_at')] + public \DateTimeInterface $createdAt; + + #[Required] + public mixed $data; + + /** + * `new DamFileVersionCreateEvent()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * DamFileVersionCreateEvent::with(id: ..., type: ..., createdAt: ..., data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new DamFileVersionCreateEvent) + * ->withID(...) + * ->withType(...) + * ->withCreatedAt(...) + * ->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with( + string $id, + string $type, + \DateTimeInterface $createdAt, + mixed $data + ): self { + $self = new self; + + $self['id'] = $id; + $self['type'] = $type; + $self['createdAt'] = $createdAt; + $self['data'] = $data; + + return $self; + } + + /** + * Unique identifier for the event. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * The type of webhook event. + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + + /** + * Timestamp of when the event occurred in ISO8601 format. + */ + public function withCreatedAt(\DateTimeInterface $createdAt): self + { + $self = clone $this; + $self['createdAt'] = $createdAt; + + return $self; + } + + public function withData(mixed $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/Webhooks/DamFileVersionDeleteEvent.php b/src/Webhooks/DamFileVersionDeleteEvent.php new file mode 100644 index 00000000..47cb5ec2 --- /dev/null +++ b/src/Webhooks/DamFileVersionDeleteEvent.php @@ -0,0 +1,136 @@ + */ + use SdkModel; + + /** + * Unique identifier for the event. + */ + #[Required] + public string $id; + + /** + * The type of webhook event. + */ + #[Required] + public string $type; + + /** + * Timestamp of when the event occurred in ISO8601 format. + */ + #[Required('created_at')] + public \DateTimeInterface $createdAt; + + #[Required] + public Data $data; + + /** + * `new DamFileVersionDeleteEvent()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * DamFileVersionDeleteEvent::with(id: ..., type: ..., createdAt: ..., data: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new DamFileVersionDeleteEvent) + * ->withID(...) + * ->withType(...) + * ->withCreatedAt(...) + * ->withData(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + * + * @param Data|DataShape $data + */ + public static function with( + string $id, + string $type, + \DateTimeInterface $createdAt, + Data|array $data + ): self { + $self = new self; + + $self['id'] = $id; + $self['type'] = $type; + $self['createdAt'] = $createdAt; + $self['data'] = $data; + + return $self; + } + + /** + * Unique identifier for the event. + */ + public function withID(string $id): self + { + $self = clone $this; + $self['id'] = $id; + + return $self; + } + + /** + * The type of webhook event. + */ + public function withType(string $type): self + { + $self = clone $this; + $self['type'] = $type; + + return $self; + } + + /** + * Timestamp of when the event occurred in ISO8601 format. + */ + public function withCreatedAt(\DateTimeInterface $createdAt): self + { + $self = clone $this; + $self['createdAt'] = $createdAt; + + return $self; + } + + /** + * @param Data|DataShape $data + */ + public function withData(Data|array $data): self + { + $self = clone $this; + $self['data'] = $data; + + return $self; + } +} diff --git a/src/Webhooks/DamFileVersionDeleteEvent/Data.php b/src/Webhooks/DamFileVersionDeleteEvent/Data.php new file mode 100644 index 00000000..396f6185 --- /dev/null +++ b/src/Webhooks/DamFileVersionDeleteEvent/Data.php @@ -0,0 +1,86 @@ + */ + use SdkModel; + + /** + * The unique `fileId` of the deleted file. + */ + #[Required('fileId')] + public string $fileID; + + /** + * The unique `versionId` of the deleted file version. + */ + #[Required('versionId')] + public string $versionID; + + /** + * `new Data()` is missing required properties by the API. + * + * To enforce required parameters use + * ``` + * Data::with(fileID: ..., versionID: ...) + * ``` + * + * Otherwise ensure the following setters are called + * + * ``` + * (new Data)->withFileID(...)->withVersionID(...) + * ``` + */ + public function __construct() + { + $this->initialize(); + } + + /** + * Construct an instance from the required parameters. + * + * You must use named parameters to construct any parameters with a default value. + */ + public static function with(string $fileID, string $versionID): self + { + $self = new self; + + $self['fileID'] = $fileID; + $self['versionID'] = $versionID; + + return $self; + } + + /** + * The unique `fileId` of the deleted file. + */ + public function withFileID(string $fileID): self + { + $self = clone $this; + $self['fileID'] = $fileID; + + return $self; + } + + /** + * The unique `versionId` of the deleted file version. + */ + public function withVersionID(string $versionID): self + { + $self = clone $this; + $self['versionID'] = $versionID; + + return $self; + } +} diff --git a/src/Webhooks/UnsafeUnwrapWebhookEvent.php b/src/Webhooks/UnsafeUnwrapWebhookEvent.php index b678dd03..26f16230 100644 --- a/src/Webhooks/UnsafeUnwrapWebhookEvent.php +++ b/src/Webhooks/UnsafeUnwrapWebhookEvent.php @@ -18,9 +18,14 @@ * @phpstan-import-type UploadPreTransformErrorEventShape from \Imagekit\Webhooks\UploadPreTransformErrorEvent * @phpstan-import-type UploadPostTransformSuccessEventShape from \Imagekit\Webhooks\UploadPostTransformSuccessEvent * @phpstan-import-type UploadPostTransformErrorEventShape from \Imagekit\Webhooks\UploadPostTransformErrorEvent + * @phpstan-import-type DamFileCreateEventShape from \Imagekit\Webhooks\DamFileCreateEvent + * @phpstan-import-type DamFileUpdateEventShape from \Imagekit\Webhooks\DamFileUpdateEvent + * @phpstan-import-type DamFileDeleteEventShape from \Imagekit\Webhooks\DamFileDeleteEvent + * @phpstan-import-type DamFileVersionCreateEventShape from \Imagekit\Webhooks\DamFileVersionCreateEvent + * @phpstan-import-type DamFileVersionDeleteEventShape from \Imagekit\Webhooks\DamFileVersionDeleteEvent * - * @phpstan-type UnsafeUnwrapWebhookEventVariants = VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent - * @phpstan-type UnsafeUnwrapWebhookEventShape = UnsafeUnwrapWebhookEventVariants|VideoTransformationAcceptedEventShape|VideoTransformationReadyEventShape|VideoTransformationErrorEventShape|UploadPreTransformSuccessEventShape|UploadPreTransformErrorEventShape|UploadPostTransformSuccessEventShape|UploadPostTransformErrorEventShape + * @phpstan-type UnsafeUnwrapWebhookEventVariants = VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|DamFileCreateEvent|DamFileUpdateEvent|DamFileDeleteEvent|DamFileVersionCreateEvent|DamFileVersionDeleteEvent + * @phpstan-type UnsafeUnwrapWebhookEventShape = UnsafeUnwrapWebhookEventVariants|VideoTransformationAcceptedEventShape|VideoTransformationReadyEventShape|VideoTransformationErrorEventShape|UploadPreTransformSuccessEventShape|UploadPreTransformErrorEventShape|UploadPostTransformSuccessEventShape|UploadPostTransformErrorEventShape|DamFileCreateEventShape|DamFileUpdateEventShape|DamFileDeleteEventShape|DamFileVersionCreateEventShape|DamFileVersionDeleteEventShape */ final class UnsafeUnwrapWebhookEvent implements ConverterSource { @@ -39,6 +44,11 @@ public static function variants(): array UploadPreTransformErrorEvent::class, UploadPostTransformSuccessEvent::class, UploadPostTransformErrorEvent::class, + DamFileCreateEvent::class, + DamFileUpdateEvent::class, + DamFileDeleteEvent::class, + DamFileVersionCreateEvent::class, + DamFileVersionDeleteEvent::class, ]; } } diff --git a/src/Webhooks/UnwrapWebhookEvent.php b/src/Webhooks/UnwrapWebhookEvent.php index 387ba594..dbb8971d 100644 --- a/src/Webhooks/UnwrapWebhookEvent.php +++ b/src/Webhooks/UnwrapWebhookEvent.php @@ -18,9 +18,14 @@ * @phpstan-import-type UploadPreTransformErrorEventShape from \Imagekit\Webhooks\UploadPreTransformErrorEvent * @phpstan-import-type UploadPostTransformSuccessEventShape from \Imagekit\Webhooks\UploadPostTransformSuccessEvent * @phpstan-import-type UploadPostTransformErrorEventShape from \Imagekit\Webhooks\UploadPostTransformErrorEvent + * @phpstan-import-type DamFileCreateEventShape from \Imagekit\Webhooks\DamFileCreateEvent + * @phpstan-import-type DamFileUpdateEventShape from \Imagekit\Webhooks\DamFileUpdateEvent + * @phpstan-import-type DamFileDeleteEventShape from \Imagekit\Webhooks\DamFileDeleteEvent + * @phpstan-import-type DamFileVersionCreateEventShape from \Imagekit\Webhooks\DamFileVersionCreateEvent + * @phpstan-import-type DamFileVersionDeleteEventShape from \Imagekit\Webhooks\DamFileVersionDeleteEvent * - * @phpstan-type UnwrapWebhookEventVariants = VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent - * @phpstan-type UnwrapWebhookEventShape = UnwrapWebhookEventVariants|VideoTransformationAcceptedEventShape|VideoTransformationReadyEventShape|VideoTransformationErrorEventShape|UploadPreTransformSuccessEventShape|UploadPreTransformErrorEventShape|UploadPostTransformSuccessEventShape|UploadPostTransformErrorEventShape + * @phpstan-type UnwrapWebhookEventVariants = VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|DamFileCreateEvent|DamFileUpdateEvent|DamFileDeleteEvent|DamFileVersionCreateEvent|DamFileVersionDeleteEvent + * @phpstan-type UnwrapWebhookEventShape = UnwrapWebhookEventVariants|VideoTransformationAcceptedEventShape|VideoTransformationReadyEventShape|VideoTransformationErrorEventShape|UploadPreTransformSuccessEventShape|UploadPreTransformErrorEventShape|UploadPostTransformSuccessEventShape|UploadPostTransformErrorEventShape|DamFileCreateEventShape|DamFileUpdateEventShape|DamFileDeleteEventShape|DamFileVersionCreateEventShape|DamFileVersionDeleteEventShape */ final class UnwrapWebhookEvent implements ConverterSource { @@ -39,6 +44,11 @@ public static function variants(): array UploadPreTransformErrorEvent::class, UploadPostTransformSuccessEvent::class, UploadPostTransformErrorEvent::class, + DamFileCreateEvent::class, + DamFileUpdateEvent::class, + DamFileDeleteEvent::class, + DamFileVersionCreateEvent::class, + DamFileVersionDeleteEvent::class, ]; } } diff --git a/tests/ClientTest.php b/tests/ClientTest.php index 5c16f737..1ca7f33f 100644 --- a/tests/ClientTest.php +++ b/tests/ClientTest.php @@ -29,7 +29,6 @@ public function testDefaultHeaders(): void $client = new \Imagekit\Client( baseUrl: 'http://localhost', privateKey: 'My Private Key', - password: 'My Password', requestOptions: ['transporter' => $transporter], ); diff --git a/tests/Services/Accounts/OriginsTest.php b/tests/Services/Accounts/OriginsTest.php index a1b1c1ef..ee11ccbe 100644 --- a/tests/Services/Accounts/OriginsTest.php +++ b/tests/Services/Accounts/OriginsTest.php @@ -22,11 +22,7 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client( - privateKey: 'My Private Key', - password: 'My Password', - baseUrl: $testUrl, - ); + $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); $this->client = $client; } diff --git a/tests/Services/Accounts/URLEndpointsTest.php b/tests/Services/Accounts/URLEndpointsTest.php index 0d2e8dbc..546c6121 100644 --- a/tests/Services/Accounts/URLEndpointsTest.php +++ b/tests/Services/Accounts/URLEndpointsTest.php @@ -23,11 +23,7 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client( - privateKey: 'My Private Key', - password: 'My Password', - baseUrl: $testUrl, - ); + $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); $this->client = $client; } diff --git a/tests/Services/Accounts/UsageTest.php b/tests/Services/Accounts/UsageTest.php index 7ada415c..b7dca29c 100644 --- a/tests/Services/Accounts/UsageTest.php +++ b/tests/Services/Accounts/UsageTest.php @@ -23,11 +23,7 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client( - privateKey: 'My Private Key', - password: 'My Password', - baseUrl: $testUrl, - ); + $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); $this->client = $client; } diff --git a/tests/Services/AssetsTest.php b/tests/Services/AssetsTest.php index 13b220e6..c0903aaf 100644 --- a/tests/Services/AssetsTest.php +++ b/tests/Services/AssetsTest.php @@ -22,11 +22,7 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client( - privateKey: 'My Private Key', - password: 'My Password', - baseUrl: $testUrl, - ); + $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); $this->client = $client; } diff --git a/tests/Services/Beta/V2/FilesTest.php b/tests/Services/Beta/V2/FilesTest.php index 000a4df1..eb15b688 100644 --- a/tests/Services/Beta/V2/FilesTest.php +++ b/tests/Services/Beta/V2/FilesTest.php @@ -23,11 +23,7 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client( - privateKey: 'My Private Key', - password: 'My Password', - baseUrl: $testUrl, - ); + $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); $this->client = $client; } diff --git a/tests/Services/Cache/InvalidationTest.php b/tests/Services/Cache/InvalidationTest.php index e1101cef..98ced0b1 100644 --- a/tests/Services/Cache/InvalidationTest.php +++ b/tests/Services/Cache/InvalidationTest.php @@ -24,11 +24,7 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client( - privateKey: 'My Private Key', - password: 'My Password', - baseUrl: $testUrl, - ); + $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); $this->client = $client; } diff --git a/tests/Services/CustomMetadataFieldsTest.php b/tests/Services/CustomMetadataFieldsTest.php index 6e3ea292..f739c49e 100644 --- a/tests/Services/CustomMetadataFieldsTest.php +++ b/tests/Services/CustomMetadataFieldsTest.php @@ -24,11 +24,7 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client( - privateKey: 'My Private Key', - password: 'My Password', - baseUrl: $testUrl, - ); + $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); $this->client = $client; } diff --git a/tests/Services/Files/BulkTest.php b/tests/Services/Files/BulkTest.php index 144ce9ef..0202af6f 100644 --- a/tests/Services/Files/BulkTest.php +++ b/tests/Services/Files/BulkTest.php @@ -26,11 +26,7 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client( - privateKey: 'My Private Key', - password: 'My Password', - baseUrl: $testUrl, - ); + $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); $this->client = $client; } diff --git a/tests/Services/Files/MetadataTest.php b/tests/Services/Files/MetadataTest.php index 6702265a..b9f30d7b 100644 --- a/tests/Services/Files/MetadataTest.php +++ b/tests/Services/Files/MetadataTest.php @@ -23,11 +23,7 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client( - privateKey: 'My Private Key', - password: 'My Password', - baseUrl: $testUrl, - ); + $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); $this->client = $client; } diff --git a/tests/Services/Files/VersionsTest.php b/tests/Services/Files/VersionsTest.php index ca5e2ba9..8762411e 100644 --- a/tests/Services/Files/VersionsTest.php +++ b/tests/Services/Files/VersionsTest.php @@ -24,11 +24,7 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client( - privateKey: 'My Private Key', - password: 'My Password', - baseUrl: $testUrl, - ); + $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); $this->client = $client; } diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index ae755594..c7c8e717 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -28,11 +28,7 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client( - privateKey: 'My Private Key', - password: 'My Password', - baseUrl: $testUrl, - ); + $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); $this->client = $client; } diff --git a/tests/Services/Folders/JobTest.php b/tests/Services/Folders/JobTest.php index 88748fae..ce8a010d 100644 --- a/tests/Services/Folders/JobTest.php +++ b/tests/Services/Folders/JobTest.php @@ -23,11 +23,7 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client( - privateKey: 'My Private Key', - password: 'My Password', - baseUrl: $testUrl, - ); + $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); $this->client = $client; } diff --git a/tests/Services/FoldersTest.php b/tests/Services/FoldersTest.php index 5251a59a..83a26935 100644 --- a/tests/Services/FoldersTest.php +++ b/tests/Services/FoldersTest.php @@ -27,11 +27,7 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client( - privateKey: 'My Private Key', - password: 'My Password', - baseUrl: $testUrl, - ); + $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); $this->client = $client; } diff --git a/tests/Services/SavedExtensionsTest.php b/tests/Services/SavedExtensionsTest.php index 8b54e333..4a42e480 100644 --- a/tests/Services/SavedExtensionsTest.php +++ b/tests/Services/SavedExtensionsTest.php @@ -23,11 +23,7 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client( - privateKey: 'My Private Key', - password: 'My Password', - baseUrl: $testUrl, - ); + $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); $this->client = $client; } diff --git a/tests/Services/WebhooksTest.php b/tests/Services/WebhooksTest.php index a4e56284..7fa4eff6 100644 --- a/tests/Services/WebhooksTest.php +++ b/tests/Services/WebhooksTest.php @@ -23,11 +23,7 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client( - privateKey: 'My Private Key', - password: 'My Password', - baseUrl: $testUrl, - ); + $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); $this->client = $client; } From c98a0fbfa6db3824d263d51e1b50446fb6344877 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 06:24:07 +0000 Subject: [PATCH 150/193] feat(api): fix spec indentation --- .stats.yml | 4 +- README.md | 6 +-- src/Client.php | 43 ++++++++++++++++++++ tests/ClientTest.php | 1 + tests/Services/Accounts/OriginsTest.php | 6 ++- tests/Services/Accounts/URLEndpointsTest.php | 6 ++- tests/Services/Accounts/UsageTest.php | 6 ++- tests/Services/AssetsTest.php | 6 ++- tests/Services/Beta/V2/FilesTest.php | 6 ++- tests/Services/Cache/InvalidationTest.php | 6 ++- tests/Services/CustomMetadataFieldsTest.php | 6 ++- tests/Services/Files/BulkTest.php | 6 ++- tests/Services/Files/MetadataTest.php | 6 ++- tests/Services/Files/VersionsTest.php | 6 ++- tests/Services/FilesTest.php | 6 ++- tests/Services/Folders/JobTest.php | 6 ++- tests/Services/FoldersTest.php | 6 ++- tests/Services/SavedExtensionsTest.php | 6 ++- tests/Services/WebhooksTest.php | 6 ++- 19 files changed, 123 insertions(+), 21 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3e331fe9..5beb1d71 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-1422f7513f230162270b197061e5768c2e0c803b94b8cd03a5e72544ac75a27f.yml -openapi_spec_hash: 41175e752e6f6ce900b36aecba687fa7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-f4cd00365ba96133e0675eae3d5d3c6ac13874789e2ce69a84310ab64a4f87dd.yml +openapi_spec_hash: dce632cfbb5464a98c0f5d8eb9573d68 config_hash: 17e408231b0b01676298010c7405f483 diff --git a/README.md b/README.md index 38692d19..81583e5f 100644 --- a/README.md +++ b/README.md @@ -35,8 +35,8 @@ Parameters with a default value must be set by name. use Imagekit\Client; $client = new Client( - privateKey: 'My Private Key', privateKey: getenv('IMAGEKIT_PRIVATE_KEY') ?: 'My Private Key', + password: getenv('OPTIONAL_IMAGEKIT_IGNORES_THIS') ?: 'do_not_set', ); $response = $client->files->upload(file: 'file', fileName: 'file-name.jpg'); @@ -105,9 +105,7 @@ You can use the `maxRetries` option to configure or disable this: use Imagekit\Client; // Configure the default for all requests: -$client = new Client( - privateKey: 'My Private Key', requestOptions: ['maxRetries' => 0] -); +$client = new Client(requestOptions: ['maxRetries' => 0]); // Or, configure per-request: $result = $client->files->upload( diff --git a/src/Client.php b/src/Client.php index ee283480..4dc1af59 100644 --- a/src/Client.php +++ b/src/Client.php @@ -19,6 +19,7 @@ use Imagekit\Services\WebhooksService; /** + * @phpstan-import-type NormalizedRequest from \Imagekit\Core\BaseClient * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions */ class Client extends BaseClient @@ -138,4 +139,46 @@ public function __construct( $this->beta = new BetaService($this); $this->webhooks = new WebhooksService($this); } + + /** @return array */ + protected function authHeaders(): array + { + if (!$this->privateKey && !$this->password) { + return []; + } + + $base64_credentials = base64_encode( + "{$this->privateKey}:{$this->password}" + ); + + return ['Authorization' => "Basic {$base64_credentials}"]; + } + + /** + * @internal + * + * @param string|list $path + * @param array $query + * @param array|null> $headers + * @param RequestOpts|null $opts + * + * @return array{NormalizedRequest, RequestOptions} + */ + protected function buildRequest( + string $method, + string|array $path, + array $query, + array $headers, + mixed $body, + RequestOptions|array|null $opts, + ): array { + return parent::buildRequest( + method: $method, + path: $path, + query: $query, + headers: [...$this->authHeaders(), ...$headers], + body: $body, + opts: $opts, + ); + } } diff --git a/tests/ClientTest.php b/tests/ClientTest.php index 1ca7f33f..5c16f737 100644 --- a/tests/ClientTest.php +++ b/tests/ClientTest.php @@ -29,6 +29,7 @@ public function testDefaultHeaders(): void $client = new \Imagekit\Client( baseUrl: 'http://localhost', privateKey: 'My Private Key', + password: 'My Password', requestOptions: ['transporter' => $transporter], ); diff --git a/tests/Services/Accounts/OriginsTest.php b/tests/Services/Accounts/OriginsTest.php index ee11ccbe..a1b1c1ef 100644 --- a/tests/Services/Accounts/OriginsTest.php +++ b/tests/Services/Accounts/OriginsTest.php @@ -22,7 +22,11 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); + $client = new Client( + privateKey: 'My Private Key', + password: 'My Password', + baseUrl: $testUrl, + ); $this->client = $client; } diff --git a/tests/Services/Accounts/URLEndpointsTest.php b/tests/Services/Accounts/URLEndpointsTest.php index 546c6121..0d2e8dbc 100644 --- a/tests/Services/Accounts/URLEndpointsTest.php +++ b/tests/Services/Accounts/URLEndpointsTest.php @@ -23,7 +23,11 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); + $client = new Client( + privateKey: 'My Private Key', + password: 'My Password', + baseUrl: $testUrl, + ); $this->client = $client; } diff --git a/tests/Services/Accounts/UsageTest.php b/tests/Services/Accounts/UsageTest.php index b7dca29c..7ada415c 100644 --- a/tests/Services/Accounts/UsageTest.php +++ b/tests/Services/Accounts/UsageTest.php @@ -23,7 +23,11 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); + $client = new Client( + privateKey: 'My Private Key', + password: 'My Password', + baseUrl: $testUrl, + ); $this->client = $client; } diff --git a/tests/Services/AssetsTest.php b/tests/Services/AssetsTest.php index c0903aaf..13b220e6 100644 --- a/tests/Services/AssetsTest.php +++ b/tests/Services/AssetsTest.php @@ -22,7 +22,11 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); + $client = new Client( + privateKey: 'My Private Key', + password: 'My Password', + baseUrl: $testUrl, + ); $this->client = $client; } diff --git a/tests/Services/Beta/V2/FilesTest.php b/tests/Services/Beta/V2/FilesTest.php index eb15b688..000a4df1 100644 --- a/tests/Services/Beta/V2/FilesTest.php +++ b/tests/Services/Beta/V2/FilesTest.php @@ -23,7 +23,11 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); + $client = new Client( + privateKey: 'My Private Key', + password: 'My Password', + baseUrl: $testUrl, + ); $this->client = $client; } diff --git a/tests/Services/Cache/InvalidationTest.php b/tests/Services/Cache/InvalidationTest.php index 98ced0b1..e1101cef 100644 --- a/tests/Services/Cache/InvalidationTest.php +++ b/tests/Services/Cache/InvalidationTest.php @@ -24,7 +24,11 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); + $client = new Client( + privateKey: 'My Private Key', + password: 'My Password', + baseUrl: $testUrl, + ); $this->client = $client; } diff --git a/tests/Services/CustomMetadataFieldsTest.php b/tests/Services/CustomMetadataFieldsTest.php index f739c49e..6e3ea292 100644 --- a/tests/Services/CustomMetadataFieldsTest.php +++ b/tests/Services/CustomMetadataFieldsTest.php @@ -24,7 +24,11 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); + $client = new Client( + privateKey: 'My Private Key', + password: 'My Password', + baseUrl: $testUrl, + ); $this->client = $client; } diff --git a/tests/Services/Files/BulkTest.php b/tests/Services/Files/BulkTest.php index 0202af6f..144ce9ef 100644 --- a/tests/Services/Files/BulkTest.php +++ b/tests/Services/Files/BulkTest.php @@ -26,7 +26,11 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); + $client = new Client( + privateKey: 'My Private Key', + password: 'My Password', + baseUrl: $testUrl, + ); $this->client = $client; } diff --git a/tests/Services/Files/MetadataTest.php b/tests/Services/Files/MetadataTest.php index b9f30d7b..6702265a 100644 --- a/tests/Services/Files/MetadataTest.php +++ b/tests/Services/Files/MetadataTest.php @@ -23,7 +23,11 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); + $client = new Client( + privateKey: 'My Private Key', + password: 'My Password', + baseUrl: $testUrl, + ); $this->client = $client; } diff --git a/tests/Services/Files/VersionsTest.php b/tests/Services/Files/VersionsTest.php index 8762411e..ca5e2ba9 100644 --- a/tests/Services/Files/VersionsTest.php +++ b/tests/Services/Files/VersionsTest.php @@ -24,7 +24,11 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); + $client = new Client( + privateKey: 'My Private Key', + password: 'My Password', + baseUrl: $testUrl, + ); $this->client = $client; } diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index c7c8e717..ae755594 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -28,7 +28,11 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); + $client = new Client( + privateKey: 'My Private Key', + password: 'My Password', + baseUrl: $testUrl, + ); $this->client = $client; } diff --git a/tests/Services/Folders/JobTest.php b/tests/Services/Folders/JobTest.php index ce8a010d..88748fae 100644 --- a/tests/Services/Folders/JobTest.php +++ b/tests/Services/Folders/JobTest.php @@ -23,7 +23,11 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); + $client = new Client( + privateKey: 'My Private Key', + password: 'My Password', + baseUrl: $testUrl, + ); $this->client = $client; } diff --git a/tests/Services/FoldersTest.php b/tests/Services/FoldersTest.php index 83a26935..5251a59a 100644 --- a/tests/Services/FoldersTest.php +++ b/tests/Services/FoldersTest.php @@ -27,7 +27,11 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); + $client = new Client( + privateKey: 'My Private Key', + password: 'My Password', + baseUrl: $testUrl, + ); $this->client = $client; } diff --git a/tests/Services/SavedExtensionsTest.php b/tests/Services/SavedExtensionsTest.php index 4a42e480..8b54e333 100644 --- a/tests/Services/SavedExtensionsTest.php +++ b/tests/Services/SavedExtensionsTest.php @@ -23,7 +23,11 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); + $client = new Client( + privateKey: 'My Private Key', + password: 'My Password', + baseUrl: $testUrl, + ); $this->client = $client; } diff --git a/tests/Services/WebhooksTest.php b/tests/Services/WebhooksTest.php index 7fa4eff6..a4e56284 100644 --- a/tests/Services/WebhooksTest.php +++ b/tests/Services/WebhooksTest.php @@ -23,7 +23,11 @@ protected function setUp(): void parent::setUp(); $testUrl = Util::getenv('TEST_API_BASE_URL') ?: 'http://127.0.0.1:4010'; - $client = new Client(privateKey: 'My Private Key', baseUrl: $testUrl); + $client = new Client( + privateKey: 'My Private Key', + password: 'My Password', + baseUrl: $testUrl, + ); $this->client = $client; } From 8190166ab4aeef88bc35fec0140ea7bbedbc3d77 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 06:30:49 +0000 Subject: [PATCH 151/193] feat(api): indentation fix --- .stats.yml | 4 ++-- src/Webhooks/DamFileVersionCreateEvent.php | 21 +++++++++++++++++---- 2 files changed, 19 insertions(+), 6 deletions(-) diff --git a/.stats.yml b/.stats.yml index 5beb1d71..3ae941b7 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-f4cd00365ba96133e0675eae3d5d3c6ac13874789e2ce69a84310ab64a4f87dd.yml -openapi_spec_hash: dce632cfbb5464a98c0f5d8eb9573d68 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-3234424a3a5871f31f5d6dcb8173593fc6c1db14802a0e71f14f3527ad16c871.yml +openapi_spec_hash: 017a8ab68d905ed9e163022f68d8be78 config_hash: 17e408231b0b01676298010c7405f483 diff --git a/src/Webhooks/DamFileVersionCreateEvent.php b/src/Webhooks/DamFileVersionCreateEvent.php index 02bafc18..1cac6e16 100644 --- a/src/Webhooks/DamFileVersionCreateEvent.php +++ b/src/Webhooks/DamFileVersionCreateEvent.php @@ -7,12 +7,15 @@ use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Files\File; /** * Triggered when a file version is created. * + * @phpstan-import-type FileShape from \Imagekit\Files\File + * * @phpstan-type DamFileVersionCreateEventShape = array{ - * id: string, type: string, createdAt: \DateTimeInterface, data: mixed + * id: string, type: string, createdAt: \DateTimeInterface, data: File|FileShape * } */ final class DamFileVersionCreateEvent implements BaseModel @@ -38,8 +41,11 @@ final class DamFileVersionCreateEvent implements BaseModel #[Required('created_at')] public \DateTimeInterface $createdAt; + /** + * Object containing details of a file or file version. + */ #[Required] - public mixed $data; + public File $data; /** * `new DamFileVersionCreateEvent()` is missing required properties by the API. @@ -68,12 +74,14 @@ public function __construct() * Construct an instance from the required parameters. * * You must use named parameters to construct any parameters with a default value. + * + * @param File|FileShape $data */ public static function with( string $id, string $type, \DateTimeInterface $createdAt, - mixed $data + File|array $data ): self { $self = new self; @@ -118,7 +126,12 @@ public function withCreatedAt(\DateTimeInterface $createdAt): self return $self; } - public function withData(mixed $data): self + /** + * Object containing details of a file or file version. + * + * @param File|FileShape $data + */ + public function withData(File|array $data): self { $self = clone $this; $self['data'] = $data; From 313dcf40608dae77f12045de3e77878b33edd638 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 06:39:17 +0000 Subject: [PATCH 152/193] feat(api): merge with main to bring back missing parameters --- .stats.yml | 4 +- .../Task/AITaskSelectMetadata.php | 4 +- .../Task/AITaskSelectTags.php | 4 +- .../Task/AITaskSelectMetadata.php | 4 +- .../Task/AITaskSelectTags.php | 4 +- src/OverlayPosition.php | 110 +++++++++++++++++- src/OverlayPosition/AnchorPoint.php | 32 +++++ src/OverlayPosition/Focus.php | 1 + src/OverlayPosition/XCenter.php | 32 +++++ src/OverlayPosition/YCenter.php | 32 +++++ 10 files changed, 215 insertions(+), 12 deletions(-) create mode 100644 src/OverlayPosition/AnchorPoint.php create mode 100644 src/OverlayPosition/XCenter.php create mode 100644 src/OverlayPosition/YCenter.php diff --git a/.stats.yml b/.stats.yml index 3ae941b7..0898c6b1 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-3234424a3a5871f31f5d6dcb8173593fc6c1db14802a0e71f14f3527ad16c871.yml -openapi_spec_hash: 017a8ab68d905ed9e163022f68d8be78 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-18b46cb8c1dd5cd0eea8559fa9671600540c5c4bee32f2d74f932416b7a1aee0.yml +openapi_spec_hash: 539770659847d04a92ef965a5313adde config_hash: 17e408231b0b01676298010c7405f483 diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata.php index 2ca98efa..a5962d70 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata.php @@ -61,7 +61,7 @@ final class AITaskSelectMetadata implements BaseModel public ?int $minSelections; /** - * Array of possible values matching the custom metadata field type. + * An array of possible values matching the custom metadata field type. If not provided for SingleSelect or MultiSelect field types, all values from the custom metadata field definition will be used. When providing large vocabularies (above 30 items), the AI may not strictly adhere to the list. * * @var list|null $vocabulary */ @@ -171,7 +171,7 @@ public function withMinSelections(int $minSelections): self } /** - * Array of possible values matching the custom metadata field type. + * An array of possible values matching the custom metadata field type. If not provided for SingleSelect or MultiSelect field types, all values from the custom metadata field definition will be used. When providing large vocabularies (above 30 items), the AI may not strictly adhere to the list. * * @param list $vocabulary */ diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php index 4586451e..862dba1a 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php @@ -50,7 +50,7 @@ final class AITaskSelectTags implements BaseModel public ?int $minSelections; /** - * Array of possible tag values. Combined length of all strings must not exceed 500 characters. Cannot contain the `%` character. + * Array of possible tag values. The combined length of all strings must not exceed 500 characters, and values cannot include the `%` character. When providing large vocabularies (more than 30 items), the AI may not follow the list strictly. * * @var list|null $vocabulary */ @@ -147,7 +147,7 @@ public function withMinSelections(int $minSelections): self } /** - * Array of possible tag values. Combined length of all strings must not exceed 500 characters. Cannot contain the `%` character. + * Array of possible tag values. The combined length of all strings must not exceed 500 characters, and values cannot include the `%` character. When providing large vocabularies (more than 30 items), the AI may not follow the list strictly. * * @param list $vocabulary */ diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata.php b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata.php index 7c67430e..20e502cd 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata.php @@ -61,7 +61,7 @@ final class AITaskSelectMetadata implements BaseModel public ?int $minSelections; /** - * Array of possible values matching the custom metadata field type. + * An array of possible values matching the custom metadata field type. If not provided for SingleSelect or MultiSelect field types, all values from the custom metadata field definition will be used. When providing large vocabularies (above 30 items), the AI may not strictly adhere to the list. * * @var list|null $vocabulary */ @@ -171,7 +171,7 @@ public function withMinSelections(int $minSelections): self } /** - * Array of possible values matching the custom metadata field type. + * An array of possible values matching the custom metadata field type. If not provided for SingleSelect or MultiSelect field types, all values from the custom metadata field definition will be used. When providing large vocabularies (above 30 items), the AI may not strictly adhere to the list. * * @param list $vocabulary */ diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php index 6026b95c..76a33c43 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php @@ -50,7 +50,7 @@ final class AITaskSelectTags implements BaseModel public ?int $minSelections; /** - * Array of possible tag values. Combined length of all strings must not exceed 500 characters. Cannot contain the `%` character. + * Array of possible tag values. The combined length of all strings must not exceed 500 characters, and values cannot include the `%` character. When providing large vocabularies (more than 30 items), the AI may not follow the list strictly. * * @var list|null $vocabulary */ @@ -147,7 +147,7 @@ public function withMinSelections(int $minSelections): self } /** - * Array of possible tag values. Combined length of all strings must not exceed 500 characters. Cannot contain the `%` character. + * Array of possible tag values. The combined length of all strings must not exceed 500 characters, and values cannot include the `%` character. When providing large vocabularies (more than 30 items), the AI may not follow the list strictly. * * @param list $vocabulary */ diff --git a/src/OverlayPosition.php b/src/OverlayPosition.php index 628a4e1d..1f008227 100644 --- a/src/OverlayPosition.php +++ b/src/OverlayPosition.php @@ -7,16 +7,26 @@ use Imagekit\Core\Attributes\Optional; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; +use Imagekit\OverlayPosition\AnchorPoint; use Imagekit\OverlayPosition\Focus; /** * @phpstan-import-type XVariants from \Imagekit\OverlayPosition\X + * @phpstan-import-type XCenterVariants from \Imagekit\OverlayPosition\XCenter * @phpstan-import-type YVariants from \Imagekit\OverlayPosition\Y + * @phpstan-import-type YCenterVariants from \Imagekit\OverlayPosition\YCenter * @phpstan-import-type XShape from \Imagekit\OverlayPosition\X + * @phpstan-import-type XCenterShape from \Imagekit\OverlayPosition\XCenter * @phpstan-import-type YShape from \Imagekit\OverlayPosition\Y + * @phpstan-import-type YCenterShape from \Imagekit\OverlayPosition\YCenter * * @phpstan-type OverlayPositionShape = array{ - * focus?: null|Focus|value-of, x?: XShape|null, y?: YShape|null + * anchorPoint?: null|AnchorPoint|value-of, + * focus?: null|Focus|value-of, + * x?: XShape|null, + * xCenter?: XCenterShape|null, + * y?: YShape|null, + * yCenter?: YCenterShape|null, * } */ final class OverlayPosition implements BaseModel @@ -24,8 +34,20 @@ final class OverlayPosition implements BaseModel /** @use SdkModel */ use SdkModel; + /** + * Sets the anchor point on the base asset from which the overlay offset is calculated. + * The default value is `top_left`. + * Maps to `lap` in the URL. + * Can only be used with one or more of `x`, `y`, `xCenter`, or `yCenter`. + * + * @var value-of|null $anchorPoint + */ + #[Optional(enum: AnchorPoint::class)] + public ?string $anchorPoint; + /** * Specifies the position of the overlay relative to the parent image or video. + * If one or more of `x`, `y`, `xCenter`, or `yCenter` parameters are specified, this parameter is ignored. * Maps to `lfo` in the URL. * * @var value-of|null $focus @@ -44,6 +66,18 @@ final class OverlayPosition implements BaseModel #[Optional] public float|string|null $x; + /** + * Specifies the x-coordinate on the base asset where the overlay's center will be positioned. + * It also accepts arithmetic expressions such as `bw_mul_0.4` or `bw_sub_cw`. + * Maps to `lxc` in the URL. + * Cannot be used together with `x`, but can be used with `y`. + * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * + * @var XCenterVariants|null $xCenter + */ + #[Optional] + public float|string|null $xCenter; + /** * Specifies the y-coordinate of the top-left corner of the base asset where the overlay's top-left corner will be positioned. * It also accepts arithmetic expressions such as `bh_mul_0.4` or `bh_sub_ch`. @@ -55,6 +89,18 @@ final class OverlayPosition implements BaseModel #[Optional] public float|string|null $y; + /** + * Specifies the y-coordinate on the base asset where the overlay's center will be positioned. + * It also accepts arithmetic expressions such as `bh_mul_0.4` or `bh_sub_ch`. + * Maps to `lyc` in the URL. + * Cannot be used together with `y`, but can be used with `x`. + * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * + * @var YCenterVariants|null $yCenter + */ + #[Optional] + public float|string|null $yCenter; + public function __construct() { $this->initialize(); @@ -65,26 +111,52 @@ public function __construct() * * You must use named parameters to construct any parameters with a default value. * + * @param AnchorPoint|value-of|null $anchorPoint * @param Focus|value-of|null $focus * @param XShape|null $x + * @param XCenterShape|null $xCenter * @param YShape|null $y + * @param YCenterShape|null $yCenter */ public static function with( + AnchorPoint|string|null $anchorPoint = null, Focus|string|null $focus = null, float|string|null $x = null, - float|string|null $y = null + float|string|null $xCenter = null, + float|string|null $y = null, + float|string|null $yCenter = null, ): self { $self = new self; + null !== $anchorPoint && $self['anchorPoint'] = $anchorPoint; null !== $focus && $self['focus'] = $focus; null !== $x && $self['x'] = $x; + null !== $xCenter && $self['xCenter'] = $xCenter; null !== $y && $self['y'] = $y; + null !== $yCenter && $self['yCenter'] = $yCenter; + + return $self; + } + + /** + * Sets the anchor point on the base asset from which the overlay offset is calculated. + * The default value is `top_left`. + * Maps to `lap` in the URL. + * Can only be used with one or more of `x`, `y`, `xCenter`, or `yCenter`. + * + * @param AnchorPoint|value-of $anchorPoint + */ + public function withAnchorPoint(AnchorPoint|string $anchorPoint): self + { + $self = clone $this; + $self['anchorPoint'] = $anchorPoint; return $self; } /** * Specifies the position of the overlay relative to the parent image or video. + * If one or more of `x`, `y`, `xCenter`, or `yCenter` parameters are specified, this parameter is ignored. * Maps to `lfo` in the URL. * * @param Focus|value-of $focus @@ -113,6 +185,23 @@ public function withX(float|string $x): self return $self; } + /** + * Specifies the x-coordinate on the base asset where the overlay's center will be positioned. + * It also accepts arithmetic expressions such as `bw_mul_0.4` or `bw_sub_cw`. + * Maps to `lxc` in the URL. + * Cannot be used together with `x`, but can be used with `y`. + * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * + * @param XCenterShape $xCenter + */ + public function withXCenter(float|string $xCenter): self + { + $self = clone $this; + $self['xCenter'] = $xCenter; + + return $self; + } + /** * Specifies the y-coordinate of the top-left corner of the base asset where the overlay's top-left corner will be positioned. * It also accepts arithmetic expressions such as `bh_mul_0.4` or `bh_sub_ch`. @@ -128,4 +217,21 @@ public function withY(float|string $y): self return $self; } + + /** + * Specifies the y-coordinate on the base asset where the overlay's center will be positioned. + * It also accepts arithmetic expressions such as `bh_mul_0.4` or `bh_sub_ch`. + * Maps to `lyc` in the URL. + * Cannot be used together with `y`, but can be used with `x`. + * Learn about [Arithmetic expressions](https://imagekit.io/docs/arithmetic-expressions-in-transformations). + * + * @param YCenterShape $yCenter + */ + public function withYCenter(float|string $yCenter): self + { + $self = clone $this; + $self['yCenter'] = $yCenter; + + return $self; + } } diff --git a/src/OverlayPosition/AnchorPoint.php b/src/OverlayPosition/AnchorPoint.php new file mode 100644 index 00000000..3558bdd6 --- /dev/null +++ b/src/OverlayPosition/AnchorPoint.php @@ -0,0 +1,32 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} diff --git a/src/OverlayPosition/YCenter.php b/src/OverlayPosition/YCenter.php new file mode 100644 index 00000000..39ac1c31 --- /dev/null +++ b/src/OverlayPosition/YCenter.php @@ -0,0 +1,32 @@ +|array + */ + public static function variants(): array + { + return ['float', 'string']; + } +} From e53bd5165e47bbe6d15413fa34120947afa3b28c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 06:54:57 +0000 Subject: [PATCH 153/193] feat(api): update webhook event names and remove DAM prefix --- .stats.yml | 4 ++-- src/ServiceContracts/WebhooksContract.php | 14 +++++------ src/Services/WebhooksService.php | 14 +++++------ ...eEvent.php => FileCreatedWebhookEvent.php} | 12 +++++----- ...eEvent.php => FileDeletedWebhookEvent.php} | 16 ++++++------- .../Data.php | 2 +- ...eEvent.php => FileUpdatedWebhookEvent.php} | 12 +++++----- ...php => FileVersionCreatedWebhookEvent.php} | 14 ++++++----- ...php => FileVersionDeletedWebhookEvent.php} | 18 +++++++------- .../Data.php | 2 +- src/Webhooks/UnsafeUnwrapWebhookEvent.php | 24 +++++++++---------- src/Webhooks/UnwrapWebhookEvent.php | 24 +++++++++---------- 12 files changed, 80 insertions(+), 76 deletions(-) rename src/Webhooks/{DamFileCreateEvent.php => FileCreatedWebhookEvent.php} (87%) rename src/Webhooks/{DamFileDeleteEvent.php => FileDeletedWebhookEvent.php} (82%) rename src/Webhooks/{DamFileDeleteEvent => FileDeletedWebhookEvent}/Data.php (96%) rename src/Webhooks/{DamFileUpdateEvent.php => FileUpdatedWebhookEvent.php} (87%) rename src/Webhooks/{DamFileVersionCreateEvent.php => FileVersionCreatedWebhookEvent.php} (86%) rename src/Webhooks/{DamFileVersionDeleteEvent.php => FileVersionDeletedWebhookEvent.php} (80%) rename src/Webhooks/{DamFileVersionDeleteEvent => FileVersionDeletedWebhookEvent}/Data.php (96%) diff --git a/.stats.yml b/.stats.yml index 0898c6b1..4bc5fef0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-18b46cb8c1dd5cd0eea8559fa9671600540c5c4bee32f2d74f932416b7a1aee0.yml -openapi_spec_hash: 539770659847d04a92ef965a5313adde +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-d73a37dc3426586109bd153f02c6a605036b6a7396bba5173d013468c5291ce6.yml +openapi_spec_hash: c193c6e557ff477481ec8d5ac8a0c96e config_hash: 17e408231b0b01676298010c7405f483 diff --git a/src/ServiceContracts/WebhooksContract.php b/src/ServiceContracts/WebhooksContract.php index 7c90b14f..74e6e737 100644 --- a/src/ServiceContracts/WebhooksContract.php +++ b/src/ServiceContracts/WebhooksContract.php @@ -5,11 +5,11 @@ namespace Imagekit\ServiceContracts; use Imagekit\Core\Exceptions\WebhookException; -use Imagekit\Webhooks\DamFileCreateEvent; -use Imagekit\Webhooks\DamFileDeleteEvent; -use Imagekit\Webhooks\DamFileUpdateEvent; -use Imagekit\Webhooks\DamFileVersionCreateEvent; -use Imagekit\Webhooks\DamFileVersionDeleteEvent; +use Imagekit\Webhooks\FileCreatedWebhookEvent; +use Imagekit\Webhooks\FileDeletedWebhookEvent; +use Imagekit\Webhooks\FileUpdatedWebhookEvent; +use Imagekit\Webhooks\FileVersionCreatedWebhookEvent; +use Imagekit\Webhooks\FileVersionDeletedWebhookEvent; use Imagekit\Webhooks\UploadPostTransformErrorEvent; use Imagekit\Webhooks\UploadPostTransformSuccessEvent; use Imagekit\Webhooks\UploadPreTransformErrorEvent; @@ -29,7 +29,7 @@ interface WebhooksContract */ public function unsafeUnwrap( string $body - ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|DamFileCreateEvent|DamFileUpdateEvent|DamFileDeleteEvent|DamFileVersionCreateEvent|DamFileVersionDeleteEvent; + ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|FileCreatedWebhookEvent|FileUpdatedWebhookEvent|FileDeletedWebhookEvent|FileVersionCreatedWebhookEvent|FileVersionDeletedWebhookEvent; /** * @api @@ -44,5 +44,5 @@ public function unwrap( string $body, ?array $headers = null, ?string $secret = null - ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|DamFileCreateEvent|DamFileUpdateEvent|DamFileDeleteEvent|DamFileVersionCreateEvent|DamFileVersionDeleteEvent; + ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|FileCreatedWebhookEvent|FileUpdatedWebhookEvent|FileDeletedWebhookEvent|FileVersionCreatedWebhookEvent|FileVersionDeletedWebhookEvent; } diff --git a/src/Services/WebhooksService.php b/src/Services/WebhooksService.php index 80552fef..5a43699d 100644 --- a/src/Services/WebhooksService.php +++ b/src/Services/WebhooksService.php @@ -9,11 +9,11 @@ use Imagekit\Core\Exceptions\WebhookException; use Imagekit\Core\Util; use Imagekit\ServiceContracts\WebhooksContract; -use Imagekit\Webhooks\DamFileCreateEvent; -use Imagekit\Webhooks\DamFileDeleteEvent; -use Imagekit\Webhooks\DamFileUpdateEvent; -use Imagekit\Webhooks\DamFileVersionCreateEvent; -use Imagekit\Webhooks\DamFileVersionDeleteEvent; +use Imagekit\Webhooks\FileCreatedWebhookEvent; +use Imagekit\Webhooks\FileDeletedWebhookEvent; +use Imagekit\Webhooks\FileUpdatedWebhookEvent; +use Imagekit\Webhooks\FileVersionCreatedWebhookEvent; +use Imagekit\Webhooks\FileVersionDeletedWebhookEvent; use Imagekit\Webhooks\UnsafeUnwrapWebhookEvent; use Imagekit\Webhooks\UnwrapWebhookEvent; use Imagekit\Webhooks\UploadPostTransformErrorEvent; @@ -50,7 +50,7 @@ public function __construct(private Client $client) */ public function unsafeUnwrap( string $body - ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|DamFileCreateEvent|DamFileUpdateEvent|DamFileDeleteEvent|DamFileVersionCreateEvent|DamFileVersionDeleteEvent { + ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|FileCreatedWebhookEvent|FileUpdatedWebhookEvent|FileDeletedWebhookEvent|FileVersionCreatedWebhookEvent|FileVersionDeletedWebhookEvent { try { $decoded = Util::decodeJson($body); @@ -74,7 +74,7 @@ public function unwrap( string $body, ?array $headers = null, ?string $secret = null - ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|DamFileCreateEvent|DamFileUpdateEvent|DamFileDeleteEvent|DamFileVersionCreateEvent|DamFileVersionDeleteEvent { + ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|FileCreatedWebhookEvent|FileUpdatedWebhookEvent|FileDeletedWebhookEvent|FileVersionCreatedWebhookEvent|FileVersionDeletedWebhookEvent { if (null !== $headers) { $secret = $secret ?? ($this->client->webhookSecret ?: null); if (null === $secret) { diff --git a/src/Webhooks/DamFileCreateEvent.php b/src/Webhooks/FileCreatedWebhookEvent.php similarity index 87% rename from src/Webhooks/DamFileCreateEvent.php rename to src/Webhooks/FileCreatedWebhookEvent.php index 7fa7de79..7d9357cd 100644 --- a/src/Webhooks/DamFileCreateEvent.php +++ b/src/Webhooks/FileCreatedWebhookEvent.php @@ -14,13 +14,13 @@ * * @phpstan-import-type FileShape from \Imagekit\Files\File * - * @phpstan-type DamFileCreateEventShape = array{ + * @phpstan-type FileCreatedWebhookEventShape = array{ * id: string, type: string, createdAt: \DateTimeInterface, data: File|FileShape * } */ -final class DamFileCreateEvent implements BaseModel +final class FileCreatedWebhookEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @@ -48,17 +48,17 @@ final class DamFileCreateEvent implements BaseModel public File $data; /** - * `new DamFileCreateEvent()` is missing required properties by the API. + * `new FileCreatedWebhookEvent()` is missing required properties by the API. * * To enforce required parameters use * ``` - * DamFileCreateEvent::with(id: ..., type: ..., createdAt: ..., data: ...) + * FileCreatedWebhookEvent::with(id: ..., type: ..., createdAt: ..., data: ...) * ``` * * Otherwise ensure the following setters are called * * ``` - * (new DamFileCreateEvent) + * (new FileCreatedWebhookEvent) * ->withID(...) * ->withType(...) * ->withCreatedAt(...) diff --git a/src/Webhooks/DamFileDeleteEvent.php b/src/Webhooks/FileDeletedWebhookEvent.php similarity index 82% rename from src/Webhooks/DamFileDeleteEvent.php rename to src/Webhooks/FileDeletedWebhookEvent.php index 66c90602..1cebe1f8 100644 --- a/src/Webhooks/DamFileDeleteEvent.php +++ b/src/Webhooks/FileDeletedWebhookEvent.php @@ -7,20 +7,20 @@ use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\DamFileDeleteEvent\Data; +use Imagekit\Webhooks\FileDeletedWebhookEvent\Data; /** * Triggered when a file is deleted. * - * @phpstan-import-type DataShape from \Imagekit\Webhooks\DamFileDeleteEvent\Data + * @phpstan-import-type DataShape from \Imagekit\Webhooks\FileDeletedWebhookEvent\Data * - * @phpstan-type DamFileDeleteEventShape = array{ + * @phpstan-type FileDeletedWebhookEventShape = array{ * id: string, type: string, createdAt: \DateTimeInterface, data: Data|DataShape * } */ -final class DamFileDeleteEvent implements BaseModel +final class FileDeletedWebhookEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @@ -45,17 +45,17 @@ final class DamFileDeleteEvent implements BaseModel public Data $data; /** - * `new DamFileDeleteEvent()` is missing required properties by the API. + * `new FileDeletedWebhookEvent()` is missing required properties by the API. * * To enforce required parameters use * ``` - * DamFileDeleteEvent::with(id: ..., type: ..., createdAt: ..., data: ...) + * FileDeletedWebhookEvent::with(id: ..., type: ..., createdAt: ..., data: ...) * ``` * * Otherwise ensure the following setters are called * * ``` - * (new DamFileDeleteEvent) + * (new FileDeletedWebhookEvent) * ->withID(...) * ->withType(...) * ->withCreatedAt(...) diff --git a/src/Webhooks/DamFileDeleteEvent/Data.php b/src/Webhooks/FileDeletedWebhookEvent/Data.php similarity index 96% rename from src/Webhooks/DamFileDeleteEvent/Data.php rename to src/Webhooks/FileDeletedWebhookEvent/Data.php index 76d563c4..1aa452e9 100644 --- a/src/Webhooks/DamFileDeleteEvent/Data.php +++ b/src/Webhooks/FileDeletedWebhookEvent/Data.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\DamFileDeleteEvent; +namespace Imagekit\Webhooks\FileDeletedWebhookEvent; use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; diff --git a/src/Webhooks/DamFileUpdateEvent.php b/src/Webhooks/FileUpdatedWebhookEvent.php similarity index 87% rename from src/Webhooks/DamFileUpdateEvent.php rename to src/Webhooks/FileUpdatedWebhookEvent.php index 139af8f5..8bc9efcd 100644 --- a/src/Webhooks/DamFileUpdateEvent.php +++ b/src/Webhooks/FileUpdatedWebhookEvent.php @@ -14,13 +14,13 @@ * * @phpstan-import-type FileShape from \Imagekit\Files\File * - * @phpstan-type DamFileUpdateEventShape = array{ + * @phpstan-type FileUpdatedWebhookEventShape = array{ * id: string, type: string, createdAt: \DateTimeInterface, data: File|FileShape * } */ -final class DamFileUpdateEvent implements BaseModel +final class FileUpdatedWebhookEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @@ -48,17 +48,17 @@ final class DamFileUpdateEvent implements BaseModel public File $data; /** - * `new DamFileUpdateEvent()` is missing required properties by the API. + * `new FileUpdatedWebhookEvent()` is missing required properties by the API. * * To enforce required parameters use * ``` - * DamFileUpdateEvent::with(id: ..., type: ..., createdAt: ..., data: ...) + * FileUpdatedWebhookEvent::with(id: ..., type: ..., createdAt: ..., data: ...) * ``` * * Otherwise ensure the following setters are called * * ``` - * (new DamFileUpdateEvent) + * (new FileUpdatedWebhookEvent) * ->withID(...) * ->withType(...) * ->withCreatedAt(...) diff --git a/src/Webhooks/DamFileVersionCreateEvent.php b/src/Webhooks/FileVersionCreatedWebhookEvent.php similarity index 86% rename from src/Webhooks/DamFileVersionCreateEvent.php rename to src/Webhooks/FileVersionCreatedWebhookEvent.php index 1cac6e16..8917aff0 100644 --- a/src/Webhooks/DamFileVersionCreateEvent.php +++ b/src/Webhooks/FileVersionCreatedWebhookEvent.php @@ -14,13 +14,13 @@ * * @phpstan-import-type FileShape from \Imagekit\Files\File * - * @phpstan-type DamFileVersionCreateEventShape = array{ + * @phpstan-type FileVersionCreatedWebhookEventShape = array{ * id: string, type: string, createdAt: \DateTimeInterface, data: File|FileShape * } */ -final class DamFileVersionCreateEvent implements BaseModel +final class FileVersionCreatedWebhookEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @@ -48,17 +48,19 @@ final class DamFileVersionCreateEvent implements BaseModel public File $data; /** - * `new DamFileVersionCreateEvent()` is missing required properties by the API. + * `new FileVersionCreatedWebhookEvent()` is missing required properties by the API. * * To enforce required parameters use * ``` - * DamFileVersionCreateEvent::with(id: ..., type: ..., createdAt: ..., data: ...) + * FileVersionCreatedWebhookEvent::with( + * id: ..., type: ..., createdAt: ..., data: ... + * ) * ``` * * Otherwise ensure the following setters are called * * ``` - * (new DamFileVersionCreateEvent) + * (new FileVersionCreatedWebhookEvent) * ->withID(...) * ->withType(...) * ->withCreatedAt(...) diff --git a/src/Webhooks/DamFileVersionDeleteEvent.php b/src/Webhooks/FileVersionDeletedWebhookEvent.php similarity index 80% rename from src/Webhooks/DamFileVersionDeleteEvent.php rename to src/Webhooks/FileVersionDeletedWebhookEvent.php index 47cb5ec2..3fcc9f22 100644 --- a/src/Webhooks/DamFileVersionDeleteEvent.php +++ b/src/Webhooks/FileVersionDeletedWebhookEvent.php @@ -7,20 +7,20 @@ use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\DamFileVersionDeleteEvent\Data; +use Imagekit\Webhooks\FileVersionDeletedWebhookEvent\Data; /** * Triggered when a file version is deleted. * - * @phpstan-import-type DataShape from \Imagekit\Webhooks\DamFileVersionDeleteEvent\Data + * @phpstan-import-type DataShape from \Imagekit\Webhooks\FileVersionDeletedWebhookEvent\Data * - * @phpstan-type DamFileVersionDeleteEventShape = array{ + * @phpstan-type FileVersionDeletedWebhookEventShape = array{ * id: string, type: string, createdAt: \DateTimeInterface, data: Data|DataShape * } */ -final class DamFileVersionDeleteEvent implements BaseModel +final class FileVersionDeletedWebhookEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @@ -45,17 +45,19 @@ final class DamFileVersionDeleteEvent implements BaseModel public Data $data; /** - * `new DamFileVersionDeleteEvent()` is missing required properties by the API. + * `new FileVersionDeletedWebhookEvent()` is missing required properties by the API. * * To enforce required parameters use * ``` - * DamFileVersionDeleteEvent::with(id: ..., type: ..., createdAt: ..., data: ...) + * FileVersionDeletedWebhookEvent::with( + * id: ..., type: ..., createdAt: ..., data: ... + * ) * ``` * * Otherwise ensure the following setters are called * * ``` - * (new DamFileVersionDeleteEvent) + * (new FileVersionDeletedWebhookEvent) * ->withID(...) * ->withType(...) * ->withCreatedAt(...) diff --git a/src/Webhooks/DamFileVersionDeleteEvent/Data.php b/src/Webhooks/FileVersionDeletedWebhookEvent/Data.php similarity index 96% rename from src/Webhooks/DamFileVersionDeleteEvent/Data.php rename to src/Webhooks/FileVersionDeletedWebhookEvent/Data.php index 396f6185..b2e91099 100644 --- a/src/Webhooks/DamFileVersionDeleteEvent/Data.php +++ b/src/Webhooks/FileVersionDeletedWebhookEvent/Data.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\DamFileVersionDeleteEvent; +namespace Imagekit\Webhooks\FileVersionDeletedWebhookEvent; use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; diff --git a/src/Webhooks/UnsafeUnwrapWebhookEvent.php b/src/Webhooks/UnsafeUnwrapWebhookEvent.php index 26f16230..86a60d3c 100644 --- a/src/Webhooks/UnsafeUnwrapWebhookEvent.php +++ b/src/Webhooks/UnsafeUnwrapWebhookEvent.php @@ -18,14 +18,14 @@ * @phpstan-import-type UploadPreTransformErrorEventShape from \Imagekit\Webhooks\UploadPreTransformErrorEvent * @phpstan-import-type UploadPostTransformSuccessEventShape from \Imagekit\Webhooks\UploadPostTransformSuccessEvent * @phpstan-import-type UploadPostTransformErrorEventShape from \Imagekit\Webhooks\UploadPostTransformErrorEvent - * @phpstan-import-type DamFileCreateEventShape from \Imagekit\Webhooks\DamFileCreateEvent - * @phpstan-import-type DamFileUpdateEventShape from \Imagekit\Webhooks\DamFileUpdateEvent - * @phpstan-import-type DamFileDeleteEventShape from \Imagekit\Webhooks\DamFileDeleteEvent - * @phpstan-import-type DamFileVersionCreateEventShape from \Imagekit\Webhooks\DamFileVersionCreateEvent - * @phpstan-import-type DamFileVersionDeleteEventShape from \Imagekit\Webhooks\DamFileVersionDeleteEvent + * @phpstan-import-type FileCreatedWebhookEventShape from \Imagekit\Webhooks\FileCreatedWebhookEvent + * @phpstan-import-type FileUpdatedWebhookEventShape from \Imagekit\Webhooks\FileUpdatedWebhookEvent + * @phpstan-import-type FileDeletedWebhookEventShape from \Imagekit\Webhooks\FileDeletedWebhookEvent + * @phpstan-import-type FileVersionCreatedWebhookEventShape from \Imagekit\Webhooks\FileVersionCreatedWebhookEvent + * @phpstan-import-type FileVersionDeletedWebhookEventShape from \Imagekit\Webhooks\FileVersionDeletedWebhookEvent * - * @phpstan-type UnsafeUnwrapWebhookEventVariants = VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|DamFileCreateEvent|DamFileUpdateEvent|DamFileDeleteEvent|DamFileVersionCreateEvent|DamFileVersionDeleteEvent - * @phpstan-type UnsafeUnwrapWebhookEventShape = UnsafeUnwrapWebhookEventVariants|VideoTransformationAcceptedEventShape|VideoTransformationReadyEventShape|VideoTransformationErrorEventShape|UploadPreTransformSuccessEventShape|UploadPreTransformErrorEventShape|UploadPostTransformSuccessEventShape|UploadPostTransformErrorEventShape|DamFileCreateEventShape|DamFileUpdateEventShape|DamFileDeleteEventShape|DamFileVersionCreateEventShape|DamFileVersionDeleteEventShape + * @phpstan-type UnsafeUnwrapWebhookEventVariants = VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|FileCreatedWebhookEvent|FileUpdatedWebhookEvent|FileDeletedWebhookEvent|FileVersionCreatedWebhookEvent|FileVersionDeletedWebhookEvent + * @phpstan-type UnsafeUnwrapWebhookEventShape = UnsafeUnwrapWebhookEventVariants|VideoTransformationAcceptedEventShape|VideoTransformationReadyEventShape|VideoTransformationErrorEventShape|UploadPreTransformSuccessEventShape|UploadPreTransformErrorEventShape|UploadPostTransformSuccessEventShape|UploadPostTransformErrorEventShape|FileCreatedWebhookEventShape|FileUpdatedWebhookEventShape|FileDeletedWebhookEventShape|FileVersionCreatedWebhookEventShape|FileVersionDeletedWebhookEventShape */ final class UnsafeUnwrapWebhookEvent implements ConverterSource { @@ -44,11 +44,11 @@ public static function variants(): array UploadPreTransformErrorEvent::class, UploadPostTransformSuccessEvent::class, UploadPostTransformErrorEvent::class, - DamFileCreateEvent::class, - DamFileUpdateEvent::class, - DamFileDeleteEvent::class, - DamFileVersionCreateEvent::class, - DamFileVersionDeleteEvent::class, + FileCreatedWebhookEvent::class, + FileUpdatedWebhookEvent::class, + FileDeletedWebhookEvent::class, + FileVersionCreatedWebhookEvent::class, + FileVersionDeletedWebhookEvent::class, ]; } } diff --git a/src/Webhooks/UnwrapWebhookEvent.php b/src/Webhooks/UnwrapWebhookEvent.php index dbb8971d..89e1e1a9 100644 --- a/src/Webhooks/UnwrapWebhookEvent.php +++ b/src/Webhooks/UnwrapWebhookEvent.php @@ -18,14 +18,14 @@ * @phpstan-import-type UploadPreTransformErrorEventShape from \Imagekit\Webhooks\UploadPreTransformErrorEvent * @phpstan-import-type UploadPostTransformSuccessEventShape from \Imagekit\Webhooks\UploadPostTransformSuccessEvent * @phpstan-import-type UploadPostTransformErrorEventShape from \Imagekit\Webhooks\UploadPostTransformErrorEvent - * @phpstan-import-type DamFileCreateEventShape from \Imagekit\Webhooks\DamFileCreateEvent - * @phpstan-import-type DamFileUpdateEventShape from \Imagekit\Webhooks\DamFileUpdateEvent - * @phpstan-import-type DamFileDeleteEventShape from \Imagekit\Webhooks\DamFileDeleteEvent - * @phpstan-import-type DamFileVersionCreateEventShape from \Imagekit\Webhooks\DamFileVersionCreateEvent - * @phpstan-import-type DamFileVersionDeleteEventShape from \Imagekit\Webhooks\DamFileVersionDeleteEvent + * @phpstan-import-type FileCreatedWebhookEventShape from \Imagekit\Webhooks\FileCreatedWebhookEvent + * @phpstan-import-type FileUpdatedWebhookEventShape from \Imagekit\Webhooks\FileUpdatedWebhookEvent + * @phpstan-import-type FileDeletedWebhookEventShape from \Imagekit\Webhooks\FileDeletedWebhookEvent + * @phpstan-import-type FileVersionCreatedWebhookEventShape from \Imagekit\Webhooks\FileVersionCreatedWebhookEvent + * @phpstan-import-type FileVersionDeletedWebhookEventShape from \Imagekit\Webhooks\FileVersionDeletedWebhookEvent * - * @phpstan-type UnwrapWebhookEventVariants = VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|DamFileCreateEvent|DamFileUpdateEvent|DamFileDeleteEvent|DamFileVersionCreateEvent|DamFileVersionDeleteEvent - * @phpstan-type UnwrapWebhookEventShape = UnwrapWebhookEventVariants|VideoTransformationAcceptedEventShape|VideoTransformationReadyEventShape|VideoTransformationErrorEventShape|UploadPreTransformSuccessEventShape|UploadPreTransformErrorEventShape|UploadPostTransformSuccessEventShape|UploadPostTransformErrorEventShape|DamFileCreateEventShape|DamFileUpdateEventShape|DamFileDeleteEventShape|DamFileVersionCreateEventShape|DamFileVersionDeleteEventShape + * @phpstan-type UnwrapWebhookEventVariants = VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|FileCreatedWebhookEvent|FileUpdatedWebhookEvent|FileDeletedWebhookEvent|FileVersionCreatedWebhookEvent|FileVersionDeletedWebhookEvent + * @phpstan-type UnwrapWebhookEventShape = UnwrapWebhookEventVariants|VideoTransformationAcceptedEventShape|VideoTransformationReadyEventShape|VideoTransformationErrorEventShape|UploadPreTransformSuccessEventShape|UploadPreTransformErrorEventShape|UploadPostTransformSuccessEventShape|UploadPostTransformErrorEventShape|FileCreatedWebhookEventShape|FileUpdatedWebhookEventShape|FileDeletedWebhookEventShape|FileVersionCreatedWebhookEventShape|FileVersionDeletedWebhookEventShape */ final class UnwrapWebhookEvent implements ConverterSource { @@ -44,11 +44,11 @@ public static function variants(): array UploadPreTransformErrorEvent::class, UploadPostTransformSuccessEvent::class, UploadPostTransformErrorEvent::class, - DamFileCreateEvent::class, - DamFileUpdateEvent::class, - DamFileDeleteEvent::class, - DamFileVersionCreateEvent::class, - DamFileVersionDeleteEvent::class, + FileCreatedWebhookEvent::class, + FileUpdatedWebhookEvent::class, + FileDeletedWebhookEvent::class, + FileVersionCreatedWebhookEvent::class, + FileVersionDeletedWebhookEvent::class, ]; } } From 3841282a5cfb0001a4674247a54cfd6fea359f9b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 06:59:10 +0000 Subject: [PATCH 154/193] fix(api): rename DamFile events to File for consistency --- .stats.yml | 2 +- src/ServiceContracts/WebhooksContract.php | 14 +++++------ src/Services/WebhooksService.php | 14 +++++------ ...edWebhookEvent.php => FileCreateEvent.php} | 12 +++++----- ...edWebhookEvent.php => FileDeleteEvent.php} | 16 ++++++------- .../Data.php | 2 +- ...edWebhookEvent.php => FileUpdateEvent.php} | 12 +++++----- ...okEvent.php => FileVersionCreateEvent.php} | 14 +++++------ ...okEvent.php => FileVersionDeleteEvent.php} | 18 +++++++------- .../Data.php | 2 +- src/Webhooks/UnsafeUnwrapWebhookEvent.php | 24 +++++++++---------- src/Webhooks/UnwrapWebhookEvent.php | 24 +++++++++---------- 12 files changed, 75 insertions(+), 79 deletions(-) rename src/Webhooks/{FileCreatedWebhookEvent.php => FileCreateEvent.php} (87%) rename src/Webhooks/{FileDeletedWebhookEvent.php => FileDeleteEvent.php} (85%) rename src/Webhooks/{FileDeletedWebhookEvent => FileDeleteEvent}/Data.php (96%) rename src/Webhooks/{FileUpdatedWebhookEvent.php => FileUpdateEvent.php} (88%) rename src/Webhooks/{FileVersionCreatedWebhookEvent.php => FileVersionCreateEvent.php} (86%) rename src/Webhooks/{FileVersionDeletedWebhookEvent.php => FileVersionDeleteEvent.php} (83%) rename src/Webhooks/{FileVersionDeletedWebhookEvent => FileVersionDeleteEvent}/Data.php (96%) diff --git a/.stats.yml b/.stats.yml index 4bc5fef0..aae6cba6 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-d73a37dc3426586109bd153f02c6a605036b6a7396bba5173d013468c5291ce6.yml openapi_spec_hash: c193c6e557ff477481ec8d5ac8a0c96e -config_hash: 17e408231b0b01676298010c7405f483 +config_hash: 32b155378f65c234d3abeb18519fb3cd diff --git a/src/ServiceContracts/WebhooksContract.php b/src/ServiceContracts/WebhooksContract.php index 74e6e737..019a1119 100644 --- a/src/ServiceContracts/WebhooksContract.php +++ b/src/ServiceContracts/WebhooksContract.php @@ -5,11 +5,11 @@ namespace Imagekit\ServiceContracts; use Imagekit\Core\Exceptions\WebhookException; -use Imagekit\Webhooks\FileCreatedWebhookEvent; -use Imagekit\Webhooks\FileDeletedWebhookEvent; -use Imagekit\Webhooks\FileUpdatedWebhookEvent; -use Imagekit\Webhooks\FileVersionCreatedWebhookEvent; -use Imagekit\Webhooks\FileVersionDeletedWebhookEvent; +use Imagekit\Webhooks\FileCreateEvent; +use Imagekit\Webhooks\FileDeleteEvent; +use Imagekit\Webhooks\FileUpdateEvent; +use Imagekit\Webhooks\FileVersionCreateEvent; +use Imagekit\Webhooks\FileVersionDeleteEvent; use Imagekit\Webhooks\UploadPostTransformErrorEvent; use Imagekit\Webhooks\UploadPostTransformSuccessEvent; use Imagekit\Webhooks\UploadPreTransformErrorEvent; @@ -29,7 +29,7 @@ interface WebhooksContract */ public function unsafeUnwrap( string $body - ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|FileCreatedWebhookEvent|FileUpdatedWebhookEvent|FileDeletedWebhookEvent|FileVersionCreatedWebhookEvent|FileVersionDeletedWebhookEvent; + ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|FileCreateEvent|FileUpdateEvent|FileDeleteEvent|FileVersionCreateEvent|FileVersionDeleteEvent; /** * @api @@ -44,5 +44,5 @@ public function unwrap( string $body, ?array $headers = null, ?string $secret = null - ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|FileCreatedWebhookEvent|FileUpdatedWebhookEvent|FileDeletedWebhookEvent|FileVersionCreatedWebhookEvent|FileVersionDeletedWebhookEvent; + ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|FileCreateEvent|FileUpdateEvent|FileDeleteEvent|FileVersionCreateEvent|FileVersionDeleteEvent; } diff --git a/src/Services/WebhooksService.php b/src/Services/WebhooksService.php index 5a43699d..6ec567a1 100644 --- a/src/Services/WebhooksService.php +++ b/src/Services/WebhooksService.php @@ -9,11 +9,11 @@ use Imagekit\Core\Exceptions\WebhookException; use Imagekit\Core\Util; use Imagekit\ServiceContracts\WebhooksContract; -use Imagekit\Webhooks\FileCreatedWebhookEvent; -use Imagekit\Webhooks\FileDeletedWebhookEvent; -use Imagekit\Webhooks\FileUpdatedWebhookEvent; -use Imagekit\Webhooks\FileVersionCreatedWebhookEvent; -use Imagekit\Webhooks\FileVersionDeletedWebhookEvent; +use Imagekit\Webhooks\FileCreateEvent; +use Imagekit\Webhooks\FileDeleteEvent; +use Imagekit\Webhooks\FileUpdateEvent; +use Imagekit\Webhooks\FileVersionCreateEvent; +use Imagekit\Webhooks\FileVersionDeleteEvent; use Imagekit\Webhooks\UnsafeUnwrapWebhookEvent; use Imagekit\Webhooks\UnwrapWebhookEvent; use Imagekit\Webhooks\UploadPostTransformErrorEvent; @@ -50,7 +50,7 @@ public function __construct(private Client $client) */ public function unsafeUnwrap( string $body - ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|FileCreatedWebhookEvent|FileUpdatedWebhookEvent|FileDeletedWebhookEvent|FileVersionCreatedWebhookEvent|FileVersionDeletedWebhookEvent { + ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|FileCreateEvent|FileUpdateEvent|FileDeleteEvent|FileVersionCreateEvent|FileVersionDeleteEvent { try { $decoded = Util::decodeJson($body); @@ -74,7 +74,7 @@ public function unwrap( string $body, ?array $headers = null, ?string $secret = null - ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|FileCreatedWebhookEvent|FileUpdatedWebhookEvent|FileDeletedWebhookEvent|FileVersionCreatedWebhookEvent|FileVersionDeletedWebhookEvent { + ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|FileCreateEvent|FileUpdateEvent|FileDeleteEvent|FileVersionCreateEvent|FileVersionDeleteEvent { if (null !== $headers) { $secret = $secret ?? ($this->client->webhookSecret ?: null); if (null === $secret) { diff --git a/src/Webhooks/FileCreatedWebhookEvent.php b/src/Webhooks/FileCreateEvent.php similarity index 87% rename from src/Webhooks/FileCreatedWebhookEvent.php rename to src/Webhooks/FileCreateEvent.php index 7d9357cd..3f9ed8d6 100644 --- a/src/Webhooks/FileCreatedWebhookEvent.php +++ b/src/Webhooks/FileCreateEvent.php @@ -14,13 +14,13 @@ * * @phpstan-import-type FileShape from \Imagekit\Files\File * - * @phpstan-type FileCreatedWebhookEventShape = array{ + * @phpstan-type FileCreateEventShape = array{ * id: string, type: string, createdAt: \DateTimeInterface, data: File|FileShape * } */ -final class FileCreatedWebhookEvent implements BaseModel +final class FileCreateEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @@ -48,17 +48,17 @@ final class FileCreatedWebhookEvent implements BaseModel public File $data; /** - * `new FileCreatedWebhookEvent()` is missing required properties by the API. + * `new FileCreateEvent()` is missing required properties by the API. * * To enforce required parameters use * ``` - * FileCreatedWebhookEvent::with(id: ..., type: ..., createdAt: ..., data: ...) + * FileCreateEvent::with(id: ..., type: ..., createdAt: ..., data: ...) * ``` * * Otherwise ensure the following setters are called * * ``` - * (new FileCreatedWebhookEvent) + * (new FileCreateEvent) * ->withID(...) * ->withType(...) * ->withCreatedAt(...) diff --git a/src/Webhooks/FileDeletedWebhookEvent.php b/src/Webhooks/FileDeleteEvent.php similarity index 85% rename from src/Webhooks/FileDeletedWebhookEvent.php rename to src/Webhooks/FileDeleteEvent.php index 1cebe1f8..db8ecd07 100644 --- a/src/Webhooks/FileDeletedWebhookEvent.php +++ b/src/Webhooks/FileDeleteEvent.php @@ -7,20 +7,20 @@ use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\FileDeletedWebhookEvent\Data; +use Imagekit\Webhooks\FileDeleteEvent\Data; /** * Triggered when a file is deleted. * - * @phpstan-import-type DataShape from \Imagekit\Webhooks\FileDeletedWebhookEvent\Data + * @phpstan-import-type DataShape from \Imagekit\Webhooks\FileDeleteEvent\Data * - * @phpstan-type FileDeletedWebhookEventShape = array{ + * @phpstan-type FileDeleteEventShape = array{ * id: string, type: string, createdAt: \DateTimeInterface, data: Data|DataShape * } */ -final class FileDeletedWebhookEvent implements BaseModel +final class FileDeleteEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @@ -45,17 +45,17 @@ final class FileDeletedWebhookEvent implements BaseModel public Data $data; /** - * `new FileDeletedWebhookEvent()` is missing required properties by the API. + * `new FileDeleteEvent()` is missing required properties by the API. * * To enforce required parameters use * ``` - * FileDeletedWebhookEvent::with(id: ..., type: ..., createdAt: ..., data: ...) + * FileDeleteEvent::with(id: ..., type: ..., createdAt: ..., data: ...) * ``` * * Otherwise ensure the following setters are called * * ``` - * (new FileDeletedWebhookEvent) + * (new FileDeleteEvent) * ->withID(...) * ->withType(...) * ->withCreatedAt(...) diff --git a/src/Webhooks/FileDeletedWebhookEvent/Data.php b/src/Webhooks/FileDeleteEvent/Data.php similarity index 96% rename from src/Webhooks/FileDeletedWebhookEvent/Data.php rename to src/Webhooks/FileDeleteEvent/Data.php index 1aa452e9..0fd437d7 100644 --- a/src/Webhooks/FileDeletedWebhookEvent/Data.php +++ b/src/Webhooks/FileDeleteEvent/Data.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\FileDeletedWebhookEvent; +namespace Imagekit\Webhooks\FileDeleteEvent; use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; diff --git a/src/Webhooks/FileUpdatedWebhookEvent.php b/src/Webhooks/FileUpdateEvent.php similarity index 88% rename from src/Webhooks/FileUpdatedWebhookEvent.php rename to src/Webhooks/FileUpdateEvent.php index 8bc9efcd..b28774fe 100644 --- a/src/Webhooks/FileUpdatedWebhookEvent.php +++ b/src/Webhooks/FileUpdateEvent.php @@ -14,13 +14,13 @@ * * @phpstan-import-type FileShape from \Imagekit\Files\File * - * @phpstan-type FileUpdatedWebhookEventShape = array{ + * @phpstan-type FileUpdateEventShape = array{ * id: string, type: string, createdAt: \DateTimeInterface, data: File|FileShape * } */ -final class FileUpdatedWebhookEvent implements BaseModel +final class FileUpdateEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @@ -48,17 +48,17 @@ final class FileUpdatedWebhookEvent implements BaseModel public File $data; /** - * `new FileUpdatedWebhookEvent()` is missing required properties by the API. + * `new FileUpdateEvent()` is missing required properties by the API. * * To enforce required parameters use * ``` - * FileUpdatedWebhookEvent::with(id: ..., type: ..., createdAt: ..., data: ...) + * FileUpdateEvent::with(id: ..., type: ..., createdAt: ..., data: ...) * ``` * * Otherwise ensure the following setters are called * * ``` - * (new FileUpdatedWebhookEvent) + * (new FileUpdateEvent) * ->withID(...) * ->withType(...) * ->withCreatedAt(...) diff --git a/src/Webhooks/FileVersionCreatedWebhookEvent.php b/src/Webhooks/FileVersionCreateEvent.php similarity index 86% rename from src/Webhooks/FileVersionCreatedWebhookEvent.php rename to src/Webhooks/FileVersionCreateEvent.php index 8917aff0..d5082a7e 100644 --- a/src/Webhooks/FileVersionCreatedWebhookEvent.php +++ b/src/Webhooks/FileVersionCreateEvent.php @@ -14,13 +14,13 @@ * * @phpstan-import-type FileShape from \Imagekit\Files\File * - * @phpstan-type FileVersionCreatedWebhookEventShape = array{ + * @phpstan-type FileVersionCreateEventShape = array{ * id: string, type: string, createdAt: \DateTimeInterface, data: File|FileShape * } */ -final class FileVersionCreatedWebhookEvent implements BaseModel +final class FileVersionCreateEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @@ -48,19 +48,17 @@ final class FileVersionCreatedWebhookEvent implements BaseModel public File $data; /** - * `new FileVersionCreatedWebhookEvent()` is missing required properties by the API. + * `new FileVersionCreateEvent()` is missing required properties by the API. * * To enforce required parameters use * ``` - * FileVersionCreatedWebhookEvent::with( - * id: ..., type: ..., createdAt: ..., data: ... - * ) + * FileVersionCreateEvent::with(id: ..., type: ..., createdAt: ..., data: ...) * ``` * * Otherwise ensure the following setters are called * * ``` - * (new FileVersionCreatedWebhookEvent) + * (new FileVersionCreateEvent) * ->withID(...) * ->withType(...) * ->withCreatedAt(...) diff --git a/src/Webhooks/FileVersionDeletedWebhookEvent.php b/src/Webhooks/FileVersionDeleteEvent.php similarity index 83% rename from src/Webhooks/FileVersionDeletedWebhookEvent.php rename to src/Webhooks/FileVersionDeleteEvent.php index 3fcc9f22..513d8e83 100644 --- a/src/Webhooks/FileVersionDeletedWebhookEvent.php +++ b/src/Webhooks/FileVersionDeleteEvent.php @@ -7,20 +7,20 @@ use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\FileVersionDeletedWebhookEvent\Data; +use Imagekit\Webhooks\FileVersionDeleteEvent\Data; /** * Triggered when a file version is deleted. * - * @phpstan-import-type DataShape from \Imagekit\Webhooks\FileVersionDeletedWebhookEvent\Data + * @phpstan-import-type DataShape from \Imagekit\Webhooks\FileVersionDeleteEvent\Data * - * @phpstan-type FileVersionDeletedWebhookEventShape = array{ + * @phpstan-type FileVersionDeleteEventShape = array{ * id: string, type: string, createdAt: \DateTimeInterface, data: Data|DataShape * } */ -final class FileVersionDeletedWebhookEvent implements BaseModel +final class FileVersionDeleteEvent implements BaseModel { - /** @use SdkModel */ + /** @use SdkModel */ use SdkModel; /** @@ -45,19 +45,17 @@ final class FileVersionDeletedWebhookEvent implements BaseModel public Data $data; /** - * `new FileVersionDeletedWebhookEvent()` is missing required properties by the API. + * `new FileVersionDeleteEvent()` is missing required properties by the API. * * To enforce required parameters use * ``` - * FileVersionDeletedWebhookEvent::with( - * id: ..., type: ..., createdAt: ..., data: ... - * ) + * FileVersionDeleteEvent::with(id: ..., type: ..., createdAt: ..., data: ...) * ``` * * Otherwise ensure the following setters are called * * ``` - * (new FileVersionDeletedWebhookEvent) + * (new FileVersionDeleteEvent) * ->withID(...) * ->withType(...) * ->withCreatedAt(...) diff --git a/src/Webhooks/FileVersionDeletedWebhookEvent/Data.php b/src/Webhooks/FileVersionDeleteEvent/Data.php similarity index 96% rename from src/Webhooks/FileVersionDeletedWebhookEvent/Data.php rename to src/Webhooks/FileVersionDeleteEvent/Data.php index b2e91099..aecdc596 100644 --- a/src/Webhooks/FileVersionDeletedWebhookEvent/Data.php +++ b/src/Webhooks/FileVersionDeleteEvent/Data.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\FileVersionDeletedWebhookEvent; +namespace Imagekit\Webhooks\FileVersionDeleteEvent; use Imagekit\Core\Attributes\Required; use Imagekit\Core\Concerns\SdkModel; diff --git a/src/Webhooks/UnsafeUnwrapWebhookEvent.php b/src/Webhooks/UnsafeUnwrapWebhookEvent.php index 86a60d3c..ca12128c 100644 --- a/src/Webhooks/UnsafeUnwrapWebhookEvent.php +++ b/src/Webhooks/UnsafeUnwrapWebhookEvent.php @@ -18,14 +18,14 @@ * @phpstan-import-type UploadPreTransformErrorEventShape from \Imagekit\Webhooks\UploadPreTransformErrorEvent * @phpstan-import-type UploadPostTransformSuccessEventShape from \Imagekit\Webhooks\UploadPostTransformSuccessEvent * @phpstan-import-type UploadPostTransformErrorEventShape from \Imagekit\Webhooks\UploadPostTransformErrorEvent - * @phpstan-import-type FileCreatedWebhookEventShape from \Imagekit\Webhooks\FileCreatedWebhookEvent - * @phpstan-import-type FileUpdatedWebhookEventShape from \Imagekit\Webhooks\FileUpdatedWebhookEvent - * @phpstan-import-type FileDeletedWebhookEventShape from \Imagekit\Webhooks\FileDeletedWebhookEvent - * @phpstan-import-type FileVersionCreatedWebhookEventShape from \Imagekit\Webhooks\FileVersionCreatedWebhookEvent - * @phpstan-import-type FileVersionDeletedWebhookEventShape from \Imagekit\Webhooks\FileVersionDeletedWebhookEvent + * @phpstan-import-type FileCreateEventShape from \Imagekit\Webhooks\FileCreateEvent + * @phpstan-import-type FileUpdateEventShape from \Imagekit\Webhooks\FileUpdateEvent + * @phpstan-import-type FileDeleteEventShape from \Imagekit\Webhooks\FileDeleteEvent + * @phpstan-import-type FileVersionCreateEventShape from \Imagekit\Webhooks\FileVersionCreateEvent + * @phpstan-import-type FileVersionDeleteEventShape from \Imagekit\Webhooks\FileVersionDeleteEvent * - * @phpstan-type UnsafeUnwrapWebhookEventVariants = VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|FileCreatedWebhookEvent|FileUpdatedWebhookEvent|FileDeletedWebhookEvent|FileVersionCreatedWebhookEvent|FileVersionDeletedWebhookEvent - * @phpstan-type UnsafeUnwrapWebhookEventShape = UnsafeUnwrapWebhookEventVariants|VideoTransformationAcceptedEventShape|VideoTransformationReadyEventShape|VideoTransformationErrorEventShape|UploadPreTransformSuccessEventShape|UploadPreTransformErrorEventShape|UploadPostTransformSuccessEventShape|UploadPostTransformErrorEventShape|FileCreatedWebhookEventShape|FileUpdatedWebhookEventShape|FileDeletedWebhookEventShape|FileVersionCreatedWebhookEventShape|FileVersionDeletedWebhookEventShape + * @phpstan-type UnsafeUnwrapWebhookEventVariants = VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|FileCreateEvent|FileUpdateEvent|FileDeleteEvent|FileVersionCreateEvent|FileVersionDeleteEvent + * @phpstan-type UnsafeUnwrapWebhookEventShape = UnsafeUnwrapWebhookEventVariants|VideoTransformationAcceptedEventShape|VideoTransformationReadyEventShape|VideoTransformationErrorEventShape|UploadPreTransformSuccessEventShape|UploadPreTransformErrorEventShape|UploadPostTransformSuccessEventShape|UploadPostTransformErrorEventShape|FileCreateEventShape|FileUpdateEventShape|FileDeleteEventShape|FileVersionCreateEventShape|FileVersionDeleteEventShape */ final class UnsafeUnwrapWebhookEvent implements ConverterSource { @@ -44,11 +44,11 @@ public static function variants(): array UploadPreTransformErrorEvent::class, UploadPostTransformSuccessEvent::class, UploadPostTransformErrorEvent::class, - FileCreatedWebhookEvent::class, - FileUpdatedWebhookEvent::class, - FileDeletedWebhookEvent::class, - FileVersionCreatedWebhookEvent::class, - FileVersionDeletedWebhookEvent::class, + FileCreateEvent::class, + FileUpdateEvent::class, + FileDeleteEvent::class, + FileVersionCreateEvent::class, + FileVersionDeleteEvent::class, ]; } } diff --git a/src/Webhooks/UnwrapWebhookEvent.php b/src/Webhooks/UnwrapWebhookEvent.php index 89e1e1a9..e06acc5e 100644 --- a/src/Webhooks/UnwrapWebhookEvent.php +++ b/src/Webhooks/UnwrapWebhookEvent.php @@ -18,14 +18,14 @@ * @phpstan-import-type UploadPreTransformErrorEventShape from \Imagekit\Webhooks\UploadPreTransformErrorEvent * @phpstan-import-type UploadPostTransformSuccessEventShape from \Imagekit\Webhooks\UploadPostTransformSuccessEvent * @phpstan-import-type UploadPostTransformErrorEventShape from \Imagekit\Webhooks\UploadPostTransformErrorEvent - * @phpstan-import-type FileCreatedWebhookEventShape from \Imagekit\Webhooks\FileCreatedWebhookEvent - * @phpstan-import-type FileUpdatedWebhookEventShape from \Imagekit\Webhooks\FileUpdatedWebhookEvent - * @phpstan-import-type FileDeletedWebhookEventShape from \Imagekit\Webhooks\FileDeletedWebhookEvent - * @phpstan-import-type FileVersionCreatedWebhookEventShape from \Imagekit\Webhooks\FileVersionCreatedWebhookEvent - * @phpstan-import-type FileVersionDeletedWebhookEventShape from \Imagekit\Webhooks\FileVersionDeletedWebhookEvent + * @phpstan-import-type FileCreateEventShape from \Imagekit\Webhooks\FileCreateEvent + * @phpstan-import-type FileUpdateEventShape from \Imagekit\Webhooks\FileUpdateEvent + * @phpstan-import-type FileDeleteEventShape from \Imagekit\Webhooks\FileDeleteEvent + * @phpstan-import-type FileVersionCreateEventShape from \Imagekit\Webhooks\FileVersionCreateEvent + * @phpstan-import-type FileVersionDeleteEventShape from \Imagekit\Webhooks\FileVersionDeleteEvent * - * @phpstan-type UnwrapWebhookEventVariants = VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|FileCreatedWebhookEvent|FileUpdatedWebhookEvent|FileDeletedWebhookEvent|FileVersionCreatedWebhookEvent|FileVersionDeletedWebhookEvent - * @phpstan-type UnwrapWebhookEventShape = UnwrapWebhookEventVariants|VideoTransformationAcceptedEventShape|VideoTransformationReadyEventShape|VideoTransformationErrorEventShape|UploadPreTransformSuccessEventShape|UploadPreTransformErrorEventShape|UploadPostTransformSuccessEventShape|UploadPostTransformErrorEventShape|FileCreatedWebhookEventShape|FileUpdatedWebhookEventShape|FileDeletedWebhookEventShape|FileVersionCreatedWebhookEventShape|FileVersionDeletedWebhookEventShape + * @phpstan-type UnwrapWebhookEventVariants = VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|FileCreateEvent|FileUpdateEvent|FileDeleteEvent|FileVersionCreateEvent|FileVersionDeleteEvent + * @phpstan-type UnwrapWebhookEventShape = UnwrapWebhookEventVariants|VideoTransformationAcceptedEventShape|VideoTransformationReadyEventShape|VideoTransformationErrorEventShape|UploadPreTransformSuccessEventShape|UploadPreTransformErrorEventShape|UploadPostTransformSuccessEventShape|UploadPostTransformErrorEventShape|FileCreateEventShape|FileUpdateEventShape|FileDeleteEventShape|FileVersionCreateEventShape|FileVersionDeleteEventShape */ final class UnwrapWebhookEvent implements ConverterSource { @@ -44,11 +44,11 @@ public static function variants(): array UploadPreTransformErrorEvent::class, UploadPostTransformSuccessEvent::class, UploadPostTransformErrorEvent::class, - FileCreatedWebhookEvent::class, - FileUpdatedWebhookEvent::class, - FileDeletedWebhookEvent::class, - FileVersionCreatedWebhookEvent::class, - FileVersionDeletedWebhookEvent::class, + FileCreateEvent::class, + FileUpdateEvent::class, + FileDeleteEvent::class, + FileVersionCreateEvent::class, + FileVersionDeleteEvent::class, ]; } } From 333a5f51772b14a4e82ee4504f32f21fec6c4863 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 18:07:03 +0000 Subject: [PATCH 155/193] docs: improve examples --- tests/Services/CustomMetadataFieldsTest.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/Services/CustomMetadataFieldsTest.php b/tests/Services/CustomMetadataFieldsTest.php index 6e3ea292..d68aa2ec 100644 --- a/tests/Services/CustomMetadataFieldsTest.php +++ b/tests/Services/CustomMetadataFieldsTest.php @@ -62,7 +62,7 @@ public function testCreateWithOptionalParams(): void name: 'price', schema: [ 'type' => 'Number', - 'defaultValue' => 'string', + 'defaultValue' => [true, 10, 'Hello'], 'isValueRequired' => true, 'maxLength' => 0, 'maxValue' => 3000, From 60d37dc437cbdf8cead0be7cc62072975400605b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 10 Apr 2026 21:29:20 +0000 Subject: [PATCH 156/193] fix(client): properly generate file params --- README.md | 51 +++++++++++++-- src/Beta/V2/Files/FileUploadParams.php | 7 ++- src/Core/Conversion.php | 4 ++ src/Core/FileParam.php | 63 +++++++++++++++++++ src/Core/Util.php | 60 ++++++++++++++---- src/Files/FileUploadParams.php | 7 ++- .../Beta/V2/FilesContract.php | 5 +- src/ServiceContracts/FilesContract.php | 5 +- src/Services/Beta/V2/FilesRawService.php | 3 +- src/Services/Beta/V2/FilesService.php | 5 +- src/Services/FilesRawService.php | 3 +- src/Services/FilesService.php | 5 +- tests/ClientTest.php | 6 +- tests/Services/Beta/V2/FilesTest.php | 7 ++- tests/Services/FilesTest.php | 8 ++- 15 files changed, 200 insertions(+), 39 deletions(-) create mode 100644 src/Core/FileParam.php diff --git a/README.md b/README.md index 81583e5f..c36e89be 100644 --- a/README.md +++ b/README.md @@ -33,13 +33,17 @@ Parameters with a default value must be set by name. files->upload(file: 'file', fileName: 'file-name.jpg'); +$response = $client->files->upload( + file: FileParam::fromString('https://www.example.com/public-url.jpg', filename: uniqid('file-upload-', true)), + fileName: 'file-name.jpg', +); var_dump($response->videoCodec); ``` @@ -58,12 +62,16 @@ When the library is unable to connect to the API, or if the API returns a non-su ```php files->upload(file: 'file', fileName: 'file-name.jpg'); + $response = $client->files->upload( + file: FileParam::fromString('https://www.example.com/public-url.jpg', filename: uniqid('file-upload-', true)), + fileName: 'file-name.jpg', + ); } catch (APIConnectionException $e) { echo "The server could not be reached", PHP_EOL; var_dump($e->getPrevious()); @@ -103,16 +111,49 @@ You can use the `maxRetries` option to configure or disable this: 0]); // Or, configure per-request: $result = $client->files->upload( - file: 'file', fileName: 'file-name.jpg', requestOptions: ['maxRetries' => 5] + file: FileParam::fromString('https://www.example.com/public-url.jpg', filename: uniqid('file-upload-', true)), + fileName: 'file-name.jpg', + requestOptions: ['maxRetries' => 5], ); ``` +### File uploads + +Request parameters that correspond to file uploads can be passed as a resource returned by `fopen()`, a string of file contents, or a `FileParam` instance. + +```php +files->upload( + file: FileParam::fromString($contents, filename: '/path/to/file', contentType: '…'), +); + +// Pass in only a string (where applicable) +$response = $client->files->upload(file: '…'); + +// Pass an open resource: +$fd = fopen('/path/to/file', 'r'); +try { + $response = $client->files->upload( + file: FileParam::fromResource($fd, filename: '/path/to/file', contentType: '…'), + ); +} finally { + fclose($fd); +} +``` + ## Advanced concepts ### Making custom or undocumented requests @@ -126,8 +167,10 @@ Note: the `extra*` parameters of the same name overrides the documented paramete ```php files->upload( - file: 'file', + file: FileParam::fromString('https://www.example.com/public-url.jpg', filename: uniqid('file-upload-', true)), fileName: 'file-name.jpg', requestOptions: [ 'extraQueryParams' => ['my_query_parameter' => 'value'], diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index cffda1b5..53af7373 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -11,6 +11,7 @@ use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\FileParam; use Imagekit\ExtensionItem; /** @@ -36,7 +37,7 @@ * @phpstan-import-type TransformationShape from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation * * @phpstan-type FileUploadParamsShape = array{ - * file: string, + * file: string|FileParam, * fileName: string, * token?: string|null, * checks?: string|null, @@ -259,7 +260,7 @@ public function __construct() * @param Transformation|TransformationShape|null $transformation */ public static function with( - string $file, + string|FileParam $file, string $fileName, ?string $token = null, ?string $checks = null, @@ -316,7 +317,7 @@ public static function with( * * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. */ - public function withFile(string $file): self + public function withFile(string|FileParam $file): self { $self = clone $this; $self['file'] = $file; diff --git a/src/Core/Conversion.php b/src/Core/Conversion.php index 67bc902f..2704e99e 100644 --- a/src/Core/Conversion.php +++ b/src/Core/Conversion.php @@ -21,6 +21,10 @@ public static function dump_unknown(mixed $value, DumpState $state): mixed } if (is_object($value)) { + if ($value instanceof FileParam) { + return $value; + } + if (is_a($value, class: ConverterSource::class)) { return $value::converter()->dump($value, state: $state); } diff --git a/src/Core/FileParam.php b/src/Core/FileParam.php new file mode 100644 index 00000000..3fb89d2e --- /dev/null +++ b/src/Core/FileParam.php @@ -0,0 +1,63 @@ +files->upload(file: FileParam::fromResource(fopen('data.csv', 'r'))); + * + * // From a string: + * $client->files->upload(file: FileParam::fromString('csv data...', 'data.csv')); + * ``` + */ +final class FileParam +{ + public const DEFAULT_CONTENT_TYPE = 'application/octet-stream'; + + /** + * @param resource|string $data the file content as a resource or string + */ + private function __construct( + public readonly mixed $data, + public readonly string $filename, + public readonly string $contentType = self::DEFAULT_CONTENT_TYPE, + ) {} + + /** + * Create a FileParam from an open resource (e.g. from fopen()). + * + * @param resource $resource an open file resource + * @param string|null $filename Override the filename. Defaults to the resource URI basename. + * @param string $contentType override the content type + */ + public static function fromResource(mixed $resource, ?string $filename = null, string $contentType = self::DEFAULT_CONTENT_TYPE): self + { + if (!is_resource($resource)) { + throw new \InvalidArgumentException('Expected a resource, got '.get_debug_type($resource)); + } + + if (null === $filename) { + $meta = stream_get_meta_data($resource); + $filename = basename($meta['uri'] ?? 'upload'); + } + + return new self($resource, filename: $filename, contentType: $contentType); + } + + /** + * Create a FileParam from a string. + * + * @param string $content the file content + * @param string $filename the filename for the Content-Disposition header + * @param string $contentType override the content type + */ + public static function fromString(string $content, string $filename, string $contentType = self::DEFAULT_CONTENT_TYPE): self + { + return new self($content, filename: $filename, contentType: $contentType); + } +} diff --git a/src/Core/Util.php b/src/Core/Util.php index 2f5e05ec..5739e11a 100644 --- a/src/Core/Util.php +++ b/src/Core/Util.php @@ -283,7 +283,7 @@ public static function withSetBody( if (preg_match('/^multipart\/form-data/', $contentType)) { [$boundary, $gen] = self::encodeMultipartStreaming($body); - $encoded = implode('', iterator_to_array($gen)); + $encoded = implode('', iterator_to_array($gen, preserve_keys: false)); $stream = $factory->createStream($encoded); /** @var RequestInterface */ @@ -447,11 +447,18 @@ private static function writeMultipartContent( ): \Generator { $contentLine = "Content-Type: %s\r\n\r\n"; - if (is_resource($val)) { - yield sprintf($contentLine, $contentType ?? 'application/octet-stream'); - while (!feof($val)) { - if ($read = fread($val, length: self::BUF_SIZE)) { - yield $read; + if ($val instanceof FileParam) { + $ct = $val->contentType ?? $contentType; + + yield sprintf($contentLine, $ct); + $data = $val->data; + if (is_string($data)) { + yield $data; + } else { // resource + while (!feof($data)) { + if ($read = fread($data, length: self::BUF_SIZE)) { + yield $read; + } } } } elseif (is_string($val) || is_numeric($val) || is_bool($val)) { @@ -483,17 +490,48 @@ private static function writeMultipartChunk( yield 'Content-Disposition: form-data'; if (!is_null($key)) { - $name = rawurlencode(self::strVal($key)); + $name = str_replace(['"', "\r", "\n"], replace: '', subject: $key); yield "; name=\"{$name}\""; } + // File uploads require a filename in the Content-Disposition header, + // e.g. `Content-Disposition: form-data; name="file"; filename="data.csv"` + // Without this, many servers will reject the upload with a 400. + if ($val instanceof FileParam) { + $filename = str_replace(['"', "\r", "\n"], replace: '', subject: $val->filename); + + yield "; filename=\"{$filename}\""; + } + yield "\r\n"; foreach (self::writeMultipartContent($val, closing: $closing) as $chunk) { yield $chunk; } } + /** + * Expands list arrays into separate multipart parts, applying the configured array key format. + * + * @param list $closing + * + * @return \Generator + */ + private static function writeMultipartField( + string $boundary, + ?string $key, + mixed $val, + array &$closing + ): \Generator { + if (is_array($val) && array_is_list($val)) { + foreach ($val as $item) { + yield from self::writeMultipartField(boundary: $boundary, key: $key, val: $item, closing: $closing); + } + } else { + yield from self::writeMultipartChunk(boundary: $boundary, key: $key, val: $val, closing: $closing); + } + } + /** * @param bool|int|float|string|resource|\Traversable|array|null $body * @@ -508,14 +546,10 @@ private static function encodeMultipartStreaming(mixed $body): array try { if (is_array($body) || is_object($body)) { foreach ((array) $body as $key => $val) { - foreach (static::writeMultipartChunk(boundary: $boundary, key: $key, val: $val, closing: $closing) as $chunk) { - yield $chunk; - } + yield from static::writeMultipartField(boundary: $boundary, key: $key, val: $val, closing: $closing); } } else { - foreach (static::writeMultipartChunk(boundary: $boundary, key: null, val: $body, closing: $closing) as $chunk) { - yield $chunk; - } + yield from static::writeMultipartField(boundary: $boundary, key: null, val: $body, closing: $closing); } yield "--{$boundary}--\r\n"; diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index 309ba54d..8b3c6ace 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -9,6 +9,7 @@ use Imagekit\Core\Concerns\SdkModel; use Imagekit\Core\Concerns\SdkParams; use Imagekit\Core\Contracts\BaseModel; +use Imagekit\Core\FileParam; use Imagekit\ExtensionItem; use Imagekit\Files\FileUploadParams\ResponseField; use Imagekit\Files\FileUploadParams\Transformation; @@ -36,7 +37,7 @@ * @phpstan-import-type TransformationShape from \Imagekit\Files\FileUploadParams\Transformation * * @phpstan-type FileUploadParamsShape = array{ - * file: string, + * file: string|FileParam, * fileName: string, * token?: string|null, * checks?: string|null, @@ -292,7 +293,7 @@ public function __construct() * @param Transformation|TransformationShape|null $transformation */ public static function with( - string $file, + string|FileParam $file, string $fileName, ?string $token = null, ?string $checks = null, @@ -355,7 +356,7 @@ public static function with( * * When supplying a URL, the server must receive the response headers within 8 seconds; otherwise the request fails with 400 Bad Request. */ - public function withFile(string $file): self + public function withFile(string|FileParam $file): self { $self = clone $this; $self['file'] = $file; diff --git a/src/ServiceContracts/Beta/V2/FilesContract.php b/src/ServiceContracts/Beta/V2/FilesContract.php index 2a3eb774..f54c2f5f 100644 --- a/src/ServiceContracts/Beta/V2/FilesContract.php +++ b/src/ServiceContracts/Beta/V2/FilesContract.php @@ -8,6 +8,7 @@ use Imagekit\Beta\V2\Files\FileUploadParams\Transformation; use Imagekit\Beta\V2\Files\FileUploadResponse; use Imagekit\Core\Exceptions\APIException; +use Imagekit\Core\FileParam; use Imagekit\RequestOptions; /** @@ -20,7 +21,7 @@ interface FilesContract /** * @api * - * @param string $file The API accepts any of the following: + * @param string|FileParam $file The API accepts any of the following: * * - **Binary data** – send the raw bytes as `multipart/form-data`. * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. @@ -76,7 +77,7 @@ interface FilesContract * @throws APIException */ public function upload( - string $file, + string|FileParam $file, string $fileName, ?string $token = null, ?string $checks = null, diff --git a/src/ServiceContracts/FilesContract.php b/src/ServiceContracts/FilesContract.php index 18aa18cf..77a2e514 100644 --- a/src/ServiceContracts/FilesContract.php +++ b/src/ServiceContracts/FilesContract.php @@ -5,6 +5,7 @@ namespace Imagekit\ServiceContracts; use Imagekit\Core\Exceptions\APIException; +use Imagekit\Core\FileParam; use Imagekit\Files\File; use Imagekit\Files\FileCopyResponse; use Imagekit\Files\FileMoveResponse; @@ -145,7 +146,7 @@ public function rename( /** * @api * - * @param string $file The API accepts any of the following: + * @param string|FileParam $file The API accepts any of the following: * * - **Binary data** – send the raw bytes as `multipart/form-data`. * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. @@ -221,7 +222,7 @@ public function rename( * @throws APIException */ public function upload( - string $file, + string|FileParam $file, string $fileName, ?string $token = null, ?string $checks = null, diff --git a/src/Services/Beta/V2/FilesRawService.php b/src/Services/Beta/V2/FilesRawService.php index a73c356f..2f68f904 100644 --- a/src/Services/Beta/V2/FilesRawService.php +++ b/src/Services/Beta/V2/FilesRawService.php @@ -11,6 +11,7 @@ use Imagekit\Client; use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Exceptions\APIException; +use Imagekit\Core\FileParam; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Beta\V2\FilesRawContract; @@ -46,7 +47,7 @@ public function __construct(private Client $client) {} * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. * * @param array{ - * file: string, + * file: string|FileParam, * fileName: string, * token?: string, * checks?: string, diff --git a/src/Services/Beta/V2/FilesService.php b/src/Services/Beta/V2/FilesService.php index 4688fc5e..2bdad7fa 100644 --- a/src/Services/Beta/V2/FilesService.php +++ b/src/Services/Beta/V2/FilesService.php @@ -9,6 +9,7 @@ use Imagekit\Beta\V2\Files\FileUploadResponse; use Imagekit\Client; use Imagekit\Core\Exceptions\APIException; +use Imagekit\Core\FileParam; use Imagekit\Core\Util; use Imagekit\RequestOptions; use Imagekit\ServiceContracts\Beta\V2\FilesContract; @@ -51,7 +52,7 @@ public function __construct(private Client $client) * - A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more. * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. * - * @param string $file The API accepts any of the following: + * @param string|FileParam $file The API accepts any of the following: * * - **Binary data** – send the raw bytes as `multipart/form-data`. * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. @@ -107,7 +108,7 @@ public function __construct(private Client $client) * @throws APIException */ public function upload( - string $file, + string|FileParam $file, string $fileName, ?string $token = null, ?string $checks = null, diff --git a/src/Services/FilesRawService.php b/src/Services/FilesRawService.php index e729ebed..3cb525ea 100644 --- a/src/Services/FilesRawService.php +++ b/src/Services/FilesRawService.php @@ -7,6 +7,7 @@ use Imagekit\Client; use Imagekit\Core\Contracts\BaseResponse; use Imagekit\Core\Exceptions\APIException; +use Imagekit\Core\FileParam; use Imagekit\Files\File; use Imagekit\Files\FileCopyParams; use Imagekit\Files\FileCopyResponse; @@ -257,7 +258,7 @@ public function rename( * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. * * @param array{ - * file: string, + * file: string|FileParam, * fileName: string, * token?: string, * checks?: string, diff --git a/src/Services/FilesService.php b/src/Services/FilesService.php index 32ccb73e..9980b528 100644 --- a/src/Services/FilesService.php +++ b/src/Services/FilesService.php @@ -6,6 +6,7 @@ use Imagekit\Client; use Imagekit\Core\Exceptions\APIException; +use Imagekit\Core\FileParam; use Imagekit\Core\Util; use Imagekit\Files\File; use Imagekit\Files\FileCopyResponse; @@ -283,7 +284,7 @@ public function rename( * - A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more. * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. * - * @param string $file The API accepts any of the following: + * @param string|FileParam $file The API accepts any of the following: * * - **Binary data** – send the raw bytes as `multipart/form-data`. * - **HTTP / HTTPS URL** – a publicly reachable URL that ImageKit’s servers can fetch. @@ -359,7 +360,7 @@ public function rename( * @throws APIException */ public function upload( - string $file, + string|FileParam $file, string $fileName, ?string $token = null, ?string $checks = null, diff --git a/tests/ClientTest.php b/tests/ClientTest.php index 5c16f737..7c364591 100644 --- a/tests/ClientTest.php +++ b/tests/ClientTest.php @@ -4,6 +4,7 @@ use Http\Discovery\Psr17FactoryDiscovery; use Http\Mock\Client; +use Imagekit\Core\FileParam; use Imagekit\Core\Util; use PHPUnit\Framework\TestCase; @@ -33,7 +34,10 @@ public function testDefaultHeaders(): void requestOptions: ['transporter' => $transporter], ); - $client->files->upload(file: 'file', fileName: 'fileName'); + $client->files->upload( + file: FileParam::fromString('Example data', filename: uniqid('file-upload-', true)), + fileName: 'fileName', + ); $this->assertNotFalse($requested = $transporter->getRequests()[0] ?? false); diff --git a/tests/Services/Beta/V2/FilesTest.php b/tests/Services/Beta/V2/FilesTest.php index 000a4df1..ea62d779 100644 --- a/tests/Services/Beta/V2/FilesTest.php +++ b/tests/Services/Beta/V2/FilesTest.php @@ -4,6 +4,7 @@ use Imagekit\Beta\V2\Files\FileUploadResponse; use Imagekit\Client; +use Imagekit\Core\FileParam; use Imagekit\Core\Util; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; @@ -40,8 +41,8 @@ public function testUpload(): void } $result = $this->client->beta->v2->files->upload( - file: 'file', - fileName: 'fileName' + file: FileParam::fromString('Example data', filename: uniqid('file-upload-', true)), + fileName: 'fileName', ); // @phpstan-ignore-next-line method.alreadyNarrowedType @@ -56,7 +57,7 @@ public function testUploadWithOptionalParams(): void } $result = $this->client->beta->v2->files->upload( - file: 'file', + file: FileParam::fromString('Example data', filename: uniqid('file-upload-', true)), fileName: 'fileName', token: 'token', checks: "\"request.folder\" : \"marketing/\"\n", diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index ae755594..55ee8e0d 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -3,6 +3,7 @@ namespace Tests\Services; use Imagekit\Client; +use Imagekit\Core\FileParam; use Imagekit\Core\Util; use Imagekit\Files\File; use Imagekit\Files\FileCopyResponse; @@ -181,7 +182,10 @@ public function testUpload(): void $this->markTestSkipped('Mock server tests are disabled'); } - $result = $this->client->files->upload(file: 'file', fileName: 'fileName'); + $result = $this->client->files->upload( + file: FileParam::fromString('Example data', filename: uniqid('file-upload-', true)), + fileName: 'fileName', + ); // @phpstan-ignore-next-line method.alreadyNarrowedType $this->assertInstanceOf(FileUploadResponse::class, $result); @@ -195,7 +199,7 @@ public function testUploadWithOptionalParams(): void } $result = $this->client->files->upload( - file: 'file', + file: FileParam::fromString('Example data', filename: uniqid('file-upload-', true)), fileName: 'fileName', token: 'token', checks: "\"request.folder\" : \"marketing/\"\n", From 68c5081d55cfcfe59a960e12e8c2c5fec62d3183 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 13 Apr 2026 00:58:21 +0000 Subject: [PATCH 157/193] fix(api): extract shared schemas to prevent Go webhook union breaking changes --- .stats.yml | 6 +++--- src/Beta/V2/Files/FileUploadResponse.php | 4 ++-- src/Beta/V2/Files/FileUploadResponse/AITag.php | 4 ++-- src/Files/File.php | 16 ++++++++-------- src/Files/File/VersionInfo.php | 2 +- src/Files/FileUpdateResponse.php | 16 ++++++++-------- src/Files/FileUploadResponse.php | 4 ++-- src/Files/FileUploadResponse/AITag.php | 4 ++-- .../UploadPreTransformSuccessEvent/Data.php | 4 ++-- .../Data/AITag.php | 4 ++-- 10 files changed, 32 insertions(+), 32 deletions(-) diff --git a/.stats.yml b/.stats.yml index aae6cba6..92aebe1f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-d73a37dc3426586109bd153f02c6a605036b6a7396bba5173d013468c5291ce6.yml -openapi_spec_hash: c193c6e557ff477481ec8d5ac8a0c96e -config_hash: 32b155378f65c234d3abeb18519fb3cd +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-7c4c23556be689ded6bcafd05e1645b82239521c9c841c0f7e76336e2eefcffa.yml +openapi_spec_hash: eca5b039a0066c6536296248c3a80854 +config_hash: e3c2679d25f6235381dfb11962fbf3d9 diff --git a/src/Beta/V2/Files/FileUploadResponse.php b/src/Beta/V2/Files/FileUploadResponse.php index b6c1159f..b865d8c8 100644 --- a/src/Beta/V2/Files/FileUploadResponse.php +++ b/src/Beta/V2/Files/FileUploadResponse.php @@ -56,7 +56,7 @@ final class FileUploadResponse implements BaseModel use SdkModel; /** - * An array of tags assigned to the uploaded file by auto tagging. + * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. * * @var list|null $aiTags */ @@ -303,7 +303,7 @@ public static function with( } /** - * An array of tags assigned to the uploaded file by auto tagging. + * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. * * @param list|null $aiTags */ diff --git a/src/Beta/V2/Files/FileUploadResponse/AITag.php b/src/Beta/V2/Files/FileUploadResponse/AITag.php index f5ff05b8..811659b6 100644 --- a/src/Beta/V2/Files/FileUploadResponse/AITag.php +++ b/src/Beta/V2/Files/FileUploadResponse/AITag.php @@ -31,7 +31,7 @@ final class AITag implements BaseModel public ?string $name; /** - * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + * Source of the tag. Possible values are `google-auto-tagging` and `aws-auto-tagging`. */ #[Optional] public ?string $source; @@ -83,7 +83,7 @@ public function withName(string $name): self } /** - * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + * Source of the tag. Possible values are `google-auto-tagging` and `aws-auto-tagging`. */ public function withSource(string $source): self { diff --git a/src/Files/File.php b/src/Files/File.php index e3a09657..b4f4de63 100644 --- a/src/Files/File.php +++ b/src/Files/File.php @@ -56,7 +56,7 @@ final class File implements BaseModel use SdkModel; /** - * An array of tags assigned to the file by auto tagging. + * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. * * @var list|null $aiTags */ @@ -88,7 +88,7 @@ final class File implements BaseModel public ?string $customCoordinates; /** - * An object with custom metadata for the file. + * A key-value data associated with the asset. Use `responseField` in API request to get `customMetadata` in the upload API response. Before setting any custom metadata on an asset, you have to create the field using custom metadata fields API. Send `customMetadata` in `responseFields` in API request to get the value of this field. * * @var array|null $customMetadata */ @@ -108,7 +108,7 @@ final class File implements BaseModel public ?int $duration; /** - * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. + * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. Send `embeddedMetadata` in `responseFields` in API request to get embeddedMetadata in the upload API response. * * @var array|null $embeddedMetadata */ @@ -222,7 +222,7 @@ final class File implements BaseModel public ?string $url; /** - * An object with details of the file version. + * An object containing the file or file version's `id` (versionId) and `name`. */ #[Optional] public ?VersionInfo $versionInfo; @@ -322,7 +322,7 @@ public static function with( } /** - * An array of tags assigned to the file by auto tagging. + * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. * * @param list|null $aiTags */ @@ -379,7 +379,7 @@ public function withCustomCoordinates(?string $customCoordinates): self } /** - * An object with custom metadata for the file. + * A key-value data associated with the asset. Use `responseField` in API request to get `customMetadata` in the upload API response. Before setting any custom metadata on an asset, you have to create the field using custom metadata fields API. Send `customMetadata` in `responseFields` in API request to get the value of this field. * * @param array $customMetadata */ @@ -414,7 +414,7 @@ public function withDuration(int $duration): self } /** - * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. + * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. Send `embeddedMetadata` in `responseFields` in API request to get embeddedMetadata in the upload API response. * * @param array $embeddedMetadata */ @@ -613,7 +613,7 @@ public function withURL(string $url): self } /** - * An object with details of the file version. + * An object containing the file or file version's `id` (versionId) and `name`. * * @param VersionInfo|VersionInfoShape $versionInfo */ diff --git a/src/Files/File/VersionInfo.php b/src/Files/File/VersionInfo.php index d7ff2131..1321dc5a 100644 --- a/src/Files/File/VersionInfo.php +++ b/src/Files/File/VersionInfo.php @@ -9,7 +9,7 @@ use Imagekit\Core\Contracts\BaseModel; /** - * An object with details of the file version. + * An object containing the file or file version's `id` (versionId) and `name`. * * @phpstan-type VersionInfoShape = array{id?: string|null, name?: string|null} */ diff --git a/src/Files/FileUpdateResponse.php b/src/Files/FileUpdateResponse.php index 94ac82a2..84e04572 100644 --- a/src/Files/FileUpdateResponse.php +++ b/src/Files/FileUpdateResponse.php @@ -59,7 +59,7 @@ final class FileUpdateResponse implements BaseModel use SdkModel; /** - * An array of tags assigned to the file by auto tagging. + * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. * * @var list|null $aiTags */ @@ -91,7 +91,7 @@ final class FileUpdateResponse implements BaseModel public ?string $customCoordinates; /** - * An object with custom metadata for the file. + * A key-value data associated with the asset. Use `responseField` in API request to get `customMetadata` in the upload API response. Before setting any custom metadata on an asset, you have to create the field using custom metadata fields API. Send `customMetadata` in `responseFields` in API request to get the value of this field. * * @var array|null $customMetadata */ @@ -111,7 +111,7 @@ final class FileUpdateResponse implements BaseModel public ?int $duration; /** - * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. + * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. Send `embeddedMetadata` in `responseFields` in API request to get embeddedMetadata in the upload API response. * * @var array|null $embeddedMetadata */ @@ -225,7 +225,7 @@ final class FileUpdateResponse implements BaseModel public ?string $url; /** - * An object with details of the file version. + * An object containing the file or file version's `id` (versionId) and `name`. */ #[Optional] public ?VersionInfo $versionInfo; @@ -331,7 +331,7 @@ public static function with( } /** - * An array of tags assigned to the file by auto tagging. + * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. * * @param list|null $aiTags */ @@ -388,7 +388,7 @@ public function withCustomCoordinates(?string $customCoordinates): self } /** - * An object with custom metadata for the file. + * A key-value data associated with the asset. Use `responseField` in API request to get `customMetadata` in the upload API response. Before setting any custom metadata on an asset, you have to create the field using custom metadata fields API. Send `customMetadata` in `responseFields` in API request to get the value of this field. * * @param array $customMetadata */ @@ -423,7 +423,7 @@ public function withDuration(int $duration): self } /** - * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. + * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. Send `embeddedMetadata` in `responseFields` in API request to get embeddedMetadata in the upload API response. * * @param array $embeddedMetadata */ @@ -622,7 +622,7 @@ public function withURL(string $url): self } /** - * An object with details of the file version. + * An object containing the file or file version's `id` (versionId) and `name`. * * @param VersionInfo|VersionInfoShape $versionInfo */ diff --git a/src/Files/FileUploadResponse.php b/src/Files/FileUploadResponse.php index 60cfc020..668ef356 100644 --- a/src/Files/FileUploadResponse.php +++ b/src/Files/FileUploadResponse.php @@ -55,7 +55,7 @@ final class FileUploadResponse implements BaseModel use SdkModel; /** - * An array of tags assigned to the uploaded file by auto tagging. + * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. * * @var list|null $aiTags */ @@ -302,7 +302,7 @@ public static function with( } /** - * An array of tags assigned to the uploaded file by auto tagging. + * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. * * @param list|null $aiTags */ diff --git a/src/Files/FileUploadResponse/AITag.php b/src/Files/FileUploadResponse/AITag.php index 3a4845ea..abb9819b 100644 --- a/src/Files/FileUploadResponse/AITag.php +++ b/src/Files/FileUploadResponse/AITag.php @@ -31,7 +31,7 @@ final class AITag implements BaseModel public ?string $name; /** - * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + * Source of the tag. Possible values are `google-auto-tagging` and `aws-auto-tagging`. */ #[Optional] public ?string $source; @@ -83,7 +83,7 @@ public function withName(string $name): self } /** - * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + * Source of the tag. Possible values are `google-auto-tagging` and `aws-auto-tagging`. */ public function withSource(string $source): self { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php index 6d06b25d..2a17c7f2 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php @@ -56,7 +56,7 @@ final class Data implements BaseModel use SdkModel; /** - * An array of tags assigned to the uploaded file by auto tagging. + * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. * * @var list|null $aiTags */ @@ -303,7 +303,7 @@ public static function with( } /** - * An array of tags assigned to the uploaded file by auto tagging. + * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. * * @param list|null $aiTags */ diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php index ab3b5f38..ad22990f 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php @@ -31,7 +31,7 @@ final class AITag implements BaseModel public ?string $name; /** - * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + * Source of the tag. Possible values are `google-auto-tagging` and `aws-auto-tagging`. */ #[Optional] public ?string $source; @@ -83,7 +83,7 @@ public function withName(string $name): self } /** - * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + * Source of the tag. Possible values are `google-auto-tagging` and `aws-auto-tagging`. */ public function withSource(string $source): self { From cd7f0dcf9bb62573b005e5891396152785e3fd2a Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 13 Apr 2026 01:00:00 +0000 Subject: [PATCH 158/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 92aebe1f..c4bde9f0 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-7c4c23556be689ded6bcafd05e1645b82239521c9c841c0f7e76336e2eefcffa.yml openapi_spec_hash: eca5b039a0066c6536296248c3a80854 -config_hash: e3c2679d25f6235381dfb11962fbf3d9 +config_hash: f914ebc9670f6e7c7751660caa4e5556 From 15d5ae51731a0f47527aeb3643b2cf75cc69151c Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 13 Apr 2026 01:33:00 +0000 Subject: [PATCH 159/193] refactor: AITags to singular AITag schema with array items pattern --- .stats.yml | 6 +++--- src/Beta/V2/Files/FileUploadResponse.php | 4 ++-- src/Beta/V2/Files/FileUploadResponse/AITag.php | 2 ++ src/Files/File.php | 16 ++++++++-------- src/Files/File/AITag.php | 2 ++ src/Files/FileUpdateResponse.php | 12 ++++++------ src/Files/FileUploadResponse.php | 4 ++-- src/Files/FileUploadResponse/AITag.php | 2 ++ .../UploadPreTransformSuccessEvent/Data.php | 4 ++-- .../Data/AITag.php | 2 ++ 10 files changed, 31 insertions(+), 23 deletions(-) diff --git a/.stats.yml b/.stats.yml index c4bde9f0..3d19128a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-7c4c23556be689ded6bcafd05e1645b82239521c9c841c0f7e76336e2eefcffa.yml -openapi_spec_hash: eca5b039a0066c6536296248c3a80854 -config_hash: f914ebc9670f6e7c7751660caa4e5556 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-70c42eda2bee929830b2537f758400a58dded1f1ef5686a286e2469c35a041a0.yml +openapi_spec_hash: cdaeed824e91657b45092765cf55eb42 +config_hash: e3c2679d25f6235381dfb11962fbf3d9 diff --git a/src/Beta/V2/Files/FileUploadResponse.php b/src/Beta/V2/Files/FileUploadResponse.php index b865d8c8..b6c1159f 100644 --- a/src/Beta/V2/Files/FileUploadResponse.php +++ b/src/Beta/V2/Files/FileUploadResponse.php @@ -56,7 +56,7 @@ final class FileUploadResponse implements BaseModel use SdkModel; /** - * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + * An array of tags assigned to the uploaded file by auto tagging. * * @var list|null $aiTags */ @@ -303,7 +303,7 @@ public static function with( } /** - * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + * An array of tags assigned to the uploaded file by auto tagging. * * @param list|null $aiTags */ diff --git a/src/Beta/V2/Files/FileUploadResponse/AITag.php b/src/Beta/V2/Files/FileUploadResponse/AITag.php index 811659b6..64b74dd9 100644 --- a/src/Beta/V2/Files/FileUploadResponse/AITag.php +++ b/src/Beta/V2/Files/FileUploadResponse/AITag.php @@ -9,6 +9,8 @@ use Imagekit\Core\Contracts\BaseModel; /** + * AI-generated tag associated with an image. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + * * @phpstan-type AITagShape = array{ * confidence?: float|null, name?: string|null, source?: string|null * } diff --git a/src/Files/File.php b/src/Files/File.php index b4f4de63..dd61b010 100644 --- a/src/Files/File.php +++ b/src/Files/File.php @@ -56,7 +56,7 @@ final class File implements BaseModel use SdkModel; /** - * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + * Array of AI-generated tags associated with the image. If no AITags are set, it will be null. * * @var list|null $aiTags */ @@ -88,7 +88,7 @@ final class File implements BaseModel public ?string $customCoordinates; /** - * A key-value data associated with the asset. Use `responseField` in API request to get `customMetadata` in the upload API response. Before setting any custom metadata on an asset, you have to create the field using custom metadata fields API. Send `customMetadata` in `responseFields` in API request to get the value of this field. + * An object with custom metadata for the file. * * @var array|null $customMetadata */ @@ -108,7 +108,7 @@ final class File implements BaseModel public ?int $duration; /** - * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. Send `embeddedMetadata` in `responseFields` in API request to get embeddedMetadata in the upload API response. + * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. * * @var array|null $embeddedMetadata */ @@ -222,7 +222,7 @@ final class File implements BaseModel public ?string $url; /** - * An object containing the file or file version's `id` (versionId) and `name`. + * An object with details of the file version. */ #[Optional] public ?VersionInfo $versionInfo; @@ -322,7 +322,7 @@ public static function with( } /** - * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + * Array of AI-generated tags associated with the image. If no AITags are set, it will be null. * * @param list|null $aiTags */ @@ -379,7 +379,7 @@ public function withCustomCoordinates(?string $customCoordinates): self } /** - * A key-value data associated with the asset. Use `responseField` in API request to get `customMetadata` in the upload API response. Before setting any custom metadata on an asset, you have to create the field using custom metadata fields API. Send `customMetadata` in `responseFields` in API request to get the value of this field. + * An object with custom metadata for the file. * * @param array $customMetadata */ @@ -414,7 +414,7 @@ public function withDuration(int $duration): self } /** - * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. Send `embeddedMetadata` in `responseFields` in API request to get embeddedMetadata in the upload API response. + * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. * * @param array $embeddedMetadata */ @@ -613,7 +613,7 @@ public function withURL(string $url): self } /** - * An object containing the file or file version's `id` (versionId) and `name`. + * An object with details of the file version. * * @param VersionInfo|VersionInfoShape $versionInfo */ diff --git a/src/Files/File/AITag.php b/src/Files/File/AITag.php index 446832e5..b4b92a75 100644 --- a/src/Files/File/AITag.php +++ b/src/Files/File/AITag.php @@ -9,6 +9,8 @@ use Imagekit\Core\Contracts\BaseModel; /** + * AI-generated tag associated with an image. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + * * @phpstan-type AITagShape = array{ * confidence?: float|null, name?: string|null, source?: string|null * } diff --git a/src/Files/FileUpdateResponse.php b/src/Files/FileUpdateResponse.php index 84e04572..545093d7 100644 --- a/src/Files/FileUpdateResponse.php +++ b/src/Files/FileUpdateResponse.php @@ -59,7 +59,7 @@ final class FileUpdateResponse implements BaseModel use SdkModel; /** - * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + * Array of AI-generated tags associated with the image. If no AITags are set, it will be null. * * @var list|null $aiTags */ @@ -91,7 +91,7 @@ final class FileUpdateResponse implements BaseModel public ?string $customCoordinates; /** - * A key-value data associated with the asset. Use `responseField` in API request to get `customMetadata` in the upload API response. Before setting any custom metadata on an asset, you have to create the field using custom metadata fields API. Send `customMetadata` in `responseFields` in API request to get the value of this field. + * A key-value data associated with the asset. * * @var array|null $customMetadata */ @@ -111,7 +111,7 @@ final class FileUpdateResponse implements BaseModel public ?int $duration; /** - * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. Send `embeddedMetadata` in `responseFields` in API request to get embeddedMetadata in the upload API response. + * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. * * @var array|null $embeddedMetadata */ @@ -331,7 +331,7 @@ public static function with( } /** - * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + * Array of AI-generated tags associated with the image. If no AITags are set, it will be null. * * @param list|null $aiTags */ @@ -388,7 +388,7 @@ public function withCustomCoordinates(?string $customCoordinates): self } /** - * A key-value data associated with the asset. Use `responseField` in API request to get `customMetadata` in the upload API response. Before setting any custom metadata on an asset, you have to create the field using custom metadata fields API. Send `customMetadata` in `responseFields` in API request to get the value of this field. + * A key-value data associated with the asset. * * @param array $customMetadata */ @@ -423,7 +423,7 @@ public function withDuration(int $duration): self } /** - * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. Send `embeddedMetadata` in `responseFields` in API request to get embeddedMetadata in the upload API response. + * Consolidated embedded metadata associated with the file. It includes exif, iptc, and xmp data. * * @param array $embeddedMetadata */ diff --git a/src/Files/FileUploadResponse.php b/src/Files/FileUploadResponse.php index 668ef356..60cfc020 100644 --- a/src/Files/FileUploadResponse.php +++ b/src/Files/FileUploadResponse.php @@ -55,7 +55,7 @@ final class FileUploadResponse implements BaseModel use SdkModel; /** - * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + * An array of tags assigned to the uploaded file by auto tagging. * * @var list|null $aiTags */ @@ -302,7 +302,7 @@ public static function with( } /** - * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + * An array of tags assigned to the uploaded file by auto tagging. * * @param list|null $aiTags */ diff --git a/src/Files/FileUploadResponse/AITag.php b/src/Files/FileUploadResponse/AITag.php index abb9819b..5e059012 100644 --- a/src/Files/FileUploadResponse/AITag.php +++ b/src/Files/FileUploadResponse/AITag.php @@ -9,6 +9,8 @@ use Imagekit\Core\Contracts\BaseModel; /** + * AI-generated tag associated with an image. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + * * @phpstan-type AITagShape = array{ * confidence?: float|null, name?: string|null, source?: string|null * } diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php index 2a17c7f2..6d06b25d 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php @@ -56,7 +56,7 @@ final class Data implements BaseModel use SdkModel; /** - * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + * An array of tags assigned to the uploaded file by auto tagging. * * @var list|null $aiTags */ @@ -303,7 +303,7 @@ public static function with( } /** - * Array of `AITags` associated with the image. If no `AITags` are set, it will be null. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + * An array of tags assigned to the uploaded file by auto tagging. * * @param list|null $aiTags */ diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php index ad22990f..4bba6eda 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php @@ -9,6 +9,8 @@ use Imagekit\Core\Contracts\BaseModel; /** + * AI-generated tag associated with an image. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. + * * @phpstan-type AITagShape = array{ * confidence?: float|null, name?: string|null, source?: string|null * } From a56537f45daad6e06ddf8e693429704c6a4a9a63 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 13 Apr 2026 02:08:44 +0000 Subject: [PATCH 160/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 3d19128a..1ee5069c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-70c42eda2bee929830b2537f758400a58dded1f1ef5686a286e2469c35a041a0.yml openapi_spec_hash: cdaeed824e91657b45092765cf55eb42 -config_hash: e3c2679d25f6235381dfb11962fbf3d9 +config_hash: 83967503e501e4199b4042d0d0f2b615 From ab78911fb20ccaedcf28d7facf05a93d8633d624 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 15:39:54 +0000 Subject: [PATCH 161/193] fix(client): resolve serialization issue with unions and enums --- src/Core/Attributes/Required.php | 17 +---------------- src/Core/Conversion.php | 15 +++++++++++++++ src/Core/Conversion/EnumOf.php | 15 +++++++++++++-- 3 files changed, 29 insertions(+), 18 deletions(-) diff --git a/src/Core/Attributes/Required.php b/src/Core/Attributes/Required.php index e5c1e23b..0ebb6bed 100644 --- a/src/Core/Attributes/Required.php +++ b/src/Core/Attributes/Required.php @@ -25,9 +25,6 @@ class Required public readonly bool $nullable; - /** @var array */ - private static array $enumConverters = []; - /** * @param class-string|Converter|string|null $type * @param class-string<\BackedEnum>|Converter|null $enum @@ -52,7 +49,7 @@ public function __construct( $type ??= new MapOf($map); } if (null !== $enum) { - $type ??= $enum instanceof Converter ? $enum : self::enumConverter($enum); + $type ??= $enum instanceof Converter ? $enum : EnumOf::fromBackedEnum($enum); } $this->apiName = $apiName; @@ -60,16 +57,4 @@ public function __construct( $this->optional = false; $this->nullable = $nullable; } - - /** @property class-string<\BackedEnum> $enum */ - private static function enumConverter(string $enum): Converter - { - if (!isset(self::$enumConverters[$enum])) { - // @phpstan-ignore-next-line argument.type - $converter = new EnumOf(array_column($enum::cases(), column_key: 'value')); - self::$enumConverters[$enum] = $converter; - } - - return self::$enumConverters[$enum]; - } } diff --git a/src/Core/Conversion.php b/src/Core/Conversion.php index 2704e99e..9afc45fb 100644 --- a/src/Core/Conversion.php +++ b/src/Core/Conversion.php @@ -8,6 +8,7 @@ use Imagekit\Core\Conversion\Contracts\Converter; use Imagekit\Core\Conversion\Contracts\ConverterSource; use Imagekit\Core\Conversion\DumpState; +use Imagekit\Core\Conversion\EnumOf; /** * @internal @@ -65,6 +66,13 @@ public static function coerce(Converter|ConverterSource|string $target, mixed $v return $target->coerce($value, state: $state); } + // BackedEnum class-name targets: wrap in EnumOf so enum values are scored + // against the enum's cases. Without this, tryConvert's default case scores + // any class-name target as `no`, even when the value is a valid enum member. + if (is_a($target, class: \BackedEnum::class, allow_string: true)) { + return EnumOf::fromBackedEnum($target)->coerce($value, state: $state); + } + return self::tryConvert($target, value: $value, state: $state); } @@ -78,6 +86,13 @@ public static function dump(Converter|ConverterSource|string $target, mixed $val return $target::converter()->dump($value, state: $state); } + // BackedEnum class-name targets: wrap in EnumOf so enum values are scored + // against the enum's cases. Without this, tryConvert's default case scores + // any class-name target as `no`, even when the value is a valid enum member. + if (is_a($target, class: \BackedEnum::class, allow_string: true)) { + return EnumOf::fromBackedEnum($target)->dump($value, state: $state); + } + self::tryConvert($target, value: $value, state: $state); return self::dump_unknown($value, state: $state); diff --git a/src/Core/Conversion/EnumOf.php b/src/Core/Conversion/EnumOf.php index 7a22876d..d7b15d24 100644 --- a/src/Core/Conversion/EnumOf.php +++ b/src/Core/Conversion/EnumOf.php @@ -14,6 +14,9 @@ final class EnumOf implements Converter { private readonly string $type; + /** @var array, self> */ + private static array $cache = []; + /** * @param list $members */ @@ -26,6 +29,13 @@ public function __construct(private readonly array $members) $this->type = $type; } + /** @param class-string<\BackedEnum> $enum */ + public static function fromBackedEnum(string $enum): self + { + // @phpstan-ignore-next-line argument.type + return self::$cache[$enum] ??= new self(array_column($enum::cases(), column_key: 'value')); + } + public function coerce(mixed $value, CoerceState $state): mixed { $this->tally($value, state: $state); @@ -42,9 +52,10 @@ public function dump(mixed $value, DumpState $state): mixed private function tally(mixed $value, CoerceState|DumpState $state): void { - if (in_array($value, haystack: $this->members, strict: true)) { + $needle = $value instanceof \BackedEnum ? $value->value : $value; + if (in_array($needle, haystack: $this->members, strict: true)) { ++$state->yes; - } elseif ($this->type === gettype($value)) { + } elseif ($this->type === gettype($needle)) { ++$state->maybe; } else { ++$state->no; From 9c715d0280fbb44b77db3fc1338ab13959c57378 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 17 Apr 2026 19:35:36 +0000 Subject: [PATCH 162/193] fix: populate enum-typed properties with enum instances --- src/Core/Conversion/EnumOf.php | 20 +++++++++-- tests/Core/ModelTest.php | 62 ++++++++++++++++++++++++++++++++++ 2 files changed, 79 insertions(+), 3 deletions(-) diff --git a/src/Core/Conversion/EnumOf.php b/src/Core/Conversion/EnumOf.php index d7b15d24..56c514b4 100644 --- a/src/Core/Conversion/EnumOf.php +++ b/src/Core/Conversion/EnumOf.php @@ -19,9 +19,12 @@ final class EnumOf implements Converter /** * @param list $members + * @param class-string<\BackedEnum>|null $class */ - public function __construct(private readonly array $members) - { + public function __construct( + private readonly array $members, + private readonly ?string $class = null, + ) { $type = 'NULL'; foreach ($this->members as $member) { $type = gettype($member); @@ -33,13 +36,24 @@ public function __construct(private readonly array $members) public static function fromBackedEnum(string $enum): self { // @phpstan-ignore-next-line argument.type - return self::$cache[$enum] ??= new self(array_column($enum::cases(), column_key: 'value')); + return self::$cache[$enum] ??= new self( + array_column($enum::cases(), column_key: 'value'), + class: $enum, + ); } public function coerce(mixed $value, CoerceState $state): mixed { $this->tally($value, state: $state); + if ($value instanceof \BackedEnum) { + return $value; + } + + if (null !== $this->class && (is_int($value) || is_string($value))) { + return ($this->class)::tryFrom($value) ?? $value; + } + return $value; } diff --git a/tests/Core/ModelTest.php b/tests/Core/ModelTest.php index 7260e691..0829a52a 100644 --- a/tests/Core/ModelTest.php +++ b/tests/Core/ModelTest.php @@ -47,6 +47,30 @@ public function __construct( } } +enum TicketPriority: string +{ + case Low = 'low'; + case High = 'high'; +} + +class Ticket implements BaseModel +{ + /** @use SdkModel> */ + use SdkModel; + + #[Required(enum: TicketPriority::class)] + public TicketPriority $priority; + + /** @var list */ + #[Required(list: TicketPriority::class)] + public array $labels; + + public function __construct() + { + $this->initialize(); + } +} + /** * @internal * @@ -141,4 +165,42 @@ public function testSerializeModelWithExplicitNull(): void json_encode($model) ); } + + #[Test] + public function testScalarEnumCoercesToInstance(): void + { + $model = Ticket::fromArray(['priority' => 'low', 'labels' => []]); + $this->assertSame(TicketPriority::Low, $model->priority); + } + + #[Test] + public function testListOfEnumCoercesElementsToInstances(): void + { + $model = Ticket::fromArray(['priority' => 'low', 'labels' => ['low', 'high']]); + $this->assertCount(2, $model->labels); + $this->assertSame(TicketPriority::Low, $model->labels[0]); + $this->assertSame(TicketPriority::High, $model->labels[1]); + } + + #[Test] + public function testEnumInstancePassesThrough(): void + { + $model = Ticket::fromArray(['priority' => TicketPriority::High, 'labels' => []]); + $this->assertSame(TicketPriority::High, $model->priority); + } + + #[Test] + public function testInvalidEnumScalarFallsBackToData(): void + { + $model = Ticket::fromArray(['priority' => 'urgent', 'labels' => []]); + $this->assertSame('urgent', $model['priority']); + } + + #[Test] + public function testEnumWireFormatStableAcrossConstruction(): void + { + $fromScalar = Ticket::fromArray(['priority' => 'low', 'labels' => ['high']]); + $fromInstance = Ticket::fromArray(['priority' => TicketPriority::Low, 'labels' => [TicketPriority::High]]); + $this->assertSame(json_encode($fromScalar), json_encode($fromInstance)); + } } From 79b51fd7add363182035bb5a3330d937b4766640 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 18 Apr 2026 06:45:50 +0000 Subject: [PATCH 163/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 1ee5069c..3aa7595d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-70c42eda2bee929830b2537f758400a58dded1f1ef5686a286e2469c35a041a0.yml openapi_spec_hash: cdaeed824e91657b45092765cf55eb42 -config_hash: 83967503e501e4199b4042d0d0f2b615 +config_hash: 2a6f67c966b8b3db6f986be4ac23a507 From 20bfdb437b3a78b2878e450d2e2ec4adbc8c92ad Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 20 Apr 2026 04:52:06 +0000 Subject: [PATCH 164/193] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index 3aa7595d..c9a36176 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-70c42eda2bee929830b2537f758400a58dded1f1ef5686a286e2469c35a041a0.yml -openapi_spec_hash: cdaeed824e91657b45092765cf55eb42 -config_hash: 2a6f67c966b8b3db6f986be4ac23a507 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-c7f578172392bde58bbb72be2a25b9e917529cd07550358c645ce155debf2418.yml +openapi_spec_hash: f0d797a17b1e8e81707517700cd44b13 +config_hash: cc8ab8a2b72639af4d57e4e268ed3f73 From 73a5550a840b76353410d542822e4e926c0621f9 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 20 Apr 2026 05:06:32 +0000 Subject: [PATCH 165/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index c9a36176..669269dd 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-c7f578172392bde58bbb72be2a25b9e917529cd07550358c645ce155debf2418.yml openapi_spec_hash: f0d797a17b1e8e81707517700cd44b13 -config_hash: cc8ab8a2b72639af4d57e4e268ed3f73 +config_hash: d886c9d8ebe60aa25c77553dba16d410 From 95b6115aa29d403d867cb1b999bfd1f2f254a839 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 20 Apr 2026 05:11:00 +0000 Subject: [PATCH 166/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 669269dd..a37aee71 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-c7f578172392bde58bbb72be2a25b9e917529cd07550358c645ce155debf2418.yml openapi_spec_hash: f0d797a17b1e8e81707517700cd44b13 -config_hash: d886c9d8ebe60aa25c77553dba16d410 +config_hash: 4fa07762cb363071cfdeef3f7eeec56e From 0fbf0fd1b92420fff1e6be51d1135ad3c8d57697 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 20 Apr 2026 05:51:55 +0000 Subject: [PATCH 167/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a37aee71..71485510 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-c7f578172392bde58bbb72be2a25b9e917529cd07550358c645ce155debf2418.yml openapi_spec_hash: f0d797a17b1e8e81707517700cd44b13 -config_hash: 4fa07762cb363071cfdeef3f7eeec56e +config_hash: ef918f7e878d4168a07e867607eb68ea From a23f14894ac74ed7297e7c20ee4acbdbc3856259 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 20 Apr 2026 05:53:01 +0000 Subject: [PATCH 168/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 71485510..7ae635fc 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-c7f578172392bde58bbb72be2a25b9e917529cd07550358c645ce155debf2418.yml openapi_spec_hash: f0d797a17b1e8e81707517700cd44b13 -config_hash: ef918f7e878d4168a07e867607eb68ea +config_hash: 85ee7f056e5c05338bd9b7a7abb33c6e From 436df753a2b32594868774fb530d9b9c68bca223 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 20 Apr 2026 06:58:02 +0000 Subject: [PATCH 169/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 7ae635fc..8624958a 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-c7f578172392bde58bbb72be2a25b9e917529cd07550358c645ce155debf2418.yml openapi_spec_hash: f0d797a17b1e8e81707517700cd44b13 -config_hash: 85ee7f056e5c05338bd9b7a7abb33c6e +config_hash: 4e6bdc90056ab9bddbeb207bd720cf53 From c728736a5d0ad40a5e26ae466057269971050981 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 20 Apr 2026 18:43:25 +0000 Subject: [PATCH 170/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 8624958a..6d0a83a8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-c7f578172392bde58bbb72be2a25b9e917529cd07550358c645ce155debf2418.yml openapi_spec_hash: f0d797a17b1e8e81707517700cd44b13 -config_hash: 4e6bdc90056ab9bddbeb207bd720cf53 +config_hash: da0c89d794fefcf600a4ddfc78553c2a From b8e3ba67288ab64cc1398e54e4dbef82baabacca Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Fri, 24 Apr 2026 05:08:39 +0000 Subject: [PATCH 171/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 6d0a83a8..a1b609ac 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-c7f578172392bde58bbb72be2a25b9e917529cd07550358c645ce155debf2418.yml openapi_spec_hash: f0d797a17b1e8e81707517700cd44b13 -config_hash: da0c89d794fefcf600a4ddfc78553c2a +config_hash: 94f48fd13b7d41b8b6a203a3a8cee9ed From cc2e7bd5a1919234353281c80c75e4049ab4b894 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 25 Apr 2026 02:35:17 +0000 Subject: [PATCH 172/193] fix: revert enum parsing change that lead to unconditional failure --- src/Core/Conversion/EnumOf.php | 20 ++--------- tests/Core/ModelTest.php | 62 ---------------------------------- 2 files changed, 3 insertions(+), 79 deletions(-) diff --git a/src/Core/Conversion/EnumOf.php b/src/Core/Conversion/EnumOf.php index 56c514b4..d7b15d24 100644 --- a/src/Core/Conversion/EnumOf.php +++ b/src/Core/Conversion/EnumOf.php @@ -19,12 +19,9 @@ final class EnumOf implements Converter /** * @param list $members - * @param class-string<\BackedEnum>|null $class */ - public function __construct( - private readonly array $members, - private readonly ?string $class = null, - ) { + public function __construct(private readonly array $members) + { $type = 'NULL'; foreach ($this->members as $member) { $type = gettype($member); @@ -36,24 +33,13 @@ public function __construct( public static function fromBackedEnum(string $enum): self { // @phpstan-ignore-next-line argument.type - return self::$cache[$enum] ??= new self( - array_column($enum::cases(), column_key: 'value'), - class: $enum, - ); + return self::$cache[$enum] ??= new self(array_column($enum::cases(), column_key: 'value')); } public function coerce(mixed $value, CoerceState $state): mixed { $this->tally($value, state: $state); - if ($value instanceof \BackedEnum) { - return $value; - } - - if (null !== $this->class && (is_int($value) || is_string($value))) { - return ($this->class)::tryFrom($value) ?? $value; - } - return $value; } diff --git a/tests/Core/ModelTest.php b/tests/Core/ModelTest.php index 0829a52a..7260e691 100644 --- a/tests/Core/ModelTest.php +++ b/tests/Core/ModelTest.php @@ -47,30 +47,6 @@ public function __construct( } } -enum TicketPriority: string -{ - case Low = 'low'; - case High = 'high'; -} - -class Ticket implements BaseModel -{ - /** @use SdkModel> */ - use SdkModel; - - #[Required(enum: TicketPriority::class)] - public TicketPriority $priority; - - /** @var list */ - #[Required(list: TicketPriority::class)] - public array $labels; - - public function __construct() - { - $this->initialize(); - } -} - /** * @internal * @@ -165,42 +141,4 @@ public function testSerializeModelWithExplicitNull(): void json_encode($model) ); } - - #[Test] - public function testScalarEnumCoercesToInstance(): void - { - $model = Ticket::fromArray(['priority' => 'low', 'labels' => []]); - $this->assertSame(TicketPriority::Low, $model->priority); - } - - #[Test] - public function testListOfEnumCoercesElementsToInstances(): void - { - $model = Ticket::fromArray(['priority' => 'low', 'labels' => ['low', 'high']]); - $this->assertCount(2, $model->labels); - $this->assertSame(TicketPriority::Low, $model->labels[0]); - $this->assertSame(TicketPriority::High, $model->labels[1]); - } - - #[Test] - public function testEnumInstancePassesThrough(): void - { - $model = Ticket::fromArray(['priority' => TicketPriority::High, 'labels' => []]); - $this->assertSame(TicketPriority::High, $model->priority); - } - - #[Test] - public function testInvalidEnumScalarFallsBackToData(): void - { - $model = Ticket::fromArray(['priority' => 'urgent', 'labels' => []]); - $this->assertSame('urgent', $model['priority']); - } - - #[Test] - public function testEnumWireFormatStableAcrossConstruction(): void - { - $fromScalar = Ticket::fromArray(['priority' => 'low', 'labels' => ['high']]); - $fromInstance = Ticket::fromArray(['priority' => TicketPriority::Low, 'labels' => [TicketPriority::High]]); - $this->assertSame(json_encode($fromScalar), json_encode($fromInstance)); - } } From ca265eedd4fdf0c13f8dc90525ff1c28845fcc5e Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 27 Apr 2026 22:28:27 +0000 Subject: [PATCH 173/193] feat: support setting headers via env --- src/Client.php | 35 ++++++++++++++++++++++++----------- 1 file changed, 24 insertions(+), 11 deletions(-) diff --git a/src/Client.php b/src/Client.php index 4dc1af59..a96c7278 100644 --- a/src/Client.php +++ b/src/Client.php @@ -113,18 +113,31 @@ public function __construct( $requestOptions, ); + /** @var array $headers */ + $headers = [ + 'Content-Type' => 'application/json', + 'Accept' => 'application/json', + 'User-Agent' => sprintf('ImageKit/PHP %s', VERSION), + 'X-Stainless-Lang' => 'php', + 'X-Stainless-Package-Version' => '0.0.1', + 'X-Stainless-Arch' => Util::machtype(), + 'X-Stainless-OS' => Util::ostype(), + 'X-Stainless-Runtime' => php_sapi_name(), + 'X-Stainless-Runtime-Version' => phpversion(), + ]; + + $customHeadersEnv = Util::getenv('IMAGE_KIT_CUSTOM_HEADERS'); + if (null !== $customHeadersEnv) { + foreach (explode("\n", $customHeadersEnv) as $line) { + $colon = strpos($line, ':'); + if (false !== $colon) { + $headers[trim(substr($line, 0, $colon))] = trim(substr($line, $colon + 1)); + } + } + } + parent::__construct( - headers: [ - 'Content-Type' => 'application/json', - 'Accept' => 'application/json', - 'User-Agent' => sprintf('ImageKit/PHP %s', VERSION), - 'X-Stainless-Lang' => 'php', - 'X-Stainless-Package-Version' => '0.0.1', - 'X-Stainless-Arch' => Util::machtype(), - 'X-Stainless-OS' => Util::ostype(), - 'X-Stainless-Runtime' => php_sapi_name(), - 'X-Stainless-Runtime-Version' => phpversion(), - ], + headers: $headers, baseUrl: $baseUrl, options: $options ); From bea63fa4ea8c8cb1d0bab59492b8ac98bb4ce9b5 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 29 Apr 2026 18:15:22 +0000 Subject: [PATCH 174/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index a1b609ac..92b16878 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc%2Fimagekit-c7f578172392bde58bbb72be2a25b9e917529cd07550358c645ce155debf2418.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-c7f578172392bde58bbb72be2a25b9e917529cd07550358c645ce155debf2418.yml openapi_spec_hash: f0d797a17b1e8e81707517700cd44b13 config_hash: 94f48fd13b7d41b8b6a203a3a8cee9ed From 41d18b4b25fa0d8928d7860d12adb9ae75ced48d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Thu, 30 Apr 2026 16:22:22 +0000 Subject: [PATCH 175/193] codegen metadata --- .stats.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.stats.yml b/.stats.yml index 92b16878..6b776b6f 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-c7f578172392bde58bbb72be2a25b9e917529cd07550358c645ce155debf2418.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-362d0336e8f52ab1beb7d9602a3665dbb0277700e8dc01ef4f96fc7651699349.yml openapi_spec_hash: f0d797a17b1e8e81707517700cd44b13 config_hash: 94f48fd13b7d41b8b6a203a3a8cee9ed From b0f95d62d3af6efd2f78e2a63f52a2f4df65c36b Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Mon, 11 May 2026 15:59:24 +0000 Subject: [PATCH 176/193] fix: guzzle requires special handling to enable streaming --- composer.json | 1 + composer.lock | 374 +++++++++++++++++- src/Client.php | 6 + src/Core/BaseClient.php | 6 +- src/Core/FileParam.php | 2 +- .../Implementation/StreamingHttpClient.php | 29 ++ src/Core/Util.php | 12 + src/RequestOptions.php | 17 + src/Services/WebhooksService.php | 4 +- tests/Core/StreamingTransportTest.php | 122 ++++++ 10 files changed, 567 insertions(+), 6 deletions(-) create mode 100644 src/Core/Implementation/StreamingHttpClient.php create mode 100644 tests/Core/StreamingTransportTest.php diff --git a/composer.json b/composer.json index 99de4d0c..1a378dae 100644 --- a/composer.json +++ b/composer.json @@ -39,6 +39,7 @@ }, "require-dev": { "friendsofphp/php-cs-fixer": "^3", + "guzzlehttp/guzzle": "^7", "nyholm/psr7": "^1", "pestphp/pest": "^3", "php-http/mock-client": "^1", diff --git a/composer.lock b/composer.lock index ba9f9683..d86fa57a 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "70cc3a7109763fc87a44dd54d75f7387", + "content-hash": "ecd99353efa1e6aa997a3cdd27edad14", "packages": [ { "name": "php-http/discovery", @@ -1013,6 +1013,332 @@ ], "time": "2026-01-08T21:57:37+00:00" }, + { + "name": "guzzlehttp/guzzle", + "version": "7.10.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/guzzle.git", + "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b51ac707cfa420b7bfd4e4d5e510ba8008e822b4", + "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4", + "shasum": "" + }, + "require": { + "ext-json": "*", + "guzzlehttp/promises": "^2.3", + "guzzlehttp/psr7": "^2.8", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "ext-curl": "*", + "guzzle/client-integration-tests": "3.0.2", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", + "psr/log": "^1.1 || ^2.0 || ^3.0" + }, + "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", + "psr/log": "Required for using the Log middleware" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "files": [ + "src/functions_include.php" + ], + "psr-4": { + "GuzzleHttp\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Jeremy Lindblom", + "email": "jeremeamia@gmail.com", + "homepage": "https://github.com/jeremeamia" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle is a PHP HTTP client library", + "keywords": [ + "client", + "curl", + "framework", + "http", + "http client", + "psr-18", + "psr-7", + "rest", + "web service" + ], + "support": { + "issues": "https://github.com/guzzle/guzzle/issues", + "source": "https://github.com/guzzle/guzzle/tree/7.10.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/guzzle", + "type": "tidelift" + } + ], + "time": "2025-08-23T22:36:01+00:00" + }, + { + "name": "guzzlehttp/promises", + "version": "2.3.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/promises.git", + "reference": "481557b130ef3790cf82b713667b43030dc9c957" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/promises/zipball/481557b130ef3790cf82b713667b43030dc9c957", + "reference": "481557b130ef3790cf82b713667b43030dc9c957", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.44 || ^9.6.25" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Promise\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + } + ], + "description": "Guzzle promises library", + "keywords": [ + "promise" + ], + "support": { + "issues": "https://github.com/guzzle/promises/issues", + "source": "https://github.com/guzzle/promises/tree/2.3.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/promises", + "type": "tidelift" + } + ], + "time": "2025-08-22T14:34:08+00:00" + }, + { + "name": "guzzlehttp/psr7", + "version": "2.9.0", + "source": { + "type": "git", + "url": "https://github.com/guzzle/psr7.git", + "reference": "7d0ed42f28e42d61352a7a79de682e5e67fec884" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/7d0ed42f28e42d61352a7a79de682e5e67fec884", + "reference": "7d0ed42f28e42d61352a7a79de682e5e67fec884", + "shasum": "" + }, + "require": { + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" + }, + "provide": { + "psr/http-factory-implementation": "1.0", + "psr/http-message-implementation": "1.0" + }, + "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "0.9.0", + "jshttp/mime-db": "1.54.0.1", + "phpunit/phpunit": "^8.5.44 || ^9.6.25" + }, + "suggest": { + "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" + }, + "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, + "autoload": { + "psr-4": { + "GuzzleHttp\\Psr7\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Graham Campbell", + "email": "hello@gjcampbell.co.uk", + "homepage": "https://github.com/GrahamCampbell" + }, + { + "name": "Michael Dowling", + "email": "mtdowling@gmail.com", + "homepage": "https://github.com/mtdowling" + }, + { + "name": "George Mponos", + "email": "gmponos@gmail.com", + "homepage": "https://github.com/gmponos" + }, + { + "name": "Tobias Nyholm", + "email": "tobias.nyholm@gmail.com", + "homepage": "https://github.com/Nyholm" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://github.com/sagikazarmark" + }, + { + "name": "Tobias Schultze", + "email": "webmaster@tubo-world.de", + "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" + } + ], + "description": "PSR-7 message implementation that also provides common utility methods", + "keywords": [ + "http", + "message", + "psr-7", + "request", + "response", + "stream", + "uri", + "url" + ], + "support": { + "issues": "https://github.com/guzzle/psr7/issues", + "source": "https://github.com/guzzle/psr7/tree/2.9.0" + }, + "funding": [ + { + "url": "https://github.com/GrahamCampbell", + "type": "github" + }, + { + "url": "https://github.com/Nyholm", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/guzzlehttp/psr7", + "type": "tidelift" + } + ], + "time": "2026-03-10T16:41:02+00:00" + }, { "name": "jean85/pretty-package-versions", "version": "2.1.1", @@ -3295,6 +3621,50 @@ }, "time": "2021-10-29T13:26:27+00:00" }, + { + "name": "ralouphie/getallheaders", + "version": "3.0.3", + "source": { + "type": "git", + "url": "https://github.com/ralouphie/getallheaders.git", + "reference": "120b605dfeb996808c31b6477290a714d356e822" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/ralouphie/getallheaders/zipball/120b605dfeb996808c31b6477290a714d356e822", + "reference": "120b605dfeb996808c31b6477290a714d356e822", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "php-coveralls/php-coveralls": "^2.1", + "phpunit/phpunit": "^5 || ^6.5" + }, + "type": "library", + "autoload": { + "files": [ + "src/getallheaders.php" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Ralph Khattar", + "email": "ralph.khattar@gmail.com" + } + ], + "description": "A polyfill for getallheaders.", + "support": { + "issues": "https://github.com/ralouphie/getallheaders/issues", + "source": "https://github.com/ralouphie/getallheaders/tree/develop" + }, + "time": "2019-03-08T08:55:37+00:00" + }, { "name": "react/cache", "version": "v1.2.0", @@ -6725,5 +7095,5 @@ "platform-overrides": { "php": "8.3" }, - "plugin-api-version": "2.9.0" + "plugin-api-version": "2.6.0" } diff --git a/src/Client.php b/src/Client.php index a96c7278..0b91177f 100644 --- a/src/Client.php +++ b/src/Client.php @@ -7,6 +7,7 @@ use Http\Discovery\Psr17FactoryDiscovery; use Http\Discovery\Psr18ClientDiscovery; use Imagekit\Core\BaseClient; +use Imagekit\Core\Implementation\StreamingHttpClient; use Imagekit\Core\Util; use Imagekit\Services\AccountsService; use Imagekit\Services\AssetsService; @@ -113,6 +114,11 @@ public function __construct( $requestOptions, ); + if (is_null($options->streamingTransporter)) { + assert(!is_null($options->transporter)); + $options->streamingTransporter = new StreamingHttpClient($options->transporter); + } + /** @var array $headers */ $headers = [ 'Content-Type' => 'application/json', diff --git a/src/Core/BaseClient.php b/src/Core/BaseClient.php index 12130b2e..8024780f 100644 --- a/src/Core/BaseClient.php +++ b/src/Core/BaseClient.php @@ -241,11 +241,15 @@ protected function sendRequest( $req = $req->withHeader('X-Stainless-Retry-Count', strval($retryCount)); $req = Util::withSetBody($opts->streamFactory, req: $req, body: $data); + $transporter = Util::isStreamingRequest($req) + ? ($opts->streamingTransporter ?? $opts->transporter) + : $opts->transporter; + $rsp = null; $err = null; try { - $rsp = $opts->transporter->sendRequest($req); + $rsp = $transporter->sendRequest($req); } catch (ClientExceptionInterface $e) { $err = $e; } diff --git a/src/Core/FileParam.php b/src/Core/FileParam.php index 3fb89d2e..9ea86106 100644 --- a/src/Core/FileParam.php +++ b/src/Core/FileParam.php @@ -41,7 +41,7 @@ public static function fromResource(mixed $resource, ?string $filename = null, s throw new \InvalidArgumentException('Expected a resource, got '.get_debug_type($resource)); } - if (null === $filename) { + if (is_null($filename)) { $meta = stream_get_meta_data($resource); $filename = basename($meta['uri'] ?? 'upload'); } diff --git a/src/Core/Implementation/StreamingHttpClient.php b/src/Core/Implementation/StreamingHttpClient.php new file mode 100644 index 00000000..e5c05d29 --- /dev/null +++ b/src/Core/Implementation/StreamingHttpClient.php @@ -0,0 +1,29 @@ +inner, '\GuzzleHttp\Client')) { + return $this->inner->send($request, ['stream' => true]); + } + + return $this->inner->sendRequest($request); + } +} diff --git a/src/Core/Util.php b/src/Core/Util.php index 5739e11a..1dd32f46 100644 --- a/src/Core/Util.php +++ b/src/Core/Util.php @@ -25,6 +25,8 @@ final class Util public const JSONL_CONTENT_TYPE = '/^application\/(:?x-(?:n|l)djson)|(:?(?:x-)?jsonl)/'; + public const STREAMING_CONTENT_TYPE = ['/^text\/event-stream/', self::JSONL_CONTENT_TYPE]; + public static function getenv(string $key): ?string { if (array_key_exists($key, array: $_ENV)) { @@ -217,6 +219,16 @@ public static function joinUri( return $base->withQuery($qs); } + public static function isStreamingRequest(RequestInterface $request): bool + { + $accept = $request->getHeaderLine('Accept'); + + return !empty(array_filter( + self::STREAMING_CONTENT_TYPE, + static fn (string $pattern) => (bool) preg_match($pattern, subject: $accept), + )); + } + /** * @param array|null> $headers */ diff --git a/src/RequestOptions.php b/src/RequestOptions.php index b5e82cff..b781ae4e 100644 --- a/src/RequestOptions.php +++ b/src/RequestOptions.php @@ -23,6 +23,7 @@ * extraQueryParams?: array|null, * extraBodyParams?: mixed, * transporter?: ClientInterface|null, + * streamingTransporter?: ClientInterface|null, * uriFactory?: UriFactoryInterface|null, * streamFactory?: StreamFactoryInterface|null, * requestFactory?: RequestFactoryInterface|null, @@ -60,6 +61,9 @@ final class RequestOptions implements BaseModel #[Optional] public ?ClientInterface $transporter; + #[Optional] + public ?ClientInterface $streamingTransporter; + #[Optional] public ?UriFactoryInterface $uriFactory; @@ -98,6 +102,7 @@ public static function with( ?array $extraQueryParams = null, mixed $extraBodyParams = null, ?ClientInterface $transporter = null, + ?ClientInterface $streamingTransporter = null, ?UriFactoryInterface $uriFactory = null, ?StreamFactoryInterface $streamFactory = null, ?RequestFactoryInterface $requestFactory = null, @@ -114,6 +119,9 @@ public static function with( null !== $extraQueryParams && $self->extraQueryParams = $extraQueryParams; null !== $extraBodyParams && $self->extraBodyParams = $extraBodyParams; null !== $transporter && $self->transporter = $transporter; + null !== $streamingTransporter && $self + ->streamingTransporter = $streamingTransporter + ; null !== $uriFactory && $self->uriFactory = $uriFactory; null !== $streamFactory && $self->streamFactory = $streamFactory; null !== $requestFactory && $self->requestFactory = $requestFactory; @@ -191,6 +199,15 @@ public function withTransporter(ClientInterface $transporter): self return $self; } + public function withStreamingTransporter( + ClientInterface $streamingTransporter + ): self { + $self = clone $this; + $self->streamingTransporter = $streamingTransporter; + + return $self; + } + public function withUriFactory(UriFactoryInterface $uriFactory): self { $self = clone $this; diff --git a/src/Services/WebhooksService.php b/src/Services/WebhooksService.php index 6ec567a1..1711c0c9 100644 --- a/src/Services/WebhooksService.php +++ b/src/Services/WebhooksService.php @@ -75,9 +75,9 @@ public function unwrap( ?array $headers = null, ?string $secret = null ): VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|FileCreateEvent|FileUpdateEvent|FileDeleteEvent|FileVersionCreateEvent|FileVersionDeleteEvent { - if (null !== $headers) { + if (!is_null($headers)) { $secret = $secret ?? ($this->client->webhookSecret ?: null); - if (null === $secret) { + if (is_null($secret)) { throw new WebhookException('Webhook key must not be null in order to unwrap'); } diff --git a/tests/Core/StreamingTransportTest.php b/tests/Core/StreamingTransportTest.php new file mode 100644 index 00000000..3f85a368 --- /dev/null +++ b/tests/Core/StreamingTransportTest.php @@ -0,0 +1,122 @@ + true, + 'application/x-ndjson' => true, + 'application/x-ldjson' => true, + 'application/jsonl' => true, + 'application/x-jsonl' => true, + 'text/event-stream; charset=utf-8' => true, + 'application/json' => false, + 'text/plain' => false, + '' => false, + ]; + + foreach ($cases as $accept => $expected) { + $req = $factory->createRequest('GET', 'http://localhost'); + if ('' !== $accept) { + $req = $req->withHeader('Accept', $accept); + } + $this->assertSame( + $expected, + Util::isStreamingRequest($req), + "Accept: '{$accept}'", + ); + } + } + + #[Test] + public function testRoutesNonStreamingRequestToTransporter(): void + { + [$client, $plain, $streaming] = $this->buildClient(); + + $client->request('GET', '/'); + + $this->assertCount(1, $plain->getRequests()); + $this->assertCount(0, $streaming->getRequests()); + } + + #[Test] + public function testRoutesStreamingRequestToStreamingTransporter(): void + { + [$client, $plain, $streaming] = $this->buildClient(); + + $client->request('GET', '/', headers: ['Accept' => 'text/event-stream']); + + $this->assertCount(0, $plain->getRequests()); + $this->assertCount(1, $streaming->getRequests()); + + $sent = $streaming->getRequests()[0]; + $this->assertStringContainsString('text/event-stream', $sent->getHeaderLine('Accept')); + } + + /** + * @return array{BaseClient, MockClient, MockClient} + */ + private function buildClient(): array + { + $plain = new MockClient; + $plain->setDefaultResponse($this->jsonResponse()); + + $streaming = new MockClient; + $streaming->setDefaultResponse($this->sseResponse()); + + $options = RequestOptions::with( + transporter: $plain, + streamingTransporter: $streaming, + uriFactory: Psr17FactoryDiscovery::findUriFactory(), + requestFactory: Psr17FactoryDiscovery::findRequestFactory(), + streamFactory: Psr17FactoryDiscovery::findStreamFactory(), + ); + + $client = new class(headers: [], baseUrl: 'http://localhost', options: $options) extends BaseClient {}; + + return [$client, $plain, $streaming]; + } + + private function jsonResponse(): ResponseInterface + { + $responseFactory = Psr17FactoryDiscovery::findResponseFactory(); + $streamFactory = Psr17FactoryDiscovery::findStreamFactory(); + + return $responseFactory->createResponse(200) + ->withHeader('Content-Type', 'application/json') + ->withBody($streamFactory->createStream('{}')) + ; + } + + private function sseResponse(): ResponseInterface + { + $responseFactory = Psr17FactoryDiscovery::findResponseFactory(); + $streamFactory = Psr17FactoryDiscovery::findStreamFactory(); + + return $responseFactory->createResponse(200) + ->withHeader('Content-Type', 'text/event-stream') + ->withBody($streamFactory->createStream('')) + ; + } +} From 4bf26fabe3ee0e42db9629914ccb0693e9c5a978 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Tue, 12 May 2026 19:06:54 +0000 Subject: [PATCH 177/193] ci: pin GitHub Actions to commit SHAs Pin all GitHub Actions referenced in generated workflows (both first-party `actions/*` and third-party) to immutable commit SHAs. Updating pinned actions is now a deliberate codegen-side bump rather than implicit on every workflow run. --- .github/workflows/ci.yml | 8 ++++---- .github/workflows/release-doctor.yml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dffb8a6f..c2ebea8b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -22,10 +22,10 @@ jobs: if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up PHP - uses: 'shivammathur/setup-php@v2' + uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0 with: php-version: '8.3' @@ -40,10 +40,10 @@ jobs: runs-on: ${{ github.repository == 'stainless-sdks/imagekit-php' && 'depot-ubuntu-24.04' || 'ubuntu-latest' }} if: github.event_name == 'push' || github.event.pull_request.head.repo.fork steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Set up PHP - uses: 'shivammathur/setup-php@v2' + uses: shivammathur/setup-php@accd6127cb78bee3e8082180cb391013d204ef9f # 2.37.0 with: php-version: '8.3' diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index 1b0856b4..bf79423a 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -12,7 +12,7 @@ jobs: if: github.repository == 'stainless-sdks/imagekit-php' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - - uses: actions/checkout@v6 + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - name: Check release environment run: | From ffebb946ee7e6ceca5824d9fb0ded368ba439431 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 13 May 2026 06:27:28 +0000 Subject: [PATCH 178/193] feat(api): add no-enlarge crop modes and colorize transformation - Add `maintain_ratio_no_enlarge` to `crop` enum - Add `pad_resize_no_enlarge` and `pad_extract_no_shrink` to `cropMode` enum - Add `colorize` transformation parameter for applying color tints --- .stats.yml | 4 ++-- src/Transformation.php | 26 ++++++++++++++++++++++++++ src/Transformation/Crop.php | 2 ++ src/Transformation/CropMode.php | 4 ++++ 4 files changed, 34 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6b776b6f..278a536d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-362d0336e8f52ab1beb7d9602a3665dbb0277700e8dc01ef4f96fc7651699349.yml -openapi_spec_hash: f0d797a17b1e8e81707517700cd44b13 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-ad6dd3b4acf289708568a12574b997503059a47c4a4ca5ffefe64f40f3d3dbf3.yml +openapi_spec_hash: 7c103e2dff0edcbeea82057e62f58d4d config_hash: 94f48fd13b7d41b8b6a203a3a8cee9ed diff --git a/src/Transformation.php b/src/Transformation.php index 2f93557f..564ef623 100644 --- a/src/Transformation.php +++ b/src/Transformation.php @@ -73,6 +73,7 @@ * background?: string|null, * blur?: float|null, * border?: string|null, + * colorize?: string|null, * colorProfile?: bool|null, * colorReplace?: string|null, * contrastStretch?: bool|null, @@ -235,6 +236,15 @@ final class Transformation implements BaseModel #[Optional] public ?string $border; + /** + * Applies a color tint to the image. Accepts color and intensity as optional parameters. + * - `co-color` - Color to apply (e.g., `red`, `blue`, `FF0022`). Default is gray color. + * - `in-intensity` - Intensity of the color (0-100). Default is 35. + * See [Colorize](https://imagekit.io/docs/effects-and-enhancements#colorize---e-colorize). + */ + #[Optional] + public ?string $colorize; + /** * Indicates whether the output image should retain the original color profile. * See [Color profile](https://imagekit.io/docs/image-optimization#color-profile---cp). @@ -645,6 +655,7 @@ public static function with( ?string $background = null, ?float $blur = null, ?string $border = null, + ?string $colorize = null, ?bool $colorProfile = null, ?string $colorReplace = null, ?bool $contrastStretch = null, @@ -702,6 +713,7 @@ public static function with( null !== $background && $self['background'] = $background; null !== $blur && $self['blur'] = $blur; null !== $border && $self['border'] = $border; + null !== $colorize && $self['colorize'] = $colorize; null !== $colorProfile && $self['colorProfile'] = $colorProfile; null !== $colorReplace && $self['colorReplace'] = $colorReplace; null !== $contrastStretch && $self['contrastStretch'] = $contrastStretch; @@ -927,6 +939,20 @@ public function withBorder(string $border): self return $self; } + /** + * Applies a color tint to the image. Accepts color and intensity as optional parameters. + * - `co-color` - Color to apply (e.g., `red`, `blue`, `FF0022`). Default is gray color. + * - `in-intensity` - Intensity of the color (0-100). Default is 35. + * See [Colorize](https://imagekit.io/docs/effects-and-enhancements#colorize---e-colorize). + */ + public function withColorize(string $colorize): self + { + $self = clone $this; + $self['colorize'] = $colorize; + + return $self; + } + /** * Indicates whether the output image should retain the original color profile. * See [Color profile](https://imagekit.io/docs/image-optimization#color-profile---cp). diff --git a/src/Transformation/Crop.php b/src/Transformation/Crop.php index 191b0b0e..c52f3ea4 100644 --- a/src/Transformation/Crop.php +++ b/src/Transformation/Crop.php @@ -18,4 +18,6 @@ enum Crop: string case AT_LEAST = 'at_least'; case MAINTAIN_RATIO = 'maintain_ratio'; + + case MAINTAIN_RATIO_NO_ENLARGE = 'maintain_ratio_no_enlarge'; } diff --git a/src/Transformation/CropMode.php b/src/Transformation/CropMode.php index 43d49024..d82621eb 100644 --- a/src/Transformation/CropMode.php +++ b/src/Transformation/CropMode.php @@ -14,4 +14,8 @@ enum CropMode: string case EXTRACT = 'extract'; case PAD_EXTRACT = 'pad_extract'; + + case PAD_RESIZE_NO_ENLARGE = 'pad_resize_no_enlarge'; + + case PAD_EXTRACT_NO_SHRINK = 'pad_extract_no_shrink'; } From 9f9309d5b8a6a800b5787bd9d739f2f2332c73d1 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 17 May 2026 02:36:35 +0000 Subject: [PATCH 179/193] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 278a536d..62ce5cf3 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-ad6dd3b4acf289708568a12574b997503059a47c4a4ca5ffefe64f40f3d3dbf3.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-a8f005109bd8f1fa42d080ed43b4f7b67eacad5aea113fe5223306c3f217556a.yml openapi_spec_hash: 7c103e2dff0edcbeea82057e62f58d4d -config_hash: 94f48fd13b7d41b8b6a203a3a8cee9ed +config_hash: 493cdeb6cf0935806c5f6a029774029d From 74fcc8b3671ad3ba0d0d91950b692c3b71963804 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 17 May 2026 02:40:07 +0000 Subject: [PATCH 180/193] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 62ce5cf3..6bae0823 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-a8f005109bd8f1fa42d080ed43b4f7b67eacad5aea113fe5223306c3f217556a.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-9daf3daa1db3813288c77c8777bfca85337e3512bdc83ee48fe0631e41c3650d.yml openapi_spec_hash: 7c103e2dff0edcbeea82057e62f58d4d -config_hash: 493cdeb6cf0935806c5f6a029774029d +config_hash: 34c788f0652c42a878adf62248426f1e From f5b2ce7c9f4412d01479c23ed1e7d3ffebac016f Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 17 May 2026 02:43:58 +0000 Subject: [PATCH 181/193] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6bae0823..02b09bcf 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-9daf3daa1db3813288c77c8777bfca85337e3512bdc83ee48fe0631e41c3650d.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-59ecd0e32aaade3cf2b31e6f757697c0a4f1c4c8ed3e52fb25b1071f592db509.yml openapi_spec_hash: 7c103e2dff0edcbeea82057e62f58d4d -config_hash: 34c788f0652c42a878adf62248426f1e +config_hash: c5a7aed248c5d9ad5cd42e56fdd62c12 From 491d4840ee82cc89b8feddfa7253cbade196a8ba Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 17 May 2026 03:12:19 +0000 Subject: [PATCH 182/193] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 02b09bcf..364b12b5 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-59ecd0e32aaade3cf2b31e6f757697c0a4f1c4c8ed3e52fb25b1071f592db509.yml -openapi_spec_hash: 7c103e2dff0edcbeea82057e62f58d4d +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-4df977cf1706b48f9d9f15d7e134d5bb062607bcf206a406a239ff6691852e7d.yml +openapi_spec_hash: fd7c931960b5d8a4c1072a69a5a3e6a1 config_hash: c5a7aed248c5d9ad5cd42e56fdd62c12 From 2d6908fb071c98b50f5302e7367a6044c61b86dd Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 17 May 2026 03:24:17 +0000 Subject: [PATCH 183/193] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 364b12b5..1497247c 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-4df977cf1706b48f9d9f15d7e134d5bb062607bcf206a406a239ff6691852e7d.yml -openapi_spec_hash: fd7c931960b5d8a4c1072a69a5a3e6a1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-406b71ea98caac24889265c5b4371961c784912e543ade88e7e6917f9a31a951.yml +openapi_spec_hash: 462b973437dd6b2659654881e9a0e5c1 config_hash: c5a7aed248c5d9ad5cd42e56fdd62c12 From 66c440e82d922c3fd53ba3a73160c4fa4287e458 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 17 May 2026 03:35:10 +0000 Subject: [PATCH 184/193] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 1497247c..88ec6965 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-406b71ea98caac24889265c5b4371961c784912e543ade88e7e6917f9a31a951.yml -openapi_spec_hash: 462b973437dd6b2659654881e9a0e5c1 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-b9cc1f62fca41c286295001551cbe902d6b2f30ab775d84e549eb5affc0186ec.yml +openapi_spec_hash: f3790446521a8f846e2e7249313de100 config_hash: c5a7aed248c5d9ad5cd42e56fdd62c12 From 27dd717fee5795fd1b7642dca07c8b64321e471d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 17 May 2026 03:48:15 +0000 Subject: [PATCH 185/193] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 88ec6965..16b469cb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-b9cc1f62fca41c286295001551cbe902d6b2f30ab775d84e549eb5affc0186ec.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-14c145ce7a0b8660a0228fb7ec2499d8e5f6c057be2750da408af8b0513f1df5.yml openapi_spec_hash: f3790446521a8f846e2e7249313de100 -config_hash: c5a7aed248c5d9ad5cd42e56fdd62c12 +config_hash: ea9d73f82c079f2c34302ff663f2aa56 From e07437fd1df88fabec8e594f272dcc3460682b11 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 17 May 2026 04:39:43 +0000 Subject: [PATCH 186/193] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 16b469cb..f1c4a937 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-14c145ce7a0b8660a0228fb7ec2499d8e5f6c057be2750da408af8b0513f1df5.yml -openapi_spec_hash: f3790446521a8f846e2e7249313de100 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-219cd09f920d87469cda8b4d45b74dbfcac5352281e240e78230934ceb5b19a4.yml +openapi_spec_hash: 790e2ebbfb462a5f38999ec543e6124e config_hash: ea9d73f82c079f2c34302ff663f2aa56 From 3a5c8cf7230c0d16104bd4b5c9ca8b3346e30d22 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 17 May 2026 04:42:34 +0000 Subject: [PATCH 187/193] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f1c4a937..6298c51e 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-219cd09f920d87469cda8b4d45b74dbfcac5352281e240e78230934ceb5b19a4.yml -openapi_spec_hash: 790e2ebbfb462a5f38999ec543e6124e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-af1d84da7e0b7c07c32d0cdf0423f40a55b4aab339cbad65e495bee483d0e3cd.yml +openapi_spec_hash: 333878ccaade1f9d0186530386bff8c5 config_hash: ea9d73f82c079f2c34302ff663f2aa56 From ef13185da066cdd4a6d35592d25a4531c0049c5d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 17 May 2026 04:47:39 +0000 Subject: [PATCH 188/193] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index 6298c51e..f1c4a937 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-af1d84da7e0b7c07c32d0cdf0423f40a55b4aab339cbad65e495bee483d0e3cd.yml -openapi_spec_hash: 333878ccaade1f9d0186530386bff8c5 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-219cd09f920d87469cda8b4d45b74dbfcac5352281e240e78230934ceb5b19a4.yml +openapi_spec_hash: 790e2ebbfb462a5f38999ec543e6124e config_hash: ea9d73f82c079f2c34302ff663f2aa56 From d479bb597afea054af41367fc3f0370646e9b3b3 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 17 May 2026 04:51:02 +0000 Subject: [PATCH 189/193] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index f1c4a937..a7206e27 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-219cd09f920d87469cda8b4d45b74dbfcac5352281e240e78230934ceb5b19a4.yml -openapi_spec_hash: 790e2ebbfb462a5f38999ec543e6124e +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-cda882cdb87edc69cffe5feacc2eaa5936d5264109668f434c575bba99eabdd3.yml +openapi_spec_hash: 964672a4901296fe54bf272bbdca0166 config_hash: ea9d73f82c079f2c34302ff663f2aa56 From b576da7a1978410fded82a997bff62759e4db921 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 17 May 2026 09:41:03 +0000 Subject: [PATCH 190/193] codegen metadata --- .stats.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.stats.yml b/.stats.yml index a7206e27..a3ed0ec8 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-cda882cdb87edc69cffe5feacc2eaa5936d5264109668f434c575bba99eabdd3.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-ad6c14539f49d7b60152d2df9963e3a7db3f202ad609ac12f54bc191d15f57df.yml openapi_spec_hash: 964672a4901296fe54bf272bbdca0166 -config_hash: ea9d73f82c079f2c34302ff663f2aa56 +config_hash: afb12722127055b21c945fe8e3607fc2 From f903680097b09868bb84c0975527af7bd4888393 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sun, 17 May 2026 09:45:13 +0000 Subject: [PATCH 191/193] codegen metadata --- .stats.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index a3ed0ec8..1eed5544 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-ad6c14539f49d7b60152d2df9963e3a7db3f202ad609ac12f54bc191d15f57df.yml -openapi_spec_hash: 964672a4901296fe54bf272bbdca0166 -config_hash: afb12722127055b21c945fe8e3607fc2 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-01267e4c07ec30011b8445babed88fbd2133b65198f42d0310b7ab39c74751d4.yml +openapi_spec_hash: 7c103e2dff0edcbeea82057e62f58d4d +config_hash: 7ef70b333059ca21bef0f0a6d4cbb282 From 04e65354ac22903e38ca02a0e4d95207bdaf9ce0 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 23 May 2026 05:28:58 +0000 Subject: [PATCH 192/193] build(php): set production target --- .github/workflows/publish-packagist.yml | 21 ++++ .github/workflows/release-doctor.yml | 4 +- .stats.yml | 4 +- README.md | 44 ++++----- composer.json | 2 +- src/Accounts/Origins/OriginCreateParams.php | 14 +-- src/Accounts/Origins/OriginRequest.php | 40 ++++---- .../Origins/OriginRequest/AkeneoPim.php | 10 +- .../OriginRequest/AzureBlobStorage.php | 10 +- .../OriginRequest/CloudinaryBackup.php | 10 +- .../OriginRequest/GoogleCloudStorageGcs.php | 10 +- src/Accounts/Origins/OriginRequest/S3.php | 10 +- .../Origins/OriginRequest/S3Compatible.php | 10 +- .../Origins/OriginRequest/WebFolder.php | 10 +- .../Origins/OriginRequest/WebProxy.php | 10 +- src/Accounts/Origins/OriginResponse.php | 40 ++++---- .../Origins/OriginResponse/AkeneoPim.php | 10 +- .../OriginResponse/AzureBlobStorage.php | 10 +- .../OriginResponse/CloudinaryBackup.php | 10 +- .../OriginResponse/GoogleCloudStorageGcs.php | 10 +- src/Accounts/Origins/OriginResponse/S3.php | 10 +- .../Origins/OriginResponse/S3Compatible.php | 10 +- .../Origins/OriginResponse/WebFolder.php | 10 +- .../Origins/OriginResponse/WebProxy.php | 10 +- src/Accounts/Origins/OriginUpdateParams.php | 14 +-- .../URLEndpoints/URLEndpointCreateParams.php | 28 +++--- .../URLEndpointCreateParams/URLRewriter.php | 20 ++-- .../URLRewriter/AkamaiURLRewriter.php | 8 +- .../URLRewriter/CloudinaryURLRewriter.php | 10 +- .../URLRewriter/ImgixURLRewriter.php | 8 +- .../URLEndpoints/URLEndpointRequest.php | 22 ++--- .../URLEndpointRequest/URLRewriter.php | 20 ++-- .../URLRewriter/AkamaiURLRewriter.php | 8 +- .../URLRewriter/CloudinaryURLRewriter.php | 10 +- .../URLRewriter/ImgixURLRewriter.php | 8 +- .../URLEndpoints/URLEndpointResponse.php | 22 ++--- .../URLEndpointResponse/URLRewriter.php | 20 ++-- .../URLRewriter/AkamaiURLRewriter.php | 8 +- .../URLRewriter/CloudinaryURLRewriter.php | 8 +- .../URLRewriter/ImgixURLRewriter.php | 8 +- .../URLEndpoints/URLEndpointUpdateParams.php | 28 +++--- .../URLEndpointUpdateParams/URLRewriter.php | 20 ++-- .../URLRewriter/AkamaiURLRewriter.php | 8 +- .../URLRewriter/CloudinaryURLRewriter.php | 10 +- .../URLRewriter/ImgixURLRewriter.php | 8 +- src/Accounts/Usage/UsageGetParams.php | 12 +-- src/Accounts/Usage/UsageGetResponse.php | 8 +- src/Assets/AssetListParams.php | 18 ++-- src/Assets/AssetListParams/FileType.php | 2 +- src/Assets/AssetListParams/Sort.php | 2 +- src/Assets/AssetListParams/Type.php | 2 +- src/Assets/AssetListResponseItem.php | 16 +-- src/BaseOverlay.php | 14 +-- src/BaseOverlay/LayerMode.php | 2 +- src/Beta/V2/Files/FileUploadParams.php | 30 +++--- .../Files/FileUploadParams/ResponseField.php | 2 +- .../Files/FileUploadParams/Transformation.php | 14 +-- .../FileUploadParams/Transformation/Post.php | 24 ++--- .../Post/AdaptiveBitrateStreaming.php | 10 +- .../AdaptiveBitrateStreaming/Protocol.php | 2 +- .../Transformation/Post/ConvertGifToVideo.php | 10 +- .../Post/GenerateAThumbnail.php | 10 +- .../Post/SimplePostTransformation.php | 8 +- src/Beta/V2/Files/FileUploadResponse.php | 28 +++--- .../V2/Files/FileUploadResponse/AITag.php | 8 +- .../FileUploadResponse/ExtensionStatus.php | 20 ++-- .../ExtensionStatus/AIAutoDescription.php | 2 +- .../ExtensionStatus/AITasks.php | 2 +- .../ExtensionStatus/AwsAutoTagging.php | 2 +- .../ExtensionStatus/GoogleAutoTagging.php | 2 +- .../ExtensionStatus/RemoveBg.php | 2 +- .../SelectedFieldsSchema.php | 32 +++--- .../SelectedFieldsSchema/DefaultValue.php | 14 +-- .../DefaultValue/Mixed_.php | 8 +- .../SelectedFieldsSchema/MaxValue.php | 8 +- .../SelectedFieldsSchema/MinValue.php | 8 +- .../SelectedFieldsSchema/SelectOption.php | 8 +- .../SelectedFieldsSchema/Type.php | 2 +- .../Files/FileUploadResponse/VersionInfo.php | 8 +- .../Invalidation/InvalidationCreateParams.php | 12 +-- .../Invalidation/InvalidationGetResponse.php | 10 +- .../InvalidationGetResponse/Status.php | 2 +- .../Invalidation/InvalidationNewResponse.php | 8 +- src/Client.php | 30 +++--- src/Core.php | 2 +- src/Core/Attributes/Optional.php | 6 +- src/Core/Attributes/Required.php | 12 +-- src/Core/BaseClient.php | 24 ++--- src/Core/Concerns/ResponseProxy.php | 2 +- src/Core/Concerns/SdkEnum.php | 6 +- src/Core/Concerns/SdkModel.php | 16 +-- src/Core/Concerns/SdkPage.php | 16 +-- src/Core/Concerns/SdkParams.php | 8 +- src/Core/Concerns/SdkUnion.php | 8 +- src/Core/Contracts/BaseModel.php | 4 +- src/Core/Contracts/BasePage.php | 4 +- src/Core/Contracts/BaseResponse.php | 2 +- src/Core/Contracts/BaseStream.php | 6 +- src/Core/Conversion.php | 12 +-- src/Core/Conversion/CoerceState.php | 2 +- src/Core/Conversion/Concerns/ArrayOf.php | 12 +-- src/Core/Conversion/Contracts/Converter.php | 6 +- .../Conversion/Contracts/ConverterSource.php | 2 +- src/Core/Conversion/DumpState.php | 2 +- src/Core/Conversion/EnumOf.php | 6 +- src/Core/Conversion/ListOf.php | 6 +- src/Core/Conversion/MapOf.php | 6 +- src/Core/Conversion/ModelOf.php | 12 +-- src/Core/Conversion/PropertyInfo.php | 10 +- src/Core/Conversion/UnionOf.php | 10 +- .../Exceptions/APIConnectionException.php | 4 +- src/Core/Exceptions/APIException.php | 4 +- src/Core/Exceptions/APIStatusException.php | 6 +- src/Core/Exceptions/APITimeoutException.php | 4 +- .../Exceptions/AuthenticationException.php | 4 +- src/Core/Exceptions/BadRequestException.php | 4 +- src/Core/Exceptions/ConflictException.php | 4 +- ...kitException.php => ImageKitException.php} | 6 +- .../Exceptions/InternalServerException.php | 4 +- src/Core/Exceptions/NotFoundException.php | 4 +- .../Exceptions/PermissionDeniedException.php | 4 +- src/Core/Exceptions/RateLimitException.php | 4 +- .../UnprocessableEntityException.php | 4 +- src/Core/Exceptions/WebhookException.php | 6 +- src/Core/FileParam.php | 2 +- src/Core/Implementation/RawResponse.php | 20 ++-- .../Implementation/StreamingHttpClient.php | 2 +- src/Core/Util.php | 2 +- .../CustomMetadataField.php | 12 +-- .../CustomMetadataField/Schema.php | 32 +++--- .../Schema/DefaultValue.php | 14 +-- .../Schema/DefaultValue/Mixed_.php | 8 +- .../CustomMetadataField/Schema/MaxValue.php | 8 +- .../CustomMetadataField/Schema/MinValue.php | 8 +- .../Schema/SelectOption.php | 8 +- .../CustomMetadataField/Schema/Type.php | 2 +- .../CustomMetadataFieldCreateParams.php | 16 +-- .../Schema.php | 32 +++--- .../Schema/DefaultValue.php | 14 +-- .../Schema/DefaultValue/Mixed_.php | 8 +- .../Schema/MaxValue.php | 8 +- .../Schema/MinValue.php | 8 +- .../Schema/SelectOption.php | 8 +- .../Schema/Type.php | 2 +- .../CustomMetadataFieldDeleteResponse.php | 6 +- .../CustomMetadataFieldListParams.php | 12 +-- .../CustomMetadataFieldUpdateParams.php | 16 +-- .../Schema.php | 28 +++--- .../Schema/DefaultValue.php | 14 +-- .../Schema/DefaultValue/Mixed_.php | 8 +- .../Schema/MaxValue.php | 8 +- .../Schema/MinValue.php | 8 +- .../Schema/SelectOption.php | 8 +- src/ExtensionConfig.php | 24 ++--- src/ExtensionConfig/AITasksExtension.php | 14 +-- src/ExtensionConfig/AITasksExtension/Task.php | 20 ++-- .../Task/AITaskSelectMetadata.php | 16 +-- .../Task/AITaskSelectMetadata/Vocabulary.php | 8 +- .../Task/AITaskSelectTags.php | 10 +- .../AITasksExtension/Task/AITaskYesNo.php | 22 ++--- .../Task/AITaskYesNo/OnNo.php | 16 +-- .../Task/AITaskYesNo/OnNo/SetMetadata.php | 14 +-- .../AITaskYesNo/OnNo/SetMetadata/Value.php | 14 +-- .../OnNo/SetMetadata/Value/Mixed_.php | 8 +- .../Task/AITaskYesNo/OnNo/UnsetMetadata.php | 8 +- .../Task/AITaskYesNo/OnUnknown.php | 16 +-- .../AITaskYesNo/OnUnknown/SetMetadata.php | 14 +-- .../OnUnknown/SetMetadata/Value.php | 14 +-- .../OnUnknown/SetMetadata/Value/Mixed_.php | 8 +- .../AITaskYesNo/OnUnknown/UnsetMetadata.php | 8 +- .../Task/AITaskYesNo/OnYes.php | 16 +-- .../Task/AITaskYesNo/OnYes/SetMetadata.php | 14 +-- .../AITaskYesNo/OnYes/SetMetadata/Value.php | 14 +-- .../OnYes/SetMetadata/Value/Mixed_.php | 8 +- .../Task/AITaskYesNo/OnYes/UnsetMetadata.php | 8 +- .../AutoDescriptionExtension.php | 8 +- src/ExtensionConfig/AutoTaggingExtension.php | 10 +- .../AutoTaggingExtension/Name.php | 2 +- src/ExtensionConfig/RemovedotBgExtension.php | 14 +-- .../RemovedotBgExtension/Options.php | 8 +- src/ExtensionItem.php | 28 +++--- src/ExtensionItem/AITasksExtension.php | 14 +-- src/ExtensionItem/AITasksExtension/Task.php | 20 ++-- .../Task/AITaskSelectMetadata.php | 16 +-- .../Task/AITaskSelectMetadata/Vocabulary.php | 8 +- .../Task/AITaskSelectTags.php | 10 +- .../AITasksExtension/Task/AITaskYesNo.php | 22 ++--- .../Task/AITaskYesNo/OnNo.php | 16 +-- .../Task/AITaskYesNo/OnNo/SetMetadata.php | 14 +-- .../AITaskYesNo/OnNo/SetMetadata/Value.php | 14 +-- .../OnNo/SetMetadata/Value/Mixed_.php | 8 +- .../Task/AITaskYesNo/OnNo/UnsetMetadata.php | 8 +- .../Task/AITaskYesNo/OnUnknown.php | 16 +-- .../AITaskYesNo/OnUnknown/SetMetadata.php | 14 +-- .../OnUnknown/SetMetadata/Value.php | 14 +-- .../OnUnknown/SetMetadata/Value/Mixed_.php | 8 +- .../AITaskYesNo/OnUnknown/UnsetMetadata.php | 8 +- .../Task/AITaskYesNo/OnYes.php | 16 +-- .../Task/AITaskYesNo/OnYes/SetMetadata.php | 14 +-- .../AITaskYesNo/OnYes/SetMetadata/Value.php | 14 +-- .../OnYes/SetMetadata/Value/Mixed_.php | 8 +- .../Task/AITaskYesNo/OnYes/UnsetMetadata.php | 8 +- .../AutoDescriptionExtension.php | 8 +- src/ExtensionItem/AutoTaggingExtension.php | 10 +- .../AutoTaggingExtension/Name.php | 2 +- src/ExtensionItem/RemovedotBgExtension.php | 14 +-- .../RemovedotBgExtension/Options.php | 8 +- src/ExtensionItem/SavedExtensionReference.php | 8 +- src/Files/Bulk/BulkAddTagsParams.php | 12 +-- src/Files/Bulk/BulkAddTagsResponse.php | 8 +- src/Files/Bulk/BulkDeleteParams.php | 12 +-- src/Files/Bulk/BulkDeleteResponse.php | 8 +- src/Files/Bulk/BulkRemoveAITagsParams.php | 12 +-- src/Files/Bulk/BulkRemoveAITagsResponse.php | 8 +- src/Files/Bulk/BulkRemoveTagsParams.php | 12 +-- src/Files/Bulk/BulkRemoveTagsResponse.php | 8 +- src/Files/File.php | 22 ++--- src/Files/File/AITag.php | 8 +- src/Files/File/SelectedFieldsSchema.php | 34 +++---- .../SelectedFieldsSchema/DefaultValue.php | 14 +-- .../DefaultValue/Mixed_.php | 8 +- .../File/SelectedFieldsSchema/MaxValue.php | 8 +- .../File/SelectedFieldsSchema/MinValue.php | 8 +- .../SelectedFieldsSchema/SelectOption.php | 8 +- src/Files/File/SelectedFieldsSchema/Type.php | 2 +- src/Files/File/Type.php | 2 +- src/Files/File/VersionInfo.php | 8 +- src/Files/FileCopyParams.php | 14 +-- src/Files/FileCopyResponse.php | 6 +- src/Files/FileMoveParams.php | 12 +-- src/Files/FileMoveResponse.php | 6 +- src/Files/FileRenameParams.php | 14 +-- src/Files/FileRenameResponse.php | 8 +- src/Files/FileUpdateParams.php | 28 +++--- src/Files/FileUpdateParams/Publish.php | 10 +- src/Files/FileUpdateParams/RemoveAITags.php | 10 +- src/Files/FileUpdateResponse.php | 26 ++--- .../FileUpdateResponse/ExtensionStatus.php | 20 ++-- .../ExtensionStatus/AIAutoDescription.php | 2 +- .../ExtensionStatus/AITasks.php | 2 +- .../ExtensionStatus/AwsAutoTagging.php | 2 +- .../ExtensionStatus/GoogleAutoTagging.php | 2 +- .../ExtensionStatus/RemoveBg.php | 2 +- src/Files/FileUploadParams.php | 30 +++--- src/Files/FileUploadParams/ResponseField.php | 2 +- src/Files/FileUploadParams/Transformation.php | 14 +-- .../FileUploadParams/Transformation/Post.php | 24 ++--- .../Post/AdaptiveBitrateStreaming.php | 10 +- .../AdaptiveBitrateStreaming/Protocol.php | 2 +- .../Transformation/Post/ConvertGifToVideo.php | 10 +- .../Post/GenerateAThumbnail.php | 10 +- .../Post/SimplePostTransformation.php | 8 +- src/Files/FileUploadResponse.php | 26 ++--- src/Files/FileUploadResponse/AITag.php | 8 +- .../FileUploadResponse/ExtensionStatus.php | 20 ++-- .../ExtensionStatus/AIAutoDescription.php | 2 +- .../ExtensionStatus/AITasks.php | 2 +- .../ExtensionStatus/AwsAutoTagging.php | 2 +- .../ExtensionStatus/GoogleAutoTagging.php | 2 +- .../ExtensionStatus/RemoveBg.php | 2 +- .../SelectedFieldsSchema.php | 32 +++--- .../SelectedFieldsSchema/DefaultValue.php | 14 +-- .../DefaultValue/Mixed_.php | 8 +- .../SelectedFieldsSchema/MaxValue.php | 8 +- .../SelectedFieldsSchema/MinValue.php | 8 +- .../SelectedFieldsSchema/SelectOption.php | 8 +- .../SelectedFieldsSchema/Type.php | 2 +- src/Files/FileUploadResponse/VersionInfo.php | 8 +- src/Files/Folder.php | 10 +- src/Files/Folder/Type.php | 2 +- src/Files/Metadata.php | 12 +-- src/Files/Metadata/Exif.php | 28 +++--- src/Files/Metadata/Exif/Exif.php | 8 +- src/Files/Metadata/Exif/Gps.php | 8 +- src/Files/Metadata/Exif/Image.php | 8 +- src/Files/Metadata/Exif/Interoperability.php | 8 +- src/Files/Metadata/Exif/Thumbnail.php | 8 +- .../Metadata/MetadataGetFromURLParams.php | 12 +-- src/Files/UpdateFileRequest.php | 16 +-- .../ChangePublicationStatus.php | 12 +-- .../ChangePublicationStatus/Publish.php | 10 +- .../UpdateFileRequest/UpdateFileDetails.php | 20 ++-- .../UpdateFileDetails/RemoveAITags.php | 10 +- src/Files/Versions/VersionDeleteParams.php | 12 +-- src/Files/Versions/VersionDeleteResponse.php | 6 +- src/Files/Versions/VersionGetParams.php | 12 +-- src/Files/Versions/VersionRestoreParams.php | 12 +-- src/Folders/FolderCopyParams.php | 14 +-- src/Folders/FolderCopyResponse.php | 8 +- src/Folders/FolderCreateParams.php | 12 +-- src/Folders/FolderDeleteParams.php | 12 +-- src/Folders/FolderDeleteResponse.php | 6 +- src/Folders/FolderMoveParams.php | 12 +-- src/Folders/FolderMoveResponse.php | 8 +- src/Folders/FolderNewResponse.php | 6 +- src/Folders/FolderRenameParams.php | 14 +-- src/Folders/FolderRenameResponse.php | 8 +- src/Folders/Job/JobGetResponse.php | 12 +-- src/Folders/Job/JobGetResponse/Status.php | 2 +- src/Folders/Job/JobGetResponse/Type.php | 2 +- src/GetImageAttributesOptions.php | 10 +- src/ImageOverlay.php | 18 ++-- src/ImageOverlay/Encoding.php | 2 +- src/Overlay.php | 18 ++-- src/OverlayPosition.php | 28 +++--- src/OverlayPosition/AnchorPoint.php | 2 +- src/OverlayPosition/Focus.php | 2 +- src/OverlayPosition/X.php | 8 +- src/OverlayPosition/XCenter.php | 8 +- src/OverlayPosition/Y.php | 8 +- src/OverlayPosition/YCenter.php | 8 +- src/OverlayTiming.php | 20 ++-- src/OverlayTiming/Duration.php | 8 +- src/OverlayTiming/End.php | 8 +- src/OverlayTiming/Start.php | 8 +- src/RequestOptions.php | 10 +- src/ResponsiveImageAttributes.php | 10 +- src/SavedExtension.php | 20 ++-- .../SavedExtensionCreateParams.php | 28 +++--- .../SavedExtensionUpdateParams.php | 28 +++--- .../Accounts/OriginsContract.php | 24 ++--- .../Accounts/OriginsRawContract.php | 30 +++--- .../Accounts/URLEndpointsContract.php | 22 ++--- .../Accounts/URLEndpointsRawContract.php | 16 +-- .../Accounts/UsageContract.php | 10 +- .../Accounts/UsageRawContract.php | 14 +-- src/ServiceContracts/AccountsContract.php | 2 +- src/ServiceContracts/AccountsRawContract.php | 2 +- src/ServiceContracts/AssetsContract.php | 18 ++-- src/ServiceContracts/AssetsRawContract.php | 16 +-- .../Beta/V2/FilesContract.php | 20 ++-- .../Beta/V2/FilesRawContract.php | 14 +-- src/ServiceContracts/Beta/V2Contract.php | 2 +- src/ServiceContracts/Beta/V2RawContract.php | 2 +- src/ServiceContracts/BetaContract.php | 2 +- src/ServiceContracts/BetaRawContract.php | 2 +- .../Cache/InvalidationContract.php | 12 +-- .../Cache/InvalidationRawContract.php | 16 +-- src/ServiceContracts/CacheContract.php | 2 +- src/ServiceContracts/CacheRawContract.php | 2 +- .../CustomMetadataFieldsContract.php | 22 ++--- .../CustomMetadataFieldsRawContract.php | 20 ++-- src/ServiceContracts/Files/BulkContract.php | 16 +-- .../Files/BulkRawContract.php | 26 ++--- .../Files/MetadataContract.php | 10 +- .../Files/MetadataRawContract.php | 14 +-- .../Files/VersionsContract.php | 12 +-- .../Files/VersionsRawContract.php | 20 ++-- src/ServiceContracts/FilesContract.php | 36 +++---- src/ServiceContracts/FilesRawContract.php | 32 +++--- src/ServiceContracts/Folders/JobContract.php | 10 +- .../Folders/JobRawContract.php | 12 +-- src/ServiceContracts/FoldersContract.php | 18 ++-- src/ServiceContracts/FoldersRawContract.php | 30 +++--- .../SavedExtensionsContract.php | 20 ++-- .../SavedExtensionsRawContract.php | 16 +-- src/ServiceContracts/WebhooksContract.php | 28 +++--- src/ServiceContracts/WebhooksRawContract.php | 2 +- src/Services/Accounts/OriginsRawService.php | 38 +++---- src/Services/Accounts/OriginsService.php | 30 +++--- .../Accounts/URLEndpointsRawService.php | 26 ++--- src/Services/Accounts/URLEndpointsService.php | 30 +++--- src/Services/Accounts/UsageRawService.php | 18 ++-- src/Services/Accounts/UsageService.php | 16 +-- src/Services/AccountsRawService.php | 6 +- src/Services/AccountsService.php | 12 +-- src/Services/AssetsRawService.php | 30 +++--- src/Services/AssetsService.php | 24 ++--- src/Services/Beta/V2/FilesRawService.php | 28 +++--- src/Services/Beta/V2/FilesService.php | 26 ++--- src/Services/Beta/V2RawService.php | 6 +- src/Services/Beta/V2Service.php | 8 +- src/Services/BetaRawService.php | 6 +- src/Services/BetaService.php | 8 +- src/Services/Cache/InvalidationRawService.php | 20 ++-- src/Services/Cache/InvalidationService.php | 18 ++-- src/Services/CacheRawService.php | 6 +- src/Services/CacheService.php | 8 +- .../CustomMetadataFieldsRawService.php | 32 +++--- src/Services/CustomMetadataFieldsService.php | 28 +++--- src/Services/Files/BulkRawService.php | 30 +++--- src/Services/Files/BulkService.php | 24 ++--- src/Services/Files/MetadataRawService.php | 18 ++-- src/Services/Files/MetadataService.php | 16 +-- src/Services/Files/VersionsRawService.php | 26 ++--- src/Services/Files/VersionsService.php | 18 ++-- src/Services/FilesRawService.php | 52 +++++----- src/Services/FilesService.php | 48 ++++----- src/Services/Folders/JobRawService.php | 16 +-- src/Services/Folders/JobService.php | 14 +-- src/Services/FoldersRawService.php | 34 +++---- src/Services/FoldersService.php | 28 +++--- src/Services/SavedExtensionsRawService.php | 24 ++--- src/Services/SavedExtensionsService.php | 28 +++--- src/Services/WebhooksRawService.php | 6 +- src/Services/WebhooksService.php | 40 ++++---- src/SolidColorOverlay.php | 18 ++-- src/SolidColorOverlayTransformation.php | 24 ++--- .../Gradient.php | 8 +- .../Height.php | 8 +- .../Radius.php | 8 +- src/SolidColorOverlayTransformation/Width.php | 8 +- src/SrcOptions.php | 10 +- src/StreamingResolution.php | 2 +- src/SubtitleOverlay.php | 20 ++-- src/SubtitleOverlay/Encoding.php | 2 +- src/SubtitleOverlayTransformation.php | 10 +- .../Typography.php | 2 +- src/TextOverlay.php | 20 ++-- src/TextOverlay/Encoding.php | 2 +- src/TextOverlayTransformation.php | 36 +++---- src/TextOverlayTransformation/Flip.php | 2 +- src/TextOverlayTransformation/FontSize.php | 8 +- .../InnerAlignment.php | 2 +- src/TextOverlayTransformation/LineHeight.php | 8 +- src/TextOverlayTransformation/Padding.php | 8 +- src/TextOverlayTransformation/Radius.php | 8 +- src/TextOverlayTransformation/Rotation.php | 8 +- src/TextOverlayTransformation/Width.php | 8 +- src/Transformation.php | 98 +++++++++---------- src/Transformation/AIDropShadow.php | 8 +- src/Transformation/AspectRatio.php | 8 +- src/Transformation/AudioCodec.php | 2 +- src/Transformation/Crop.php | 2 +- src/Transformation/CropMode.php | 2 +- src/Transformation/Duration.php | 8 +- src/Transformation/EndOffset.php | 8 +- src/Transformation/Flip.php | 2 +- src/Transformation/Format.php | 2 +- src/Transformation/Gradient.php | 8 +- src/Transformation/Height.php | 8 +- src/Transformation/Page.php | 8 +- src/Transformation/Radius.php | 8 +- src/Transformation/Rotation.php | 8 +- src/Transformation/Shadow.php | 8 +- src/Transformation/Sharpen.php | 8 +- src/Transformation/StartOffset.php | 8 +- src/Transformation/Trim.php | 8 +- src/Transformation/UnsharpMask.php | 8 +- src/Transformation/VideoCodec.php | 2 +- src/Transformation/Width.php | 8 +- src/Transformation/X.php | 8 +- src/Transformation/XCenter.php | 8 +- src/Transformation/Y.php | 8 +- src/Transformation/YCenter.php | 8 +- src/TransformationPosition.php | 2 +- src/Version.php | 2 +- src/VideoOverlay.php | 18 ++-- src/VideoOverlay/Encoding.php | 2 +- src/Webhooks/BaseWebhookEvent.php | 8 +- src/Webhooks/FileCreateEvent.php | 12 +-- src/Webhooks/FileDeleteEvent.php | 12 +-- src/Webhooks/FileDeleteEvent/Data.php | 8 +- src/Webhooks/FileUpdateEvent.php | 12 +-- src/Webhooks/FileVersionCreateEvent.php | 12 +-- src/Webhooks/FileVersionDeleteEvent.php | 12 +-- src/Webhooks/FileVersionDeleteEvent/Data.php | 8 +- src/Webhooks/UnsafeUnwrapWebhookEvent.php | 32 +++--- src/Webhooks/UnwrapWebhookEvent.php | 32 +++--- .../UploadPostTransformErrorEvent.php | 16 +-- .../UploadPostTransformErrorEvent/Data.php | 12 +-- .../Data/Transformation.php | 12 +-- .../Data/Transformation/Error.php | 8 +- .../UploadPostTransformErrorEvent/Request.php | 12 +-- .../Request/Transformation.php | 16 +-- .../Request/Transformation/Protocol.php | 2 +- .../Request/Transformation/Type.php | 2 +- .../UploadPostTransformSuccessEvent.php | 16 +-- .../UploadPostTransformSuccessEvent/Data.php | 8 +- .../Request.php | 12 +-- .../Request/Transformation.php | 16 +-- .../Request/Transformation/Protocol.php | 2 +- .../Request/Transformation/Type.php | 2 +- src/Webhooks/UploadPreTransformErrorEvent.php | 16 +-- .../UploadPreTransformErrorEvent/Data.php | 12 +-- .../Data/Transformation.php | 12 +-- .../Data/Transformation/Error.php | 8 +- .../UploadPreTransformErrorEvent/Request.php | 8 +- .../UploadPreTransformSuccessEvent.php | 16 +-- .../UploadPreTransformSuccessEvent/Data.php | 28 +++--- .../Data/AITag.php | 8 +- .../Data/ExtensionStatus.php | 20 ++-- .../ExtensionStatus/AIAutoDescription.php | 2 +- .../Data/ExtensionStatus/AITasks.php | 2 +- .../Data/ExtensionStatus/AwsAutoTagging.php | 2 +- .../ExtensionStatus/GoogleAutoTagging.php | 2 +- .../Data/ExtensionStatus/RemoveBg.php | 2 +- .../Data/SelectedFieldsSchema.php | 32 +++--- .../SelectedFieldsSchema/DefaultValue.php | 14 +-- .../DefaultValue/Mixed_.php | 8 +- .../Data/SelectedFieldsSchema/MaxValue.php | 8 +- .../Data/SelectedFieldsSchema/MinValue.php | 8 +- .../SelectedFieldsSchema/SelectOption.php | 8 +- .../Data/SelectedFieldsSchema/Type.php | 2 +- .../Data/VersionInfo.php | 8 +- .../Request.php | 8 +- .../VideoTransformationAcceptedEvent.php | 16 +-- .../VideoTransformationAcceptedEvent/Data.php | 16 +-- .../Data/Asset.php | 8 +- .../Data/Transformation.php | 16 +-- .../Data/Transformation/Options.php | 18 ++-- .../Transformation/Options/AudioCodec.php | 2 +- .../Data/Transformation/Options/Format.php | 2 +- .../Transformation/Options/StreamProtocol.php | 2 +- .../Transformation/Options/VideoCodec.php | 2 +- .../Data/Transformation/Type.php | 2 +- .../Request.php | 10 +- .../VideoTransformationErrorEvent.php | 16 +-- .../VideoTransformationErrorEvent/Data.php | 16 +-- .../Data/Asset.php | 8 +- .../Data/Transformation.php | 20 ++-- .../Data/Transformation/Error.php | 10 +- .../Data/Transformation/Error/Reason.php | 2 +- .../Data/Transformation/Options.php | 18 ++-- .../Transformation/Options/AudioCodec.php | 2 +- .../Data/Transformation/Options/Format.php | 2 +- .../Transformation/Options/StreamProtocol.php | 2 +- .../Transformation/Options/VideoCodec.php | 2 +- .../Data/Transformation/Type.php | 2 +- .../VideoTransformationErrorEvent/Request.php | 10 +- .../VideoTransformationReadyEvent.php | 22 ++--- .../VideoTransformationReadyEvent/Data.php | 16 +-- .../Data/Asset.php | 8 +- .../Data/Transformation.php | 20 ++-- .../Data/Transformation/Options.php | 18 ++-- .../Transformation/Options/AudioCodec.php | 2 +- .../Data/Transformation/Options/Format.php | 2 +- .../Transformation/Options/StreamProtocol.php | 2 +- .../Transformation/Options/VideoCodec.php | 2 +- .../Data/Transformation/Output.php | 14 +-- .../Transformation/Output/VideoMetadata.php | 8 +- .../Data/Transformation/Type.php | 2 +- .../VideoTransformationReadyEvent/Request.php | 10 +- .../VideoTransformationReadyEvent/Timings.php | 8 +- tests/ClientTest.php | 6 +- tests/Core/ModelTest.php | 8 +- tests/Core/StreamingTransportTest.php | 6 +- tests/Core/UtilTest.php | 2 +- tests/Services/Accounts/OriginsTest.php | 4 +- tests/Services/Accounts/URLEndpointsTest.php | 6 +- tests/Services/Accounts/UsageTest.php | 6 +- tests/Services/AssetsTest.php | 4 +- tests/Services/Beta/V2/FilesTest.php | 8 +- tests/Services/Cache/InvalidationTest.php | 8 +- tests/Services/CustomMetadataFieldsTest.php | 8 +- tests/Services/Files/BulkTest.php | 12 +-- tests/Services/Files/MetadataTest.php | 6 +- tests/Services/Files/VersionsTest.php | 8 +- tests/Services/FilesTest.php | 18 ++-- tests/Services/Folders/JobTest.php | 6 +- tests/Services/FoldersTest.php | 14 +-- tests/Services/SavedExtensionsTest.php | 6 +- tests/Services/WebhooksTest.php | 6 +- 553 files changed, 3226 insertions(+), 3213 deletions(-) create mode 100644 .github/workflows/publish-packagist.yml rename src/Core/Exceptions/{ImagekitException.php => ImageKitException.php} (63%) diff --git a/.github/workflows/publish-packagist.yml b/.github/workflows/publish-packagist.yml new file mode 100644 index 00000000..e8509fa2 --- /dev/null +++ b/.github/workflows/publish-packagist.yml @@ -0,0 +1,21 @@ +name: Publish Packagist +on: + workflow_dispatch: + + release: + types: [published] + +jobs: + publish: + name: publish + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Publish to Packagist + run: |- + curl --fail-with-body -X POST -H 'Content-Type: application/json' "https://packagist.org/api/update-package?username=${PACKAGIST_USERNAME}&apiToken=${PACKAGIST_SAFE_KEY}" -d '{"repository":"https://github.com/imagekit-developer/imagekit-php"}' + env: + PACKAGIST_USERNAME: ${{ secrets.IMAGE_KIT_PACKAGIST_USERNAME || secrets.PACKAGIST_USERNAME }} + PACKAGIST_SAFE_KEY: ${{ secrets.IMAGE_KIT_PACKAGIST_SAFE_KEY || secrets.PACKAGIST_SAFE_KEY }} \ No newline at end of file diff --git a/.github/workflows/release-doctor.yml b/.github/workflows/release-doctor.yml index bf79423a..1af22484 100644 --- a/.github/workflows/release-doctor.yml +++ b/.github/workflows/release-doctor.yml @@ -2,14 +2,14 @@ name: Release Doctor on: pull_request: branches: - - main + - master workflow_dispatch: jobs: release_doctor: name: release doctor runs-on: ubuntu-latest - if: github.repository == 'stainless-sdks/imagekit-php' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') + if: github.repository == 'imagekit-developer/imagekit-php' && (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || startsWith(github.head_ref, 'release-please') || github.head_ref == 'next') steps: - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 diff --git a/.stats.yml b/.stats.yml index 1eed5544..c1c7ec9d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 47 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-01267e4c07ec30011b8445babed88fbd2133b65198f42d0310b7ab39c74751d4.yml +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/imagekit-inc/imagekit-5280e65473c0c42b7f41216fd22aeb469acb5f54b6ee1a3181f3ec9b7a19dc17.yml openapi_spec_hash: 7c103e2dff0edcbeea82057e62f58d4d -config_hash: 7ef70b333059ca21bef0f0a6d4cbb282 +config_hash: 7960882e624d385c4d9aecca2132adad diff --git a/README.md b/README.md index c36e89be..ea9290f5 100644 --- a/README.md +++ b/README.md @@ -8,21 +8,13 @@ The REST API documentation can be found on [imagekit.io](https://imagekit.io/doc ## Installation -To use this package, install via Composer by adding the following to your application's `composer.json`: - -```json -{ - "repositories": [ - { - "type": "vcs", - "url": "git@github.com:stainless-sdks/imagekit-php.git" - } - ], - "require": { - "imagekit/imagekit": "dev-main" - } -} + + ``` +composer require "imagekit/imagekit 0.0.1" +``` + + ## Usage @@ -32,8 +24,8 @@ Parameters with a default value must be set by name. ```php withName("Joey")`. ### Handling errors -When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `Imagekit\Core\Exceptions\APIException` will be thrown: +When the library is unable to connect to the API, or if the API returns a non-success status code (i.e., 4xx or 5xx response), a subclass of `ImageKit\Core\Exceptions\APIException` will be thrown: ```php files->upload( @@ -110,8 +102,8 @@ You can use the `maxRetries` option to configure or disable this: ```php 0]); @@ -131,7 +123,7 @@ Request parameters that correspond to file uploads can be passed as a resource r ```php files->upload( file: FileParam::fromString('https://www.example.com/public-url.jpg', filename: uniqid('file-upload-', true)), @@ -212,4 +204,4 @@ PHP 8.1.0 or higher. ## Contributing -See [the contributing documentation](https://github.com/stainless-sdks/imagekit-php/tree/main/CONTRIBUTING.md). +See [the contributing documentation](https://github.com/imagekit-developer/imagekit-php/tree/master/CONTRIBUTING.md). diff --git a/composer.json b/composer.json index 1a378dae..28e6cfee 100644 --- a/composer.json +++ b/composer.json @@ -6,7 +6,7 @@ "src/Version.php" ], "psr-4": { - "Imagekit\\": "src/" + "ImageKit\\": "src/" } }, "autoload-dev": { diff --git a/src/Accounts/Origins/OriginCreateParams.php b/src/Accounts/Origins/OriginCreateParams.php index 46e443f8..d36feb97 100644 --- a/src/Accounts/Origins/OriginCreateParams.php +++ b/src/Accounts/Origins/OriginCreateParams.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\Accounts\Origins; +namespace ImageKit\Accounts\Origins; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; /** * **Note:** This API is currently in beta. * Creates a new origin and returns the origin object. * - * @see Imagekit\Services\Accounts\OriginsService::create() + * @see ImageKit\Services\Accounts\OriginsService::create() * * @phpstan-type OriginCreateParamsShape = array{ * type: 'AKENEO_PIM', diff --git a/src/Accounts/Origins/OriginRequest.php b/src/Accounts/Origins/OriginRequest.php index 3bcb4559..08918583 100644 --- a/src/Accounts/Origins/OriginRequest.php +++ b/src/Accounts/Origins/OriginRequest.php @@ -2,31 +2,31 @@ declare(strict_types=1); -namespace Imagekit\Accounts\Origins; +namespace ImageKit\Accounts\Origins; -use Imagekit\Accounts\Origins\OriginRequest\AkeneoPim; -use Imagekit\Accounts\Origins\OriginRequest\AzureBlobStorage; -use Imagekit\Accounts\Origins\OriginRequest\CloudinaryBackup; -use Imagekit\Accounts\Origins\OriginRequest\GoogleCloudStorageGcs; -use Imagekit\Accounts\Origins\OriginRequest\S3; -use Imagekit\Accounts\Origins\OriginRequest\S3Compatible; -use Imagekit\Accounts\Origins\OriginRequest\WebFolder; -use Imagekit\Accounts\Origins\OriginRequest\WebProxy; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Accounts\Origins\OriginRequest\AkeneoPim; +use ImageKit\Accounts\Origins\OriginRequest\AzureBlobStorage; +use ImageKit\Accounts\Origins\OriginRequest\CloudinaryBackup; +use ImageKit\Accounts\Origins\OriginRequest\GoogleCloudStorageGcs; +use ImageKit\Accounts\Origins\OriginRequest\S3; +use ImageKit\Accounts\Origins\OriginRequest\S3Compatible; +use ImageKit\Accounts\Origins\OriginRequest\WebFolder; +use ImageKit\Accounts\Origins\OriginRequest\WebProxy; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Schema for origin request resources. * - * @phpstan-import-type S3Shape from \Imagekit\Accounts\Origins\OriginRequest\S3 - * @phpstan-import-type S3CompatibleShape from \Imagekit\Accounts\Origins\OriginRequest\S3Compatible - * @phpstan-import-type CloudinaryBackupShape from \Imagekit\Accounts\Origins\OriginRequest\CloudinaryBackup - * @phpstan-import-type WebFolderShape from \Imagekit\Accounts\Origins\OriginRequest\WebFolder - * @phpstan-import-type WebProxyShape from \Imagekit\Accounts\Origins\OriginRequest\WebProxy - * @phpstan-import-type GoogleCloudStorageGcsShape from \Imagekit\Accounts\Origins\OriginRequest\GoogleCloudStorageGcs - * @phpstan-import-type AzureBlobStorageShape from \Imagekit\Accounts\Origins\OriginRequest\AzureBlobStorage - * @phpstan-import-type AkeneoPimShape from \Imagekit\Accounts\Origins\OriginRequest\AkeneoPim + * @phpstan-import-type S3Shape from \ImageKit\Accounts\Origins\OriginRequest\S3 + * @phpstan-import-type S3CompatibleShape from \ImageKit\Accounts\Origins\OriginRequest\S3Compatible + * @phpstan-import-type CloudinaryBackupShape from \ImageKit\Accounts\Origins\OriginRequest\CloudinaryBackup + * @phpstan-import-type WebFolderShape from \ImageKit\Accounts\Origins\OriginRequest\WebFolder + * @phpstan-import-type WebProxyShape from \ImageKit\Accounts\Origins\OriginRequest\WebProxy + * @phpstan-import-type GoogleCloudStorageGcsShape from \ImageKit\Accounts\Origins\OriginRequest\GoogleCloudStorageGcs + * @phpstan-import-type AzureBlobStorageShape from \ImageKit\Accounts\Origins\OriginRequest\AzureBlobStorage + * @phpstan-import-type AkeneoPimShape from \ImageKit\Accounts\Origins\OriginRequest\AkeneoPim * * @phpstan-type OriginRequestVariants = S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|GoogleCloudStorageGcs|AzureBlobStorage|AkeneoPim * @phpstan-type OriginRequestShape = OriginRequestVariants|S3Shape|S3CompatibleShape|CloudinaryBackupShape|WebFolderShape|WebProxyShape|GoogleCloudStorageGcsShape|AzureBlobStorageShape|AkeneoPimShape diff --git a/src/Accounts/Origins/OriginRequest/AkeneoPim.php b/src/Accounts/Origins/OriginRequest/AkeneoPim.php index 4712b85a..11da7ced 100644 --- a/src/Accounts/Origins/OriginRequest/AkeneoPim.php +++ b/src/Accounts/Origins/OriginRequest/AkeneoPim.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Accounts\Origins\OriginRequest; +namespace ImageKit\Accounts\Origins\OriginRequest; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type AkeneoPimShape = array{ diff --git a/src/Accounts/Origins/OriginRequest/AzureBlobStorage.php b/src/Accounts/Origins/OriginRequest/AzureBlobStorage.php index dd94f496..3b42220b 100644 --- a/src/Accounts/Origins/OriginRequest/AzureBlobStorage.php +++ b/src/Accounts/Origins/OriginRequest/AzureBlobStorage.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Accounts\Origins\OriginRequest; +namespace ImageKit\Accounts\Origins\OriginRequest; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type AzureBlobStorageShape = array{ diff --git a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php index a61e3d98..da0561fc 100644 --- a/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginRequest/CloudinaryBackup.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Accounts\Origins\OriginRequest; +namespace ImageKit\Accounts\Origins\OriginRequest; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type CloudinaryBackupShape = array{ diff --git a/src/Accounts/Origins/OriginRequest/GoogleCloudStorageGcs.php b/src/Accounts/Origins/OriginRequest/GoogleCloudStorageGcs.php index 1e66df4f..e867b814 100644 --- a/src/Accounts/Origins/OriginRequest/GoogleCloudStorageGcs.php +++ b/src/Accounts/Origins/OriginRequest/GoogleCloudStorageGcs.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Accounts\Origins\OriginRequest; +namespace ImageKit\Accounts\Origins\OriginRequest; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type GoogleCloudStorageGcsShape = array{ diff --git a/src/Accounts/Origins/OriginRequest/S3.php b/src/Accounts/Origins/OriginRequest/S3.php index 53896f45..cd4c3c79 100644 --- a/src/Accounts/Origins/OriginRequest/S3.php +++ b/src/Accounts/Origins/OriginRequest/S3.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Accounts\Origins\OriginRequest; +namespace ImageKit\Accounts\Origins\OriginRequest; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type S3Shape = array{ diff --git a/src/Accounts/Origins/OriginRequest/S3Compatible.php b/src/Accounts/Origins/OriginRequest/S3Compatible.php index 3daec53e..fac8cf60 100644 --- a/src/Accounts/Origins/OriginRequest/S3Compatible.php +++ b/src/Accounts/Origins/OriginRequest/S3Compatible.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Accounts\Origins\OriginRequest; +namespace ImageKit\Accounts\Origins\OriginRequest; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type S3CompatibleShape = array{ diff --git a/src/Accounts/Origins/OriginRequest/WebFolder.php b/src/Accounts/Origins/OriginRequest/WebFolder.php index 658aa97e..885195b6 100644 --- a/src/Accounts/Origins/OriginRequest/WebFolder.php +++ b/src/Accounts/Origins/OriginRequest/WebFolder.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Accounts\Origins\OriginRequest; +namespace ImageKit\Accounts\Origins\OriginRequest; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type WebFolderShape = array{ diff --git a/src/Accounts/Origins/OriginRequest/WebProxy.php b/src/Accounts/Origins/OriginRequest/WebProxy.php index d6d78325..b4ab0fc1 100644 --- a/src/Accounts/Origins/OriginRequest/WebProxy.php +++ b/src/Accounts/Origins/OriginRequest/WebProxy.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Accounts\Origins\OriginRequest; +namespace ImageKit\Accounts\Origins\OriginRequest; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type WebProxyShape = array{ diff --git a/src/Accounts/Origins/OriginResponse.php b/src/Accounts/Origins/OriginResponse.php index e810c999..2a4d4c8e 100644 --- a/src/Accounts/Origins/OriginResponse.php +++ b/src/Accounts/Origins/OriginResponse.php @@ -2,31 +2,31 @@ declare(strict_types=1); -namespace Imagekit\Accounts\Origins; +namespace ImageKit\Accounts\Origins; -use Imagekit\Accounts\Origins\OriginResponse\AkeneoPim; -use Imagekit\Accounts\Origins\OriginResponse\AzureBlobStorage; -use Imagekit\Accounts\Origins\OriginResponse\CloudinaryBackup; -use Imagekit\Accounts\Origins\OriginResponse\GoogleCloudStorageGcs; -use Imagekit\Accounts\Origins\OriginResponse\S3; -use Imagekit\Accounts\Origins\OriginResponse\S3Compatible; -use Imagekit\Accounts\Origins\OriginResponse\WebFolder; -use Imagekit\Accounts\Origins\OriginResponse\WebProxy; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Accounts\Origins\OriginResponse\AkeneoPim; +use ImageKit\Accounts\Origins\OriginResponse\AzureBlobStorage; +use ImageKit\Accounts\Origins\OriginResponse\CloudinaryBackup; +use ImageKit\Accounts\Origins\OriginResponse\GoogleCloudStorageGcs; +use ImageKit\Accounts\Origins\OriginResponse\S3; +use ImageKit\Accounts\Origins\OriginResponse\S3Compatible; +use ImageKit\Accounts\Origins\OriginResponse\WebFolder; +use ImageKit\Accounts\Origins\OriginResponse\WebProxy; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Origin object as returned by the API (sensitive fields removed). * - * @phpstan-import-type S3Shape from \Imagekit\Accounts\Origins\OriginResponse\S3 - * @phpstan-import-type S3CompatibleShape from \Imagekit\Accounts\Origins\OriginResponse\S3Compatible - * @phpstan-import-type CloudinaryBackupShape from \Imagekit\Accounts\Origins\OriginResponse\CloudinaryBackup - * @phpstan-import-type WebFolderShape from \Imagekit\Accounts\Origins\OriginResponse\WebFolder - * @phpstan-import-type WebProxyShape from \Imagekit\Accounts\Origins\OriginResponse\WebProxy - * @phpstan-import-type GoogleCloudStorageGcsShape from \Imagekit\Accounts\Origins\OriginResponse\GoogleCloudStorageGcs - * @phpstan-import-type AzureBlobStorageShape from \Imagekit\Accounts\Origins\OriginResponse\AzureBlobStorage - * @phpstan-import-type AkeneoPimShape from \Imagekit\Accounts\Origins\OriginResponse\AkeneoPim + * @phpstan-import-type S3Shape from \ImageKit\Accounts\Origins\OriginResponse\S3 + * @phpstan-import-type S3CompatibleShape from \ImageKit\Accounts\Origins\OriginResponse\S3Compatible + * @phpstan-import-type CloudinaryBackupShape from \ImageKit\Accounts\Origins\OriginResponse\CloudinaryBackup + * @phpstan-import-type WebFolderShape from \ImageKit\Accounts\Origins\OriginResponse\WebFolder + * @phpstan-import-type WebProxyShape from \ImageKit\Accounts\Origins\OriginResponse\WebProxy + * @phpstan-import-type GoogleCloudStorageGcsShape from \ImageKit\Accounts\Origins\OriginResponse\GoogleCloudStorageGcs + * @phpstan-import-type AzureBlobStorageShape from \ImageKit\Accounts\Origins\OriginResponse\AzureBlobStorage + * @phpstan-import-type AkeneoPimShape from \ImageKit\Accounts\Origins\OriginResponse\AkeneoPim * * @phpstan-type OriginResponseVariants = S3|S3Compatible|CloudinaryBackup|WebFolder|WebProxy|GoogleCloudStorageGcs|AzureBlobStorage|AkeneoPim * @phpstan-type OriginResponseShape = OriginResponseVariants|S3Shape|S3CompatibleShape|CloudinaryBackupShape|WebFolderShape|WebProxyShape|GoogleCloudStorageGcsShape|AzureBlobStorageShape|AkeneoPimShape diff --git a/src/Accounts/Origins/OriginResponse/AkeneoPim.php b/src/Accounts/Origins/OriginResponse/AkeneoPim.php index cd4e3964..84b2accf 100644 --- a/src/Accounts/Origins/OriginResponse/AkeneoPim.php +++ b/src/Accounts/Origins/OriginResponse/AkeneoPim.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Accounts\Origins\OriginResponse; +namespace ImageKit\Accounts\Origins\OriginResponse; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type AkeneoPimShape = array{ diff --git a/src/Accounts/Origins/OriginResponse/AzureBlobStorage.php b/src/Accounts/Origins/OriginResponse/AzureBlobStorage.php index d3d9890b..45df2f63 100644 --- a/src/Accounts/Origins/OriginResponse/AzureBlobStorage.php +++ b/src/Accounts/Origins/OriginResponse/AzureBlobStorage.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Accounts\Origins\OriginResponse; +namespace ImageKit\Accounts\Origins\OriginResponse; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type AzureBlobStorageShape = array{ diff --git a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php index 8d3e82ab..fba1c65d 100644 --- a/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php +++ b/src/Accounts/Origins/OriginResponse/CloudinaryBackup.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Accounts\Origins\OriginResponse; +namespace ImageKit\Accounts\Origins\OriginResponse; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type CloudinaryBackupShape = array{ diff --git a/src/Accounts/Origins/OriginResponse/GoogleCloudStorageGcs.php b/src/Accounts/Origins/OriginResponse/GoogleCloudStorageGcs.php index f68266f6..cb998b0b 100644 --- a/src/Accounts/Origins/OriginResponse/GoogleCloudStorageGcs.php +++ b/src/Accounts/Origins/OriginResponse/GoogleCloudStorageGcs.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Accounts\Origins\OriginResponse; +namespace ImageKit\Accounts\Origins\OriginResponse; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type GoogleCloudStorageGcsShape = array{ diff --git a/src/Accounts/Origins/OriginResponse/S3.php b/src/Accounts/Origins/OriginResponse/S3.php index 2482bae3..b62e9ef4 100644 --- a/src/Accounts/Origins/OriginResponse/S3.php +++ b/src/Accounts/Origins/OriginResponse/S3.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Accounts\Origins\OriginResponse; +namespace ImageKit\Accounts\Origins\OriginResponse; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type S3Shape = array{ diff --git a/src/Accounts/Origins/OriginResponse/S3Compatible.php b/src/Accounts/Origins/OriginResponse/S3Compatible.php index 392e79d6..78078b4a 100644 --- a/src/Accounts/Origins/OriginResponse/S3Compatible.php +++ b/src/Accounts/Origins/OriginResponse/S3Compatible.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Accounts\Origins\OriginResponse; +namespace ImageKit\Accounts\Origins\OriginResponse; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type S3CompatibleShape = array{ diff --git a/src/Accounts/Origins/OriginResponse/WebFolder.php b/src/Accounts/Origins/OriginResponse/WebFolder.php index d04074f4..85234356 100644 --- a/src/Accounts/Origins/OriginResponse/WebFolder.php +++ b/src/Accounts/Origins/OriginResponse/WebFolder.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Accounts\Origins\OriginResponse; +namespace ImageKit\Accounts\Origins\OriginResponse; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type WebFolderShape = array{ diff --git a/src/Accounts/Origins/OriginResponse/WebProxy.php b/src/Accounts/Origins/OriginResponse/WebProxy.php index cc92822d..a460f0fc 100644 --- a/src/Accounts/Origins/OriginResponse/WebProxy.php +++ b/src/Accounts/Origins/OriginResponse/WebProxy.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Accounts\Origins\OriginResponse; +namespace ImageKit\Accounts\Origins\OriginResponse; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type WebProxyShape = array{ diff --git a/src/Accounts/Origins/OriginUpdateParams.php b/src/Accounts/Origins/OriginUpdateParams.php index eca8811e..1abf1736 100644 --- a/src/Accounts/Origins/OriginUpdateParams.php +++ b/src/Accounts/Origins/OriginUpdateParams.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\Accounts\Origins; +namespace ImageKit\Accounts\Origins; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; /** * **Note:** This API is currently in beta. * Updates the origin identified by `id` and returns the updated origin object. * - * @see Imagekit\Services\Accounts\OriginsService::update() + * @see ImageKit\Services\Accounts\OriginsService::update() * * @phpstan-type OriginUpdateParamsShape = array{ * type: 'AKENEO_PIM', diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php index 6c5ef00f..5d5fbb74 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php @@ -2,26 +2,26 @@ declare(strict_types=1); -namespace Imagekit\Accounts\URLEndpoints; - -use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\AkamaiURLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\CloudinaryURLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\ImgixURLRewriter; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; +namespace ImageKit\Accounts\URLEndpoints; + +use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\AkamaiURLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\CloudinaryURLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\ImgixURLRewriter; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; /** * **Note:** This API is currently in beta. * Creates a new URL‑endpoint and returns the resulting object. * - * @see Imagekit\Services\Accounts\URLEndpointsService::create() + * @see ImageKit\Services\Accounts\URLEndpointsService::create() * - * @phpstan-import-type URLRewriterVariants from \Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter - * @phpstan-import-type URLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter + * @phpstan-import-type URLRewriterVariants from \ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter + * @phpstan-import-type URLRewriterShape from \ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter * * @phpstan-type URLEndpointCreateParamsShape = array{ * description: string, diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php index 4d43a5a8..013a7d11 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter.php @@ -2,21 +2,21 @@ declare(strict_types=1); -namespace Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams; +namespace ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams; -use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\AkamaiURLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\CloudinaryURLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\ImgixURLRewriter; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\AkamaiURLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\CloudinaryURLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\ImgixURLRewriter; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Configuration for third-party URL rewriting. * - * @phpstan-import-type CloudinaryURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\CloudinaryURLRewriter - * @phpstan-import-type ImgixURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\ImgixURLRewriter - * @phpstan-import-type AkamaiURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\AkamaiURLRewriter + * @phpstan-import-type CloudinaryURLRewriterShape from \ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\CloudinaryURLRewriter + * @phpstan-import-type ImgixURLRewriterShape from \ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\ImgixURLRewriter + * @phpstan-import-type AkamaiURLRewriterShape from \ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\AkamaiURLRewriter * * @phpstan-type URLRewriterVariants = CloudinaryURLRewriter|ImgixURLRewriter|AkamaiURLRewriter * @phpstan-type URLRewriterShape = URLRewriterVariants|CloudinaryURLRewriterShape|ImgixURLRewriterShape|AkamaiURLRewriterShape diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/AkamaiURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/AkamaiURLRewriter.php index ce09c4a1..3426c523 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/AkamaiURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/AkamaiURLRewriter.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter; +namespace ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type AkamaiURLRewriterShape = array{type: 'AKAMAI'} diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/CloudinaryURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/CloudinaryURLRewriter.php index 47303cef..56426c4f 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/CloudinaryURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/CloudinaryURLRewriter.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter; +namespace ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type CloudinaryURLRewriterShape = array{ diff --git a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/ImgixURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/ImgixURLRewriter.php index 9972235f..4eadafe0 100644 --- a/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/ImgixURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams/URLRewriter/ImgixURLRewriter.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter; +namespace ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type ImgixURLRewriterShape = array{type: 'IMGIX'} diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest.php b/src/Accounts/URLEndpoints/URLEndpointRequest.php index 0960f890..a3a90292 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace Imagekit\Accounts\URLEndpoints; +namespace ImageKit\Accounts\URLEndpoints; -use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\AkamaiURLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\CloudinaryURLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\ImgixURLRewriter; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\AkamaiURLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\CloudinaryURLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\ImgixURLRewriter; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * Schema for URL endpoint resource. * - * @phpstan-import-type URLRewriterVariants from \Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter - * @phpstan-import-type URLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter + * @phpstan-import-type URLRewriterVariants from \ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter + * @phpstan-import-type URLRewriterShape from \ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter * * @phpstan-type URLEndpointRequestShape = array{ * description: string, diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php index a2ab8335..73515b91 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter.php @@ -2,21 +2,21 @@ declare(strict_types=1); -namespace Imagekit\Accounts\URLEndpoints\URLEndpointRequest; +namespace ImageKit\Accounts\URLEndpoints\URLEndpointRequest; -use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\AkamaiURLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\CloudinaryURLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\ImgixURLRewriter; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\AkamaiURLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\CloudinaryURLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\ImgixURLRewriter; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Configuration for third-party URL rewriting. * - * @phpstan-import-type CloudinaryURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\CloudinaryURLRewriter - * @phpstan-import-type ImgixURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\ImgixURLRewriter - * @phpstan-import-type AkamaiURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\AkamaiURLRewriter + * @phpstan-import-type CloudinaryURLRewriterShape from \ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\CloudinaryURLRewriter + * @phpstan-import-type ImgixURLRewriterShape from \ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\ImgixURLRewriter + * @phpstan-import-type AkamaiURLRewriterShape from \ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter\AkamaiURLRewriter * * @phpstan-type URLRewriterVariants = CloudinaryURLRewriter|ImgixURLRewriter|AkamaiURLRewriter * @phpstan-type URLRewriterShape = URLRewriterVariants|CloudinaryURLRewriterShape|ImgixURLRewriterShape|AkamaiURLRewriterShape diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/AkamaiURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/AkamaiURLRewriter.php index 4b254a04..534e2eaf 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/AkamaiURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/AkamaiURLRewriter.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter; +namespace ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type AkamaiURLRewriterShape = array{type: 'AKAMAI'} diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/CloudinaryURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/CloudinaryURLRewriter.php index d2c51792..b2438007 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/CloudinaryURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/CloudinaryURLRewriter.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter; +namespace ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type CloudinaryURLRewriterShape = array{ diff --git a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/ImgixURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/ImgixURLRewriter.php index 5990df7b..2f96917c 100644 --- a/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/ImgixURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointRequest/URLRewriter/ImgixURLRewriter.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter; +namespace ImageKit\Accounts\URLEndpoints\URLEndpointRequest\URLRewriter; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type ImgixURLRewriterShape = array{type: 'IMGIX'} diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse.php b/src/Accounts/URLEndpoints/URLEndpointResponse.php index 59467346..af3e773d 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace Imagekit\Accounts\URLEndpoints; +namespace ImageKit\Accounts\URLEndpoints; -use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\AkamaiURLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\CloudinaryURLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\ImgixURLRewriter; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\AkamaiURLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\CloudinaryURLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\ImgixURLRewriter; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * URL‑endpoint object as returned by the API. * - * @phpstan-import-type URLRewriterVariants from \Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter - * @phpstan-import-type URLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter + * @phpstan-import-type URLRewriterVariants from \ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter + * @phpstan-import-type URLRewriterShape from \ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter * * @phpstan-type URLEndpointResponseShape = array{ * id: string, diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php index 6a6013de..4670b2e9 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter.php @@ -2,21 +2,21 @@ declare(strict_types=1); -namespace Imagekit\Accounts\URLEndpoints\URLEndpointResponse; +namespace ImageKit\Accounts\URLEndpoints\URLEndpointResponse; -use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\AkamaiURLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\CloudinaryURLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\ImgixURLRewriter; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\AkamaiURLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\CloudinaryURLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\ImgixURLRewriter; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Configuration for third-party URL rewriting. * - * @phpstan-import-type CloudinaryURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\CloudinaryURLRewriter - * @phpstan-import-type ImgixURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\ImgixURLRewriter - * @phpstan-import-type AkamaiURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\AkamaiURLRewriter + * @phpstan-import-type CloudinaryURLRewriterShape from \ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\CloudinaryURLRewriter + * @phpstan-import-type ImgixURLRewriterShape from \ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\ImgixURLRewriter + * @phpstan-import-type AkamaiURLRewriterShape from \ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter\AkamaiURLRewriter * * @phpstan-type URLRewriterVariants = CloudinaryURLRewriter|ImgixURLRewriter|AkamaiURLRewriter * @phpstan-type URLRewriterShape = URLRewriterVariants|CloudinaryURLRewriterShape|ImgixURLRewriterShape|AkamaiURLRewriterShape diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/AkamaiURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/AkamaiURLRewriter.php index bb12c17e..505b599f 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/AkamaiURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/AkamaiURLRewriter.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter; +namespace ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type AkamaiURLRewriterShape = array{type: 'AKAMAI'} diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/CloudinaryURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/CloudinaryURLRewriter.php index bc03162f..c4efdb70 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/CloudinaryURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/CloudinaryURLRewriter.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter; +namespace ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type CloudinaryURLRewriterShape = array{ diff --git a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/ImgixURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/ImgixURLRewriter.php index a0acd6d7..e22b4dba 100644 --- a/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/ImgixURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointResponse/URLRewriter/ImgixURLRewriter.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter; +namespace ImageKit\Accounts\URLEndpoints\URLEndpointResponse\URLRewriter; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type ImgixURLRewriterShape = array{type: 'IMGIX'} diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php index 70da5f96..cfda6c3d 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php @@ -2,26 +2,26 @@ declare(strict_types=1); -namespace Imagekit\Accounts\URLEndpoints; - -use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\AkamaiURLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\CloudinaryURLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\ImgixURLRewriter; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; +namespace ImageKit\Accounts\URLEndpoints; + +use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\AkamaiURLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\CloudinaryURLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\ImgixURLRewriter; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; /** * **Note:** This API is currently in beta. * Updates the URL‑endpoint identified by `id` and returns the updated object. * - * @see Imagekit\Services\Accounts\URLEndpointsService::update() + * @see ImageKit\Services\Accounts\URLEndpointsService::update() * - * @phpstan-import-type URLRewriterVariants from \Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter - * @phpstan-import-type URLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter + * @phpstan-import-type URLRewriterVariants from \ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter + * @phpstan-import-type URLRewriterShape from \ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter * * @phpstan-type URLEndpointUpdateParamsShape = array{ * description: string, diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php index 85afc58b..8b2661a1 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter.php @@ -2,21 +2,21 @@ declare(strict_types=1); -namespace Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams; +namespace ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams; -use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\AkamaiURLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\CloudinaryURLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\ImgixURLRewriter; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\AkamaiURLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\CloudinaryURLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\ImgixURLRewriter; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Configuration for third-party URL rewriting. * - * @phpstan-import-type CloudinaryURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\CloudinaryURLRewriter - * @phpstan-import-type ImgixURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\ImgixURLRewriter - * @phpstan-import-type AkamaiURLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\AkamaiURLRewriter + * @phpstan-import-type CloudinaryURLRewriterShape from \ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\CloudinaryURLRewriter + * @phpstan-import-type ImgixURLRewriterShape from \ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\ImgixURLRewriter + * @phpstan-import-type AkamaiURLRewriterShape from \ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\AkamaiURLRewriter * * @phpstan-type URLRewriterVariants = CloudinaryURLRewriter|ImgixURLRewriter|AkamaiURLRewriter * @phpstan-type URLRewriterShape = URLRewriterVariants|CloudinaryURLRewriterShape|ImgixURLRewriterShape|AkamaiURLRewriterShape diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/AkamaiURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/AkamaiURLRewriter.php index 36724a05..ad726587 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/AkamaiURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/AkamaiURLRewriter.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter; +namespace ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type AkamaiURLRewriterShape = array{type: 'AKAMAI'} diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/CloudinaryURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/CloudinaryURLRewriter.php index fd9829b7..7d42dda6 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/CloudinaryURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/CloudinaryURLRewriter.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter; +namespace ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type CloudinaryURLRewriterShape = array{ diff --git a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/ImgixURLRewriter.php b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/ImgixURLRewriter.php index d538c3fc..21125d80 100644 --- a/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/ImgixURLRewriter.php +++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams/URLRewriter/ImgixURLRewriter.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter; +namespace ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type ImgixURLRewriterShape = array{type: 'IMGIX'} diff --git a/src/Accounts/Usage/UsageGetParams.php b/src/Accounts/Usage/UsageGetParams.php index dede1fd7..3c4f6064 100644 --- a/src/Accounts/Usage/UsageGetParams.php +++ b/src/Accounts/Usage/UsageGetParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Accounts\Usage; +namespace ImageKit\Accounts\Usage; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; /** * Get the account usage information between two dates. Note that the API response includes data from the start date while excluding data from the end date. In other words, the data covers the period starting from the specified start date up to, but not including, the end date. * - * @see Imagekit\Services\Accounts\UsageService::get() + * @see ImageKit\Services\Accounts\UsageService::get() * * @phpstan-type UsageGetParamsShape = array{endDate: string, startDate: string} */ diff --git a/src/Accounts/Usage/UsageGetResponse.php b/src/Accounts/Usage/UsageGetResponse.php index a5c24d50..d6759c18 100644 --- a/src/Accounts/Usage/UsageGetResponse.php +++ b/src/Accounts/Usage/UsageGetResponse.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Accounts\Usage; +namespace ImageKit\Accounts\Usage; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type UsageGetResponseShape = array{ diff --git a/src/Assets/AssetListParams.php b/src/Assets/AssetListParams.php index 6f105019..1d90f4b3 100644 --- a/src/Assets/AssetListParams.php +++ b/src/Assets/AssetListParams.php @@ -2,20 +2,20 @@ declare(strict_types=1); -namespace Imagekit\Assets; +namespace ImageKit\Assets; -use Imagekit\Assets\AssetListParams\FileType; -use Imagekit\Assets\AssetListParams\Sort; -use Imagekit\Assets\AssetListParams\Type; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Assets\AssetListParams\FileType; +use ImageKit\Assets\AssetListParams\Sort; +use ImageKit\Assets\AssetListParams\Type; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; /** * This API can list all the uploaded files and folders in your ImageKit.io media library. In addition, you can fine-tune your query by specifying various filters by generating a query string in a Lucene-like syntax and provide this generated string as the value of the `searchQuery`. * - * @see Imagekit\Services\AssetsService::list() + * @see ImageKit\Services\AssetsService::list() * * @phpstan-type AssetListParamsShape = array{ * fileType?: null|FileType|value-of, diff --git a/src/Assets/AssetListParams/FileType.php b/src/Assets/AssetListParams/FileType.php index 522b96fc..8c812108 100644 --- a/src/Assets/AssetListParams/FileType.php +++ b/src/Assets/AssetListParams/FileType.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Assets\AssetListParams; +namespace ImageKit\Assets\AssetListParams; /** * Filter results by file type. diff --git a/src/Assets/AssetListParams/Sort.php b/src/Assets/AssetListParams/Sort.php index 51eb8459..ff5a2378 100644 --- a/src/Assets/AssetListParams/Sort.php +++ b/src/Assets/AssetListParams/Sort.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Assets\AssetListParams; +namespace ImageKit\Assets\AssetListParams; /** * Sort the results by one of the supported fields in ascending or descending order. diff --git a/src/Assets/AssetListParams/Type.php b/src/Assets/AssetListParams/Type.php index 13ce10ab..a4d41c10 100644 --- a/src/Assets/AssetListParams/Type.php +++ b/src/Assets/AssetListParams/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Assets\AssetListParams; +namespace ImageKit\Assets\AssetListParams; /** * Filter results by asset type. diff --git a/src/Assets/AssetListResponseItem.php b/src/Assets/AssetListResponseItem.php index 6655acdb..204e96d5 100644 --- a/src/Assets/AssetListResponseItem.php +++ b/src/Assets/AssetListResponseItem.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\Assets; +namespace ImageKit\Assets; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Files\File; -use Imagekit\Files\Folder; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Files\File; +use ImageKit\Files\Folder; /** * Object containing details of a file or file version. * - * @phpstan-import-type FileShape from \Imagekit\Files\File - * @phpstan-import-type FolderShape from \Imagekit\Files\Folder + * @phpstan-import-type FileShape from \ImageKit\Files\File + * @phpstan-import-type FolderShape from \ImageKit\Files\Folder * * @phpstan-type AssetListResponseItemVariants = File|Folder * @phpstan-type AssetListResponseItemShape = AssetListResponseItemVariants|FileShape|FolderShape diff --git a/src/BaseOverlay.php b/src/BaseOverlay.php index e9f25b00..2d1a6986 100644 --- a/src/BaseOverlay.php +++ b/src/BaseOverlay.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace Imagekit; +namespace ImageKit; -use Imagekit\BaseOverlay\LayerMode; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\BaseOverlay\LayerMode; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-import-type OverlayPositionShape from \Imagekit\OverlayPosition - * @phpstan-import-type OverlayTimingShape from \Imagekit\OverlayTiming + * @phpstan-import-type OverlayPositionShape from \ImageKit\OverlayPosition + * @phpstan-import-type OverlayTimingShape from \ImageKit\OverlayTiming * * @phpstan-type BaseOverlayShape = array{ * layerMode?: null|LayerMode|value-of, diff --git a/src/BaseOverlay/LayerMode.php b/src/BaseOverlay/LayerMode.php index 98d1080c..8f40d2f6 100644 --- a/src/BaseOverlay/LayerMode.php +++ b/src/BaseOverlay/LayerMode.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\BaseOverlay; +namespace ImageKit\BaseOverlay; /** * Controls how the layer blends with the base image or underlying content. Maps to `lm` in the URL. diff --git a/src/Beta/V2/Files/FileUploadParams.php b/src/Beta/V2/Files/FileUploadParams.php index 53af7373..5f998c4e 100644 --- a/src/Beta/V2/Files/FileUploadParams.php +++ b/src/Beta/V2/Files/FileUploadParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files; - -use Imagekit\Beta\V2\Files\FileUploadParams\ResponseField; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\FileParam; -use Imagekit\ExtensionItem; +namespace ImageKit\Beta\V2\Files; + +use ImageKit\Beta\V2\Files\FileUploadParams\ResponseField; +use ImageKit\Beta\V2\Files\FileUploadParams\Transformation; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\FileParam; +use ImageKit\ExtensionItem; /** * The V2 API enhances security by verifying the entire payload using JWT. This API is in beta. @@ -30,11 +30,11 @@ * - A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more. * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. * - * @see Imagekit\Services\Beta\V2\FilesService::upload() + * @see ImageKit\Services\Beta\V2\FilesService::upload() * - * @phpstan-import-type ExtensionItemVariants from \Imagekit\ExtensionItem - * @phpstan-import-type ExtensionItemShape from \Imagekit\ExtensionItem - * @phpstan-import-type TransformationShape from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation + * @phpstan-import-type ExtensionItemVariants from \ImageKit\ExtensionItem + * @phpstan-import-type ExtensionItemShape from \ImageKit\ExtensionItem + * @phpstan-import-type TransformationShape from \ImageKit\Beta\V2\Files\FileUploadParams\Transformation * * @phpstan-type FileUploadParamsShape = array{ * file: string|FileParam, diff --git a/src/Beta/V2/Files/FileUploadParams/ResponseField.php b/src/Beta/V2/Files/FileUploadParams/ResponseField.php index 72fc2f32..04a9aeb2 100644 --- a/src/Beta/V2/Files/FileUploadParams/ResponseField.php +++ b/src/Beta/V2/Files/FileUploadParams/ResponseField.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files\FileUploadParams; +namespace ImageKit\Beta\V2\Files\FileUploadParams; enum ResponseField: string { diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation.php index ba6236ba..7b37a055 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files\FileUploadParams; +namespace ImageKit\Beta\V2\Files\FileUploadParams; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * Configure pre-processing (`pre`) and post-processing (`post`) transformations. @@ -20,8 +20,8 @@ * * You can mix and match any combination of post-processing types. * - * @phpstan-import-type PostVariants from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post - * @phpstan-import-type PostShape from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post + * @phpstan-import-type PostVariants from \ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post + * @phpstan-import-type PostShape from \ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post * * @phpstan-type TransformationShape = array{ * post?: list|null, pre?: string|null diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php index a93f365f..6f82cf67 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post.php @@ -2,21 +2,21 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files\FileUploadParams\Transformation; +namespace ImageKit\Beta\V2\Files\FileUploadParams\Transformation; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\ConvertGifToVideo; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\SimplePostTransformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming; +use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\ConvertGifToVideo; +use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail; +use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\SimplePostTransformation; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** - * @phpstan-import-type SimplePostTransformationShape from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\SimplePostTransformation - * @phpstan-import-type ConvertGifToVideoShape from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\ConvertGifToVideo - * @phpstan-import-type GenerateAThumbnailShape from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail - * @phpstan-import-type AdaptiveBitrateStreamingShape from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming + * @phpstan-import-type SimplePostTransformationShape from \ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\SimplePostTransformation + * @phpstan-import-type ConvertGifToVideoShape from \ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\ConvertGifToVideo + * @phpstan-import-type GenerateAThumbnailShape from \ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail + * @phpstan-import-type AdaptiveBitrateStreamingShape from \ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming * * @phpstan-type PostVariants = SimplePostTransformation|ConvertGifToVideo|GenerateAThumbnail|AdaptiveBitrateStreaming * @phpstan-type PostShape = PostVariants|SimplePostTransformationShape|ConvertGifToVideoShape|GenerateAThumbnailShape|AdaptiveBitrateStreamingShape diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php index 98267546..8223ea1b 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post; +namespace ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming\Protocol; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming\Protocol; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type AdaptiveBitrateStreamingShape = array{ diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming/Protocol.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming/Protocol.php index c7e0f5eb..9be027f5 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming/Protocol.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming/Protocol.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming; +namespace ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming; /** * Streaming protocol to use (`hls` or `dash`). diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php index c3c1b4fc..11f95c98 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post; +namespace ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type ConvertGifToVideoShape = array{ diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php index d1ebd5fa..23cf5ffb 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post; +namespace ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type GenerateAThumbnailShape = array{ diff --git a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php index d8038387..bc515320 100644 --- a/src/Beta/V2/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php +++ b/src/Beta/V2/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files\FileUploadParams\Transformation\Post; +namespace ImageKit\Beta\V2\Files\FileUploadParams\Transformation\Post; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type SimplePostTransformationShape = array{ diff --git a/src/Beta/V2/Files/FileUploadResponse.php b/src/Beta/V2/Files/FileUploadResponse.php index b6c1159f..89f2316f 100644 --- a/src/Beta/V2/Files/FileUploadResponse.php +++ b/src/Beta/V2/Files/FileUploadResponse.php @@ -2,25 +2,25 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files; +namespace ImageKit\Beta\V2\Files; -use Imagekit\Beta\V2\Files\FileUploadResponse\AITag; -use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; -use Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; -use Imagekit\Beta\V2\Files\FileUploadResponse\VersionInfo; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Files\Metadata; +use ImageKit\Beta\V2\Files\FileUploadResponse\AITag; +use ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; +use ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; +use ImageKit\Beta\V2\Files\FileUploadResponse\VersionInfo; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Files\Metadata; /** * Object containing details of a successful upload. * - * @phpstan-import-type AITagShape from \Imagekit\Beta\V2\Files\FileUploadResponse\AITag - * @phpstan-import-type ExtensionStatusShape from \Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus - * @phpstan-import-type MetadataShape from \Imagekit\Files\Metadata - * @phpstan-import-type SelectedFieldsSchemaShape from \Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema - * @phpstan-import-type VersionInfoShape from \Imagekit\Beta\V2\Files\FileUploadResponse\VersionInfo + * @phpstan-import-type AITagShape from \ImageKit\Beta\V2\Files\FileUploadResponse\AITag + * @phpstan-import-type ExtensionStatusShape from \ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus + * @phpstan-import-type MetadataShape from \ImageKit\Files\Metadata + * @phpstan-import-type SelectedFieldsSchemaShape from \ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema + * @phpstan-import-type VersionInfoShape from \ImageKit\Beta\V2\Files\FileUploadResponse\VersionInfo * * @phpstan-type FileUploadResponseShape = array{ * aiTags?: list|null, diff --git a/src/Beta/V2/Files/FileUploadResponse/AITag.php b/src/Beta/V2/Files/FileUploadResponse/AITag.php index 64b74dd9..f137fa84 100644 --- a/src/Beta/V2/Files/FileUploadResponse/AITag.php +++ b/src/Beta/V2/Files/FileUploadResponse/AITag.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files\FileUploadResponse; +namespace ImageKit\Beta\V2\Files\FileUploadResponse; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * AI-generated tag associated with an image. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php index 7e3d926f..1cee1cbd 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files\FileUploadResponse; - -use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\AIAutoDescription; -use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\AITasks; -use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\AwsAutoTagging; -use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\GoogleAutoTagging; -use Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\RemoveBg; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +namespace ImageKit\Beta\V2\Files\FileUploadResponse; + +use ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\AIAutoDescription; +use ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\AITasks; +use ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\AwsAutoTagging; +use ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\GoogleAutoTagging; +use ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus\RemoveBg; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * Extension names with their processing status at the time of completion of the request. It could have one of the following status values: diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php index 2669c27d..c38a0dcf 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; +namespace ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; enum AIAutoDescription: string { diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AITasks.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AITasks.php index 55a806b6..30cab804 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AITasks.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AITasks.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; +namespace ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; enum AITasks: string { diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php index 0da0e20a..ac0ff91d 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; +namespace ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; enum AwsAutoTagging: string { diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php index 25ae68aa..740091fe 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; +namespace ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; enum GoogleAutoTagging: string { diff --git a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php index 44149e3b..5b1468d3 100644 --- a/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php +++ b/src/Beta/V2/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; +namespace ImageKit\Beta\V2\Files\FileUploadResponse\ExtensionStatus; enum RemoveBg: string { diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php index 2e26653f..cf010317 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema.php @@ -2,25 +2,25 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files\FileUploadResponse; +namespace ImageKit\Beta\V2\Files\FileUploadResponse; -use Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue; -use Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\SelectOption; -use Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\Type; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue; +use ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\SelectOption; +use ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\Type; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-import-type DefaultValueVariants from \Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue - * @phpstan-import-type MaxValueVariants from \Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\MaxValue - * @phpstan-import-type MinValueVariants from \Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\MinValue - * @phpstan-import-type SelectOptionVariants from \Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\SelectOption - * @phpstan-import-type DefaultValueShape from \Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue - * @phpstan-import-type MaxValueShape from \Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\MaxValue - * @phpstan-import-type MinValueShape from \Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\MinValue - * @phpstan-import-type SelectOptionShape from \Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\SelectOption + * @phpstan-import-type DefaultValueVariants from \ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue + * @phpstan-import-type MaxValueVariants from \ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\MaxValue + * @phpstan-import-type MinValueVariants from \ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\MinValue + * @phpstan-import-type SelectOptionVariants from \ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\SelectOption + * @phpstan-import-type DefaultValueShape from \ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue + * @phpstan-import-type MaxValueShape from \ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\MaxValue + * @phpstan-import-type MinValueShape from \ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\MinValue + * @phpstan-import-type SelectOptionShape from \ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\SelectOption * * @phpstan-type SelectedFieldsSchemaShape = array{ * type: Type|value-of, diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php index ae24e8a4..6a8628ea 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; +namespace ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; -use Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed_; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Core\Conversion\ListOf; +use ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed_; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\ListOf; /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. * - * @phpstan-import-type MixedShape from \Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed_ + * @phpstan-import-type MixedShape from \ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed_ * * @phpstan-type DefaultValueVariants = string|float|bool|list * @phpstan-type DefaultValueShape = DefaultValueVariants|list diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php index 09ea4d35..eb226022 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue; +namespace ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @phpstan-type MixedVariants = string|float|bool diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php index 8bfc3ea0..e9a4ab2c 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; +namespace ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php index 3d95e84e..8bde7ef4 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; +namespace ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php index 0dd5ef1e..9f95d64a 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; +namespace ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @phpstan-type SelectOptionVariants = string|float|bool diff --git a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/Type.php b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/Type.php index e5051b7a..e41d977e 100644 --- a/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/Type.php +++ b/src/Beta/V2/Files/FileUploadResponse/SelectedFieldsSchema/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; +namespace ImageKit\Beta\V2\Files\FileUploadResponse\SelectedFieldsSchema; /** * Type of the custom metadata field. diff --git a/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php b/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php index 00e786ff..712aac3c 100644 --- a/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php +++ b/src/Beta/V2/Files/FileUploadResponse/VersionInfo.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Beta\V2\Files\FileUploadResponse; +namespace ImageKit\Beta\V2\Files\FileUploadResponse; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * An object containing the file or file version's `id` (versionId) and `name`. diff --git a/src/Cache/Invalidation/InvalidationCreateParams.php b/src/Cache/Invalidation/InvalidationCreateParams.php index e65b2376..360e19c8 100644 --- a/src/Cache/Invalidation/InvalidationCreateParams.php +++ b/src/Cache/Invalidation/InvalidationCreateParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Cache\Invalidation; +namespace ImageKit\Cache\Invalidation; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; /** * This API will purge CDN cache and ImageKit.io's internal cache for a file. Note: Purge cache is an asynchronous process and it may take some time to reflect the changes. * - * @see Imagekit\Services\Cache\InvalidationService::create() + * @see ImageKit\Services\Cache\InvalidationService::create() * * @phpstan-type InvalidationCreateParamsShape = array{url: string} */ diff --git a/src/Cache/Invalidation/InvalidationGetResponse.php b/src/Cache/Invalidation/InvalidationGetResponse.php index b2f1b131..185a5189 100644 --- a/src/Cache/Invalidation/InvalidationGetResponse.php +++ b/src/Cache/Invalidation/InvalidationGetResponse.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Cache\Invalidation; +namespace ImageKit\Cache\Invalidation; -use Imagekit\Cache\Invalidation\InvalidationGetResponse\Status; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Cache\Invalidation\InvalidationGetResponse\Status; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type InvalidationGetResponseShape = array{ diff --git a/src/Cache/Invalidation/InvalidationGetResponse/Status.php b/src/Cache/Invalidation/InvalidationGetResponse/Status.php index b4443bb1..3b72a61a 100644 --- a/src/Cache/Invalidation/InvalidationGetResponse/Status.php +++ b/src/Cache/Invalidation/InvalidationGetResponse/Status.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Cache\Invalidation\InvalidationGetResponse; +namespace ImageKit\Cache\Invalidation\InvalidationGetResponse; /** * Status of the purge request. diff --git a/src/Cache/Invalidation/InvalidationNewResponse.php b/src/Cache/Invalidation/InvalidationNewResponse.php index 55ad149f..22edef66 100644 --- a/src/Cache/Invalidation/InvalidationNewResponse.php +++ b/src/Cache/Invalidation/InvalidationNewResponse.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Cache\Invalidation; +namespace ImageKit\Cache\Invalidation; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type InvalidationNewResponseShape = array{requestID?: string|null} diff --git a/src/Client.php b/src/Client.php index 0b91177f..86d08ed0 100644 --- a/src/Client.php +++ b/src/Client.php @@ -2,26 +2,26 @@ declare(strict_types=1); -namespace Imagekit; +namespace ImageKit; use Http\Discovery\Psr17FactoryDiscovery; use Http\Discovery\Psr18ClientDiscovery; -use Imagekit\Core\BaseClient; -use Imagekit\Core\Implementation\StreamingHttpClient; -use Imagekit\Core\Util; -use Imagekit\Services\AccountsService; -use Imagekit\Services\AssetsService; -use Imagekit\Services\BetaService; -use Imagekit\Services\CacheService; -use Imagekit\Services\CustomMetadataFieldsService; -use Imagekit\Services\FilesService; -use Imagekit\Services\FoldersService; -use Imagekit\Services\SavedExtensionsService; -use Imagekit\Services\WebhooksService; +use ImageKit\Core\BaseClient; +use ImageKit\Core\Implementation\StreamingHttpClient; +use ImageKit\Core\Util; +use ImageKit\Services\AccountsService; +use ImageKit\Services\AssetsService; +use ImageKit\Services\BetaService; +use ImageKit\Services\CacheService; +use ImageKit\Services\CustomMetadataFieldsService; +use ImageKit\Services\FilesService; +use ImageKit\Services\FoldersService; +use ImageKit\Services\SavedExtensionsService; +use ImageKit\Services\WebhooksService; /** - * @phpstan-import-type NormalizedRequest from \Imagekit\Core\BaseClient - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type NormalizedRequest from \ImageKit\Core\BaseClient + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ class Client extends BaseClient { diff --git a/src/Core.php b/src/Core.php index 18db36d5..1e035bb1 100644 --- a/src/Core.php +++ b/src/Core.php @@ -2,4 +2,4 @@ declare(strict_types=1); -namespace Imagekit\Core; +namespace ImageKit\Core; diff --git a/src/Core/Attributes/Optional.php b/src/Core/Attributes/Optional.php index 30402964..31429388 100644 --- a/src/Core/Attributes/Optional.php +++ b/src/Core/Attributes/Optional.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Imagekit\Core\Attributes; +namespace ImageKit\Core\Attributes; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @internal diff --git a/src/Core/Attributes/Required.php b/src/Core/Attributes/Required.php index 0ebb6bed..f264dc07 100644 --- a/src/Core/Attributes/Required.php +++ b/src/Core/Attributes/Required.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace Imagekit\Core\Attributes; +namespace ImageKit\Core\Attributes; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Core\Conversion\EnumOf; -use Imagekit\Core\Conversion\ListOf; -use Imagekit\Core\Conversion\MapOf; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\EnumOf; +use ImageKit\Core\Conversion\ListOf; +use ImageKit\Core\Conversion\MapOf; /** * @internal diff --git a/src/Core/BaseClient.php b/src/Core/BaseClient.php index 8024780f..89afdd83 100644 --- a/src/Core/BaseClient.php +++ b/src/Core/BaseClient.php @@ -2,24 +2,24 @@ declare(strict_types=1); -namespace Imagekit\Core; - -use Imagekit\Core\Contracts\BasePage; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Contracts\BaseStream; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Core\Exceptions\APIConnectionException; -use Imagekit\Core\Exceptions\APIStatusException; -use Imagekit\Core\Implementation\RawResponse; -use Imagekit\RequestOptions; +namespace ImageKit\Core; + +use ImageKit\Core\Contracts\BasePage; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Contracts\BaseStream; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Exceptions\APIConnectionException; +use ImageKit\Core\Exceptions\APIStatusException; +use ImageKit\Core\Implementation\RawResponse; +use ImageKit\RequestOptions; use Psr\Http\Client\ClientExceptionInterface; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\UriInterface; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions * * @phpstan-type NormalizedRequest = array{ * method: string, diff --git a/src/Core/Concerns/ResponseProxy.php b/src/Core/Concerns/ResponseProxy.php index cd8daa58..709bfc4f 100644 --- a/src/Core/Concerns/ResponseProxy.php +++ b/src/Core/Concerns/ResponseProxy.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Core\Concerns; +namespace ImageKit\Core\Concerns; use Psr\Http\Message\ResponseInterface; use Psr\Http\Message\StreamInterface; diff --git a/src/Core/Concerns/SdkEnum.php b/src/Core/Concerns/SdkEnum.php index f24b2689..c47f7343 100644 --- a/src/Core/Concerns/SdkEnum.php +++ b/src/Core/Concerns/SdkEnum.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Imagekit\Core\Concerns; +namespace ImageKit\Core\Concerns; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\EnumOf; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\EnumOf; /** * @internal diff --git a/src/Core/Concerns/SdkModel.php b/src/Core/Concerns/SdkModel.php index 7c0d214e..98948b2b 100644 --- a/src/Core/Concerns/SdkModel.php +++ b/src/Core/Concerns/SdkModel.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace Imagekit\Core\Concerns; - -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion; -use Imagekit\Core\Conversion\CoerceState; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\ModelOf; -use Imagekit\Core\Util; +namespace ImageKit\Core\Concerns; + +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion; +use ImageKit\Core\Conversion\CoerceState; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\ModelOf; +use ImageKit\Core\Util; /** * @internal diff --git a/src/Core/Concerns/SdkPage.php b/src/Core/Concerns/SdkPage.php index ed45df89..466eb6f1 100644 --- a/src/Core/Concerns/SdkPage.php +++ b/src/Core/Concerns/SdkPage.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Core\Concerns; +namespace ImageKit\Core\Concerns; -use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Core\Exceptions\APIStatusException; -use Imagekit\RequestOptions; +use ImageKit\Client; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Exceptions\APIStatusException; +use ImageKit\RequestOptions; /** - * @phpstan-import-type NormalizedRequest from \Imagekit\Core\BaseClient + * @phpstan-import-type NormalizedRequest from \ImageKit\Core\BaseClient * * @internal * diff --git a/src/Core/Concerns/SdkParams.php b/src/Core/Concerns/SdkParams.php index 5c25615e..ab53ae51 100644 --- a/src/Core/Concerns/SdkParams.php +++ b/src/Core/Concerns/SdkParams.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Core\Concerns; +namespace ImageKit\Core\Concerns; -use Imagekit\Core\Conversion; -use Imagekit\Core\Conversion\DumpState; -use Imagekit\RequestOptions; +use ImageKit\Core\Conversion; +use ImageKit\Core\Conversion\DumpState; +use ImageKit\RequestOptions; /** * @internal diff --git a/src/Core/Concerns/SdkUnion.php b/src/Core/Concerns/SdkUnion.php index 3045665d..90e3d812 100644 --- a/src/Core/Concerns/SdkUnion.php +++ b/src/Core/Concerns/SdkUnion.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Core\Concerns; +namespace ImageKit\Core\Concerns; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Core\Conversion\UnionOf; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\UnionOf; /** * @internal diff --git a/src/Core/Contracts/BaseModel.php b/src/Core/Contracts/BaseModel.php index fa1d3714..ec1fbe74 100644 --- a/src/Core/Contracts/BaseModel.php +++ b/src/Core/Contracts/BaseModel.php @@ -2,9 +2,9 @@ declare(strict_types=1); -namespace Imagekit\Core\Contracts; +namespace ImageKit\Core\Contracts; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @internal diff --git a/src/Core/Contracts/BasePage.php b/src/Core/Contracts/BasePage.php index b2a776d8..d1fed191 100644 --- a/src/Core/Contracts/BasePage.php +++ b/src/Core/Contracts/BasePage.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Imagekit\Core\Contracts; +namespace ImageKit\Core\Contracts; /** - * @phpstan-import-type NormalizedRequest from \Imagekit\Core\BaseClient + * @phpstan-import-type NormalizedRequest from \ImageKit\Core\BaseClient * * @internal * diff --git a/src/Core/Contracts/BaseResponse.php b/src/Core/Contracts/BaseResponse.php index e6f682e4..f5638ee4 100644 --- a/src/Core/Contracts/BaseResponse.php +++ b/src/Core/Contracts/BaseResponse.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Core\Contracts; +namespace ImageKit\Core\Contracts; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; diff --git a/src/Core/Contracts/BaseStream.php b/src/Core/Contracts/BaseStream.php index 3710528e..b389a65d 100644 --- a/src/Core/Contracts/BaseStream.php +++ b/src/Core/Contracts/BaseStream.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Imagekit\Core\Contracts; +namespace ImageKit\Core\Contracts; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; use Psr\Http\Message\RequestInterface; use Psr\Http\Message\ResponseInterface; diff --git a/src/Core/Conversion.php b/src/Core/Conversion.php index 9afc45fb..2d89651f 100644 --- a/src/Core/Conversion.php +++ b/src/Core/Conversion.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace Imagekit\Core; +namespace ImageKit\Core; -use Imagekit\Core\Conversion\CoerceState; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Core\Conversion\DumpState; -use Imagekit\Core\Conversion\EnumOf; +use ImageKit\Core\Conversion\CoerceState; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\DumpState; +use ImageKit\Core\Conversion\EnumOf; /** * @internal diff --git a/src/Core/Conversion/CoerceState.php b/src/Core/Conversion/CoerceState.php index 578e7f4f..b1de64d7 100644 --- a/src/Core/Conversion/CoerceState.php +++ b/src/Core/Conversion/CoerceState.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Core\Conversion; +namespace ImageKit\Core\Conversion; /** * @internal diff --git a/src/Core/Conversion/Concerns/ArrayOf.php b/src/Core/Conversion/Concerns/ArrayOf.php index 5b0e9c67..443f2de9 100644 --- a/src/Core/Conversion/Concerns/ArrayOf.php +++ b/src/Core/Conversion/Concerns/ArrayOf.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace Imagekit\Core\Conversion\Concerns; +namespace ImageKit\Core\Conversion\Concerns; -use Imagekit\Core\Conversion; -use Imagekit\Core\Conversion\CoerceState; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Core\Conversion\DumpState; +use ImageKit\Core\Conversion; +use ImageKit\Core\Conversion\CoerceState; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\DumpState; /** * @internal diff --git a/src/Core/Conversion/Contracts/Converter.php b/src/Core/Conversion/Contracts/Converter.php index f03a3f0d..dadf46de 100644 --- a/src/Core/Conversion/Contracts/Converter.php +++ b/src/Core/Conversion/Contracts/Converter.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Imagekit\Core\Conversion\Contracts; +namespace ImageKit\Core\Conversion\Contracts; -use Imagekit\Core\Conversion\CoerceState; -use Imagekit\Core\Conversion\DumpState; +use ImageKit\Core\Conversion\CoerceState; +use ImageKit\Core\Conversion\DumpState; /** * @internal diff --git a/src/Core/Conversion/Contracts/ConverterSource.php b/src/Core/Conversion/Contracts/ConverterSource.php index 0b41f2ab..f21b477b 100644 --- a/src/Core/Conversion/Contracts/ConverterSource.php +++ b/src/Core/Conversion/Contracts/ConverterSource.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Core\Conversion\Contracts; +namespace ImageKit\Core\Conversion\Contracts; /** * @internal diff --git a/src/Core/Conversion/DumpState.php b/src/Core/Conversion/DumpState.php index 904887f2..44926759 100644 --- a/src/Core/Conversion/DumpState.php +++ b/src/Core/Conversion/DumpState.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Core\Conversion; +namespace ImageKit\Core\Conversion; /** * @internal diff --git a/src/Core/Conversion/EnumOf.php b/src/Core/Conversion/EnumOf.php index d7b15d24..44eb32fc 100644 --- a/src/Core/Conversion/EnumOf.php +++ b/src/Core/Conversion/EnumOf.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Imagekit\Core\Conversion; +namespace ImageKit\Core\Conversion; -use Imagekit\Core\Conversion; -use Imagekit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion; +use ImageKit\Core\Conversion\Contracts\Converter; /** * @internal diff --git a/src/Core/Conversion/ListOf.php b/src/Core/Conversion/ListOf.php index 2caad9a6..31a262e6 100644 --- a/src/Core/Conversion/ListOf.php +++ b/src/Core/Conversion/ListOf.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Imagekit\Core\Conversion; +namespace ImageKit\Core\Conversion; -use Imagekit\Core\Conversion\Concerns\ArrayOf; -use Imagekit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Concerns\ArrayOf; +use ImageKit\Core\Conversion\Contracts\Converter; /** * @internal diff --git a/src/Core/Conversion/MapOf.php b/src/Core/Conversion/MapOf.php index 5bfef272..42c34b57 100644 --- a/src/Core/Conversion/MapOf.php +++ b/src/Core/Conversion/MapOf.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Imagekit\Core\Conversion; +namespace ImageKit\Core\Conversion; -use Imagekit\Core\Conversion\Concerns\ArrayOf; -use Imagekit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Concerns\ArrayOf; +use ImageKit\Core\Conversion\Contracts\Converter; /** * @internal diff --git a/src/Core/Conversion/ModelOf.php b/src/Core/Conversion/ModelOf.php index 713a803a..fe73e1f2 100644 --- a/src/Core/Conversion/ModelOf.php +++ b/src/Core/Conversion/ModelOf.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace Imagekit\Core\Conversion; +namespace ImageKit\Core\Conversion; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion; -use Imagekit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion; +use ImageKit\Core\Conversion\Contracts\Converter; /** * @internal diff --git a/src/Core/Conversion/PropertyInfo.php b/src/Core/Conversion/PropertyInfo.php index 0017d339..0cebd935 100644 --- a/src/Core/Conversion/PropertyInfo.php +++ b/src/Core/Conversion/PropertyInfo.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Core\Conversion; +namespace ImageKit\Core\Conversion; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @internal diff --git a/src/Core/Conversion/UnionOf.php b/src/Core/Conversion/UnionOf.php index d6709f35..181643c8 100644 --- a/src/Core/Conversion/UnionOf.php +++ b/src/Core/Conversion/UnionOf.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Core\Conversion; +namespace ImageKit\Core\Conversion; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\Conversion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\Conversion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @internal diff --git a/src/Core/Exceptions/APIConnectionException.php b/src/Core/Exceptions/APIConnectionException.php index 849139cc..c897edb5 100644 --- a/src/Core/Exceptions/APIConnectionException.php +++ b/src/Core/Exceptions/APIConnectionException.php @@ -1,9 +1,9 @@ , diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php index 30deb45b..16fb1365 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit\CustomMetadataFields\CustomMetadataField\Schema; +namespace ImageKit\CustomMetadataFields\CustomMetadataField\Schema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Core\Conversion\ListOf; -use Imagekit\CustomMetadataFields\CustomMetadataField\Schema\DefaultValue\Mixed_; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\ListOf; +use ImageKit\CustomMetadataFields\CustomMetadataField\Schema\DefaultValue\Mixed_; /** * The default value for this custom metadata field. Data type of default value depends on the field type. * - * @phpstan-import-type MixedShape from \Imagekit\CustomMetadataFields\CustomMetadataField\Schema\DefaultValue\Mixed_ + * @phpstan-import-type MixedShape from \ImageKit\CustomMetadataFields\CustomMetadataField\Schema\DefaultValue\Mixed_ * * @phpstan-type DefaultValueVariants = string|float|bool|list * @phpstan-type DefaultValueShape = DefaultValueVariants|list diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed_.php b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed_.php index 72295b59..eb6905b8 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed_.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/DefaultValue/Mixed_.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\CustomMetadataFields\CustomMetadataField\Schema\DefaultValue; +namespace ImageKit\CustomMetadataFields\CustomMetadataField\Schema\DefaultValue; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @phpstan-type MixedVariants = string|float|bool diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/MaxValue.php b/src/CustomMetadataFields/CustomMetadataField/Schema/MaxValue.php index 54e02e2c..19073221 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/MaxValue.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/MaxValue.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\CustomMetadataFields\CustomMetadataField\Schema; +namespace ImageKit\CustomMetadataFields\CustomMetadataField\Schema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/MinValue.php b/src/CustomMetadataFields/CustomMetadataField/Schema/MinValue.php index 5092fa45..cf627712 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/MinValue.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/MinValue.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\CustomMetadataFields\CustomMetadataField\Schema; +namespace ImageKit\CustomMetadataFields\CustomMetadataField\Schema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/SelectOption.php b/src/CustomMetadataFields/CustomMetadataField/Schema/SelectOption.php index 6f518130..501e46fd 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/SelectOption.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/SelectOption.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\CustomMetadataFields\CustomMetadataField\Schema; +namespace ImageKit\CustomMetadataFields\CustomMetadataField\Schema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @phpstan-type SelectOptionVariants = string|float|bool diff --git a/src/CustomMetadataFields/CustomMetadataField/Schema/Type.php b/src/CustomMetadataFields/CustomMetadataField/Schema/Type.php index e67d3e4c..3c5e1691 100644 --- a/src/CustomMetadataFields/CustomMetadataField/Schema/Type.php +++ b/src/CustomMetadataFields/CustomMetadataField/Schema/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\CustomMetadataFields\CustomMetadataField\Schema; +namespace ImageKit\CustomMetadataFields\CustomMetadataField\Schema; /** * Type of the custom metadata field. diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php index 12cf2a09..69142ad6 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams.php @@ -2,20 +2,20 @@ declare(strict_types=1); -namespace Imagekit\CustomMetadataFields; +namespace ImageKit\CustomMetadataFields; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; /** * This API creates a new custom metadata field. Once a custom metadata field is created either through this API or using the dashboard UI, its value can be set on the assets. The value of a field for an asset can be set using the media library UI or programmatically through upload or update assets API. * - * @see Imagekit\Services\CustomMetadataFieldsService::create() + * @see ImageKit\Services\CustomMetadataFieldsService::create() * - * @phpstan-import-type SchemaShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema + * @phpstan-import-type SchemaShape from \ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema * * @phpstan-type CustomMetadataFieldCreateParamsShape = array{ * label: string, name: string, schema: Schema|SchemaShape diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php index bbb64d6c..0e699657 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema.php @@ -2,25 +2,25 @@ declare(strict_types=1); -namespace Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams; +namespace ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\DefaultValue; -use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\SelectOption; -use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\Type; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\DefaultValue; +use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\SelectOption; +use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\Type; /** - * @phpstan-import-type DefaultValueVariants from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\DefaultValue - * @phpstan-import-type MaxValueVariants from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\MaxValue - * @phpstan-import-type MinValueVariants from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\MinValue - * @phpstan-import-type SelectOptionVariants from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\SelectOption - * @phpstan-import-type DefaultValueShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\DefaultValue - * @phpstan-import-type MaxValueShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\MaxValue - * @phpstan-import-type MinValueShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\MinValue - * @phpstan-import-type SelectOptionShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\SelectOption + * @phpstan-import-type DefaultValueVariants from \ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\DefaultValue + * @phpstan-import-type MaxValueVariants from \ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\MaxValue + * @phpstan-import-type MinValueVariants from \ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\MinValue + * @phpstan-import-type SelectOptionVariants from \ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\SelectOption + * @phpstan-import-type DefaultValueShape from \ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\DefaultValue + * @phpstan-import-type MaxValueShape from \ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\MaxValue + * @phpstan-import-type MinValueShape from \ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\MinValue + * @phpstan-import-type SelectOptionShape from \ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\SelectOption * * @phpstan-type SchemaShape = array{ * type: Type|value-of, diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php index 0f1310b5..783cbc57 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; +namespace ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Core\Conversion\ListOf; -use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\DefaultValue\Mixed_; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\ListOf; +use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\DefaultValue\Mixed_; /** * The default value for this custom metadata field. This property is only required if `isValueRequired` property is set to `true`. The value should match the `type` of custom metadata field. * - * @phpstan-import-type MixedShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\DefaultValue\Mixed_ + * @phpstan-import-type MixedShape from \ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\DefaultValue\Mixed_ * * @phpstan-type DefaultValueVariants = string|float|bool|list * @phpstan-type DefaultValueShape = DefaultValueVariants|list diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed_.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed_.php index 6d480919..5f579928 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed_.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/DefaultValue/Mixed_.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\DefaultValue; +namespace ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema\DefaultValue; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @phpstan-type MixedVariants = string|float|bool diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MaxValue.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MaxValue.php index a3d9cd53..7f76b4a1 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MaxValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MaxValue.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; +namespace ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Maximum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MinValue.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MinValue.php index 5bec82f3..81ec0a2f 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MinValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/MinValue.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; +namespace ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Minimum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/SelectOption.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/SelectOption.php index ecdfcbec..792afdb4 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/SelectOption.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/SelectOption.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; +namespace ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @phpstan-type SelectOptionVariants = string|float|bool diff --git a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/Type.php b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/Type.php index 1e7d0fc0..9918b486 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/Type.php +++ b/src/CustomMetadataFields/CustomMetadataFieldCreateParams/Schema/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; +namespace ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; /** * Type of the custom metadata field. diff --git a/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php b/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php index 18c7f55e..c8ccad78 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php +++ b/src/CustomMetadataFields/CustomMetadataFieldDeleteResponse.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Imagekit\CustomMetadataFields; +namespace ImageKit\CustomMetadataFields; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type CustomMetadataFieldDeleteResponseShape = array diff --git a/src/CustomMetadataFields/CustomMetadataFieldListParams.php b/src/CustomMetadataFields/CustomMetadataFieldListParams.php index 706d12a0..be00d9be 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldListParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldListParams.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\CustomMetadataFields; +namespace ImageKit\CustomMetadataFields; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; /** * This API returns the array of created custom metadata field objects. By default the API returns only non deleted field objects, but you can include deleted fields in the API response. * * You can also filter results by a specific folder path to retrieve custom metadata fields applicable at that location. This path-specific filtering is useful when using the **Path policy** feature to determine which custom metadata fields are selected for a given path. * - * @see Imagekit\Services\CustomMetadataFieldsService::list() + * @see ImageKit\Services\CustomMetadataFieldsService::list() * * @phpstan-type CustomMetadataFieldListParamsShape = array{ * folderPath?: string|null, includeDeleted?: bool|null diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php index dde5fa2e..a653f397 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php @@ -2,20 +2,20 @@ declare(strict_types=1); -namespace Imagekit\CustomMetadataFields; +namespace ImageKit\CustomMetadataFields; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema; /** * This API updates the label or schema of an existing custom metadata field. * - * @see Imagekit\Services\CustomMetadataFieldsService::update() + * @see ImageKit\Services\CustomMetadataFieldsService::update() * - * @phpstan-import-type SchemaShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema + * @phpstan-import-type SchemaShape from \ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema * * @phpstan-type CustomMetadataFieldUpdateParamsShape = array{ * label?: string|null, schema?: null|Schema|SchemaShape diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php index b1137839..c8c84f9c 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema.php @@ -2,25 +2,25 @@ declare(strict_types=1); -namespace Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams; +namespace ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue; -use Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\SelectOption; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue; +use ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\SelectOption; /** * An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. * - * @phpstan-import-type DefaultValueVariants from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue - * @phpstan-import-type MaxValueVariants from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\MaxValue - * @phpstan-import-type MinValueVariants from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\MinValue - * @phpstan-import-type SelectOptionVariants from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\SelectOption - * @phpstan-import-type DefaultValueShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue - * @phpstan-import-type MaxValueShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\MaxValue - * @phpstan-import-type MinValueShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\MinValue - * @phpstan-import-type SelectOptionShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\SelectOption + * @phpstan-import-type DefaultValueVariants from \ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue + * @phpstan-import-type MaxValueVariants from \ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\MaxValue + * @phpstan-import-type MinValueVariants from \ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\MinValue + * @phpstan-import-type SelectOptionVariants from \ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\SelectOption + * @phpstan-import-type DefaultValueShape from \ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue + * @phpstan-import-type MaxValueShape from \ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\MaxValue + * @phpstan-import-type MinValueShape from \ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\MinValue + * @phpstan-import-type SelectOptionShape from \ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\SelectOption * * @phpstan-type SchemaShape = array{ * defaultValue?: DefaultValueShape|null, diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php index b294d3ef..41b9726c 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema; +namespace ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Core\Conversion\ListOf; -use Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue\Mixed_; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\ListOf; +use ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue\Mixed_; /** * The default value for this custom metadata field. This property is only required if `isValueRequired` property is set to `true`. The value should match the `type` of custom metadata field. * - * @phpstan-import-type MixedShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue\Mixed_ + * @phpstan-import-type MixedShape from \ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue\Mixed_ * * @phpstan-type DefaultValueVariants = string|float|bool|list * @phpstan-type DefaultValueShape = DefaultValueVariants|list diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed_.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed_.php index 197bd44e..28e55b44 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed_.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/DefaultValue/Mixed_.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue; +namespace ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema\DefaultValue; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @phpstan-type MixedVariants = string|float|bool diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MaxValue.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MaxValue.php index 2bfd164c..194f409b 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MaxValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MaxValue.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema; +namespace ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Maximum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MinValue.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MinValue.php index 17b266ea..b3552c30 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MinValue.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/MinValue.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema; +namespace ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Minimum value of the field. Only set this property if field type is `Date` or `Number`. For `Date` type field, set the minimum date in ISO8601 string format. For `Number` type field, set the minimum numeric value. diff --git a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/SelectOption.php b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/SelectOption.php index a54d7a04..8153af9c 100644 --- a/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/SelectOption.php +++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams/Schema/SelectOption.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema; +namespace ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @phpstan-type SelectOptionVariants = string|float|bool diff --git a/src/ExtensionConfig.php b/src/ExtensionConfig.php index 962a6f97..bb6698d1 100644 --- a/src/ExtensionConfig.php +++ b/src/ExtensionConfig.php @@ -2,23 +2,23 @@ declare(strict_types=1); -namespace Imagekit; +namespace ImageKit; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\ExtensionConfig\AITasksExtension; -use Imagekit\ExtensionConfig\AutoDescriptionExtension; -use Imagekit\ExtensionConfig\AutoTaggingExtension; -use Imagekit\ExtensionConfig\RemovedotBgExtension; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\ExtensionConfig\AITasksExtension; +use ImageKit\ExtensionConfig\AutoDescriptionExtension; +use ImageKit\ExtensionConfig\AutoTaggingExtension; +use ImageKit\ExtensionConfig\RemovedotBgExtension; /** * Configuration object for an extension (base extensions only, not saved extension references). * - * @phpstan-import-type RemovedotBgExtensionShape from \Imagekit\ExtensionConfig\RemovedotBgExtension - * @phpstan-import-type AutoTaggingExtensionShape from \Imagekit\ExtensionConfig\AutoTaggingExtension - * @phpstan-import-type AutoDescriptionExtensionShape from \Imagekit\ExtensionConfig\AutoDescriptionExtension - * @phpstan-import-type AITasksExtensionShape from \Imagekit\ExtensionConfig\AITasksExtension + * @phpstan-import-type RemovedotBgExtensionShape from \ImageKit\ExtensionConfig\RemovedotBgExtension + * @phpstan-import-type AutoTaggingExtensionShape from \ImageKit\ExtensionConfig\AutoTaggingExtension + * @phpstan-import-type AutoDescriptionExtensionShape from \ImageKit\ExtensionConfig\AutoDescriptionExtension + * @phpstan-import-type AITasksExtensionShape from \ImageKit\ExtensionConfig\AITasksExtension * * @phpstan-type ExtensionConfigVariants = RemovedotBgExtension|AutoTaggingExtension|AutoDescriptionExtension|AITasksExtension * @phpstan-type ExtensionConfigShape = ExtensionConfigVariants|RemovedotBgExtensionShape|AutoTaggingExtensionShape|AutoDescriptionExtensionShape|AITasksExtensionShape diff --git a/src/ExtensionConfig/AITasksExtension.php b/src/ExtensionConfig/AITasksExtension.php index 5a808c61..dc838b5d 100644 --- a/src/ExtensionConfig/AITasksExtension.php +++ b/src/ExtensionConfig/AITasksExtension.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig; +namespace ImageKit\ExtensionConfig; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionConfig\AITasksExtension\Task; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionConfig\AITasksExtension\Task; /** - * @phpstan-import-type TaskVariants from \Imagekit\ExtensionConfig\AITasksExtension\Task - * @phpstan-import-type TaskShape from \Imagekit\ExtensionConfig\AITasksExtension\Task + * @phpstan-import-type TaskVariants from \ImageKit\ExtensionConfig\AITasksExtension\Task + * @phpstan-import-type TaskShape from \ImageKit\ExtensionConfig\AITasksExtension\Task * * @phpstan-type AITasksExtensionShape = array{ * name: 'ai-tasks', tasks: list diff --git a/src/ExtensionConfig/AITasksExtension/Task.php b/src/ExtensionConfig/AITasksExtension/Task.php index ff5cf9dc..e7c7c4ac 100644 --- a/src/ExtensionConfig/AITasksExtension/Task.php +++ b/src/ExtensionConfig/AITasksExtension/Task.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig\AITasksExtension; +namespace ImageKit\ExtensionConfig\AITasksExtension; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskSelectMetadata; -use Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskSelectTags; -use Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskSelectMetadata; +use ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskSelectTags; +use ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo; /** - * @phpstan-import-type AITaskSelectTagsShape from \Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskSelectTags - * @phpstan-import-type AITaskSelectMetadataShape from \Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskSelectMetadata - * @phpstan-import-type AITaskYesNoShape from \Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo + * @phpstan-import-type AITaskSelectTagsShape from \ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskSelectTags + * @phpstan-import-type AITaskSelectMetadataShape from \ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskSelectMetadata + * @phpstan-import-type AITaskYesNoShape from \ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo * * @phpstan-type TaskVariants = AITaskSelectTags|AITaskSelectMetadata|AITaskYesNo * @phpstan-type TaskShape = TaskVariants|AITaskSelectTagsShape|AITaskSelectMetadataShape|AITaskYesNoShape diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata.php index a5962d70..deb722bb 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig\AITasksExtension\Task; +namespace ImageKit\ExtensionConfig\AITasksExtension\Task; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskSelectMetadata\Vocabulary; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskSelectMetadata\Vocabulary; /** - * @phpstan-import-type VocabularyVariants from \Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskSelectMetadata\Vocabulary - * @phpstan-import-type VocabularyShape from \Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskSelectMetadata\Vocabulary + * @phpstan-import-type VocabularyVariants from \ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskSelectMetadata\Vocabulary + * @phpstan-import-type VocabularyShape from \ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskSelectMetadata\Vocabulary * * @phpstan-type AITaskSelectMetadataShape = array{ * field: string, diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata/Vocabulary.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata/Vocabulary.php index 539a0d96..87ba89b9 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata/Vocabulary.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectMetadata/Vocabulary.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskSelectMetadata; +namespace ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskSelectMetadata; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @phpstan-type VocabularyVariants = string|float|bool diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php index 862dba1a..63099b66 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskSelectTags.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig\AITasksExtension\Task; +namespace ImageKit\ExtensionConfig\AITasksExtension\Task; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type AITaskSelectTagsShape = array{ diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo.php index 75d68bdd..f5bdebf3 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo.php @@ -2,20 +2,20 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig\AITasksExtension\Task; +namespace ImageKit\ExtensionConfig\AITasksExtension\Task; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo; -use Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown; -use Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo; +use ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown; +use ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes; /** - * @phpstan-import-type OnNoShape from \Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo - * @phpstan-import-type OnUnknownShape from \Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown - * @phpstan-import-type OnYesShape from \Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes + * @phpstan-import-type OnNoShape from \ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo + * @phpstan-import-type OnUnknownShape from \ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown + * @phpstan-import-type OnYesShape from \ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes * * @phpstan-type AITaskYesNoShape = array{ * instruction: string, diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo.php index 0d23c60e..f2795843 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo; +namespace ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata; -use Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo\UnsetMetadata; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata; +use ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo\UnsetMetadata; /** * Actions to execute if the AI answers no. * - * @phpstan-import-type SetMetadataShape from \Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata - * @phpstan-import-type UnsetMetadataShape from \Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo\UnsetMetadata + * @phpstan-import-type SetMetadataShape from \ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata + * @phpstan-import-type UnsetMetadataShape from \ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo\UnsetMetadata * * @phpstan-type OnNoShape = array{ * addTags?: list|null, diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata.php index d9f94992..ed5a1488 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo; +namespace ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata\Value; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata\Value; /** - * @phpstan-import-type ValueVariants from \Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata\Value - * @phpstan-import-type ValueShape from \Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata\Value + * @phpstan-import-type ValueVariants from \ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata\Value + * @phpstan-import-type ValueShape from \ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata\Value * * @phpstan-type SetMetadataShape = array{field: string, value: ValueShape} */ diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value.php index d675dc7a..7572a321 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata; +namespace ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Core\Conversion\ListOf; -use Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata\Value\Mixed_; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\ListOf; +use ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata\Value\Mixed_; /** * Value to set for the custom metadata field. The value type should match the custom metadata field type. * - * @phpstan-import-type MixedShape from \Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata\Value\Mixed_ + * @phpstan-import-type MixedShape from \ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata\Value\Mixed_ * * @phpstan-type ValueVariants = string|float|bool|list * @phpstan-type ValueShape = ValueVariants|list diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value/Mixed_.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value/Mixed_.php index ad001d4e..f35eb7bb 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value/Mixed_.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value/Mixed_.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata\Value; +namespace ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata\Value; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @phpstan-type MixedVariants = string|float|bool diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/UnsetMetadata.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/UnsetMetadata.php index cef7e924..d516ece7 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/UnsetMetadata.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnNo/UnsetMetadata.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo; +namespace ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnNo; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type UnsetMetadataShape = array{field: string} diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown.php index 609552bf..f18bfb9b 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo; +namespace ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata; -use Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown\UnsetMetadata; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata; +use ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown\UnsetMetadata; /** * Actions to execute if the AI cannot determine the answer. * - * @phpstan-import-type SetMetadataShape from \Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata - * @phpstan-import-type UnsetMetadataShape from \Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown\UnsetMetadata + * @phpstan-import-type SetMetadataShape from \ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata + * @phpstan-import-type UnsetMetadataShape from \ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown\UnsetMetadata * * @phpstan-type OnUnknownShape = array{ * addTags?: list|null, diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata.php index 6f4df422..66db67ec 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown; +namespace ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata\Value; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata\Value; /** - * @phpstan-import-type ValueVariants from \Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata\Value - * @phpstan-import-type ValueShape from \Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata\Value + * @phpstan-import-type ValueVariants from \ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata\Value + * @phpstan-import-type ValueShape from \ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata\Value * * @phpstan-type SetMetadataShape = array{field: string, value: ValueShape} */ diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value.php index 619ad140..32a48506 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata; +namespace ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Core\Conversion\ListOf; -use Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata\Value\Mixed_; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\ListOf; +use ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata\Value\Mixed_; /** * Value to set for the custom metadata field. The value type should match the custom metadata field type. * - * @phpstan-import-type MixedShape from \Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata\Value\Mixed_ + * @phpstan-import-type MixedShape from \ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata\Value\Mixed_ * * @phpstan-type ValueVariants = string|float|bool|list * @phpstan-type ValueShape = ValueVariants|list diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value/Mixed_.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value/Mixed_.php index 6df05fea..f6f779fe 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value/Mixed_.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value/Mixed_.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata\Value; +namespace ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata\Value; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @phpstan-type MixedVariants = string|float|bool diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/UnsetMetadata.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/UnsetMetadata.php index 82f06e46..aefe5155 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/UnsetMetadata.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnUnknown/UnsetMetadata.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown; +namespace ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnUnknown; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type UnsetMetadataShape = array{field: string} diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes.php index 63a20a37..ee5a6e49 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo; +namespace ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata; -use Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes\UnsetMetadata; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata; +use ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes\UnsetMetadata; /** * Actions to execute if the AI answers yes. * - * @phpstan-import-type SetMetadataShape from \Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata - * @phpstan-import-type UnsetMetadataShape from \Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes\UnsetMetadata + * @phpstan-import-type SetMetadataShape from \ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata + * @phpstan-import-type UnsetMetadataShape from \ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes\UnsetMetadata * * @phpstan-type OnYesShape = array{ * addTags?: list|null, diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata.php index 5cb7196b..187dffac 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes; +namespace ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata\Value; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata\Value; /** - * @phpstan-import-type ValueVariants from \Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata\Value - * @phpstan-import-type ValueShape from \Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata\Value + * @phpstan-import-type ValueVariants from \ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata\Value + * @phpstan-import-type ValueShape from \ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata\Value * * @phpstan-type SetMetadataShape = array{field: string, value: ValueShape} */ diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value.php index 2b20098f..727626b6 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata; +namespace ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Core\Conversion\ListOf; -use Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata\Value\Mixed_; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\ListOf; +use ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata\Value\Mixed_; /** * Value to set for the custom metadata field. The value type should match the custom metadata field type. * - * @phpstan-import-type MixedShape from \Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata\Value\Mixed_ + * @phpstan-import-type MixedShape from \ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata\Value\Mixed_ * * @phpstan-type ValueVariants = string|float|bool|list * @phpstan-type ValueShape = ValueVariants|list diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value/Mixed_.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value/Mixed_.php index b462627f..f5d43583 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value/Mixed_.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value/Mixed_.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata\Value; +namespace ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata\Value; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @phpstan-type MixedVariants = string|float|bool diff --git a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/UnsetMetadata.php b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/UnsetMetadata.php index 09a6a90f..13828e0a 100644 --- a/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/UnsetMetadata.php +++ b/src/ExtensionConfig/AITasksExtension/Task/AITaskYesNo/OnYes/UnsetMetadata.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes; +namespace ImageKit\ExtensionConfig\AITasksExtension\Task\AITaskYesNo\OnYes; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type UnsetMetadataShape = array{field: string} diff --git a/src/ExtensionConfig/AutoDescriptionExtension.php b/src/ExtensionConfig/AutoDescriptionExtension.php index bf2c9937..7cecf12f 100644 --- a/src/ExtensionConfig/AutoDescriptionExtension.php +++ b/src/ExtensionConfig/AutoDescriptionExtension.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig; +namespace ImageKit\ExtensionConfig; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type AutoDescriptionExtensionShape = array{name: 'ai-auto-description'} diff --git a/src/ExtensionConfig/AutoTaggingExtension.php b/src/ExtensionConfig/AutoTaggingExtension.php index 93226423..a3f76b70 100644 --- a/src/ExtensionConfig/AutoTaggingExtension.php +++ b/src/ExtensionConfig/AutoTaggingExtension.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig; +namespace ImageKit\ExtensionConfig; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionConfig\AutoTaggingExtension\Name; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionConfig\AutoTaggingExtension\Name; /** * @phpstan-type AutoTaggingExtensionShape = array{ diff --git a/src/ExtensionConfig/AutoTaggingExtension/Name.php b/src/ExtensionConfig/AutoTaggingExtension/Name.php index 688cb35f..30463fb2 100644 --- a/src/ExtensionConfig/AutoTaggingExtension/Name.php +++ b/src/ExtensionConfig/AutoTaggingExtension/Name.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig\AutoTaggingExtension; +namespace ImageKit\ExtensionConfig\AutoTaggingExtension; /** * Specifies the auto-tagging extension used. diff --git a/src/ExtensionConfig/RemovedotBgExtension.php b/src/ExtensionConfig/RemovedotBgExtension.php index bc23307b..2277d0e4 100644 --- a/src/ExtensionConfig/RemovedotBgExtension.php +++ b/src/ExtensionConfig/RemovedotBgExtension.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig; +namespace ImageKit\ExtensionConfig; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionConfig\RemovedotBgExtension\Options; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionConfig\RemovedotBgExtension\Options; /** - * @phpstan-import-type OptionsShape from \Imagekit\ExtensionConfig\RemovedotBgExtension\Options + * @phpstan-import-type OptionsShape from \ImageKit\ExtensionConfig\RemovedotBgExtension\Options * * @phpstan-type RemovedotBgExtensionShape = array{ * name: 'remove-bg', options?: null|Options|OptionsShape diff --git a/src/ExtensionConfig/RemovedotBgExtension/Options.php b/src/ExtensionConfig/RemovedotBgExtension/Options.php index b5a9e808..031a1f2a 100644 --- a/src/ExtensionConfig/RemovedotBgExtension/Options.php +++ b/src/ExtensionConfig/RemovedotBgExtension/Options.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\ExtensionConfig\RemovedotBgExtension; +namespace ImageKit\ExtensionConfig\RemovedotBgExtension; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type OptionsShape = array{ diff --git a/src/ExtensionItem.php b/src/ExtensionItem.php index 6c538fdb..16d96692 100644 --- a/src/ExtensionItem.php +++ b/src/ExtensionItem.php @@ -2,23 +2,23 @@ declare(strict_types=1); -namespace Imagekit; +namespace ImageKit; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\ExtensionItem\AITasksExtension; -use Imagekit\ExtensionItem\AutoDescriptionExtension; -use Imagekit\ExtensionItem\AutoTaggingExtension; -use Imagekit\ExtensionItem\RemovedotBgExtension; -use Imagekit\ExtensionItem\SavedExtensionReference; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\ExtensionItem\AITasksExtension; +use ImageKit\ExtensionItem\AutoDescriptionExtension; +use ImageKit\ExtensionItem\AutoTaggingExtension; +use ImageKit\ExtensionItem\RemovedotBgExtension; +use ImageKit\ExtensionItem\SavedExtensionReference; /** - * @phpstan-import-type RemovedotBgExtensionShape from \Imagekit\ExtensionItem\RemovedotBgExtension - * @phpstan-import-type AutoTaggingExtensionShape from \Imagekit\ExtensionItem\AutoTaggingExtension - * @phpstan-import-type AutoDescriptionExtensionShape from \Imagekit\ExtensionItem\AutoDescriptionExtension - * @phpstan-import-type AITasksExtensionShape from \Imagekit\ExtensionItem\AITasksExtension - * @phpstan-import-type SavedExtensionReferenceShape from \Imagekit\ExtensionItem\SavedExtensionReference + * @phpstan-import-type RemovedotBgExtensionShape from \ImageKit\ExtensionItem\RemovedotBgExtension + * @phpstan-import-type AutoTaggingExtensionShape from \ImageKit\ExtensionItem\AutoTaggingExtension + * @phpstan-import-type AutoDescriptionExtensionShape from \ImageKit\ExtensionItem\AutoDescriptionExtension + * @phpstan-import-type AITasksExtensionShape from \ImageKit\ExtensionItem\AITasksExtension + * @phpstan-import-type SavedExtensionReferenceShape from \ImageKit\ExtensionItem\SavedExtensionReference * * @phpstan-type ExtensionItemVariants = RemovedotBgExtension|AutoTaggingExtension|AutoDescriptionExtension|AITasksExtension|SavedExtensionReference * @phpstan-type ExtensionItemShape = ExtensionItemVariants|RemovedotBgExtensionShape|AutoTaggingExtensionShape|AutoDescriptionExtensionShape|AITasksExtensionShape|SavedExtensionReferenceShape diff --git a/src/ExtensionItem/AITasksExtension.php b/src/ExtensionItem/AITasksExtension.php index abcbf473..17d7e397 100644 --- a/src/ExtensionItem/AITasksExtension.php +++ b/src/ExtensionItem/AITasksExtension.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem; +namespace ImageKit\ExtensionItem; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionItem\AITasksExtension\Task; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionItem\AITasksExtension\Task; /** - * @phpstan-import-type TaskVariants from \Imagekit\ExtensionItem\AITasksExtension\Task - * @phpstan-import-type TaskShape from \Imagekit\ExtensionItem\AITasksExtension\Task + * @phpstan-import-type TaskVariants from \ImageKit\ExtensionItem\AITasksExtension\Task + * @phpstan-import-type TaskShape from \ImageKit\ExtensionItem\AITasksExtension\Task * * @phpstan-type AITasksExtensionShape = array{ * name: 'ai-tasks', tasks: list diff --git a/src/ExtensionItem/AITasksExtension/Task.php b/src/ExtensionItem/AITasksExtension/Task.php index 8bc4b169..bab2348c 100644 --- a/src/ExtensionItem/AITasksExtension/Task.php +++ b/src/ExtensionItem/AITasksExtension/Task.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem\AITasksExtension; +namespace ImageKit\ExtensionItem\AITasksExtension; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\ExtensionItem\AITasksExtension\Task\AITaskSelectMetadata; -use Imagekit\ExtensionItem\AITasksExtension\Task\AITaskSelectTags; -use Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\ExtensionItem\AITasksExtension\Task\AITaskSelectMetadata; +use ImageKit\ExtensionItem\AITasksExtension\Task\AITaskSelectTags; +use ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo; /** - * @phpstan-import-type AITaskSelectTagsShape from \Imagekit\ExtensionItem\AITasksExtension\Task\AITaskSelectTags - * @phpstan-import-type AITaskSelectMetadataShape from \Imagekit\ExtensionItem\AITasksExtension\Task\AITaskSelectMetadata - * @phpstan-import-type AITaskYesNoShape from \Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo + * @phpstan-import-type AITaskSelectTagsShape from \ImageKit\ExtensionItem\AITasksExtension\Task\AITaskSelectTags + * @phpstan-import-type AITaskSelectMetadataShape from \ImageKit\ExtensionItem\AITasksExtension\Task\AITaskSelectMetadata + * @phpstan-import-type AITaskYesNoShape from \ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo * * @phpstan-type TaskVariants = AITaskSelectTags|AITaskSelectMetadata|AITaskYesNo * @phpstan-type TaskShape = TaskVariants|AITaskSelectTagsShape|AITaskSelectMetadataShape|AITaskYesNoShape diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata.php b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata.php index 20e502cd..156edeff 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem\AITasksExtension\Task; +namespace ImageKit\ExtensionItem\AITasksExtension\Task; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionItem\AITasksExtension\Task\AITaskSelectMetadata\Vocabulary; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionItem\AITasksExtension\Task\AITaskSelectMetadata\Vocabulary; /** - * @phpstan-import-type VocabularyVariants from \Imagekit\ExtensionItem\AITasksExtension\Task\AITaskSelectMetadata\Vocabulary - * @phpstan-import-type VocabularyShape from \Imagekit\ExtensionItem\AITasksExtension\Task\AITaskSelectMetadata\Vocabulary + * @phpstan-import-type VocabularyVariants from \ImageKit\ExtensionItem\AITasksExtension\Task\AITaskSelectMetadata\Vocabulary + * @phpstan-import-type VocabularyShape from \ImageKit\ExtensionItem\AITasksExtension\Task\AITaskSelectMetadata\Vocabulary * * @phpstan-type AITaskSelectMetadataShape = array{ * field: string, diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata/Vocabulary.php b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata/Vocabulary.php index 74737a8a..96fd064f 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata/Vocabulary.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectMetadata/Vocabulary.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem\AITasksExtension\Task\AITaskSelectMetadata; +namespace ImageKit\ExtensionItem\AITasksExtension\Task\AITaskSelectMetadata; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @phpstan-type VocabularyVariants = string|float|bool diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php index 76a33c43..94f379c0 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskSelectTags.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem\AITasksExtension\Task; +namespace ImageKit\ExtensionItem\AITasksExtension\Task; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type AITaskSelectTagsShape = array{ diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo.php index c095ef0e..eab84588 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo.php @@ -2,20 +2,20 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem\AITasksExtension\Task; +namespace ImageKit\ExtensionItem\AITasksExtension\Task; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo; -use Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown; -use Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo; +use ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown; +use ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes; /** - * @phpstan-import-type OnNoShape from \Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo - * @phpstan-import-type OnUnknownShape from \Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown - * @phpstan-import-type OnYesShape from \Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes + * @phpstan-import-type OnNoShape from \ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo + * @phpstan-import-type OnUnknownShape from \ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown + * @phpstan-import-type OnYesShape from \ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes * * @phpstan-type AITaskYesNoShape = array{ * instruction: string, diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo.php index eab59743..60a99c77 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo; +namespace ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata; -use Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo\UnsetMetadata; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata; +use ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo\UnsetMetadata; /** * Actions to execute if the AI answers no. * - * @phpstan-import-type SetMetadataShape from \Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata - * @phpstan-import-type UnsetMetadataShape from \Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo\UnsetMetadata + * @phpstan-import-type SetMetadataShape from \ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata + * @phpstan-import-type UnsetMetadataShape from \ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo\UnsetMetadata * * @phpstan-type OnNoShape = array{ * addTags?: list|null, diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata.php index d95c47fc..734a59c4 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo; +namespace ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata\Value; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata\Value; /** - * @phpstan-import-type ValueVariants from \Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata\Value - * @phpstan-import-type ValueShape from \Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata\Value + * @phpstan-import-type ValueVariants from \ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata\Value + * @phpstan-import-type ValueShape from \ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata\Value * * @phpstan-type SetMetadataShape = array{field: string, value: ValueShape} */ diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value.php index 6c6adb76..d93e6313 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata; +namespace ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Core\Conversion\ListOf; -use Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata\Value\Mixed_; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\ListOf; +use ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata\Value\Mixed_; /** * Value to set for the custom metadata field. The value type should match the custom metadata field type. * - * @phpstan-import-type MixedShape from \Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata\Value\Mixed_ + * @phpstan-import-type MixedShape from \ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata\Value\Mixed_ * * @phpstan-type ValueVariants = string|float|bool|list * @phpstan-type ValueShape = ValueVariants|list diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value/Mixed_.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value/Mixed_.php index 5620cc2b..34892471 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value/Mixed_.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/SetMetadata/Value/Mixed_.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata\Value; +namespace ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo\SetMetadata\Value; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @phpstan-type MixedVariants = string|float|bool diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/UnsetMetadata.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/UnsetMetadata.php index 91198047..9cb0b711 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/UnsetMetadata.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnNo/UnsetMetadata.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo; +namespace ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnNo; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type UnsetMetadataShape = array{field: string} diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown.php index 82a274a6..1d3fcdf6 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo; +namespace ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata; -use Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown\UnsetMetadata; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata; +use ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown\UnsetMetadata; /** * Actions to execute if the AI cannot determine the answer. * - * @phpstan-import-type SetMetadataShape from \Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata - * @phpstan-import-type UnsetMetadataShape from \Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown\UnsetMetadata + * @phpstan-import-type SetMetadataShape from \ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata + * @phpstan-import-type UnsetMetadataShape from \ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown\UnsetMetadata * * @phpstan-type OnUnknownShape = array{ * addTags?: list|null, diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata.php index da15abd5..97a5d086 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown; +namespace ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata\Value; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata\Value; /** - * @phpstan-import-type ValueVariants from \Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata\Value - * @phpstan-import-type ValueShape from \Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata\Value + * @phpstan-import-type ValueVariants from \ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata\Value + * @phpstan-import-type ValueShape from \ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata\Value * * @phpstan-type SetMetadataShape = array{field: string, value: ValueShape} */ diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value.php index 59d525b3..ddb63eb2 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata; +namespace ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Core\Conversion\ListOf; -use Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata\Value\Mixed_; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\ListOf; +use ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata\Value\Mixed_; /** * Value to set for the custom metadata field. The value type should match the custom metadata field type. * - * @phpstan-import-type MixedShape from \Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata\Value\Mixed_ + * @phpstan-import-type MixedShape from \ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata\Value\Mixed_ * * @phpstan-type ValueVariants = string|float|bool|list * @phpstan-type ValueShape = ValueVariants|list diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value/Mixed_.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value/Mixed_.php index 4e5457c1..ad5f8e0f 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value/Mixed_.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/SetMetadata/Value/Mixed_.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata\Value; +namespace ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown\SetMetadata\Value; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @phpstan-type MixedVariants = string|float|bool diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/UnsetMetadata.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/UnsetMetadata.php index 3fe870d9..4e367df9 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/UnsetMetadata.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnUnknown/UnsetMetadata.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown; +namespace ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnUnknown; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type UnsetMetadataShape = array{field: string} diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes.php index e2f9c6c5..f413daca 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo; +namespace ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata; -use Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes\UnsetMetadata; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata; +use ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes\UnsetMetadata; /** * Actions to execute if the AI answers yes. * - * @phpstan-import-type SetMetadataShape from \Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata - * @phpstan-import-type UnsetMetadataShape from \Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes\UnsetMetadata + * @phpstan-import-type SetMetadataShape from \ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata + * @phpstan-import-type UnsetMetadataShape from \ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes\UnsetMetadata * * @phpstan-type OnYesShape = array{ * addTags?: list|null, diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata.php index 80171d37..6d82f7e7 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes; +namespace ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata\Value; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata\Value; /** - * @phpstan-import-type ValueVariants from \Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata\Value - * @phpstan-import-type ValueShape from \Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata\Value + * @phpstan-import-type ValueVariants from \ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata\Value + * @phpstan-import-type ValueShape from \ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata\Value * * @phpstan-type SetMetadataShape = array{field: string, value: ValueShape} */ diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value.php index 808ac5cd..139d6170 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata; +namespace ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Core\Conversion\ListOf; -use Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata\Value\Mixed_; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\ListOf; +use ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata\Value\Mixed_; /** * Value to set for the custom metadata field. The value type should match the custom metadata field type. * - * @phpstan-import-type MixedShape from \Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata\Value\Mixed_ + * @phpstan-import-type MixedShape from \ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata\Value\Mixed_ * * @phpstan-type ValueVariants = string|float|bool|list * @phpstan-type ValueShape = ValueVariants|list diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value/Mixed_.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value/Mixed_.php index 42dd6a8a..4c3e83ea 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value/Mixed_.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/SetMetadata/Value/Mixed_.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata\Value; +namespace ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes\SetMetadata\Value; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @phpstan-type MixedVariants = string|float|bool diff --git a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/UnsetMetadata.php b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/UnsetMetadata.php index c1f5e1de..efbce1ab 100644 --- a/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/UnsetMetadata.php +++ b/src/ExtensionItem/AITasksExtension/Task/AITaskYesNo/OnYes/UnsetMetadata.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes; +namespace ImageKit\ExtensionItem\AITasksExtension\Task\AITaskYesNo\OnYes; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type UnsetMetadataShape = array{field: string} diff --git a/src/ExtensionItem/AutoDescriptionExtension.php b/src/ExtensionItem/AutoDescriptionExtension.php index 4905cf99..18a552f8 100644 --- a/src/ExtensionItem/AutoDescriptionExtension.php +++ b/src/ExtensionItem/AutoDescriptionExtension.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem; +namespace ImageKit\ExtensionItem; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type AutoDescriptionExtensionShape = array{name: 'ai-auto-description'} diff --git a/src/ExtensionItem/AutoTaggingExtension.php b/src/ExtensionItem/AutoTaggingExtension.php index 5351864c..5363463c 100644 --- a/src/ExtensionItem/AutoTaggingExtension.php +++ b/src/ExtensionItem/AutoTaggingExtension.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem; +namespace ImageKit\ExtensionItem; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionItem\AutoTaggingExtension\Name; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionItem\AutoTaggingExtension\Name; /** * @phpstan-type AutoTaggingExtensionShape = array{ diff --git a/src/ExtensionItem/AutoTaggingExtension/Name.php b/src/ExtensionItem/AutoTaggingExtension/Name.php index da677cb5..853dc5ad 100644 --- a/src/ExtensionItem/AutoTaggingExtension/Name.php +++ b/src/ExtensionItem/AutoTaggingExtension/Name.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem\AutoTaggingExtension; +namespace ImageKit\ExtensionItem\AutoTaggingExtension; /** * Specifies the auto-tagging extension used. diff --git a/src/ExtensionItem/RemovedotBgExtension.php b/src/ExtensionItem/RemovedotBgExtension.php index 4913bb31..cc4a1a83 100644 --- a/src/ExtensionItem/RemovedotBgExtension.php +++ b/src/ExtensionItem/RemovedotBgExtension.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem; +namespace ImageKit\ExtensionItem; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionItem\RemovedotBgExtension\Options; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionItem\RemovedotBgExtension\Options; /** - * @phpstan-import-type OptionsShape from \Imagekit\ExtensionItem\RemovedotBgExtension\Options + * @phpstan-import-type OptionsShape from \ImageKit\ExtensionItem\RemovedotBgExtension\Options * * @phpstan-type RemovedotBgExtensionShape = array{ * name: 'remove-bg', options?: null|Options|OptionsShape diff --git a/src/ExtensionItem/RemovedotBgExtension/Options.php b/src/ExtensionItem/RemovedotBgExtension/Options.php index dbb57e4e..7bd2192f 100644 --- a/src/ExtensionItem/RemovedotBgExtension/Options.php +++ b/src/ExtensionItem/RemovedotBgExtension/Options.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem\RemovedotBgExtension; +namespace ImageKit\ExtensionItem\RemovedotBgExtension; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type OptionsShape = array{ diff --git a/src/ExtensionItem/SavedExtensionReference.php b/src/ExtensionItem/SavedExtensionReference.php index 3803028e..2f7da2ef 100644 --- a/src/ExtensionItem/SavedExtensionReference.php +++ b/src/ExtensionItem/SavedExtensionReference.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\ExtensionItem; +namespace ImageKit\ExtensionItem; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type SavedExtensionReferenceShape = array{ diff --git a/src/Files/Bulk/BulkAddTagsParams.php b/src/Files/Bulk/BulkAddTagsParams.php index afb3a686..1eee40f3 100644 --- a/src/Files/Bulk/BulkAddTagsParams.php +++ b/src/Files/Bulk/BulkAddTagsParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Files\Bulk; +namespace ImageKit\Files\Bulk; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; /** * This API adds tags to multiple files in bulk. A maximum of 50 files can be specified at a time. * - * @see Imagekit\Services\Files\BulkService::addTags() + * @see ImageKit\Services\Files\BulkService::addTags() * * @phpstan-type BulkAddTagsParamsShape = array{ * fileIDs: list, tags: list diff --git a/src/Files/Bulk/BulkAddTagsResponse.php b/src/Files/Bulk/BulkAddTagsResponse.php index b59a6216..1c34f22b 100644 --- a/src/Files/Bulk/BulkAddTagsResponse.php +++ b/src/Files/Bulk/BulkAddTagsResponse.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Files\Bulk; +namespace ImageKit\Files\Bulk; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type BulkAddTagsResponseShape = array{ diff --git a/src/Files/Bulk/BulkDeleteParams.php b/src/Files/Bulk/BulkDeleteParams.php index de31521e..2886101e 100644 --- a/src/Files/Bulk/BulkDeleteParams.php +++ b/src/Files/Bulk/BulkDeleteParams.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Files\Bulk; +namespace ImageKit\Files\Bulk; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; /** * This API deletes multiple files and all their file versions permanently. @@ -16,7 +16,7 @@ * * A maximum of 100 files can be deleted at a time. * - * @see Imagekit\Services\Files\BulkService::delete() + * @see ImageKit\Services\Files\BulkService::delete() * * @phpstan-type BulkDeleteParamsShape = array{fileIDs: list} */ diff --git a/src/Files/Bulk/BulkDeleteResponse.php b/src/Files/Bulk/BulkDeleteResponse.php index a72bd0e4..6283cf47 100644 --- a/src/Files/Bulk/BulkDeleteResponse.php +++ b/src/Files/Bulk/BulkDeleteResponse.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Files\Bulk; +namespace ImageKit\Files\Bulk; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type BulkDeleteResponseShape = array{ diff --git a/src/Files/Bulk/BulkRemoveAITagsParams.php b/src/Files/Bulk/BulkRemoveAITagsParams.php index 312ad978..fbbe1f5e 100644 --- a/src/Files/Bulk/BulkRemoveAITagsParams.php +++ b/src/Files/Bulk/BulkRemoveAITagsParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Files\Bulk; +namespace ImageKit\Files\Bulk; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; /** * This API removes AITags from multiple files in bulk. A maximum of 50 files can be specified at a time. * - * @see Imagekit\Services\Files\BulkService::removeAITags() + * @see ImageKit\Services\Files\BulkService::removeAITags() * * @phpstan-type BulkRemoveAITagsParamsShape = array{ * aiTags: list, fileIDs: list diff --git a/src/Files/Bulk/BulkRemoveAITagsResponse.php b/src/Files/Bulk/BulkRemoveAITagsResponse.php index 85aeafa2..da106c25 100644 --- a/src/Files/Bulk/BulkRemoveAITagsResponse.php +++ b/src/Files/Bulk/BulkRemoveAITagsResponse.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Files\Bulk; +namespace ImageKit\Files\Bulk; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type BulkRemoveAITagsResponseShape = array{ diff --git a/src/Files/Bulk/BulkRemoveTagsParams.php b/src/Files/Bulk/BulkRemoveTagsParams.php index 3dcfcde9..dc147943 100644 --- a/src/Files/Bulk/BulkRemoveTagsParams.php +++ b/src/Files/Bulk/BulkRemoveTagsParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Files\Bulk; +namespace ImageKit\Files\Bulk; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; /** * This API removes tags from multiple files in bulk. A maximum of 50 files can be specified at a time. * - * @see Imagekit\Services\Files\BulkService::removeTags() + * @see ImageKit\Services\Files\BulkService::removeTags() * * @phpstan-type BulkRemoveTagsParamsShape = array{ * fileIDs: list, tags: list diff --git a/src/Files/Bulk/BulkRemoveTagsResponse.php b/src/Files/Bulk/BulkRemoveTagsResponse.php index 78d55a6b..5762922d 100644 --- a/src/Files/Bulk/BulkRemoveTagsResponse.php +++ b/src/Files/Bulk/BulkRemoveTagsResponse.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Files\Bulk; +namespace ImageKit\Files\Bulk; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type BulkRemoveTagsResponseShape = array{ diff --git a/src/Files/File.php b/src/Files/File.php index dd61b010..0829a793 100644 --- a/src/Files/File.php +++ b/src/Files/File.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace Imagekit\Files; +namespace ImageKit\Files; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Files\File\AITag; -use Imagekit\Files\File\SelectedFieldsSchema; -use Imagekit\Files\File\Type; -use Imagekit\Files\File\VersionInfo; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Files\File\AITag; +use ImageKit\Files\File\SelectedFieldsSchema; +use ImageKit\Files\File\Type; +use ImageKit\Files\File\VersionInfo; /** * Object containing details of a file or file version. * - * @phpstan-import-type AITagShape from \Imagekit\Files\File\AITag - * @phpstan-import-type SelectedFieldsSchemaShape from \Imagekit\Files\File\SelectedFieldsSchema - * @phpstan-import-type VersionInfoShape from \Imagekit\Files\File\VersionInfo + * @phpstan-import-type AITagShape from \ImageKit\Files\File\AITag + * @phpstan-import-type SelectedFieldsSchemaShape from \ImageKit\Files\File\SelectedFieldsSchema + * @phpstan-import-type VersionInfoShape from \ImageKit\Files\File\VersionInfo * * @phpstan-type FileShape = array{ * aiTags?: list|null, diff --git a/src/Files/File/AITag.php b/src/Files/File/AITag.php index b4b92a75..1b45d329 100644 --- a/src/Files/File/AITag.php +++ b/src/Files/File/AITag.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Files\File; +namespace ImageKit\Files\File; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * AI-generated tag associated with an image. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. diff --git a/src/Files/File/SelectedFieldsSchema.php b/src/Files/File/SelectedFieldsSchema.php index 4a49e87c..8c9b953e 100644 --- a/src/Files/File/SelectedFieldsSchema.php +++ b/src/Files/File/SelectedFieldsSchema.php @@ -2,28 +2,28 @@ declare(strict_types=1); -namespace Imagekit\Files\File; +namespace ImageKit\Files\File; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Files\File\SelectedFieldsSchema\DefaultValue; -use Imagekit\Files\File\SelectedFieldsSchema\SelectOption; -use Imagekit\Files\File\SelectedFieldsSchema\Type; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Files\File\SelectedFieldsSchema\DefaultValue; +use ImageKit\Files\File\SelectedFieldsSchema\SelectOption; +use ImageKit\Files\File\SelectedFieldsSchema\Type; /** - * @phpstan-import-type DefaultValueVariants from \Imagekit\Files\File\SelectedFieldsSchema\DefaultValue - * @phpstan-import-type MaxValueVariants from \Imagekit\Files\File\SelectedFieldsSchema\MaxValue - * @phpstan-import-type MinValueVariants from \Imagekit\Files\File\SelectedFieldsSchema\MinValue - * @phpstan-import-type SelectOptionVariants from \Imagekit\Files\File\SelectedFieldsSchema\SelectOption - * @phpstan-import-type DefaultValueShape from \Imagekit\Files\File\SelectedFieldsSchema\DefaultValue - * @phpstan-import-type MaxValueShape from \Imagekit\Files\File\SelectedFieldsSchema\MaxValue - * @phpstan-import-type MinValueShape from \Imagekit\Files\File\SelectedFieldsSchema\MinValue - * @phpstan-import-type SelectOptionShape from \Imagekit\Files\File\SelectedFieldsSchema\SelectOption + * @phpstan-import-type DefaultValueVariants from \ImageKit\Files\File\SelectedFieldsSchema\DefaultValue + * @phpstan-import-type MaxValueVariants from \ImageKit\Files\File\SelectedFieldsSchema\MaxValue + * @phpstan-import-type MinValueVariants from \ImageKit\Files\File\SelectedFieldsSchema\MinValue + * @phpstan-import-type SelectOptionVariants from \ImageKit\Files\File\SelectedFieldsSchema\SelectOption + * @phpstan-import-type DefaultValueShape from \ImageKit\Files\File\SelectedFieldsSchema\DefaultValue + * @phpstan-import-type MaxValueShape from \ImageKit\Files\File\SelectedFieldsSchema\MaxValue + * @phpstan-import-type MinValueShape from \ImageKit\Files\File\SelectedFieldsSchema\MinValue + * @phpstan-import-type SelectOptionShape from \ImageKit\Files\File\SelectedFieldsSchema\SelectOption * * @phpstan-type SelectedFieldsSchemaShape = array{ - * type: \Imagekit\Files\File\SelectedFieldsSchema\Type|value-of<\Imagekit\Files\File\SelectedFieldsSchema\Type>, + * type: \ImageKit\Files\File\SelectedFieldsSchema\Type|value-of<\ImageKit\Files\File\SelectedFieldsSchema\Type>, * defaultValue?: DefaultValueShape|null, * isValueRequired?: bool|null, * maxLength?: float|null, diff --git a/src/Files/File/SelectedFieldsSchema/DefaultValue.php b/src/Files/File/SelectedFieldsSchema/DefaultValue.php index 0d0e0594..1a1a2a49 100644 --- a/src/Files/File/SelectedFieldsSchema/DefaultValue.php +++ b/src/Files/File/SelectedFieldsSchema/DefaultValue.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit\Files\File\SelectedFieldsSchema; +namespace ImageKit\Files\File\SelectedFieldsSchema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Core\Conversion\ListOf; -use Imagekit\Files\File\SelectedFieldsSchema\DefaultValue\Mixed_; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\ListOf; +use ImageKit\Files\File\SelectedFieldsSchema\DefaultValue\Mixed_; /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. * - * @phpstan-import-type MixedShape from \Imagekit\Files\File\SelectedFieldsSchema\DefaultValue\Mixed_ + * @phpstan-import-type MixedShape from \ImageKit\Files\File\SelectedFieldsSchema\DefaultValue\Mixed_ * * @phpstan-type DefaultValueVariants = string|float|bool|list * @phpstan-type DefaultValueShape = DefaultValueVariants|list diff --git a/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed_.php b/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed_.php index cf7c9d44..7a2f762e 100644 --- a/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed_.php +++ b/src/Files/File/SelectedFieldsSchema/DefaultValue/Mixed_.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Files\File\SelectedFieldsSchema\DefaultValue; +namespace ImageKit\Files\File\SelectedFieldsSchema\DefaultValue; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @phpstan-type MixedVariants = string|float|bool diff --git a/src/Files/File/SelectedFieldsSchema/MaxValue.php b/src/Files/File/SelectedFieldsSchema/MaxValue.php index 7b909ebe..c06c6ccf 100644 --- a/src/Files/File/SelectedFieldsSchema/MaxValue.php +++ b/src/Files/File/SelectedFieldsSchema/MaxValue.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Files\File\SelectedFieldsSchema; +namespace ImageKit\Files\File\SelectedFieldsSchema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. diff --git a/src/Files/File/SelectedFieldsSchema/MinValue.php b/src/Files/File/SelectedFieldsSchema/MinValue.php index 590c2d65..5a5101b0 100644 --- a/src/Files/File/SelectedFieldsSchema/MinValue.php +++ b/src/Files/File/SelectedFieldsSchema/MinValue.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Files\File\SelectedFieldsSchema; +namespace ImageKit\Files\File\SelectedFieldsSchema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. diff --git a/src/Files/File/SelectedFieldsSchema/SelectOption.php b/src/Files/File/SelectedFieldsSchema/SelectOption.php index c3e0530f..dee55d4a 100644 --- a/src/Files/File/SelectedFieldsSchema/SelectOption.php +++ b/src/Files/File/SelectedFieldsSchema/SelectOption.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Files\File\SelectedFieldsSchema; +namespace ImageKit\Files\File\SelectedFieldsSchema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @phpstan-type SelectOptionVariants = string|float|bool diff --git a/src/Files/File/SelectedFieldsSchema/Type.php b/src/Files/File/SelectedFieldsSchema/Type.php index 9b0648ec..6d24b064 100644 --- a/src/Files/File/SelectedFieldsSchema/Type.php +++ b/src/Files/File/SelectedFieldsSchema/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Files\File\SelectedFieldsSchema; +namespace ImageKit\Files\File\SelectedFieldsSchema; /** * Type of the custom metadata field. diff --git a/src/Files/File/Type.php b/src/Files/File/Type.php index 481c0627..5c97f13f 100644 --- a/src/Files/File/Type.php +++ b/src/Files/File/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Files\File; +namespace ImageKit\Files\File; /** * Type of the asset. diff --git a/src/Files/File/VersionInfo.php b/src/Files/File/VersionInfo.php index 1321dc5a..51e96b41 100644 --- a/src/Files/File/VersionInfo.php +++ b/src/Files/File/VersionInfo.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Files\File; +namespace ImageKit\Files\File; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * An object containing the file or file version's `id` (versionId) and `name`. diff --git a/src/Files/FileCopyParams.php b/src/Files/FileCopyParams.php index c36f163a..bc1e6a3c 100644 --- a/src/Files/FileCopyParams.php +++ b/src/Files/FileCopyParams.php @@ -2,20 +2,20 @@ declare(strict_types=1); -namespace Imagekit\Files; +namespace ImageKit\Files; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; /** * This will copy a file from one folder to another. * * Note: If any file at the destination has the same name as the source file, then the source file and its versions (if `includeFileVersions` is set to true) will be appended to the destination file version history. * - * @see Imagekit\Services\FilesService::copy() + * @see ImageKit\Services\FilesService::copy() * * @phpstan-type FileCopyParamsShape = array{ * destinationPath: string, diff --git a/src/Files/FileCopyResponse.php b/src/Files/FileCopyResponse.php index 10a47d1e..a4cbf359 100644 --- a/src/Files/FileCopyResponse.php +++ b/src/Files/FileCopyResponse.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Imagekit\Files; +namespace ImageKit\Files; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type FileCopyResponseShape = array diff --git a/src/Files/FileMoveParams.php b/src/Files/FileMoveParams.php index d973fa5d..9465649f 100644 --- a/src/Files/FileMoveParams.php +++ b/src/Files/FileMoveParams.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\Files; +namespace ImageKit\Files; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; /** * This will move a file and all its versions from one folder to another. * * Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file. * - * @see Imagekit\Services\FilesService::move() + * @see ImageKit\Services\FilesService::move() * * @phpstan-type FileMoveParamsShape = array{ * destinationPath: string, sourceFilePath: string diff --git a/src/Files/FileMoveResponse.php b/src/Files/FileMoveResponse.php index 905e4f53..9173d423 100644 --- a/src/Files/FileMoveResponse.php +++ b/src/Files/FileMoveResponse.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Imagekit\Files; +namespace ImageKit\Files; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type FileMoveResponseShape = array diff --git a/src/Files/FileRenameParams.php b/src/Files/FileRenameParams.php index d1c8b3b6..50717564 100644 --- a/src/Files/FileRenameParams.php +++ b/src/Files/FileRenameParams.php @@ -2,20 +2,20 @@ declare(strict_types=1); -namespace Imagekit\Files; +namespace ImageKit\Files; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; /** * You can rename an already existing file in the media library using rename file API. This operation would rename all file versions of the file. * * Note: The old URLs will stop working. The file/file version URLs cached on CDN will continue to work unless a purge is requested. * - * @see Imagekit\Services\FilesService::rename() + * @see ImageKit\Services\FilesService::rename() * * @phpstan-type FileRenameParamsShape = array{ * filePath: string, newFileName: string, purgeCache?: bool|null diff --git a/src/Files/FileRenameResponse.php b/src/Files/FileRenameResponse.php index ce95b15b..da01c35a 100644 --- a/src/Files/FileRenameResponse.php +++ b/src/Files/FileRenameResponse.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Files; +namespace ImageKit\Files; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type FileRenameResponseShape = array{purgeRequestID?: string|null} diff --git a/src/Files/FileUpdateParams.php b/src/Files/FileUpdateParams.php index 8a6716f4..c978c0f5 100644 --- a/src/Files/FileUpdateParams.php +++ b/src/Files/FileUpdateParams.php @@ -2,26 +2,26 @@ declare(strict_types=1); -namespace Imagekit\Files; +namespace ImageKit\Files; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionItem; -use Imagekit\Files\FileUpdateParams\Publish; -use Imagekit\Files\FileUpdateParams\RemoveAITags; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionItem; +use ImageKit\Files\FileUpdateParams\Publish; +use ImageKit\Files\FileUpdateParams\RemoveAITags; /** * This API updates the details or attributes of the current version of the file. You can update `tags`, `customCoordinates`, `customMetadata`, publication status, remove existing `AITags` and apply extensions using this API. * - * @see Imagekit\Services\FilesService::update() + * @see ImageKit\Services\FilesService::update() * - * @phpstan-import-type ExtensionItemVariants from \Imagekit\ExtensionItem - * @phpstan-import-type RemoveAITagsVariants from \Imagekit\Files\FileUpdateParams\RemoveAITags - * @phpstan-import-type ExtensionItemShape from \Imagekit\ExtensionItem - * @phpstan-import-type RemoveAITagsShape from \Imagekit\Files\FileUpdateParams\RemoveAITags - * @phpstan-import-type PublishShape from \Imagekit\Files\FileUpdateParams\Publish + * @phpstan-import-type ExtensionItemVariants from \ImageKit\ExtensionItem + * @phpstan-import-type RemoveAITagsVariants from \ImageKit\Files\FileUpdateParams\RemoveAITags + * @phpstan-import-type ExtensionItemShape from \ImageKit\ExtensionItem + * @phpstan-import-type RemoveAITagsShape from \ImageKit\Files\FileUpdateParams\RemoveAITags + * @phpstan-import-type PublishShape from \ImageKit\Files\FileUpdateParams\Publish * * @phpstan-type FileUpdateParamsShape = array{ * customCoordinates?: string|null, diff --git a/src/Files/FileUpdateParams/Publish.php b/src/Files/FileUpdateParams/Publish.php index 53d27bf7..958ddc0f 100644 --- a/src/Files/FileUpdateParams/Publish.php +++ b/src/Files/FileUpdateParams/Publish.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUpdateParams; +namespace ImageKit\Files\FileUpdateParams; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * Configure the publication status of a file and its versions. diff --git a/src/Files/FileUpdateParams/RemoveAITags.php b/src/Files/FileUpdateParams/RemoveAITags.php index b4ca7928..315e644c 100644 --- a/src/Files/FileUpdateParams/RemoveAITags.php +++ b/src/Files/FileUpdateParams/RemoveAITags.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUpdateParams; +namespace ImageKit\Files\FileUpdateParams; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Core\Conversion\ListOf; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\ListOf; /** * An array of AITags associated with the file that you want to remove, e.g. `["car", "vehicle", "motorsports"]`. diff --git a/src/Files/FileUpdateResponse.php b/src/Files/FileUpdateResponse.php index 545093d7..e7ea8e1b 100644 --- a/src/Files/FileUpdateResponse.php +++ b/src/Files/FileUpdateResponse.php @@ -2,24 +2,24 @@ declare(strict_types=1); -namespace Imagekit\Files; +namespace ImageKit\Files; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Files\File\AITag; -use Imagekit\Files\File\SelectedFieldsSchema; -use Imagekit\Files\File\Type; -use Imagekit\Files\File\VersionInfo; -use Imagekit\Files\FileUpdateResponse\ExtensionStatus; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Files\File\AITag; +use ImageKit\Files\File\SelectedFieldsSchema; +use ImageKit\Files\File\Type; +use ImageKit\Files\File\VersionInfo; +use ImageKit\Files\FileUpdateResponse\ExtensionStatus; /** * Object containing details of a file or file version. * - * @phpstan-import-type AITagShape from \Imagekit\Files\File\AITag - * @phpstan-import-type SelectedFieldsSchemaShape from \Imagekit\Files\File\SelectedFieldsSchema - * @phpstan-import-type VersionInfoShape from \Imagekit\Files\File\VersionInfo - * @phpstan-import-type ExtensionStatusShape from \Imagekit\Files\FileUpdateResponse\ExtensionStatus + * @phpstan-import-type AITagShape from \ImageKit\Files\File\AITag + * @phpstan-import-type SelectedFieldsSchemaShape from \ImageKit\Files\File\SelectedFieldsSchema + * @phpstan-import-type VersionInfoShape from \ImageKit\Files\File\VersionInfo + * @phpstan-import-type ExtensionStatusShape from \ImageKit\Files\FileUpdateResponse\ExtensionStatus * * @phpstan-type FileUpdateResponseShape = array{ * aiTags?: list|null, diff --git a/src/Files/FileUpdateResponse/ExtensionStatus.php b/src/Files/FileUpdateResponse/ExtensionStatus.php index ef60b143..a68f6468 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUpdateResponse; - -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Files\FileUpdateResponse\ExtensionStatus\AIAutoDescription; -use Imagekit\Files\FileUpdateResponse\ExtensionStatus\AITasks; -use Imagekit\Files\FileUpdateResponse\ExtensionStatus\AwsAutoTagging; -use Imagekit\Files\FileUpdateResponse\ExtensionStatus\GoogleAutoTagging; -use Imagekit\Files\FileUpdateResponse\ExtensionStatus\RemoveBg; +namespace ImageKit\Files\FileUpdateResponse; + +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Files\FileUpdateResponse\ExtensionStatus\AIAutoDescription; +use ImageKit\Files\FileUpdateResponse\ExtensionStatus\AITasks; +use ImageKit\Files\FileUpdateResponse\ExtensionStatus\AwsAutoTagging; +use ImageKit\Files\FileUpdateResponse\ExtensionStatus\GoogleAutoTagging; +use ImageKit\Files\FileUpdateResponse\ExtensionStatus\RemoveBg; /** * @phpstan-type ExtensionStatusShape = array{ diff --git a/src/Files/FileUpdateResponse/ExtensionStatus/AIAutoDescription.php b/src/Files/FileUpdateResponse/ExtensionStatus/AIAutoDescription.php index a1f9d530..ae67f332 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus/AIAutoDescription.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus/AIAutoDescription.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUpdateResponse\ExtensionStatus; +namespace ImageKit\Files\FileUpdateResponse\ExtensionStatus; enum AIAutoDescription: string { diff --git a/src/Files/FileUpdateResponse/ExtensionStatus/AITasks.php b/src/Files/FileUpdateResponse/ExtensionStatus/AITasks.php index 44cf01a0..185121c6 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus/AITasks.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus/AITasks.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUpdateResponse\ExtensionStatus; +namespace ImageKit\Files\FileUpdateResponse\ExtensionStatus; enum AITasks: string { diff --git a/src/Files/FileUpdateResponse/ExtensionStatus/AwsAutoTagging.php b/src/Files/FileUpdateResponse/ExtensionStatus/AwsAutoTagging.php index f4de62b1..0dba4e7e 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus/AwsAutoTagging.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus/AwsAutoTagging.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUpdateResponse\ExtensionStatus; +namespace ImageKit\Files\FileUpdateResponse\ExtensionStatus; enum AwsAutoTagging: string { diff --git a/src/Files/FileUpdateResponse/ExtensionStatus/GoogleAutoTagging.php b/src/Files/FileUpdateResponse/ExtensionStatus/GoogleAutoTagging.php index 77095aca..8613623f 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus/GoogleAutoTagging.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus/GoogleAutoTagging.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUpdateResponse\ExtensionStatus; +namespace ImageKit\Files\FileUpdateResponse\ExtensionStatus; enum GoogleAutoTagging: string { diff --git a/src/Files/FileUpdateResponse/ExtensionStatus/RemoveBg.php b/src/Files/FileUpdateResponse/ExtensionStatus/RemoveBg.php index 10aa911d..db5b4275 100644 --- a/src/Files/FileUpdateResponse/ExtensionStatus/RemoveBg.php +++ b/src/Files/FileUpdateResponse/ExtensionStatus/RemoveBg.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUpdateResponse\ExtensionStatus; +namespace ImageKit\Files\FileUpdateResponse\ExtensionStatus; enum RemoveBg: string { diff --git a/src/Files/FileUploadParams.php b/src/Files/FileUploadParams.php index 8b3c6ace..99e4b333 100644 --- a/src/Files/FileUploadParams.php +++ b/src/Files/FileUploadParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Files; - -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Core\FileParam; -use Imagekit\ExtensionItem; -use Imagekit\Files\FileUploadParams\ResponseField; -use Imagekit\Files\FileUploadParams\Transformation; +namespace ImageKit\Files; + +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Core\FileParam; +use ImageKit\ExtensionItem; +use ImageKit\Files\FileUploadParams\ResponseField; +use ImageKit\Files\FileUploadParams\Transformation; /** * ImageKit.io allows you to upload files directly from both the server and client sides. For server-side uploads, private API key authentication is used. For client-side uploads, generate a one-time `token`, `signature`, and `expire` from your secure backend using private API. [Learn more](/docs/api-reference/upload-file/upload-file#how-to-implement-client-side-file-upload) about how to implement client-side file upload. @@ -30,11 +30,11 @@ * - A full-fledged [upload widget using Uppy](https://github.com/imagekit-samples/uppy-uploader), supporting file selections from local storage, URL, Dropbox, Google Drive, Instagram, and more. * - [Quick start guides](/docs/quick-start-guides) for various frameworks and technologies. * - * @see Imagekit\Services\FilesService::upload() + * @see ImageKit\Services\FilesService::upload() * - * @phpstan-import-type ExtensionItemVariants from \Imagekit\ExtensionItem - * @phpstan-import-type ExtensionItemShape from \Imagekit\ExtensionItem - * @phpstan-import-type TransformationShape from \Imagekit\Files\FileUploadParams\Transformation + * @phpstan-import-type ExtensionItemVariants from \ImageKit\ExtensionItem + * @phpstan-import-type ExtensionItemShape from \ImageKit\ExtensionItem + * @phpstan-import-type TransformationShape from \ImageKit\Files\FileUploadParams\Transformation * * @phpstan-type FileUploadParamsShape = array{ * file: string|FileParam, diff --git a/src/Files/FileUploadParams/ResponseField.php b/src/Files/FileUploadParams/ResponseField.php index 035f03f5..ad83a282 100644 --- a/src/Files/FileUploadParams/ResponseField.php +++ b/src/Files/FileUploadParams/ResponseField.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUploadParams; +namespace ImageKit\Files\FileUploadParams; enum ResponseField: string { diff --git a/src/Files/FileUploadParams/Transformation.php b/src/Files/FileUploadParams/Transformation.php index ab660c79..db133fcb 100644 --- a/src/Files/FileUploadParams/Transformation.php +++ b/src/Files/FileUploadParams/Transformation.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUploadParams; +namespace ImageKit\Files\FileUploadParams; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Files\FileUploadParams\Transformation\Post; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Files\FileUploadParams\Transformation\Post; /** * Configure pre-processing (`pre`) and post-processing (`post`) transformations. @@ -20,8 +20,8 @@ * * You can mix and match any combination of post-processing types. * - * @phpstan-import-type PostVariants from \Imagekit\Files\FileUploadParams\Transformation\Post - * @phpstan-import-type PostShape from \Imagekit\Files\FileUploadParams\Transformation\Post + * @phpstan-import-type PostVariants from \ImageKit\Files\FileUploadParams\Transformation\Post + * @phpstan-import-type PostShape from \ImageKit\Files\FileUploadParams\Transformation\Post * * @phpstan-type TransformationShape = array{ * post?: list|null, pre?: string|null diff --git a/src/Files/FileUploadParams/Transformation/Post.php b/src/Files/FileUploadParams/Transformation/Post.php index ef793c55..76f0cc9c 100644 --- a/src/Files/FileUploadParams/Transformation/Post.php +++ b/src/Files/FileUploadParams/Transformation/Post.php @@ -2,21 +2,21 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUploadParams\Transformation; +namespace ImageKit\Files\FileUploadParams\Transformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming; -use Imagekit\Files\FileUploadParams\Transformation\Post\ConvertGifToVideo; -use Imagekit\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail; -use Imagekit\Files\FileUploadParams\Transformation\Post\SimplePostTransformation; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming; +use ImageKit\Files\FileUploadParams\Transformation\Post\ConvertGifToVideo; +use ImageKit\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail; +use ImageKit\Files\FileUploadParams\Transformation\Post\SimplePostTransformation; /** - * @phpstan-import-type SimplePostTransformationShape from \Imagekit\Files\FileUploadParams\Transformation\Post\SimplePostTransformation - * @phpstan-import-type ConvertGifToVideoShape from \Imagekit\Files\FileUploadParams\Transformation\Post\ConvertGifToVideo - * @phpstan-import-type GenerateAThumbnailShape from \Imagekit\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail - * @phpstan-import-type AdaptiveBitrateStreamingShape from \Imagekit\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming + * @phpstan-import-type SimplePostTransformationShape from \ImageKit\Files\FileUploadParams\Transformation\Post\SimplePostTransformation + * @phpstan-import-type ConvertGifToVideoShape from \ImageKit\Files\FileUploadParams\Transformation\Post\ConvertGifToVideo + * @phpstan-import-type GenerateAThumbnailShape from \ImageKit\Files\FileUploadParams\Transformation\Post\GenerateAThumbnail + * @phpstan-import-type AdaptiveBitrateStreamingShape from \ImageKit\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming * * @phpstan-type PostVariants = SimplePostTransformation|ConvertGifToVideo|GenerateAThumbnail|AdaptiveBitrateStreaming * @phpstan-type PostShape = PostVariants|SimplePostTransformationShape|ConvertGifToVideoShape|GenerateAThumbnailShape|AdaptiveBitrateStreamingShape diff --git a/src/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php b/src/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php index 1e516704..f08b45bd 100644 --- a/src/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php +++ b/src/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUploadParams\Transformation\Post; +namespace ImageKit\Files\FileUploadParams\Transformation\Post; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming\Protocol; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming\Protocol; /** * @phpstan-type AdaptiveBitrateStreamingShape = array{ diff --git a/src/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming/Protocol.php b/src/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming/Protocol.php index df516efd..e7d1b239 100644 --- a/src/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming/Protocol.php +++ b/src/Files/FileUploadParams/Transformation/Post/AdaptiveBitrateStreaming/Protocol.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming; +namespace ImageKit\Files\FileUploadParams\Transformation\Post\AdaptiveBitrateStreaming; /** * Streaming protocol to use (`hls` or `dash`). diff --git a/src/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php b/src/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php index 3455e76b..bc8eff90 100644 --- a/src/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php +++ b/src/Files/FileUploadParams/Transformation/Post/ConvertGifToVideo.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUploadParams\Transformation\Post; +namespace ImageKit\Files\FileUploadParams\Transformation\Post; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type ConvertGifToVideoShape = array{ diff --git a/src/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php b/src/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php index f16a6220..3f1e3eae 100644 --- a/src/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php +++ b/src/Files/FileUploadParams/Transformation/Post/GenerateAThumbnail.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUploadParams\Transformation\Post; +namespace ImageKit\Files\FileUploadParams\Transformation\Post; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type GenerateAThumbnailShape = array{ diff --git a/src/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php b/src/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php index 923a885e..24302772 100644 --- a/src/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php +++ b/src/Files/FileUploadParams/Transformation/Post/SimplePostTransformation.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUploadParams\Transformation\Post; +namespace ImageKit\Files\FileUploadParams\Transformation\Post; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type SimplePostTransformationShape = array{ diff --git a/src/Files/FileUploadResponse.php b/src/Files/FileUploadResponse.php index 60cfc020..a505ef53 100644 --- a/src/Files/FileUploadResponse.php +++ b/src/Files/FileUploadResponse.php @@ -2,24 +2,24 @@ declare(strict_types=1); -namespace Imagekit\Files; +namespace ImageKit\Files; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Files\FileUploadResponse\AITag; -use Imagekit\Files\FileUploadResponse\ExtensionStatus; -use Imagekit\Files\FileUploadResponse\SelectedFieldsSchema; -use Imagekit\Files\FileUploadResponse\VersionInfo; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Files\FileUploadResponse\AITag; +use ImageKit\Files\FileUploadResponse\ExtensionStatus; +use ImageKit\Files\FileUploadResponse\SelectedFieldsSchema; +use ImageKit\Files\FileUploadResponse\VersionInfo; /** * Object containing details of a successful upload. * - * @phpstan-import-type AITagShape from \Imagekit\Files\FileUploadResponse\AITag - * @phpstan-import-type ExtensionStatusShape from \Imagekit\Files\FileUploadResponse\ExtensionStatus - * @phpstan-import-type MetadataShape from \Imagekit\Files\Metadata - * @phpstan-import-type SelectedFieldsSchemaShape from \Imagekit\Files\FileUploadResponse\SelectedFieldsSchema - * @phpstan-import-type VersionInfoShape from \Imagekit\Files\FileUploadResponse\VersionInfo + * @phpstan-import-type AITagShape from \ImageKit\Files\FileUploadResponse\AITag + * @phpstan-import-type ExtensionStatusShape from \ImageKit\Files\FileUploadResponse\ExtensionStatus + * @phpstan-import-type MetadataShape from \ImageKit\Files\Metadata + * @phpstan-import-type SelectedFieldsSchemaShape from \ImageKit\Files\FileUploadResponse\SelectedFieldsSchema + * @phpstan-import-type VersionInfoShape from \ImageKit\Files\FileUploadResponse\VersionInfo * * @phpstan-type FileUploadResponseShape = array{ * aiTags?: list|null, diff --git a/src/Files/FileUploadResponse/AITag.php b/src/Files/FileUploadResponse/AITag.php index 5e059012..c0d1def2 100644 --- a/src/Files/FileUploadResponse/AITag.php +++ b/src/Files/FileUploadResponse/AITag.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUploadResponse; +namespace ImageKit\Files\FileUploadResponse; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * AI-generated tag associated with an image. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. diff --git a/src/Files/FileUploadResponse/ExtensionStatus.php b/src/Files/FileUploadResponse/ExtensionStatus.php index b59a7f64..ae08d714 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus.php +++ b/src/Files/FileUploadResponse/ExtensionStatus.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUploadResponse; - -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Files\FileUploadResponse\ExtensionStatus\AIAutoDescription; -use Imagekit\Files\FileUploadResponse\ExtensionStatus\AITasks; -use Imagekit\Files\FileUploadResponse\ExtensionStatus\AwsAutoTagging; -use Imagekit\Files\FileUploadResponse\ExtensionStatus\GoogleAutoTagging; -use Imagekit\Files\FileUploadResponse\ExtensionStatus\RemoveBg; +namespace ImageKit\Files\FileUploadResponse; + +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Files\FileUploadResponse\ExtensionStatus\AIAutoDescription; +use ImageKit\Files\FileUploadResponse\ExtensionStatus\AITasks; +use ImageKit\Files\FileUploadResponse\ExtensionStatus\AwsAutoTagging; +use ImageKit\Files\FileUploadResponse\ExtensionStatus\GoogleAutoTagging; +use ImageKit\Files\FileUploadResponse\ExtensionStatus\RemoveBg; /** * Extension names with their processing status at the time of completion of the request. It could have one of the following status values: diff --git a/src/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php b/src/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php index bc0bedc7..a12ba5f1 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php +++ b/src/Files/FileUploadResponse/ExtensionStatus/AIAutoDescription.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUploadResponse\ExtensionStatus; +namespace ImageKit\Files\FileUploadResponse\ExtensionStatus; enum AIAutoDescription: string { diff --git a/src/Files/FileUploadResponse/ExtensionStatus/AITasks.php b/src/Files/FileUploadResponse/ExtensionStatus/AITasks.php index be837d2b..8db12f5a 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus/AITasks.php +++ b/src/Files/FileUploadResponse/ExtensionStatus/AITasks.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUploadResponse\ExtensionStatus; +namespace ImageKit\Files\FileUploadResponse\ExtensionStatus; enum AITasks: string { diff --git a/src/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php b/src/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php index f25d3dd4..06158e8a 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php +++ b/src/Files/FileUploadResponse/ExtensionStatus/AwsAutoTagging.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUploadResponse\ExtensionStatus; +namespace ImageKit\Files\FileUploadResponse\ExtensionStatus; enum AwsAutoTagging: string { diff --git a/src/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php b/src/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php index 7845ea15..5289a3cf 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php +++ b/src/Files/FileUploadResponse/ExtensionStatus/GoogleAutoTagging.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUploadResponse\ExtensionStatus; +namespace ImageKit\Files\FileUploadResponse\ExtensionStatus; enum GoogleAutoTagging: string { diff --git a/src/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php b/src/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php index 6a4c44b8..2321fd44 100644 --- a/src/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php +++ b/src/Files/FileUploadResponse/ExtensionStatus/RemoveBg.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUploadResponse\ExtensionStatus; +namespace ImageKit\Files\FileUploadResponse\ExtensionStatus; enum RemoveBg: string { diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema.php b/src/Files/FileUploadResponse/SelectedFieldsSchema.php index 3abd0c2e..0795ea63 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema.php @@ -2,25 +2,25 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUploadResponse; +namespace ImageKit\Files\FileUploadResponse; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue; -use Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\SelectOption; -use Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\Type; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue; +use ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\SelectOption; +use ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\Type; /** - * @phpstan-import-type DefaultValueVariants from \Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue - * @phpstan-import-type MaxValueVariants from \Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\MaxValue - * @phpstan-import-type MinValueVariants from \Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\MinValue - * @phpstan-import-type SelectOptionVariants from \Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\SelectOption - * @phpstan-import-type DefaultValueShape from \Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue - * @phpstan-import-type MaxValueShape from \Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\MaxValue - * @phpstan-import-type MinValueShape from \Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\MinValue - * @phpstan-import-type SelectOptionShape from \Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\SelectOption + * @phpstan-import-type DefaultValueVariants from \ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue + * @phpstan-import-type MaxValueVariants from \ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\MaxValue + * @phpstan-import-type MinValueVariants from \ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\MinValue + * @phpstan-import-type SelectOptionVariants from \ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\SelectOption + * @phpstan-import-type DefaultValueShape from \ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue + * @phpstan-import-type MaxValueShape from \ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\MaxValue + * @phpstan-import-type MinValueShape from \ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\MinValue + * @phpstan-import-type SelectOptionShape from \ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\SelectOption * * @phpstan-type SelectedFieldsSchemaShape = array{ * type: Type|value-of, diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php index 12b504ec..cb9739d6 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUploadResponse\SelectedFieldsSchema; +namespace ImageKit\Files\FileUploadResponse\SelectedFieldsSchema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Core\Conversion\ListOf; -use Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed_; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\ListOf; +use ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed_; /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. * - * @phpstan-import-type MixedShape from \Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed_ + * @phpstan-import-type MixedShape from \ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue\Mixed_ * * @phpstan-type DefaultValueVariants = string|float|bool|list * @phpstan-type DefaultValueShape = DefaultValueVariants|list diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php index 67aae15b..a5a58458 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/DefaultValue/Mixed_.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue; +namespace ImageKit\Files\FileUploadResponse\SelectedFieldsSchema\DefaultValue; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @phpstan-type MixedVariants = string|float|bool diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php index 51297b62..968070cd 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/MaxValue.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUploadResponse\SelectedFieldsSchema; +namespace ImageKit\Files\FileUploadResponse\SelectedFieldsSchema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php index ee6f0fc8..7fe54973 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/MinValue.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUploadResponse\SelectedFieldsSchema; +namespace ImageKit\Files\FileUploadResponse\SelectedFieldsSchema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php index 4d9d2041..a5228945 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/SelectOption.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUploadResponse\SelectedFieldsSchema; +namespace ImageKit\Files\FileUploadResponse\SelectedFieldsSchema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @phpstan-type SelectOptionVariants = string|float|bool diff --git a/src/Files/FileUploadResponse/SelectedFieldsSchema/Type.php b/src/Files/FileUploadResponse/SelectedFieldsSchema/Type.php index bb67b578..d987d623 100644 --- a/src/Files/FileUploadResponse/SelectedFieldsSchema/Type.php +++ b/src/Files/FileUploadResponse/SelectedFieldsSchema/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUploadResponse\SelectedFieldsSchema; +namespace ImageKit\Files\FileUploadResponse\SelectedFieldsSchema; /** * Type of the custom metadata field. diff --git a/src/Files/FileUploadResponse/VersionInfo.php b/src/Files/FileUploadResponse/VersionInfo.php index 8df22100..964f9bf7 100644 --- a/src/Files/FileUploadResponse/VersionInfo.php +++ b/src/Files/FileUploadResponse/VersionInfo.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Files\FileUploadResponse; +namespace ImageKit\Files\FileUploadResponse; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * An object containing the file or file version's `id` (versionId) and `name`. diff --git a/src/Files/Folder.php b/src/Files/Folder.php index a6c62665..f1ee66ff 100644 --- a/src/Files/Folder.php +++ b/src/Files/Folder.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Files; +namespace ImageKit\Files; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Files\Folder\Type; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Files\Folder\Type; /** * @phpstan-type FolderShape = array{ diff --git a/src/Files/Folder/Type.php b/src/Files/Folder/Type.php index 060fae8e..91836374 100644 --- a/src/Files/Folder/Type.php +++ b/src/Files/Folder/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Files\Folder; +namespace ImageKit\Files\Folder; /** * Type of the asset. diff --git a/src/Files/Metadata.php b/src/Files/Metadata.php index 9d22d7ed..5fbcc520 100644 --- a/src/Files/Metadata.php +++ b/src/Files/Metadata.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Files; +namespace ImageKit\Files; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Files\Metadata\Exif; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Files\Metadata\Exif; /** * JSON object containing metadata. * - * @phpstan-import-type ExifShape from \Imagekit\Files\Metadata\Exif + * @phpstan-import-type ExifShape from \ImageKit\Files\Metadata\Exif * * @phpstan-type MetadataShape = array{ * audioCodec?: string|null, diff --git a/src/Files/Metadata/Exif.php b/src/Files/Metadata/Exif.php index 3074e4e7..8eb7274c 100644 --- a/src/Files/Metadata/Exif.php +++ b/src/Files/Metadata/Exif.php @@ -2,25 +2,25 @@ declare(strict_types=1); -namespace Imagekit\Files\Metadata; +namespace ImageKit\Files\Metadata; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Files\Metadata\Exif\Gps; -use Imagekit\Files\Metadata\Exif\Image; -use Imagekit\Files\Metadata\Exif\Interoperability; -use Imagekit\Files\Metadata\Exif\Thumbnail; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Files\Metadata\Exif\Gps; +use ImageKit\Files\Metadata\Exif\Image; +use ImageKit\Files\Metadata\Exif\Interoperability; +use ImageKit\Files\Metadata\Exif\Thumbnail; /** - * @phpstan-import-type ExifShape from \Imagekit\Files\Metadata\Exif\Exif as ExifShape1 - * @phpstan-import-type GpsShape from \Imagekit\Files\Metadata\Exif\Gps - * @phpstan-import-type ImageShape from \Imagekit\Files\Metadata\Exif\Image - * @phpstan-import-type InteroperabilityShape from \Imagekit\Files\Metadata\Exif\Interoperability - * @phpstan-import-type ThumbnailShape from \Imagekit\Files\Metadata\Exif\Thumbnail + * @phpstan-import-type ExifShape from \ImageKit\Files\Metadata\Exif\Exif as ExifShape1 + * @phpstan-import-type GpsShape from \ImageKit\Files\Metadata\Exif\Gps + * @phpstan-import-type ImageShape from \ImageKit\Files\Metadata\Exif\Image + * @phpstan-import-type InteroperabilityShape from \ImageKit\Files\Metadata\Exif\Interoperability + * @phpstan-import-type ThumbnailShape from \ImageKit\Files\Metadata\Exif\Thumbnail * * @phpstan-type ExifShape = array{ - * exif?: null|\Imagekit\Files\Metadata\Exif\Exif|ExifShape1, + * exif?: null|\ImageKit\Files\Metadata\Exif\Exif|ExifShape1, * gps?: null|Gps|GpsShape, * image?: null|Image|ImageShape, * interoperability?: null|Interoperability|InteroperabilityShape, diff --git a/src/Files/Metadata/Exif/Exif.php b/src/Files/Metadata/Exif/Exif.php index 68bcf4d4..de7e80fa 100644 --- a/src/Files/Metadata/Exif/Exif.php +++ b/src/Files/Metadata/Exif/Exif.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Files\Metadata\Exif; +namespace ImageKit\Files\Metadata\Exif; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * Object containing Exif details. diff --git a/src/Files/Metadata/Exif/Gps.php b/src/Files/Metadata/Exif/Gps.php index a215e735..f4920c6e 100644 --- a/src/Files/Metadata/Exif/Gps.php +++ b/src/Files/Metadata/Exif/Gps.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Files\Metadata\Exif; +namespace ImageKit\Files\Metadata\Exif; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * Object containing GPS information. diff --git a/src/Files/Metadata/Exif/Image.php b/src/Files/Metadata/Exif/Image.php index 8eb0bb24..1fe201e7 100644 --- a/src/Files/Metadata/Exif/Image.php +++ b/src/Files/Metadata/Exif/Image.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Files\Metadata\Exif; +namespace ImageKit\Files\Metadata\Exif; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * Object containing EXIF image information. diff --git a/src/Files/Metadata/Exif/Interoperability.php b/src/Files/Metadata/Exif/Interoperability.php index d47a2f28..61c6d148 100644 --- a/src/Files/Metadata/Exif/Interoperability.php +++ b/src/Files/Metadata/Exif/Interoperability.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Files\Metadata\Exif; +namespace ImageKit\Files\Metadata\Exif; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * JSON object. diff --git a/src/Files/Metadata/Exif/Thumbnail.php b/src/Files/Metadata/Exif/Thumbnail.php index 4a1c1094..95b2c12e 100644 --- a/src/Files/Metadata/Exif/Thumbnail.php +++ b/src/Files/Metadata/Exif/Thumbnail.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Files\Metadata\Exif; +namespace ImageKit\Files\Metadata\Exif; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * Object containing Thumbnail information. diff --git a/src/Files/Metadata/MetadataGetFromURLParams.php b/src/Files/Metadata/MetadataGetFromURLParams.php index d9b0a422..0b04939b 100644 --- a/src/Files/Metadata/MetadataGetFromURLParams.php +++ b/src/Files/Metadata/MetadataGetFromURLParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Files\Metadata; +namespace ImageKit\Files\Metadata; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; /** * Get image EXIF, pHash, and other metadata from ImageKit.io powered remote URL using this API. * - * @see Imagekit\Services\Files\MetadataService::getFromURL() + * @see ImageKit\Services\Files\MetadataService::getFromURL() * * @phpstan-type MetadataGetFromURLParamsShape = array{url: string} */ diff --git a/src/Files/UpdateFileRequest.php b/src/Files/UpdateFileRequest.php index 18ae1d6f..05bf2da6 100644 --- a/src/Files/UpdateFileRequest.php +++ b/src/Files/UpdateFileRequest.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\Files; +namespace ImageKit\Files; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Files\UpdateFileRequest\ChangePublicationStatus; -use Imagekit\Files\UpdateFileRequest\UpdateFileDetails; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Files\UpdateFileRequest\ChangePublicationStatus; +use ImageKit\Files\UpdateFileRequest\UpdateFileDetails; /** * Schema for update file update request. * - * @phpstan-import-type UpdateFileDetailsShape from \Imagekit\Files\UpdateFileRequest\UpdateFileDetails - * @phpstan-import-type ChangePublicationStatusShape from \Imagekit\Files\UpdateFileRequest\ChangePublicationStatus + * @phpstan-import-type UpdateFileDetailsShape from \ImageKit\Files\UpdateFileRequest\UpdateFileDetails + * @phpstan-import-type ChangePublicationStatusShape from \ImageKit\Files\UpdateFileRequest\ChangePublicationStatus * * @phpstan-type UpdateFileRequestVariants = UpdateFileDetails|ChangePublicationStatus * @phpstan-type UpdateFileRequestShape = UpdateFileRequestVariants|UpdateFileDetailsShape|ChangePublicationStatusShape diff --git a/src/Files/UpdateFileRequest/ChangePublicationStatus.php b/src/Files/UpdateFileRequest/ChangePublicationStatus.php index 69454690..55f1028d 100644 --- a/src/Files/UpdateFileRequest/ChangePublicationStatus.php +++ b/src/Files/UpdateFileRequest/ChangePublicationStatus.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace Imagekit\Files\UpdateFileRequest; +namespace ImageKit\Files\UpdateFileRequest; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Files\UpdateFileRequest\ChangePublicationStatus\Publish; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Files\UpdateFileRequest\ChangePublicationStatus\Publish; /** - * @phpstan-import-type PublishShape from \Imagekit\Files\UpdateFileRequest\ChangePublicationStatus\Publish + * @phpstan-import-type PublishShape from \ImageKit\Files\UpdateFileRequest\ChangePublicationStatus\Publish * * @phpstan-type ChangePublicationStatusShape = array{ * publish?: null|Publish|PublishShape diff --git a/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php b/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php index 5928c599..b859f05e 100644 --- a/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php +++ b/src/Files/UpdateFileRequest/ChangePublicationStatus/Publish.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Files\UpdateFileRequest\ChangePublicationStatus; +namespace ImageKit\Files\UpdateFileRequest\ChangePublicationStatus; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * Configure the publication status of a file and its versions. diff --git a/src/Files/UpdateFileRequest/UpdateFileDetails.php b/src/Files/UpdateFileRequest/UpdateFileDetails.php index ad8f5668..a9729b82 100644 --- a/src/Files/UpdateFileRequest/UpdateFileDetails.php +++ b/src/Files/UpdateFileRequest/UpdateFileDetails.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\Files\UpdateFileRequest; +namespace ImageKit\Files\UpdateFileRequest; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionItem; -use Imagekit\Files\UpdateFileRequest\UpdateFileDetails\RemoveAITags; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionItem; +use ImageKit\Files\UpdateFileRequest\UpdateFileDetails\RemoveAITags; /** - * @phpstan-import-type ExtensionItemVariants from \Imagekit\ExtensionItem - * @phpstan-import-type RemoveAITagsVariants from \Imagekit\Files\UpdateFileRequest\UpdateFileDetails\RemoveAITags - * @phpstan-import-type ExtensionItemShape from \Imagekit\ExtensionItem - * @phpstan-import-type RemoveAITagsShape from \Imagekit\Files\UpdateFileRequest\UpdateFileDetails\RemoveAITags + * @phpstan-import-type ExtensionItemVariants from \ImageKit\ExtensionItem + * @phpstan-import-type RemoveAITagsVariants from \ImageKit\Files\UpdateFileRequest\UpdateFileDetails\RemoveAITags + * @phpstan-import-type ExtensionItemShape from \ImageKit\ExtensionItem + * @phpstan-import-type RemoveAITagsShape from \ImageKit\Files\UpdateFileRequest\UpdateFileDetails\RemoveAITags * * @phpstan-type UpdateFileDetailsShape = array{ * customCoordinates?: string|null, diff --git a/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php b/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php index 55a17b20..320af835 100644 --- a/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php +++ b/src/Files/UpdateFileRequest/UpdateFileDetails/RemoveAITags.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Files\UpdateFileRequest\UpdateFileDetails; +namespace ImageKit\Files\UpdateFileRequest\UpdateFileDetails; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Core\Conversion\ListOf; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\ListOf; /** * An array of AITags associated with the file that you want to remove, e.g. `["car", "vehicle", "motorsports"]`. diff --git a/src/Files/Versions/VersionDeleteParams.php b/src/Files/Versions/VersionDeleteParams.php index 0deba939..9e43e7a8 100644 --- a/src/Files/Versions/VersionDeleteParams.php +++ b/src/Files/Versions/VersionDeleteParams.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\Files\Versions; +namespace ImageKit\Files\Versions; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; /** * This API deletes a non-current file version permanently. The API returns an empty response. * * Note: If you want to delete all versions of a file, use the delete file API. * - * @see Imagekit\Services\Files\VersionsService::delete() + * @see ImageKit\Services\Files\VersionsService::delete() * * @phpstan-type VersionDeleteParamsShape = array{fileID: string} */ diff --git a/src/Files/Versions/VersionDeleteResponse.php b/src/Files/Versions/VersionDeleteResponse.php index c8bebe49..9702f2e6 100644 --- a/src/Files/Versions/VersionDeleteResponse.php +++ b/src/Files/Versions/VersionDeleteResponse.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Imagekit\Files\Versions; +namespace ImageKit\Files\Versions; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type VersionDeleteResponseShape = array diff --git a/src/Files/Versions/VersionGetParams.php b/src/Files/Versions/VersionGetParams.php index 0c62b7fb..224e02c9 100644 --- a/src/Files/Versions/VersionGetParams.php +++ b/src/Files/Versions/VersionGetParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Files\Versions; +namespace ImageKit\Files\Versions; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; /** * This API returns an object with details or attributes of a file version. * - * @see Imagekit\Services\Files\VersionsService::get() + * @see ImageKit\Services\Files\VersionsService::get() * * @phpstan-type VersionGetParamsShape = array{fileID: string} */ diff --git a/src/Files/Versions/VersionRestoreParams.php b/src/Files/Versions/VersionRestoreParams.php index 9d9fcfef..f1db11d7 100644 --- a/src/Files/Versions/VersionRestoreParams.php +++ b/src/Files/Versions/VersionRestoreParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Files\Versions; +namespace ImageKit\Files\Versions; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; /** * This API restores a file version as the current file version. * - * @see Imagekit\Services\Files\VersionsService::restore() + * @see ImageKit\Services\Files\VersionsService::restore() * * @phpstan-type VersionRestoreParamsShape = array{fileID: string} */ diff --git a/src/Folders/FolderCopyParams.php b/src/Folders/FolderCopyParams.php index 726e2f14..89cd83e9 100644 --- a/src/Folders/FolderCopyParams.php +++ b/src/Folders/FolderCopyParams.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit\Folders; +namespace ImageKit\Folders; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; /** * This will copy one folder into another. The selected folder, its nested folders, files, and their versions (in `includeVersions` is set to true) are copied in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history. * - * @see Imagekit\Services\FoldersService::copy() + * @see ImageKit\Services\FoldersService::copy() * * @phpstan-type FolderCopyParamsShape = array{ * destinationPath: string, sourceFolderPath: string, includeVersions?: bool|null diff --git a/src/Folders/FolderCopyResponse.php b/src/Folders/FolderCopyResponse.php index c4f76c16..f055562e 100644 --- a/src/Folders/FolderCopyResponse.php +++ b/src/Folders/FolderCopyResponse.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Folders; +namespace ImageKit\Folders; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * Job submitted successfully. A `jobId` will be returned. diff --git a/src/Folders/FolderCreateParams.php b/src/Folders/FolderCreateParams.php index 92a3cbab..74d396f8 100644 --- a/src/Folders/FolderCreateParams.php +++ b/src/Folders/FolderCreateParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Folders; +namespace ImageKit\Folders; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; /** * This will create a new folder. You can specify the folder name and location of the parent folder where this new folder should be created. * - * @see Imagekit\Services\FoldersService::create() + * @see ImageKit\Services\FoldersService::create() * * @phpstan-type FolderCreateParamsShape = array{ * folderName: string, parentFolderPath: string diff --git a/src/Folders/FolderDeleteParams.php b/src/Folders/FolderDeleteParams.php index 85870454..aa11b23a 100644 --- a/src/Folders/FolderDeleteParams.php +++ b/src/Folders/FolderDeleteParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Folders; +namespace ImageKit\Folders; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; /** * This will delete a folder and all its contents permanently. The API returns an empty response. * - * @see Imagekit\Services\FoldersService::delete() + * @see ImageKit\Services\FoldersService::delete() * * @phpstan-type FolderDeleteParamsShape = array{folderPath: string} */ diff --git a/src/Folders/FolderDeleteResponse.php b/src/Folders/FolderDeleteResponse.php index ba6a1b95..ebb739ca 100644 --- a/src/Folders/FolderDeleteResponse.php +++ b/src/Folders/FolderDeleteResponse.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Imagekit\Folders; +namespace ImageKit\Folders; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type FolderDeleteResponseShape = array diff --git a/src/Folders/FolderMoveParams.php b/src/Folders/FolderMoveParams.php index 5f55b636..e0e66484 100644 --- a/src/Folders/FolderMoveParams.php +++ b/src/Folders/FolderMoveParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Folders; +namespace ImageKit\Folders; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; /** * This will move one folder into another. The selected folder, its nested folders, files, and their versions are moved in this operation. Note: If any file at the destination has the same name as the source file, then the source file and its versions will be appended to the destination file version history. * - * @see Imagekit\Services\FoldersService::move() + * @see ImageKit\Services\FoldersService::move() * * @phpstan-type FolderMoveParamsShape = array{ * destinationPath: string, sourceFolderPath: string diff --git a/src/Folders/FolderMoveResponse.php b/src/Folders/FolderMoveResponse.php index 7151fa0d..57937c45 100644 --- a/src/Folders/FolderMoveResponse.php +++ b/src/Folders/FolderMoveResponse.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Folders; +namespace ImageKit\Folders; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * Job submitted successfully. A `jobId` will be returned. diff --git a/src/Folders/FolderNewResponse.php b/src/Folders/FolderNewResponse.php index f7dd8e41..6ac9d782 100644 --- a/src/Folders/FolderNewResponse.php +++ b/src/Folders/FolderNewResponse.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Imagekit\Folders; +namespace ImageKit\Folders; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type FolderNewResponseShape = array diff --git a/src/Folders/FolderRenameParams.php b/src/Folders/FolderRenameParams.php index dd706364..8b87c509 100644 --- a/src/Folders/FolderRenameParams.php +++ b/src/Folders/FolderRenameParams.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit\Folders; +namespace ImageKit\Folders; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; /** * This API allows you to rename an existing folder. The folder and all its nested assets and sub-folders will remain unchanged, but their paths will be updated to reflect the new folder name. * - * @see Imagekit\Services\FoldersService::rename() + * @see ImageKit\Services\FoldersService::rename() * * @phpstan-type FolderRenameParamsShape = array{ * folderPath: string, newFolderName: string, purgeCache?: bool|null diff --git a/src/Folders/FolderRenameResponse.php b/src/Folders/FolderRenameResponse.php index fa79bc71..9a7fecf1 100644 --- a/src/Folders/FolderRenameResponse.php +++ b/src/Folders/FolderRenameResponse.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Folders; +namespace ImageKit\Folders; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * Job submitted successfully. A `jobId` will be returned. diff --git a/src/Folders/Job/JobGetResponse.php b/src/Folders/Job/JobGetResponse.php index d512c378..96fe6826 100644 --- a/src/Folders/Job/JobGetResponse.php +++ b/src/Folders/Job/JobGetResponse.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace Imagekit\Folders\Job; +namespace ImageKit\Folders\Job; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Folders\Job\JobGetResponse\Status; -use Imagekit\Folders\Job\JobGetResponse\Type; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Folders\Job\JobGetResponse\Status; +use ImageKit\Folders\Job\JobGetResponse\Type; /** * @phpstan-type JobGetResponseShape = array{ diff --git a/src/Folders/Job/JobGetResponse/Status.php b/src/Folders/Job/JobGetResponse/Status.php index 7504b1e1..0d3bad1f 100644 --- a/src/Folders/Job/JobGetResponse/Status.php +++ b/src/Folders/Job/JobGetResponse/Status.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Folders\Job\JobGetResponse; +namespace ImageKit\Folders\Job\JobGetResponse; /** * Status of the bulk job. diff --git a/src/Folders/Job/JobGetResponse/Type.php b/src/Folders/Job/JobGetResponse/Type.php index c23fb745..d4b1bfa0 100644 --- a/src/Folders/Job/JobGetResponse/Type.php +++ b/src/Folders/Job/JobGetResponse/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Folders\Job\JobGetResponse; +namespace ImageKit\Folders\Job\JobGetResponse; /** * Type of the bulk job. diff --git a/src/GetImageAttributesOptions.php b/src/GetImageAttributesOptions.php index dc76fc3b..21ec98f8 100644 --- a/src/GetImageAttributesOptions.php +++ b/src/GetImageAttributesOptions.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit; +namespace ImageKit; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * Options for generating responsive image attributes including `src`, `srcSet`, and `sizes` for HTML `` elements. diff --git a/src/ImageOverlay.php b/src/ImageOverlay.php index 2fb56ad2..959e33bd 100644 --- a/src/ImageOverlay.php +++ b/src/ImageOverlay.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit; +namespace ImageKit; -use Imagekit\BaseOverlay\LayerMode; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ImageOverlay\Encoding; +use ImageKit\BaseOverlay\LayerMode; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ImageOverlay\Encoding; /** - * @phpstan-import-type OverlayPositionShape from \Imagekit\OverlayPosition - * @phpstan-import-type OverlayTimingShape from \Imagekit\OverlayTiming + * @phpstan-import-type OverlayPositionShape from \ImageKit\OverlayPosition + * @phpstan-import-type OverlayTimingShape from \ImageKit\OverlayTiming * * @phpstan-type ImageOverlayShape = array{ * layerMode?: null|LayerMode|value-of, diff --git a/src/ImageOverlay/Encoding.php b/src/ImageOverlay/Encoding.php index 9a3ef436..9dba58a7 100644 --- a/src/ImageOverlay/Encoding.php +++ b/src/ImageOverlay/Encoding.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\ImageOverlay; +namespace ImageKit\ImageOverlay; /** * The input path can be included in the layer as either `i-{input}` or `ie-{base64_encoded_input}`. diff --git a/src/Overlay.php b/src/Overlay.php index 2bd5cc81..7a1df780 100644 --- a/src/Overlay.php +++ b/src/Overlay.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace Imagekit; +namespace ImageKit; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Specifies an overlay to be applied on the parent image or video. * ImageKit supports overlays including images, text, videos, subtitles, and solid colors. * See [Overlay using layers](https://imagekit.io/docs/transformations#overlay-using-layers). * - * @phpstan-import-type TextOverlayShape from \Imagekit\TextOverlay - * @phpstan-import-type ImageOverlayShape from \Imagekit\ImageOverlay - * @phpstan-import-type VideoOverlayShape from \Imagekit\VideoOverlay - * @phpstan-import-type SubtitleOverlayShape from \Imagekit\SubtitleOverlay - * @phpstan-import-type SolidColorOverlayShape from \Imagekit\SolidColorOverlay + * @phpstan-import-type TextOverlayShape from \ImageKit\TextOverlay + * @phpstan-import-type ImageOverlayShape from \ImageKit\ImageOverlay + * @phpstan-import-type VideoOverlayShape from \ImageKit\VideoOverlay + * @phpstan-import-type SubtitleOverlayShape from \ImageKit\SubtitleOverlay + * @phpstan-import-type SolidColorOverlayShape from \ImageKit\SolidColorOverlay * * @phpstan-type OverlayVariants = mixed|TextOverlay|SubtitleOverlay|SolidColorOverlay * @phpstan-type OverlayShape = OverlayVariants|TextOverlayShape|ImageOverlayShape|VideoOverlayShape|SubtitleOverlayShape|SolidColorOverlayShape diff --git a/src/OverlayPosition.php b/src/OverlayPosition.php index 1f008227..b3e88c24 100644 --- a/src/OverlayPosition.php +++ b/src/OverlayPosition.php @@ -2,23 +2,23 @@ declare(strict_types=1); -namespace Imagekit; +namespace ImageKit; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\OverlayPosition\AnchorPoint; -use Imagekit\OverlayPosition\Focus; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\OverlayPosition\AnchorPoint; +use ImageKit\OverlayPosition\Focus; /** - * @phpstan-import-type XVariants from \Imagekit\OverlayPosition\X - * @phpstan-import-type XCenterVariants from \Imagekit\OverlayPosition\XCenter - * @phpstan-import-type YVariants from \Imagekit\OverlayPosition\Y - * @phpstan-import-type YCenterVariants from \Imagekit\OverlayPosition\YCenter - * @phpstan-import-type XShape from \Imagekit\OverlayPosition\X - * @phpstan-import-type XCenterShape from \Imagekit\OverlayPosition\XCenter - * @phpstan-import-type YShape from \Imagekit\OverlayPosition\Y - * @phpstan-import-type YCenterShape from \Imagekit\OverlayPosition\YCenter + * @phpstan-import-type XVariants from \ImageKit\OverlayPosition\X + * @phpstan-import-type XCenterVariants from \ImageKit\OverlayPosition\XCenter + * @phpstan-import-type YVariants from \ImageKit\OverlayPosition\Y + * @phpstan-import-type YCenterVariants from \ImageKit\OverlayPosition\YCenter + * @phpstan-import-type XShape from \ImageKit\OverlayPosition\X + * @phpstan-import-type XCenterShape from \ImageKit\OverlayPosition\XCenter + * @phpstan-import-type YShape from \ImageKit\OverlayPosition\Y + * @phpstan-import-type YCenterShape from \ImageKit\OverlayPosition\YCenter * * @phpstan-type OverlayPositionShape = array{ * anchorPoint?: null|AnchorPoint|value-of, diff --git a/src/OverlayPosition/AnchorPoint.php b/src/OverlayPosition/AnchorPoint.php index 3558bdd6..54b11ef2 100644 --- a/src/OverlayPosition/AnchorPoint.php +++ b/src/OverlayPosition/AnchorPoint.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\OverlayPosition; +namespace ImageKit\OverlayPosition; /** * Sets the anchor point on the base asset from which the overlay offset is calculated. diff --git a/src/OverlayPosition/Focus.php b/src/OverlayPosition/Focus.php index dfd5c954..94e51a84 100644 --- a/src/OverlayPosition/Focus.php +++ b/src/OverlayPosition/Focus.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\OverlayPosition; +namespace ImageKit\OverlayPosition; /** * Specifies the position of the overlay relative to the parent image or video. diff --git a/src/OverlayPosition/X.php b/src/OverlayPosition/X.php index 395fad09..14ed727f 100644 --- a/src/OverlayPosition/X.php +++ b/src/OverlayPosition/X.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\OverlayPosition; +namespace ImageKit\OverlayPosition; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the x-coordinate of the top-left corner of the base asset where the overlay's top-left corner will be positioned. diff --git a/src/OverlayPosition/XCenter.php b/src/OverlayPosition/XCenter.php index a2486561..8269ae11 100644 --- a/src/OverlayPosition/XCenter.php +++ b/src/OverlayPosition/XCenter.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\OverlayPosition; +namespace ImageKit\OverlayPosition; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the x-coordinate on the base asset where the overlay's center will be positioned. diff --git a/src/OverlayPosition/Y.php b/src/OverlayPosition/Y.php index 7931395c..6147c122 100644 --- a/src/OverlayPosition/Y.php +++ b/src/OverlayPosition/Y.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\OverlayPosition; +namespace ImageKit\OverlayPosition; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the y-coordinate of the top-left corner of the base asset where the overlay's top-left corner will be positioned. diff --git a/src/OverlayPosition/YCenter.php b/src/OverlayPosition/YCenter.php index 39ac1c31..7266a870 100644 --- a/src/OverlayPosition/YCenter.php +++ b/src/OverlayPosition/YCenter.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\OverlayPosition; +namespace ImageKit\OverlayPosition; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the y-coordinate on the base asset where the overlay's center will be positioned. diff --git a/src/OverlayTiming.php b/src/OverlayTiming.php index f19f7cb7..ae7fcdb4 100644 --- a/src/OverlayTiming.php +++ b/src/OverlayTiming.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit; +namespace ImageKit; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-import-type DurationVariants from \Imagekit\OverlayTiming\Duration - * @phpstan-import-type EndVariants from \Imagekit\OverlayTiming\End - * @phpstan-import-type StartVariants from \Imagekit\OverlayTiming\Start - * @phpstan-import-type DurationShape from \Imagekit\OverlayTiming\Duration - * @phpstan-import-type EndShape from \Imagekit\OverlayTiming\End - * @phpstan-import-type StartShape from \Imagekit\OverlayTiming\Start + * @phpstan-import-type DurationVariants from \ImageKit\OverlayTiming\Duration + * @phpstan-import-type EndVariants from \ImageKit\OverlayTiming\End + * @phpstan-import-type StartVariants from \ImageKit\OverlayTiming\Start + * @phpstan-import-type DurationShape from \ImageKit\OverlayTiming\Duration + * @phpstan-import-type EndShape from \ImageKit\OverlayTiming\End + * @phpstan-import-type StartShape from \ImageKit\OverlayTiming\Start * * @phpstan-type OverlayTimingShape = array{ * duration?: DurationShape|null, end?: EndShape|null, start?: StartShape|null diff --git a/src/OverlayTiming/Duration.php b/src/OverlayTiming/Duration.php index 39472864..49e167ff 100644 --- a/src/OverlayTiming/Duration.php +++ b/src/OverlayTiming/Duration.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\OverlayTiming; +namespace ImageKit\OverlayTiming; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the duration (in seconds) during which the overlay should appear on the base video. diff --git a/src/OverlayTiming/End.php b/src/OverlayTiming/End.php index 29e47218..1a3cd453 100644 --- a/src/OverlayTiming/End.php +++ b/src/OverlayTiming/End.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\OverlayTiming; +namespace ImageKit\OverlayTiming; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the end time (in seconds) for when the overlay should disappear from the base video. diff --git a/src/OverlayTiming/Start.php b/src/OverlayTiming/Start.php index 3200ff1f..099c5969 100644 --- a/src/OverlayTiming/Start.php +++ b/src/OverlayTiming/Start.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\OverlayTiming; +namespace ImageKit\OverlayTiming; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the start time (in seconds) for when the overlay should appear on the base video. diff --git a/src/RequestOptions.php b/src/RequestOptions.php index b781ae4e..07135340 100644 --- a/src/RequestOptions.php +++ b/src/RequestOptions.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit; +namespace ImageKit; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required as Property; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required as Property; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; use Psr\Http\Client\ClientInterface; use Psr\Http\Message\RequestFactoryInterface; use Psr\Http\Message\StreamFactoryInterface; diff --git a/src/ResponsiveImageAttributes.php b/src/ResponsiveImageAttributes.php index 966754f1..3d7c6912 100644 --- a/src/ResponsiveImageAttributes.php +++ b/src/ResponsiveImageAttributes.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit; +namespace ImageKit; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * Resulting set of attributes suitable for an HTML `` element. diff --git a/src/SavedExtension.php b/src/SavedExtension.php index 18561209..f38114b1 100644 --- a/src/SavedExtension.php +++ b/src/SavedExtension.php @@ -2,21 +2,21 @@ declare(strict_types=1); -namespace Imagekit; +namespace ImageKit; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionConfig\AITasksExtension; -use Imagekit\ExtensionConfig\AutoDescriptionExtension; -use Imagekit\ExtensionConfig\AutoTaggingExtension; -use Imagekit\ExtensionConfig\RemovedotBgExtension; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionConfig\AITasksExtension; +use ImageKit\ExtensionConfig\AutoDescriptionExtension; +use ImageKit\ExtensionConfig\AutoTaggingExtension; +use ImageKit\ExtensionConfig\RemovedotBgExtension; /** * Saved extension object containing extension configuration. * - * @phpstan-import-type ExtensionConfigVariants from \Imagekit\ExtensionConfig - * @phpstan-import-type ExtensionConfigShape from \Imagekit\ExtensionConfig + * @phpstan-import-type ExtensionConfigVariants from \ImageKit\ExtensionConfig + * @phpstan-import-type ExtensionConfigShape from \ImageKit\ExtensionConfig * * @phpstan-type SavedExtensionShape = array{ * id?: string|null, diff --git a/src/SavedExtensions/SavedExtensionCreateParams.php b/src/SavedExtensions/SavedExtensionCreateParams.php index 24194204..c7a2b0e8 100644 --- a/src/SavedExtensions/SavedExtensionCreateParams.php +++ b/src/SavedExtensions/SavedExtensionCreateParams.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\SavedExtensions; - -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionConfig; -use Imagekit\ExtensionConfig\AITasksExtension; -use Imagekit\ExtensionConfig\AutoDescriptionExtension; -use Imagekit\ExtensionConfig\AutoTaggingExtension; -use Imagekit\ExtensionConfig\RemovedotBgExtension; +namespace ImageKit\SavedExtensions; + +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionConfig; +use ImageKit\ExtensionConfig\AITasksExtension; +use ImageKit\ExtensionConfig\AutoDescriptionExtension; +use ImageKit\ExtensionConfig\AutoTaggingExtension; +use ImageKit\ExtensionConfig\RemovedotBgExtension; /** * This API creates a new saved extension. Saved extensions allow you to save complex extension configurations (like AI tasks) and reuse them by referencing the ID in upload or update file APIs. @@ -20,10 +20,10 @@ * **Saved extension limit** \ * You can create a maximum of 100 saved extensions per account. * - * @see Imagekit\Services\SavedExtensionsService::create() + * @see ImageKit\Services\SavedExtensionsService::create() * - * @phpstan-import-type ExtensionConfigVariants from \Imagekit\ExtensionConfig - * @phpstan-import-type ExtensionConfigShape from \Imagekit\ExtensionConfig + * @phpstan-import-type ExtensionConfigVariants from \ImageKit\ExtensionConfig + * @phpstan-import-type ExtensionConfigShape from \ImageKit\ExtensionConfig * * @phpstan-type SavedExtensionCreateParamsShape = array{ * config: ExtensionConfigShape, description: string, name: string diff --git a/src/SavedExtensions/SavedExtensionUpdateParams.php b/src/SavedExtensions/SavedExtensionUpdateParams.php index c1a0e6bb..2107a7f5 100644 --- a/src/SavedExtensions/SavedExtensionUpdateParams.php +++ b/src/SavedExtensions/SavedExtensionUpdateParams.php @@ -2,25 +2,25 @@ declare(strict_types=1); -namespace Imagekit\SavedExtensions; - -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Concerns\SdkParams; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\ExtensionConfig; -use Imagekit\ExtensionConfig\AITasksExtension; -use Imagekit\ExtensionConfig\AutoDescriptionExtension; -use Imagekit\ExtensionConfig\AutoTaggingExtension; -use Imagekit\ExtensionConfig\RemovedotBgExtension; +namespace ImageKit\SavedExtensions; + +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Concerns\SdkParams; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\ExtensionConfig; +use ImageKit\ExtensionConfig\AITasksExtension; +use ImageKit\ExtensionConfig\AutoDescriptionExtension; +use ImageKit\ExtensionConfig\AutoTaggingExtension; +use ImageKit\ExtensionConfig\RemovedotBgExtension; /** * This API updates an existing saved extension. You can update the name, description, or config. * - * @see Imagekit\Services\SavedExtensionsService::update() + * @see ImageKit\Services\SavedExtensionsService::update() * - * @phpstan-import-type ExtensionConfigVariants from \Imagekit\ExtensionConfig - * @phpstan-import-type ExtensionConfigShape from \Imagekit\ExtensionConfig + * @phpstan-import-type ExtensionConfigVariants from \ImageKit\ExtensionConfig + * @phpstan-import-type ExtensionConfigShape from \ImageKit\ExtensionConfig * * @phpstan-type SavedExtensionUpdateParamsShape = array{ * config?: ExtensionConfigShape|null, diff --git a/src/ServiceContracts/Accounts/OriginsContract.php b/src/ServiceContracts/Accounts/OriginsContract.php index 1dee4893..075de491 100644 --- a/src/ServiceContracts/Accounts/OriginsContract.php +++ b/src/ServiceContracts/Accounts/OriginsContract.php @@ -2,21 +2,21 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts\Accounts; +namespace ImageKit\ServiceContracts\Accounts; -use Imagekit\Accounts\Origins\OriginResponse\AkeneoPim; -use Imagekit\Accounts\Origins\OriginResponse\AzureBlobStorage; -use Imagekit\Accounts\Origins\OriginResponse\CloudinaryBackup; -use Imagekit\Accounts\Origins\OriginResponse\GoogleCloudStorageGcs; -use Imagekit\Accounts\Origins\OriginResponse\S3; -use Imagekit\Accounts\Origins\OriginResponse\S3Compatible; -use Imagekit\Accounts\Origins\OriginResponse\WebFolder; -use Imagekit\Accounts\Origins\OriginResponse\WebProxy; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\RequestOptions; +use ImageKit\Accounts\Origins\OriginResponse\AkeneoPim; +use ImageKit\Accounts\Origins\OriginResponse\AzureBlobStorage; +use ImageKit\Accounts\Origins\OriginResponse\CloudinaryBackup; +use ImageKit\Accounts\Origins\OriginResponse\GoogleCloudStorageGcs; +use ImageKit\Accounts\Origins\OriginResponse\S3; +use ImageKit\Accounts\Origins\OriginResponse\S3Compatible; +use ImageKit\Accounts\Origins\OriginResponse\WebFolder; +use ImageKit\Accounts\Origins\OriginResponse\WebProxy; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\RequestOptions; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface OriginsContract { diff --git a/src/ServiceContracts/Accounts/OriginsRawContract.php b/src/ServiceContracts/Accounts/OriginsRawContract.php index 66f09a58..e3cb0579 100644 --- a/src/ServiceContracts/Accounts/OriginsRawContract.php +++ b/src/ServiceContracts/Accounts/OriginsRawContract.php @@ -2,24 +2,24 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts\Accounts; +namespace ImageKit\ServiceContracts\Accounts; -use Imagekit\Accounts\Origins\OriginCreateParams; -use Imagekit\Accounts\Origins\OriginResponse\AkeneoPim; -use Imagekit\Accounts\Origins\OriginResponse\AzureBlobStorage; -use Imagekit\Accounts\Origins\OriginResponse\CloudinaryBackup; -use Imagekit\Accounts\Origins\OriginResponse\GoogleCloudStorageGcs; -use Imagekit\Accounts\Origins\OriginResponse\S3; -use Imagekit\Accounts\Origins\OriginResponse\S3Compatible; -use Imagekit\Accounts\Origins\OriginResponse\WebFolder; -use Imagekit\Accounts\Origins\OriginResponse\WebProxy; -use Imagekit\Accounts\Origins\OriginUpdateParams; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\RequestOptions; +use ImageKit\Accounts\Origins\OriginCreateParams; +use ImageKit\Accounts\Origins\OriginResponse\AkeneoPim; +use ImageKit\Accounts\Origins\OriginResponse\AzureBlobStorage; +use ImageKit\Accounts\Origins\OriginResponse\CloudinaryBackup; +use ImageKit\Accounts\Origins\OriginResponse\GoogleCloudStorageGcs; +use ImageKit\Accounts\Origins\OriginResponse\S3; +use ImageKit\Accounts\Origins\OriginResponse\S3Compatible; +use ImageKit\Accounts\Origins\OriginResponse\WebFolder; +use ImageKit\Accounts\Origins\OriginResponse\WebProxy; +use ImageKit\Accounts\Origins\OriginUpdateParams; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\RequestOptions; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface OriginsRawContract { diff --git a/src/ServiceContracts/Accounts/URLEndpointsContract.php b/src/ServiceContracts/Accounts/URLEndpointsContract.php index 1589a2de..44b69db0 100644 --- a/src/ServiceContracts/Accounts/URLEndpointsContract.php +++ b/src/ServiceContracts/Accounts/URLEndpointsContract.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts\Accounts; +namespace ImageKit\ServiceContracts\Accounts; -use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\AkamaiURLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\CloudinaryURLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\ImgixURLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\RequestOptions; +use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\AkamaiURLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\CloudinaryURLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\ImgixURLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\RequestOptions; /** - * @phpstan-import-type URLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter - * @phpstan-import-type URLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter as URLRewriterShape1 - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type URLRewriterShape from \ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter + * @phpstan-import-type URLRewriterShape from \ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter as URLRewriterShape1 + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface URLEndpointsContract { @@ -54,7 +54,7 @@ public function update( string $description, array $origins = [], string $urlPrefix = '', - \Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\CloudinaryURLRewriter|array|\Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\ImgixURLRewriter|\Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\AkamaiURLRewriter|null $urlRewriter = null, + \ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\CloudinaryURLRewriter|array|\ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\ImgixURLRewriter|\ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\AkamaiURLRewriter|null $urlRewriter = null, RequestOptions|array|null $requestOptions = null, ): URLEndpointResponse; diff --git a/src/ServiceContracts/Accounts/URLEndpointsRawContract.php b/src/ServiceContracts/Accounts/URLEndpointsRawContract.php index 31d3615d..bbf30517 100644 --- a/src/ServiceContracts/Accounts/URLEndpointsRawContract.php +++ b/src/ServiceContracts/Accounts/URLEndpointsRawContract.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts\Accounts; +namespace ImageKit\ServiceContracts\Accounts; -use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams; -use Imagekit\Accounts\URLEndpoints\URLEndpointResponse; -use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\RequestOptions; +use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams; +use ImageKit\Accounts\URLEndpoints\URLEndpointResponse; +use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\RequestOptions; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface URLEndpointsRawContract { diff --git a/src/ServiceContracts/Accounts/UsageContract.php b/src/ServiceContracts/Accounts/UsageContract.php index 5a77662a..f316b17d 100644 --- a/src/ServiceContracts/Accounts/UsageContract.php +++ b/src/ServiceContracts/Accounts/UsageContract.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts\Accounts; +namespace ImageKit\ServiceContracts\Accounts; -use Imagekit\Accounts\Usage\UsageGetResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\RequestOptions; +use ImageKit\Accounts\Usage\UsageGetResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\RequestOptions; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface UsageContract { diff --git a/src/ServiceContracts/Accounts/UsageRawContract.php b/src/ServiceContracts/Accounts/UsageRawContract.php index a1f1809e..ec1d057c 100644 --- a/src/ServiceContracts/Accounts/UsageRawContract.php +++ b/src/ServiceContracts/Accounts/UsageRawContract.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts\Accounts; +namespace ImageKit\ServiceContracts\Accounts; -use Imagekit\Accounts\Usage\UsageGetParams; -use Imagekit\Accounts\Usage\UsageGetResponse; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\RequestOptions; +use ImageKit\Accounts\Usage\UsageGetParams; +use ImageKit\Accounts\Usage\UsageGetResponse; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\RequestOptions; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface UsageRawContract { diff --git a/src/ServiceContracts/AccountsContract.php b/src/ServiceContracts/AccountsContract.php index f65e2076..593d29a6 100644 --- a/src/ServiceContracts/AccountsContract.php +++ b/src/ServiceContracts/AccountsContract.php @@ -2,6 +2,6 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts; +namespace ImageKit\ServiceContracts; interface AccountsContract {} diff --git a/src/ServiceContracts/AccountsRawContract.php b/src/ServiceContracts/AccountsRawContract.php index c4da8e64..8937636a 100644 --- a/src/ServiceContracts/AccountsRawContract.php +++ b/src/ServiceContracts/AccountsRawContract.php @@ -2,6 +2,6 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts; +namespace ImageKit\ServiceContracts; interface AccountsRawContract {} diff --git a/src/ServiceContracts/AssetsContract.php b/src/ServiceContracts/AssetsContract.php index 0c3aac67..6ee1b360 100644 --- a/src/ServiceContracts/AssetsContract.php +++ b/src/ServiceContracts/AssetsContract.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts; +namespace ImageKit\ServiceContracts; -use Imagekit\Assets\AssetListParams\FileType; -use Imagekit\Assets\AssetListParams\Sort; -use Imagekit\Assets\AssetListParams\Type; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Files\File; -use Imagekit\Files\Folder; -use Imagekit\RequestOptions; +use ImageKit\Assets\AssetListParams\FileType; +use ImageKit\Assets\AssetListParams\Sort; +use ImageKit\Assets\AssetListParams\Type; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Files\File; +use ImageKit\Files\Folder; +use ImageKit\RequestOptions; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface AssetsContract { diff --git a/src/ServiceContracts/AssetsRawContract.php b/src/ServiceContracts/AssetsRawContract.php index 378f145b..824bfd3e 100644 --- a/src/ServiceContracts/AssetsRawContract.php +++ b/src/ServiceContracts/AssetsRawContract.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts; +namespace ImageKit\ServiceContracts; -use Imagekit\Assets\AssetListParams; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Files\File; -use Imagekit\Files\Folder; -use Imagekit\RequestOptions; +use ImageKit\Assets\AssetListParams; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Files\File; +use ImageKit\Files\Folder; +use ImageKit\RequestOptions; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface AssetsRawContract { diff --git a/src/ServiceContracts/Beta/V2/FilesContract.php b/src/ServiceContracts/Beta/V2/FilesContract.php index f54c2f5f..0a864d25 100644 --- a/src/ServiceContracts/Beta/V2/FilesContract.php +++ b/src/ServiceContracts/Beta/V2/FilesContract.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts\Beta\V2; +namespace ImageKit\ServiceContracts\Beta\V2; -use Imagekit\Beta\V2\Files\FileUploadParams\ResponseField; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation; -use Imagekit\Beta\V2\Files\FileUploadResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Core\FileParam; -use Imagekit\RequestOptions; +use ImageKit\Beta\V2\Files\FileUploadParams\ResponseField; +use ImageKit\Beta\V2\Files\FileUploadParams\Transformation; +use ImageKit\Beta\V2\Files\FileUploadResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Core\FileParam; +use ImageKit\RequestOptions; /** - * @phpstan-import-type ExtensionItemShape from \Imagekit\ExtensionItem - * @phpstan-import-type TransformationShape from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type ExtensionItemShape from \ImageKit\ExtensionItem + * @phpstan-import-type TransformationShape from \ImageKit\Beta\V2\Files\FileUploadParams\Transformation + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface FilesContract { diff --git a/src/ServiceContracts/Beta/V2/FilesRawContract.php b/src/ServiceContracts/Beta/V2/FilesRawContract.php index 29c5de52..f66987e1 100644 --- a/src/ServiceContracts/Beta/V2/FilesRawContract.php +++ b/src/ServiceContracts/Beta/V2/FilesRawContract.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts\Beta\V2; +namespace ImageKit\ServiceContracts\Beta\V2; -use Imagekit\Beta\V2\Files\FileUploadParams; -use Imagekit\Beta\V2\Files\FileUploadResponse; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\RequestOptions; +use ImageKit\Beta\V2\Files\FileUploadParams; +use ImageKit\Beta\V2\Files\FileUploadResponse; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\RequestOptions; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface FilesRawContract { diff --git a/src/ServiceContracts/Beta/V2Contract.php b/src/ServiceContracts/Beta/V2Contract.php index b560e528..c3c8cd8c 100644 --- a/src/ServiceContracts/Beta/V2Contract.php +++ b/src/ServiceContracts/Beta/V2Contract.php @@ -2,6 +2,6 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts\Beta; +namespace ImageKit\ServiceContracts\Beta; interface V2Contract {} diff --git a/src/ServiceContracts/Beta/V2RawContract.php b/src/ServiceContracts/Beta/V2RawContract.php index 998afd13..3faca374 100644 --- a/src/ServiceContracts/Beta/V2RawContract.php +++ b/src/ServiceContracts/Beta/V2RawContract.php @@ -2,6 +2,6 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts\Beta; +namespace ImageKit\ServiceContracts\Beta; interface V2RawContract {} diff --git a/src/ServiceContracts/BetaContract.php b/src/ServiceContracts/BetaContract.php index 98f96434..675430fc 100644 --- a/src/ServiceContracts/BetaContract.php +++ b/src/ServiceContracts/BetaContract.php @@ -2,6 +2,6 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts; +namespace ImageKit\ServiceContracts; interface BetaContract {} diff --git a/src/ServiceContracts/BetaRawContract.php b/src/ServiceContracts/BetaRawContract.php index 144bdf55..a66cbdd3 100644 --- a/src/ServiceContracts/BetaRawContract.php +++ b/src/ServiceContracts/BetaRawContract.php @@ -2,6 +2,6 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts; +namespace ImageKit\ServiceContracts; interface BetaRawContract {} diff --git a/src/ServiceContracts/Cache/InvalidationContract.php b/src/ServiceContracts/Cache/InvalidationContract.php index 18c88763..0201dc00 100644 --- a/src/ServiceContracts/Cache/InvalidationContract.php +++ b/src/ServiceContracts/Cache/InvalidationContract.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts\Cache; +namespace ImageKit\ServiceContracts\Cache; -use Imagekit\Cache\Invalidation\InvalidationGetResponse; -use Imagekit\Cache\Invalidation\InvalidationNewResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\RequestOptions; +use ImageKit\Cache\Invalidation\InvalidationGetResponse; +use ImageKit\Cache\Invalidation\InvalidationNewResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\RequestOptions; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface InvalidationContract { diff --git a/src/ServiceContracts/Cache/InvalidationRawContract.php b/src/ServiceContracts/Cache/InvalidationRawContract.php index ecf3270e..dfb084c9 100644 --- a/src/ServiceContracts/Cache/InvalidationRawContract.php +++ b/src/ServiceContracts/Cache/InvalidationRawContract.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts\Cache; +namespace ImageKit\ServiceContracts\Cache; -use Imagekit\Cache\Invalidation\InvalidationCreateParams; -use Imagekit\Cache\Invalidation\InvalidationGetResponse; -use Imagekit\Cache\Invalidation\InvalidationNewResponse; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\RequestOptions; +use ImageKit\Cache\Invalidation\InvalidationCreateParams; +use ImageKit\Cache\Invalidation\InvalidationGetResponse; +use ImageKit\Cache\Invalidation\InvalidationNewResponse; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\RequestOptions; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface InvalidationRawContract { diff --git a/src/ServiceContracts/CacheContract.php b/src/ServiceContracts/CacheContract.php index e9e3c36d..aa3c07b6 100644 --- a/src/ServiceContracts/CacheContract.php +++ b/src/ServiceContracts/CacheContract.php @@ -2,6 +2,6 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts; +namespace ImageKit\ServiceContracts; interface CacheContract {} diff --git a/src/ServiceContracts/CacheRawContract.php b/src/ServiceContracts/CacheRawContract.php index 601fbc3a..11eab8d3 100644 --- a/src/ServiceContracts/CacheRawContract.php +++ b/src/ServiceContracts/CacheRawContract.php @@ -2,6 +2,6 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts; +namespace ImageKit\ServiceContracts; interface CacheRawContract {} diff --git a/src/ServiceContracts/CustomMetadataFieldsContract.php b/src/ServiceContracts/CustomMetadataFieldsContract.php index 5614e767..d7967a9d 100644 --- a/src/ServiceContracts/CustomMetadataFieldsContract.php +++ b/src/ServiceContracts/CustomMetadataFieldsContract.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts; +namespace ImageKit\ServiceContracts; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\CustomMetadataFields\CustomMetadataField; -use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; -use Imagekit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; -use Imagekit\RequestOptions; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\CustomMetadataFields\CustomMetadataField; +use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; +use ImageKit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; +use ImageKit\RequestOptions; /** - * @phpstan-import-type SchemaShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema - * @phpstan-import-type SchemaShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema as SchemaShape1 - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type SchemaShape from \ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema + * @phpstan-import-type SchemaShape from \ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema as SchemaShape1 + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface CustomMetadataFieldsContract { @@ -39,7 +39,7 @@ public function create( * * @param string $id should be a valid custom metadata field id * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. This parameter is required if `schema` is not provided. - * @param \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema|SchemaShape1 $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. + * @param \ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema|SchemaShape1 $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. * @param RequestOpts|null $requestOptions * * @throws APIException @@ -47,7 +47,7 @@ public function create( public function update( string $id, ?string $label = null, - \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema|array|null $schema = null, + \ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema|array|null $schema = null, RequestOptions|array|null $requestOptions = null, ): CustomMetadataField; diff --git a/src/ServiceContracts/CustomMetadataFieldsRawContract.php b/src/ServiceContracts/CustomMetadataFieldsRawContract.php index b28c430e..25b7b107 100644 --- a/src/ServiceContracts/CustomMetadataFieldsRawContract.php +++ b/src/ServiceContracts/CustomMetadataFieldsRawContract.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts; +namespace ImageKit\ServiceContracts; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\CustomMetadataFields\CustomMetadataField; -use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams; -use Imagekit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; -use Imagekit\CustomMetadataFields\CustomMetadataFieldListParams; -use Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams; -use Imagekit\RequestOptions; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\CustomMetadataFields\CustomMetadataField; +use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams; +use ImageKit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; +use ImageKit\CustomMetadataFields\CustomMetadataFieldListParams; +use ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams; +use ImageKit\RequestOptions; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface CustomMetadataFieldsRawContract { diff --git a/src/ServiceContracts/Files/BulkContract.php b/src/ServiceContracts/Files/BulkContract.php index 35954c92..4ec1adf3 100644 --- a/src/ServiceContracts/Files/BulkContract.php +++ b/src/ServiceContracts/Files/BulkContract.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts\Files; +namespace ImageKit\ServiceContracts\Files; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Files\Bulk\BulkAddTagsResponse; -use Imagekit\Files\Bulk\BulkDeleteResponse; -use Imagekit\Files\Bulk\BulkRemoveAITagsResponse; -use Imagekit\Files\Bulk\BulkRemoveTagsResponse; -use Imagekit\RequestOptions; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Files\Bulk\BulkAddTagsResponse; +use ImageKit\Files\Bulk\BulkDeleteResponse; +use ImageKit\Files\Bulk\BulkRemoveAITagsResponse; +use ImageKit\Files\Bulk\BulkRemoveTagsResponse; +use ImageKit\RequestOptions; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface BulkContract { diff --git a/src/ServiceContracts/Files/BulkRawContract.php b/src/ServiceContracts/Files/BulkRawContract.php index f4d0f74d..6062f309 100644 --- a/src/ServiceContracts/Files/BulkRawContract.php +++ b/src/ServiceContracts/Files/BulkRawContract.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts\Files; +namespace ImageKit\ServiceContracts\Files; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Files\Bulk\BulkAddTagsParams; -use Imagekit\Files\Bulk\BulkAddTagsResponse; -use Imagekit\Files\Bulk\BulkDeleteParams; -use Imagekit\Files\Bulk\BulkDeleteResponse; -use Imagekit\Files\Bulk\BulkRemoveAITagsParams; -use Imagekit\Files\Bulk\BulkRemoveAITagsResponse; -use Imagekit\Files\Bulk\BulkRemoveTagsParams; -use Imagekit\Files\Bulk\BulkRemoveTagsResponse; -use Imagekit\RequestOptions; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Files\Bulk\BulkAddTagsParams; +use ImageKit\Files\Bulk\BulkAddTagsResponse; +use ImageKit\Files\Bulk\BulkDeleteParams; +use ImageKit\Files\Bulk\BulkDeleteResponse; +use ImageKit\Files\Bulk\BulkRemoveAITagsParams; +use ImageKit\Files\Bulk\BulkRemoveAITagsResponse; +use ImageKit\Files\Bulk\BulkRemoveTagsParams; +use ImageKit\Files\Bulk\BulkRemoveTagsResponse; +use ImageKit\RequestOptions; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface BulkRawContract { diff --git a/src/ServiceContracts/Files/MetadataContract.php b/src/ServiceContracts/Files/MetadataContract.php index 6590f24c..bac8b5c5 100644 --- a/src/ServiceContracts/Files/MetadataContract.php +++ b/src/ServiceContracts/Files/MetadataContract.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts\Files; +namespace ImageKit\ServiceContracts\Files; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Files\Metadata; -use Imagekit\RequestOptions; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Files\Metadata; +use ImageKit\RequestOptions; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface MetadataContract { diff --git a/src/ServiceContracts/Files/MetadataRawContract.php b/src/ServiceContracts/Files/MetadataRawContract.php index d13cb89b..837e12b0 100644 --- a/src/ServiceContracts/Files/MetadataRawContract.php +++ b/src/ServiceContracts/Files/MetadataRawContract.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts\Files; +namespace ImageKit\ServiceContracts\Files; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Files\Metadata; -use Imagekit\Files\Metadata\MetadataGetFromURLParams; -use Imagekit\RequestOptions; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Files\Metadata; +use ImageKit\Files\Metadata\MetadataGetFromURLParams; +use ImageKit\RequestOptions; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface MetadataRawContract { diff --git a/src/ServiceContracts/Files/VersionsContract.php b/src/ServiceContracts/Files/VersionsContract.php index 7165daf9..cd697185 100644 --- a/src/ServiceContracts/Files/VersionsContract.php +++ b/src/ServiceContracts/Files/VersionsContract.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts\Files; +namespace ImageKit\ServiceContracts\Files; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Files\File; -use Imagekit\Files\Versions\VersionDeleteResponse; -use Imagekit\RequestOptions; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Files\File; +use ImageKit\Files\Versions\VersionDeleteResponse; +use ImageKit\RequestOptions; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface VersionsContract { diff --git a/src/ServiceContracts/Files/VersionsRawContract.php b/src/ServiceContracts/Files/VersionsRawContract.php index 188e7681..746d3baa 100644 --- a/src/ServiceContracts/Files/VersionsRawContract.php +++ b/src/ServiceContracts/Files/VersionsRawContract.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts\Files; +namespace ImageKit\ServiceContracts\Files; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Files\File; -use Imagekit\Files\Versions\VersionDeleteParams; -use Imagekit\Files\Versions\VersionDeleteResponse; -use Imagekit\Files\Versions\VersionGetParams; -use Imagekit\Files\Versions\VersionRestoreParams; -use Imagekit\RequestOptions; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Files\File; +use ImageKit\Files\Versions\VersionDeleteParams; +use ImageKit\Files\Versions\VersionDeleteResponse; +use ImageKit\Files\Versions\VersionGetParams; +use ImageKit\Files\Versions\VersionRestoreParams; +use ImageKit\RequestOptions; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface VersionsRawContract { diff --git a/src/ServiceContracts/FilesContract.php b/src/ServiceContracts/FilesContract.php index 77a2e514..06f120ee 100644 --- a/src/ServiceContracts/FilesContract.php +++ b/src/ServiceContracts/FilesContract.php @@ -2,27 +2,27 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts; +namespace ImageKit\ServiceContracts; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Core\FileParam; -use Imagekit\Files\File; -use Imagekit\Files\FileCopyResponse; -use Imagekit\Files\FileMoveResponse; -use Imagekit\Files\FileRenameResponse; -use Imagekit\Files\FileUpdateParams\Publish; -use Imagekit\Files\FileUpdateResponse; -use Imagekit\Files\FileUploadParams\ResponseField; -use Imagekit\Files\FileUploadParams\Transformation; -use Imagekit\Files\FileUploadResponse; -use Imagekit\RequestOptions; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Core\FileParam; +use ImageKit\Files\File; +use ImageKit\Files\FileCopyResponse; +use ImageKit\Files\FileMoveResponse; +use ImageKit\Files\FileRenameResponse; +use ImageKit\Files\FileUpdateParams\Publish; +use ImageKit\Files\FileUpdateResponse; +use ImageKit\Files\FileUploadParams\ResponseField; +use ImageKit\Files\FileUploadParams\Transformation; +use ImageKit\Files\FileUploadResponse; +use ImageKit\RequestOptions; /** - * @phpstan-import-type RemoveAITagsShape from \Imagekit\Files\FileUpdateParams\RemoveAITags - * @phpstan-import-type PublishShape from \Imagekit\Files\FileUpdateParams\Publish - * @phpstan-import-type TransformationShape from \Imagekit\Files\FileUploadParams\Transformation - * @phpstan-import-type ExtensionItemShape from \Imagekit\ExtensionItem - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RemoveAITagsShape from \ImageKit\Files\FileUpdateParams\RemoveAITags + * @phpstan-import-type PublishShape from \ImageKit\Files\FileUpdateParams\Publish + * @phpstan-import-type TransformationShape from \ImageKit\Files\FileUploadParams\Transformation + * @phpstan-import-type ExtensionItemShape from \ImageKit\ExtensionItem + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface FilesContract { diff --git a/src/ServiceContracts/FilesRawContract.php b/src/ServiceContracts/FilesRawContract.php index 9b7501c7..54a96cd0 100644 --- a/src/ServiceContracts/FilesRawContract.php +++ b/src/ServiceContracts/FilesRawContract.php @@ -2,25 +2,25 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts; +namespace ImageKit\ServiceContracts; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Files\File; -use Imagekit\Files\FileCopyParams; -use Imagekit\Files\FileCopyResponse; -use Imagekit\Files\FileMoveParams; -use Imagekit\Files\FileMoveResponse; -use Imagekit\Files\FileRenameParams; -use Imagekit\Files\FileRenameResponse; -use Imagekit\Files\FileUpdateParams; -use Imagekit\Files\FileUpdateResponse; -use Imagekit\Files\FileUploadParams; -use Imagekit\Files\FileUploadResponse; -use Imagekit\RequestOptions; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Files\File; +use ImageKit\Files\FileCopyParams; +use ImageKit\Files\FileCopyResponse; +use ImageKit\Files\FileMoveParams; +use ImageKit\Files\FileMoveResponse; +use ImageKit\Files\FileRenameParams; +use ImageKit\Files\FileRenameResponse; +use ImageKit\Files\FileUpdateParams; +use ImageKit\Files\FileUpdateResponse; +use ImageKit\Files\FileUploadParams; +use ImageKit\Files\FileUploadResponse; +use ImageKit\RequestOptions; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface FilesRawContract { diff --git a/src/ServiceContracts/Folders/JobContract.php b/src/ServiceContracts/Folders/JobContract.php index 1362f086..e111bc22 100644 --- a/src/ServiceContracts/Folders/JobContract.php +++ b/src/ServiceContracts/Folders/JobContract.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts\Folders; +namespace ImageKit\ServiceContracts\Folders; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Folders\Job\JobGetResponse; -use Imagekit\RequestOptions; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Folders\Job\JobGetResponse; +use ImageKit\RequestOptions; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface JobContract { diff --git a/src/ServiceContracts/Folders/JobRawContract.php b/src/ServiceContracts/Folders/JobRawContract.php index f46ff737..f1fe291b 100644 --- a/src/ServiceContracts/Folders/JobRawContract.php +++ b/src/ServiceContracts/Folders/JobRawContract.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts\Folders; +namespace ImageKit\ServiceContracts\Folders; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Folders\Job\JobGetResponse; -use Imagekit\RequestOptions; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Folders\Job\JobGetResponse; +use ImageKit\RequestOptions; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface JobRawContract { diff --git a/src/ServiceContracts/FoldersContract.php b/src/ServiceContracts/FoldersContract.php index 87ef5b64..45ad8fdd 100644 --- a/src/ServiceContracts/FoldersContract.php +++ b/src/ServiceContracts/FoldersContract.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts; +namespace ImageKit\ServiceContracts; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Folders\FolderCopyResponse; -use Imagekit\Folders\FolderDeleteResponse; -use Imagekit\Folders\FolderMoveResponse; -use Imagekit\Folders\FolderNewResponse; -use Imagekit\Folders\FolderRenameResponse; -use Imagekit\RequestOptions; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Folders\FolderCopyResponse; +use ImageKit\Folders\FolderDeleteResponse; +use ImageKit\Folders\FolderMoveResponse; +use ImageKit\Folders\FolderNewResponse; +use ImageKit\Folders\FolderRenameResponse; +use ImageKit\RequestOptions; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface FoldersContract { diff --git a/src/ServiceContracts/FoldersRawContract.php b/src/ServiceContracts/FoldersRawContract.php index 973814f7..5713793e 100644 --- a/src/ServiceContracts/FoldersRawContract.php +++ b/src/ServiceContracts/FoldersRawContract.php @@ -2,24 +2,24 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts; +namespace ImageKit\ServiceContracts; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Folders\FolderCopyParams; -use Imagekit\Folders\FolderCopyResponse; -use Imagekit\Folders\FolderCreateParams; -use Imagekit\Folders\FolderDeleteParams; -use Imagekit\Folders\FolderDeleteResponse; -use Imagekit\Folders\FolderMoveParams; -use Imagekit\Folders\FolderMoveResponse; -use Imagekit\Folders\FolderNewResponse; -use Imagekit\Folders\FolderRenameParams; -use Imagekit\Folders\FolderRenameResponse; -use Imagekit\RequestOptions; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Folders\FolderCopyParams; +use ImageKit\Folders\FolderCopyResponse; +use ImageKit\Folders\FolderCreateParams; +use ImageKit\Folders\FolderDeleteParams; +use ImageKit\Folders\FolderDeleteResponse; +use ImageKit\Folders\FolderMoveParams; +use ImageKit\Folders\FolderMoveResponse; +use ImageKit\Folders\FolderNewResponse; +use ImageKit\Folders\FolderRenameParams; +use ImageKit\Folders\FolderRenameResponse; +use ImageKit\RequestOptions; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface FoldersRawContract { diff --git a/src/ServiceContracts/SavedExtensionsContract.php b/src/ServiceContracts/SavedExtensionsContract.php index 7aedcd36..4104f9e1 100644 --- a/src/ServiceContracts/SavedExtensionsContract.php +++ b/src/ServiceContracts/SavedExtensionsContract.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts; +namespace ImageKit\ServiceContracts; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\ExtensionConfig\AITasksExtension; -use Imagekit\ExtensionConfig\AutoDescriptionExtension; -use Imagekit\ExtensionConfig\AutoTaggingExtension; -use Imagekit\ExtensionConfig\RemovedotBgExtension; -use Imagekit\RequestOptions; -use Imagekit\SavedExtension; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\ExtensionConfig\AITasksExtension; +use ImageKit\ExtensionConfig\AutoDescriptionExtension; +use ImageKit\ExtensionConfig\AutoTaggingExtension; +use ImageKit\ExtensionConfig\RemovedotBgExtension; +use ImageKit\RequestOptions; +use ImageKit\SavedExtension; /** - * @phpstan-import-type ExtensionConfigShape from \Imagekit\ExtensionConfig - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type ExtensionConfigShape from \ImageKit\ExtensionConfig + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface SavedExtensionsContract { diff --git a/src/ServiceContracts/SavedExtensionsRawContract.php b/src/ServiceContracts/SavedExtensionsRawContract.php index ccdb8a05..95f1d0e9 100644 --- a/src/ServiceContracts/SavedExtensionsRawContract.php +++ b/src/ServiceContracts/SavedExtensionsRawContract.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts; +namespace ImageKit\ServiceContracts; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\RequestOptions; -use Imagekit\SavedExtension; -use Imagekit\SavedExtensions\SavedExtensionCreateParams; -use Imagekit\SavedExtensions\SavedExtensionUpdateParams; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\RequestOptions; +use ImageKit\SavedExtension; +use ImageKit\SavedExtensions\SavedExtensionCreateParams; +use ImageKit\SavedExtensions\SavedExtensionUpdateParams; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ interface SavedExtensionsRawContract { diff --git a/src/ServiceContracts/WebhooksContract.php b/src/ServiceContracts/WebhooksContract.php index 019a1119..4cc93acb 100644 --- a/src/ServiceContracts/WebhooksContract.php +++ b/src/ServiceContracts/WebhooksContract.php @@ -2,21 +2,21 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts; +namespace ImageKit\ServiceContracts; -use Imagekit\Core\Exceptions\WebhookException; -use Imagekit\Webhooks\FileCreateEvent; -use Imagekit\Webhooks\FileDeleteEvent; -use Imagekit\Webhooks\FileUpdateEvent; -use Imagekit\Webhooks\FileVersionCreateEvent; -use Imagekit\Webhooks\FileVersionDeleteEvent; -use Imagekit\Webhooks\UploadPostTransformErrorEvent; -use Imagekit\Webhooks\UploadPostTransformSuccessEvent; -use Imagekit\Webhooks\UploadPreTransformErrorEvent; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent; -use Imagekit\Webhooks\VideoTransformationAcceptedEvent; -use Imagekit\Webhooks\VideoTransformationErrorEvent; -use Imagekit\Webhooks\VideoTransformationReadyEvent; +use ImageKit\Core\Exceptions\WebhookException; +use ImageKit\Webhooks\FileCreateEvent; +use ImageKit\Webhooks\FileDeleteEvent; +use ImageKit\Webhooks\FileUpdateEvent; +use ImageKit\Webhooks\FileVersionCreateEvent; +use ImageKit\Webhooks\FileVersionDeleteEvent; +use ImageKit\Webhooks\UploadPostTransformErrorEvent; +use ImageKit\Webhooks\UploadPostTransformSuccessEvent; +use ImageKit\Webhooks\UploadPreTransformErrorEvent; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent; +use ImageKit\Webhooks\VideoTransformationAcceptedEvent; +use ImageKit\Webhooks\VideoTransformationErrorEvent; +use ImageKit\Webhooks\VideoTransformationReadyEvent; interface WebhooksContract { diff --git a/src/ServiceContracts/WebhooksRawContract.php b/src/ServiceContracts/WebhooksRawContract.php index 9be0a2e1..80aa9694 100644 --- a/src/ServiceContracts/WebhooksRawContract.php +++ b/src/ServiceContracts/WebhooksRawContract.php @@ -2,6 +2,6 @@ declare(strict_types=1); -namespace Imagekit\ServiceContracts; +namespace ImageKit\ServiceContracts; interface WebhooksRawContract {} diff --git a/src/Services/Accounts/OriginsRawService.php b/src/Services/Accounts/OriginsRawService.php index d4d6c37f..fe0e3a30 100644 --- a/src/Services/Accounts/OriginsRawService.php +++ b/src/Services/Accounts/OriginsRawService.php @@ -2,28 +2,28 @@ declare(strict_types=1); -namespace Imagekit\Services\Accounts; +namespace ImageKit\Services\Accounts; -use Imagekit\Accounts\Origins\OriginCreateParams; -use Imagekit\Accounts\Origins\OriginResponse; -use Imagekit\Accounts\Origins\OriginResponse\AkeneoPim; -use Imagekit\Accounts\Origins\OriginResponse\AzureBlobStorage; -use Imagekit\Accounts\Origins\OriginResponse\CloudinaryBackup; -use Imagekit\Accounts\Origins\OriginResponse\GoogleCloudStorageGcs; -use Imagekit\Accounts\Origins\OriginResponse\S3; -use Imagekit\Accounts\Origins\OriginResponse\S3Compatible; -use Imagekit\Accounts\Origins\OriginResponse\WebFolder; -use Imagekit\Accounts\Origins\OriginResponse\WebProxy; -use Imagekit\Accounts\Origins\OriginUpdateParams; -use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Conversion\ListOf; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\Accounts\OriginsRawContract; +use ImageKit\Accounts\Origins\OriginCreateParams; +use ImageKit\Accounts\Origins\OriginResponse; +use ImageKit\Accounts\Origins\OriginResponse\AkeneoPim; +use ImageKit\Accounts\Origins\OriginResponse\AzureBlobStorage; +use ImageKit\Accounts\Origins\OriginResponse\CloudinaryBackup; +use ImageKit\Accounts\Origins\OriginResponse\GoogleCloudStorageGcs; +use ImageKit\Accounts\Origins\OriginResponse\S3; +use ImageKit\Accounts\Origins\OriginResponse\S3Compatible; +use ImageKit\Accounts\Origins\OriginResponse\WebFolder; +use ImageKit\Accounts\Origins\OriginResponse\WebProxy; +use ImageKit\Accounts\Origins\OriginUpdateParams; +use ImageKit\Client; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Conversion\ListOf; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Accounts\OriginsRawContract; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class OriginsRawService implements OriginsRawContract { diff --git a/src/Services/Accounts/OriginsService.php b/src/Services/Accounts/OriginsService.php index f38b5eef..41e60fbb 100644 --- a/src/Services/Accounts/OriginsService.php +++ b/src/Services/Accounts/OriginsService.php @@ -2,24 +2,24 @@ declare(strict_types=1); -namespace Imagekit\Services\Accounts; +namespace ImageKit\Services\Accounts; -use Imagekit\Accounts\Origins\OriginResponse\AkeneoPim; -use Imagekit\Accounts\Origins\OriginResponse\AzureBlobStorage; -use Imagekit\Accounts\Origins\OriginResponse\CloudinaryBackup; -use Imagekit\Accounts\Origins\OriginResponse\GoogleCloudStorageGcs; -use Imagekit\Accounts\Origins\OriginResponse\S3; -use Imagekit\Accounts\Origins\OriginResponse\S3Compatible; -use Imagekit\Accounts\Origins\OriginResponse\WebFolder; -use Imagekit\Accounts\Origins\OriginResponse\WebProxy; -use Imagekit\Client; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Core\Util; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\Accounts\OriginsContract; +use ImageKit\Accounts\Origins\OriginResponse\AkeneoPim; +use ImageKit\Accounts\Origins\OriginResponse\AzureBlobStorage; +use ImageKit\Accounts\Origins\OriginResponse\CloudinaryBackup; +use ImageKit\Accounts\Origins\OriginResponse\GoogleCloudStorageGcs; +use ImageKit\Accounts\Origins\OriginResponse\S3; +use ImageKit\Accounts\Origins\OriginResponse\S3Compatible; +use ImageKit\Accounts\Origins\OriginResponse\WebFolder; +use ImageKit\Accounts\Origins\OriginResponse\WebProxy; +use ImageKit\Client; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Core\Util; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Accounts\OriginsContract; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class OriginsService implements OriginsContract { diff --git a/src/Services/Accounts/URLEndpointsRawService.php b/src/Services/Accounts/URLEndpointsRawService.php index 2dadaa3a..7dac59d1 100644 --- a/src/Services/Accounts/URLEndpointsRawService.php +++ b/src/Services/Accounts/URLEndpointsRawService.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace Imagekit\Services\Accounts; +namespace ImageKit\Services\Accounts; -use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams; -use Imagekit\Accounts\URLEndpoints\URLEndpointResponse; -use Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams; -use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Conversion\ListOf; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\Accounts\URLEndpointsRawContract; +use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams; +use ImageKit\Accounts\URLEndpoints\URLEndpointResponse; +use ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams; +use ImageKit\Client; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Conversion\ListOf; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Accounts\URLEndpointsRawContract; /** - * @phpstan-import-type URLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter - * @phpstan-import-type URLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter as URLRewriterShape1 - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type URLRewriterShape from \ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter + * @phpstan-import-type URLRewriterShape from \ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter as URLRewriterShape1 + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class URLEndpointsRawService implements URLEndpointsRawContract { diff --git a/src/Services/Accounts/URLEndpointsService.php b/src/Services/Accounts/URLEndpointsService.php index 5637058d..0740c4f5 100644 --- a/src/Services/Accounts/URLEndpointsService.php +++ b/src/Services/Accounts/URLEndpointsService.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace Imagekit\Services\Accounts; - -use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\AkamaiURLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\CloudinaryURLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\ImgixURLRewriter; -use Imagekit\Accounts\URLEndpoints\URLEndpointResponse; -use Imagekit\Client; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Core\Util; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\Accounts\URLEndpointsContract; +namespace ImageKit\Services\Accounts; + +use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\AkamaiURLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\CloudinaryURLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter\ImgixURLRewriter; +use ImageKit\Accounts\URLEndpoints\URLEndpointResponse; +use ImageKit\Client; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Core\Util; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Accounts\URLEndpointsContract; /** - * @phpstan-import-type URLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter - * @phpstan-import-type URLRewriterShape from \Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter as URLRewriterShape1 - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type URLRewriterShape from \ImageKit\Accounts\URLEndpoints\URLEndpointCreateParams\URLRewriter + * @phpstan-import-type URLRewriterShape from \ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter as URLRewriterShape1 + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class URLEndpointsService implements URLEndpointsContract { @@ -90,7 +90,7 @@ public function update( string $description, array $origins = [], string $urlPrefix = '', - \Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\CloudinaryURLRewriter|array|\Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\ImgixURLRewriter|\Imagekit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\AkamaiURLRewriter|null $urlRewriter = null, + \ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\CloudinaryURLRewriter|array|\ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\ImgixURLRewriter|\ImageKit\Accounts\URLEndpoints\URLEndpointUpdateParams\URLRewriter\AkamaiURLRewriter|null $urlRewriter = null, RequestOptions|array|null $requestOptions = null, ): URLEndpointResponse { $params = Util::removeNulls( diff --git a/src/Services/Accounts/UsageRawService.php b/src/Services/Accounts/UsageRawService.php index 43933f7a..0de038f8 100644 --- a/src/Services/Accounts/UsageRawService.php +++ b/src/Services/Accounts/UsageRawService.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit\Services\Accounts; +namespace ImageKit\Services\Accounts; -use Imagekit\Accounts\Usage\UsageGetParams; -use Imagekit\Accounts\Usage\UsageGetResponse; -use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\Accounts\UsageRawContract; +use ImageKit\Accounts\Usage\UsageGetParams; +use ImageKit\Accounts\Usage\UsageGetResponse; +use ImageKit\Client; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Accounts\UsageRawContract; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class UsageRawService implements UsageRawContract { diff --git a/src/Services/Accounts/UsageService.php b/src/Services/Accounts/UsageService.php index 8d74cbf2..a49773b4 100644 --- a/src/Services/Accounts/UsageService.php +++ b/src/Services/Accounts/UsageService.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Services\Accounts; +namespace ImageKit\Services\Accounts; -use Imagekit\Accounts\Usage\UsageGetResponse; -use Imagekit\Client; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Core\Util; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\Accounts\UsageContract; +use ImageKit\Accounts\Usage\UsageGetResponse; +use ImageKit\Client; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Core\Util; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Accounts\UsageContract; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class UsageService implements UsageContract { diff --git a/src/Services/AccountsRawService.php b/src/Services/AccountsRawService.php index 199cf855..fa3fca54 100644 --- a/src/Services/AccountsRawService.php +++ b/src/Services/AccountsRawService.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Imagekit\Services; +namespace ImageKit\Services; -use Imagekit\Client; -use Imagekit\ServiceContracts\AccountsRawContract; +use ImageKit\Client; +use ImageKit\ServiceContracts\AccountsRawContract; final class AccountsRawService implements AccountsRawContract { diff --git a/src/Services/AccountsService.php b/src/Services/AccountsService.php index 56f16fe7..c21981cd 100644 --- a/src/Services/AccountsService.php +++ b/src/Services/AccountsService.php @@ -2,13 +2,13 @@ declare(strict_types=1); -namespace Imagekit\Services; +namespace ImageKit\Services; -use Imagekit\Client; -use Imagekit\ServiceContracts\AccountsContract; -use Imagekit\Services\Accounts\OriginsService; -use Imagekit\Services\Accounts\URLEndpointsService; -use Imagekit\Services\Accounts\UsageService; +use ImageKit\Client; +use ImageKit\ServiceContracts\AccountsContract; +use ImageKit\Services\Accounts\OriginsService; +use ImageKit\Services\Accounts\URLEndpointsService; +use ImageKit\Services\Accounts\UsageService; final class AccountsService implements AccountsContract { diff --git a/src/Services/AssetsRawService.php b/src/Services/AssetsRawService.php index 37332460..bd20f60e 100644 --- a/src/Services/AssetsRawService.php +++ b/src/Services/AssetsRawService.php @@ -2,24 +2,24 @@ declare(strict_types=1); -namespace Imagekit\Services; +namespace ImageKit\Services; -use Imagekit\Assets\AssetListParams; -use Imagekit\Assets\AssetListParams\FileType; -use Imagekit\Assets\AssetListParams\Sort; -use Imagekit\Assets\AssetListParams\Type; -use Imagekit\Assets\AssetListResponseItem; -use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Conversion\ListOf; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Files\File; -use Imagekit\Files\Folder; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\AssetsRawContract; +use ImageKit\Assets\AssetListParams; +use ImageKit\Assets\AssetListParams\FileType; +use ImageKit\Assets\AssetListParams\Sort; +use ImageKit\Assets\AssetListParams\Type; +use ImageKit\Assets\AssetListResponseItem; +use ImageKit\Client; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Conversion\ListOf; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Files\File; +use ImageKit\Files\Folder; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\AssetsRawContract; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class AssetsRawService implements AssetsRawContract { diff --git a/src/Services/AssetsService.php b/src/Services/AssetsService.php index e437ce59..dcfd4933 100644 --- a/src/Services/AssetsService.php +++ b/src/Services/AssetsService.php @@ -2,21 +2,21 @@ declare(strict_types=1); -namespace Imagekit\Services; +namespace ImageKit\Services; -use Imagekit\Assets\AssetListParams\FileType; -use Imagekit\Assets\AssetListParams\Sort; -use Imagekit\Assets\AssetListParams\Type; -use Imagekit\Client; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Core\Util; -use Imagekit\Files\File; -use Imagekit\Files\Folder; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\AssetsContract; +use ImageKit\Assets\AssetListParams\FileType; +use ImageKit\Assets\AssetListParams\Sort; +use ImageKit\Assets\AssetListParams\Type; +use ImageKit\Client; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Core\Util; +use ImageKit\Files\File; +use ImageKit\Files\Folder; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\AssetsContract; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class AssetsService implements AssetsContract { diff --git a/src/Services/Beta/V2/FilesRawService.php b/src/Services/Beta/V2/FilesRawService.php index 2f68f904..f9dc045e 100644 --- a/src/Services/Beta/V2/FilesRawService.php +++ b/src/Services/Beta/V2/FilesRawService.php @@ -2,23 +2,23 @@ declare(strict_types=1); -namespace Imagekit\Services\Beta\V2; +namespace ImageKit\Services\Beta\V2; -use Imagekit\Beta\V2\Files\FileUploadParams; -use Imagekit\Beta\V2\Files\FileUploadParams\ResponseField; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation; -use Imagekit\Beta\V2\Files\FileUploadResponse; -use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Core\FileParam; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\Beta\V2\FilesRawContract; +use ImageKit\Beta\V2\Files\FileUploadParams; +use ImageKit\Beta\V2\Files\FileUploadParams\ResponseField; +use ImageKit\Beta\V2\Files\FileUploadParams\Transformation; +use ImageKit\Beta\V2\Files\FileUploadResponse; +use ImageKit\Client; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Core\FileParam; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Beta\V2\FilesRawContract; /** - * @phpstan-import-type ExtensionItemShape from \Imagekit\ExtensionItem - * @phpstan-import-type TransformationShape from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type ExtensionItemShape from \ImageKit\ExtensionItem + * @phpstan-import-type TransformationShape from \ImageKit\Beta\V2\Files\FileUploadParams\Transformation + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class FilesRawService implements FilesRawContract { diff --git a/src/Services/Beta/V2/FilesService.php b/src/Services/Beta/V2/FilesService.php index 2bdad7fa..425e3147 100644 --- a/src/Services/Beta/V2/FilesService.php +++ b/src/Services/Beta/V2/FilesService.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace Imagekit\Services\Beta\V2; +namespace ImageKit\Services\Beta\V2; -use Imagekit\Beta\V2\Files\FileUploadParams\ResponseField; -use Imagekit\Beta\V2\Files\FileUploadParams\Transformation; -use Imagekit\Beta\V2\Files\FileUploadResponse; -use Imagekit\Client; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Core\FileParam; -use Imagekit\Core\Util; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\Beta\V2\FilesContract; +use ImageKit\Beta\V2\Files\FileUploadParams\ResponseField; +use ImageKit\Beta\V2\Files\FileUploadParams\Transformation; +use ImageKit\Beta\V2\Files\FileUploadResponse; +use ImageKit\Client; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Core\FileParam; +use ImageKit\Core\Util; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Beta\V2\FilesContract; /** - * @phpstan-import-type ExtensionItemShape from \Imagekit\ExtensionItem - * @phpstan-import-type TransformationShape from \Imagekit\Beta\V2\Files\FileUploadParams\Transformation - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type ExtensionItemShape from \ImageKit\ExtensionItem + * @phpstan-import-type TransformationShape from \ImageKit\Beta\V2\Files\FileUploadParams\Transformation + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class FilesService implements FilesContract { diff --git a/src/Services/Beta/V2RawService.php b/src/Services/Beta/V2RawService.php index 7c1b018e..2b0b996e 100644 --- a/src/Services/Beta/V2RawService.php +++ b/src/Services/Beta/V2RawService.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Imagekit\Services\Beta; +namespace ImageKit\Services\Beta; -use Imagekit\Client; -use Imagekit\ServiceContracts\Beta\V2RawContract; +use ImageKit\Client; +use ImageKit\ServiceContracts\Beta\V2RawContract; final class V2RawService implements V2RawContract { diff --git a/src/Services/Beta/V2Service.php b/src/Services/Beta/V2Service.php index df86b811..05b1c6b8 100644 --- a/src/Services/Beta/V2Service.php +++ b/src/Services/Beta/V2Service.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Services\Beta; +namespace ImageKit\Services\Beta; -use Imagekit\Client; -use Imagekit\ServiceContracts\Beta\V2Contract; -use Imagekit\Services\Beta\V2\FilesService; +use ImageKit\Client; +use ImageKit\ServiceContracts\Beta\V2Contract; +use ImageKit\Services\Beta\V2\FilesService; final class V2Service implements V2Contract { diff --git a/src/Services/BetaRawService.php b/src/Services/BetaRawService.php index 1be324fd..e5ef3afa 100644 --- a/src/Services/BetaRawService.php +++ b/src/Services/BetaRawService.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Imagekit\Services; +namespace ImageKit\Services; -use Imagekit\Client; -use Imagekit\ServiceContracts\BetaRawContract; +use ImageKit\Client; +use ImageKit\ServiceContracts\BetaRawContract; final class BetaRawService implements BetaRawContract { diff --git a/src/Services/BetaService.php b/src/Services/BetaService.php index b96ecc75..d91b098a 100644 --- a/src/Services/BetaService.php +++ b/src/Services/BetaService.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Services; +namespace ImageKit\Services; -use Imagekit\Client; -use Imagekit\ServiceContracts\BetaContract; -use Imagekit\Services\Beta\V2Service; +use ImageKit\Client; +use ImageKit\ServiceContracts\BetaContract; +use ImageKit\Services\Beta\V2Service; final class BetaService implements BetaContract { diff --git a/src/Services/Cache/InvalidationRawService.php b/src/Services/Cache/InvalidationRawService.php index 91d5267c..1d9daaef 100644 --- a/src/Services/Cache/InvalidationRawService.php +++ b/src/Services/Cache/InvalidationRawService.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\Services\Cache; +namespace ImageKit\Services\Cache; -use Imagekit\Cache\Invalidation\InvalidationCreateParams; -use Imagekit\Cache\Invalidation\InvalidationGetResponse; -use Imagekit\Cache\Invalidation\InvalidationNewResponse; -use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\Cache\InvalidationRawContract; +use ImageKit\Cache\Invalidation\InvalidationCreateParams; +use ImageKit\Cache\Invalidation\InvalidationGetResponse; +use ImageKit\Cache\Invalidation\InvalidationNewResponse; +use ImageKit\Client; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Cache\InvalidationRawContract; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class InvalidationRawService implements InvalidationRawContract { diff --git a/src/Services/Cache/InvalidationService.php b/src/Services/Cache/InvalidationService.php index 0caa2ee1..cfc001e2 100644 --- a/src/Services/Cache/InvalidationService.php +++ b/src/Services/Cache/InvalidationService.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit\Services\Cache; +namespace ImageKit\Services\Cache; -use Imagekit\Cache\Invalidation\InvalidationGetResponse; -use Imagekit\Cache\Invalidation\InvalidationNewResponse; -use Imagekit\Client; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Core\Util; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\Cache\InvalidationContract; +use ImageKit\Cache\Invalidation\InvalidationGetResponse; +use ImageKit\Cache\Invalidation\InvalidationNewResponse; +use ImageKit\Client; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Core\Util; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Cache\InvalidationContract; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class InvalidationService implements InvalidationContract { diff --git a/src/Services/CacheRawService.php b/src/Services/CacheRawService.php index a435dd7c..096ab979 100644 --- a/src/Services/CacheRawService.php +++ b/src/Services/CacheRawService.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Imagekit\Services; +namespace ImageKit\Services; -use Imagekit\Client; -use Imagekit\ServiceContracts\CacheRawContract; +use ImageKit\Client; +use ImageKit\ServiceContracts\CacheRawContract; final class CacheRawService implements CacheRawContract { diff --git a/src/Services/CacheService.php b/src/Services/CacheService.php index 53112d6f..f0c12dd5 100644 --- a/src/Services/CacheService.php +++ b/src/Services/CacheService.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Services; +namespace ImageKit\Services; -use Imagekit\Client; -use Imagekit\ServiceContracts\CacheContract; -use Imagekit\Services\Cache\InvalidationService; +use ImageKit\Client; +use ImageKit\ServiceContracts\CacheContract; +use ImageKit\Services\Cache\InvalidationService; final class CacheService implements CacheContract { diff --git a/src/Services/CustomMetadataFieldsRawService.php b/src/Services/CustomMetadataFieldsRawService.php index 6a93b197..8d3f5877 100644 --- a/src/Services/CustomMetadataFieldsRawService.php +++ b/src/Services/CustomMetadataFieldsRawService.php @@ -2,25 +2,25 @@ declare(strict_types=1); -namespace Imagekit\Services; +namespace ImageKit\Services; -use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Conversion\ListOf; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\CustomMetadataFields\CustomMetadataField; -use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams; -use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; -use Imagekit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; -use Imagekit\CustomMetadataFields\CustomMetadataFieldListParams; -use Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\CustomMetadataFieldsRawContract; +use ImageKit\Client; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Conversion\ListOf; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\CustomMetadataFields\CustomMetadataField; +use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams; +use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; +use ImageKit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; +use ImageKit\CustomMetadataFields\CustomMetadataFieldListParams; +use ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\CustomMetadataFieldsRawContract; /** - * @phpstan-import-type SchemaShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema - * @phpstan-import-type SchemaShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema as SchemaShape1 - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type SchemaShape from \ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema + * @phpstan-import-type SchemaShape from \ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema as SchemaShape1 + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class CustomMetadataFieldsRawService implements CustomMetadataFieldsRawContract { diff --git a/src/Services/CustomMetadataFieldsService.php b/src/Services/CustomMetadataFieldsService.php index d0e03ec1..62c848bd 100644 --- a/src/Services/CustomMetadataFieldsService.php +++ b/src/Services/CustomMetadataFieldsService.php @@ -2,21 +2,21 @@ declare(strict_types=1); -namespace Imagekit\Services; +namespace ImageKit\Services; -use Imagekit\Client; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Core\Util; -use Imagekit\CustomMetadataFields\CustomMetadataField; -use Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; -use Imagekit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\CustomMetadataFieldsContract; +use ImageKit\Client; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Core\Util; +use ImageKit\CustomMetadataFields\CustomMetadataField; +use ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema; +use ImageKit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\CustomMetadataFieldsContract; /** - * @phpstan-import-type SchemaShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema - * @phpstan-import-type SchemaShape from \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema as SchemaShape1 - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type SchemaShape from \ImageKit\CustomMetadataFields\CustomMetadataFieldCreateParams\Schema + * @phpstan-import-type SchemaShape from \ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema as SchemaShape1 + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class CustomMetadataFieldsService implements CustomMetadataFieldsContract { @@ -68,7 +68,7 @@ public function create( * * @param string $id should be a valid custom metadata field id * @param string $label Human readable name of the custom metadata field. This should be unique across all non deleted custom metadata fields. This name is displayed as form field label to the users while setting field value on an asset in the media library UI. This parameter is required if `schema` is not provided. - * @param \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema|SchemaShape1 $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. + * @param \ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema|SchemaShape1 $schema An object that describes the rules for the custom metadata key. This parameter is required if `label` is not provided. Note: `type` cannot be updated and will be ignored if sent with the `schema`. The schema will be validated as per the existing `type`. * @param RequestOpts|null $requestOptions * * @throws APIException @@ -76,7 +76,7 @@ public function create( public function update( string $id, ?string $label = null, - \Imagekit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema|array|null $schema = null, + \ImageKit\CustomMetadataFields\CustomMetadataFieldUpdateParams\Schema|array|null $schema = null, RequestOptions|array|null $requestOptions = null, ): CustomMetadataField { $params = Util::removeNulls(['label' => $label, 'schema' => $schema]); diff --git a/src/Services/Files/BulkRawService.php b/src/Services/Files/BulkRawService.php index 02f07fdc..97aba6e4 100644 --- a/src/Services/Files/BulkRawService.php +++ b/src/Services/Files/BulkRawService.php @@ -2,24 +2,24 @@ declare(strict_types=1); -namespace Imagekit\Services\Files; +namespace ImageKit\Services\Files; -use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Files\Bulk\BulkAddTagsParams; -use Imagekit\Files\Bulk\BulkAddTagsResponse; -use Imagekit\Files\Bulk\BulkDeleteParams; -use Imagekit\Files\Bulk\BulkDeleteResponse; -use Imagekit\Files\Bulk\BulkRemoveAITagsParams; -use Imagekit\Files\Bulk\BulkRemoveAITagsResponse; -use Imagekit\Files\Bulk\BulkRemoveTagsParams; -use Imagekit\Files\Bulk\BulkRemoveTagsResponse; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\Files\BulkRawContract; +use ImageKit\Client; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Files\Bulk\BulkAddTagsParams; +use ImageKit\Files\Bulk\BulkAddTagsResponse; +use ImageKit\Files\Bulk\BulkDeleteParams; +use ImageKit\Files\Bulk\BulkDeleteResponse; +use ImageKit\Files\Bulk\BulkRemoveAITagsParams; +use ImageKit\Files\Bulk\BulkRemoveAITagsResponse; +use ImageKit\Files\Bulk\BulkRemoveTagsParams; +use ImageKit\Files\Bulk\BulkRemoveTagsResponse; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Files\BulkRawContract; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class BulkRawService implements BulkRawContract { diff --git a/src/Services/Files/BulkService.php b/src/Services/Files/BulkService.php index b3562409..89fb681f 100644 --- a/src/Services/Files/BulkService.php +++ b/src/Services/Files/BulkService.php @@ -2,20 +2,20 @@ declare(strict_types=1); -namespace Imagekit\Services\Files; - -use Imagekit\Client; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Core\Util; -use Imagekit\Files\Bulk\BulkAddTagsResponse; -use Imagekit\Files\Bulk\BulkDeleteResponse; -use Imagekit\Files\Bulk\BulkRemoveAITagsResponse; -use Imagekit\Files\Bulk\BulkRemoveTagsResponse; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\Files\BulkContract; +namespace ImageKit\Services\Files; + +use ImageKit\Client; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Core\Util; +use ImageKit\Files\Bulk\BulkAddTagsResponse; +use ImageKit\Files\Bulk\BulkDeleteResponse; +use ImageKit\Files\Bulk\BulkRemoveAITagsResponse; +use ImageKit\Files\Bulk\BulkRemoveTagsResponse; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Files\BulkContract; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class BulkService implements BulkContract { diff --git a/src/Services/Files/MetadataRawService.php b/src/Services/Files/MetadataRawService.php index 9defe1ad..db981b5c 100644 --- a/src/Services/Files/MetadataRawService.php +++ b/src/Services/Files/MetadataRawService.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit\Services\Files; +namespace ImageKit\Services\Files; -use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Files\Metadata; -use Imagekit\Files\Metadata\MetadataGetFromURLParams; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\Files\MetadataRawContract; +use ImageKit\Client; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Files\Metadata; +use ImageKit\Files\Metadata\MetadataGetFromURLParams; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Files\MetadataRawContract; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class MetadataRawService implements MetadataRawContract { diff --git a/src/Services/Files/MetadataService.php b/src/Services/Files/MetadataService.php index 5440854c..bfffa68c 100644 --- a/src/Services/Files/MetadataService.php +++ b/src/Services/Files/MetadataService.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Services\Files; +namespace ImageKit\Services\Files; -use Imagekit\Client; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Core\Util; -use Imagekit\Files\Metadata; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\Files\MetadataContract; +use ImageKit\Client; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Core\Util; +use ImageKit\Files\Metadata; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Files\MetadataContract; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class MetadataService implements MetadataContract { diff --git a/src/Services/Files/VersionsRawService.php b/src/Services/Files/VersionsRawService.php index 652aa608..10c58a31 100644 --- a/src/Services/Files/VersionsRawService.php +++ b/src/Services/Files/VersionsRawService.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace Imagekit\Services\Files; +namespace ImageKit\Services\Files; -use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Conversion\ListOf; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Files\File; -use Imagekit\Files\Versions\VersionDeleteParams; -use Imagekit\Files\Versions\VersionDeleteResponse; -use Imagekit\Files\Versions\VersionGetParams; -use Imagekit\Files\Versions\VersionRestoreParams; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\Files\VersionsRawContract; +use ImageKit\Client; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Conversion\ListOf; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Files\File; +use ImageKit\Files\Versions\VersionDeleteParams; +use ImageKit\Files\Versions\VersionDeleteResponse; +use ImageKit\Files\Versions\VersionGetParams; +use ImageKit\Files\Versions\VersionRestoreParams; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Files\VersionsRawContract; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class VersionsRawService implements VersionsRawContract { diff --git a/src/Services/Files/VersionsService.php b/src/Services/Files/VersionsService.php index 0d0007a8..527eadfe 100644 --- a/src/Services/Files/VersionsService.php +++ b/src/Services/Files/VersionsService.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit\Services\Files; +namespace ImageKit\Services\Files; -use Imagekit\Client; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Core\Util; -use Imagekit\Files\File; -use Imagekit\Files\Versions\VersionDeleteResponse; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\Files\VersionsContract; +use ImageKit\Client; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Core\Util; +use ImageKit\Files\File; +use ImageKit\Files\Versions\VersionDeleteResponse; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Files\VersionsContract; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class VersionsService implements VersionsContract { diff --git a/src/Services/FilesRawService.php b/src/Services/FilesRawService.php index 3cb525ea..19c71ac6 100644 --- a/src/Services/FilesRawService.php +++ b/src/Services/FilesRawService.php @@ -2,35 +2,35 @@ declare(strict_types=1); -namespace Imagekit\Services; +namespace ImageKit\Services; -use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Core\FileParam; -use Imagekit\Files\File; -use Imagekit\Files\FileCopyParams; -use Imagekit\Files\FileCopyResponse; -use Imagekit\Files\FileMoveParams; -use Imagekit\Files\FileMoveResponse; -use Imagekit\Files\FileRenameParams; -use Imagekit\Files\FileRenameResponse; -use Imagekit\Files\FileUpdateParams; -use Imagekit\Files\FileUpdateParams\Publish; -use Imagekit\Files\FileUpdateResponse; -use Imagekit\Files\FileUploadParams; -use Imagekit\Files\FileUploadParams\ResponseField; -use Imagekit\Files\FileUploadParams\Transformation; -use Imagekit\Files\FileUploadResponse; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\FilesRawContract; +use ImageKit\Client; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Core\FileParam; +use ImageKit\Files\File; +use ImageKit\Files\FileCopyParams; +use ImageKit\Files\FileCopyResponse; +use ImageKit\Files\FileMoveParams; +use ImageKit\Files\FileMoveResponse; +use ImageKit\Files\FileRenameParams; +use ImageKit\Files\FileRenameResponse; +use ImageKit\Files\FileUpdateParams; +use ImageKit\Files\FileUpdateParams\Publish; +use ImageKit\Files\FileUpdateResponse; +use ImageKit\Files\FileUploadParams; +use ImageKit\Files\FileUploadParams\ResponseField; +use ImageKit\Files\FileUploadParams\Transformation; +use ImageKit\Files\FileUploadResponse; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\FilesRawContract; /** - * @phpstan-import-type RemoveAITagsShape from \Imagekit\Files\FileUpdateParams\RemoveAITags - * @phpstan-import-type PublishShape from \Imagekit\Files\FileUpdateParams\Publish - * @phpstan-import-type TransformationShape from \Imagekit\Files\FileUploadParams\Transformation - * @phpstan-import-type ExtensionItemShape from \Imagekit\ExtensionItem - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RemoveAITagsShape from \ImageKit\Files\FileUpdateParams\RemoveAITags + * @phpstan-import-type PublishShape from \ImageKit\Files\FileUpdateParams\Publish + * @phpstan-import-type TransformationShape from \ImageKit\Files\FileUploadParams\Transformation + * @phpstan-import-type ExtensionItemShape from \ImageKit\ExtensionItem + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class FilesRawService implements FilesRawContract { diff --git a/src/Services/FilesService.php b/src/Services/FilesService.php index 9980b528..18a5d76e 100644 --- a/src/Services/FilesService.php +++ b/src/Services/FilesService.php @@ -2,33 +2,33 @@ declare(strict_types=1); -namespace Imagekit\Services; +namespace ImageKit\Services; -use Imagekit\Client; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Core\FileParam; -use Imagekit\Core\Util; -use Imagekit\Files\File; -use Imagekit\Files\FileCopyResponse; -use Imagekit\Files\FileMoveResponse; -use Imagekit\Files\FileRenameResponse; -use Imagekit\Files\FileUpdateParams\Publish; -use Imagekit\Files\FileUpdateResponse; -use Imagekit\Files\FileUploadParams\ResponseField; -use Imagekit\Files\FileUploadParams\Transformation; -use Imagekit\Files\FileUploadResponse; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\FilesContract; -use Imagekit\Services\Files\BulkService; -use Imagekit\Services\Files\MetadataService; -use Imagekit\Services\Files\VersionsService; +use ImageKit\Client; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Core\FileParam; +use ImageKit\Core\Util; +use ImageKit\Files\File; +use ImageKit\Files\FileCopyResponse; +use ImageKit\Files\FileMoveResponse; +use ImageKit\Files\FileRenameResponse; +use ImageKit\Files\FileUpdateParams\Publish; +use ImageKit\Files\FileUpdateResponse; +use ImageKit\Files\FileUploadParams\ResponseField; +use ImageKit\Files\FileUploadParams\Transformation; +use ImageKit\Files\FileUploadResponse; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\FilesContract; +use ImageKit\Services\Files\BulkService; +use ImageKit\Services\Files\MetadataService; +use ImageKit\Services\Files\VersionsService; /** - * @phpstan-import-type RemoveAITagsShape from \Imagekit\Files\FileUpdateParams\RemoveAITags - * @phpstan-import-type PublishShape from \Imagekit\Files\FileUpdateParams\Publish - * @phpstan-import-type TransformationShape from \Imagekit\Files\FileUploadParams\Transformation - * @phpstan-import-type ExtensionItemShape from \Imagekit\ExtensionItem - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RemoveAITagsShape from \ImageKit\Files\FileUpdateParams\RemoveAITags + * @phpstan-import-type PublishShape from \ImageKit\Files\FileUpdateParams\Publish + * @phpstan-import-type TransformationShape from \ImageKit\Files\FileUploadParams\Transformation + * @phpstan-import-type ExtensionItemShape from \ImageKit\ExtensionItem + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class FilesService implements FilesContract { diff --git a/src/Services/Folders/JobRawService.php b/src/Services/Folders/JobRawService.php index 9f64052f..84c93d8e 100644 --- a/src/Services/Folders/JobRawService.php +++ b/src/Services/Folders/JobRawService.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Services\Folders; +namespace ImageKit\Services\Folders; -use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Folders\Job\JobGetResponse; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\Folders\JobRawContract; +use ImageKit\Client; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Folders\Job\JobGetResponse; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Folders\JobRawContract; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class JobRawService implements JobRawContract { diff --git a/src/Services/Folders/JobService.php b/src/Services/Folders/JobService.php index 18442f06..9197ed41 100644 --- a/src/Services/Folders/JobService.php +++ b/src/Services/Folders/JobService.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace Imagekit\Services\Folders; +namespace ImageKit\Services\Folders; -use Imagekit\Client; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Folders\Job\JobGetResponse; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\Folders\JobContract; +use ImageKit\Client; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Folders\Job\JobGetResponse; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\Folders\JobContract; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class JobService implements JobContract { diff --git a/src/Services/FoldersRawService.php b/src/Services/FoldersRawService.php index c88e08b9..9c1d0dbb 100644 --- a/src/Services/FoldersRawService.php +++ b/src/Services/FoldersRawService.php @@ -2,26 +2,26 @@ declare(strict_types=1); -namespace Imagekit\Services; +namespace ImageKit\Services; -use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Folders\FolderCopyParams; -use Imagekit\Folders\FolderCopyResponse; -use Imagekit\Folders\FolderCreateParams; -use Imagekit\Folders\FolderDeleteParams; -use Imagekit\Folders\FolderDeleteResponse; -use Imagekit\Folders\FolderMoveParams; -use Imagekit\Folders\FolderMoveResponse; -use Imagekit\Folders\FolderNewResponse; -use Imagekit\Folders\FolderRenameParams; -use Imagekit\Folders\FolderRenameResponse; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\FoldersRawContract; +use ImageKit\Client; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Folders\FolderCopyParams; +use ImageKit\Folders\FolderCopyResponse; +use ImageKit\Folders\FolderCreateParams; +use ImageKit\Folders\FolderDeleteParams; +use ImageKit\Folders\FolderDeleteResponse; +use ImageKit\Folders\FolderMoveParams; +use ImageKit\Folders\FolderMoveResponse; +use ImageKit\Folders\FolderNewResponse; +use ImageKit\Folders\FolderRenameParams; +use ImageKit\Folders\FolderRenameResponse; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\FoldersRawContract; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class FoldersRawService implements FoldersRawContract { diff --git a/src/Services/FoldersService.php b/src/Services/FoldersService.php index 4ceabed1..8b5d95f4 100644 --- a/src/Services/FoldersService.php +++ b/src/Services/FoldersService.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace Imagekit\Services; - -use Imagekit\Client; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Core\Util; -use Imagekit\Folders\FolderCopyResponse; -use Imagekit\Folders\FolderDeleteResponse; -use Imagekit\Folders\FolderMoveResponse; -use Imagekit\Folders\FolderNewResponse; -use Imagekit\Folders\FolderRenameResponse; -use Imagekit\RequestOptions; -use Imagekit\ServiceContracts\FoldersContract; -use Imagekit\Services\Folders\JobService; +namespace ImageKit\Services; + +use ImageKit\Client; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Core\Util; +use ImageKit\Folders\FolderCopyResponse; +use ImageKit\Folders\FolderDeleteResponse; +use ImageKit\Folders\FolderMoveResponse; +use ImageKit\Folders\FolderNewResponse; +use ImageKit\Folders\FolderRenameResponse; +use ImageKit\RequestOptions; +use ImageKit\ServiceContracts\FoldersContract; +use ImageKit\Services\Folders\JobService; /** - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class FoldersService implements FoldersContract { diff --git a/src/Services/SavedExtensionsRawService.php b/src/Services/SavedExtensionsRawService.php index f641d0f6..17f551b5 100644 --- a/src/Services/SavedExtensionsRawService.php +++ b/src/Services/SavedExtensionsRawService.php @@ -2,21 +2,21 @@ declare(strict_types=1); -namespace Imagekit\Services; +namespace ImageKit\Services; -use Imagekit\Client; -use Imagekit\Core\Contracts\BaseResponse; -use Imagekit\Core\Conversion\ListOf; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\RequestOptions; -use Imagekit\SavedExtension; -use Imagekit\SavedExtensions\SavedExtensionCreateParams; -use Imagekit\SavedExtensions\SavedExtensionUpdateParams; -use Imagekit\ServiceContracts\SavedExtensionsRawContract; +use ImageKit\Client; +use ImageKit\Core\Contracts\BaseResponse; +use ImageKit\Core\Conversion\ListOf; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\RequestOptions; +use ImageKit\SavedExtension; +use ImageKit\SavedExtensions\SavedExtensionCreateParams; +use ImageKit\SavedExtensions\SavedExtensionUpdateParams; +use ImageKit\ServiceContracts\SavedExtensionsRawContract; /** - * @phpstan-import-type ExtensionConfigShape from \Imagekit\ExtensionConfig - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type ExtensionConfigShape from \ImageKit\ExtensionConfig + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class SavedExtensionsRawService implements SavedExtensionsRawContract { diff --git a/src/Services/SavedExtensionsService.php b/src/Services/SavedExtensionsService.php index 0be0dfa8..d296f313 100644 --- a/src/Services/SavedExtensionsService.php +++ b/src/Services/SavedExtensionsService.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace Imagekit\Services; - -use Imagekit\Client; -use Imagekit\Core\Exceptions\APIException; -use Imagekit\Core\Util; -use Imagekit\ExtensionConfig\AITasksExtension; -use Imagekit\ExtensionConfig\AutoDescriptionExtension; -use Imagekit\ExtensionConfig\AutoTaggingExtension; -use Imagekit\ExtensionConfig\RemovedotBgExtension; -use Imagekit\RequestOptions; -use Imagekit\SavedExtension; -use Imagekit\ServiceContracts\SavedExtensionsContract; +namespace ImageKit\Services; + +use ImageKit\Client; +use ImageKit\Core\Exceptions\APIException; +use ImageKit\Core\Util; +use ImageKit\ExtensionConfig\AITasksExtension; +use ImageKit\ExtensionConfig\AutoDescriptionExtension; +use ImageKit\ExtensionConfig\AutoTaggingExtension; +use ImageKit\ExtensionConfig\RemovedotBgExtension; +use ImageKit\RequestOptions; +use ImageKit\SavedExtension; +use ImageKit\ServiceContracts\SavedExtensionsContract; /** - * @phpstan-import-type ExtensionConfigShape from \Imagekit\ExtensionConfig - * @phpstan-import-type RequestOpts from \Imagekit\RequestOptions + * @phpstan-import-type ExtensionConfigShape from \ImageKit\ExtensionConfig + * @phpstan-import-type RequestOpts from \ImageKit\RequestOptions */ final class SavedExtensionsService implements SavedExtensionsContract { diff --git a/src/Services/WebhooksRawService.php b/src/Services/WebhooksRawService.php index 38bd2b03..4802ba05 100644 --- a/src/Services/WebhooksRawService.php +++ b/src/Services/WebhooksRawService.php @@ -2,10 +2,10 @@ declare(strict_types=1); -namespace Imagekit\Services; +namespace ImageKit\Services; -use Imagekit\Client; -use Imagekit\ServiceContracts\WebhooksRawContract; +use ImageKit\Client; +use ImageKit\ServiceContracts\WebhooksRawContract; final class WebhooksRawService implements WebhooksRawContract { diff --git a/src/Services/WebhooksService.php b/src/Services/WebhooksService.php index 1711c0c9..2c5a709a 100644 --- a/src/Services/WebhooksService.php +++ b/src/Services/WebhooksService.php @@ -2,27 +2,27 @@ declare(strict_types=1); -namespace Imagekit\Services; +namespace ImageKit\Services; -use Imagekit\Client; -use Imagekit\Core\Conversion; -use Imagekit\Core\Exceptions\WebhookException; -use Imagekit\Core\Util; -use Imagekit\ServiceContracts\WebhooksContract; -use Imagekit\Webhooks\FileCreateEvent; -use Imagekit\Webhooks\FileDeleteEvent; -use Imagekit\Webhooks\FileUpdateEvent; -use Imagekit\Webhooks\FileVersionCreateEvent; -use Imagekit\Webhooks\FileVersionDeleteEvent; -use Imagekit\Webhooks\UnsafeUnwrapWebhookEvent; -use Imagekit\Webhooks\UnwrapWebhookEvent; -use Imagekit\Webhooks\UploadPostTransformErrorEvent; -use Imagekit\Webhooks\UploadPostTransformSuccessEvent; -use Imagekit\Webhooks\UploadPreTransformErrorEvent; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent; -use Imagekit\Webhooks\VideoTransformationAcceptedEvent; -use Imagekit\Webhooks\VideoTransformationErrorEvent; -use Imagekit\Webhooks\VideoTransformationReadyEvent; +use ImageKit\Client; +use ImageKit\Core\Conversion; +use ImageKit\Core\Exceptions\WebhookException; +use ImageKit\Core\Util; +use ImageKit\ServiceContracts\WebhooksContract; +use ImageKit\Webhooks\FileCreateEvent; +use ImageKit\Webhooks\FileDeleteEvent; +use ImageKit\Webhooks\FileUpdateEvent; +use ImageKit\Webhooks\FileVersionCreateEvent; +use ImageKit\Webhooks\FileVersionDeleteEvent; +use ImageKit\Webhooks\UnsafeUnwrapWebhookEvent; +use ImageKit\Webhooks\UnwrapWebhookEvent; +use ImageKit\Webhooks\UploadPostTransformErrorEvent; +use ImageKit\Webhooks\UploadPostTransformSuccessEvent; +use ImageKit\Webhooks\UploadPreTransformErrorEvent; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent; +use ImageKit\Webhooks\VideoTransformationAcceptedEvent; +use ImageKit\Webhooks\VideoTransformationErrorEvent; +use ImageKit\Webhooks\VideoTransformationReadyEvent; use StandardWebhooks\Exception\WebhookVerificationException; use StandardWebhooks\Webhook; diff --git a/src/SolidColorOverlay.php b/src/SolidColorOverlay.php index 3991721e..e341af17 100644 --- a/src/SolidColorOverlay.php +++ b/src/SolidColorOverlay.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit; +namespace ImageKit; -use Imagekit\BaseOverlay\LayerMode; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\BaseOverlay\LayerMode; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-import-type OverlayPositionShape from \Imagekit\OverlayPosition - * @phpstan-import-type OverlayTimingShape from \Imagekit\OverlayTiming - * @phpstan-import-type SolidColorOverlayTransformationShape from \Imagekit\SolidColorOverlayTransformation + * @phpstan-import-type OverlayPositionShape from \ImageKit\OverlayPosition + * @phpstan-import-type OverlayTimingShape from \ImageKit\OverlayTiming + * @phpstan-import-type SolidColorOverlayTransformationShape from \ImageKit\SolidColorOverlayTransformation * * @phpstan-type SolidColorOverlayShape = array{ * layerMode?: null|LayerMode|value-of, diff --git a/src/SolidColorOverlayTransformation.php b/src/SolidColorOverlayTransformation.php index 707ed85b..52e5149b 100644 --- a/src/SolidColorOverlayTransformation.php +++ b/src/SolidColorOverlayTransformation.php @@ -2,21 +2,21 @@ declare(strict_types=1); -namespace Imagekit; +namespace ImageKit; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** - * @phpstan-import-type GradientVariants from \Imagekit\SolidColorOverlayTransformation\Gradient - * @phpstan-import-type HeightVariants from \Imagekit\SolidColorOverlayTransformation\Height - * @phpstan-import-type RadiusVariants from \Imagekit\SolidColorOverlayTransformation\Radius - * @phpstan-import-type WidthVariants from \Imagekit\SolidColorOverlayTransformation\Width - * @phpstan-import-type GradientShape from \Imagekit\SolidColorOverlayTransformation\Gradient - * @phpstan-import-type HeightShape from \Imagekit\SolidColorOverlayTransformation\Height - * @phpstan-import-type RadiusShape from \Imagekit\SolidColorOverlayTransformation\Radius - * @phpstan-import-type WidthShape from \Imagekit\SolidColorOverlayTransformation\Width + * @phpstan-import-type GradientVariants from \ImageKit\SolidColorOverlayTransformation\Gradient + * @phpstan-import-type HeightVariants from \ImageKit\SolidColorOverlayTransformation\Height + * @phpstan-import-type RadiusVariants from \ImageKit\SolidColorOverlayTransformation\Radius + * @phpstan-import-type WidthVariants from \ImageKit\SolidColorOverlayTransformation\Width + * @phpstan-import-type GradientShape from \ImageKit\SolidColorOverlayTransformation\Gradient + * @phpstan-import-type HeightShape from \ImageKit\SolidColorOverlayTransformation\Height + * @phpstan-import-type RadiusShape from \ImageKit\SolidColorOverlayTransformation\Radius + * @phpstan-import-type WidthShape from \ImageKit\SolidColorOverlayTransformation\Width * * @phpstan-type SolidColorOverlayTransformationShape = array{ * alpha?: float|null, diff --git a/src/SolidColorOverlayTransformation/Gradient.php b/src/SolidColorOverlayTransformation/Gradient.php index 7091649a..cb98110e 100644 --- a/src/SolidColorOverlayTransformation/Gradient.php +++ b/src/SolidColorOverlayTransformation/Gradient.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\SolidColorOverlayTransformation; +namespace ImageKit\SolidColorOverlayTransformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. diff --git a/src/SolidColorOverlayTransformation/Height.php b/src/SolidColorOverlayTransformation/Height.php index 15fac418..eab71847 100644 --- a/src/SolidColorOverlayTransformation/Height.php +++ b/src/SolidColorOverlayTransformation/Height.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\SolidColorOverlayTransformation; +namespace ImageKit\SolidColorOverlayTransformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Controls the height of the solid color overlay. Accepts a numeric value or an arithmetic expression. diff --git a/src/SolidColorOverlayTransformation/Radius.php b/src/SolidColorOverlayTransformation/Radius.php index 4f575ec1..a181fec0 100644 --- a/src/SolidColorOverlayTransformation/Radius.php +++ b/src/SolidColorOverlayTransformation/Radius.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\SolidColorOverlayTransformation; +namespace ImageKit\SolidColorOverlayTransformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the corner radius of the solid color overlay. diff --git a/src/SolidColorOverlayTransformation/Width.php b/src/SolidColorOverlayTransformation/Width.php index 9c3880b9..0eaf990e 100644 --- a/src/SolidColorOverlayTransformation/Width.php +++ b/src/SolidColorOverlayTransformation/Width.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\SolidColorOverlayTransformation; +namespace ImageKit\SolidColorOverlayTransformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Controls the width of the solid color overlay. Accepts a numeric value or an arithmetic expression (e.g., `bw_mul_0.2` or `bh_div_2`). diff --git a/src/SrcOptions.php b/src/SrcOptions.php index c24f759a..6363bf6a 100644 --- a/src/SrcOptions.php +++ b/src/SrcOptions.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit; +namespace ImageKit; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * Options for generating ImageKit URLs with transformations. See the [Transformations guide](https://imagekit.io/docs/transformations). diff --git a/src/StreamingResolution.php b/src/StreamingResolution.php index 309db090..350f8215 100644 --- a/src/StreamingResolution.php +++ b/src/StreamingResolution.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit; +namespace ImageKit; /** * Available streaming resolutions for [adaptive bitrate streaming](https://imagekit.io/docs/adaptive-bitrate-streaming). diff --git a/src/SubtitleOverlay.php b/src/SubtitleOverlay.php index 4b756d76..ccb69c3b 100644 --- a/src/SubtitleOverlay.php +++ b/src/SubtitleOverlay.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit; +namespace ImageKit; -use Imagekit\BaseOverlay\LayerMode; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\SubtitleOverlay\Encoding; +use ImageKit\BaseOverlay\LayerMode; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\SubtitleOverlay\Encoding; /** - * @phpstan-import-type OverlayPositionShape from \Imagekit\OverlayPosition - * @phpstan-import-type OverlayTimingShape from \Imagekit\OverlayTiming - * @phpstan-import-type SubtitleOverlayTransformationShape from \Imagekit\SubtitleOverlayTransformation + * @phpstan-import-type OverlayPositionShape from \ImageKit\OverlayPosition + * @phpstan-import-type OverlayTimingShape from \ImageKit\OverlayTiming + * @phpstan-import-type SubtitleOverlayTransformationShape from \ImageKit\SubtitleOverlayTransformation * * @phpstan-type SubtitleOverlayShape = array{ * layerMode?: null|LayerMode|value-of, diff --git a/src/SubtitleOverlay/Encoding.php b/src/SubtitleOverlay/Encoding.php index 8d5e3627..d234a9ff 100644 --- a/src/SubtitleOverlay/Encoding.php +++ b/src/SubtitleOverlay/Encoding.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\SubtitleOverlay; +namespace ImageKit\SubtitleOverlay; /** * The input path can be included in the layer as either `i-{input}` or `ie-{base64_encoded_input}`. diff --git a/src/SubtitleOverlayTransformation.php b/src/SubtitleOverlayTransformation.php index 33415b6f..4f73eb7b 100644 --- a/src/SubtitleOverlayTransformation.php +++ b/src/SubtitleOverlayTransformation.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit; +namespace ImageKit; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\SubtitleOverlayTransformation\Typography; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\SubtitleOverlayTransformation\Typography; /** * Subtitle styling options. [Learn more](https://imagekit.io/docs/add-overlays-on-videos#styling-controls-for-subtitles-layer) from the docs. diff --git a/src/SubtitleOverlayTransformation/Typography.php b/src/SubtitleOverlayTransformation/Typography.php index 296f8290..da7d956d 100644 --- a/src/SubtitleOverlayTransformation/Typography.php +++ b/src/SubtitleOverlayTransformation/Typography.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\SubtitleOverlayTransformation; +namespace ImageKit\SubtitleOverlayTransformation; /** * Sets the typography style of the subtitle text. Supports values are `b` for bold, `i` for italics, and `b_i` for bold with italics. diff --git a/src/TextOverlay.php b/src/TextOverlay.php index f501cb3c..ace1d917 100644 --- a/src/TextOverlay.php +++ b/src/TextOverlay.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit; +namespace ImageKit; -use Imagekit\BaseOverlay\LayerMode; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\TextOverlay\Encoding; +use ImageKit\BaseOverlay\LayerMode; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\TextOverlay\Encoding; /** - * @phpstan-import-type OverlayPositionShape from \Imagekit\OverlayPosition - * @phpstan-import-type OverlayTimingShape from \Imagekit\OverlayTiming - * @phpstan-import-type TextOverlayTransformationShape from \Imagekit\TextOverlayTransformation + * @phpstan-import-type OverlayPositionShape from \ImageKit\OverlayPosition + * @phpstan-import-type OverlayTimingShape from \ImageKit\OverlayTiming + * @phpstan-import-type TextOverlayTransformationShape from \ImageKit\TextOverlayTransformation * * @phpstan-type TextOverlayShape = array{ * layerMode?: null|LayerMode|value-of, diff --git a/src/TextOverlay/Encoding.php b/src/TextOverlay/Encoding.php index 5d9cec1e..ad8dbcf2 100644 --- a/src/TextOverlay/Encoding.php +++ b/src/TextOverlay/Encoding.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\TextOverlay; +namespace ImageKit\TextOverlay; /** * Text can be included in the layer as either `i-{input}` (plain text) or `ie-{base64_encoded_input}` (base64). diff --git a/src/TextOverlayTransformation.php b/src/TextOverlayTransformation.php index 7bbfeabb..7a9af566 100644 --- a/src/TextOverlayTransformation.php +++ b/src/TextOverlayTransformation.php @@ -2,27 +2,27 @@ declare(strict_types=1); -namespace Imagekit; +namespace ImageKit; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\TextOverlayTransformation\Flip; -use Imagekit\TextOverlayTransformation\InnerAlignment; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\TextOverlayTransformation\Flip; +use ImageKit\TextOverlayTransformation\InnerAlignment; /** - * @phpstan-import-type FontSizeVariants from \Imagekit\TextOverlayTransformation\FontSize - * @phpstan-import-type LineHeightVariants from \Imagekit\TextOverlayTransformation\LineHeight - * @phpstan-import-type PaddingVariants from \Imagekit\TextOverlayTransformation\Padding - * @phpstan-import-type RadiusVariants from \Imagekit\TextOverlayTransformation\Radius - * @phpstan-import-type RotationVariants from \Imagekit\TextOverlayTransformation\Rotation - * @phpstan-import-type WidthVariants from \Imagekit\TextOverlayTransformation\Width - * @phpstan-import-type FontSizeShape from \Imagekit\TextOverlayTransformation\FontSize - * @phpstan-import-type LineHeightShape from \Imagekit\TextOverlayTransformation\LineHeight - * @phpstan-import-type PaddingShape from \Imagekit\TextOverlayTransformation\Padding - * @phpstan-import-type RadiusShape from \Imagekit\TextOverlayTransformation\Radius - * @phpstan-import-type RotationShape from \Imagekit\TextOverlayTransformation\Rotation - * @phpstan-import-type WidthShape from \Imagekit\TextOverlayTransformation\Width + * @phpstan-import-type FontSizeVariants from \ImageKit\TextOverlayTransformation\FontSize + * @phpstan-import-type LineHeightVariants from \ImageKit\TextOverlayTransformation\LineHeight + * @phpstan-import-type PaddingVariants from \ImageKit\TextOverlayTransformation\Padding + * @phpstan-import-type RadiusVariants from \ImageKit\TextOverlayTransformation\Radius + * @phpstan-import-type RotationVariants from \ImageKit\TextOverlayTransformation\Rotation + * @phpstan-import-type WidthVariants from \ImageKit\TextOverlayTransformation\Width + * @phpstan-import-type FontSizeShape from \ImageKit\TextOverlayTransformation\FontSize + * @phpstan-import-type LineHeightShape from \ImageKit\TextOverlayTransformation\LineHeight + * @phpstan-import-type PaddingShape from \ImageKit\TextOverlayTransformation\Padding + * @phpstan-import-type RadiusShape from \ImageKit\TextOverlayTransformation\Radius + * @phpstan-import-type RotationShape from \ImageKit\TextOverlayTransformation\Rotation + * @phpstan-import-type WidthShape from \ImageKit\TextOverlayTransformation\Width * * @phpstan-type TextOverlayTransformationShape = array{ * alpha?: float|null, diff --git a/src/TextOverlayTransformation/Flip.php b/src/TextOverlayTransformation/Flip.php index e99fb624..6214d8f2 100644 --- a/src/TextOverlayTransformation/Flip.php +++ b/src/TextOverlayTransformation/Flip.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\TextOverlayTransformation; +namespace ImageKit\TextOverlayTransformation; /** * Flip/mirror the text horizontally, vertically, or in both directions. diff --git a/src/TextOverlayTransformation/FontSize.php b/src/TextOverlayTransformation/FontSize.php index eb8bb573..dfe61b01 100644 --- a/src/TextOverlayTransformation/FontSize.php +++ b/src/TextOverlayTransformation/FontSize.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\TextOverlayTransformation; +namespace ImageKit\TextOverlayTransformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the font size of the overlaid text. Accepts a numeric value or an arithmetic expression. diff --git a/src/TextOverlayTransformation/InnerAlignment.php b/src/TextOverlayTransformation/InnerAlignment.php index 13619a50..e38cc502 100644 --- a/src/TextOverlayTransformation/InnerAlignment.php +++ b/src/TextOverlayTransformation/InnerAlignment.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\TextOverlayTransformation; +namespace ImageKit\TextOverlayTransformation; /** * Specifies the inner alignment of the text when width is more than the text length. diff --git a/src/TextOverlayTransformation/LineHeight.php b/src/TextOverlayTransformation/LineHeight.php index e3e6eb9e..d3435adb 100644 --- a/src/TextOverlayTransformation/LineHeight.php +++ b/src/TextOverlayTransformation/LineHeight.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\TextOverlayTransformation; +namespace ImageKit\TextOverlayTransformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the line height for multi-line text overlays. It will come into effect only if the text wraps over multiple lines. diff --git a/src/TextOverlayTransformation/Padding.php b/src/TextOverlayTransformation/Padding.php index 50da4639..65838ff6 100644 --- a/src/TextOverlayTransformation/Padding.php +++ b/src/TextOverlayTransformation/Padding.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\TextOverlayTransformation; +namespace ImageKit\TextOverlayTransformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the padding around the overlaid text. diff --git a/src/TextOverlayTransformation/Radius.php b/src/TextOverlayTransformation/Radius.php index aee44853..42e84e72 100644 --- a/src/TextOverlayTransformation/Radius.php +++ b/src/TextOverlayTransformation/Radius.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\TextOverlayTransformation; +namespace ImageKit\TextOverlayTransformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the corner radius: diff --git a/src/TextOverlayTransformation/Rotation.php b/src/TextOverlayTransformation/Rotation.php index d62ee898..3bb977b9 100644 --- a/src/TextOverlayTransformation/Rotation.php +++ b/src/TextOverlayTransformation/Rotation.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\TextOverlayTransformation; +namespace ImageKit\TextOverlayTransformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the rotation angle of the text overlay. diff --git a/src/TextOverlayTransformation/Width.php b/src/TextOverlayTransformation/Width.php index bd54a319..4a8e1ec7 100644 --- a/src/TextOverlayTransformation/Width.php +++ b/src/TextOverlayTransformation/Width.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\TextOverlayTransformation; +namespace ImageKit\TextOverlayTransformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the maximum width (in pixels) of the overlaid text. The text wraps automatically, and arithmetic expressions (e.g., `bw_mul_0.2` or `bh_div_2`) are supported. Useful when used in conjunction with the `background`. diff --git a/src/Transformation.php b/src/Transformation.php index 564ef623..8ed80b36 100644 --- a/src/Transformation.php +++ b/src/Transformation.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit; - -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Transformation\AudioCodec; -use Imagekit\Transformation\Crop; -use Imagekit\Transformation\CropMode; -use Imagekit\Transformation\Flip; -use Imagekit\Transformation\Format; -use Imagekit\Transformation\VideoCodec; +namespace ImageKit; + +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Transformation\AudioCodec; +use ImageKit\Transformation\Crop; +use ImageKit\Transformation\CropMode; +use ImageKit\Transformation\Flip; +use ImageKit\Transformation\Format; +use ImageKit\Transformation\VideoCodec; /** * The SDK provides easy-to-use names for transformations. These names are converted to the corresponding transformation string before being added to the URL. @@ -20,44 +20,44 @@ * You can use the `raw` parameter to pass the transformation string directly. * See the [Transformations documentation](https://imagekit.io/docs/transformations). * - * @phpstan-import-type AIDropShadowVariants from \Imagekit\Transformation\AIDropShadow - * @phpstan-import-type AspectRatioVariants from \Imagekit\Transformation\AspectRatio - * @phpstan-import-type DurationVariants from \Imagekit\Transformation\Duration - * @phpstan-import-type EndOffsetVariants from \Imagekit\Transformation\EndOffset - * @phpstan-import-type GradientVariants from \Imagekit\Transformation\Gradient - * @phpstan-import-type HeightVariants from \Imagekit\Transformation\Height - * @phpstan-import-type PageVariants from \Imagekit\Transformation\Page - * @phpstan-import-type RadiusVariants from \Imagekit\Transformation\Radius - * @phpstan-import-type RotationVariants from \Imagekit\Transformation\Rotation - * @phpstan-import-type ShadowVariants from \Imagekit\Transformation\Shadow - * @phpstan-import-type SharpenVariants from \Imagekit\Transformation\Sharpen - * @phpstan-import-type StartOffsetVariants from \Imagekit\Transformation\StartOffset - * @phpstan-import-type TrimVariants from \Imagekit\Transformation\Trim - * @phpstan-import-type UnsharpMaskVariants from \Imagekit\Transformation\UnsharpMask - * @phpstan-import-type WidthVariants from \Imagekit\Transformation\Width - * @phpstan-import-type XVariants from \Imagekit\Transformation\X - * @phpstan-import-type XCenterVariants from \Imagekit\Transformation\XCenter - * @phpstan-import-type YVariants from \Imagekit\Transformation\Y - * @phpstan-import-type YCenterVariants from \Imagekit\Transformation\YCenter - * @phpstan-import-type AIDropShadowShape from \Imagekit\Transformation\AIDropShadow - * @phpstan-import-type AspectRatioShape from \Imagekit\Transformation\AspectRatio - * @phpstan-import-type DurationShape from \Imagekit\Transformation\Duration - * @phpstan-import-type EndOffsetShape from \Imagekit\Transformation\EndOffset - * @phpstan-import-type GradientShape from \Imagekit\Transformation\Gradient - * @phpstan-import-type HeightShape from \Imagekit\Transformation\Height - * @phpstan-import-type PageShape from \Imagekit\Transformation\Page - * @phpstan-import-type RadiusShape from \Imagekit\Transformation\Radius - * @phpstan-import-type RotationShape from \Imagekit\Transformation\Rotation - * @phpstan-import-type ShadowShape from \Imagekit\Transformation\Shadow - * @phpstan-import-type SharpenShape from \Imagekit\Transformation\Sharpen - * @phpstan-import-type StartOffsetShape from \Imagekit\Transformation\StartOffset - * @phpstan-import-type TrimShape from \Imagekit\Transformation\Trim - * @phpstan-import-type UnsharpMaskShape from \Imagekit\Transformation\UnsharpMask - * @phpstan-import-type WidthShape from \Imagekit\Transformation\Width - * @phpstan-import-type XShape from \Imagekit\Transformation\X - * @phpstan-import-type XCenterShape from \Imagekit\Transformation\XCenter - * @phpstan-import-type YShape from \Imagekit\Transformation\Y - * @phpstan-import-type YCenterShape from \Imagekit\Transformation\YCenter + * @phpstan-import-type AIDropShadowVariants from \ImageKit\Transformation\AIDropShadow + * @phpstan-import-type AspectRatioVariants from \ImageKit\Transformation\AspectRatio + * @phpstan-import-type DurationVariants from \ImageKit\Transformation\Duration + * @phpstan-import-type EndOffsetVariants from \ImageKit\Transformation\EndOffset + * @phpstan-import-type GradientVariants from \ImageKit\Transformation\Gradient + * @phpstan-import-type HeightVariants from \ImageKit\Transformation\Height + * @phpstan-import-type PageVariants from \ImageKit\Transformation\Page + * @phpstan-import-type RadiusVariants from \ImageKit\Transformation\Radius + * @phpstan-import-type RotationVariants from \ImageKit\Transformation\Rotation + * @phpstan-import-type ShadowVariants from \ImageKit\Transformation\Shadow + * @phpstan-import-type SharpenVariants from \ImageKit\Transformation\Sharpen + * @phpstan-import-type StartOffsetVariants from \ImageKit\Transformation\StartOffset + * @phpstan-import-type TrimVariants from \ImageKit\Transformation\Trim + * @phpstan-import-type UnsharpMaskVariants from \ImageKit\Transformation\UnsharpMask + * @phpstan-import-type WidthVariants from \ImageKit\Transformation\Width + * @phpstan-import-type XVariants from \ImageKit\Transformation\X + * @phpstan-import-type XCenterVariants from \ImageKit\Transformation\XCenter + * @phpstan-import-type YVariants from \ImageKit\Transformation\Y + * @phpstan-import-type YCenterVariants from \ImageKit\Transformation\YCenter + * @phpstan-import-type AIDropShadowShape from \ImageKit\Transformation\AIDropShadow + * @phpstan-import-type AspectRatioShape from \ImageKit\Transformation\AspectRatio + * @phpstan-import-type DurationShape from \ImageKit\Transformation\Duration + * @phpstan-import-type EndOffsetShape from \ImageKit\Transformation\EndOffset + * @phpstan-import-type GradientShape from \ImageKit\Transformation\Gradient + * @phpstan-import-type HeightShape from \ImageKit\Transformation\Height + * @phpstan-import-type PageShape from \ImageKit\Transformation\Page + * @phpstan-import-type RadiusShape from \ImageKit\Transformation\Radius + * @phpstan-import-type RotationShape from \ImageKit\Transformation\Rotation + * @phpstan-import-type ShadowShape from \ImageKit\Transformation\Shadow + * @phpstan-import-type SharpenShape from \ImageKit\Transformation\Sharpen + * @phpstan-import-type StartOffsetShape from \ImageKit\Transformation\StartOffset + * @phpstan-import-type TrimShape from \ImageKit\Transformation\Trim + * @phpstan-import-type UnsharpMaskShape from \ImageKit\Transformation\UnsharpMask + * @phpstan-import-type WidthShape from \ImageKit\Transformation\Width + * @phpstan-import-type XShape from \ImageKit\Transformation\X + * @phpstan-import-type XCenterShape from \ImageKit\Transformation\XCenter + * @phpstan-import-type YShape from \ImageKit\Transformation\Y + * @phpstan-import-type YCenterShape from \ImageKit\Transformation\YCenter * * @phpstan-type TransformationShape = array{ * aiChangeBackground?: string|null, diff --git a/src/Transformation/AIDropShadow.php b/src/Transformation/AIDropShadow.php index 6637b5ca..8e83ba88 100644 --- a/src/Transformation/AIDropShadow.php +++ b/src/Transformation/AIDropShadow.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Adds an AI-based drop shadow around a foreground object on a transparent or removed background. diff --git a/src/Transformation/AspectRatio.php b/src/Transformation/AspectRatio.php index 10ff17b1..6efa4212 100644 --- a/src/Transformation/AspectRatio.php +++ b/src/Transformation/AspectRatio.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the aspect ratio for the output, e.g., "ar-4-3". Typically used with either width or height (but not both). diff --git a/src/Transformation/AudioCodec.php b/src/Transformation/AudioCodec.php index c42357a9..e50f6a34 100644 --- a/src/Transformation/AudioCodec.php +++ b/src/Transformation/AudioCodec.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; /** * Specifies the audio codec, e.g., `aac`, `opus`, or `none`. See [Audio codec](https://imagekit.io/docs/video-optimization#audio-codec---ac). diff --git a/src/Transformation/Crop.php b/src/Transformation/Crop.php index c52f3ea4..5216d5a2 100644 --- a/src/Transformation/Crop.php +++ b/src/Transformation/Crop.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; /** * Crop modes for image resizing. See [Crop modes & focus](https://imagekit.io/docs/image-resize-and-crop#crop-crop-modes--focus). diff --git a/src/Transformation/CropMode.php b/src/Transformation/CropMode.php index d82621eb..c133ad4a 100644 --- a/src/Transformation/CropMode.php +++ b/src/Transformation/CropMode.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; /** * Additional crop modes for image resizing. See [Crop modes & focus](https://imagekit.io/docs/image-resize-and-crop#crop-crop-modes--focus). diff --git a/src/Transformation/Duration.php b/src/Transformation/Duration.php index 11cc614a..0a19274b 100644 --- a/src/Transformation/Duration.php +++ b/src/Transformation/Duration.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the duration (in seconds) for trimming videos, e.g., `5` or `10.5`. diff --git a/src/Transformation/EndOffset.php b/src/Transformation/EndOffset.php index fbe021f3..a0ea4d3a 100644 --- a/src/Transformation/EndOffset.php +++ b/src/Transformation/EndOffset.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the end offset (in seconds) for trimming videos, e.g., `5` or `10.5`. diff --git a/src/Transformation/Flip.php b/src/Transformation/Flip.php index f4d9aab7..cf787781 100644 --- a/src/Transformation/Flip.php +++ b/src/Transformation/Flip.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; /** * Flips or mirrors an image either horizontally, vertically, or both. diff --git a/src/Transformation/Format.php b/src/Transformation/Format.php index 7bea47a2..ba9c998f 100644 --- a/src/Transformation/Format.php +++ b/src/Transformation/Format.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; /** * Specifies the output format for images or videos, e.g., `jpg`, `png`, `webp`, `mp4`, or `auto`. diff --git a/src/Transformation/Gradient.php b/src/Transformation/Gradient.php index 956bf4f8..d202b0a2 100644 --- a/src/Transformation/Gradient.php +++ b/src/Transformation/Gradient.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Creates a linear gradient with two colors. Pass `true` for a default gradient, or provide a string for a custom gradient. diff --git a/src/Transformation/Height.php b/src/Transformation/Height.php index 858b23b1..a71522ac 100644 --- a/src/Transformation/Height.php +++ b/src/Transformation/Height.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the height of the output. If a value between 0 and 1 is provided, it is treated as a percentage (e.g., `0.5` represents 50% of the original height). diff --git a/src/Transformation/Page.php b/src/Transformation/Page.php index 8db1194e..39c7d7b8 100644 --- a/src/Transformation/Page.php +++ b/src/Transformation/Page.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Extracts a specific page or frame from multi-page or layered files (PDF, PSD, AI). diff --git a/src/Transformation/Radius.php b/src/Transformation/Radius.php index 1c78c440..e8557099 100644 --- a/src/Transformation/Radius.php +++ b/src/Transformation/Radius.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the corner radius for rounded corners. diff --git a/src/Transformation/Rotation.php b/src/Transformation/Rotation.php index e0e4a71d..98feb837 100644 --- a/src/Transformation/Rotation.php +++ b/src/Transformation/Rotation.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the rotation angle in degrees. Positive values rotate the image clockwise; you can also use, for example, `N40` for counterclockwise rotation diff --git a/src/Transformation/Shadow.php b/src/Transformation/Shadow.php index 765b7716..964b6aa4 100644 --- a/src/Transformation/Shadow.php +++ b/src/Transformation/Shadow.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Adds a shadow beneath solid objects in an image with a transparent background. diff --git a/src/Transformation/Sharpen.php b/src/Transformation/Sharpen.php index 102e1302..57c395fd 100644 --- a/src/Transformation/Sharpen.php +++ b/src/Transformation/Sharpen.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Sharpens the input image, highlighting edges and finer details. diff --git a/src/Transformation/StartOffset.php b/src/Transformation/StartOffset.php index 7fd2e50a..117c4c36 100644 --- a/src/Transformation/StartOffset.php +++ b/src/Transformation/StartOffset.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the start offset (in seconds) for trimming videos, e.g., `5` or `10.5`. diff --git a/src/Transformation/Trim.php b/src/Transformation/Trim.php index a807cc2d..549f23a9 100644 --- a/src/Transformation/Trim.php +++ b/src/Transformation/Trim.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Useful for images with a solid or nearly solid background and a central object. This parameter trims the background, diff --git a/src/Transformation/UnsharpMask.php b/src/Transformation/UnsharpMask.php index 26bdf4c3..d41f04c1 100644 --- a/src/Transformation/UnsharpMask.php +++ b/src/Transformation/UnsharpMask.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Applies Unsharp Masking (USM), an image sharpening technique. diff --git a/src/Transformation/VideoCodec.php b/src/Transformation/VideoCodec.php index dc7fa510..787a91fc 100644 --- a/src/Transformation/VideoCodec.php +++ b/src/Transformation/VideoCodec.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; /** * Specifies the video codec, e.g., `h264`, `vp9`, `av1`, or `none`. See [Video codec](https://imagekit.io/docs/video-optimization#video-codec---vc). diff --git a/src/Transformation/Width.php b/src/Transformation/Width.php index 1a96f183..83729736 100644 --- a/src/Transformation/Width.php +++ b/src/Transformation/Width.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Specifies the width of the output. If a value between 0 and 1 is provided, it is treated as a percentage (e.g., `0.4` represents 40% of the original width). diff --git a/src/Transformation/X.php b/src/Transformation/X.php index 14a30b38..451916da 100644 --- a/src/Transformation/X.php +++ b/src/Transformation/X.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Focus using cropped image coordinates - X coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). diff --git a/src/Transformation/XCenter.php b/src/Transformation/XCenter.php index 594bae0c..c4bead03 100644 --- a/src/Transformation/XCenter.php +++ b/src/Transformation/XCenter.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Focus using cropped image coordinates - X center coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). diff --git a/src/Transformation/Y.php b/src/Transformation/Y.php index 8aa1ef1f..cef68ed2 100644 --- a/src/Transformation/Y.php +++ b/src/Transformation/Y.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Focus using cropped image coordinates - Y coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). diff --git a/src/Transformation/YCenter.php b/src/Transformation/YCenter.php index 5080ae6e..8467dca4 100644 --- a/src/Transformation/YCenter.php +++ b/src/Transformation/YCenter.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Transformation; +namespace ImageKit\Transformation; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Focus using cropped image coordinates - Y center coordinate. See [Focus using cropped coordinates](https://imagekit.io/docs/image-resize-and-crop#example---focus-using-cropped-image-coordinates). diff --git a/src/TransformationPosition.php b/src/TransformationPosition.php index 6935eca7..8e3ee23f 100644 --- a/src/TransformationPosition.php +++ b/src/TransformationPosition.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit; +namespace ImageKit; /** * By default, the transformation string is added as a query parameter in the URL, e.g., `?tr=w-100,h-100`. diff --git a/src/Version.php b/src/Version.php index 6dac0f12..ab74436c 100644 --- a/src/Version.php +++ b/src/Version.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit; +namespace ImageKit; // x-release-please-start-version const VERSION = '0.0.1'; diff --git a/src/VideoOverlay.php b/src/VideoOverlay.php index 7dde0986..60093c0d 100644 --- a/src/VideoOverlay.php +++ b/src/VideoOverlay.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit; +namespace ImageKit; -use Imagekit\BaseOverlay\LayerMode; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\VideoOverlay\Encoding; +use ImageKit\BaseOverlay\LayerMode; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\VideoOverlay\Encoding; /** - * @phpstan-import-type OverlayPositionShape from \Imagekit\OverlayPosition - * @phpstan-import-type OverlayTimingShape from \Imagekit\OverlayTiming + * @phpstan-import-type OverlayPositionShape from \ImageKit\OverlayPosition + * @phpstan-import-type OverlayTimingShape from \ImageKit\OverlayTiming * * @phpstan-type VideoOverlayShape = array{ * layerMode?: null|LayerMode|value-of, diff --git a/src/VideoOverlay/Encoding.php b/src/VideoOverlay/Encoding.php index 6ad40fae..a78e3f8f 100644 --- a/src/VideoOverlay/Encoding.php +++ b/src/VideoOverlay/Encoding.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\VideoOverlay; +namespace ImageKit\VideoOverlay; /** * The input path can be included in the layer as either `i-{input}` or `ie-{base64_encoded_input}`. diff --git a/src/Webhooks/BaseWebhookEvent.php b/src/Webhooks/BaseWebhookEvent.php index c91cc020..15714284 100644 --- a/src/Webhooks/BaseWebhookEvent.php +++ b/src/Webhooks/BaseWebhookEvent.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Webhooks; +namespace ImageKit\Webhooks; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type BaseWebhookEventShape = array{id: string, type: string} diff --git a/src/Webhooks/FileCreateEvent.php b/src/Webhooks/FileCreateEvent.php index 3f9ed8d6..fb6e1d8e 100644 --- a/src/Webhooks/FileCreateEvent.php +++ b/src/Webhooks/FileCreateEvent.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Webhooks; +namespace ImageKit\Webhooks; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Files\File; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Files\File; /** * Triggered when a file is created. * - * @phpstan-import-type FileShape from \Imagekit\Files\File + * @phpstan-import-type FileShape from \ImageKit\Files\File * * @phpstan-type FileCreateEventShape = array{ * id: string, type: string, createdAt: \DateTimeInterface, data: File|FileShape diff --git a/src/Webhooks/FileDeleteEvent.php b/src/Webhooks/FileDeleteEvent.php index db8ecd07..736af9fd 100644 --- a/src/Webhooks/FileDeleteEvent.php +++ b/src/Webhooks/FileDeleteEvent.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Webhooks; +namespace ImageKit\Webhooks; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\FileDeleteEvent\Data; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\FileDeleteEvent\Data; /** * Triggered when a file is deleted. * - * @phpstan-import-type DataShape from \Imagekit\Webhooks\FileDeleteEvent\Data + * @phpstan-import-type DataShape from \ImageKit\Webhooks\FileDeleteEvent\Data * * @phpstan-type FileDeleteEventShape = array{ * id: string, type: string, createdAt: \DateTimeInterface, data: Data|DataShape diff --git a/src/Webhooks/FileDeleteEvent/Data.php b/src/Webhooks/FileDeleteEvent/Data.php index 0fd437d7..dd5b0d28 100644 --- a/src/Webhooks/FileDeleteEvent/Data.php +++ b/src/Webhooks/FileDeleteEvent/Data.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\FileDeleteEvent; +namespace ImageKit\Webhooks\FileDeleteEvent; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type DataShape = array{fileID: string} diff --git a/src/Webhooks/FileUpdateEvent.php b/src/Webhooks/FileUpdateEvent.php index b28774fe..5bb1195a 100644 --- a/src/Webhooks/FileUpdateEvent.php +++ b/src/Webhooks/FileUpdateEvent.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Webhooks; +namespace ImageKit\Webhooks; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Files\File; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Files\File; /** * Triggered when a file is updated. * - * @phpstan-import-type FileShape from \Imagekit\Files\File + * @phpstan-import-type FileShape from \ImageKit\Files\File * * @phpstan-type FileUpdateEventShape = array{ * id: string, type: string, createdAt: \DateTimeInterface, data: File|FileShape diff --git a/src/Webhooks/FileVersionCreateEvent.php b/src/Webhooks/FileVersionCreateEvent.php index d5082a7e..6e1aa478 100644 --- a/src/Webhooks/FileVersionCreateEvent.php +++ b/src/Webhooks/FileVersionCreateEvent.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Webhooks; +namespace ImageKit\Webhooks; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Files\File; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Files\File; /** * Triggered when a file version is created. * - * @phpstan-import-type FileShape from \Imagekit\Files\File + * @phpstan-import-type FileShape from \ImageKit\Files\File * * @phpstan-type FileVersionCreateEventShape = array{ * id: string, type: string, createdAt: \DateTimeInterface, data: File|FileShape diff --git a/src/Webhooks/FileVersionDeleteEvent.php b/src/Webhooks/FileVersionDeleteEvent.php index 513d8e83..92b2d709 100644 --- a/src/Webhooks/FileVersionDeleteEvent.php +++ b/src/Webhooks/FileVersionDeleteEvent.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Webhooks; +namespace ImageKit\Webhooks; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\FileVersionDeleteEvent\Data; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\FileVersionDeleteEvent\Data; /** * Triggered when a file version is deleted. * - * @phpstan-import-type DataShape from \Imagekit\Webhooks\FileVersionDeleteEvent\Data + * @phpstan-import-type DataShape from \ImageKit\Webhooks\FileVersionDeleteEvent\Data * * @phpstan-type FileVersionDeleteEventShape = array{ * id: string, type: string, createdAt: \DateTimeInterface, data: Data|DataShape diff --git a/src/Webhooks/FileVersionDeleteEvent/Data.php b/src/Webhooks/FileVersionDeleteEvent/Data.php index aecdc596..2ae74e04 100644 --- a/src/Webhooks/FileVersionDeleteEvent/Data.php +++ b/src/Webhooks/FileVersionDeleteEvent/Data.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\FileVersionDeleteEvent; +namespace ImageKit\Webhooks\FileVersionDeleteEvent; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type DataShape = array{fileID: string, versionID: string} diff --git a/src/Webhooks/UnsafeUnwrapWebhookEvent.php b/src/Webhooks/UnsafeUnwrapWebhookEvent.php index ca12128c..666bdb61 100644 --- a/src/Webhooks/UnsafeUnwrapWebhookEvent.php +++ b/src/Webhooks/UnsafeUnwrapWebhookEvent.php @@ -2,27 +2,27 @@ declare(strict_types=1); -namespace Imagekit\Webhooks; +namespace ImageKit\Webhooks; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Triggered when a new video transformation request is accepted for processing. This event confirms that ImageKit has received and queued your transformation request. Use this for debugging and tracking transformation lifecycle. * - * @phpstan-import-type VideoTransformationAcceptedEventShape from \Imagekit\Webhooks\VideoTransformationAcceptedEvent - * @phpstan-import-type VideoTransformationReadyEventShape from \Imagekit\Webhooks\VideoTransformationReadyEvent - * @phpstan-import-type VideoTransformationErrorEventShape from \Imagekit\Webhooks\VideoTransformationErrorEvent - * @phpstan-import-type UploadPreTransformSuccessEventShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent - * @phpstan-import-type UploadPreTransformErrorEventShape from \Imagekit\Webhooks\UploadPreTransformErrorEvent - * @phpstan-import-type UploadPostTransformSuccessEventShape from \Imagekit\Webhooks\UploadPostTransformSuccessEvent - * @phpstan-import-type UploadPostTransformErrorEventShape from \Imagekit\Webhooks\UploadPostTransformErrorEvent - * @phpstan-import-type FileCreateEventShape from \Imagekit\Webhooks\FileCreateEvent - * @phpstan-import-type FileUpdateEventShape from \Imagekit\Webhooks\FileUpdateEvent - * @phpstan-import-type FileDeleteEventShape from \Imagekit\Webhooks\FileDeleteEvent - * @phpstan-import-type FileVersionCreateEventShape from \Imagekit\Webhooks\FileVersionCreateEvent - * @phpstan-import-type FileVersionDeleteEventShape from \Imagekit\Webhooks\FileVersionDeleteEvent + * @phpstan-import-type VideoTransformationAcceptedEventShape from \ImageKit\Webhooks\VideoTransformationAcceptedEvent + * @phpstan-import-type VideoTransformationReadyEventShape from \ImageKit\Webhooks\VideoTransformationReadyEvent + * @phpstan-import-type VideoTransformationErrorEventShape from \ImageKit\Webhooks\VideoTransformationErrorEvent + * @phpstan-import-type UploadPreTransformSuccessEventShape from \ImageKit\Webhooks\UploadPreTransformSuccessEvent + * @phpstan-import-type UploadPreTransformErrorEventShape from \ImageKit\Webhooks\UploadPreTransformErrorEvent + * @phpstan-import-type UploadPostTransformSuccessEventShape from \ImageKit\Webhooks\UploadPostTransformSuccessEvent + * @phpstan-import-type UploadPostTransformErrorEventShape from \ImageKit\Webhooks\UploadPostTransformErrorEvent + * @phpstan-import-type FileCreateEventShape from \ImageKit\Webhooks\FileCreateEvent + * @phpstan-import-type FileUpdateEventShape from \ImageKit\Webhooks\FileUpdateEvent + * @phpstan-import-type FileDeleteEventShape from \ImageKit\Webhooks\FileDeleteEvent + * @phpstan-import-type FileVersionCreateEventShape from \ImageKit\Webhooks\FileVersionCreateEvent + * @phpstan-import-type FileVersionDeleteEventShape from \ImageKit\Webhooks\FileVersionDeleteEvent * * @phpstan-type UnsafeUnwrapWebhookEventVariants = VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|FileCreateEvent|FileUpdateEvent|FileDeleteEvent|FileVersionCreateEvent|FileVersionDeleteEvent * @phpstan-type UnsafeUnwrapWebhookEventShape = UnsafeUnwrapWebhookEventVariants|VideoTransformationAcceptedEventShape|VideoTransformationReadyEventShape|VideoTransformationErrorEventShape|UploadPreTransformSuccessEventShape|UploadPreTransformErrorEventShape|UploadPostTransformSuccessEventShape|UploadPostTransformErrorEventShape|FileCreateEventShape|FileUpdateEventShape|FileDeleteEventShape|FileVersionCreateEventShape|FileVersionDeleteEventShape diff --git a/src/Webhooks/UnwrapWebhookEvent.php b/src/Webhooks/UnwrapWebhookEvent.php index e06acc5e..a7ad2b52 100644 --- a/src/Webhooks/UnwrapWebhookEvent.php +++ b/src/Webhooks/UnwrapWebhookEvent.php @@ -2,27 +2,27 @@ declare(strict_types=1); -namespace Imagekit\Webhooks; +namespace ImageKit\Webhooks; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Triggered when a new video transformation request is accepted for processing. This event confirms that ImageKit has received and queued your transformation request. Use this for debugging and tracking transformation lifecycle. * - * @phpstan-import-type VideoTransformationAcceptedEventShape from \Imagekit\Webhooks\VideoTransformationAcceptedEvent - * @phpstan-import-type VideoTransformationReadyEventShape from \Imagekit\Webhooks\VideoTransformationReadyEvent - * @phpstan-import-type VideoTransformationErrorEventShape from \Imagekit\Webhooks\VideoTransformationErrorEvent - * @phpstan-import-type UploadPreTransformSuccessEventShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent - * @phpstan-import-type UploadPreTransformErrorEventShape from \Imagekit\Webhooks\UploadPreTransformErrorEvent - * @phpstan-import-type UploadPostTransformSuccessEventShape from \Imagekit\Webhooks\UploadPostTransformSuccessEvent - * @phpstan-import-type UploadPostTransformErrorEventShape from \Imagekit\Webhooks\UploadPostTransformErrorEvent - * @phpstan-import-type FileCreateEventShape from \Imagekit\Webhooks\FileCreateEvent - * @phpstan-import-type FileUpdateEventShape from \Imagekit\Webhooks\FileUpdateEvent - * @phpstan-import-type FileDeleteEventShape from \Imagekit\Webhooks\FileDeleteEvent - * @phpstan-import-type FileVersionCreateEventShape from \Imagekit\Webhooks\FileVersionCreateEvent - * @phpstan-import-type FileVersionDeleteEventShape from \Imagekit\Webhooks\FileVersionDeleteEvent + * @phpstan-import-type VideoTransformationAcceptedEventShape from \ImageKit\Webhooks\VideoTransformationAcceptedEvent + * @phpstan-import-type VideoTransformationReadyEventShape from \ImageKit\Webhooks\VideoTransformationReadyEvent + * @phpstan-import-type VideoTransformationErrorEventShape from \ImageKit\Webhooks\VideoTransformationErrorEvent + * @phpstan-import-type UploadPreTransformSuccessEventShape from \ImageKit\Webhooks\UploadPreTransformSuccessEvent + * @phpstan-import-type UploadPreTransformErrorEventShape from \ImageKit\Webhooks\UploadPreTransformErrorEvent + * @phpstan-import-type UploadPostTransformSuccessEventShape from \ImageKit\Webhooks\UploadPostTransformSuccessEvent + * @phpstan-import-type UploadPostTransformErrorEventShape from \ImageKit\Webhooks\UploadPostTransformErrorEvent + * @phpstan-import-type FileCreateEventShape from \ImageKit\Webhooks\FileCreateEvent + * @phpstan-import-type FileUpdateEventShape from \ImageKit\Webhooks\FileUpdateEvent + * @phpstan-import-type FileDeleteEventShape from \ImageKit\Webhooks\FileDeleteEvent + * @phpstan-import-type FileVersionCreateEventShape from \ImageKit\Webhooks\FileVersionCreateEvent + * @phpstan-import-type FileVersionDeleteEventShape from \ImageKit\Webhooks\FileVersionDeleteEvent * * @phpstan-type UnwrapWebhookEventVariants = VideoTransformationAcceptedEvent|VideoTransformationReadyEvent|VideoTransformationErrorEvent|UploadPreTransformSuccessEvent|UploadPreTransformErrorEvent|UploadPostTransformSuccessEvent|UploadPostTransformErrorEvent|FileCreateEvent|FileUpdateEvent|FileDeleteEvent|FileVersionCreateEvent|FileVersionDeleteEvent * @phpstan-type UnwrapWebhookEventShape = UnwrapWebhookEventVariants|VideoTransformationAcceptedEventShape|VideoTransformationReadyEventShape|VideoTransformationErrorEventShape|UploadPreTransformSuccessEventShape|UploadPreTransformErrorEventShape|UploadPostTransformSuccessEventShape|UploadPostTransformErrorEventShape|FileCreateEventShape|FileUpdateEventShape|FileDeleteEventShape|FileVersionCreateEventShape|FileVersionDeleteEventShape diff --git a/src/Webhooks/UploadPostTransformErrorEvent.php b/src/Webhooks/UploadPostTransformErrorEvent.php index fcb9b748..2fb26668 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent.php +++ b/src/Webhooks/UploadPostTransformErrorEvent.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\Webhooks; +namespace ImageKit\Webhooks; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\UploadPostTransformErrorEvent\Data; -use Imagekit\Webhooks\UploadPostTransformErrorEvent\Request; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\UploadPostTransformErrorEvent\Data; +use ImageKit\Webhooks\UploadPostTransformErrorEvent\Request; /** * Triggered when a post-transformation fails. The original file remains available, but the requested transformation could not be generated. * - * @phpstan-import-type DataShape from \Imagekit\Webhooks\UploadPostTransformErrorEvent\Data - * @phpstan-import-type RequestShape from \Imagekit\Webhooks\UploadPostTransformErrorEvent\Request + * @phpstan-import-type DataShape from \ImageKit\Webhooks\UploadPostTransformErrorEvent\Data + * @phpstan-import-type RequestShape from \ImageKit\Webhooks\UploadPostTransformErrorEvent\Request * * @phpstan-type UploadPostTransformErrorEventShape = array{ * id: string, diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data.php b/src/Webhooks/UploadPostTransformErrorEvent/Data.php index 967ab2fc..c223ce04 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Data.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPostTransformErrorEvent; +namespace ImageKit\Webhooks\UploadPostTransformErrorEvent; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation; /** - * @phpstan-import-type TransformationShape from \Imagekit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation + * @phpstan-import-type TransformationShape from \ImageKit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation * * @phpstan-type DataShape = array{ * fileID: string, diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php index 82e3d615..cfd37551 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPostTransformErrorEvent\Data; +namespace ImageKit\Webhooks\UploadPostTransformErrorEvent\Data; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation\Error; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation\Error; /** - * @phpstan-import-type ErrorShape from \Imagekit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation\Error + * @phpstan-import-type ErrorShape from \ImageKit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation\Error * * @phpstan-type TransformationShape = array{error: Error|ErrorShape} */ diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php index a3b4f219..130de60e 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Data/Transformation/Error.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation; +namespace ImageKit\Webhooks\UploadPostTransformErrorEvent\Data\Transformation; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type ErrorShape = array{reason: string} diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request.php b/src/Webhooks/UploadPostTransformErrorEvent/Request.php index 8477ea9b..9b42fa05 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPostTransformErrorEvent; +namespace ImageKit\Webhooks\UploadPostTransformErrorEvent; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation; /** - * @phpstan-import-type TransformationShape from \Imagekit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation + * @phpstan-import-type TransformationShape from \ImageKit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation * * @phpstan-type RequestShape = array{ * transformation: Transformation|TransformationShape, xRequestID: string diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php index 7e7703d6..a02d4598 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPostTransformErrorEvent\Request; - -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation\Protocol; -use Imagekit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation\Type; +namespace ImageKit\Webhooks\UploadPostTransformErrorEvent\Request; + +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation\Protocol; +use ImageKit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation\Type; /** * @phpstan-type TransformationShape = array{ diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Protocol.php b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Protocol.php index 273e2a8a..f6f399cc 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Protocol.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Protocol.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation; +namespace ImageKit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation; /** * Only applicable if transformation type is 'abs'. Streaming protocol used. diff --git a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Type.php b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Type.php index e2c2cb78..5a9dbbf8 100644 --- a/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Type.php +++ b/src/Webhooks/UploadPostTransformErrorEvent/Request/Transformation/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation; +namespace ImageKit\Webhooks\UploadPostTransformErrorEvent\Request\Transformation; /** * Type of the requested post-transformation. diff --git a/src/Webhooks/UploadPostTransformSuccessEvent.php b/src/Webhooks/UploadPostTransformSuccessEvent.php index 69cab6d2..37628bc9 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\Webhooks; +namespace ImageKit\Webhooks; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\UploadPostTransformSuccessEvent\Data; -use Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\UploadPostTransformSuccessEvent\Data; +use ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request; /** * Triggered when a post-transformation completes successfully. The transformed version of the file is now ready and can be accessed via the provided URL. Note that each post-transformation generates a separate webhook event. * - * @phpstan-import-type DataShape from \Imagekit\Webhooks\UploadPostTransformSuccessEvent\Data - * @phpstan-import-type RequestShape from \Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request + * @phpstan-import-type DataShape from \ImageKit\Webhooks\UploadPostTransformSuccessEvent\Data + * @phpstan-import-type RequestShape from \ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request * * @phpstan-type UploadPostTransformSuccessEventShape = array{ * id: string, diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Data.php b/src/Webhooks/UploadPostTransformSuccessEvent/Data.php index 9bfe6258..966e7d9e 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Data.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Data.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPostTransformSuccessEvent; +namespace ImageKit\Webhooks\UploadPostTransformSuccessEvent; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type DataShape = array{fileID: string, name: string, url: string} diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request.php index e8bb182c..5a7e25ad 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPostTransformSuccessEvent; +namespace ImageKit\Webhooks\UploadPostTransformSuccessEvent; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation; /** - * @phpstan-import-type TransformationShape from \Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation + * @phpstan-import-type TransformationShape from \ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation * * @phpstan-type RequestShape = array{ * transformation: Transformation|TransformationShape, xRequestID: string diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php index 7d80090b..594940bb 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation.php @@ -2,14 +2,14 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request; - -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation\Protocol; -use Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation\Type; +namespace ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request; + +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation\Protocol; +use ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation\Type; /** * @phpstan-type TransformationShape = array{ diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Protocol.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Protocol.php index c7aebb30..e9a8d491 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Protocol.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Protocol.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation; +namespace ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation; /** * Only applicable if transformation type is 'abs'. Streaming protocol used. diff --git a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Type.php b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Type.php index c565a96d..9b9fa624 100644 --- a/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Type.php +++ b/src/Webhooks/UploadPostTransformSuccessEvent/Request/Transformation/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation; +namespace ImageKit\Webhooks\UploadPostTransformSuccessEvent\Request\Transformation; /** * Type of the requested post-transformation. diff --git a/src/Webhooks/UploadPreTransformErrorEvent.php b/src/Webhooks/UploadPreTransformErrorEvent.php index e1640ee7..c71426b5 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent.php +++ b/src/Webhooks/UploadPreTransformErrorEvent.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\Webhooks; +namespace ImageKit\Webhooks; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\UploadPreTransformErrorEvent\Data; -use Imagekit\Webhooks\UploadPreTransformErrorEvent\Request; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\UploadPreTransformErrorEvent\Data; +use ImageKit\Webhooks\UploadPreTransformErrorEvent\Request; /** * Triggered when a pre-transformation fails. The file upload may have been accepted, but the requested transformation could not be applied. * - * @phpstan-import-type DataShape from \Imagekit\Webhooks\UploadPreTransformErrorEvent\Data - * @phpstan-import-type RequestShape from \Imagekit\Webhooks\UploadPreTransformErrorEvent\Request + * @phpstan-import-type DataShape from \ImageKit\Webhooks\UploadPreTransformErrorEvent\Data + * @phpstan-import-type RequestShape from \ImageKit\Webhooks\UploadPreTransformErrorEvent\Request * * @phpstan-type UploadPreTransformErrorEventShape = array{ * id: string, diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data.php b/src/Webhooks/UploadPreTransformErrorEvent/Data.php index 119b3086..5b17752d 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Data.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPreTransformErrorEvent; +namespace ImageKit\Webhooks\UploadPreTransformErrorEvent; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation; /** - * @phpstan-import-type TransformationShape from \Imagekit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation + * @phpstan-import-type TransformationShape from \ImageKit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation * * @phpstan-type DataShape = array{ * name: string, path: string, transformation: Transformation|TransformationShape diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php index 6ff64881..95c2165e 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPreTransformErrorEvent\Data; +namespace ImageKit\Webhooks\UploadPreTransformErrorEvent\Data; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation\Error; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation\Error; /** - * @phpstan-import-type ErrorShape from \Imagekit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation\Error + * @phpstan-import-type ErrorShape from \ImageKit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation\Error * * @phpstan-type TransformationShape = array{error: Error|ErrorShape} */ diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php index 48554237..e3e2c31b 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Data/Transformation/Error.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation; +namespace ImageKit\Webhooks\UploadPreTransformErrorEvent\Data\Transformation; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type ErrorShape = array{reason: string} diff --git a/src/Webhooks/UploadPreTransformErrorEvent/Request.php b/src/Webhooks/UploadPreTransformErrorEvent/Request.php index 2e7acc64..3c641161 100644 --- a/src/Webhooks/UploadPreTransformErrorEvent/Request.php +++ b/src/Webhooks/UploadPreTransformErrorEvent/Request.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPreTransformErrorEvent; +namespace ImageKit\Webhooks\UploadPreTransformErrorEvent; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type RequestShape = array{transformation: string, xRequestID: string} diff --git a/src/Webhooks/UploadPreTransformSuccessEvent.php b/src/Webhooks/UploadPreTransformSuccessEvent.php index ab508328..b4c57508 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\Webhooks; +namespace ImageKit\Webhooks; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Request; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Request; /** * Triggered when a pre-transformation completes successfully. The file has been processed with the requested transformation and is now available in the Media Library. * - * @phpstan-import-type DataShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data - * @phpstan-import-type RequestShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Request + * @phpstan-import-type DataShape from \ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data + * @phpstan-import-type RequestShape from \ImageKit\Webhooks\UploadPreTransformSuccessEvent\Request * * @phpstan-type UploadPreTransformSuccessEventShape = array{ * id: string, diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php index 6d06b25d..2b5d0279 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data.php @@ -2,25 +2,25 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent; +namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Files\Metadata; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\AITag; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\VersionInfo; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Files\Metadata; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\AITag; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\VersionInfo; /** * Object containing details of a successful upload. * - * @phpstan-import-type AITagShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\AITag - * @phpstan-import-type ExtensionStatusShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus - * @phpstan-import-type MetadataShape from \Imagekit\Files\Metadata - * @phpstan-import-type SelectedFieldsSchemaShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema - * @phpstan-import-type VersionInfoShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\VersionInfo + * @phpstan-import-type AITagShape from \ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\AITag + * @phpstan-import-type ExtensionStatusShape from \ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus + * @phpstan-import-type MetadataShape from \ImageKit\Files\Metadata + * @phpstan-import-type SelectedFieldsSchemaShape from \ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema + * @phpstan-import-type VersionInfoShape from \ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\VersionInfo * * @phpstan-type DataShape = array{ * aiTags?: list|null, diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php index 4bba6eda..f32e6d15 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/AITag.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data; +namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * AI-generated tag associated with an image. These tags can be added using the `google-auto-tagging` or `aws-auto-tagging` extensions. diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php index 0ad3f22a..5c0cf5ab 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus.php @@ -2,16 +2,16 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data; - -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\AIAutoDescription; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\AITasks; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\AwsAutoTagging; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\GoogleAutoTagging; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\RemoveBg; +namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data; + +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\AIAutoDescription; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\AITasks; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\AwsAutoTagging; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\GoogleAutoTagging; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus\RemoveBg; /** * Extension names with their processing status at the time of completion of the request. It could have one of the following status values: diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AIAutoDescription.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AIAutoDescription.php index c1b7c0fb..a9cc5f07 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AIAutoDescription.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AIAutoDescription.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; +namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; enum AIAutoDescription: string { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AITasks.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AITasks.php index cd735a06..b5afa8bb 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AITasks.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AITasks.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; +namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; enum AITasks: string { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AwsAutoTagging.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AwsAutoTagging.php index 08047f44..6ff57cec 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AwsAutoTagging.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/AwsAutoTagging.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; +namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; enum AwsAutoTagging: string { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/GoogleAutoTagging.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/GoogleAutoTagging.php index c1f24075..31f9d58b 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/GoogleAutoTagging.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/GoogleAutoTagging.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; +namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; enum GoogleAutoTagging: string { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/RemoveBg.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/RemoveBg.php index ced8c0ee..6e389314 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/RemoveBg.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/ExtensionStatus/RemoveBg.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; +namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\ExtensionStatus; enum RemoveBg: string { diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php index 0ae6f2a9..dca5955c 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema.php @@ -2,25 +2,25 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data; +namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\SelectOption; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\Type; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\SelectOption; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\Type; /** - * @phpstan-import-type DefaultValueVariants from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue - * @phpstan-import-type MaxValueVariants from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\MaxValue - * @phpstan-import-type MinValueVariants from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\MinValue - * @phpstan-import-type SelectOptionVariants from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\SelectOption - * @phpstan-import-type DefaultValueShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue - * @phpstan-import-type MaxValueShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\MaxValue - * @phpstan-import-type MinValueShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\MinValue - * @phpstan-import-type SelectOptionShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\SelectOption + * @phpstan-import-type DefaultValueVariants from \ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue + * @phpstan-import-type MaxValueVariants from \ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\MaxValue + * @phpstan-import-type MinValueVariants from \ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\MinValue + * @phpstan-import-type SelectOptionVariants from \ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\SelectOption + * @phpstan-import-type DefaultValueShape from \ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue + * @phpstan-import-type MaxValueShape from \ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\MaxValue + * @phpstan-import-type MinValueShape from \ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\MinValue + * @phpstan-import-type SelectOptionShape from \ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\SelectOption * * @phpstan-type SelectedFieldsSchemaShape = array{ * type: Type|value-of, diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php index f489d39f..8adaf3a1 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; +namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; -use Imagekit\Core\Conversion\ListOf; -use Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue\Mixed_; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Conversion\ListOf; +use ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue\Mixed_; /** * The default value for this custom metadata field. The value should match the `type` of custom metadata field. * - * @phpstan-import-type MixedShape from \Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue\Mixed_ + * @phpstan-import-type MixedShape from \ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue\Mixed_ * * @phpstan-type DefaultValueVariants = string|float|bool|list * @phpstan-type DefaultValueShape = DefaultValueVariants|list diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed_.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed_.php index db130b3f..60f3a6e5 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed_.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/DefaultValue/Mixed_.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue; +namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema\DefaultValue; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @phpstan-type MixedVariants = string|float|bool diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MaxValue.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MaxValue.php index bde99e35..07daa097 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MaxValue.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MaxValue.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; +namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Maximum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MinValue.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MinValue.php index 066cb052..c1dd20ae 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MinValue.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/MinValue.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; +namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * Minimum value of the field. Only set if field type is `Date` or `Number`. For `Date` type field, the value will be in ISO8601 string format. For `Number` type field, it will be a numeric value. diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/SelectOption.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/SelectOption.php index a53ca9e6..db28a90f 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/SelectOption.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/SelectOption.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; +namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; -use Imagekit\Core\Concerns\SdkUnion; -use Imagekit\Core\Conversion\Contracts\Converter; -use Imagekit\Core\Conversion\Contracts\ConverterSource; +use ImageKit\Core\Concerns\SdkUnion; +use ImageKit\Core\Conversion\Contracts\Converter; +use ImageKit\Core\Conversion\Contracts\ConverterSource; /** * @phpstan-type SelectOptionVariants = string|float|bool diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/Type.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/Type.php index f643af4e..3f000dee 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/Type.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/SelectedFieldsSchema/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; +namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data\SelectedFieldsSchema; /** * Type of the custom metadata field. diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php b/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php index 7d8289c0..c66b0347 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Data/VersionInfo.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent\Data; +namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent\Data; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * An object containing the file or file version's `id` (versionId) and `name`. diff --git a/src/Webhooks/UploadPreTransformSuccessEvent/Request.php b/src/Webhooks/UploadPreTransformSuccessEvent/Request.php index 12ce9bd0..caa7f2c5 100644 --- a/src/Webhooks/UploadPreTransformSuccessEvent/Request.php +++ b/src/Webhooks/UploadPreTransformSuccessEvent/Request.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\UploadPreTransformSuccessEvent; +namespace ImageKit\Webhooks\UploadPreTransformSuccessEvent; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * @phpstan-type RequestShape = array{transformation: string, xRequestID: string} diff --git a/src/Webhooks/VideoTransformationAcceptedEvent.php b/src/Webhooks/VideoTransformationAcceptedEvent.php index 0708daee..1b03f04f 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\Webhooks; +namespace ImageKit\Webhooks; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data; -use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Request; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data; +use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Request; /** * Triggered when a new video transformation request is accepted for processing. This event confirms that ImageKit has received and queued your transformation request. Use this for debugging and tracking transformation lifecycle. * - * @phpstan-import-type DataShape from \Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data - * @phpstan-import-type RequestShape from \Imagekit\Webhooks\VideoTransformationAcceptedEvent\Request + * @phpstan-import-type DataShape from \ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data + * @phpstan-import-type RequestShape from \ImageKit\Webhooks\VideoTransformationAcceptedEvent\Request * * @phpstan-type VideoTransformationAcceptedEventShape = array{ * id: string, diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data.php index 6144343f..2183b326 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent; +namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Asset; -use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Asset; +use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation; /** - * @phpstan-import-type AssetShape from \Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Asset - * @phpstan-import-type TransformationShape from \Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation + * @phpstan-import-type AssetShape from \ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Asset + * @phpstan-import-type TransformationShape from \ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation * * @phpstan-type DataShape = array{ * asset: Asset|AssetShape, transformation: Transformation|TransformationShape diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php index 726c4b50..817c9c2c 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Asset.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data; +namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * Information about the source video asset being transformed. diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php index bbf46fd8..15c532d4 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data; +namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; -use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Type; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; +use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Type; /** * Base information about a video transformation request. * - * @phpstan-import-type OptionsShape from \Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options + * @phpstan-import-type OptionsShape from \ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options * * @phpstan-type TransformationShape = array{ * type: Type|value-of, options?: null|Options|OptionsShape diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php index 43afe77e..e2c3d608 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation; - -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\AudioCodec; -use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\Format; -use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\StreamProtocol; -use Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\VideoCodec; +namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation; + +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\AudioCodec; +use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\Format; +use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\StreamProtocol; +use ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options\VideoCodec; /** * Configuration options for video transformations. diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/AudioCodec.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/AudioCodec.php index ec4fd4b4..e9034932 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/AudioCodec.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/AudioCodec.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; +namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; /** * Audio codec used for encoding (aac or opus). diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/Format.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/Format.php index 5b3fe80f..46b26e0e 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/Format.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/Format.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; +namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; /** * Output format for the transformed video or thumbnail. diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/StreamProtocol.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/StreamProtocol.php index 94d65a6b..c8b11edd 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/StreamProtocol.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/StreamProtocol.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; +namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; /** * Streaming protocol for adaptive bitrate streaming. diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/VideoCodec.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/VideoCodec.php index 393581e3..f2afe7bf 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/VideoCodec.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Options/VideoCodec.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; +namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation\Options; /** * Video codec used for encoding (h264, vp9, or av1). diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Type.php b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Type.php index 209a41a3..75f61460 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Type.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Data/Transformation/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation; +namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent\Data\Transformation; /** * Type of video transformation: diff --git a/src/Webhooks/VideoTransformationAcceptedEvent/Request.php b/src/Webhooks/VideoTransformationAcceptedEvent/Request.php index 202799d0..8ebea931 100644 --- a/src/Webhooks/VideoTransformationAcceptedEvent/Request.php +++ b/src/Webhooks/VideoTransformationAcceptedEvent/Request.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationAcceptedEvent; +namespace ImageKit\Webhooks\VideoTransformationAcceptedEvent; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * Information about the original request that triggered the video transformation. diff --git a/src/Webhooks/VideoTransformationErrorEvent.php b/src/Webhooks/VideoTransformationErrorEvent.php index dc637214..c289d758 100644 --- a/src/Webhooks/VideoTransformationErrorEvent.php +++ b/src/Webhooks/VideoTransformationErrorEvent.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\Webhooks; +namespace ImageKit\Webhooks; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\VideoTransformationErrorEvent\Data; -use Imagekit\Webhooks\VideoTransformationErrorEvent\Request; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\VideoTransformationErrorEvent\Data; +use ImageKit\Webhooks\VideoTransformationErrorEvent\Request; /** * Triggered when an error occurs during video encoding. Listen to this webhook to log error reasons and debug issues. Check your origin and URL endpoint settings if the reason is related to download failure. For other errors, contact ImageKit support. * - * @phpstan-import-type DataShape from \Imagekit\Webhooks\VideoTransformationErrorEvent\Data - * @phpstan-import-type RequestShape from \Imagekit\Webhooks\VideoTransformationErrorEvent\Request + * @phpstan-import-type DataShape from \ImageKit\Webhooks\VideoTransformationErrorEvent\Data + * @phpstan-import-type RequestShape from \ImageKit\Webhooks\VideoTransformationErrorEvent\Request * * @phpstan-type VideoTransformationErrorEventShape = array{ * id: string, diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data.php b/src/Webhooks/VideoTransformationErrorEvent/Data.php index 833fcc94..0df6009c 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationErrorEvent; +namespace ImageKit\Webhooks\VideoTransformationErrorEvent; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Asset; -use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Asset; +use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; /** - * @phpstan-import-type AssetShape from \Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Asset - * @phpstan-import-type TransformationShape from \Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation + * @phpstan-import-type AssetShape from \ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Asset + * @phpstan-import-type TransformationShape from \ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation * * @phpstan-type DataShape = array{ * asset: Asset|AssetShape, transformation: Transformation|TransformationShape diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php index 0f6fc2ac..a41c76d1 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Asset.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationErrorEvent\Data; +namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * Information about the source video asset being transformed. diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php index e60cdf18..16efca63 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationErrorEvent\Data; +namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error; -use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; -use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Type; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error; +use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; +use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Type; /** - * @phpstan-import-type ErrorShape from \Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error - * @phpstan-import-type OptionsShape from \Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options + * @phpstan-import-type ErrorShape from \ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error + * @phpstan-import-type OptionsShape from \ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options * * @phpstan-type TransformationShape = array{ * type: Type|value-of, diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php index 09480994..06c1d0b1 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; +namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error\Reason; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error\Reason; /** * Details about the transformation error. diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error/Reason.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error/Reason.php index 17893063..751baa9f 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error/Reason.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Error/Reason.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error; +namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Error; /** * Specific reason for the transformation failure: diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php index f5575323..82a664ac 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; - -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\AudioCodec; -use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\Format; -use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\StreamProtocol; -use Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\VideoCodec; +namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; + +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\AudioCodec; +use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\Format; +use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\StreamProtocol; +use ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options\VideoCodec; /** * Configuration options for video transformations. diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/AudioCodec.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/AudioCodec.php index bc5b53d4..c33c2fef 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/AudioCodec.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/AudioCodec.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; +namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; /** * Audio codec used for encoding (aac or opus). diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/Format.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/Format.php index 236d4d59..c37d8135 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/Format.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/Format.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; +namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; /** * Output format for the transformed video or thumbnail. diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/StreamProtocol.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/StreamProtocol.php index 00471a43..73d64235 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/StreamProtocol.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/StreamProtocol.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; +namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; /** * Streaming protocol for adaptive bitrate streaming. diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/VideoCodec.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/VideoCodec.php index d295b710..7540a5fb 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/VideoCodec.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Options/VideoCodec.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; +namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation\Options; /** * Video codec used for encoding (h264, vp9, or av1). diff --git a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Type.php b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Type.php index 8a1d9454..38869bb0 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Type.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Data/Transformation/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; +namespace ImageKit\Webhooks\VideoTransformationErrorEvent\Data\Transformation; /** * Type of video transformation: diff --git a/src/Webhooks/VideoTransformationErrorEvent/Request.php b/src/Webhooks/VideoTransformationErrorEvent/Request.php index 02a6b569..62fe77d0 100644 --- a/src/Webhooks/VideoTransformationErrorEvent/Request.php +++ b/src/Webhooks/VideoTransformationErrorEvent/Request.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationErrorEvent; +namespace ImageKit\Webhooks\VideoTransformationErrorEvent; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * Information about the original request that triggered the video transformation. diff --git a/src/Webhooks/VideoTransformationReadyEvent.php b/src/Webhooks/VideoTransformationReadyEvent.php index 9e187ed0..7d08c1ef 100644 --- a/src/Webhooks/VideoTransformationReadyEvent.php +++ b/src/Webhooks/VideoTransformationReadyEvent.php @@ -2,22 +2,22 @@ declare(strict_types=1); -namespace Imagekit\Webhooks; +namespace ImageKit\Webhooks; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\VideoTransformationReadyEvent\Data; -use Imagekit\Webhooks\VideoTransformationReadyEvent\Request; -use Imagekit\Webhooks\VideoTransformationReadyEvent\Timings; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\VideoTransformationReadyEvent\Data; +use ImageKit\Webhooks\VideoTransformationReadyEvent\Request; +use ImageKit\Webhooks\VideoTransformationReadyEvent\Timings; /** * Triggered when video encoding is finished and the transformed resource is ready to be served. This is the key event to listen for - update your database or CMS flags when you receive this so your application can start showing the transformed video to users. * - * @phpstan-import-type DataShape from \Imagekit\Webhooks\VideoTransformationReadyEvent\Data - * @phpstan-import-type RequestShape from \Imagekit\Webhooks\VideoTransformationReadyEvent\Request - * @phpstan-import-type TimingsShape from \Imagekit\Webhooks\VideoTransformationReadyEvent\Timings + * @phpstan-import-type DataShape from \ImageKit\Webhooks\VideoTransformationReadyEvent\Data + * @phpstan-import-type RequestShape from \ImageKit\Webhooks\VideoTransformationReadyEvent\Request + * @phpstan-import-type TimingsShape from \ImageKit\Webhooks\VideoTransformationReadyEvent\Timings * * @phpstan-type VideoTransformationReadyEventShape = array{ * id: string, diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data.php b/src/Webhooks/VideoTransformationReadyEvent/Data.php index 826fedb6..aee25cf4 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data.php @@ -2,17 +2,17 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationReadyEvent; +namespace ImageKit\Webhooks\VideoTransformationReadyEvent; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Asset; -use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Asset; +use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; /** - * @phpstan-import-type AssetShape from \Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Asset - * @phpstan-import-type TransformationShape from \Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation + * @phpstan-import-type AssetShape from \ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Asset + * @phpstan-import-type TransformationShape from \ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation * * @phpstan-type DataShape = array{ * asset: Asset|AssetShape, transformation: Transformation|TransformationShape diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php index bc5ae690..73388521 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Asset.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data; +namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * Information about the source video asset being transformed. diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php index ae70d5ad..169eec3c 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation.php @@ -2,19 +2,19 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data; +namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; -use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output; -use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Type; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; +use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output; +use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Type; /** - * @phpstan-import-type OptionsShape from \Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options - * @phpstan-import-type OutputShape from \Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output + * @phpstan-import-type OptionsShape from \ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options + * @phpstan-import-type OutputShape from \ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output * * @phpstan-type TransformationShape = array{ * type: Type|value-of, diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php index 17cd66df..c121c59c 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options.php @@ -2,15 +2,15 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; - -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\AudioCodec; -use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\Format; -use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\StreamProtocol; -use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\VideoCodec; +namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; + +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\AudioCodec; +use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\Format; +use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\StreamProtocol; +use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options\VideoCodec; /** * Configuration options for video transformations. diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/AudioCodec.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/AudioCodec.php index 72c07068..28919565 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/AudioCodec.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/AudioCodec.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; +namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; /** * Audio codec used for encoding (aac or opus). diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/Format.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/Format.php index 7cb4ea6b..8c7dfc76 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/Format.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/Format.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; +namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; /** * Output format for the transformed video or thumbnail. diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/StreamProtocol.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/StreamProtocol.php index f57f0497..604fb5cd 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/StreamProtocol.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/StreamProtocol.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; +namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; /** * Streaming protocol for adaptive bitrate streaming. diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/VideoCodec.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/VideoCodec.php index 91059365..f8061f64 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/VideoCodec.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Options/VideoCodec.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; +namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Options; /** * Video codec used for encoding (h264, vp9, or av1). diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php index b7bd9f68..4bcc4da1 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output.php @@ -2,18 +2,18 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; +namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; -use Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output\VideoMetadata; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; +use ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output\VideoMetadata; /** * Information about the transformed output video. * - * @phpstan-import-type VideoMetadataShape from \Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output\VideoMetadata + * @phpstan-import-type VideoMetadataShape from \ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output\VideoMetadata * * @phpstan-type OutputShape = array{ * url: string, videoMetadata?: null|VideoMetadata|VideoMetadataShape diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php index 7edcfa3b..c1903388 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Output/VideoMetadata.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output; +namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation\Output; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * Metadata of the output video file. diff --git a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Type.php b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Type.php index b305d9b0..0dfcbeae 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Type.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Data/Transformation/Type.php @@ -2,7 +2,7 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; +namespace ImageKit\Webhooks\VideoTransformationReadyEvent\Data\Transformation; /** * Type of video transformation: diff --git a/src/Webhooks/VideoTransformationReadyEvent/Request.php b/src/Webhooks/VideoTransformationReadyEvent/Request.php index 38343e7b..8ed1f74d 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Request.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Request.php @@ -2,12 +2,12 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationReadyEvent; +namespace ImageKit\Webhooks\VideoTransformationReadyEvent; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * Information about the original request that triggered the video transformation. diff --git a/src/Webhooks/VideoTransformationReadyEvent/Timings.php b/src/Webhooks/VideoTransformationReadyEvent/Timings.php index ce383aa0..f147e9bf 100644 --- a/src/Webhooks/VideoTransformationReadyEvent/Timings.php +++ b/src/Webhooks/VideoTransformationReadyEvent/Timings.php @@ -2,11 +2,11 @@ declare(strict_types=1); -namespace Imagekit\Webhooks\VideoTransformationReadyEvent; +namespace ImageKit\Webhooks\VideoTransformationReadyEvent; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; /** * Performance metrics for the transformation process. diff --git a/tests/ClientTest.php b/tests/ClientTest.php index 7c364591..a3ca6694 100644 --- a/tests/ClientTest.php +++ b/tests/ClientTest.php @@ -4,8 +4,8 @@ use Http\Discovery\Psr17FactoryDiscovery; use Http\Mock\Client; -use Imagekit\Core\FileParam; -use Imagekit\Core\Util; +use ImageKit\Core\FileParam; +use ImageKit\Core\Util; use PHPUnit\Framework\TestCase; /** @@ -27,7 +27,7 @@ public function testDefaultHeaders(): void $transporter->setDefaultResponse($mockRsp); - $client = new \Imagekit\Client( + $client = new \ImageKit\Client( baseUrl: 'http://localhost', privateKey: 'My Private Key', password: 'My Password', diff --git a/tests/Core/ModelTest.php b/tests/Core/ModelTest.php index 7260e691..bd4682ab 100644 --- a/tests/Core/ModelTest.php +++ b/tests/Core/ModelTest.php @@ -2,10 +2,10 @@ namespace Tests\Core; -use Imagekit\Core\Attributes\Optional; -use Imagekit\Core\Attributes\Required; -use Imagekit\Core\Concerns\SdkModel; -use Imagekit\Core\Contracts\BaseModel; +use ImageKit\Core\Attributes\Optional; +use ImageKit\Core\Attributes\Required; +use ImageKit\Core\Concerns\SdkModel; +use ImageKit\Core\Contracts\BaseModel; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Core/StreamingTransportTest.php b/tests/Core/StreamingTransportTest.php index 3f85a368..1014a6c5 100644 --- a/tests/Core/StreamingTransportTest.php +++ b/tests/Core/StreamingTransportTest.php @@ -4,9 +4,9 @@ use Http\Discovery\Psr17FactoryDiscovery; use Http\Mock\Client as MockClient; -use Imagekit\Core\BaseClient; -use Imagekit\Core\Util; -use Imagekit\RequestOptions; +use ImageKit\Core\BaseClient; +use ImageKit\Core\Util; +use ImageKit\RequestOptions; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Core/UtilTest.php b/tests/Core/UtilTest.php index fd2be56b..acce0587 100644 --- a/tests/Core/UtilTest.php +++ b/tests/Core/UtilTest.php @@ -3,7 +3,7 @@ namespace Tests\Core; use Http\Discovery\Psr17FactoryDiscovery; -use Imagekit\Core\Util; +use ImageKit\Core\Util; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/Accounts/OriginsTest.php b/tests/Services/Accounts/OriginsTest.php index a1b1c1ef..6f927c36 100644 --- a/tests/Services/Accounts/OriginsTest.php +++ b/tests/Services/Accounts/OriginsTest.php @@ -2,8 +2,8 @@ namespace Tests\Services\Accounts; -use Imagekit\Client; -use Imagekit\Core\Util; +use ImageKit\Client; +use ImageKit\Core\Util; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/Accounts/URLEndpointsTest.php b/tests/Services/Accounts/URLEndpointsTest.php index 0d2e8dbc..fff8bc16 100644 --- a/tests/Services/Accounts/URLEndpointsTest.php +++ b/tests/Services/Accounts/URLEndpointsTest.php @@ -2,9 +2,9 @@ namespace Tests\Services\Accounts; -use Imagekit\Accounts\URLEndpoints\URLEndpointResponse; -use Imagekit\Client; -use Imagekit\Core\Util; +use ImageKit\Accounts\URLEndpoints\URLEndpointResponse; +use ImageKit\Client; +use ImageKit\Core\Util; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/Accounts/UsageTest.php b/tests/Services/Accounts/UsageTest.php index 7ada415c..a1bd0096 100644 --- a/tests/Services/Accounts/UsageTest.php +++ b/tests/Services/Accounts/UsageTest.php @@ -2,9 +2,9 @@ namespace Tests\Services\Accounts; -use Imagekit\Accounts\Usage\UsageGetResponse; -use Imagekit\Client; -use Imagekit\Core\Util; +use ImageKit\Accounts\Usage\UsageGetResponse; +use ImageKit\Client; +use ImageKit\Core\Util; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/AssetsTest.php b/tests/Services/AssetsTest.php index 13b220e6..f3e729d3 100644 --- a/tests/Services/AssetsTest.php +++ b/tests/Services/AssetsTest.php @@ -2,8 +2,8 @@ namespace Tests\Services; -use Imagekit\Client; -use Imagekit\Core\Util; +use ImageKit\Client; +use ImageKit\Core\Util; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/Beta/V2/FilesTest.php b/tests/Services/Beta/V2/FilesTest.php index ea62d779..a5da04d6 100644 --- a/tests/Services/Beta/V2/FilesTest.php +++ b/tests/Services/Beta/V2/FilesTest.php @@ -2,10 +2,10 @@ namespace Tests\Services\Beta\V2; -use Imagekit\Beta\V2\Files\FileUploadResponse; -use Imagekit\Client; -use Imagekit\Core\FileParam; -use Imagekit\Core\Util; +use ImageKit\Beta\V2\Files\FileUploadResponse; +use ImageKit\Client; +use ImageKit\Core\FileParam; +use ImageKit\Core\Util; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/Cache/InvalidationTest.php b/tests/Services/Cache/InvalidationTest.php index e1101cef..9744391a 100644 --- a/tests/Services/Cache/InvalidationTest.php +++ b/tests/Services/Cache/InvalidationTest.php @@ -2,10 +2,10 @@ namespace Tests\Services\Cache; -use Imagekit\Cache\Invalidation\InvalidationGetResponse; -use Imagekit\Cache\Invalidation\InvalidationNewResponse; -use Imagekit\Client; -use Imagekit\Core\Util; +use ImageKit\Cache\Invalidation\InvalidationGetResponse; +use ImageKit\Cache\Invalidation\InvalidationNewResponse; +use ImageKit\Client; +use ImageKit\Core\Util; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/CustomMetadataFieldsTest.php b/tests/Services/CustomMetadataFieldsTest.php index d68aa2ec..fe677646 100644 --- a/tests/Services/CustomMetadataFieldsTest.php +++ b/tests/Services/CustomMetadataFieldsTest.php @@ -2,10 +2,10 @@ namespace Tests\Services; -use Imagekit\Client; -use Imagekit\Core\Util; -use Imagekit\CustomMetadataFields\CustomMetadataField; -use Imagekit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; +use ImageKit\Client; +use ImageKit\Core\Util; +use ImageKit\CustomMetadataFields\CustomMetadataField; +use ImageKit\CustomMetadataFields\CustomMetadataFieldDeleteResponse; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/Files/BulkTest.php b/tests/Services/Files/BulkTest.php index 144ce9ef..e20e6c31 100644 --- a/tests/Services/Files/BulkTest.php +++ b/tests/Services/Files/BulkTest.php @@ -2,12 +2,12 @@ namespace Tests\Services\Files; -use Imagekit\Client; -use Imagekit\Core\Util; -use Imagekit\Files\Bulk\BulkAddTagsResponse; -use Imagekit\Files\Bulk\BulkDeleteResponse; -use Imagekit\Files\Bulk\BulkRemoveAITagsResponse; -use Imagekit\Files\Bulk\BulkRemoveTagsResponse; +use ImageKit\Client; +use ImageKit\Core\Util; +use ImageKit\Files\Bulk\BulkAddTagsResponse; +use ImageKit\Files\Bulk\BulkDeleteResponse; +use ImageKit\Files\Bulk\BulkRemoveAITagsResponse; +use ImageKit\Files\Bulk\BulkRemoveTagsResponse; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/Files/MetadataTest.php b/tests/Services/Files/MetadataTest.php index 6702265a..5216a3ca 100644 --- a/tests/Services/Files/MetadataTest.php +++ b/tests/Services/Files/MetadataTest.php @@ -2,9 +2,9 @@ namespace Tests\Services\Files; -use Imagekit\Client; -use Imagekit\Core\Util; -use Imagekit\Files\Metadata; +use ImageKit\Client; +use ImageKit\Core\Util; +use ImageKit\Files\Metadata; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/Files/VersionsTest.php b/tests/Services/Files/VersionsTest.php index ca5e2ba9..7f5ffd52 100644 --- a/tests/Services/Files/VersionsTest.php +++ b/tests/Services/Files/VersionsTest.php @@ -2,10 +2,10 @@ namespace Tests\Services\Files; -use Imagekit\Client; -use Imagekit\Core\Util; -use Imagekit\Files\File; -use Imagekit\Files\Versions\VersionDeleteResponse; +use ImageKit\Client; +use ImageKit\Core\Util; +use ImageKit\Files\File; +use ImageKit\Files\Versions\VersionDeleteResponse; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/FilesTest.php b/tests/Services/FilesTest.php index 55ee8e0d..e1c920d2 100644 --- a/tests/Services/FilesTest.php +++ b/tests/Services/FilesTest.php @@ -2,15 +2,15 @@ namespace Tests\Services; -use Imagekit\Client; -use Imagekit\Core\FileParam; -use Imagekit\Core\Util; -use Imagekit\Files\File; -use Imagekit\Files\FileCopyResponse; -use Imagekit\Files\FileMoveResponse; -use Imagekit\Files\FileRenameResponse; -use Imagekit\Files\FileUpdateResponse; -use Imagekit\Files\FileUploadResponse; +use ImageKit\Client; +use ImageKit\Core\FileParam; +use ImageKit\Core\Util; +use ImageKit\Files\File; +use ImageKit\Files\FileCopyResponse; +use ImageKit\Files\FileMoveResponse; +use ImageKit\Files\FileRenameResponse; +use ImageKit\Files\FileUpdateResponse; +use ImageKit\Files\FileUploadResponse; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/Folders/JobTest.php b/tests/Services/Folders/JobTest.php index 88748fae..7a1a5870 100644 --- a/tests/Services/Folders/JobTest.php +++ b/tests/Services/Folders/JobTest.php @@ -2,9 +2,9 @@ namespace Tests\Services\Folders; -use Imagekit\Client; -use Imagekit\Core\Util; -use Imagekit\Folders\Job\JobGetResponse; +use ImageKit\Client; +use ImageKit\Core\Util; +use ImageKit\Folders\Job\JobGetResponse; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/FoldersTest.php b/tests/Services/FoldersTest.php index 5251a59a..2aa44b02 100644 --- a/tests/Services/FoldersTest.php +++ b/tests/Services/FoldersTest.php @@ -2,13 +2,13 @@ namespace Tests\Services; -use Imagekit\Client; -use Imagekit\Core\Util; -use Imagekit\Folders\FolderCopyResponse; -use Imagekit\Folders\FolderDeleteResponse; -use Imagekit\Folders\FolderMoveResponse; -use Imagekit\Folders\FolderNewResponse; -use Imagekit\Folders\FolderRenameResponse; +use ImageKit\Client; +use ImageKit\Core\Util; +use ImageKit\Folders\FolderCopyResponse; +use ImageKit\Folders\FolderDeleteResponse; +use ImageKit\Folders\FolderMoveResponse; +use ImageKit\Folders\FolderNewResponse; +use ImageKit\Folders\FolderRenameResponse; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/SavedExtensionsTest.php b/tests/Services/SavedExtensionsTest.php index 8b54e333..f3cf8d70 100644 --- a/tests/Services/SavedExtensionsTest.php +++ b/tests/Services/SavedExtensionsTest.php @@ -2,9 +2,9 @@ namespace Tests\Services; -use Imagekit\Client; -use Imagekit\Core\Util; -use Imagekit\SavedExtension; +use ImageKit\Client; +use ImageKit\Core\Util; +use ImageKit\SavedExtension; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; diff --git a/tests/Services/WebhooksTest.php b/tests/Services/WebhooksTest.php index a4e56284..d9458597 100644 --- a/tests/Services/WebhooksTest.php +++ b/tests/Services/WebhooksTest.php @@ -2,9 +2,9 @@ namespace Tests\Services; -use Imagekit\Client; -use Imagekit\Core\Exceptions\WebhookException; -use Imagekit\Core\Util; +use ImageKit\Client; +use ImageKit\Core\Exceptions\WebhookException; +use ImageKit\Core\Util; use PHPUnit\Framework\Attributes\CoversNothing; use PHPUnit\Framework\Attributes\Test; use PHPUnit\Framework\TestCase; From ada6b9026fe9d725e7dd46ce4c9fc450023cb011 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Sat, 23 May 2026 05:32:06 +0000 Subject: [PATCH 193/193] release: 0.1.0 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 179 ++++++++++++++++++++++++++++++++++ README.md | 2 +- src/Version.php | 2 +- 4 files changed, 182 insertions(+), 3 deletions(-) create mode 100644 CHANGELOG.md diff --git a/.release-please-manifest.json b/.release-please-manifest.json index 1332969b..3d2ac0bd 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.0.1" + ".": "0.1.0" } \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 00000000..72c9c81d --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,179 @@ +# Changelog + +## 0.1.0 (2026-05-23) + +Full Changelog: [v0.0.1...v0.1.0](https://github.com/imagekit-developer/imagekit-php/compare/v0.0.1...v0.1.0) + +### ⚠ BREAKING CHANGES + +* remove unused webhook params +* replace special flag type `omittable` with just `null` +* use aliases for phpstan types +* improve identifier renaming for names that clash with builtins +* use camel casing for all class properties +* **client:** redesign methods +* remove confusing `toArray()` alias to `__serialize()` in favour of `toProperties()` +* expose services and service contracts + +### Features + +* add `BaseResponse` class for accessing raw responses ([f7102f9](https://github.com/imagekit-developer/imagekit-php/commit/f7102f9b0eb254f51e210ee9a5106cdbff98b3a6)) +* add idempotency header support ([aabdd47](https://github.com/imagekit-developer/imagekit-php/commit/aabdd475e597cf8a33699651aeaa7fc6d8681b52)) +* add setters to constant parameters ([2a1cdf8](https://github.com/imagekit-developer/imagekit-php/commit/2a1cdf802ce25941729d92632ac88ec11d708fda)) +* allow both model class instances and arrays in setters ([eee2c6e](https://github.com/imagekit-developer/imagekit-php/commit/eee2c6ec19c56a1635840341ee047f6e3b790142)) +* **api:** add BaseWebhookEvent ([84f5b7c](https://github.com/imagekit-developer/imagekit-php/commit/84f5b7c65eb1b7b23fdda823aca71c51b73023e3)) +* **api:** add customMetadata property to folder schema ([2b8763e](https://github.com/imagekit-developer/imagekit-php/commit/2b8763e03a721ac880ff51dc41a0b5a075916bf2)) +* **api:** add GetImageAttributesOptions and ResponsiveImageAttributes schemas; update resource references in main.yaml; remove dummy endpoint ([f2b5264](https://github.com/imagekit-developer/imagekit-php/commit/f2b52643c14ced1fe4264ddc4517c3394b0cc507)) +* **api:** add no-enlarge crop modes and colorize transformation ([ffebb94](https://github.com/imagekit-developer/imagekit-php/commit/ffebb946ee7e6ceca5824d9fb0ded368ba439431)) +* **api:** add path policy related non-breaking changes ([b961183](https://github.com/imagekit-developer/imagekit-php/commit/b961183d52e6374915bb9d1d403c89f561ed53a2)) +* **api:** Add saved extensions API and enhance transformation options ([2299402](https://github.com/imagekit-developer/imagekit-php/commit/229940265d3a5e7ba42bf3fd5ecaec92d67c1e6d)) +* **api:** add selectedFieldsSchema in upload and list API response ([24b3de1](https://github.com/imagekit-developer/imagekit-php/commit/24b3de13174ce310577db618727add52833b00ef)) +* **api:** add webhook verification ([f229b60](https://github.com/imagekit-developer/imagekit-php/commit/f229b603c92e55e54ebf745b07bc97a86ec04358)) +* **api:** dam related webhook events ([a9623d9](https://github.com/imagekit-developer/imagekit-php/commit/a9623d953b519a3b526dc98993a8e762459a0eae)) +* **api:** dpr type update ([ee5e13b](https://github.com/imagekit-developer/imagekit-php/commit/ee5e13b4b0776354070b0fb51a6acd56743bb680)) +* **api:** extract UpdateFileDetailsRequest to model ([8628e12](https://github.com/imagekit-developer/imagekit-php/commit/8628e12e2bdb99f3755bb1ea960547876fcccf00)) +* **api:** fix spec indentation ([c98a0fb](https://github.com/imagekit-developer/imagekit-php/commit/c98a0fbfa6db3824d263d51e1b50446fb6344877)) +* **api:** fix upload API request params ([d79cd68](https://github.com/imagekit-developer/imagekit-php/commit/d79cd6841ecb59fd1360663036af57b27c00f8fa)) +* **api:** indentation fix ([8190166](https://github.com/imagekit-developer/imagekit-php/commit/8190166ab4aeef88bc35fec0140ea7bbedbc3d77)) +* **api:** Introduce lxc, lyc, lap parameters in overlays. ([0f57760](https://github.com/imagekit-developer/imagekit-php/commit/0f5776049a1c25d6d957d1f93d919db41ea3de33)) +* **api:** manual updates ([9c45ffa](https://github.com/imagekit-developer/imagekit-php/commit/9c45ffaa1995b69c467d307238b2882944b3c7ad)) +* **api:** manual updates ([333c06b](https://github.com/imagekit-developer/imagekit-php/commit/333c06bedfbe8d5a91d1549ad5d67f05e794d159)) +* **api:** manual updates ([2d65a57](https://github.com/imagekit-developer/imagekit-php/commit/2d65a573684fed507cfb7397f73ef22b9d9e8f94)) +* **api:** manual updates ([bfc46ad](https://github.com/imagekit-developer/imagekit-php/commit/bfc46add70562512b60928554638368443b6e38c)) +* **api:** manual updates ([46dbc22](https://github.com/imagekit-developer/imagekit-php/commit/46dbc22461339a6be4f275f57b4f74a6fc2e4625)) +* **api:** manual updates ([e5c1428](https://github.com/imagekit-developer/imagekit-php/commit/e5c142868fae36f9f88f4142b98b47a1abbbaa1c)) +* **api:** manual updates ([2361086](https://github.com/imagekit-developer/imagekit-php/commit/2361086b4a3578fc04ac20da138d1ebcf3f92852)) +* **api:** manual updates ([de13f68](https://github.com/imagekit-developer/imagekit-php/commit/de13f687044f442b41ec1de7a72c2fd3ad27f1e1)) +* **api:** manual updates ([79f9906](https://github.com/imagekit-developer/imagekit-php/commit/79f9906770fee9602f9b1ed6397b5b00f015bcd2)) +* **api:** manual updates ([0daa175](https://github.com/imagekit-developer/imagekit-php/commit/0daa17580a73ebd447e344f01fa36f1fb593dd4d)) +* **api:** manual updates ([6ec4a94](https://github.com/imagekit-developer/imagekit-php/commit/6ec4a94508922f91f34d9b58226e047de6c40399)) +* **api:** manual updates ([2ebe4bf](https://github.com/imagekit-developer/imagekit-php/commit/2ebe4bffb958f8cd8c923b285bdb79b4d93ea755)) +* **api:** manual updates ([8aecc6e](https://github.com/imagekit-developer/imagekit-php/commit/8aecc6ee1d42589a554687c3a8138ff764ba223f)) +* **api:** manual updates ([3ac5bb6](https://github.com/imagekit-developer/imagekit-php/commit/3ac5bb60ab1b828c27a17e8d499309c1ac077dd9)) +* **api:** manual updates ([864a1aa](https://github.com/imagekit-developer/imagekit-php/commit/864a1aa121d394cbc89a9b305d03177777fe173e)) +* **api:** merge with main to bring back missing parameters ([313dcf4](https://github.com/imagekit-developer/imagekit-php/commit/313dcf40608dae77f12045de3e77878b33edd638)) +* **api:** remove Stainless attribution from readme ([a6f01f0](https://github.com/imagekit-developer/imagekit-php/commit/a6f01f0756a28bb4deafc5f65480aad544c12947)) +* **api:** revert dpr breaking change ([b97b7d6](https://github.com/imagekit-developer/imagekit-php/commit/b97b7d6717de6ffcd76dff3d159081f7bfd31360)) +* **api:** update api docs link ([aff2c75](https://github.com/imagekit-developer/imagekit-php/commit/aff2c753975007fed90c0400fef40c50a42d5587)) +* **api:** Update env var name ([a3edfdd](https://github.com/imagekit-developer/imagekit-php/commit/a3edfdd78c4a8aa37d18c74d0adade953a63d834)) +* **api:** update package names for Python and PHP targets in configuration ([264d6cf](https://github.com/imagekit-developer/imagekit-php/commit/264d6cf84f2853f08a2457d22b9aade5e7c6d375)) +* **api:** update webhook event names and remove DAM prefix ([e53bd51](https://github.com/imagekit-developer/imagekit-php/commit/e53bd5165e47bbe6d15413fa34120947afa3b28c)) +* **api:** updated docs ([8970696](https://github.com/imagekit-developer/imagekit-php/commit/8970696de6da93147e3e9cacc7e80a59dadaa5f3)) +* **client:** add raw methods ([049e837](https://github.com/imagekit-developer/imagekit-php/commit/049e837e2827e68c6cada81e7e35e3ddef23beb9)) +* **client:** redesign methods ([bf6c4d6](https://github.com/imagekit-developer/imagekit-php/commit/bf6c4d658f92eb53b032dafe0c3569cb4e8a0c2a)) +* **client:** support raw responses ([cc5397d](https://github.com/imagekit-developer/imagekit-php/commit/cc5397ddbb7a5a58b22f25037a76cc502a972692)) +* **client:** use real enums ([0b65863](https://github.com/imagekit-developer/imagekit-php/commit/0b65863c45d58bf52bca76cfa8f7560e381d7dc9)) +* expose services and service contracts ([1329184](https://github.com/imagekit-developer/imagekit-php/commit/13291847d68a49a7468bf64dac797124ad8b2178)) +* improve identifier renaming for names that clash with builtins ([629e73b](https://github.com/imagekit-developer/imagekit-php/commit/629e73bd717a76d55f745a1b25dcec1e38d692d6)) +* improved phpstan type annotations ([29c5644](https://github.com/imagekit-developer/imagekit-php/commit/29c564459ff158230f1efcfd80115ff911022c86)) +* remove confusing `toArray()` alias to `__serialize()` in favour of `toProperties()` ([6b0dfb3](https://github.com/imagekit-developer/imagekit-php/commit/6b0dfb31fc142c9c34f061ba48f469973ade55a3)) +* replace special flag type `omittable` with just `null` ([37f7fda](https://github.com/imagekit-developer/imagekit-php/commit/37f7fdabd844ff3bef85aae719b02ded1da5aadf)) +* simplify and make the phpstan types more consistent ([a48eabf](https://github.com/imagekit-developer/imagekit-php/commit/a48eabf27bc0717621987efcace7886a9611e10b)) +* split out services into normal & raw types ([72581b3](https://github.com/imagekit-developer/imagekit-php/commit/72581b38ac28d0bc43aa76e0df66a66a53c744e5)) +* support setting headers via env ([ca265ee](https://github.com/imagekit-developer/imagekit-php/commit/ca265eedd4fdf0c13f8dc90525ff1c28845fcc5e)) +* support unwrapping envelopes ([387f46c](https://github.com/imagekit-developer/imagekit-php/commit/387f46c0d4956e0df99308f0c407c17bc23970ae)) +* use `$_ENV` aware getenv helper ([ad42299](https://github.com/imagekit-developer/imagekit-php/commit/ad42299eeecb6784d17adf834fa522d03a62d801)) +* use aliases for phpstan types ([b7e0d88](https://github.com/imagekit-developer/imagekit-php/commit/b7e0d887e721da064ebce2d8f4319af258170d5e)) +* use camel casing for all class properties ([64f685c](https://github.com/imagekit-developer/imagekit-php/commit/64f685c64536578e988e610150d2b85a7d28529d)) + + +### Bug Fixes + +* a number of serialization errors ([328063f](https://github.com/imagekit-developer/imagekit-php/commit/328063f0ab0c9604527c9adb1dc5015778e52de1)) +* add ai-tasks property to response schemas with enum values ([4694d71](https://github.com/imagekit-developer/imagekit-php/commit/4694d7135602bdbac9d7ad210f4bba10fa5a3693)) +* **api:** add missing embeddedMetadata and video properties to FileDetails ([d42768b](https://github.com/imagekit-developer/imagekit-php/commit/d42768bef461fd55c7e45213518caadadbc77c4c)) +* **api:** extract shared schemas to prevent Go webhook union breaking changes ([68c5081](https://github.com/imagekit-developer/imagekit-php/commit/68c5081d55cfcfe59a960e12e8c2c5fec62d3183)) +* **api:** rename DamFile events to File for consistency ([3841282](https://github.com/imagekit-developer/imagekit-php/commit/3841282a5cfb0001a4674247a54cfd6fea359f9b)) +* **ci:** release doctor workflow ([5a4ecfc](https://github.com/imagekit-developer/imagekit-php/commit/5a4ecfc9579954ed381c99fe5cba7d1cca3e8520)) +* **client:** elide client methods in docs ([d3e94af](https://github.com/imagekit-developer/imagekit-php/commit/d3e94af126fa9bf00a0a704aa9fbc8e37125447a)) +* **client:** handle C-style escaped characters ([497b114](https://github.com/imagekit-developer/imagekit-php/commit/497b114e1861becb85e3e6682ae6421a1a607857)) +* **client:** properly generate file params ([60d37dc](https://github.com/imagekit-developer/imagekit-php/commit/60d37dc437cbdf8cead0be7cc62072975400605b)) +* **client:** properly import fully qualified names ([2da9342](https://github.com/imagekit-developer/imagekit-php/commit/2da9342a698593e82e15db1b8966b888684a862e)) +* **client:** resolve serialization issue with unions and enums ([ab78911](https://github.com/imagekit-developer/imagekit-php/commit/ab78911fb20ccaedcf28d7facf05a93d8633d624)) +* correctly serialize dates ([cfc1686](https://github.com/imagekit-developer/imagekit-php/commit/cfc16863ed169c087bd75f0b9a66715aab8aa80f)) +* decorate with enum label for all enum classes ([c3ea060](https://github.com/imagekit-developer/imagekit-php/commit/c3ea060ee47054167b8db064d3b423065fb106c1)) +* guzzle requires special handling to enable streaming ([b0f95d6](https://github.com/imagekit-developer/imagekit-php/commit/b0f95d62d3af6efd2f78e2a63f52a2f4df65c36b)) +* inverted retry condition ([493710d](https://github.com/imagekit-developer/imagekit-php/commit/493710dc24182fc6c2162a9554e45402ab43a2f7)) +* **php:** fix typo in options parsing ([2809bb4](https://github.com/imagekit-developer/imagekit-php/commit/2809bb451cd619af703ec50d29eba0b1a19371cf)) +* phpStan linter errors ([4cb4ba0](https://github.com/imagekit-developer/imagekit-php/commit/4cb4ba01a9054a10d74cad43d64228f685bfde2e)) +* populate enum-typed properties with enum instances ([9c715d0](https://github.com/imagekit-developer/imagekit-php/commit/9c715d0280fbb44b77db3fc1338ab13959c57378)) +* remove unused webhook params ([0aea279](https://github.com/imagekit-developer/imagekit-php/commit/0aea279726fe6954cfdfc84c121e45ce9342f7b4)) +* rename invalid types ([59bcbf0](https://github.com/imagekit-developer/imagekit-php/commit/59bcbf0d82436725efb8f63c405a088ab92b10c2)) +* revert accidental code deletion ([7649278](https://github.com/imagekit-developer/imagekit-php/commit/7649278a7a6c5e74a7f58e1743c1843f3f1f1f47)) +* revert enum parsing change that lead to unconditional failure ([cc2e7bd](https://github.com/imagekit-developer/imagekit-php/commit/cc2e7bd5a1919234353281c80c75e4049ab4b894)) +* support arrays in query param construction ([6f1f9dd](https://github.com/imagekit-developer/imagekit-php/commit/6f1f9dd3d46c7122dd103a6d721e51c20066a142)) +* typos in README.md ([d731ff1](https://github.com/imagekit-developer/imagekit-php/commit/d731ff1d6f21a3ac47c758e87e8219664962f1fb)) +* used redirect count instead of retry count in base client ([c8864b8](https://github.com/imagekit-developer/imagekit-php/commit/c8864b87a493e4d51647f4efc6ae5320102d955d)) +* vocab field is required ([a1f0a2c](https://github.com/imagekit-developer/imagekit-php/commit/a1f0a2c5c1867b9b6101d39eea7e8b70d32e34b9)) + + +### Chores + +* add git attributes and composer lock file ([40f7b97](https://github.com/imagekit-developer/imagekit-php/commit/40f7b97fa95c8c82feb267e006872c5107a0a26c)) +* add license ([c0f6216](https://github.com/imagekit-developer/imagekit-php/commit/c0f621686ed7fc92fd4618393bbdc4ad7bea8a91)) +* be more targeted in suppressing superfluous linter warnings ([577f528](https://github.com/imagekit-developer/imagekit-php/commit/577f5285b139a39f605dc3e38773eb0ecf5bbef5)) +* better support for phpstan ([574a0bb](https://github.com/imagekit-developer/imagekit-php/commit/574a0bbda02bdae57ec2a5655aee2f1264d8a1c3)) +* client instantiation refactor ([8341019](https://github.com/imagekit-developer/imagekit-php/commit/834101926d2a3ad566a8c3880e1a5a0dffde9f63)) +* **client:** refactor error type constructors ([cecffe1](https://github.com/imagekit-developer/imagekit-php/commit/cecffe1980bb81dedee05968b8046c95c4db02d1)) +* **client:** send metadata headers ([130ede9](https://github.com/imagekit-developer/imagekit-php/commit/130ede91a7873981a7696eb90b70c1e1780c8215)) +* **docs:** update readme formatting ([2831746](https://github.com/imagekit-developer/imagekit-php/commit/283174604767a8fe614ca521462f691572a695a4)) +* document parameter object usage ([c959bcf](https://github.com/imagekit-developer/imagekit-php/commit/c959bcf6d18e0f078fbed9d50c05d6feb1d81a42)) +* ensure constant values are marked as optional in array types ([59bab21](https://github.com/imagekit-developer/imagekit-php/commit/59bab215c6165b2290ca08bb3aee44d16721a308)) +* fix lints in UnionOf ([a57c7cc](https://github.com/imagekit-developer/imagekit-php/commit/a57c7cc9f5131daea2a45d261b414a3deed3adba)) +* formatting ([a11b751](https://github.com/imagekit-developer/imagekit-php/commit/a11b7519be814fe8955f2a3d564b342572883cf2)) +* **internal:** add a basic client test ([2994f2d](https://github.com/imagekit-developer/imagekit-php/commit/2994f2d6f65889a67ceccfb274944b517f86793f)) +* **internal:** codegen related update ([32cccc6](https://github.com/imagekit-developer/imagekit-php/commit/32cccc6bf639fb685938afb689b46f5b65106c12)) +* **internal:** codegen related update ([65b995a](https://github.com/imagekit-developer/imagekit-php/commit/65b995aa83c6cf09fa55f784cf06fd3c8f95c0ff)) +* **internal:** codegen related update ([cc9408e](https://github.com/imagekit-developer/imagekit-php/commit/cc9408e49527807fd3a91d07c226d380b52247de)) +* **internal:** codegen related update ([87b1637](https://github.com/imagekit-developer/imagekit-php/commit/87b1637ba7e0943ebd19f65cbadd9857cc6deb80)) +* **internal:** codegen related update ([0215531](https://github.com/imagekit-developer/imagekit-php/commit/0215531088e798a7ffbb41fc92afdba93e615305)) +* **internal:** codegen related update ([c91e314](https://github.com/imagekit-developer/imagekit-php/commit/c91e31405811b0ec13c47d6640c80e4ac988bca4)) +* **internal:** codegen related update ([ce694ee](https://github.com/imagekit-developer/imagekit-php/commit/ce694eea2c03e9b50fb0055980a7789fd2fdaf63)) +* **internal:** codegen related update ([10d85fa](https://github.com/imagekit-developer/imagekit-php/commit/10d85fa72d5cf2e3025f7fafd495f651372ccaa0)) +* **internal:** codegen related update ([e896f2b](https://github.com/imagekit-developer/imagekit-php/commit/e896f2bf3e12423cec0f242ab9c19eb268fd3b87)) +* **internal:** codegen related update ([7d97124](https://github.com/imagekit-developer/imagekit-php/commit/7d97124eff55d2d54e6b1877174bc2eb7206665c)) +* **internal:** codegen related update ([65e8d5f](https://github.com/imagekit-developer/imagekit-php/commit/65e8d5ff7c465323eb396caaab93870c09f94e84)) +* **internal:** codegen related update ([8cce69f](https://github.com/imagekit-developer/imagekit-php/commit/8cce69f9353760cd01788b3ae56718dbdbddc540)) +* **internal:** codegen related update ([cd71972](https://github.com/imagekit-developer/imagekit-php/commit/cd71972213770889ed4417a69849a9c4504b5d00)) +* **internal:** codegen related update ([cf2eb10](https://github.com/imagekit-developer/imagekit-php/commit/cf2eb10b550e628dcd50528ea1ba6d18aba812f3)) +* **internal:** codegen related update ([bde112f](https://github.com/imagekit-developer/imagekit-php/commit/bde112f4d3a020051e13c581c3ff7bc89f7b27a9)) +* **internal:** codegen related update ([76b7d1a](https://github.com/imagekit-developer/imagekit-php/commit/76b7d1a3bec0ff36b996eceb7af07a54f4a8439a)) +* **internal:** ignore stainless-internal artifacts ([8e06db7](https://github.com/imagekit-developer/imagekit-php/commit/8e06db7959b044ab844db8eb2ca530740f01b084)) +* **internal:** minor test script reformatting ([4572ac9](https://github.com/imagekit-developer/imagekit-php/commit/4572ac94b4784db86b2fe41e4458e73d1c6e98e8)) +* **internal:** php cs fixer should not be memory limited ([ffce92f](https://github.com/imagekit-developer/imagekit-php/commit/ffce92feb7a761600be48db66c357ac4be6a27b4)) +* **internal:** refactor auth by moving concern from base client into client ([a29d53f](https://github.com/imagekit-developer/imagekit-php/commit/a29d53f233f62dfccfa69e7487fdf8bc79f19d57)) +* **internal:** refactor base client internals ([aba7242](https://github.com/imagekit-developer/imagekit-php/commit/aba7242684bdef5c8926ef4f1e7b0909650cbf17)) +* **internal:** remove mock server code ([bc5a3ed](https://github.com/imagekit-developer/imagekit-php/commit/bc5a3ed131b03c042fa8020f0b85d8d0ab70546a)) +* **internal:** restructure some imports ([9a9fe93](https://github.com/imagekit-developer/imagekit-php/commit/9a9fe9357a5a0a614bd2f546a4606698cb289a8f)) +* **internal:** tweak CI branches ([df01794](https://github.com/imagekit-developer/imagekit-php/commit/df01794af8a40d7154495cdc1c33cb51c3875cf2)) +* **internal:** update `actions/checkout` version ([a086098](https://github.com/imagekit-developer/imagekit-php/commit/a08609804375fcbb528ca08b82cf935d7f6dddf5)) +* **internal:** update phpstan comments ([5b9a607](https://github.com/imagekit-developer/imagekit-php/commit/5b9a60764c121078ddebc742a9f1787b8d5dac1a)) +* **internal:** upgrade phpunit ([ac20448](https://github.com/imagekit-developer/imagekit-php/commit/ac20448a0f856ea1afa12b120dd59d3d33384cfc)) +* none ([a29b310](https://github.com/imagekit-developer/imagekit-php/commit/a29b310c8c6d916ecb9098e81ab4c1f29034e506)) +* **readme:** remove beta warning now that we're in ga ([1c52ed5](https://github.com/imagekit-developer/imagekit-php/commit/1c52ed5f2b1cadca880e71230a475077e9fc749a)) +* refactor methods ([759837c](https://github.com/imagekit-developer/imagekit-php/commit/759837c405f3861d56b463b84e2344cf0a3a82f7)) +* switch from `#[Api(optional: true|false)]` to `#[Required]|#[Optional]` for annotations ([229f706](https://github.com/imagekit-developer/imagekit-php/commit/229f706c0368dbbd51cf56a683eba73c301c1b89)) +* sync repo ([bb14ef3](https://github.com/imagekit-developer/imagekit-php/commit/bb14ef396deb2b1bccc1e8d80da4bd47e3a04427)) +* typing updates ([4208922](https://github.com/imagekit-developer/imagekit-php/commit/420892242261f1a4e5099a1dbfe7bd2705ce88c5)) +* update mock server docs ([d02f1aa](https://github.com/imagekit-developer/imagekit-php/commit/d02f1aa5f9b7dbe551ae0822943ea38c0622a825)) +* update SDK settings ([6913a6d](https://github.com/imagekit-developer/imagekit-php/commit/6913a6de33f625b50dc0aa5881e1208e136c8b2a)) +* use `$self = clone $this;` instead of `$obj = clone $this;` ([1baa8c0](https://github.com/imagekit-developer/imagekit-php/commit/1baa8c086edb663887b7a8ffe7975e5c1e96b203)) +* use non-trivial test assertions ([bcbfa80](https://github.com/imagekit-developer/imagekit-php/commit/bcbfa809e6b7e3f995cd8cddf8b55da68a89bedf)) +* use pascal case for phpstan typedefs ([8d8f4fc](https://github.com/imagekit-developer/imagekit-php/commit/8d8f4fcc8d20dd6ccdb4825f438e14ec71bb4600)) +* use single quote strings ([2a67006](https://github.com/imagekit-developer/imagekit-php/commit/2a67006f8a94fec12ca7d862cd6340d6a1b39f4e)) + + +### Documentation + +* correct typo in default value description for custom metadata field ([d0d0590](https://github.com/imagekit-developer/imagekit-php/commit/d0d0590988600c967eb2d54f0bf3c06868dc6942)) +* improve examples ([333a5f5](https://github.com/imagekit-developer/imagekit-php/commit/333a5f51772b14a4e82ee4504f32f21fec6c4863)) + + +### Refactors + +* AITags to singular AITag schema with array items pattern ([15d5ae5](https://github.com/imagekit-developer/imagekit-php/commit/15d5ae51731a0f47527aeb3643b2cf75cc69151c)) + + +### Build System + +* **php:** set production target ([04e6535](https://github.com/imagekit-developer/imagekit-php/commit/04e65354ac22903e38ca02a0e4d95207bdaf9ce0)) diff --git a/README.md b/README.md index ea9290f5..38e5e4aa 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ The REST API documentation can be found on [imagekit.io](https://imagekit.io/doc ``` -composer require "imagekit/imagekit 0.0.1" +composer require "imagekit/imagekit 0.1.0" ``` diff --git a/src/Version.php b/src/Version.php index ab74436c..67b0b2c7 100644 --- a/src/Version.php +++ b/src/Version.php @@ -5,5 +5,5 @@ namespace ImageKit; // x-release-please-start-version -const VERSION = '0.0.1'; +const VERSION = '0.1.0'; // x-release-please-end