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/release-doctor.yml b/.github/workflows/release-doctor.yml
new file mode 100644
index 00000000..6619e3f0
--- /dev/null
+++ b/.github/workflows/release-doctor.yml
@@ -0,0 +1,19 @@
+name: Release Doctor
+on:
+ pull_request:
+ branches:
+ - master
+ 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')
+
+ steps:
+ - uses: actions/checkout@v4
+
+ - name: Check release environment
+ run: |
+ bash ./bin/check-release-environment
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..c7159c1a
--- /dev/null
+++ b/.release-please-manifest.json
@@ -0,0 +1,3 @@
+{
+ ".": "0.0.2"
+}
\ No newline at end of file
diff --git a/.stats.yml b/.stats.yml
new file mode 100644
index 00000000..b0086e96
--- /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-bc7c0d27962b30c19c778656988e154b54696819389289f34420a5e5fdfbd3b8.yml
+openapi_spec_hash: 1bfde02a63416c036e9545927f727459
+config_hash: b415c06a3b29485af4601beb94ae1aeb
diff --git a/CHANGELOG.md b/CHANGELOG.md
new file mode 100644
index 00000000..7e6f5900
--- /dev/null
+++ b/CHANGELOG.md
@@ -0,0 +1,46 @@
+# Changelog
+
+## 0.0.2 (2025-09-06)
+
+Full Changelog: [v0.0.1...v0.0.2](https://github.com/imagekit-developer/imagekit-php/compare/v0.0.1...v0.0.2)
+
+### ⚠ BREAKING CHANGES
+
+* expose services and service contracts
+
+### Features
+
+* **api:** add BaseWebhookEvent ([84f5b7c](https://github.com/imagekit-developer/imagekit-php/commit/84f5b7c65eb1b7b23fdda823aca71c51b73023e3))
+* **api:** extract UpdateFileDetailsRequest to model ([8628e12](https://github.com/imagekit-developer/imagekit-php/commit/8628e12e2bdb99f3755bb1ea960547876fcccf00))
+* **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))
+* expose services and service contracts ([1329184](https://github.com/imagekit-developer/imagekit-php/commit/13291847d68a49a7468bf64dac797124ad8b2178))
+
+
+### Bug Fixes
+
+* decorate with enum label for all enum classes ([c3ea060](https://github.com/imagekit-developer/imagekit-php/commit/c3ea060ee47054167b8db064d3b423065fb106c1))
+* filter logic for setting data in GuzzleHttpWrapper ([4f510b9](https://github.com/imagekit-developer/imagekit-php/commit/4f510b938073ea4bf0f6d867a3cf9170be6cc246))
+* remove uniqueFileName & isPrivate hardcoding from GuzzleHttpWrapper getMultipartData fn ([11aff51](https://github.com/imagekit-developer/imagekit-php/commit/11aff51f80a751c8393d3b0983d91ff3b816dc84))
+* update sdk-version url generation param to ik-sdk-version ([9e2eae6](https://github.com/imagekit-developer/imagekit-php/commit/9e2eae65570d569aa8776cc46aec1588beeee596))
+
+
+### Chores
+
+* document parameter object usage ([c959bcf](https://github.com/imagekit-developer/imagekit-php/commit/c959bcf6d18e0f078fbed9d50c05d6feb1d81a42))
+* **internal:** codegen related update ([76b7d1a](https://github.com/imagekit-developer/imagekit-php/commit/76b7d1a3bec0ff36b996eceb7af07a54f4a8439a))
+* **internal:** refactor base client internals ([aba7242](https://github.com/imagekit-developer/imagekit-php/commit/aba7242684bdef5c8926ef4f1e7b0909650cbf17))
+* sync repo ([bb14ef3](https://github.com/imagekit-developer/imagekit-php/commit/bb14ef396deb2b1bccc1e8d80da4bd47e3a04427))
+* update dependencies to replace guzzlehttp/streams with guzzle/Psr7 ([ddc07e9](https://github.com/imagekit-developer/imagekit-php/commit/ddc07e9ee94541a7c0c28ac1cfe7980ec5045784))
+* update documentation ([523ee0d](https://github.com/imagekit-developer/imagekit-php/commit/523ee0d463756aa534a6fa0daa315f9fab297800))
+* update documentation for running test cases ([6f7810e](https://github.com/imagekit-developer/imagekit-php/commit/6f7810eb81ba91679ff8aa62ab41395a50793f4d))
+* update SDK settings ([6913a6d](https://github.com/imagekit-developer/imagekit-php/commit/6913a6de33f625b50dc0aa5881e1208e136c8b2a))
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..0325e391 100644
--- a/README.md
+++ b/README.md
@@ -1,1238 +1,191 @@
-# PHP SDK for ImageKit
+# Image Kit PHP API library
-[](https://packagist.org/packages/imagekit/imagekit) [](https://packagist.org/packages/imagekit/imagekit) [](https://opensource.org/licenses/MIT) [](https://codecov.io/gh/imagekit-developer/imagekit-php) [](https://twitter.com/ImagekitIo)
-[](https://github.com/imagekit-developer/imagekit-php/actions/workflows/test.yml) [](https://github.com/imagekit-developer/imagekit-php/actions/workflows/coverage.yml) [](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/imagekit-developer/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`
+To use this package, install via Composer by adding the following to your application's `composer.json`:
-## 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)
+
```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:imagekit-developer/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
-```
+## Usage
-### 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.
+This library uses named parameters to specify optional arguments.
+Parameters with a default value must be set by name.
-#### 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
+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-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
+var_dump($response->videoCodec);
```
-#### Image as overlays
+### Value Objects
-You can add an image over a base video or image using an image layer (l-image).
+It is recommended to use the static `with` constructor `Dog::with(name: "Joey")`
+and named parameters to initialize value objects.
-For example:
+However, builders are also provided `(new Dog)->withName("Joey")`.
-```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
-```
-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
+### Handling errors
-You can add solid color blocks over a base video or image using an image layer (l-image).
-
-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' => '/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
-```
+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` |
-
-
-## Server-side File Upload
-
-The SDK provides a simple interface using the `$imageKit->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,
- // ]
-]);
-```
-
-## File Management
-
-The SDK provides a simple interface for all the following [Media APIs](https://docs.imagekit.io/api-reference/media-api) to manage your files.
-
-### 1. List and Search Files
-
-This API can list all the uploaded files and folders in your [ImageKit.io](https://docs.imagekit.io/api-reference/media-api) media library.
-
-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**.
-
-#### Example
-```php
-$listFiles = $imageKit->listFiles();
-```
-#### Applying Filters
-Filter out the files with an object specifying the parameters.
-
-```php
-$listFiles = $imageKit->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`.
+Error codes are as follows:
-```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).
-
-### 2. Get File Details
-
-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');
-```
-
-### 3. Get File Version Details
-
-This API can get you all the details and attributes for the provided version of the file.
+| 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` |
-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');
-```
+### Retries
-### 5. Update File Details
+Certain errors will be automatically retried 2 times by default, with a short exponential backoff.
-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.
+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 [update file details API](https://docs.imagekit.io/api-reference/media-api/update-file-details) for better understanding about the **request & response structure**.
+You can use the `maxRetries` option to configure or disable this:
-#### 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,
- // ]
-];
+updateFileDetails(
- 'file_id',
- $updateData
-);
-```
+use ImageKit\Client;
+use ImageKit\RequestOptions;
-**Update publish status**
+// Configure the default for all requests:
+$client = new Client(maxRetries: 0);
-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`.
+// Or, configure per-request:
-#### 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
-
-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.
+## Advanced concepts
-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**.
+### Making custom or undocumented requests
-#### Example
-```php
-$fileIds = ['file_id1','file_id2'];
-$tags = ['image_tag_1', 'image_tag_2'];
-
-$bulkAddTags = $imageKit->bulkAddTags($fileIds, $tags);
-```
+#### Undocumented properties
-### 7. Remove Tags (Bulk) API
+You can send undocumented parameters to any endpoint, and read undocumented response properties, like so:
-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.
+Note: the `extra*` parameters of the same name overrides the documented parameters.
-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**.
-
-#### 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);
-```
-
-### 9. Delete File API
+ 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/imagekit-developer/imagekit-php/tree/master/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..cf571b62
--- /dev/null
+++ b/bin/check-release-environment
@@ -0,0 +1,25 @@
+#!/usr/bin/env bash
+
+errors=()
+
+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 @@
-uploadFile([
- '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 44283cdf..00000000
Binary files a/sample/upload_api/sample_image.jpeg and /dev/null differ
diff --git a/sample/url_generation/chained_transformations.php b/sample/url_generation/chained_transformations.php
deleted file mode 100644
index 6b3bd330..00000000
--- a/sample/url_generation/chained_transformations.php
+++ /dev/null
@@ -1,54 +0,0 @@
-url(
- [
- '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..ea0572c7
--- /dev/null
+++ b/src/Accounts/Origins/OriginCreateParams.php
@@ -0,0 +1,466 @@
+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{
+ * 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
+{
+ /** @use SdkModel */
+ 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;
+
+ /**
+ * Akeneo API client ID.
+ */
+ #[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(
+ * accessKey: ...,
+ * bucket: ...,
+ * name: ...,
+ * secretKey: ...,
+ * endpoint: ...,
+ * baseURL: ...,
+ * clientEmail: ...,
+ * privateKey: ...,
+ * accountName: ...,
+ * container: ...,
+ * sasToken: ...,
+ * clientID: ...,
+ * clientSecret: ...,
+ * password: ...,
+ * username: ...,
+ * )
+ * ```
+ *
+ * Otherwise ensure the following setters are called
+ *
+ * ```
+ * (new OriginCreateParams)
+ * ->withAccessKey(...)
+ * ->withBucket(...)
+ * ->withName(...)
+ * ->withSecretKey(...)
+ * ->withEndpoint(...)
+ * ->withBaseURL(...)
+ * ->withClientEmail(...)
+ * ->withPrivateKey(...)
+ * ->withAccountName(...)
+ * ->withContainer(...)
+ * ->withSasToken(...)
+ * ->withClientID(...)
+ * ->withClientSecret(...)
+ * ->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 $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->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;
+ }
+
+ /**
+ * 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;
+ }
+
+ /**
+ * 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/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..2ce8e6c0
--- /dev/null
+++ b/src/Accounts/Origins/OriginUpdateParams.php
@@ -0,0 +1,466 @@
+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{
+ * 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
+{
+ /** @use SdkModel */
+ 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;
+
+ /**
+ * Akeneo API client ID.
+ */
+ #[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(
+ * accessKey: ...,
+ * bucket: ...,
+ * name: ...,
+ * secretKey: ...,
+ * endpoint: ...,
+ * baseURL: ...,
+ * clientEmail: ...,
+ * privateKey: ...,
+ * accountName: ...,
+ * container: ...,
+ * sasToken: ...,
+ * clientID: ...,
+ * clientSecret: ...,
+ * password: ...,
+ * username: ...,
+ * )
+ * ```
+ *
+ * Otherwise ensure the following setters are called
+ *
+ * ```
+ * (new OriginUpdateParams)
+ * ->withAccessKey(...)
+ * ->withBucket(...)
+ * ->withName(...)
+ * ->withSecretKey(...)
+ * ->withEndpoint(...)
+ * ->withBaseURL(...)
+ * ->withClientEmail(...)
+ * ->withPrivateKey(...)
+ * ->withAccountName(...)
+ * ->withContainer(...)
+ * ->withSasToken(...)
+ * ->withClientID(...)
+ * ->withClientSecret(...)
+ * ->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 $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->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;
+ }
+
+ /**
+ * 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;
+ }
+
+ /**
+ * 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/URLEndpoints/URLEndpointCreateParams.php b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php
new file mode 100644
index 00000000..050e4196
--- /dev/null
+++ b/src/Accounts/URLEndpoints/URLEndpointCreateParams.php
@@ -0,0 +1,160 @@
+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{
+ * 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..7bcaea5c
--- /dev/null
+++ b/src/Accounts/URLEndpoints/URLEndpointUpdateParams.php
@@ -0,0 +1,160 @@
+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{
+ * 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..ebd52bda
--- /dev/null
+++ b/src/Accounts/Usage/UsageGetParams.php
@@ -0,0 +1,107 @@
+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{
+ * 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..f788cfbd
--- /dev/null
+++ b/src/Assets/AssetListParams.php
@@ -0,0 +1,253 @@
+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{
+ * 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..d9c0c919
--- /dev/null
+++ b/src/Beta/V2/Files/FileUploadParams.php
@@ -0,0 +1,582 @@
+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.
+ *
+ * **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.
+ *
+ * @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{
+ * 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 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;
+
+ /**
+ * 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 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;
+ }
+
+ /**
+ * 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/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..881250e3
--- /dev/null
+++ b/src/Cache/Invalidation/InvalidationCreateParams.php
@@ -0,0 +1,85 @@
+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}
+ */
+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..9cdd9aa3
--- /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..f3229494
--- /dev/null
+++ b/src/Core/BaseClient.php
@@ -0,0 +1,288 @@
+,
+ * 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(!is_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(!is_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 APIConnectionException($req, message: 'Redirection without Location header');
+ }
+
+ $uri = Util::joinUri($req->getUri(), path: $location);
+
+ 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
+ *
+ * @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 = 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 APIConnectionException($req, message: 'Maximum redirects exceeded');
+ }
+
+ $req = $this->followRedirect($rsp, req: $req);
+
+ return $this->sendRequest($opts, req: $req, data: $data, retryCount: $retryCount, redirectCount: ++$redirectCount);
+ }
+
+ 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;
+ }
+
+ $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);
+ }
+
+ 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..35f52cf4
--- /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;
+
+ 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 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
+ */
+ 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 @@
+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{
+ * 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..852c124a
--- /dev/null
+++ b/src/CustomMetadataFields/CustomMetadataFieldListParams.php
@@ -0,0 +1,71 @@
+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}
+ */
+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..0d72504d
--- /dev/null
+++ b/src/CustomMetadataFields/CustomMetadataFieldUpdateParams.php
@@ -0,0 +1,94 @@
+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{
+ * 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/ExtensionItem.php b/src/ExtensionItem.php
new file mode 100644
index 00000000..3583b8d4
--- /dev/null
+++ b/src/ExtensionItem.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/ExtensionItem/AIAutoDescription.php b/src/ExtensionItem/AIAutoDescription.php
new file mode 100644
index 00000000..3cd6fa98
--- /dev/null
+++ b/src/ExtensionItem/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/ExtensionItem/AutoTaggingExtension.php b/src/ExtensionItem/AutoTaggingExtension.php
new file mode 100644
index 00000000..262f220b
--- /dev/null
+++ b/src/ExtensionItem/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/ExtensionItem/AutoTaggingExtension/Name.php b/src/ExtensionItem/AutoTaggingExtension/Name.php
new file mode 100644
index 00000000..7289da91
--- /dev/null
+++ b/src/ExtensionItem/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/ExtensionItem/RemoveBg/Options.php b/src/ExtensionItem/RemoveBg/Options.php
new file mode 100644
index 00000000..093cf8a6
--- /dev/null
+++ b/src/ExtensionItem/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/Bulk/BulkAddTagsParams.php b/src/Files/Bulk/BulkAddTagsParams.php
new file mode 100644
index 00000000..6ce38baa
--- /dev/null
+++ b/src/Files/Bulk/BulkAddTagsParams.php
@@ -0,0 +1,116 @@
+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{
+ * 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..7898f84d
--- /dev/null
+++ b/src/Files/Bulk/BulkDeleteParams.php
@@ -0,0 +1,95 @@
+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}
+ */
+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..a5d9c1cb
--- /dev/null
+++ b/src/Files/Bulk/BulkRemoveAITagsParams.php
@@ -0,0 +1,116 @@
+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{
+ * 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..0f442e97
--- /dev/null
+++ b/src/Files/Bulk/BulkRemoveTagsParams.php
@@ -0,0 +1,116 @@
+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{
+ * 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